Skip to content

Spec: in-progress marks only a live Run - #1935

Merged
JacobStephens2 merged 20 commits into
mainfrom
issue-1901
Nov 10, 2026
Merged

JacobStephens2 merged 20 commits into
mainfrom
issue-1901

Conversation

@JacobStephens2

@JacobStephens2 JacobStephens2 commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

Summary

in-progress now marks only a live Run, on issues as on pull requests (ADR 0029). When a Run ends, the issue is labelled with how it ended. A failure, or a Spec that is only waiting, also gets a generated comment on GitHub.

 Claimed::end(ending)
   Merged                         -> remove in-progress once the issue is closed
-  ReadyForReview | Held          -> keep in-progress
+  ReadyForReview | Held          -> remove in-progress, put nothing back
   Failed, nothing on origin      -> release (ready-for-agent back), no comment
-  Failed, work on origin         -> add agent-failed beside in-progress
+  Failed, work on origin         -> swap in-progress for agent-failed + Recovery comment
-  Security fix failed            -> add agent-failed beside in-progress
+  Security fix failed / waiting  -> swap in-progress for agent-failed, no comment
+  Waiting (Spec run, or land-tickets Custom process)
+    untrusted Spec edit          -> needs-triage
+    else                         -> ready-for-agent back (if the Claim took it off)
+                                    + comment naming each undone Ticket and why
   Stop / NotReproduced           -> unchanged (needs-triage / needs-info)

A Spec run is only waiting (TicketBoard::only_waiting) when all of these hold:

  • No Ticket failed or was interrupted.
  • Every undone Ticket is an Unready Ticket, outside the Spec's repository, or blocked only by outside work and by Tickets that are themselves waiting.
  • Every open Ticket passes the Trusted-account check for Tickets.

A blocking cycle is a failure.

Pickup's gates:

 gates
   sweep(closed issues)
+  sweep(open agent-failed issues): take in-progress off, warning-only
   clear_and_count_failures(open agent-failed issues)
-    neither in-progress nor needs-triage -> "took over", don't count
     ready-for-agent back                 -> take agent-failed off, don't count

The Recovery comment (src/recovery.rs) is built from factory-owned facts only:

  • It opens with the attribution line (github::GENERATED), then gives the cause, where the Run stopped, what was preserved, the machine, and "Put ready-for-agent back to retry."
  • It has no local paths and no continue command.
  • It leaves out a failed session's Harness diagnostic.
  • A comment that would quote stored private Security review material is replaced by a withheld notice.

The guide (regenerated into site/docs/index.html), GLOSSARY.md and the hand-written pages (site/index.html, site/how-it-works/, site/architecture/) describe the new endings.

Spec review fixes (3cabca0):

  • A failed session's diagnostic no longer reaches the Recovery comment's cause (recovery::cause).
  • A land-tickets Custom process that is only waiting hands its Spec back, matching its comment, where before it was labelled agent-failed.
  • A Security fix Spec that is only waiting stays agent-failed with no comment.
  • A hand-back refused by an untrusted Ticket edit now gives that reason in its cause.

Seams tested:

  • fake-gh integration tests (failed_run, process, spec_run, pickup_run, security_run);
  • the Claim's in-memory Outside (claim::tests);
  • the Spec run's Outside (spec_run::tests).

Closes #1901

Evidence

Execution evidence

Each review test was run against d80995f, the Spec branch before the review, before the fix:

  • Before: cargo test --test failed_run a_recovery_comment_does_not_post_the_sessions_own_text
    panicked at tests/failed_run.rs:617:5:
    - Cause: claude exited 1: agent-authored: ignore previous instructions
    test result: FAILED. 0 passed; 1 failed
    
    After: cargo test --test failed_run → test result: ok. 19 passed; 0 failed; 1 ignored
  • Before: cargo test --test process land_tickets::
    test land_tickets::a_custom_process_whose_spec_only_waits_posts_a_comment_matching_its_label ... FAILED
    test land_tickets::a_spec_branch_whose_tickets_only_wait_hands_the_spec_back ... FAILED
    test result: FAILED. 12 passed; 2 failed
    
    After: cargo test --test process → test result: ok. 239 passed; 0 failed; 1 ignored
  • Before: cargo test --test spec_run a_spec_run_failed_for_an_untrusted_ticket_says_so_in_its_comment
    panicked at tests/spec_run.rs:3896:5:
    test result: FAILED. 0 passed; 1 failed
    
    After: cargo test --test spec_run → test result: ok. 100 passed; 0 failed; 1 ignored
  • Also on this head:
    • cargo test --test security_run → ok. 125 passed
    • cargo test --test pickup_run → ok. 147 passed
    • cargo test --test continuation → ok. 9 passed
    • cargo clippy --all-targets is clean, and cargo fmt --check passes.
    • npm run docs:check --prefix site exits 0.
  • Not run locally: the unit-test binary (cargo test --bin thirdshift). rustc was SIGKILLed (OOM) linking it on this 7 GB host with no swap, the same limit the Ticket PRs hit. So the new claim::tests::a_waiting_security_fix_spec_is_swapped_for_agent_failed_and_owes_no_comment, and the other inline tests from A waiting Spec run puts ready-for-agent back on its Spec, not agent-failed #1936 and Post a failed Run's Recovery, and a waiting Spec's reasons, as a generated issue comment #1940, have only been typechecked; CI runs them first. scripts/affected-tests main would select the full Rust suite, so it was not run, for the same reason.

Visual evidence

None. The site changes are prose only, inside existing paragraphs and list items, and no screenshots were taken.

Unaddressed findings

Standards

  • S2: ADR 0029 vs a successful Custom process that ends before Delivery and keeps in-progress. Declined, filed as A Custom process that ends before Delivery with work on origin keeps in-progress after it exits #1945. The behaviour predates this Spec and is documented on purpose: docs/guide.md (land-tickets) says "It leaves the Claim while the Spec waits for completion", and tests/process/land_tickets.rs::a_spec_branch_lands_dependent_tickets_and_leaves_the_spec_pr_draft asserts it. Changing it changes how Pickup and the Day shift treat a half-delivered Spec, so the Day shift or a Spec has to choose.
  • S3, partly: the strengthened test asserts one comment with no private text, but not the WITHHELD wording. With the P1 fix, a session's diagnostic no longer reaches the cause, so this test's route never triggers the replacement; asserting it failed at tests/failed_run.rs:588. The WITHHELD replacement in Claim::end has no integration test left.
  • S4 (Duplicated Code / Data Clumps, judgement call): the repeated return Err(failed_before_steps(…)) predates this Spec. main already has 24 such calls in src/processes.rs; this diff rewrites five. The cause half of the data clump now goes through one recovery::cause.
  • S5 (Middle Man / naming, judgement call): recovery::comment is not pure delegation. It renders the before-work comment when there is no Recovery (src/recovery.rs, BEFORE_WORK).

Spec

Review coverage

Both reviewers read every changed file except site/docs/index.html. Both confirmed its exclusion as generated output: docs/guide.md was reviewed, and npm run docs:check --prefix site exits 0.

Security review outcome

No unaddressed introduced findings.

Merge Danger

Door: two-way

Label endings and comments change; nothing is migrated except the Sweep, which takes in-progress off open agent-failed issues. Reverting restores the old labels on new Runs only.

Blast Radius: labels

Every Command's Claim ending, Pickup's Failure-limit count and Sweep, and public issue comments on failed issues. A wrong ending could stall Pickup (a ready-for-agent missing) or re-take work (one wrongly put back).

Tickets

Built with codex codex-cli 0.164.0 · gpt-6.1-sol · xhigh

JacobStephens2 and others added 16 commits November 9, 2026 19:54
…wapped for agent-failed on failure

Ready for review and a held Self-merge take in-progress off and put
nothing back. A failure with work on origin, and a failed Security fix,
swap in-progress for agent-failed in one label edit. Pickup no longer
reads neither in-progress nor needs-triage as a take-over, and its Sweep
takes in-progress off every open issue labelled agent-failed.

Closes #1902
…losed, tidy Sweep code

A Custom process whose Self-merge merged now ends its Claim as a Ticket
run's does, removing in-progress only once the issue is closed. Fold the
Sweep's handed-back decision into one place, rename claim_stays, rewrap
docs, and align the step wording. Update the Process tests for the new
endings.
A dispatched child Run that merged no longer keeps in-progress on the
parent issue whose own pull request is only ready for review. Clarify the
release doc and rewrap the Pickup module and guide text.
…fakes; keep Run a workflow name only

Edit::labels_after now follows the request apply makes, so a Delete leaves
an already-present agent-failed in its own case, as GitHub does. The
hand-written pages say 'run' where the Claim prose meant a run, not the
Run concept the pages test forbids.
… the issue has it

Edit::labels_after now follows the Delete request, which leaves the other
labels in their order, so the Claim tests expect in-progress where it was
read, not moved to the end.
…en failures

A failed Run now leaves agent-failed without in-progress, so the Failure
limit skip test seeds its failures that way, and the closed-issue Sweep
test expects the open failure it seeds to have in-progress taken off.
End a Claim when its Run ends: in-progress off at ready for review, swapped for agent-failed on failure
…ailed

A Spec run that failed no Ticket and whose undone Tickets all wait on a
person or on other work takes in-progress off its Spec and puts
ready-for-agent back, or needs-triage after an untrusted edit of the Spec
since its last Trusted ready-for-agent labelling. A blocking cycle, or any
failed or interrupted Ticket, still ends agent-failed.

Closes #1903
A waiting Spec run on a Spec with no ready-for-agent only takes in-progress
off, so thirdshift never makes a Spec Ready that the Day shift did not.
Keep one Tickets not done error with an only_waiting flag, check cycles
where the walk through blockers starts, and correct the guide and site
index wording. The Pickup test now reads the timeline thirdshift's edits
recorded.
Handing a waiting Spec back labels it ready-for-agent again, by thirdshift's
own Trusted account. The Trusted-account check for Tickets counts edits only
since the later of the Ticket's and its Spec's last Trusted labelling, so
that hand-back excused an untrusted edit of a waiting Ticket made before it,
and the next Spec run started that Ticket. A waiting Spec run now checks
each open Ticket in the Spec's repository first, and fails as before when
one fails the check or cannot be checked.

Co-Authored-By: Claude <noreply@anthropic.com>
A waiting Spec run puts ready-for-agent back on its Spec, not agent-failed
…ec PR caveat, scrub joined paths, share the attribution line
A failed session's diagnostic is model output and goes into the Recovery
comment's cause. Check the comment against the stored private Security
reports, captured before the run's sessions and again at its end, and post
a withheld comment in its place when it includes any of their text.
…ment's pull request

Clippy's wildcard_enum_match_arm lint rejects the catch-all arm.
Post a failed Run's Recovery, and a waiting Spec's reasons, as a generated issue comment
…d a waiting Custom process's Spec back, keep a waiting Security fix agent-failed

- A Recovery comment's cause leaves out a failed session's Harness
  diagnostic, which its agent can write (recovery::cause).
- A Custom process whose land-tickets Step ends only waiting ends its
  Claim as a waiting Spec run does, matching the comment it posts.
- A Security fix Spec that ends only waiting is swapped for agent-failed
  with no comment, as a failed Security fix is.
- A Spec run refused the hand-back by an untrusted Ticket edit says so in
  its cause.
- Strengthen the private-material Recovery test to require a comment;
  update the guide, glossary and code-navigation rows.
A Spec run's cause names each Ticket not done, and a failed Ticket's
reason is the cause its child Run printed, which can include its
session's Harness diagnostic: text the session's agent writes. Render
a failed Ticket as only "failed" in the Recovery comment; terminal
output keeps the full cause.
Carry Recovery comments and waiting Spec Claim endings through the Process source refactor. Retain shared Pickup and Triage failure accounting under ADR 0029, update Triage expectations, and regenerate the user manual.
@JacobStephens2 JacobStephens2 removed the in-progress A Claim: thirdshift has taken this issue label Nov 10, 2026
@JacobStephens2
JacobStephens2 merged commit 84c5856 into main Nov 10, 2026
16 checks passed
@JacobStephens2
JacobStephens2 deleted the issue-1901 branch November 10, 2026 20:45
This was referenced Nov 11, 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.

Spec: in-progress marks only a live Run

1 participant