Repository navigation
Description
Problem
The adapter records why capture stopped, and the human-facing report does not carry it. Two instances, same shape, both verified at the current pull-request heads.
- Unverified host lifetime renders as a switch the user never touched. When the oh-my-pi adapter cannot verify the host's shutdown contract it sets auto-capture off and writes
auto_capture_disabledwithreason=unverified_host_lifetime. The health states enumerated insrc/status/metrics.tsareoff,switch_mismatch,invalid_model,no_capabilities,on— there is no state for a failed verification — so startup derivesoffandmemory_statusprintsauto-capture: off (autoCapture: false). The user is told they turned it off. The real reason is one record away in the same store and nothing reads it. - A queue-overflow drop names no reason.
queue_fullis emitted as a drop reason by the oh-my-pi capture path, but the terminal-reason whitelist in the health metrics lists onlycompleted,request_timeout,host_cancelled,host_shutdown,capture_threwandinsufficient_host_grant. An overflow therefore advances the skipped counter without ever naming why, which is why the queue-overflow ticket can only be closed partially.
Both are the same defect class: a reason code exists in the evidence log and has no counterpart in the report vocabulary, so the degradation is real, logged, and invisible to the person it happened to.
Required
Every reason code a capture path can emit has exactly one rendering in the human report, and the enumeration is checked rather than curated by hand. Concretely: add a health state for a capture that is off because the host contract could not be verified, named from the recorded reason rather than from the option value; add the queue-overflow reason to the terminal reasons the health line considers; and add a test that enumerates the emitted reason codes and fails when any lacks a report rendering or a health state.
Wording follows the existing pattern: name the cause, name the consequence, and say what to do. no_capabilities is the model to copy.
Invariant
Reporting changes only what is displayed. The state must be derived from the record the adapter already writes, not from a second decision the report makes on its own, otherwise the log and the report can disagree and the log stops being evidence.
Acceptance
A host stub whose shutdown contract cannot be verified yields a report line naming the verification failure rather than an autoCapture: false line, while the memory tools, commands, recall and injection all remain available. A queue overflow yields a report line naming overflow. A test enumerating capture reason codes fails when a new code is added without a report rendering. Every added announcement string is pinned by whole-string equality on delivered bytes, with no ticket numbers, dates or review narration inside them.
Non-goals
The general seam contract, the degradation ladder and the doctor entry point are tracked separately. This ticket is the two concrete gaps plus the enumeration rule that keeps them from recurring.
Activity
ocsi-triager commentedon Nov 30, 2026
Triager
1. Is the behaviour observable?
Yes, both instances. Each names a report line a person can read and a evidence record to compare it against:
auto_capture_disabled reason=unverified_host_lifetime(src/adapters/oh-my-pi/extension.ts:63), whilememory_statusprintsauto-capture: off (autoCapture: false)(src/status/report.ts:173) even though the user never set that option. Both sides are checkable from the ticket alone.queue_fullis emitted onauto_capture_skipped(src/adapters/oh-my-pi/capture.ts:183), and the terminal-reason whitelist atsrc/status/metrics.ts:287-294confirms it is absent, so the report's outcome line can never name it.Reproduction is concrete: existing tests (
test/host/oh-my-pi-lifetime.test.ts,test/host/oh-my-pi-capture.test.ts) already drive both conditions.2. Are the acceptance criteria stated?
Yes, in the "Acceptance" section, quoted verbatim:
3. Is anything missing that would stop a competent stranger from starting?
Nothing blocking — the two concrete gaps are locatable and the wording pattern (
no_capabilities) is given. One scope question they will hit and should resolve before writing the enumeration test:capture_unavailableis a third drop reason emitted alongsidequeue_full(src/adapters/oh-my-pi/capture.ts:41) and is also missing from both the terminal whitelist and any report rendering — same defect class, yet the "Required" section asks only forqueue_full. The new enumeration test will trip on it immediately. Whether this ticket owescapture_unavailablea rendering, or the enumeration's scope is defined to exclude it, is unstated.src/adapters/pi/capture.ts:38) emits the same drop-code set; the ticket names only the oh-my-pi path, and the adapter boundary rules require affected copies be handled independently. Which adapter(s) the enumeration test enumerates should be pinned down.Neither stops the two required changes; both are decisions the architect can settle inside this ticket.
HANDOFF: @architect
ocsi-triager commentedon Nov 30, 2026
Triager
Verified the ticket's claims against head
d7521e6before answering.Is the behaviour observable? Yes. Both symptoms are user-visible text from
memory_status: the current report printsauto-capture: off (autoCapture: false)(src/status/report.ts:173) whenever the newestplugin_loadheartbeat namesoff, with no branch for a verification failure — the reason only exists in theauto_capture_disabled reason=unverified_host_lifetimeline that health never reads. The overflow claim is mechanical and checkable:dropped()writesauto_capture_skippedwithqueue_full(src/adapters/oh-my-pi/capture.ts:39-50,183), and the terminal-reason whitelist incaptureHealth(src/status/metrics.ts:284-297) covers onlyauto_capture_finish/auto_capture_refusedwith the six listed reasons, so the drop names nothing in the report. A person hitting either sees the wrong line, not silence.Are the acceptance criteria stated? Yes, under "Acceptance":
Is anything missing that would stop a competent stranger? Nothing that blocks starting. One scope line is left open: the
piadapter emits the samequeue_fulldrop reason (src/adapters/pi/capture.ts:161), and the repo's adapter-boundary rules say equivalent defects in multiple adapters are fixed in each copy independently — the ticket names only the oh-my-pi capture path, so it is ambiguous whether the pi copy is in scope or deliberately deferred.@architect
ocsi-architect commentedon Nov 30, 2026
Architect
Where the behaviour lives
Symptom 1 is not authored in
captureLines; the report only repeats what a layer above decided.createOhMyPiMemory's catch —src/adapters/oh-my-pi/extension.ts:45-69— rewrites the user's own config (options.autoCapture = false, :57) and hands setup a stub host (captureUnavailable ? { subscribedEvents: [] } : capture.host, :361). The cause goes only to the console (:58) and toauto_capture_disabled reason=unverified_host_lifetime(:61-67).recordStartup'scaptureState—src/runtime/startup.ts:49-60— derives the heartbeat'scapture=value from options alone. It has no input capable of telling "user set false" from "the plugin disabled itself", so it emitsoff.captureHealth'splugin_loadbranch —src/status/metrics.ts:257-267, validated againstCAPTURE_STATES(:225) — copies that value intostate. No branch of the parser readsauto_capture_disabled.captureLinescase"off"—src/status/report.ts:170-173— prints the config-blaming sentence.Symptom 2:
dropped()andpublish()'s cap —src/adapters/oh-my-pi/capture.ts:39-50,182-185; pi copy:33-45,159-162— writesauto_capture_skipped reason=queue_full. The reader that swallows it iscaptureHealth's tail,src/status/metrics.ts:320-341, which collapses every skip into one timestamp (lastSkipped, :325) and keeps no reason. What the user then reads comes from the inert ladder inreport.ts:186-230: the skip accounts for the arrival (:347-348, :361), soarrivedWithoutStartis false and the line is "ARMED BUT NEVER FIRED — no turn-end event was observed". The ticket understates this: the report does not stay silent about the drop, it names the opposite of what happened.And the terminal whitelist at
metrics.ts:284-297is not where the drop reason belongs — a drop is not a terminal receipt; adding it there would make a saturated pipeline readon, last outcome queue_full, i.e. alive.The invariant that broke
Every capture decision that ends with no pass has exactly one rendering, and it is reached through the channel the reader treats as authoritative for that kind of fact: configured state travels only in the newest
plugin_loadheartbeat; reason codes travel in the evidence line that carries them, and the reader must keep the code, not just the timestamp. No decision may fall through to a neighbouring branch.A proposed fix restores it if, for the newest evidence, the report's line changes exactly when the underlying decision changes, and adding a reason code without a rendering fails instead of borrowing someone else's line. A fix that special-cases
captureLineswhile the heartbeat still saysofffails the first half — the state machine reads the heartbeat, so a report-side guess must either contradict it or stay silent.Smallest shape, and what it costs
Cause of disable: put the cause on the host the adapter already substitutes. One optional diagnostic field on
MemoryCaptureHost(src/host/capture.ts:23), set on thecaptureUnavailablestub atextension.ts:361;recordStartupfolds it intocaptureStatebefore theswitch_mismatchtest (:49-55);metrics.tswidensCaptureHealthState(:159) andCAPTURE_STATES(:225);report.tsgains one case. Five files, one new value in a format the parser validates, and the state string also prints raw in the cross-harness summary (src/status/harness-stats.ts:180).The cheaper-looking reader-only fix — parse
auto_capture_disabledincaptureHealth— is wrong in the field and should be refused up front: evidence lines carry no process or run id (buildEvidenceLine,src/telemetry/record.ts:158-182), onlytsandharness, and the disabled line is written before its own heartbeat. Correlating a 30-day line with "this startup" is guesswork: a user who switches toautoCapture: falseon a repaired host keeps reading "verification failed" for a month.Overflow: shared code only.
captureHealthalready reads the event and discards the reason (:325); keep the newest drop's code and render it. No adapter edit, which settles the triager's open question: the fix serves both harnesses from the engine, and pi's copy is touched only by the item below. Verify pi through the same reader —test/host/pi.test.ts:41already pins its drop line.The enumeration criterion is the real cost, and the ticket does not say why: there is nothing to enumerate today.
EvidenceEvent = string(src/telemetry/record.ts:31); drop codes are inline literal unions in each adapter'sdropped()signature; terminal reasons are a bare string array inmetrics.ts. A test that lists strings by hand passes while a new code goes unrendered. Making it fail when it should means declaring the codes once in shared code the adapters may import —src/host/capture.tsis permitted bysrc/adapters/AGENTS.md, adapter-to-adapter is not — typing each adapter's drop parameter from it, keying the report's rendering off it, and asserting the rendering covers the list. The user-facing strings are the cheap part of this ticket.What can go wrong that the ticket does not mention
report.ts:198). Real saturation happens in a window that also holds successes, where theon, last fired…line prints and the overflow stays invisible. A test feeding onequeue_fullline and nothing else passes either way. Overflow answers "what was lost", not "why nothing ran", so it must ride alongside the alive line, outside a ladder whose ordering comments (:199-215) are load-bearing.queue_fullis not the only blind code:capture_unavailable(oh-my-pi/capture.ts:172,pi/capture.ts:150) is the same class, and the enumeration test will name it.host_shutdownis worse — the same code means a dropped turn inauto_capture_skippedand a cancelled request inauto_capture_finish. Key renderings by event and code or one of them lies.auto_capture_skippedis shared with the core's ordinary skips —session_moved,no-signal,transcript_too_thin(src/runtime/capture.ts:364,467,489) — one of which the quietest healthy turn writes. Keying on the event accuses every idle session of overflow.switch_mismatchshadow: withcaptureOnCompact: trueplus a failed verification, the heartbeat saysswitch_mismatchand the report blames the user's switch. Folding the new state after that branch fails criterion 1 for exactly that config.unknown(metrics.ts:263) and prints "no plugin_load heartbeat in the evidence files (plugin never loaded here?)" (report.ts:240-243) — false when a heartbeat is merely unrecognized. Pre-existing, newly reachable; either correct that default's claim or state the limit.docs/internals/auto-capture-evidence.md:27,README.oh-my-pi.md:130,docs/reference/oh-my-pi.md:272. They are part of the change.captureLinesoutput is already asserted by whole-array equality intest/status/status.test.ts:753-805, andtest/host/oh-my-pi-lifetime.test.ts:130-138pins the evidence reason — extend those rather than adding files. Notetest:oh-my-piruns its owntscpass andintegration/oh-my-pi/capture-shutdown-runner.ts:85reads the disabled line, so any change to its emission lands there too.@fix
abogartz-opencode-self-improvement commentedon Dec 1, 2026
🎉 This issue has been resolved in version 0.41.2 🎉
The release is available on:
Your semantic-release bot 📦🚀