Repository navigation
feat: route Lavish feedback directly to owning workers - #5099
Merged
Merged
Conversation
…e orphaned captures
…, roll back failed re-arms
haris-siddiqui-1
pushed a commit
to haris-siddiqui-1/firstmate
that referenced
this pull request
Sep 21, 2026
) * feat(procevent): route worker-owned Lavish rounds * no-mistakes(review): drop duplicate artifact field from task-owned registration * no-mistakes(review): post worker reply once, fix ring label, keep re-arm atomic * no-mistakes(review): keep worker board owned until terminal round acknowledged * no-mistakes(review): refuse every retirement of an open worker-owned round * no-mistakes(review): use real lavish reply flag, isolate reply generations * no-mistakes(review): drop .posted marker for best-effort reply posting * no-mistakes(review): consume staged reply after listener setup, refuse orphaned captures * no-mistakes(review): require a reachable owner, redeliver open rounds, roll back failed re-arms * no-mistakes(review): re-arm only to acknowledge an open round * no-mistakes(review): conclude only a still-open terminal round * no-mistakes(review): record the acknowledgement before retiring the board * no-mistakes(review): retain the registration across a conclude, qualify terminal docs * no-mistakes(document): Document worker-owned Lavish round lifecycle
dscott98
pushed a commit
to Simplifying-Cloud/firstmate
that referenced
this pull request
Sep 21, 2026
) * feat(procevent): route worker-owned Lavish rounds * no-mistakes(review): drop duplicate artifact field from task-owned registration * no-mistakes(review): post worker reply once, fix ring label, keep re-arm atomic * no-mistakes(review): keep worker board owned until terminal round acknowledged * no-mistakes(review): refuse every retirement of an open worker-owned round * no-mistakes(review): use real lavish reply flag, isolate reply generations * no-mistakes(review): drop .posted marker for best-effort reply posting * no-mistakes(review): consume staged reply after listener setup, refuse orphaned captures * no-mistakes(review): require a reachable owner, redeliver open rounds, roll back failed re-arms * no-mistakes(review): re-arm only to acknowledge an open round * no-mistakes(review): conclude only a still-open terminal round * no-mistakes(review): record the acknowledgement before retiring the board * no-mistakes(review): retain the registration across a conclude, qualify terminal docs * no-mistakes(document): Document worker-owned Lavish round lifecycle
dscott98
added a commit
to Simplifying-Cloud/firstmate
that referenced
this pull request
Sep 21, 2026
Intent
Rebuild the worker-owned Lavish listener - the second half of the crew-hosted-Lavish fix, after Ship A landed the clean parts (merged as #5060, on main at c443d8c) - on the SIMPLER mechanism the grind assessment settled: "a round stays open until the worker acknowledges it." The original per-round claim-handoff mechanism is abandoned (it was a concurrency tangle and was never prototyped). Firstmate no-mistakes, yolo off, hold the green PR for the captain's merge.
Requirements (authoritative design: the scout report data/fm-crew-hosted-lavish-poll-fix-s1/report.md "Revised design after round 2" plus its Ship B rules, and the grind assessment data/fm-crew-hosted-lavish-layer1-grind-assess-s1/report.md "Ship B" section):
PROTOTYPE FIRST: prototype the full multi-round loop end-to-end (arm -> captain feedback reaches the worker inbox -> worker acknowledges and re-arms with its reply -> next round -> session_ended stop) BEFORE entering no-mistakes review. The original's cost was underestimated precisely because it was never prototyped; do not skip this.
What Changed
Risk Assessment
✅ Low: The worker-owned multi-round flow, terminal conclusion recovery, direct inbox routing, and reply staging are coherently implemented and covered by behavior-level regression tests, with no new material defect found.
Testing
The targeted process-event regression suite passed, including rollback, crash-recovery, redelivery, endpoint, ownership, reply-consumption, and terminal-round cases. Live product validation covered feedback routing, worker acknowledgement and re-arm, ownership refusal, and terminal acknowledgement without restart. Recovery and endpoint/redelivery behavior lacked live-product evidence, so the overall result is inconclusive.
live-round1-routing.txtshows the real feedback inworker-live.inbox, the complete captured message, and an absent firstmate wake queue.live-board-round2.pngvisibly shows the captain message and worker reply;live-rearm-state.txtrecords round one handled while the source remains registered.live-second-armer-refusal.txtrecords nonzero status and namesworker-liveas the owner.live-terminal-open.txt,live-board-ended.png, andlive-terminal-final-state.txtshow the terminal instruction, zero starts while open, retirement on handled acknowledgement, and zero starts afte…Evidence: Round-one direct worker routing and absent firstmate wake
Source: Round-one direct worker routing and absent firstmate wake
Evidence: Open terminal round ownership and no-auto-rearm state
Source: Open terminal round ownership and no-auto-rearm state
Evidence: Competing armer refusal naming the worker owner
Source: Competing armer refusal naming the worker owner
Evidence: Terminal acknowledgement and final non-restart state
Source: Terminal acknowledgement and final non-restart state
Evidence: Targeted process-event regression transcript
Source: Targeted process-event regression transcript
Evidence: Guarded Herdr lab teardown confirmation
Source: Guarded Herdr lab teardown confirmation
Pipeline
Updates from git push no-mistakes
... (19 earlier update rounds omitted to keep the PR body within GitHub's 65536-char limit; full history is in the run log.)
🔧 **Review** - 3 issues found → auto-fixed (12) ✅
🔧 Fix applied.
15 issues (12 errors, 3 warnings) still open:
bin/fm-procevent.sh:740- The immediate inbox doorbell passes task IDworker-1as the expected endpoint label, but task endpoints usefm-worker-1(as derived byfm_backend_expected_label_of_selectorandwindow_label). Identity-checking backends such as Zellij reject the mismatched label, so feedback is durably queued but the worker is not notified until the watcher's delayed re-ring. Derive and pass the canonical expected label here.bin/fm-procevent.sh:549- A failed re-arm can corrupt the still-valid prior registration. For example, after an arm stagesid.replybut before its runner starts, retrying with a nonexistent reply path deletesid.replyat line 549 and then fails validation at line 562; the unchanged source still references that deleted file, so every launch exits without polling and captain feedback is no longer collected. The same invariant is violated when line 570 replaces the prior reply before registration publication can fail at line 576. Stage the new reply under a generation-specific path and only clean the prior reply after the new source record commits, so every failed re-arm leaves the previous registration executable.bin/fm-procevent.sh:492- Intent contradiction: the requirement says “Register refuses a second armer (naming the holder)” and firstmate must never arm a worker-hosted board, but ownership checks consult only the live.source. After a worker-owned terminal capture,retire_owned_terminal_sourceremoves that record while the unhandled.owner-taskevidence remains; a subsequent ordinary Lavisharmsees nosource_kind, publishes a firstmate registration at line 501, and reconcile polls the ended worker board. The sibling task path also checks pending results only for terminality at lines 529-536: after explicit retirement of an open nonterminal round, another task can register and lines 581-588 acknowledge the original owner’s capture. Registration must honor immutable pending owner evidence even when the source record is absent.bin/fm-procevent.sh:711- Terminal worker rounds have no completion path. The terminal message says only to stop, while re-arm is prohibited at lines 529-535 and re-arm is the only new path that writes handled markers at lines 581-588. Consequentlysession_ended, empty End, and missing captures remain pending forever and every reconcile republishes/rings them. The new test at tests/fm-procevent.test.sh:794-799 confirms only sequences 1 and 2 are handled and leaves terminal sequence 3 open. Instruct the worker to acknowledge the terminal sequence with the existinghandledcommand after processing it, and verify that terminal pending state clears.bin/fm-procevent.sh:569- The latest fix round left the second half of the failed-rearm corruption sequence intact. A prior registration can still reference$id.reply; re-arm overwrites that shared file at line 569 before publication at line 575, so a publication failure makes the prior registration send the new reply even though re-arm reported failure. If publication succeeds but handled-marker creation fails at line 584, the failed command likewise leaves the replacement registration installed. Keep the prior registration and reply generation intact until registration publication and acknowledgement commit, rolling back on either failure; use generation-specific reply paths rather than the shared destination.bin/fm-procevent.sh:1829- Intent contradiction: the requirement says the owning source remains authoritative until acknowledgement, but explicitretirestill removes a task-owned source with an open round. Concrete path: worker-1 captures nonterminal feedback,retireremoves its source, then worker-2 registers at lines 533-551 and lines 585-592 mark worker-1's capture handled because only terminality—not captured owner—is checked. Ordinary registration can likewise replace the retired owner at lines 496-504. Round 3's ownership fix left this explicit-retirement sibling path behind, and the new test at tests/fm-procevent.test.sh:800 never executes the required retire/re-register sequence. Refuse retirement while a task-owned capture is unacknowledged, and only let re-arm acknowledge captures whose immutable owner matches the registering task.bin/fm-procevent.sh:731- Repeat delivery breaks after the worker consumes the first inbox notification.fm_task_inbox_write_idempotentcan return the matching record underinbox/handled/; line 740 then rings using that path, andfm_task_inbox_doorbell_linederivesinbox/handledas the inbox and instructs the worker to move the record into nonexistenthandled/handled/. If the worker moved the notification before crashing or re-arming, every reconcile repeats this malformed doorbell and no active inbox record restores the still-open round. When the matching record is already handled but the process result remains unacknowledged, create or reference a valid active inbox delivery rather than ringing the handled pathname.bin/fm-procevent.sh:1814- Terminal acknowledgement ignores failure to remove the source and still printsretired. If removal fails, the handled marker already suppresses the terminal result, while reconcile sees a task-owned source with no pending round and launches another poll, producing duplicate terminal captures. Check removal and roll back the newly created handled marker on failure so the source remains owned and round-open.bin/fm-procevent.sh:1826- The new task-terminal path retires the source whenhandledsucceeds, but the public command help at line 85 still states that marking a result handled does not retire its registration or claim. Document the task-owned terminal exception so callers do not rely on a guarantee this change invalidates.bin/fm-procevent.sh:1832- Terminal acknowledgement is not crash-recoverable. If the process dies after creating the handled marker here but before removing the source at line 1836,source_pendingpermanently hides that terminal result. A repeatedhandledcall therefore does not setconclude, register-task's terminal check at lines 554-561 permits re-arm, and reconcile's pending guard at lines 1561-1565 permits another poll of the ended board. Round 5's r11 fix handles an ordinary removal error but left this crash sibling reachable. Detect and finish a handled terminal conclusion at the shared task-source boundaries before either re-arm or reconcile can launch it again.bin/fm-procevent.sh:589- The selected r7 failed-rearm invariant remains unresolved. The replacement registration commits here and stale reply generations are deleted at lines 594-598 before the existing round is acknowledged at lines 601-608. If handled-marker creation fails, the command reports failure but leaves the replacement registration and reply installed rather than preserving the prior executable registration. Keep the prior registration generation until acknowledgement commits, and restore it plus its reply on acknowledgement failure.bin/fm-procevent.sh:554- Task registration treats every unhandled result sharing the source ID as the registering worker's round, without checking its immutable owner sidecar. Concrete path: firstmate captures nonterminal feedback, explicitly retires that source before handling it, then a worker arms the same artifact. Lines 554-561 accept the legacy result and lines 601-608 silently mark it handled even though it was never routed to that worker. Filter both terminal validation and acknowledgement to captures whose.owner-taskequals the registering task, and refuse unmatched pending captures rather than consuming them.bin/fm-procevent.sh:532-register-taskvalidates only the task-id syntax, not that it identifies a current task endpoint. A worker typo such as--for worker-10is accepted, persisted as the capture owner at bin/fm-procevent-lib.sh:1062, and later causespublish_resultto create an ownerlessworker-10.inboxat bin/fm-procevent.sh:756 while suppressing the firstmate wake; lines 760-767 find no metadata and ring nobody, so captain feedback remains stranded indefinitely. Validate the task’s regular, identity-matching endpoint metadata before publishing a task-owned registration.bin/fm-procevent.sh:545- Intent contradiction: “re-arm is an acknowledgement” requires an open captured round, but the same task may re-arm while no round is pending. Concrete sequence: worker-1 arms with reply A; while that listener still owns the claim, a repeated arm stages reply B and replaces the registration at bin/fm-procevent.sh:613; the acknowledgement loop at bin/fm-procevent.sh:621 is empty; after the old listener captures feedback, the proper next re-arm replaces the registration again and stale cleanup at bin/fm-procevent.sh:632 deletes reply B without ever posting it. Remove this extra acceptance path by refusing same-owner replacement unless an unacknowledged nonterminal round exists; initial arm remains the source-absent path.bin/fm-procevent.sh:1868- The half-finished-conclude recovery path can retire a later board generation. Concrete sequence: acknowledge terminal sequence 1, arm a new Lavish session using the same artifact/source ID, then repeat the idempotenthandled <id> 1call. Because lines 1868-1883 inspect the old terminal result but never check whether it is already handled or belongs to the current registration, they delete the new registration beforefm_procevent_mark_handledreportsalready-handled. The same unsupported fallback is asserted at tests/fm-procevent.test.sh:1050 and documented at docs/configuration.md:893. No authoritative intent requirement requires recovering the legacy marker-before-retirement state, and safely retaining that behavior would require new generation binding; remove this extra recovery path and only retire for a currently unhandled terminal round.🔧 Fix applied.
16 issues (13 errors, 3 warnings) still open:
bin/fm-procevent.sh:740- The immediate inbox doorbell passes task IDworker-1as the expected endpoint label, but task endpoints usefm-worker-1(as derived byfm_backend_expected_label_of_selectorandwindow_label). Identity-checking backends such as Zellij reject the mismatched label, so feedback is durably queued but the worker is not notified until the watcher's delayed re-ring. Derive and pass the canonical expected label here.bin/fm-procevent.sh:549- A failed re-arm can corrupt the still-valid prior registration. For example, after an arm stagesid.replybut before its runner starts, retrying with a nonexistent reply path deletesid.replyat line 549 and then fails validation at line 562; the unchanged source still references that deleted file, so every launch exits without polling and captain feedback is no longer collected. The same invariant is violated when line 570 replaces the prior reply before registration publication can fail at line 576. Stage the new reply under a generation-specific path and only clean the prior reply after the new source record commits, so every failed re-arm leaves the previous registration executable.bin/fm-procevent.sh:492- Intent contradiction: the requirement says “Register refuses a second armer (naming the holder)” and firstmate must never arm a worker-hosted board, but ownership checks consult only the live.source. After a worker-owned terminal capture,retire_owned_terminal_sourceremoves that record while the unhandled.owner-taskevidence remains; a subsequent ordinary Lavisharmsees nosource_kind, publishes a firstmate registration at line 501, and reconcile polls the ended worker board. The sibling task path also checks pending results only for terminality at lines 529-536: after explicit retirement of an open nonterminal round, another task can register and lines 581-588 acknowledge the original owner’s capture. Registration must honor immutable pending owner evidence even when the source record is absent.bin/fm-procevent.sh:711- Terminal worker rounds have no completion path. The terminal message says only to stop, while re-arm is prohibited at lines 529-535 and re-arm is the only new path that writes handled markers at lines 581-588. Consequentlysession_ended, empty End, and missing captures remain pending forever and every reconcile republishes/rings them. The new test at tests/fm-procevent.test.sh:794-799 confirms only sequences 1 and 2 are handled and leaves terminal sequence 3 open. Instruct the worker to acknowledge the terminal sequence with the existinghandledcommand after processing it, and verify that terminal pending state clears.bin/fm-procevent.sh:569- The latest fix round left the second half of the failed-rearm corruption sequence intact. A prior registration can still reference$id.reply; re-arm overwrites that shared file at line 569 before publication at line 575, so a publication failure makes the prior registration send the new reply even though re-arm reported failure. If publication succeeds but handled-marker creation fails at line 584, the failed command likewise leaves the replacement registration installed. Keep the prior registration and reply generation intact until registration publication and acknowledgement commit, rolling back on either failure; use generation-specific reply paths rather than the shared destination.bin/fm-procevent.sh:1829- Intent contradiction: the requirement says the owning source remains authoritative until acknowledgement, but explicitretirestill removes a task-owned source with an open round. Concrete path: worker-1 captures nonterminal feedback,retireremoves its source, then worker-2 registers at lines 533-551 and lines 585-592 mark worker-1's capture handled because only terminality—not captured owner—is checked. Ordinary registration can likewise replace the retired owner at lines 496-504. Round 3's ownership fix left this explicit-retirement sibling path behind, and the new test at tests/fm-procevent.test.sh:800 never executes the required retire/re-register sequence. Refuse retirement while a task-owned capture is unacknowledged, and only let re-arm acknowledge captures whose immutable owner matches the registering task.bin/fm-procevent.sh:731- Repeat delivery breaks after the worker consumes the first inbox notification.fm_task_inbox_write_idempotentcan return the matching record underinbox/handled/; line 740 then rings using that path, andfm_task_inbox_doorbell_linederivesinbox/handledas the inbox and instructs the worker to move the record into nonexistenthandled/handled/. If the worker moved the notification before crashing or re-arming, every reconcile repeats this malformed doorbell and no active inbox record restores the still-open round. When the matching record is already handled but the process result remains unacknowledged, create or reference a valid active inbox delivery rather than ringing the handled pathname.bin/fm-procevent.sh:1814- Terminal acknowledgement ignores failure to remove the source and still printsretired. If removal fails, the handled marker already suppresses the terminal result, while reconcile sees a task-owned source with no pending round and launches another poll, producing duplicate terminal captures. Check removal and roll back the newly created handled marker on failure so the source remains owned and round-open.bin/fm-procevent.sh:1826- The new task-terminal path retires the source whenhandledsucceeds, but the public command help at line 85 still states that marking a result handled does not retire its registration or claim. Document the task-owned terminal exception so callers do not rely on a guarantee this change invalidates.bin/fm-procevent.sh:1832- Terminal acknowledgement is not crash-recoverable. If the process dies after creating the handled marker here but before removing the source at line 1836,source_pendingpermanently hides that terminal result. A repeatedhandledcall therefore does not setconclude, register-task's terminal check at lines 554-561 permits re-arm, and reconcile's pending guard at lines 1561-1565 permits another poll of the ended board. Round 5's r11 fix handles an ordinary removal error but left this crash sibling reachable. Detect and finish a handled terminal conclusion at the shared task-source boundaries before either re-arm or reconcile can launch it again.bin/fm-procevent.sh:589- The selected r7 failed-rearm invariant remains unresolved. The replacement registration commits here and stale reply generations are deleted at lines 594-598 before the existing round is acknowledged at lines 601-608. If handled-marker creation fails, the command reports failure but leaves the replacement registration and reply installed rather than preserving the prior executable registration. Keep the prior registration generation until acknowledgement commits, and restore it plus its reply on acknowledgement failure.bin/fm-procevent.sh:554- Task registration treats every unhandled result sharing the source ID as the registering worker's round, without checking its immutable owner sidecar. Concrete path: firstmate captures nonterminal feedback, explicitly retires that source before handling it, then a worker arms the same artifact. Lines 554-561 accept the legacy result and lines 601-608 silently mark it handled even though it was never routed to that worker. Filter both terminal validation and acknowledgement to captures whose.owner-taskequals the registering task, and refuse unmatched pending captures rather than consuming them.bin/fm-procevent.sh:532-register-taskvalidates only the task-id syntax, not that it identifies a current task endpoint. A worker typo such as--for worker-10is accepted, persisted as the capture owner at bin/fm-procevent-lib.sh:1062, and later causespublish_resultto create an ownerlessworker-10.inboxat bin/fm-procevent.sh:756 while suppressing the firstmate wake; lines 760-767 find no metadata and ring nobody, so captain feedback remains stranded indefinitely. Validate the task’s regular, identity-matching endpoint metadata before publishing a task-owned registration.bin/fm-procevent.sh:545- Intent contradiction: “re-arm is an acknowledgement” requires an open captured round, but the same task may re-arm while no round is pending. Concrete sequence: worker-1 arms with reply A; while that listener still owns the claim, a repeated arm stages reply B and replaces the registration at bin/fm-procevent.sh:613; the acknowledgement loop at bin/fm-procevent.sh:621 is empty; after the old listener captures feedback, the proper next re-arm replaces the registration again and stale cleanup at bin/fm-procevent.sh:632 deletes reply B without ever posting it. Remove this extra acceptance path by refusing same-owner replacement unless an unacknowledged nonterminal round exists; initial arm remains the source-absent path.bin/fm-procevent.sh:1868- The half-finished-conclude recovery path can retire a later board generation. Concrete sequence: acknowledge terminal sequence 1, arm a new Lavish session using the same artifact/source ID, then repeat the idempotenthandled <id> 1call. Because lines 1868-1883 inspect the old terminal result but never check whether it is already handled or belongs to the current registration, they delete the new registration beforefm_procevent_mark_handledreportsalready-handled. The same unsupported fallback is asserted at tests/fm-procevent.test.sh:1050 and documented at docs/configuration.md:893. No authoritative intent requirement requires recovering the legacy marker-before-retirement state, and safely retaining that behavior would require new generation binding; remove this extra recovery path and only retire for a currently unhandled terminal round.bin/fm-procevent.sh:1877- Terminal acknowledgement removes the board registration before proving the handled marker can be written. Concrete path: the source directory is writable butstate/procevent-inboxcannot allocate a marker (for example, permissions or inode exhaustion); line 1877 successfully removes the source, line 1883 fails, and the command reports an error while leaving the terminal round open and its only ownership record gone. A subsequent ordinary arm at line 506 can then replace the still-unacknowledged worker board, while worker re-adoption remains blocked by the terminal check at line 569. Round 10's selected r24 fix correctly prevents a repeated acknowledgement from retiring a newer generation, but left this ordinary failure sibling behind. Preserve the current registration before removal and restore it iffm_procevent_mark_handledfails, while retaining the new open-round check and without adding generation-binding machinery.🔧 Fix applied.
18 issues (14 errors, 4 warnings) still open:
bin/fm-procevent.sh:740- The immediate inbox doorbell passes task IDworker-1as the expected endpoint label, but task endpoints usefm-worker-1(as derived byfm_backend_expected_label_of_selectorandwindow_label). Identity-checking backends such as Zellij reject the mismatched label, so feedback is durably queued but the worker is not notified until the watcher's delayed re-ring. Derive and pass the canonical expected label here.bin/fm-procevent.sh:549- A failed re-arm can corrupt the still-valid prior registration. For example, after an arm stagesid.replybut before its runner starts, retrying with a nonexistent reply path deletesid.replyat line 549 and then fails validation at line 562; the unchanged source still references that deleted file, so every launch exits without polling and captain feedback is no longer collected. The same invariant is violated when line 570 replaces the prior reply before registration publication can fail at line 576. Stage the new reply under a generation-specific path and only clean the prior reply after the new source record commits, so every failed re-arm leaves the previous registration executable.bin/fm-procevent.sh:492- Intent contradiction: the requirement says “Register refuses a second armer (naming the holder)” and firstmate must never arm a worker-hosted board, but ownership checks consult only the live.source. After a worker-owned terminal capture,retire_owned_terminal_sourceremoves that record while the unhandled.owner-taskevidence remains; a subsequent ordinary Lavisharmsees nosource_kind, publishes a firstmate registration at line 501, and reconcile polls the ended worker board. The sibling task path also checks pending results only for terminality at lines 529-536: after explicit retirement of an open nonterminal round, another task can register and lines 581-588 acknowledge the original owner’s capture. Registration must honor immutable pending owner evidence even when the source record is absent.bin/fm-procevent.sh:711- Terminal worker rounds have no completion path. The terminal message says only to stop, while re-arm is prohibited at lines 529-535 and re-arm is the only new path that writes handled markers at lines 581-588. Consequentlysession_ended, empty End, and missing captures remain pending forever and every reconcile republishes/rings them. The new test at tests/fm-procevent.test.sh:794-799 confirms only sequences 1 and 2 are handled and leaves terminal sequence 3 open. Instruct the worker to acknowledge the terminal sequence with the existinghandledcommand after processing it, and verify that terminal pending state clears.bin/fm-procevent.sh:569- The latest fix round left the second half of the failed-rearm corruption sequence intact. A prior registration can still reference$id.reply; re-arm overwrites that shared file at line 569 before publication at line 575, so a publication failure makes the prior registration send the new reply even though re-arm reported failure. If publication succeeds but handled-marker creation fails at line 584, the failed command likewise leaves the replacement registration installed. Keep the prior registration and reply generation intact until registration publication and acknowledgement commit, rolling back on either failure; use generation-specific reply paths rather than the shared destination.bin/fm-procevent.sh:1829- Intent contradiction: the requirement says the owning source remains authoritative until acknowledgement, but explicitretirestill removes a task-owned source with an open round. Concrete path: worker-1 captures nonterminal feedback,retireremoves its source, then worker-2 registers at lines 533-551 and lines 585-592 mark worker-1's capture handled because only terminality—not captured owner—is checked. Ordinary registration can likewise replace the retired owner at lines 496-504. Round 3's ownership fix left this explicit-retirement sibling path behind, and the new test at tests/fm-procevent.test.sh:800 never executes the required retire/re-register sequence. Refuse retirement while a task-owned capture is unacknowledged, and only let re-arm acknowledge captures whose immutable owner matches the registering task.bin/fm-procevent.sh:731- Repeat delivery breaks after the worker consumes the first inbox notification.fm_task_inbox_write_idempotentcan return the matching record underinbox/handled/; line 740 then rings using that path, andfm_task_inbox_doorbell_linederivesinbox/handledas the inbox and instructs the worker to move the record into nonexistenthandled/handled/. If the worker moved the notification before crashing or re-arming, every reconcile repeats this malformed doorbell and no active inbox record restores the still-open round. When the matching record is already handled but the process result remains unacknowledged, create or reference a valid active inbox delivery rather than ringing the handled pathname.bin/fm-procevent.sh:1814- Terminal acknowledgement ignores failure to remove the source and still printsretired. If removal fails, the handled marker already suppresses the terminal result, while reconcile sees a task-owned source with no pending round and launches another poll, producing duplicate terminal captures. Check removal and roll back the newly created handled marker on failure so the source remains owned and round-open.bin/fm-procevent.sh:1826- The new task-terminal path retires the source whenhandledsucceeds, but the public command help at line 85 still states that marking a result handled does not retire its registration or claim. Document the task-owned terminal exception so callers do not rely on a guarantee this change invalidates.bin/fm-procevent.sh:1832- Terminal acknowledgement is not crash-recoverable. If the process dies after creating the handled marker here but before removing the source at line 1836,source_pendingpermanently hides that terminal result. A repeatedhandledcall therefore does not setconclude, register-task's terminal check at lines 554-561 permits re-arm, and reconcile's pending guard at lines 1561-1565 permits another poll of the ended board. Round 5's r11 fix handles an ordinary removal error but left this crash sibling reachable. Detect and finish a handled terminal conclusion at the shared task-source boundaries before either re-arm or reconcile can launch it again.bin/fm-procevent.sh:589- The selected r7 failed-rearm invariant remains unresolved. The replacement registration commits here and stale reply generations are deleted at lines 594-598 before the existing round is acknowledged at lines 601-608. If handled-marker creation fails, the command reports failure but leaves the replacement registration and reply installed rather than preserving the prior executable registration. Keep the prior registration generation until acknowledgement commits, and restore it plus its reply on acknowledgement failure.bin/fm-procevent.sh:554- Task registration treats every unhandled result sharing the source ID as the registering worker's round, without checking its immutable owner sidecar. Concrete path: firstmate captures nonterminal feedback, explicitly retires that source before handling it, then a worker arms the same artifact. Lines 554-561 accept the legacy result and lines 601-608 silently mark it handled even though it was never routed to that worker. Filter both terminal validation and acknowledgement to captures whose.owner-taskequals the registering task, and refuse unmatched pending captures rather than consuming them.bin/fm-procevent.sh:532-register-taskvalidates only the task-id syntax, not that it identifies a current task endpoint. A worker typo such as--for worker-10is accepted, persisted as the capture owner at bin/fm-procevent-lib.sh:1062, and later causespublish_resultto create an ownerlessworker-10.inboxat bin/fm-procevent.sh:756 while suppressing the firstmate wake; lines 760-767 find no metadata and ring nobody, so captain feedback remains stranded indefinitely. Validate the task’s regular, identity-matching endpoint metadata before publishing a task-owned registration.bin/fm-procevent.sh:545- Intent contradiction: “re-arm is an acknowledgement” requires an open captured round, but the same task may re-arm while no round is pending. Concrete sequence: worker-1 arms with reply A; while that listener still owns the claim, a repeated arm stages reply B and replaces the registration at bin/fm-procevent.sh:613; the acknowledgement loop at bin/fm-procevent.sh:621 is empty; after the old listener captures feedback, the proper next re-arm replaces the registration again and stale cleanup at bin/fm-procevent.sh:632 deletes reply B without ever posting it. Remove this extra acceptance path by refusing same-owner replacement unless an unacknowledged nonterminal round exists; initial arm remains the source-absent path.bin/fm-procevent.sh:1868- The half-finished-conclude recovery path can retire a later board generation. Concrete sequence: acknowledge terminal sequence 1, arm a new Lavish session using the same artifact/source ID, then repeat the idempotenthandled <id> 1call. Because lines 1868-1883 inspect the old terminal result but never check whether it is already handled or belongs to the current registration, they delete the new registration beforefm_procevent_mark_handledreportsalready-handled. The same unsupported fallback is asserted at tests/fm-procevent.test.sh:1050 and documented at docs/configuration.md:893. No authoritative intent requirement requires recovering the legacy marker-before-retirement state, and safely retaining that behavior would require new generation binding; remove this extra recovery path and only retire for a currently unhandled terminal round.bin/fm-procevent.sh:1877- Terminal acknowledgement removes the board registration before proving the handled marker can be written. Concrete path: the source directory is writable butstate/procevent-inboxcannot allocate a marker (for example, permissions or inode exhaustion); line 1877 successfully removes the source, line 1883 fails, and the command reports an error while leaving the terminal round open and its only ownership record gone. A subsequent ordinary arm at line 506 can then replace the still-unacknowledged worker board, while worker re-adoption remains blocked by the terminal check at line 569. Round 10's selected r24 fix correctly prevents a repeated acknowledgement from retiring a newer generation, but left this ordinary failure sibling behind. Preserve the current registration before removal and restore it iffm_procevent_mark_handledfails, while retaining the new open-round check and without adding generation-binding machinery.bin/fm-procevent.sh:1876- Round 11's selected r15 crash-recovery fix remains unresolved. A crash afterfm_procevent_mark_handledcreates the marker but before line 1880 removes the task-owned registration leaves a terminal board registered with no pending round. Repeatinghandledcannot conclude it because line 1869 searches only unhandled results;startat line 951 andreconcileat line 1606 then see no pending result and poll the ended board again, violating the required never-auto-rearm terminal invariant. Persist enough conclusion state to finish this exact interrupted transition at the shared start/reconcile boundaries without allowing an old acknowledgement to retire a later registration generation..agents/skills/process-event-sources/SKILL.md:125- The operational skill still universally says a terminal adapter result has already retired its source, contradicting the newly documented task-owned exception at line 39 where the source remains registered untilhandled. The same universal description remains in docs/configuration.md:928. Round 11's r13 documentation fix updated the command help but left these sibling instructions behind; qualify both generic statements so agents do not skip the terminal acknowledgement that actually retires a worker-owned board.🔧 Fix applied.
✅ Re-checked - no issues remain.
live-round1-routing.txtshows the real feedback inworker-live.inbox, the complete captured message, and an absent firstmate wake queue.live-board-round2.pngvisibly shows the captain message and worker reply;live-rearm-state.txtrecords round one handled while the source remains registered.live-second-armer-refusal.txtrecords nonzero status and namesworker-liveas the owner.live-terminal-open.txt,live-board-ended.png, andlive-terminal-final-state.txtshow the terminal instruction, zero starts while open, retirement on handled acknowledgement, and zero starts afte…tests/fm-procevent.test.shProvisioned and operated isolated Herdr sessionfm-lab-lavish-live-56223-23765exclusively throughbin/fm-herdr-lab.sh, then verified guarded teardown.Armed the real Lavish board withFM_HOME=<isolated-home> bin/fm-procevent-lavish.sh arm <board> --for worker-live, launched it throughbin/fm-procevent.sh reconcile, and submitted browser feedback usingchrome-devtools-axi.Re-armed the board with--agent-reply-file, verified round-one acknowledgement and the rendered agent reply, then submitted a realSend & Endterminal round.Attempted a competing firstmate arm while the terminal round remained open, acknowledged the terminal result withbin/fm-procevent.sh handled <source> 2, and reconciled again to verify no restart.Confirmedgit status --shortremained clean after testing.✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.