Repository navigation
docs(adr): name the real reason a bespoke event type gets dropped (#968 follow-up) - #972
Conversation
… follow-up) ADR-018 D5 justifies "no `claim.expired` event type" with a mechanism that is false: `extractPrompt` does NOT return null for everything outside `PROMPT_EVENT_TYPES`. It handles `heartbeat`, `agent.ask` and `agent.ask.response` in explicit branches below the set (cli/src/commands/agent.js:628-663), and the set's own comment says so. The decision is unaffected — a bespoke type really would be dropped — but for a different reason: `extractPrompt` has no branch for it and falls through to null at the end, and a wrapper cannot grow a branch without a release. The boundary is the branch, not the set. The same sentence had been copied into two more places, both reaching the same right conclusion from the same wrong premise: - backend/services/welcomeWakeService.ts (the enqueue comment) - backend/__tests__/unit/services/welcomeWakeService.test.js (describe block) All three corrected together. Comments and prose only; no behavior change, no test assertion touched. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
lilyshen0722
left a comment
There was a problem hiding this comment.
Verified at 018e8783.
The mechanism claim holds. On origin/main, cli/src/commands/agent.js extractPrompt has explicit branches for heartbeat (:628), agent.ask (:634) and agent.ask.response (:648) after the PROMPT_EVENT_TYPES block and before the trailing return null. So the original premise ("returns null outside PROMPT_EVENT_TYPES") was false as stated, and the replacement ("no branch → falls through to null; the boundary is the branch, not the set") is accurate.
The enumeration is complete. I checked this two ways rather than trusting the token:
git grep PROMPT_EVENT_TYPES origin/main -- . ":!cli/src"→ exactly the three files this PR touches.- Untokened phrasings that could carry the same premise without naming the set (
unknown event type,drops? (unknown|unrecognized),silently (drop|ignore)) → no fourth site; the only hit in this area iswelcomeWakeService.ts:224, already one of the three.
Fixing all three together is the right call — a corrected ADR next to two uncorrected copies is how the false version wins the next grep.
One nit, non-blocking. backend/services/welcomeWakeService.ts:227 is 124 characters; every other line in that comment block is ≤79. It reads as text inserted without re-wrapping the paragraph. Worth a rewrap purely for the diff's sake.
It will not fail CI, and that is the more interesting part: backend/package.json lint is eslint . --ext .js, so none of the 286 tracked .ts files under backend/ are linted at all. max-len is configured (.eslintrc.js:26, warn, 120) and simply cannot fire on them. tsc:check covers types, not lint rules. Out of scope here — flagging it because "npm run lint → 0 errors" reads as coverage it does not have.
@sprint-review's review nit: the forward-ported sentence landed at 124 chars inside a block that is otherwise <=79, so the paragraph read as two different comments. No behaviour change — backend eslint is --ext .js and covers zero .ts files, so CI could never have caught it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
ADR-018 D5 argues there should be no
claim.expiredevent type, and backs it with a mechanism that is false:extractPrompthandles three types outside that set, in explicit branches below it —heartbeat,agent.ask,agent.ask.response(cli/src/commands/agent.js:628-663). The set's own comment says as much:The decision is unaffected. A bespoke
claim.expiredreally would be dropped — but becauseextractPrompthas no branch for it and falls through toreturn nullat the end, and a deployed wrapper cannot grow a branch without a release. The boundary is the branch, not the set.Why it is worth a PR rather than a note: #968 ratified ADR-018, and its status line names exactly two unsettled items (D4's lease length, BYO compliance). Everything else now reads as verified, including this.
Three copies, not one
The same sentence had been copied into two more places, both reaching the right conclusion from the wrong premise:
docs/adr/ADR-018-agent-attention-claims.mdclaim.expiredtypebackend/services/welcomeWakeService.tschat.mentionbackend/__tests__/unit/services/welcomeWakeService.test.jsAll three corrected together, so grep does not resurface the false version.
Comments and prose only — no behavior change, no test assertion touched.
🤖 Generated with Claude Code