Task DAG — Testing and evidence
This page maps each requirement of SPEC.md to the tests that falsify it, and records the evidence. The executor and reporters are tested in three ways:
- a fake action driver under the deterministic
TestSchedand a fake clock, with completion orders deliberately scrambled; - real short-lived child processes for the subprocess adapter;
- byte-exact transcripts compared across every completion order of a fixed graph.
A test is also checked against a deliberately broken implementation where the ledger says so: the starvation and primary-cause tests fail when their rule is removed.
The tests live in libs/build-primitives and, for the TTY reporter, in apps/ci.
Evidence ledger
Test names below are the @("…") names under build_primitives.task. or build_primitives.workspace., shortened by that prefix; the TTY reporter's are under task.reporter_tty.. Rows marked verified passed on Linux (kernel 6.18, LDC 1.43) on 2026-11-01. partial rows name what is missing; planned and unverified rows ran nothing.
| Requirement | Status | Evidence | Missing |
|---|---|---|---|
| TDS1, TDS3 | verified | package_graph.buildPackageGraph.rejectsInvalidGraphs, package_graph.buildPackageGraph.configurationAwareEdges, package_graph.discoverPackages.thisRepository | — |
| TDS2 | partial | package_graph.buildPackageGraph.configurationAwareEdges | the unittest configuration's platforms; platform on dependencies |
| TDS4 | verified | select.selectPackages.fromExactAndGlob, select.selectPackages.emptyMatchesAreErrors | — |
| TDS5–TDS6 | partial | select.gitChangesSince.fixtureRepository, select.gitChangesSince.indexOnlyAndUntrackedStates, select.gitChangesSince.defaultBaseAndErrors, select.seedsByClaims.reaches, select.seedsByClaims.removedWorkspaceAndUnclaimed, select.seedsByClaims.uncertain, select.planPackages.fixtureRepository | ci test does not yet take --since (M6b) |
| TDS7–TDS8 | verified | select.selectPackages.closuresAreAFixedPointUnion, select.selectPackages.platformSkippedSeedsAreNotEmpty, select.selectPackages.cyclicGraphsNeverReachSelection | — |
| TDM1–TDM2 | verified | model.taskId.formatting, action.writeActionSummary.process, action.writeActionSummary.inProcessAndInert | — |
| TDM3 | partial | action.writeActionSummary.process, action.writeActionSummary.inProcessAndInert | a complete environment that replaces the command's, for build-graph actions |
| TDM4 | verified | process.redact.masksEveryOccurrence, process.run.timeoutAndRedaction, process.redactionNeedles.everyLineOfAMultilineValue, process.run.multilineRedactedValueNeverAppears | — |
| TDM5–TDM6 | partial | graph.resolveEdge.conditions, graph.propagateBlocked.cascadesAndKeepsTheRoot, graph.propagateBlocked.successBlocksTheFallbackWithoutFailing | provisional blocks; conditionUnmet under cancellation; the cancelled rule |
| TDM7–TDM8 | verified | executor.admission.capacityAndPresentationOrder, executor.admission.exclusiveKeysSerializeOnlyTheirHolders, executor.admission.overCapacityClaimRunsAlone, executor.admission.aRejectedSpawnFailsTheTask; TDM7's lookup first: executor.admission.warmRunAdmitsEveryLookupAtOnce (a run whose lookups hit admits them all at once and charges none), executor.admission.missChargedInAdmissionOrder (a miss charged in admission order and only while it executes, the lookup slots bounding open lookups), executor.admission.awaitingChargeIsCancelled (a node awaiting its charge ends cancelled, unexecuted), executor.gate.lookupsUnderTheGate (lookups start under a hold, never under a cancel, which is asked before the first lookup, nor past the reserved task's key); TDM8's order and backfilling: executor.admissionOrder.longestChainFirst (the chain in predicted durations, a node without one a second, a fallback edge not counted), executor.admission.criticalPathFirst (the longest chain starts first, predictions outweigh the count of nodes), executor.admission.backfillsPastAWaitingTask and executor.admission.backfillsPastAWaitForMemory (a later node that fits starts past one waiting for tokens or memory), executor.admission.boundedWaitForAHeavyTask (passed over for the bound, then reserved: nothing predicted to end later starts until it does; without the bound it waits for an idle moment), executor.admission.reservationBackfillsWhatEndsBeforeIt (a reserved node backfilled with what ends before it could start, until twice the bound), executor.admission.reservedTaskMeetsACancellingGate (a gate cancelling at a reserved node: every ready node turned away, their dependents decided, the cleanup run), executor.admission.testsOverlapCompiles (a test starts as its link ends, beside the compiles) | — |
| TDM9–TDM10 | partial | model.ResourceClaim.defaultsAndClamp, executor.admission.threadBudget (threads above the tokens, bounded by the thread budget) | build-graph weights; the capacity formula |
| TDM11 | verified | model.TaskOutcome.kindAndFailure, graph.readiness.preferAFailureCauseRegardlessOfCompletionOrder | — |
| TDM12 | verified | executor.run.eventsAreSequencedAndMonotonic, executor.run.outputSequenceNumbersAreMonotonic, executor.run.sequenceNumbersFollowDeliveryOrder | — |
| TDM13–TDM14 | partial | process.run.reporterOnAnotherWorker, output.OutputSpool.spillsLosslesslyAndKeepsATail, output.OutputSpool.emptyLinesCountAgainstTheBudget, process.run.largeOutputSpillsToTheSandbox, process.sandboxPath.noComponentClimbsUnderEitherSeparator, process.sandboxPath.distinctIdsGetDistinctDirectories | spilled lines containing line breaks |
| TDM18 | verified | executor.admission.memoryBudget (the running nodes' predicted memory within the budget, a claim above it alone, order across both dimensions, the dimension off without a budget), executor.admission.aloneBesideZeroClaims (alone beside a zero claim, in either order), executor.admission.budgetRisesAsMemoryFrees (the budget follows the gate's headroom up within a sample, under the cap, and the events carry both), executor.admission.shrinkingBudgetRevokesNothing (a budget below what the charged nodes hold stops admission and nothing else), executor.admission.budgetCreditsCurrentResidentSets (the budget credits the resident sets the charged nodes hold now, not their peaks), executor.admission.coldBurstChargedConservatively (a burst of nodes on low defaults charged conservatively while they run, an early sample below the charge releasing nothing), executor.admission.reportedMemoryOutgrowsThePrediction (a running node holds the resident set it reports above its prediction, releases it when it ends, and a budget it overdraws fits nothing, a zero claim included) | |
| TDM19 | verified | executor.gate.boundedHold (held while a node runs, one admitted with none running, one more after the bound, resumed once the gate opens), executor.gate.boundedHoldWithinTheBudget (past the bound a node starts only if it fits the budget the headroom leaves), executor.gate.notAskedOnceDecided (a run whose nodes are all decided is not cancelled by a late gate), executor.gate.diskCancels (an unbounded hold cancels once nothing runs, a cancel fails the run with the gate's message, running nodes not stopped), executor.gate.floorWhileFull (a floor reached while every token is taken cancels the run mid-node), executor.gate.cancelStillRunsCleanup | |
| TDM20 | verified | process.run.memoryLimitFailure (a task past twice its prediction fails as memoryLimit, naming the 64 MiB limit, a task within it succeeds; it re-runs itself in a delegated user scope), process.run.inProcessMemoryLimit (an in-process action told twice its prediction, its reported kill a memory-limit failure), process.memoryLimitOf (floor, ceiling, saturation), Event Horizon's supervise.memoryLimitKillsTheRunAlone (also a child started in its run cgroup, and a run group killed at its limit), supervise.anAncestorLimitStaysASignal (a scope's kill stays a signal) and cgroup.memoryEventsKilled | |
| TDM21 | verified | executor.notice.apartFromTheOutput, reporter_plain.noticesShowWhateverThePolicy, task.reporter_status.StatusTranscript.noticeOfAQuietTask | — |
| TDM22 | verified | executor.thrown.anErrorFailsTheTask (an AssertError from a running node and from a protected cleanup each fail their node Failed(contract) with a notice naming the error, the dependent blocked and an independent node succeeding) | — |
| TDE1–TDE3 | partial | process.run.reporterOnAnotherWorker, process.run.exitStatusesArgvAndFraming | an import audit for the forbidden constructs; Windows |
| TDC1–TDC2 | partial | executor.failFast.blockedCancelledAndCleanup, process.run.failFastTearsDownTheTree, executor.cancel.interruptedProducersStillDeliver, executor.failFast.aChattyTaskDoesNotStarveTheScheduler | cleanup nodes during an abnormal drain |
| TDC3 | partial | executor.failFast.simultaneousFailuresPickTheLowestKey, executor.run.anUnaskedCancellationIsAFailure | an interrupted node that reports Failed |
| TDC4 | partial | executor.failFast.provisionalFailureFallsBackWithoutCancelling | provisional blocks |
| TDC5–TDC6 | partial | executor.cancel.externalInterrupt | a real signal delivered to a running command |
| TDD1–TDD2 | verified | executor.run.outcomesIndependentOfCompletionOrder, graph.build.orderIsIndependentOfInsertionOrder, graph.build.reportsTheShortestCycleFromItsLowestMember, graph.stableTopologicalOrder.tiesAndCycles, executor.run.primaryFailureIsTheLowestIndexWithoutFailFast | — |
| TDO1, TDO3 | partial | reporter_plain.transcriptIsIdenticalAcrossCompletionOrders, reporter_plain.spilledBlocksReplayInFull, reporter_plain.outputPolicies, reporter.OrderedBlocks.releasesInPresentationOrder | the unneeded count in the summary |
| TDO2 | partial | task.reporter_tty.interactiveShowsTailsAndRestoresTheCursor, task.reporter_tty.runningOnceCharged, task.reporter_tty.nonInteractiveDegradesToPlainLines | collapsing past a height limit; a timer-driven spinner |
| TDO4 | partial | reporter_plain.interlacedIsImmediateLineAtomicAndPrefixed, reporter_plain.interlacedStreamsOnlyReplayedNodes | the sorted failure replay at the end |
| TDO5 | unverified | — | no command with a JSON mode runs on the executor |
| TDO6–TDO7 | planned | sparkles:ci-provider | everything |
| TDO8 | partial | task.live_view.transcriptScrollsAboveTheView, task.reporter_live.finish.transcriptAboveAndBlockErased | the 100 ms redraw, which needs a scheduler and a clock |
| TDO9 | partial | task.live_view.transcriptThenView, task.reporter_status.StatusTranscript.aRunAsStatusLines | a CI service's fences around a consumer's quoted lines |
| TDO10 | partial | admission_trace.writeTraceLine (an admission state naming the waiting task and its reason, a start with its claim, a finish with its outcome), executor.admission.threadBudget (a state naming the thread budget as the reason) | a command-level trace (ci test --trace-admission) is exercised by hand only |
| TDO12 | verified | build_primitives.task.reporter_plain.quietSuccess (120 completion orders: only the failed, blocked, skipped and degraded tasks' blocks, the summary unchanged; off, every block) | — |
| TDO11 | partial | build_graph.execute.runActions.observerFirst (each event to the observer before the consumer's transcript, the observer ending first, a throwing observer let go and the transcript still ended), run_report.RunObserver.agreesWithRunStats (in apps/ci: the counts gathered match the driver's) | the order beside the admission trace and a live view, which no test checks |
| TDY1–TDY3 | partial | graph.writePlan.dryRun | a command-level dry run that checks no file is written |