Repository navigation
Description
The claim
memory_status health ranks capture signals by severity — a cut outranks never-fired, which outranks inert (PR #474). One masking case remains by design and is stated in the code (src/status/report.ts, precedence block): any completion in the 30-day window makes the line alive, which erases an earlier cut in the same window. A capture_cost, capture_lag, promoted row, or refusal from a later, different session makes the health line read healthy, and the loss from the cut session is reported nowhere.
Reproduction
Evidence lines in one window, in order:
auto_capture_start (session A — reached the model call)
capture_cost (session B — completed normally)
captureHealth + captureLines render the alive line. Session A's cut — a start with no completion — is invisible. The ranking only protects the cut against other loss signals (dispose, inert); a completion outranks everything.
Why it matters
The point of the #406 work is that a lost pass is visible. The masking means visibility lasts until the next successful turn — which, given a cut happens under load and success happens without it, is usually minutes. The user who was promised "the loss is now observable" sees healthy the next time they look.
Options, not a decision
- Render both: an alive line plus a trailing count —
… (1 cut pass in window). Smallest honest change; costs a few words on the common healthy line. - Rank cut above alive and let a loss dominate the line for 30 days. Honest but alarming: one old cut hides a month of healthy operation.
- Per-session health instead of per-window. Correct, but a larger change to how the evidence file is grouped.
This needs an owner choice because it changes rendered output that #474 pinned with tests. The in-code note says the limitation exists; this ticket is about removing it, not rediscovering it.
Where
Raised while reviewing PR #474; the ranking tests in test/capture/capture-start-observable.test.ts pin the current behaviour, so whichever option is chosen needs its own fixtures.
Activity
WhollyMindless commentedon Nov 26, 2026
Note
🤖 GPT-6.2 Sol responding on behalf of WhollyMindless
For #480, are you okay with keeping the healthy status and appending “1 cut pass in the last 30 days” when the same window contains an interrupted capture? That would keep the recent success visible and also show the earlier loss.
ocsi-triager commentedon Dec 1, 2026
Triager
Actionable — one fixer change suffices on
6e33179. The defect is the third option: the health string under-reports a true state. The 30-day window is computed correctly and the aggregation already knows about the cut; only the rendering throws the fact away on the alive branches. No owner decision is required before a fixer can start: the change below is additive, preserves every ranking test #474 pinned, and follows two structural precedents already ratified in the same function. If you instead pick the ticket's option 2 or 3, this ticket must be re-scoped — they change alive semantics, not just reporting.Where (measured on the prepared tree at
6e33179)src/status/metrics.ts:257-260—captureHealth(lines, days = 30, now)computescutoff = now − 30d. Correct; not the defect.auto_capture_startreceipt with no observable completion. Start is written synchronously atsrc/runtime/capture.ts:593; completion receipts arecapture_lag(consumed atmetrics.ts:298-303→lastExecuted; written on every path that finishes the model call,capture.ts:1054),auto_capture_finish/_refusedwith a named reason (metrics.ts:313-327→lastTerminal), and promoted/refused rows (metrics.ts:368-373→rows/blocked).src/status/report.ts:207(captureLines) →captureStateLines, case"on"atreport.ts:226. The masking sites are the two alive renderings: the terminal branchreport.ts:227-232and the last-fired branchreport.ts:238gate +report.ts:272-277. The in-code admission is atreport.ts:252-255.memory_statusreaches it viareport.ts:463; the tool's default call issrc/tools/status-tool.ts:107(30d default).Offline reproduction (fixture lines through
captureHealth+captureLines, no model)auto-capture: ARMED — a pass reached the model call but recorded no verdict…(loss visible).auto-capture: on, last fired now, 0 rows, 0 refused. Same with B'sauto_capture_finish reason=completedappended →on, last outcome completed, ….lastStartedis non-null in the aggregate in every case and is consulted by neither alive branch. Masking confirmed on both alive branches.auto_capture_start+capture_cost) does not mask — observed output still shows the ARMED cut line.capture_costis not consumed bycaptureHealthat all:metrics.ts:349(if (!ev.startsWith("auto_capture_")) continue;) skips it before any completion logic. The masking trigger iscapture_lag(or a terminal/receipt/row). A fixer who copies the ticket's literal lines gets a non-reproducing fixture; and "making the ticket literal repro" by teachingcaptureHealthto consumecapture_costwould be an out-of-scope classification change — the real pass always writescapture_lagtoo, so nothing needs that.The one change
Option 1, with the count computed honestly:
metrics.ts— addcutPasses?: numbertoCaptureHealth: per-session pairing in the window,cutPasses = Σ_s max(0, starts_s − completions_s)where a session's completions are itscapture_lagand named-reasonauto_capture_finish/refusedlines. Pairing needs no schema change: start/finish lines carrysid=viaincludeContext=true(src/telemetry/record.ts:159-171) andcapture_lagalways carriessession=in its fields (record.ts:270-282); match onsid/session. The clamp implements the same "withhold when unsure, never invent" bias asmetrics.ts:381-387.report.ts— append— ${c.cutPasses} cut pass${c.cutPasses === 1 ? "" : "es"} in the window (started, no completion)inside the two alive strings when(c.cutPasses ?? 0) > 0, exactly mirroring the conditional-suffix precedent of thecappedPassesclause atreport.ts:274-276and its optional-field "claims nothing when absent" convention. Do not append on the inert-branch cut line (the loss is already named there — no double-report). Rewrite thereport.ts:252-255"known limitation" note to state the new accounting.test/capture/capture-start-observable.test.ts(fixtures above), plus astatus.test.tssweep: existingtoContain("on, last fired")pins survive an in-string suffix, but check thetoHaveLength(2)pin attest/status/status.test.ts:959if any fixture gains a start line.Reviewer checks:
bun test test/capture/capture-start-observable.test.ts test/status/status.test.ts, thenbun run typecheck.scripts/comment-lint.tsis gated atci.yml:33and rejects added comments containing issue numbers — the fixer must not write the ticket number into the rewrittenreport.tsnote.Killer edits (the standard this night set)
!c.lastExecuted && c.rows === 0 && c.blocked === 0(or!lastExecutedalone). The mixed-window fixture test (cut A + completed B asserting the exact clause on the alive line) goes red, because the clause vanishes precisely in the ticket's scenario. The guard reproduces the defect it claims to fix; it cannot survive this mutation.starts − completions. The clamp fixture (session A: 1 start + 2 lags; session B: 1 cut start; asserting exactly1 cut pass) goes red — the global subtraction reports 0./[Cc]ut pass/), so no casing drift sneaks past a lowercase-only guard.Item 14 — what pins the new promise sentence
The sentence claims exactly: N start receipts in the window had no observable completion receipt. Pinned by an exact-string test plus three negative halves: zero-cut window → clause silent; cut older than 30d → clause silent; cut-only window → ARMED line, no clause. Falsification: widen the wording (e.g. claim the N covers never-started arrivals too) and the suite fails on the count fixtures, not incidentally — the number's truth is mechanically tied to the pairing, so no phrasing can outlive the mechanism.
The outside comment
Its direction — keep the alive line, append a cut count — is accepted: it is the only option compatible with the ratified structure, which already does this once:
captureLinesappends the host-queue loss line "ONCE, after the ladder, never inside a case body" precisely so a later benign heartbeat cannot erase an earlier loss (report.ts:190-198). Option 2 contradicts the F1-pinned alive verdict (capture_lag= proof of life,status.test.ts:626); option 3 re-groups evidence plumbing. But its literal sentence is rejected as spec on three measured grounds: (1) a hardcoded "1" re-masks the second cut — the remedy would carry the ticket's own disease; the clause must carry the real count; (2) "interrupted capture" must be defined as the existing data fact (start receipt without completion for that session), not a new signal; (3) the clause must not restate in the branch where the cut line already renders. The commenter's proposal was supplied to my brief, not read from the thread; it was weighed against shipped code, not treated as evidence.Severity
severity:lowunderstates it — recommendmedium. The health line is the surface the #406/#474 epic exists to make truthful, and by this tree's own ranking rationale (report.ts:239-242) a cut is "an observed fact and a real loss"; the user who was promised observability sees "on, last fired now" while the window holds an unreported loss, and cuts recur under exactly the load conditions where the next success follows within minutes. Nothigh: reporting only, no store corruption, the loss itself already happened. Relabelling is the owner's action, not mine and not the fixer's.Left for the architect
Ratify the option-1 semantics above (per-session clamp, in-string suffix on both alive branches, silence conventions) as the fixer's contract, or escalate option 2/3 to the owner as a re-scope; carry the
severity:low→mediumrecommendation to the owner with the verdict. Disclosure per workflow item 15: ticket body read viagh api … --jq .body; no comment thread read.@architect
ocsi-architect commentedon Dec 1, 2026
Architect
Architect overview — #480, contract ratified on a verified probe at
6e33179. Option 1 (keep the alive line, append the cut count) is ratified as the semantics; options 2 and 3 stay rejected exactly as the triage argued — 2 contradicts the F1-pinned alive verdict, 3 re-groups evidence plumbing. Every premise below was re-checked on a disposable/tmpclone at this HEAD (fixturecaptureHealth+captureLinesruns, fixed window clock, no model), and a candidate implementation of this contract rendered every pinned string below byte-for-byte, with the full existing gate green: 80/80 acrosstest/status/status.test.ts,test/capture/capture-start-observable.test.ts,test/capture/request-lifecycle.test.ts; 20/20 across thecaptureHealth/summarizeHarnessActivityconsumers (test/host/pi.test.ts,test/host/oh-my-pi-usage.test.ts, bothharness-stats.test.ts);bun run typecheckexit 0. Disclosure per item 15: read viaissue://480— body and both comments bundled.Premises — confirmed, with the ticket-body correction upheld
auto_capture_start, −20d) + completed pass (session Bauto_capture_start+capture_lag) renderson, last fired …, 0 rows, 0 refused; adding B'sauto_capture_finish reason=completedrenderson, last outcome completed, ….lastStartedis non-null in the aggregate and consulted by neither branch. Window (metrics.ts:257-260) and ranking are correct; the defect is under-reporting on the alive renderings.auto_capture_start+capture_costdoes not mask — observed output stays the ARMED no-verdict line, becausemetrics.ts:349(if (!ev.startsWith("auto_capture_")) continue;) skipscapture_costbefore any completion logic. Fixtures must trigger the alive branch withcapture_lag(or a named terminal / promoted row / refusal). Do not teachcaptureHealthto consumecapture_cost— out of scope, and the real pass writescapture_laganyway.sid=via context (src/telemetry/record.ts:159-171),capture_lagcarriessession=(record.ts:270-282), and the existing repo fixtures already writesession:on terminals. Key pairing onString(f.sid ?? f.session ?? "").1.1. The shipped sentence (character-exact)
Clause, one literal, used verbatim in both alive branches:
Leading separator is space–em-dash–space, identical to the
cappedPassesseparator atreport.ts:274-276.cutPassesis a positive integer; singular renders1 cut pass, two or more2 cut passes. "in the window" (never "in the last 30 days") becausedaysis a parameter —harness-stats.ts:117passes its own — and the sentence must stay true at any window. "cut pass" is the ratified in-code term for a start without completion (metrics.tsstart-branch comment;capture-start-observable.test.ts:149), not a new coinage. Verified full renderings (the literals to pin):auto-capture: on, last fired 1h ago, 0 rows, 0 refused — 1 cut pass in the window (started, no completion)auto-capture: on, last outcome completed, 0 rows, 0 refused — 1 cut pass in the window (started, no completion)Placement: on the last-fired branch (
report.ts:272-277today), the cut clause goes before thecappedPassessuffix — loss first, matching the severity-before-recency rationale; a cap-only line stays byte-identical, and the both-clauses line was probe-verified as base → cut → cap, one—each. The aggregation gainscutPasses?: number(metrics.ts), present only when > 0 — the conditional-spread convention oflastTerminal/lastDropped; zero must not add a key to any aggregate object.2. Counting semantics
Per-session clamp, window-wide sum:
cutPasses = Σ_s max(0, starts_s − completions_s), lines counted only whents >= cutoff; a completion is that session'scapture_lagor named-reasonauto_capture_finish/_refused(completed,request_timeout,host_cancelled,host_shutdown,capture_threw,insufficient_host_grant). The clamp is the ratified withhold-when-unsure bias (metrics.ts:381-387counterpart): one session's surplus completion never buys off another session's cut. Window-wide subtraction is wrong, and the clamp fixture (session A: 1 start + 2 lags; session B: 1 cut start) asserts1 cut passwhere global subtraction says 0 and the clause vanishes — that is the secondary killer edit, keep it red. The completion bump must sit inside the named-terminal branch but outside the recency gate ((!lastTerminal || ts >= lastTerminal.at)) so repeated terminals all count. Lines with neithersidnorsessionpool under""and clamp together — legacy stores floor the count, never invent. Second cut: two cut sessions, or two starts in one session, both render— 2 cut passes in the window (started, no completion)— the clause counts passes, not sessions. Accepted inherited behavior, state it in the note: a pass mid-flight reads as a cut for the minutes before itscapture_laglands — the same reading the ARMED branch has always made oflastStarted, and why the clause says no completion observed, never failed.3. Exclusivity and the inert branch
The clause renders iff the rendering is one of the two alive returns and
(c.cutPasses ?? 0) > 0. The inert block (!c.lastExecuted && c.rows === 0 && c.blocked === 0,report.ts:238-270today) returns from all four of its sub-branches with no suffix anywhere, so exclusivity is structural: never append inside that block. It is also collision-free:cutPasses > 0⇒lastStartednon-null, so inside the inert block the cut is always named by the ARMED no-verdict line alone. Rewrite the stale "known limitation" note (report.ts:252-255today, it misnamescapture_cost): say that a completion keeps the line alive and both alive renderings now carry thecutPassescount, while this branch names the loss in its own sentence and the count must not repeat it. No issue number in any added comment (scripts/comment-lint.ts, gated atci.yml:33). The host-queue loss line is a separate fact on its own line and is untouched — a drop + a cut renders both, each named once.4. Negative halves (exact) and positive pins
Absence guards case-insensitively per #630:
not.toMatch(/cut pass/i)— and state the carve-out in the PR: JS/ifolds ASCII only; homoglyph substitution is beyond any regex here, so it is a named limit, not a silent gap. Fixtures build timestamps from realDate.now()like the existingat()helpers —ago()ignores the fixednowpassed tocaptureHealth, which only controls window membership; the terminal-branch literal is fully deterministic and the last-fired one is stable at the 3600/3700 s offsets used.capture_lag(paired) → line byte-identical to the shippedauto-capture: on, last fired …, 0 rows, 0 refused,/cut pass/iabsent.linesis the single ARMED no-verdict string already pinned atstatus.test.ts:808,/cut pass/iabsent across the output (probe confirmscutPasses=1internally, rendering silent — this pins the predicate, not a lucky absence).capture_lag+auto_capture_finish reason=completed→ terminal line byte-identical,/cut pass/iabsent.toBethe full last-fired literal in §1.completed→toBethe full terminal literal in §1.1 cut pass in the window (started, no completion).2 cut passes in the window (started, no completion).captureHealth(...).cutPassestoBe 1/2 on P3/P4 shapes,toBeUndefined()on H1/H2 (pins conditional presence).Falsification (item 14): widen the clause to cover never-started arrivals and the count fixtures (P3/P4/H4) fail on the numbers — the sentence's truth is mechanically tied to the pairing.
5. Pin ownership; what must not move
test/status/status.test.tsowns all new pins — it already owns every rung of this ladder (F1 alive, ARMED strings, terminal, drop-line). One deliberate divergence from the triage: new rendering fixtures do not go intotest/capture/capture-start-observable.test.ts; that file pins the plugin-side writer contract through a real store, and reader fixtures placed there would split ownership of one surface. That file stays unchanged. Existing expectations that must not move: the F1 alive verdict (status.test.ts:626), the exact ARMED line (:808), the drop-linetoHaveLength(2)+ full-stringtoBe(:959— do not add start lines to that fixture),last outcome host_shutdown(:985),request-lifecycle.test.ts:105, and thetoContain("on, last fired")family (suffix append preserves them). If any of these legitimately must change, that is a semantics decision to name to the owner in the PR description — not a diff.6. Precedents matched (not a third way)
The shape is the ratified
cappedPassesconditional in-string suffix (report.ts:274-276): same separator, same(c.field ?? 0) > 0optional-field gate, same "claims nothing when absent". The choice of in-string over the drop-line's own-line append (report.ts:190-198) is deliberate: the drop line appends after the ladder because it can render under any rung and answers a different question than the state verdict; the cut count qualifies this line's own verdict (alive despite N cuts), so it rides the line, exactly where the ladder already ends up for a mixed window. The "loss must not be erased by a later benign event" doctrine ofreport.ts:190-198and ofdocs/internals/auto-capture-evidence.md(drop line: "a saturated pipeline keeps its alive line and still names the overflow") is extended to cuts, consistently.7. Fences
No new evidence event, no writer or schema change (
capture.ts,record.tsuntouched — the probe paired off existing lines), nocapture_costconsumption change, no per-session state model (options 2/3 stay closed), no workflow/CI files (constraint 8 — CI is not the deliverable), no README change (ratchet; README is an introduction). Nodocs/edit is required: the masking limitation was never stated in docs, and the internals doc's doctrine stands honored — optional one line there is the fixer's call only if it states the counting rule exactly as §2. No issue numbers in added comments.8. Tier and severity
Tier: endorse
tier:standard(T2) — new field, new call sites, rendering extension inside two ratified patterns, and the one judgment the diff could have made (the pairing policy) is pre-decided in §2, so the diff decides nothing. It exceeds T0 (reader-visible behavior, well past ~25 lines with tests). Fallback per the tier table: if real evidence exposes a decision this contract does not pre-answer (e.g. a session-key shape the pairing misses), the reviewer escalates to T3 in prose on the thread. Severity ask (owner's action, one line):severity:low→medium— a promise of observability silently under-reports a real loss on the surface the #406/#474 epic exists to make truthful.Reviewer gate:
bun test test/status/status.test.ts test/capture/capture-start-observable.test.ts test/capture/request-lifecycle.test.ts test/host/pi.test.ts test/simulator/harness-stats.test.ts test/status/harness-stats.test.ts, thenbun run typecheck; both killer edits in §2/§1-killer form must go red, and the H1–H4 absence guards stay green.@fix