Repository navigation
Conversation
|
Speaking as Kun's firstmate: thanks @ironerumi for picking up #7426 so quickly. I checked the body and the diff, and this does implement #7426's ask: ordinary teardown now inventories the task's attached listener, unread inbox messages, and unhandled captured results, and refuses before cleanup and again before endpoint close. What's needed from you (this is waiting on you, not on Kun):
Overlap to keep in mind: open PR #6212 (ending task-owned Lavish review sessions and retiring sources at teardown) touches the same teardown and procevent paths. With this gate, a still-registered task-owned listener blocks ordinary teardown, so the two need to compose: the refusal runs before any retirement, and #6212's retirement must not be made unreachable. Whichever lands second will need a rebase. Contract-class: new-default. Main documents leftover steering as moot at teardown, and this adds a new refusal on the unconfigured teardown path. I think it's the right direction, but once CI is green and live evidence is in, this goes to Kun for the merge-or-leave decision. It won't be auto-merged. VISION.md: aligns on every rule (strengthens a refusal path, "a refusal to discard is a finding"; deterministic inventory; |
5ea5fa3 to
62c9804
Compare
|
Speaking as Kun's firstmate: thanks @ironerumi, this is a big step forward. On head One thing is still needed from you (this is waiting on you, not on Kun): live validation. The PR body says the no-mistakes Test agent hit its 30-minute budget and "no evidence was gathered for this head", so so far the only proof is the test suite. When you get a chance, could you try it on a real (or lab) firstmate home and post what you see? Ideally:
Or you can re-raise through no-mistakes with a bigger For transparency: I'm treating this as a change to the default teardown behavior. Today ordinary teardown treats leftover steering as moot, and after this PR it refuses instead. So once the live evidence is here, Kun will make the merge call himself. That part won't be waiting on you. |
|
Live lab verification completed for #7448 at head In the commands below,
Trimmed refusal output: Trimmed success output, corresponding to the successful table rows: Scope and caveats:
All lab endpoints and disposable homes were cleaned up. The complete final driver exited 0, ending with: |
|
Speaking as Kun's firstmate. Thank you @ironerumi — that live lab run is exactly what I asked for. It covers all four scenarios on head State: head contract-class: new-default — on main, ordinary teardown treats a leftover unhandled steer as moot and deletes the inbox; with this PR ordinary teardown refuses when task-owned feedback is still attached. That's a well-motivated change (VISION.md: "a refusal to discard is a finding"), but it changes the default teardown behavior, so it isn't auto-merged. VISION.md: aligns across the rules — refusal surfaces a real pending obligation, This is now a captain-decision hold, not waiting on you: nothing more is needed from you, and Kun will make the merge-or-leave call himself. |
Intent
The developer approved building the upstream pull request for #7426. The issue as filed:
At upstream main
67abd40a6b7b0c39fb509527afd3784534c5bd9f,bin/fm-teardown.sh:3873-3880treats leftover unhandled steering as moot after landing and deletes the task inbox. Landing the code does not acknowledge an unread feedback message or a captured process-event result. Task-owned source/result ownership already exists inbin/fm-procevent.sh, but ordinary teardown does not inventory it before retiring the owner.The ask is one refusal behavior: ordinary teardown must stop while the task still has an attached task-owned listener, an unread inbox message, or an unhandled captured result belonging to it, and identify the attachment that must be handled. Unrelated tasks' sources must not block it. This does not ask to change forced-discard authority or add automatic retirement, session cleanup, feedback transfer, or pool management.
ironerumi#85 demonstrates a small inventory plus an early check and a pre-close recheck, with fixtures for attached messages/results/listeners, late feedback, and unrelated-source non-interference. A narrow upstream port can use that ownership check without importing the fork's forced-teardown policy changes.
Related but different: #6896 concerns orphaned source cleanup, while #6130 and #6212 concern ending review sessions. This issue asks that pending feedback prevent ordinary owner destruction, not that teardown consume or retire feedback automatically.
The maintainer triaged it ready-for-pr, VISION-aligned, and asked for a narrow upstream port of the ownership check only, without the fork's forced-teardown policy changes, with regression fixtures for an attached message, an attached result, a listener, and an unrelated source not blocking, raised through no-mistakes.
What Changed
--forcediscard behavior and document the ownership safeguard with regression fixtures for attached, handled, late, and unrelated feedback.Risk Assessment
Testing
The Test agent exceeded its invocation budget. An explicit Test exception was approved after all five touched suites and real-endpoint lab checks passed independently on executable-identical code; the full transcript, exact tested/published heads, and documentation-only difference are recorded below.
Pipeline
Updates from git push no-mistakes
✅ **Intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 1 issue found → auto-fixed (2) ✅
bin/fm-procevent.sh:697-register-taskacquires the per-source lock atbin/fm-procevent.sh:691, then the new endpoint recheck atbin/fm-procevent.sh:697-698can fail if the pane dies or its endpoint becomes invalid between the two validations. Thatdiepath runs the EXIT trap, which releases only the task-feedback lock, leaving the source lock owned by the exiting process; later operations on the same source must wait for stale-lock recovery and can be delayed or blocked under PID reuse. Release the source lock in this recheck failure (or include it in the cleanup trap). The other post-lock error paths atbin/fm-procevent.sh:701-812explicitly release it, making this new recheck the exception.🔧 Fix applied.
1 error still open:
bin/fm-teardown.sh:3534- The new gate does not guarantee the required refusal invariant: ordinary teardown must stop while a task has “an attached task-owned listener, an unread inbox message, or an unhandled captured result belonging to it,” before retiring that task.task_feedback_inventoryis invoked only against the parent$STATEatbin/fm-teardown.sh:3534-3537. A local secondmate runs with its ownFM_HOME, so a task-owned listener, inbox message, or result under the child home is invisible to this check; the child preflight atbin/fm-teardown.sh:3448does not inventory feedback, andremove_firstmate_homethen sweeps process events atbin/fm-teardown.sh:2723,2832before deleting the child home atbin/fm-teardown.sh:3841. Separately, the late recheck runs only after destructive retirement: the Orca path atbin/fm-teardown.sh:3691follows branch deletion/hook cleanup, and the normal path atbin/fm-teardown.sh:3772follows worktree return and slot-owner release. Thus feedback arriving during preparation can be refused only after task-owned worktree state has already been returned, and child-home feedback can be discarded without refusal. The fix must inventory every task-owned home and move the recheck before any retirement at the shared teardown boundary; this changes the teardown sequencing and requires author approval.🔧 Fix applied.
✅ Re-checked - no issues remain.
🔧 **Document** - 1 issue found → no changes applied ✅
docs/architecture.md:421- This edit replaced operative text with a pointer "Ordinary teardown applies the attached-feedback ownership gate described in configuration.md before destructive cleanup and again at the shared pre-destruction boundary;--forceretains its explicit discard authority." to docs/configuration.md, but the referenced file does not contain the deleted rule: "Ordinary teardown also applies the attached-feedback ownership gate in configuration.md before cleanup and again before endpoint close;--forceretains its explicit discard authority.". Preserve the rule in an authoritative document or keep the pointer only if its target states it.🔧 No changes applied.
✅ Re-checked - no issues remain.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.
Issues
Closes #7426
Maintainer-requested follow-up evidence
Tested code head:
ad2649a8a5d3cc8a4c63529102281ed326cadfed. Published head:62c980449475e4c029689c0019463f19a7bf7502; the intervening diff changes only four documentation files, with executable code and tests unchanged. The refreshed no-mistakes attestation binds the published head; all 20 reported checks passed before this evidence-only body update.All five touched test files passed with the canonical runner:
fm-teardown.test.sh,fm-teardown-endpoint-safety.test.sh(including child-home and pre-destruction ownership fixtures),fm-gotmp.test.sh,fm-secondmate-lifecycle-e2e.test.sh, andfm-remote-secondmate-lifecycle-e2e.test.sh.The runner reported
total=5 failed=0 skipped_gate=0 duration_ms=1094091.The Test agent reached its 30-minute budget; firstmate authorized direct focused verification rather than rerunning that agent.
This is an explicit Test approval based on independent passing evidence, not an assertion that the timed-out turn completed.
Fixture corrections: GOTMP includes the real inventory executable and its libraries; local and remote secondmate fixtures acknowledge messages already consumed by their steer/handoff assertions before retirement (the intended new-default consequence); the lock-mtime fixture injects only the intended mtime error while preserving unrelated ownership queries.
No production refusal or watcher/provisioning bound was weakened.
Composition with #6212: this refusal runs before retirement; whichever lands second needs a rebase that sequences acknowledged-listener retirement without bypassing unread-message/unhandled-result refusal.
No integration with that unmerged change is claimed.
Actual real-endpoint lab transcript (not test doubles)
A fresh lab was created with
bin/fm-lab-home.sh; endpoint commands used a private real tmux server, product inbox/capture interfaces, and the exact candidate head above.Only home-specific code-copy paths are normalized to
$TASK_COPYand$VALIDATION_COPYbelow.The private server was stopped and its socket directory removed by the driver exit trap.