Conversation
|
Pushed SHOULD 1 — the tests only proved absence-detectionThe original three mutations all deleted something, so they demonstrated the tests notice a missing signal and said nothing about a false one. With the gate forced unconditional at both sites: A regression firing the warn in local mode, or making the sidebar always claim dark, was invisible to the whole 1896-test suite. Added Mutation polarity is the point: for a positive assertion you delete to redden; for an absence assertion you must add the forbidden behavior. Reverting the warn cannot redden a test that requires no warn. SHOULD 2 — the boot case had no sidebar writeReview traced that the loader's own sidebar write is unreachable while structurally dark: So an operator who booted dark and ran no command saw nothing in the sidebar. Fixed with a 3-line publish at the end of the boot sequence via the existing VerificationThree mutations re-run independently of the implementer's report, tree restored to clean between each:
The third was not requested. It isolates the two halves of the negative test: without it, a single warn assertion could have been carrying the whole thing while the sidebar-absence assertion rode along untested. Each half fails on its own. Gates on the restored tree: core 199/0 · opencode 1898/0 (1896 + 2) · typecheck clean · Nits
|
2225d81 to
47221cb
Compare
|
Rebased onto Re-checked that the PR is still valid rather than assuming it. v1.23.0 reworked const fallbackRefreshStructuralDark =
getClaustrumMode(initialStorage) === 'claustrum' &&
provisionalCustody.provisional === true &&
(fallbackDimensions.fallbacks === 'M' ||
fallbackDimensions.fallbacks === 'R')
const fallbackRefreshReady = fallbackRefreshStructuralDark
? Promise.resolve('not-started')
: fallbackManager.startBackgroundRefresh()
Pre-existing failures on this branch are upstream's, not this PR'sThe full opencode suite shows two failures on this branch. Both reproduce on clean
Counts vary run to run (2 fails, then 1) on both this branch and Typecheck passes. Core is 295/0 on the new baseline. One correction to my own methodMy first read of this was "upstream v1.23.0 ships a broken build" — root typecheck and |
| // Set once at construction and never cleared: this stays true after the | ||
| // process recovers, so it records that the boot gate withheld the refresh, | ||
| // not that the refresh is currently dark. | ||
| ...(fallbackRefreshStructuralDark && { | ||
| fallbackRefreshStructuralDark: true, | ||
| }), |
There was a problem hiding this comment.
Shared signal can become stale
Each plugin instance adds this field based only on its own construction-time decision, but instances can share a sidebar file and each write replaces the complete state. A non-dark instance can therefore remove a dark sibling's signal, while a pending write from a disposed dark instance can restore stale true. This makes the new process-wide diagnostic unreliable in multi-project processes. Preserve or aggregate the flag across writers, and test mixed dark and non-dark instances sharing one sidebar file.
Knowledge Base Used:
The construction-time gate that withholds the fallback-account background refresh when vault residency is structurally unsafe emitted no signal, so a process that had silently stopped refreshing looked identical from outside to a healthy one. Emit one claustrum warn at the decision carrying the three dimensions that produced it (custody mode, provisional flag, fallbacks dimension), and add a process-wide fallbackRefreshStructuralDark flag to sidebar state so the condition is visible on the wire. The gate's boolean is unchanged.
Add a non-dark control test: an unconditional gate (if (true) / ...(true &&)) previously passed the whole suite, so nothing proved the signal is absent when the gate does not withhold. The new test asserts no withheld warn and that the sidebar key is omitted entirely. Publish the boot decision to the sidebar at construction. The loader's own sidebar write is unreachable while structurally dark (the custody reconcile refuses first), so a warm-vault dark boot left the sidebar silent until a command ran. A poll-based test covers the fire-and-forget boot publish. Document at the projection site that the flag is a boot fact, never cleared.
47221cb to
1bdb29d
Compare
|
No longer applies: on main, |
Closes #239.
The problem
packages/opencode/src/index.tsdecides at plugin construction whether to start the fallback-account background refresh. When it withholds, nothing observable says so — the process is indistinguishable from a healthy one.Measured on
mainbefore this change:The withheld state reached neither the log file nor sidebar state. Its only consumer was a test seam.
Why it matters
A boot-time flag gating a resource fails loud — the acquire blocks or errors. A boot-time flag gating a capability fails silent: nothing errors, a manager simply never exists, and everything downstream is merely quiet.
There is a live precedent for this exact gate. An earlier revision computed boot evidence as "every bound fallback has a usable resident credential right now", so a single cold account at boot returned provisional
FAIL_CLOSEDand suppressedstartBackgroundRefresh()across all accounts — re-introducing a fleet-wide idle-expiry exposure. The logic was corrected to a structural-only gate; the silence was not.The change
logger.warn('claustrum', 'fallback refresh withheld at construction', …)at the decision, carrying the three dimensions that produced it (custodyMode,provisional,fallbacks) — so a reader can tell why it withheld, not just that it did. Follows the existing convention used at 16 other sites in the file.fallbackRefreshStructuralDarkflag onSidebarState, using the house...(cond && { field })additive idiom.The gate's boolean is unchanged. This attaches a signal to an existing decision; it does not re-decide it.
Verification
Three mutations, all re-run independently of the implementer's report, each restored to a clean tree before the next:
withholding the fallback refresh logs the three dimensions that produced it—Received: undefinedthe sidebar carries the structural-dark flag—Expected: true, Received: undefined'local',false,'X')- Expected - 3 / + Received + 3The third was not in the brief. It distinguishes a test that asserts a line fired from one that asserts the line carries the right dimensions — without it, the log could regress to useless content while staying green. It reddens, so the test checks values rather than presence.
Gates on the restored tree: core 199/0 · opencode 1896/0 · typecheck clean ·
aft_inspect0/0.Note on the test harness
The sidebar test triggers its write via
claude-account add-apikeyrather than the loader's own sidebar write: in the dark state the loader refuses withRESUME_TAKEOVERbefore reaching that write. Harness choice only — no production write path was altered.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by cubic
Closes #239. Makes the withheld fallback refresh observable so a process that silently stopped refreshing no longer looks identical to a healthy one. The gate's boolean is unchanged; only its visibility changes.
claustrumwarning at the gate carryingcustodyMode,provisional, andfallbacks, so thewhyis visible, not just thethat.fallbackRefreshStructuralDarkfield to sidebar state, published at construction and never cleared — it records the boot decision, not current darkness. The loader's own sidebar write is unreachable while structurally dark, so this boot publish exposes a warm-vault dark boot without waiting for a command.Tests cover dark and non-dark boots, include a non-dark control proving the signal is absent when the gate does not withhold, and poll for the fire-and-forget construction-time publish.
Written for commit 1bdb29d. Summary will update on new commits.
The PR appears mergeable, although the sidebar diagnostic can still become stale when multiple plugin instances share the same state file.
Findings
Summary
The PR makes a boot-time decision to withhold fallback-account background refresh observable.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart LR A[Plugin construction] --> B{Fallback refresh structurally dark?} B -->|No| C[Start background refresh] B -->|Yes| D[Emit diagnostic warning] D --> E[Publish structural-dark sidebar field] E --> F[Shared sidebar state]Reviews (2) · Last reviewed commit: "fix(custody): close observability gaps i..."