Skip to content

PRD 4173 M5: the board and issue writes on YouTrack - #23

Merged
MirceaTufanDev merged 32 commits into
prd/ws-2from
agent/issue-22
Nov 19, 2026
Merged

MirceaTufanDev merged 32 commits into
prd/ws-2from
agent/issue-22

Conversation

@mirceatufan-uzi

@mirceatufan-uzi mirceatufan-uzi commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

This rework of the YouTrack-linked board stops automatic card moves from overwriting a resolution someone made in YouTrack. A move the cache shows as open is refused with a 409 and the card snaps back, and an explicit reopen from the Closed lane is the path that may write over a resolution. The branch also adds tests and corrects the PRD, ADR and changelog wording.

Size: 118 files

Category Added Deleted
Code +2,151 −258
Tests +5,494 −179
Docs +52 −9
Generated +273 −36
Total +7,970 −482

What changed

  • A column move on a YouTrack-linked repo is refused when YouTrack already shows the issue resolved, so a run or merge request change cannot write an open State over it.
  • A board drag that hits this refusal answers 409 and the card returns to its old column. A drag to Closed still closes the issue.
  • The merge request watch records a linked merge request's state without moving the card when the move is refused or the issue is resolved.
  • Reopening a linked issue from the Closed lane writes the State and cached column together, and the cache changes only after the tracker accepts the write.
  • New LiveDB tests check that untagged issues stay off the board after a sync and that chat and scheduled proposals create issues in the YouTrack project.

Verification

Reported by the agent at 710b82b:

  • passed: GOGC=40 task check:api (at 558bb90 and at 5e794b1)
  • passed: go test -p 1 -count=1 -v -run 'LiveDB' ./internal/runlifecycle/... (postgres 17.12, after the merge; five linked_board tests PASS, 0 SKIP)
  • passed: go test -p 1 -count=1 -run 'Linked.*LiveDB|LiveDB.*Linked|MovedLinked' runlifecycle forgesvc handler workersvc schedsvc poller at 710b82b (162 PASS, 0 SKIP)
  • passed: tester mutation folds in scratch exports: resolved check, Reopen:true, lifecycle branch, MR-watch branch, handler 409 case; sync eligibility filter, LinkedLabels, proposal filing (all red)
  • passed: scripts/changelog-fragments.sh validate

Scope and review notes

  • Changed: A card the cache shows as open, but YouTrack has resolved, now answers 409 on a board drag until the next sync. Dragging it to Closed still closes it, per the plan's assumption.
  • Added: The merged run-now LiveDB test now seeds the eligibility tag that the linked sweep filters on.
  • Deferred: The resolved check and the write are two requests, so a resolution landing between them can still be overwritten. This is an accepted limit recorded in the Decision Log.
  • Deferred: Four non-blocking reviewer and fact-checker notes are deferred, including one dated Decision Log entry that still says bare 'tracker'.
  • Review: The resolved check and the reopen-only flag in the YouTrack state move path (moveToColumn in youtrack_state.go) together with reopenLinkedIssue in forgesvc/close_reopen.go decide which moves may wr…
  • Review: The 409 mapping in handler/issue_write_refusal.go (writeLinkedMoveError) and the board drag handler, which controls the card snap-back the description relies on.

Describes 710b82b against prd/ws-2.

Related to #22.

Closes #22

Internally reviewed by the repository's own agents, not uzi's built-in reviewer.


Opened by uzi from agent/issue-22. A human reviews and merges; uzi never merges.

uzi-agent and others added 25 commits November 17, 2026 17:25
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s (PRD 4173 M5 U1)

ClosableState allowlist with a live bundle check before every State write,
ErrColumnNotMapped/ErrStateNotAllowed, bounded ListStates, a bounded State
custom field on issue reads with ListIssuesWithState, and the CreateIssue
read-back failure as issue-not-found.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
localizedName only for non-ASCII names, State written by checked id,
custom fields only on the listing, state-machine fields read, maxItems
unchanged, issuetrackersvc test compares Options with DeepEqual.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
localizedName is display only; state names reject default-ignorable
fillers; the fake refuses a State write without an id.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…5 U1)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r (PRD 4173 M5 U2)

ColumnMove and MoveByLabels; the three forge drivers and AutoMove go
through it; the Recorder logs moves in Moves() and records the label
calls as before; contract case MoveToColumnMovesTheIssue on all four
real drivers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…(PRD 4173 M5 U2)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… M5 U3)

Migration 00468 adds repo_issue_tracker_states, repo_issue_tracker_column_states
and issues.issue_tracker_column. GET/PUT /api/repos/{id}/issue-tracker-link/states
validates against the project's States; ConfigureColumns on a linked repo writes
rows and prunes the mapping without EnsureLabels; the resolver passes the stored
mapping to the driver.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… (PRD 4173 M5 U3)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…173 M5 U3)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…(PRD 4173 M5 U3)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…l test (PRD 4173 M5 U3)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eld (PRD 4173 M5 U4a)

The guard lets MoveToColumn and SetIssueState through; the linked sync caches
each card's mapped column; the board reads it; a refused move is a 409 and the
card snaps back; a linked reopen is one MoveToColumn; the lifecycle keeps the
marker on a refused move and probes an uncached linked issue; origin_column
reads the cached column.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…M5 U4b)

The board-free MR-state lane reconciles a linked repo's issue-lane runs through
the board lane's edge switch. Only the issue's latest run moves the card. A
missing cached row or a refused move consumes the edge, so the MR state is
still recorded and the run is not polled forever.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…173 M5 U4a)

The Decision Log names ClearIssueTrackerColumnsNotIn as a writer of the cached
column and records the reconfigure race and the pre-M5 origin_column note.
Stale comments are corrected. New tests pin that SetIssueTrackerColumn leaves
labels and position alone, the direction of the State-to-column map, and the
probe with no eligibility tag name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… (PRD 4173 M5 U4b)

Only a real linked tracker moves a card from the board-free lane. With no
tracker, or the unavailable stand-in, the lane records the MR state as before
U4b. New tests pin the self_improve kind check and the poller wiring.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… 4173 M5 U4)

A failed database read of the repo's issue source no longer consumes a linked
MR close edge in the board-free lane: those candidates wait for the next tick.
Other unavailable causes still record the MR state without a move. A close or
Open move with no stored State gets its own 409 text. The Decision Log and SQL
comments now match what U4 does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… scope (PRD 4173 M5 U4)

A repo-source database error is transient and keeps its cause; a missing row
and a missing store are not. During a deferral, self_improve and issue-less
runs are still recorded. The transient-cause comment is corrected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…gibility tag (PRD 4173 M5 U5)

Every create site files into the linked YouTrack project, with the uzi label
rewritten to the stored eligibility tag and no autopilot label. The
self-improve tracking issue and proposals no longer skip a linked repo. Promote
adds the stored eligibility tag. Remove-label-on-dispatch never strips it, and
the write guard refuses any label write that would. Ensuring repo labels on a
linked repo is a 409.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d marking (PRD 4173 M5 U5)

The guard passes near-miss removals such as a different case or a longer name
through, and marks a not-found from CreateIssue and EnsureLabels. Comments now
match the lifted writes. The Decision Log records the uncertain finding-group
create, the duplicate risk of a create with no rollback, and the U5 tests
changed under the M5 test-change rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…RD 4173 M5 U6)

On a repo linked to YouTrack, the CI autofix start and halt comments, the MR
rework halt comment and the terminal comment now land on the linked issue, and
the PRD link patch rewrites its description. A failed comment is logged and the
run continues; a moved-away issue stays skippable. The write guard's only
remaining refusal is removing the eligibility tag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…est name (PRD 4173 M5 U6)

The write guard, issuesource sentinel and MR-watch skip comments now say every
write passes through except removing the eligibility tag. The CI autofix
failure test is named for what it proves, a logged failure from a stub.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… M5 U7)

The ADR records what M5 shipped on a repo linked to YouTrack, its new
invariants and the open questions for M6's live pass. The PRD ticks M5, and a
changelog fragment describes the user-visible change. A linked MR-watch test
uses a tagged switch, as staticcheck asks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ames its evidence (PRD 4173 M5 U7)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MirceaTufanDev

Copy link
Copy Markdown
Collaborator

Review of 0cb3095. The YouTrack write path fails closed as described and the forge-only path is unchanged. The LiveDB packages runlifecycle, forgesvc, handler and workersvc pass on a clean postgres 17.12. Please rework the following on this branch.

  1. Merge prd/ws-2 into this branch first. It now carries the M4 review fixes (source lock on a removed linked repo, run-now on linked repos, ./internal/runlifecycle/... in ALL_PKGS). Expect conflicts in api/internal/handler/labels.go and the PRD; keep both sides' intent, regenerate sqlc output rather than editing it, and confirm the five new runlifecycle LiveDB tests in linked_board_livedb_test.go now run in the sweep (pass, not skip).

  2. An automatic move can reopen an issue a person resolved in YouTrack. moveToColumn checks the target State and the issue's project and number, but not the issue's own resolved field, and the "never move a closed issue" guard on the lifecycle and merge-request-watch paths reads only the cache. Between a person resolving the issue and the next sync, a run transition writes an unresolved State over that decision. A label move on a forge does not reopen a closed issue. Refuse the automatic move when the live issue is resolved, keep the explicit reopen path working, add a regression test that fails without the fix, and record the decision in the Decision Log.

  3. The changelog fragment cites (#22). Cite the PRD number, #4173, as the earlier fragments do.

  4. Spec gaps:

    • The Decision Log has no entry for the test changes in U2 to U4 (the deleted TestLinkedMoveIssueNoLongerCachedClearsMarker and its replacement, the State mapping seeded in the moved-issue test, the fixture moving from a label to the cached column). The issue requires one for every changed existing test.
    • No test checks the board after a full sync for an issue created without the eligibility tag (item 5 of the issue).
    • The chat-proposal confirm and scheduled-proposal create sites have no LiveDB test against youtracktest; the other create sites do.
  5. Wording: say "issue tracker", not bare "tracker", in the comments of forgesvc/board_free_mr_watch.go, forgesvc/mr_watch.go, handler/labels.go and in the two test failure messages in forgesvc.

Out of scope for this rework: the board card wording and link immutability notes, and the CLI for the states route (M6).

uzi-agent and others added 4 commits November 18, 2026 09:00
Conflicts: handler/labels.go keeps both guards (never-enabled/source-locked
refusal first, then the linked 409); the PRD Decision Log keeps both sides'
entries. sqlc regenerate is a no-op.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lity tag after the merge (PRD 4173 M5)

The M4 review fix seeded the sweep selector and card labels as "uzi"; on a linked
repo M5's sweep filters on the link's stored eligibility tag name, so the fixture
had no candidate and the issue tracker was never reached.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…in YouTrack (PRD 4173 M5 review)

MoveToColumn refuses a live-resolved issue with ErrIssueResolved unless the
move is an explicit reopen (ColumnMove.Reopen, set only by reopenLinkedIssue).
The run lifecycle clears its pending move, the MR watch skips the move and
records the MR state, and a board drag answers 409.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eduled proposals reach YouTrack; issue tracker wording (PRD 4173 M5 review)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
uzi-agent and others added 3 commits November 18, 2026 10:21
…osal LiveDB header names its stand-in resolver (PRD 4173 M5 review)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…es in the Decision Log; changelog cites vtmocanu#4173 (PRD 4173 M5 review)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ngelog says column move (PRD 4173 M5 review)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MirceaTufanDev
MirceaTufanDev merged commit 5fea2ce into prd/ws-2 Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PRD 4173 M5: the board and issue writes on YouTrack

2 participants