Repository navigation
Description
Files:
packages/core/src/analyzers/analyzer.tspackages/daemon/src/scheduler/run-pipeline.tsandscheduler/index.tspackages/daemon/src/check.ts, and the CLI'sstatus/checkrendering if a pair's state is shown wrongly- their tests, under
packages/core/test/andpackages/daemon/test/ docs/architecture.md(the data-flow invariant on infra failures)plan_docs/milestones/m3-sandbox-typecheck-build.mdplan_docs/log.md
Prerequisite. None beyond dev: the sandbox runner (#86), toolchain detection (#87), the typecheck runner (#88) and the baseline differ (#93) are merged. This does not need the attribution engine (#94).
What. The rule is in analyzer.ts and in CLAUDE.md: an analyzer that cannot run returns infra-failure, an infra failure is never shown to a user as a conflict, and an analyzer that cannot run must never report clean. Today the rule is honoured where it was written — the textual analyzer, the typecheck registry's outcomes, the baseline differ's unavailable — but the pipeline around analyzers does not enforce it, and the analyzers that are about to join (typecheck, build) will lean on it. Make it a property of the pipeline, not a convention each analyzer has to remember, for each environmental failure M3 names: Docker down, image missing, toolchain unknown, a timeout, and dependencies unavailable because the lockfile changed.
Acceptance.
-
Each named failure is
infra-failure, with a remedy, and never a Finding:- Docker not running or not reachable (
SANDBOX_UNAVAILABLE); - the sandbox image missing (
SANDBOX_UNAVAILABLE, as the runner reportsno such image); - the toolchain not one Interlock handles (
TOOLCHAIN_UNSUPPORTED); - dependencies unavailable: a clean merge whose
slotis null because its dependency files differ from the installed tree, for an analyzer that needs the slot.
Each has a test that drives it through
runPipeline, not only through the analyzer, and asserts no Finding is written, no open Finding is resolved, and the run is recordedfailedwith the component and the redacted diagnostic. - Docker not running or not reachable (
-
A thrown infrastructure error is an infra failure. An analyzer that throws an
InterlockErrorwithinfra: truefromanalyzeis recorded asinfra-failurefor that analyzer, the same as one that returned it. A throw that is not infrastructure — a bug — still fails the run loudly and is never turned intoinfra-failureorclean. -
A timeout never reads as clean. A
timeoutverdict is neither cached (the store already refuses it) nor treated as having judged the content: the pair is not marked analysed at that content, so it is run again rather than left looking finished, and nothing a user sees calls it clean. Today a run with atimeoutverdict finishescompleteand its content key goes intoanalysedAt; check whether that leaves the pair unretried until a branch moves, and fix it if so, with a test. -
What the user sees.
interlock check A Bandinterlock statusshow a pair whose last run could not judge it as "could not check" with the reason and the remedy — never as clean, never as a conflict. A test per surface. -
Retries. An infra failure backs off and retries, as
landalready does; a test shows a failure that clears (Docker comes back) leads to a real verdict without a branch moving. -
No analyzer has to remember the rule. A test analyzer that returns
cleanwith a null slot on a clean merge, for a kind that needs one, is caught by the pipeline rather than trusted — or the contract makes that impossible to express. Choose one and record why.
Constraints.
- When a check is unsure, it says nothing — and nothing is not clean. The direction of every ambiguity here is toward
infra-failure, never towardclean. - Environmental failures are never Findings (CLAUDE.md). None of this adds a Finding kind or rule.
- Models are wire formats.
AnalyzerVerdictandAnalyzerResultalready carryinfra-failure,timeoutand a redacteddiagnostic. A new field means a store migration and needs a reason in the log. - Redaction. A diagnostic carries paths and tool output; it goes through the existing redaction before it is stored or printed.
- Hard rule 5. No test is weakened to make room.
Approach
Where the rule lives. Read the loop in run-pipeline.ts that runs each analyzer: an infra-failure outcome already ends the run as failed, but a throw from analyze is not caught there, and a timeout outcome is pushed onto ran like a verdict. Decide the one place the pipeline turns an analyzer's result into "judged" or "not judged", and make every path go through it.
The slot. AnalyzerContext.slot is null for a conflicted merge and for a pair whose dependencies differ from the installed tree. An analyzer that needs real files and is handed null on a clean merge cannot run. Say so in the contract (a needsSlot-style declaration, or a helper every slot analyzer calls), so the next analyzer cannot get it wrong by returning clean.
The surfaces. Follow an infra failure from land in scheduler/index.ts to what check and status render. check.ts already throws ANALYZER_INFRA_FAILURE for a run that failed; check what status shows for a pair whose newest run failed, and whether a pair that last ran clean and then failed shows its old clean result.
Cases to cover:
- each of the four named failures, through
runPipeline; - a thrown infra error, and a thrown bug;
- a
timeout, and that the pair is run again; - a failure that clears on retry;
- an open Finding from an earlier run, followed by an infra failure: the Finding stays open, neither resolved nor duplicated.
Method
- Read first. Read CLAUDE.md and follow it. Then read:
packages/core/src/analyzers/analyzer.ts,textual.ts, and the outcome kinds intypecheck.tsandbaseline.ts;packages/daemon/src/scheduler/run-pipeline.ts, the analyzer loop,reconcileFindingsand the verdict cache;packages/daemon/src/scheduler/index.ts,landandbackOff;packages/daemon/src/check.ts;packages/shared/src/models/speculative-run.tsandpackages/shared/src/errors.ts.
- Load the skill:
.claude/skills/interlock-gitbefore writing tests that build repositories. - Expand the task first. Rewrite the "Infra failure handling" task in
plan_docs/milestones/m3-sandbox-typecheck-build.mdto the depth ofm1-watcher-and-git-core.md. Record the rewrite in the log. - Branch and commits. Branch off
dev, namedinfraFailures. Single-line commit subjects, no body, no Co-Authored-By or session trailers. Don't push. - Test isolation. Docker being down is produced with an injected runner or a
DOCKER_HOSTpointing nowhere, never by stopping the developer's Docker. Fixture repositories in temp directories, cleaned up inafterEach. - Mutation-test the judged / not-judged decision, the timeout path and the slot rule, with a disposable harness that refuses a dirty tree, applies one mutation at a time and restores with
git checkout --. A survivor that would let an unrun analyzer read as clean is a missing test, never an equivalent. - Coverage floors in
vitest.config.tsonly go up.pnpm verifygreen, pluspnpm test:untouched. - Docs and log. Comments explain why, never what. Tick the task in the same change. One log line per decision. A CHANGELOG entry if
checkorstatusoutput changes. - Expect review rounds. Verify each finding against the code, and record what you rejected and why.
Activity