Skip to content

DraftOwner apps/ciReviewed 2026-11-01

apps/ci commands — Delivery plan ​

Companion to SPEC.md. Each milestone is independently green: the tool builds, its tests pass, the repository's invocations of ci keep working, and the milestone can be reviewed without relying on a later commit.

The generic layers are delivered by the task DAG plan (M1, M2, M4–M6) and the compile machinery by the build graph plan (E0–E4). This plan owns the prerequisite gate and the command cutovers.

Delivery rules ​

  • Add the smallest module split the current milestone needs. The layout in SPEC §7 is a destination, not permission for empty files.
  • These are hard prerequisites for the first cutover:
    • the complete sparkles.wired.sdl backend;
    • Event Horizon M19 items 1–5;
    • bounded cross-worker channels;
    • the test runner's out-of-process runner (TRD1 and TRD9 in docs/specs/test-runner/), which supersedes build graph E1a, and build graph E3.
  • Event Horizon M19 item 6 is delivered by the cutovers below, not by a separate port of the legacy process layer. apps/ci carries no second process executor.
  • Switch one work family at a time. Keep no flag aliases and no fallback from the task-DAG executor.
  • Every graph or executor test uses stable task ids, and deliberately scrambled completion order where ordering is under test.

M0: Specification ​

The command specification, delivered with the task DAG and build graph specifications it links to.

Gate: the three specification trees are internally consistent, reviewed, and pass the documentation checks.

M3: Prerequisite integration gate ​

  • Require the sparkles.wired.sdl backend and the Event Horizon M19 supervised-process surface in apps/ci's dependency closure.
  • Add integration probes for:
    • typed repository discovery;
    • supervised line streaming;
    • cancellation;
    • process-tree teardown;
    • resource events;
    • the scheduler-integrated blocking pool.
  • Require bounded cross-worker channels, exercising backpressure, close and drain, cancellation, and exactly-once delivery between scheduler workers.
  • Expose no partial canonical CLI.

Gate: prerequisite package tests pass on Linux, macOS and Windows. The probes leave no process behind and use no sparkles.core_cli.process_utils execution path.

Status: met.

  • Process matrix: the macOS matrix runs the supervision suite on both hosts.
  • Channels: CrossChannel is the executor's production event channel.
  • Windows: Event Horizon M19 item 5 delivered supervision on Windows, and the windows-latest leg runs the prerequisite packages' suites, the supervision cases among them: on #745's run 44573104254, event-horizon passed 179 tests (2 skipped), wired 338 and build-primitives 286.

M3a: Placements before the build graph ​

CIC14's data path on the current test modes, with the slice of the observability plan that OD21 names:

  • Records: --test, ci test --sanitize address and ci test --special-modes all write a run record with one task per package run, task id test:<package>:<mode>:<leg> (TDM1), where <leg> is serial or parallel rather than a thread count that varies by host, its outcome and task.wall. ci perf record ID -- COMMAND records any other command the same way. CI uploads the records as artifacts.
  • History: main-checks.yml appends the validating run's records to refs/perf/data (OBH3–OBH5), signed with the CI key (OBH8). ci perf push publishes local records, and ci perf import-github-run RUN builds records from an earlier run's job logs, to seed the history.
  • Placements: one data file, ci/placements.json, declares each placement: its system, compiler, mode, legs, coverage, runners per provider, shard count and time limit. ci placements list prints them with their shards as JSON, and sets it as a job output.
  • Shards: --placement NAME --shard K/N packs the placement's packages longest first, by the median task.wall of each task's last five records on that placement, and runs shard K. A package with no record takes the median of the placement's recorded tasks.
  • Workflows: the test, sanitizer and extracted jobs take their matrix from ci placements list, and name no package. The steps the first shard used to run beside its tests move to jobs of their own. CircleCI runs the same placements by --shard ${CIRCLE_NODE_INDEX}/${CIRCLE_NODE_TOTAL}.
  • The toolchain's build plan reads each pin's cost the same way, from the pin-build:<pin> tasks its builds record (ci cache pin-costs), and the hand-kept nix/pin-build-costs.json is gone.

Prerequisites from the owner: the CI signing key's environment and the allowed-signers file (OD21).

Gate: two consecutive main landings append their records; a third run's shards are packed from them, with no package named in any workflow; every shard of a run packs identically, checked by a test that packs one placement from two --history-tip reads; a forged or unsigned record is not read.

Progress: delivered. The landings of #742 and #743 appended their records (8133e639f, 311256477), and every shard of #744's run 44294916592 packed from the 15 records at 311256477. Run records (perf_record, perf_run), the signed history (perf_history), publishing (perf_publish: ci perf append, ci perf push, ci perf import), ci/placements.json with ci placements list and --shard, the workflows (ci.yml's placements, test and platform jobs, main-checks.yml's perf-append, CircleCI's parallelism) and the toolchain's recorded costs (ci cache pin-costs).

M7a: The canonical command line over the current implementations ​

The command surface of SPEC §1.1 replaces the flags before any command runs on the build graph (T16). It changes the command line, not what a command does, so it is not a cutover and needs none of the prerequisites above.

  • Add cli.d with the core-cli command tree, dispatched by runCli. Each command is a struct whose run() returns RunExpected (CIC16), and each command's options are its own fields. CliParams, ProgramMode and the cross-mode validation they needed are removed.
  • Every current mode gets the command SPEC §1.1 names. Until M7b:
    • ci test --build-only runs each package's dub build, as --build did;
    • --from takes package names only;
    • --since, --dependencies, --dependents, --backend, --require-cached and the common --jobs, --interlaced and --dry-run are not accepted yet, since nothing could honour them.
  • ci pipeline does not exist yet; ci placements list and ci test --placement NAME --shard K/N carry M3a's placements.
  • Reject every removed flag as an unknown option (CIC4), and give checks, fixes and GitHub actions their verb groups (CIC17).
  • Change every workflow, hook, script, Nix package and document that runs ci in the same change, so the repository never runs a removed flag.
  • Move each command group's implementation out of app.d into its commands/ module (SPEC §7), with the file selection, rendering and toolchain command lines the groups share in modules of their own.

Progress: delivered. The command tree landed in #743 and the commands/ split in #744; cli.removedFlags.unknown rejects SPEC §2's removed flags, and no workflow, hook, script or document uses one.

Gate:

  • ci's tests pass, and a test rejects every flag of SPEC §2's first column as an unknown option.
  • Repository CI is green on the canonical commands, on GitHub Actions and CircleCI.
  • No script, hook, workflow or user-facing document uses a removed flag.

M7b: The ci test cutover onto the build graph ​

  • Add the common execution options to ci test.
  • Add ci test's focused selectors and closures (SPEC §1.2, §4). Plan ordinary tests and build-only runs as the build graph's actions: test-root compiles, dependency-library builds, test binary links and test runs, with no ordering edges between tests.
  • Run each test binary through the test runner's core library, as worker nodes whose events are the nodes' output (CIC11). It needs the core that the test runner's P1 slice 6 delivers, so M7b closes only after it.
  • Add the CI-provider grouping to the plain reporter (task DAG M6b), and switch workflows to --interlaced. Workflows that set SPARKLES_CI_JOBS convert it to weighted units (CIC1).
  • Remove the current serial test and build loops in the same change.
  • Add --require-cached (CIC12), ci cache explain and ci cache verify --rerun, and run the determinism check on every CI run from the first workflow that builds on the shared store (CIC13).

Gate:

  • ci test --jobs 1 and ci test are green in their build-only and ordinary forms.
  • A second run in another worktree passes under --require-cached compile archive link.
  • A CI run includes the determinism check, and a planted nondeterministic fixture fails it.
  • Fail-fast kills a deliberately nested child tree.
  • The removed flags are rejected.
  • A binary run under ci test and standalone agrees on every test (CIC11).

Progress, by the gate's items:

  • The cutover: ci test and ci test --build-only plan the selected packages' test roots as one build graph (runTestsOnGraph) and run it against the shared store, with the compiler $DC names, DMD's variants included (build graph D63). Each test leg is the in-process action test:leg, which drives the test runner's core over workers fed their commands on standard input (apps/ci/src/test_leg.d, Event Horizon's superviseFed). The placement chooses the legs and coverage; listings merge into build/coverage, and each leg's wall time goes to the run record. The dub build loop is removed; --sanitize keeps the dub test loop until its variant (M8).

  • Options: --jobs, --interlaced and --dry-run (CIC1), the focused selectors and closures (§4) and --require-cached (CIC12) are delivered; ci cache stats|list|gc|verify|remove|replace|explain replace ci cache store, and ci cache verify --rerun runs CIC13's check over the last run.

  • Workflows: the ci test steps pass --interlaced, and each is followed by ci cache verify --rerun.

  • Gate checks so far: oracle cic11 of apps/ci/tools/graph-oracles.d: a fixture's 17 tests get the same verdicts through the core and standalone, and fail-fast ends another package's leg with the nested processes its test started. Oracle 19 plants a nondeterministic result, which fails the check. cli.removedFlags.unknown rejects the removed flags. A second ci test of versions passes under --require-cached compile archive link.

  • The whole repository (pc2-local, dc4041727): ci test (761 tasks succeeded, 340 unneeded fallbacks), ci test --build-only (405), --build-only --jobs 1 (405) and --jobs 1 --no-coverage (575 tests) pass, ci cache verify --rerun passes, and a second worktree builds all 405 tasks under --require-cached compile archive link, compiling nothing.

Open: a CI run with the determinism check, which this branch's pull request gives.

M8: Coverage, sanitizers, slow tests and special modes ​

  • Coverage attempts with conditional plain retries and package classification; deterministic listing merge and atomic publication (SPEC §5.2, §6).
  • --sanitize address, --slow and --special-modes betterc|wasm|all as variants and task kinds.
  • Remove the current special-mode, sanitizer, slow-test and coverage loops.

Gate: ordinary tests pass with and without coverage. A fixture that fails only under coverage is degraded and exits zero, and a true fallback failure exits one. Parallel listings never share a destination.

Progress: delivered on the build graph, beside M7b.

  • Coverage: each package's test is a -cov attempt with a plain fallback (build graph CIC7 planning); a package whose coverage build failed but whose fallback passed is reported uncovered (Degraded(noCoverage)), and the listings merge (coverage.mergeListings) into a sibling directory that replaces build/coverage by rename. Oracle m8 checks the degraded and the failing fallback, and that a test run after --build-only takes its plan and executes no build action, with coverage and without it.
  • --sanitize address: -fsanitize=address in every compile and link of the test roots and their dependency libraries, and ASAN_OPTIONS in every test, as each test request's profile (RequestProfile: its flags each variant's profileFlags, its variables and legs on its root), one leg keeping the @slow tests.
  • --slow: each package's chosen @slow tests are one leg, --only-slow -i <names> (Tools.testArguments).
  • --special-modes: each package's modes are one leg, which runs the runner core's driver on a blocking pool.
  • Packages beneath the runner (metadata, profiling-counters, test-attributes, test-harness, test-runner) speak no runner protocol: their test actions stay processes, the exit status their verdict.

The dub test loops are removed. The whole repository passes with coverage and without it (M7b's runs), and oracle m8 passes: the gate is met.

M9: Markdown and standalone examples ​

  • Markdown extraction and per-example single-file packages, shared by ci examples run, verify and update, built against the shared library variants.
  • ci examples standalone with directives and platform skips.
  • Remove the current example loops and TaskPool example execution.
  • An example whose inputs are unchanged reuses its last passing run (CIC31).

Gate: README verification, a multi-file update fixture, standalone build-only and run fixtures, timeout behavior, and parallel duplicate example names are green. No std.parallelism import remains in apps/ci. A second run of an unchanged example reuses its run, and a changed input runs it again.

Progress: each example is a single-file package the build graph plans against the store's variants (apps/ci/src/example_graph.d): an inline one extracted to build/md-examples/<digest>/, so an unchanged example reuses its compile. Its run, the in-process action example:run with /dev/null as its standard input and the example timeout, is a keyed generator whose result is the output it printed, and example:report reads that output back on every request (CIC31); a run-always example and a Node module run as tests, on every request. Standalone examples run the same way, build-only ones linked and never run. No std.parallelism import remains in apps/ci.

Oracle m9 runs a set of examples twice against one store: the passing one is reused with its output the second time and run again once an environment variable changes; a failing one and a run-always one run, by their own count, on both requests; one that outlives its limit fails though it exits zero when stopped, and is never reused; a build-only one whose program would fail is linked and passes; two that share a package name, in two directories, each run their own program, planning the second under its name and its directory's digest (graph_driver.keptApart.byDirectory). The multi-file update fixture (ci.examples.update.multiFile) rewrites the file whose examples all passed, through a sibling renamed over it, and leaves the one with a failing example byte for byte; a file changed while its examples ran is not rewritten. The examples that read the worktree or the host's configuration, fonts, desktop or tools carry // ci: run-always. An example runs under the memory limit its run admitted it under (task-DAG TDM20), its peak recorded for the next prediction (CIC23), and --fail-fast stops admitting Markdown examples once one fails (TDC2).

M10: Documentation commands ​

  • Every documentation ci check and ci fix of SPEC §5.6, including glossary, credits, spec evidence and the WebAssembly modules.
  • Preserve every file default, selector semantic, source-position diagnostic, local-clone behavior and audit scope.

Gate: every documentation check and fix has a parity fixture. Mutating commands make no writes under dry run and write atomically otherwise. The pre-commit hook invocations remain green after their migration.

Progress: every ci check, ci fix and ci docs command runs as a one-node graph on the executor (apps/ci/src/one_node.d, CIC2); the fixes take --dry-run and replace each file whole. The reference-link fixture (ci.check.referenceLinks.fixture) fails the check on a duplicate URL, writes nothing under --dry-run, rewrites only the file holding the duplicate by rename, and passes the check after. ci check vcs-urls, ci check reference-links, ci fix reference-links, ci docs fences-audit and ci check blob-paths each run as at most eight parts and a report after them (one_node.runFileNodes, CIC2), the parts on a blocking pool at once, printing only what did not pass (TDO12): the fix computes every rewrite in its parts and writes the changed files as the parts of a second graph, and the blob citations are queried per clone. Each moved only because it is faster than its single node. Over this repository on pc2 (32 cores), warm, median of seven, the single node's binary against the parts', on one tree:

CommandSingle nodeParts
ci check vcs-urls674 ms322 ms
ci check reference-links290 ms79 ms
ci fix reference-links291 ms81 ms
ci fix reference-links --dry-run290 ms82 ms
ci docs fences-audit281 ms97 ms
ci check blob-paths13,020 ms5,493 ms

A node per file, measured first, took vcs-urls 765 ms against the single node's 669 ms, and was not kept. Each prints what its single node printed, with its exit status; blob paths, whose single node listed its clones in hash order, now lists them sorted. A part that never ran, or a report that never did, fails the run (one_node.fileNodesResult.noFailureIsMasked), a part that throws stops the report (one_node.runFileNodes.aThrowingPartStopsTheReport), and a part is told its batch by its action, not its text (one_node.runFileNodes.dispatchByAction). ci stats stays one node: only its outcome changed (degraded, M11). The fixtures run each graph beside the single node the pipeline runs (ci.check.referenceLinks.fixture, ci.check.blobPaths.fixture). Open: parity fixtures for the other checks and for ci fix spec-evidence-backlog.

M11: Statistics, commit checks and maintenance commands ​

  • ci stats with its degradations (SPEC §5.7). Blocking HTTP runs through the blocking pool until a native client exists.
  • ci check commit-scope and ci commits build-each on the shared store.
  • ci cache, with removal and replacement (BGS7), ci host probe, ci github mirror-checks, ci github link-rot-issue and ci slow-tests list.

Gate: complete, partial, empty-comparison, authentication-failure and optional metadata fixtures have the specified outcomes and exits; tokens are absent from events and dry runs; commit hook output stays concise.

Progress: ci stats, ci github …, ci host probe, ci slow-tests list and the cache commands run as one-node graphs; ci commits build-each runs every commit of its range as one graph against the shared store (CIC21), a worktree per commit, an action a commit shares with the one before it waiting to reuse that one's result, each WebAssembly module planned for every host the toolchain table lists (build-graph E5), and any package planning refuses built by dub as tasks of the same run; ci cache gc-r2 fans its requests out on threads.

The gate's fixtures run ci stats over canned GitHub responses (ci_stats.fixtures.*): a complete report has an empty degradations[]; one failed jobs page after complete runs remain is partialPopulation, naming the omitted run and counting only the complete ones, and exits zero, while no complete run fails; an empty comparison side fails and a split with both sides compares them; a 401 on the run list fails; jobs without runner labels and untimed or malformed steps degrade only their views, counted over the jobs each view counts, an untimed step never counted as zero; a 401 or an undecodable response on a run's jobs fails the report, and a failing later jobs page omits its run whole (ci_stats.fixtures.laterJobsPageFails); a comparison over an empty window fails. With --json, standard output holds the JSON alone. No progress line, error or JSON of theirs holds the token, which every request carries as its header, and a dry run of ci github mirror-checks writes nothing and keeps the token to its header (check_mirror.mirrorChecks.dryRunWritesNothingAndKeepsTheToken). ci stats --json prints the report with its degradations[], and the human report warns of each. A report with degradations ends its node degraded, by its first degradation (commands.stats.degradedKind.byTheFirstDegradation), through one_node.degradedRun (one_node.degradedRun.aDegradedNode), and exits zero. ci check commit-scope runs as a compact one-node graph, its transcript printed only when it fails (one_node.compactTranscript.silentWhenPassing): a passing commit hook prints nothing. Each of ci stats' requests runs on a worker of a blocking pool while its fiber is parked (commands.stats.pooledFetch.offTheSchedulerThread), as §5.7 asks.

M12: ci pipeline, beside the dub path ​

  • ci pipeline as the union graph of every CI job (SPEC §1.3), with the determinism check as one of its tasks (CIC13).
  • Placements (CIC14): the placement file, --placement and ci placements list, with shards packed from recorded wall times.
  • Verify that every production command the build graph can plan constructs a graph and uses the common executor.
  • Keep the dub path, reachable as it is: the work the build graph does not plan runs through dub. That is ci test --watch's rounds, which run each package's dub test legs; the packages planning refuses in ci commits build-each (CIC21); the tests that declare dub as their subject (build graph D62), each a task of the common executor; and the forwarding dub's fallback, which hands its command line to dub itself (CIC30). No command loses a route it has, and the dub path needs no flag to reach.
  • Measure idle behavior, peak memory, weighted saturation and the pipeline's wall time against the current CI.
  • Measure the build graph's no-op run time, planning time, the stats and manifests each lookup reads, and the cutoff rate, split by whether an edit moved lines and by whether it changed a module's interface or only a body. The definitions belong to the build-primitives observability specification (docs/specs/build-primitives/observability/). The results decide two open build-graph questions: a planning memo past about one second of no-op planning (D37), and interface cutoff (D35).
  • Shards recompile common libraries until a binary cache shares results (build graph D41); the measurement records what that costs.

Gate: ci pipeline covers every job ci.yml runs or names it as skipped. Each route of the dub path above still runs, and nothing else starts dub. Forced cancellation leaves no child process or live-region control residue. Default non-TTY output is stable across a randomized completion stress run.

Progress: ci pipeline runs the tests, the sanitized tests (LDC on Linux), the extracted modes, the checks and commit scopes as one build graph run, which --dry-run prints, then the examples, the slow tests and the determinism check as graphs of their own, and reports every ci.yml job, ran or skipped with its reason (apps/ci/src/pipeline.d). The dub path keeps each route: the watch rounds plan dub test legs as tasks (watch_round.d), ci commits build-each builds a package planning refuses with dub (each_commit.refusedUnit.byNameAndHost), and the forwarding dub falls back to dub (dub_forward.rules.decide). Oracle m12 gives eight examples that each sleep a random time the same outcomes and the same transcript, times aside, over six runs at one and at eight weighted units, and a fail-fast run that cancels an example waiting on a child leaves none of its processes alive: the cancellation and stress gates hold for the examples commands.

The measurements, on a 32-core host against a cache of its own, ci test --build-only over the whole repository (769 actions planned; 416 compiles, 176 links, 177 generators, 86 packages):

RunWallPlanningCompiles ranLinks ran
cold149.4 s9.8 s, fresh31390
no change, first0.65 s0.12 s, reused00
no change, second and third0.25 s0.13 s, reused00
a unittest's body in base.text.writers153.4 s10.7 s, fresh1591
a line inserted above its module164.0 s10.8 s, fresh15978
a public symbol added to it164.6 s10.8 s, fresh15976

Every edit reran the compile of each package that imports the module (159), whether or not its interface changed: no compile is cut off, and only links are, when the objects they read come out the same (89 of 90 after the body edit). That is what interface cutoff (build graph D35) would save, about 158 compiles of a body-only edit. No-op planning takes 0.12 s, under the second past which D37 asks for a planning memo, but any edit plans afresh (about 10 s). Of the 416 compiles and 176 links planned, 330 compiles and 90 links are needed (the cold run ran 313 of the compiles and reused the other 17 within the run); the rest are coverage attempts' fallbacks the run leaves unneeded. An edit's run took about as long as the cold one, though it ran about half its compiles.

The sanitized tests share the one graph. A request's profile (RequestProfile, build graph planning) carries the flags, which are its variants' profileFlags, in their keys and every compile and link (not the test runner's probes), and its root's test variables and legs, which Tools.testLegs only defaults; ci pipeline plans each test root again under the sanitizer's profile (graph_driver.TestProfile), its libraries too, beside the plain one. No compile, link or test of the two shares an id, a key or a store entry (build_graph.actions.planActions.profilesKeyVariantsApart), and ci pipeline --dry-run --from base versions plans each package's plain legs and its sanitize leg, each library three times (the coverage attempt, its fallback, the sanitized one). The tools a generator runs are planned without a profile, so they run uninstrumented. On pc2, warm, median of seven: ci pipeline --dry-run plans its one graph in 17.3 s, where the pipeline before planned two, the tests (ci test --dry-run, 10.0 s) and the sanitized tests (8.2 s), 18.2 s in all; ci test --dry-run and ci test --sanitize address --dry-run plan as before (10.0 s and 8.2 s on both binaries). The graph's own warm cost does not move: ci test --build-only, every action reused, takes 297 ms against 302 ms, and with --sanitize address 931 ms against 924 ms (fifteen interleaved pairs, within their spread). A warm ci test runs every test binary again, so its wall time is the slowest test's (wired, 1.2 to 1.8 minutes from run to run): 101 s and 109 s in one set of seven interleaved pairs, 110 s and 110 s in another, the same tests with the same ids.

M13: Repository migration ​

  • Change workflows, hooks and developer documentation to the canonical commands, in the same series as the cutovers.
  • Generate the workflows from ci placements list pipeline. No workflow passes --since (CIC15).
  • Reconcile docs/specs/ci/stats/ terminology with ci stats and the common reporter.

Gate: full repository CI is green on canonical commands, and no script, hook, workflow or user-facing document uses a removed flag.

Progress: the workflows and hooks run the canonical commands; the developer guide leads with ci pipeline. The statistics specification (docs/specs/ci/stats/) names the command's real options, its one-node graph, its --json shape and its outcomes in the common reporter's terms: complete, degraded with degradations[], or failed. The workflows' matrices come from the placements: GitHub's test, sanitizer and extracted jobs take theirs from ci placements list at run time, and GitHub's platform legs and each CircleCI job's parallelism are written from ci/placements.json by ci fix workflow-matrices, which ci check workflow-matrices (a pre-commit hook, and workflow_matrices.repository.noDrift in ci test) holds them to: each marker present once, in the job it names. No workflow passes --since.

Progress ​

MilestoneDeliverableState
M0Specificationsin review
M3Prerequisite gatedone
M3aPlacements before the build graphdone
M7aCanonical command linedone
M7bci test on the build graphin progress
M8Coverage and special modesdone
M9Examplesdone
M10Docs commandsin progress
M11Stats, commits, maintenancedone
M12ci pipeline, beside dubin progress
M13Consumer migrationdone