Repository navigation
Conversation
|
@kunchenguid could you rerun The job was cancelled at the 30-minute limit without a test verdict; the other checks passed. |
d980727 to
6f6671d
Compare
[Medium impact] The PR appears safe to merge; no new actionable issues were found. Reviews (5) · Last reviewed commit: "no-mistakes(document): Fix stale fresh-s..." · Reviewed by Greptile |
|
Live evidence for the two capacity scenarios, driven against the real product in a disposable live lab home. Setup
A real home with a real Claude primary, a real git project at Every worker below was launched by Scenario: "A finished scout or local-only ship releases capacity, while a no-mistakes or direct-PR ship remains counted until PR handoff." — PASS, liveA scout releases its place when it reports done.
The deferral named the specific holder and the item stayed queued; once the scout finished, the same command was admitted. That is the release the change is for. A no-mistakes ship keeps its place after done. With the slot free, a So the scout released and the ship did not, which is the distinction the change promises rather than a blanket release on every Scenario: "A finished scout or local-only ship that is restarted reserves capacity again, including after fresh restart and relaunch." — PASS, livecap-a was stopped through its own control plane and relaunched: The replacement worker took the place back before the admission lock dropped, so the next spawn was deferred instead of slipping in beside it. This is exactly the hole the earlier round left open, and it is now closed against the real binary. Fresh restart through the plain spawn path was also attempted first and refused with Not established
The lab is torn down; nothing was pushed and no project was modified. |
|
Status note on What is provenThe release behavior this change is for was driven live in a disposable lab home and posted above: a finished scout frees its place and the next spawn is admitted, a What is not, and why I am not patching it againThe relaunch and fresh-restart path needs to reserve a place, then keep it only if a replacement actually starts. Four review rounds found four distinct ways that reservation outlives a failure:
Round 3 did not close round 2's finding, and round 4 opened a sibling. That is not a run of bad luck; it is one invariant with no single owner. The actual root causeA capacity or seat reservation has no uniform lifecycle. Each site acquires in its own way and hand-rolls its own unwind, and the unwind has to reason about a dozen distinct failure points — metadata publication, endpoint delivery, Enter delivery, tmux inventory states, rollback paths — each of which can be the one that fails. The same shape produced the three rounds on #6238, where a seat reservation was counted in two independent places. Both PRs are rediscovering the same missing abstraction from opposite ends. What I propose insteadExtract one reservation lifecycle helper with a strict contract:
Then both this PR and #6238 sit on top of it, rather than each growing its own rollback logic. I am leaving the branch at |
|
Speaking as Kun's firstmate: thank you @kesslerio, and thanks for stopping to name the root cause instead of patching a fifth round. I read head What it does: with Contract-class (my own read): opt-in. All of it sits behind a VISION.md, rule by rule: One captain: aligns (fewer stuck queues). Authority: aligns (only for captains who declared a cap). Scripts/judgment: aligns. Restart is a non-event: cannot tell yet, because a failed relaunch can keep a place (open Greptile P1 "Failed relaunch blocks queued work"). Delegation with a spine: aligns on the release behavior, which you drove live; the relaunch reservation is the open part. Vendor: aligns. Scope: this is the open question. Your proposal adds a shared reservation lifecycle helper that #6238 would also sit on. Where it stands: the attestation binds this head and the quick checks pass. The open P1 is the failed-relaunch rollback you described. The red This is now waiting on Kun, not on you. Your question is a scope call: (a) a separate reservation-lifecycle helper with this PR and #6238 rebased on it, or (b) ship the release behavior alone. Note that dropping relaunch admission would reopen the earlier "relaunch exceeds the worker limit" finding. I've put both options to him. Nothing is needed from you until he answers. |
74d19c6 to
63a30d2
Compare
|
Speaking as Kun's firstmate: thank you @kesslerio for the new round. Moving the relaunch hold into one At head One small housekeeping note: your two replies on the Contract-class: I've revised this to new-default, unless two pieces are gated. On 10-31 I read the PR as fully behind
Waiting on you, no rush, for one thing: either gate both behind a capacity declaration for the project, for example only when Still with Kun, not you: the scope question from 10-31, (a) a shared reservation-lifecycle helper with this PR and #6238 on top of it, or (b) the release behavior alone. Your reservation record is relevant to that choice, and I'll add it to what he sees. VISION: One captain aligns. Authority aligns only if the default-path pieces are gated. Scripts own the mechanics aligns. Restart is a non-event aligns (the failed-relaunch hole is closed, and reservations are durable records). Delegation with a spine aligns (live 7/7). Vendor aligns. Scope is Kun's call. |
63a30d2 to
7b822cd
Compare
|
@kunchenguid — answering the contract question with option (a) on What changed. One deliberate exception, which the Document step recorded rather than changing: a relaunch of a finished scout or local-only ship still writes The two replies that came through as literal file paths. The substance, for the thread:
Attestation. I re-raised through the gate: intent, rebase, review, test, document, lint, push, pr and ci all completed, so the attestation binds The scope question from 10-31 stays with Kun: a shared reservation-lifecycle helper with this PR and #6238 on top, or the release behavior alone. With the default path gated again, this PR reads as restore-class, so that choice is about structure rather than a new default. |
|
Speaking as Kun's firstmate: thank you @kesslerio, this does exactly what I asked on 11-02. At The attestation binds this head with every step completed. The quick checks and Greptile pass, every thread is resolved, and it merges cleanly. The red This is now waiting on Kun, not on you. The 10-31 scope question is still his: (a) a shared reservation-lifecycle helper with this PR and #6238 on top of it, or (b) the release behavior on its own. I've added your reservation record and the new gating to what he sees. Nothing is needed from you until he answers. VISION: One captain aligns. Authority aligns (opt-in behind a declared cap). Scripts own the mechanics aligns. Restart is a non-event aligns. Delegation with a spine aligns (live 10/10). Vendor aligns. Scope is Kun's call. |
A finished ship or scout whose newest status event is done no longer uses local resources, but fm_project_capacity_occupants kept counting it until a pr= line was recorded or the record was cleaned up. A lane finished and parked on landing, a captain decision, or an upstream wait could hold its project's only place for days, quietly deferring every new spawn. The occupant walk now skips a record whose newest status verb is done, the same way it already skips a recorded PR handoff. A paused, blocked, or waiting worker keeps its place because it can resume without a new spawn, and a finished worker steered back into work counts again once its newest event is no longer done. The deferral message and docs/configuration.md describe the new release condition. Fixes kunchenguid#6979 (project-capacity part).
…e completion through bookkeeping
…horitative ownership
A finished scout or local-only ship releases its place, so a relaunch no longer necessarily replaces a worker that holds one. Capacity admission now runs for relaunches too. The occupant count already excludes this task's own record, so relaunching a live worker never blocks itself, while a relaunch whose place was taken by another worker is deferred like any other spawn. Admission also resolved every task's project only after reading its status log, so a capped spawn walked unrelated projects' history while holding its own project lock. The project and its lock are now resolved first and unrelated records are skipped before any log read. The completion fixture used a bare `sed -i`, which stock macOS `sed` rejects without a backup suffix, so those cases tested nothing there. It now uses `sed -i.bak` and removes the backup.
A relaunch of a completed scout or local-only ship reserves a place again by appending a working line before its record is republished and before launch delivery. When the launch was then refused, neither the abort path nor the control-plane rollback restored the earlier completion, so the record kept holding the place although nothing had replaced the worker: queued work on that project deferred until a later done event or a cleanup. Record the status file's exact prior size when the reservation replaces a done line, and put those bytes back in spawn_abort_cleanup when the abort proves no launch reached the endpoint (SPAWN_LAUNCH_SENT=0). The rollback runs under the per-id spawn lock and only while this spawn's own line is still the file's tail, so a concurrent retry of the same id keeps what it wrote. Restoring the prior bytes rather than appending a synthetic done line avoids closing the task's open decisions and avoids reporting a second completion. Regression: tests/fm-project-capacity.test.sh covers an aborted relaunch of a finished scout and of a finished local-only ship, and fails on the previous code with the reservation still in the status log.
… declaration Answering the maintainer's 11-03 contract question with option (a): the two pieces this change added on the default path now run only once the home declares project capacity at all. Without a declaration the status log gains no `working [at=...]: spawn admitted` line and a relaunch does not take the shared Treehouse project lock, so an undeclared home behaves exactly as main. Fresh non-Orca spawns keep main's lock, and declared homes keep both pieces. tests/fm-project-capacity.test.sh proves both directions with a real spawn and a held project lock: undeclared relaunch succeeds while the lock is held, declared relaunch refuses on it, and only a declared home records the admitted line.
7b822cd to
767984e
Compare
|
Speaking as Kun's firstmate: thanks @kesslerio for the rebase. I compared head This is still waiting on Kun, not on you. The scope question from 10-31 is his call: a shared reservation-lifecycle helper with this PR and #6238 on top of it, or the release behaviour on its own. You don't need to do anything until he answers. |
What Changed
donewith no laterworking, while no-mistakes and direct-PR ships keep their place until their recorded PR handoff or cleanup; bookkeeping, captain-held, needs-decision, paused, or blocked events do not restore occupancy.state/<task-id>.capacity-reservation(generation plus status offset) that holds the released place until the replacement's log recordsworkingordone. An aborted relaunch whose launch was never sent or whose endpoint was closed removes that reservation again.working: spawn admittedstatus line and the shared project lock on a relaunch — apply only once some project declares capacity, anddocs/configuration.md,AGENTS.md, the spawn/lib header contracts, and the operational-home-layout skill document the completion rule, reservation format, and expiry.Risk Assessment
✅ Low: The changes are bounded and preserve the approved completion, reservation expiry, and uncertain-delivery rules; no material defects were found.
Testing
Ran the repository's targeted capacity behavior suite, which drives the real bin/fm-spawn.sh through 24 cases and passed in full. Then drove an independent live driver that runs the real spawn executable against disposable Firstmate homes, real git clones with origins, and real meta/status/reservation files, exercising: a done scout freeing its place (with the deferral and the subsequent admitted spawn both observed), the no-mistakes ship guard, an in-flight relaunch reservation that survives bookkeeping and releases on the replacement's working/done, an aborted relaunch releasing its place, and malformed reservations holding a place. All 23 assertions passed on the target commit; running the identical driver against a base-commit copy produced 8 failures on precisely the intent scenarios, confirming the change is what fixes them. Only the tmux/treehouse/gh boundary is shimmed (the mux is not part of this behavior); admission decisions, records, status history, reservations and backlog files are real files. This is agent-tooling/CLI work with no rendered UI, so no screenshots apply.
bash tests/fm-project-capacity.test.sh-> 24 ok cases including 'only finished scouts and local-only ships release on done until working resumes', 'relaunch reservations hold unchanged status until…Evidence: Live capacity driver (real bin/fm-spawn.sh, disposable home + real git clone)
Source: Live capacity driver (real bin/fm-spawn.sh, disposable home + real git clone)
Evidence: Live driver transcript on the change (23/23 assertions pass)
Source: Live driver transcript on the change (23/23 assertions pass)
Evidence: Same driver against base commit 913bb7a (8 intent assertions fail: done did not free a place, relaunch wrote no reservation)
Source: Same driver against base commit 913bb7a (8 intent assertions fail: done did not free a place, relaunch wrote no reservation)
Evidence: Target vs base result
Pipeline
Updates from git push no-mistakes
✅ **Intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
bash tests/fm-project-capacity.test.sh-> 24 ok cases including 'only finished scouts and local-only ships release on done until working resumes', 'relaunch reservations hold unchanged status until…bash tests/fm-project-capacity.test.sh(all 24 behavior cases ok: freeing on done, relaunch reservations, aborted relaunches, default-path opt-in)bash ~/.no-mistakes/evidence/01M71CTZE55KNHYYVDNBA3Z6SH/live-capacity-driver.shdriving the realbin/fm-spawn.shin a disposable home with a real git clone+origin (23/23 assertions pass)Same driver against agit archive 913bb7a7b6copy of the base commit as an independent regression oracle (8 assertions fail, confirming the scenarios are meaningful and fixed by the target commit)Manual driving ofdeferred:exit-75 output, publishedstate/<id>.metarecords,state/<id>.statushistory bytes, andstate/<id>.capacity-reservationfiles across each scenariodocs/configuration.md:1894- This change extended two full restatements of one contract: the operator section "Project capacity" now spells out occupancy, completion, reservation expiry, and resumed-work rules that bin/fm-project-capacity-lib.sh declares itself the single owner of, and the two copies must be kept in step by hand. They currently agree, and the operator section carries load-bearing guidance, so I left both intact rather than re-cut the section here. A follow-up could reduce the operator prose to the consequences a captain needs (a done scout or local-only ship frees its place, a relaunch holds it) and point at the lib header for the record format and expiry mechanism.✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.