Phase 9 — cross-cutting invariants, conformance, and the shrink-and-run guard - #54
Merged
Wahbeh-Mohammad merged 1 commit intoAug 29, 2026
Conversation
…k guard.
Audits what Phases 0-8 built against product spec §19 (XCUT-1..24) and §20
(NFR-1..17). This is the first systematic tabulation of the XCUT family:
before this phase, zero XCUT-N citations existed in any source file.
Ships:
- @dexpace/shrink-test (NFR-9) — private, unpublished. esbuild
bundle+minify+tree-shake of a synthetic consumer, a 24 KiB budget against
a measured 16,671 bytes, then a child-process round trip. NFR-8's keep
configuration ships nothing, deliberately: this port has no reflective
discovery surface to keep-configure, so the guard targets the
dual-package hazard instead (deliberate-deviations.md:32). Verified
non-vacuous — a separately bundled IoError has a different class identity
and instanceof is false across the boundary.
- tests/conformance/xcut/ — six suites, 36 tests driving the real
standardResilience() pipeline over live sockets, plus 17 retrofit
citations across 12 existing test files. All 24 XCUT and 17 NFR IDs are
dispositioned with evidence in a new phase checklist; no silent gaps.
- NFR-13 SPDX sweep across every tracked source file: 3 offenders fixed,
now 0.
Four findings filed as docs/open-items.md Section N, not patched here —
Phase 9 audits rather than edits another phase's code:
N1 cancellation surfaces CancellationError from the transport but a bare
AbortError under a SuppressedError from a retry backoff wait, so
`e instanceof CancellationError` handles one path and silently misses
the other (owner 5a)
N2 HttpStatusError's public constructor accepts a 200, fabricating the
"successful exception" XCUT-8 names and contradicting its own TSDoc
(owner 3b)
N3 the plan's `grep unresolved 2026-07-25 docs/knowledge/` step cannot
return empty as written (owner Phase 10)
N4 rxjs restated in three places against NFR-14's single source of truth
(owner Phase 10)
Toolchain:
- build:deps gains codec-json and transport-fetch. Phase 9 made them the
third and fourth packages imported by name with exports pointing at
dist/, from shrink-test/src/ and from tests/. A warm tree hid this; a
clean preflight failed typecheck and lint exactly as PR #52 did.
- bunfig pins [test] root = "packages", so a bare `bun test` never sees
tests/. The root `test` script now passes both trees
(bun test ./packages ./tests) and CI runs `bun run test --coverage`.
typecheck gains tests/tsconfig.json, which was linted but never
typechecked.
- CLAUDE.md documents the two-tree split, the bare-`bun test` trap, and the
grown build:deps list.
Ten plan amendments are recorded in the checklist — the plan predates the
packages and several of its code blocks assume APIs that shipped
differently. The two that would otherwise have produced silently-passing
tests: the dispatch counter belongs on the transport rather than
Runtime.send, and Runtime.close() is a documented no-op (PIPE-27).
Gates: ci-preflight --clean green, all 14 steps, on .bun-version's Bun
1.3.14; test:node also green on the 20.3.0 engines.node floor; 2171 tests
passing at 99.72% line coverage against the 80% floor.
Wahbeh-Mohammad
deleted the
24-phase-9-cross-cutting-invariants-conformance
branch
August 29, 2026 13:53
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #24
What changed
Phase 9 audits Phases 0-8 against
§19(XCUT-1..XCUT-24) and§20(NFR-1..NFR-17). It is thefirst systematic tabulation of the
XCUTfamily: before this phase no source file cited anXCUT-Nat all.
New package
@dexpace/shrink-test— private, unpublished, a devDependency of the workspace root only. Itbundles a synthetic consumer of
@dexpace/core,@dexpace/transport-fetchand@dexpace/codec-jsonthrough esbuild with minify and tree-shaking, asserts a size budget, thenruns the artifact in a child process so the check measures the shipped bytes rather than this
process's warm module graph.
NFR-9.fires catches nothing, so the figure, the toolchain version and the headroom are recorded in
shrink-test.config.ts.NFR-8's keep-configuration ships nothing, deliberately. This port has no reflection-drivendiscovery surface to keep-configure, so the guard targets the dual-package hazard instead
(
deliberate-deviations.md:32). The hazard is real, not assumed: a separately bundledIoErrorhas a different class identity and
instanceofisfalseacross the boundary.New conformance suite
tests/conformance/xcut/— six suites, 36 tests. Every row drives the realstandardResilience()pipeline over a live two-originnode:httpfixture, never a fake of asubsystem the row is meant to prove.
XCUT-1,3), error taxonomy (4,6,7,9), retry safety(
10), concurrency and lifecycle (11,13), security by default (16,17), diagnosticpreviews (
24).Runtime.send. Wrapping the runtime countscaller invocations and reads 1 whether retry re-issued four times or none, which inverts every
XCUT-10row.127.0.0.1explicitly, so one portunder a second hostname is not reliably resolvable.
Requirement citations
XCUT-2,5,8,12,14,15,16,18,19,20,21,22are satisfied by earlier phases and are cited where theyare actually asserted rather than restated here.
XCUT-14stays a retrofit on purpose: neither bounded map is reachable from a consumer-shapedtest, so a burst driven from
tests/could assert liveness but never a cap.context/store.test.tsand
auth/digest.test.tsassert the cap where it is observable.XCUT-23is not applicable by construction. Every seam this port ships is explicit-call-only, sothe explicit-install ordering holds vacuously.
Gates and toolchain
build:depsgainscodec-jsonandtransport-fetch. This phase made them the third and fourthpackages imported by name with
exportspointing atdist/. A warm tree hid it; a cleanpreflight failed
typecheckandlintexactly as Phase 8a — the fetch and undici transport adapters, and the file-backed body #52 did.bunfig.tomlpins[test] root = "packages", so a barebun testnever seestests/. The roottestscript now passes both trees (bun test ./packages ./tests) and CI's Test step isbun run test --coverage. One process, one coverage report, one exit code.typecheckgainstests/tsconfig.jsonandpackages/shrink-test. Thetests/tree was beinglinted with the type-aware tier but never typechecked.
NFR-13SPDX sweep across every tracked source file: 3 offenders fixed, now 0.Docs
XCUTand all 17NFRIDs to their evidence, plus ten planamendments — the plan predates the packages and several code blocks assume APIs that shipped
differently.
docs/open-items.md§N, andCLAUDE.mdfor the two-tree split, the bare-bun testtrap and thegrown
build:depslist.Open and deferred items
Four findings, filed rather than patched. Phase 9 audits; it does not edit another phase's code, and
the plan says a failure found here belongs to the phase that shipped it.
CancellationErrorfrom the transport but a bareAbortErrorunder a
SuppressedErrorfrom a retry backoff wait, soe instanceof CancellationErrorhandlesone path and silently misses the other. Not an
XCUT-3violation on its own terms: a cancellationis surfaced, it aborts near-immediately, nothing is re-dispatched, and it is not a timeout. The
defect is cross-layer consistency. Owner 5a.
HttpStatusError's public constructor accepts a 200, fabricating the "successfulexception"
XCUT-8names and contradicting the class's own TSDoc.toHttpErroritself iscorrect. Owner 3b.
grep "unresolved 2026-07-25" docs/knowledge/step cannot return empty. Twomarkers live outside the file the design scoped. Owner Phase 10.
rxjsis restated in three places againstNFR-14. The peer range is legitimate; thetwo
devDependenciesare not. Owner Phase 10.No changeset:
bun run apireports no drift in any of the nineetc/*.api.md, and@dexpace/shrink-testisprivate. Nothing consumer-facing changed.Verification
node .claude/skills/ci-preflight/run-ci.mjs --clean— all 14 steps pass on.bun-version's Bun1.3.14.
test:nodealso passes on the 20.3.0engines.nodefloor, and the shrink guard holds theretoo. 2171 tests, 99.72% line coverage against the 80% floor.
The coverage floor was verified live rather than assumed: raising
coverageThresholdto 0.999 exits1, and a single file at 66.67% function coverage failed the run on its own while the aggregate stayed
at 98.5% — so Bun enforces the floor per file, not only in aggregate.