Skip to content

tracker-sync: reserve Linear Done for merged PRs; In Review after make-pr — fn-66#178

Merged
gmickel merged 18 commits into
mainfrom
fn-66-tracker-sync-reserve-linear-done-for
Jun 18, 2026
Merged

tracker-sync: reserve Linear Done for merged PRs; In Review after make-pr — fn-66#178
gmickel merged 18 commits into
mainfrom
fn-66-tracker-sync-reserve-linear-done-for

Conversation

@gmickel

@gmickel gmickel commented Jun 18, 2026

Copy link
Copy Markdown
Owner

Spec: fn-66-tracker-sync-reserve-linear-done-for · Tracker: FLOW-15 (Bug, High) · Plan-review: SHIP (rp, 2 rounds) · Completion-review: SHIP (rp, 1 fix)

What & why

tracker-sync pushed Linear Done on local Flow completion (all tasks done + completion-review SHIP) even with no merged PR — a SapienXT spec with no PR landed on the board as Done and a human had to drag it back. Done is a claim that the work shipped, so this was a correctness bug, not cosmetic.

This makes the status policy lifecycle-accurate: Done is reserved for merge-confirmed PRs, an open PR maps to In Review, completion-review never completes the issue, and pilot never declares NO_WORK for an all-done spec that hasn't shipped.

R-ID coverage

R-ID What Where
R1 flow→normalized is flowToNormalized(spec, prEvidence); terminal Done needs MERGED evidence status-sync.md
R2 make-pr → In Review on the unconditional bridge-active PR-link path make-pr/workflow.md
R3 land.mergedDone only on a fresh post-merge MERGED re-probe (sole driver) land/workflow.md
R4 completion-review is comment-shaped (verdict + R-ID coverage), never terminal work/phases.md, tracker-sync SKILL.md/steps.md
R5 pilot: no-PR all-done → make-pr; open PR → DEFERRED_TO_LAND; never NO_WORK pilot/workflow.md
R6 closed-unmerged / missing-branch / ambiguous → never Done (NEEDS_HUMAN/non-terminal) status-sync.md, pilot/workflow.md
R7 worked fixtures S-G..S-J: no-PR, open-PR, merged-PR, closed-unmerged (exact states) status-sync.md
R8 GitHub adapter honors the same merge-evidence gate github.md, adapter-interface.md
R9 docs (tracker-sync.md / teams.md / flowctl.md / SKILL / decision record) + Codex mirror + flow-next.dev many
R10 land.merged active-by-default when bridge active; per-write merge-evidence invariant incl. manual reconcile flowctl.py, test_land_tracker_event.py

Critical changes — where to look

  • references/status-sync.md — the policy core: flowToNormalized(spec, prEvidence) with a prEvidence enum (merged|open|closed-unmerged|none|ambiguous|probe-error); terminal impossible without MERGED; In Review rung; fixtures S-G..S-J. Who-wins / deadlock ordering untouched (gate is upstream).
  • flow-next-land/workflow.mdland.merged is the sole Done driver, active-by-default when the bridge is active, and (completion-review fix) re-probes MERGED fresh after the merge rather than reusing the stale pre-merge MERGED_PR_NUM (which is empty on the normal OPEN→merge path — would've silently skipped the Done push).
  • flow-next-work/phases.md + tracker-sync SKILL.md/steps.md — completionReview dispatch reconcilecomment; setStatus merge-evidence guard.
  • flow-next-make-pr/workflow.md — In Review on the unconditional PR-link path.
  • flow-next-pilot/workflow.md + SKILL.md — new DEFERRED_TO_LAND verdict (open PR), no-PR all-done → make-pr, never NO_WORK.
  • flowctl.py (+ dogfood copy) — land.merged default; new test_land_tracker_event.py. Codex mirror regenerated; flow-next.dev updated (gmickel/flow-next.dev@5c53197, 2.1.2).

Decision context

The merge-evidence gate is a per-write invariant on the outbound terminal write — no touchpoint or manual /flow-next:tracker-sync reconcile writes Done without a MERGED probe (so a manual reconcile can still recover Done once a merge exists). Three distinct evidence-backed states end to end: done locally (In Progress) → in review (open PR) → shipped (merged). Two bugs caught + memory'd during the work: the policy-map needing a matching reconcile branch; and "invert a policy claim → sweep ALL surfaces" (both ceremony copies, docs, CLI header).

Verification

  • Full suite green (python3 -m unittest discover -s plugins/flow-next/tests, 1110); ci_test.sh 67/0.
  • Plan-review (RepoPrompt): SHIP after 2 rounds (6 blockers — incl. land.merged activation, the flowToNormalized(spec, prEvidence) shape, per-write recovery).
  • Completion-review (RepoPrompt): SHIP after fixing the stale-MERGED_PR_NUM Done-skip (R3/R10).

🤖 Generated with Claude Code via /flow-next:make-pr

gmickel added 16 commits June 18, 2026 09:50
…d In Review rung

- status-sync.md flow→normalized map is now flowToNormalized(spec, prEvidence):
  terminal done/verified require a MERGED PR probe; local completion necessary,
  not sufficient (R1). Open PR → in-review rung (R2); closed-unmerged → non-terminal
  + NEEDS_HUMAN (R6). who-wins / deadlock-first ordering untouched.
- linear-ladder.md + github.md + adapter-interface.md updated in lockstep:
  transport-blind terminal-write-requires-merge-evidence invariant (R8).
- Worked fixtures S-G..S-J with EXACT expected states: no-PR all-done → stays
  In Progress (no advance); open-PR → In Review; merged-PR → Done; closed-unmerged
  → non-terminal + NEEDS_HUMAN (R7).
- Regenerated Codex mirror.

Task: fn-66-tracker-sync-reserve-linear-done-for.1

Claude-Session: https://claude.ai/code/session_01A295VQ42CDSgVTTPgkBY4x
…s/probe-error; S-G preserve rule

Addresses impl-review NEEDS_WORK (3 findings):
- in-review rung now has an explicit reconcile-loop branch (was only in the
  flow→normalized table; S-H setStatus(in-review) previously fell through to
  conflictTiebreak). Push fires only on a real open-PR signal.
- S-G no-PR preserve rule promoted from fixture-only to policy: prEvidence=none
  projects in-review but the loop KEEPS an existing valid non-terminal state (no
  forced in-progress→in-review advance, no terminal).
- prEvidence enum extended with `ambiguous` + `probe-error`; both (and
  closed-unmerged) route to a single non-terminal + NEEDS_HUMAN branch. Unknown
  branch_name / gh failure is probe-error, never `none`/`merged`. Terminal
  reachable ONLY from unambiguous MERGED. S-J extended to cover them.
- Regenerated Codex mirror.

Task: fn-66-tracker-sync-reserve-linear-done-for.1

Claude-Session: https://claude.ai/code/session_01A295VQ42CDSgVTTPgkBY4x
…minal / makePr→In Review / land.merged→Done-on-merge (fn-66.2)

- completionReview (work phases.md 3g + retro-fire + SKILL table): comment-shaped
  verdict/R-ID coverage, NEVER terminal Done; ceremony seeds completionReview=comment (R4)
- makePr: In Review status push rides the unconditional bridge-active PR-link path,
  not gated behind perEvent.makePr (R2)
- land.merged: SOLE Done driver, active-by-default when bridge active, self-checks the
  GitHub MERGED probe before terminal write (R3/R10)
- steps.md push/reconcile setStatus: merge-evidence gate via flowToNormalized(spec,
  prEvidence); manual reconcile MAY terminal-write Done iff MERGED (per-write invariant)
- flowctl.py land.merged default documented (active-by-default, MERGED-gated); schema
  default stays off (fn-52.1 invariant); +test_land_tracker_event.py round-trip
- docs/tracker-sync.md: invert spec-completion-review-owns-Done claim; perEvent table +
  unconditional-paths prose updated
- Codex mirror regenerated; bundled .flow/bin/flowctl.py synced (dual-copy invariant)
- full suite (1110) + ci_test.sh (67) green

Task: fn-66-tracker-sync-reserve-linear-done-for.2

Claude-Session: https://claude.ai/code/session_01A295VQ42CDSgVTTPgkBY4x
… fix stale Done-owner prose (fn-66.2)

- land.merged: TRACKER_TERMINAL_OK now selects the dispatch op explicitly
  (push on clean MERGED, comment-only + NEEDS_HUMAN otherwise) — land no longer
  trusts the caller's merge claim (review #2, R3)
- land workflow.md: fix collapsed list item (RELEASED.4. → separate line) (review #5)
- docs/tracker-sync.md recovery: work.completionReview recovered via comment, not
  push (review #3, R4)
- github.md: closing-ref bypass prose → land.merged Done projection, not
  spec-completion-review (review #4)
- docs/teams.md + flowctl.md: invert completionReview-owns-Done claims; land.merged
  active-by-default; make-pr In Review unconditional
- Codex mirror regenerated (land/workflow.md, github.md)

Task: fn-66-tracker-sync-reserve-linear-done-for.2

Claude-Session: https://claude.ai/code/session_01A295VQ42CDSgVTTPgkBY4x
…eremony + dispatch grammar (fn-66.2)

- steps.md:56 duplicate discovery ceremony seed: completionReview reconcile →
  comment; line-60 'one exception' → 'two exceptions' (make-pr link/In Review +
  land.merged) (review #1, R4/R10)
- make-pr dispatch grammar: operation token back to canonical
  'operation: push <spec-id>, event: makePr' (PR URL / In Review as evidence prose,
  not in the op token); same for the §5.7 retro-fire path (review #2, R2)
- work/phases.md completionReview dispatch examples: drop 'verdict + R-ID coverage'
  from the op token → canonical 'operation: comment <spec-id>, event: work.completionReview'
- Codex mirror regenerated

Task: fn-66-tracker-sync-reserve-linear-done-for.2

Claude-Session: https://claude.ai/code/session_01A295VQ42CDSgVTTPgkBY4x
…ional paths (fn-66.2)

- flowctl.py:1024 header comment no longer claims a stray enabled=true 'does nothing
  until a specific event is opted in' — calls out the two fn-66 unconditional
  bridge-active paths (make-pr link/In Review + land.merged Done-on-merge) (review #1, R10)
- bundled .flow/bin/flowctl.py synced (dual-copy invariant)

Task: fn-66-tracker-sync-reserve-linear-done-for.2

Claude-Session: https://claude.ai/code/session_01A295VQ42CDSgVTTPgkBY4x
…t NO_WORK (fn-66.3)

- All-done + open PR: explicit greppable PILOT_VERDICT=DEFERRED_TO_LAND (stage=land), not a silent skip→NO_WORK collapse
- All-done + no PR (FLOW-15 case): always classifies make-pr, never NO_WORK
- Closed-unmerged / missing-branch / merged-but-open-spec stay NEEDS_HUMAN
- Register DEFERRED_TO_LAND in SKILL.md verdict grammar + land stage; update classification table + crash-class note
- Regenerate Codex mirror

Task: fn-66-tracker-sync-reserve-linear-done-for.3
…r (fn-66.3)

- ralph.md Codex /goal verdict grammar + Claude /goal recipe now name DEFERRED_TO_LAND and route it to land, not a pilot re-run

Task: fn-66-tracker-sync-reserve-linear-done-for.3
…ion bump 2.1.2

- audit confirms fn-66.1/.2/.3 already inverted tracker-sync.md/teams.md
  "completion-review owns Done" → "land.merged owns Done" + In Review documented
- decision record Consequences: In Review actively projected at make-pr;
  Done gated on GitHub MERGED probe (projection-not-coordination unchanged)
- CHANGELOG 2.1.2 (Fixed: merge-evidence gate + In Review; Changed: pilot DEFERRED_TO_LAND)
- version bump 2.1.1 → 2.1.2 across all manifests; Codex mirror regenerated

Task: fn-66-tracker-sync-reserve-linear-done-for.4
Claude-Session: https://claude.ai/code/session_01A295VQ42CDSgVTTPgkBY4x
…use stale pre-merge MERGED_PR_NUM (fn-66 R3/R10, completion-review)
@gmickel gmickel marked this pull request as ready for review June 18, 2026 12:20
@gmickel

gmickel commented Jun 18, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d17861278e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread plugins/flow-next/skills/flow-next-tracker-sync/references/status-sync.md Outdated
Comment thread plugins/flow-next/skills/flow-next-tracker-sync/references/status-sync.md Outdated
…open-PR→In Review and merged→Done precede local task/completion rows (fn-66, PR #178 review)

Two P1s: (A) all-done OPEN spec + open PR mapped in-progress not in-review (make-pr push no-op); (B) ungated/unknown-completion merged spec stayed in-review so land.merged never wrote Done. Reordered the table prEvidence-first; added fixtures S-K/S-L. Codex mirror regenerated.
@gmickel

gmickel commented Jun 18, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d6d9d593bc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread plugins/flow-next/skills/flow-next-make-pr/workflow.md Outdated
…not push (full re-render clobbers tracker edits) — fn-66, PR #178 review

push(spec) renders the full spec body + writeIssue before status, so opening a PR could overwrite human tracker-side edits just to flip In Review. reconcile runs the 3-way body merge that preserves edits and sets In Review in the same op. Codex mirror regenerated.
@gmickel

gmickel commented Jun 18, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 3e92c39922

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@gmickel gmickel merged commit ec95c11 into main Jun 18, 2026
4 checks passed
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.

1 participant