Repository navigation
Description
Summary
distribution/validate-sync-manifest.mjs — the ajv authoring schema for
sync-manifest.yml — is referenced only from distribution/sync-manifest.test.sh
(lines 78, 314, 601), where it validates fixture manifests. It never runs against
the real distribution/sync-manifest.yml.
CI's live-manifest gate is bash distribution/sync-manifest.sh validate
(.github/workflows/ci.yml:723). So the two validators cover disjoint inputs: the
schema sees only fixtures, the engine sees only the live manifest.
Surfaced while fixing #330, where the schema rejects the crafted-key manifests
that crashed the Bash engine — which meant the schema could not be cited as a
mitigation for anything reaching the engine, including the live manifest.
The decision, not a foregone conclusion
This is filed as a decision to make, not a task to execute, because adding a
second validator to the live path has a real tradeoff:
For wiring it in
- Defense in depth: a structural violation gets caught by a purpose-built schema
with schema-quality messages rather than by whichever ad-hoc shell check
happens to trip first. - Cheap: one
nodeinvocation against one file, next to the existing gate. - The schema is already maintained and already exercised by the contract suite,
so it is not new surface — just newly applied to the live manifest.
Against, or at least to resolve first
- It creates a second source of truth for "is this manifest valid". Today the
Bash engine is definitively authoritative, because it is what the real sync
runs. Two validators means drift between them becomes a new failure mode, and
someone has to decide which one wins when they disagree. - The engine is strictly stricter in places the schema cannot express (Git index
state, tracked-file modes, path safety, dependency closure). A green schema
pass could read as more assurance than it provides. - If the schema is looser anywhere the engine is strict, wiring it in adds a
gate that never fires, i.e. cost with no coverage.
Questions to answer before implementing
- Is the schema intended to be a strict subset of the engine's rules, a superset,
or an overlapping-but-independent check? Its role is currently undocumented. - On disagreement, which is authoritative — and is a disagreement itself a CI
failure worth surfacing? - Should this run on the live manifest only, or on every consumer repo's
materializedsync-manifest.ymltoo?
A cheap third option worth weighing: instead of adding the schema to the live
gate, add a contract test asserting the schema and the engine agree on a
corpus of fixtures — which converts the drift risk into a tested invariant
without introducing a second live gate.
Related
- sync-manifest.sh: a control-character mapping key forges a TSV row and crashes load_manifest_rows on an empty record name #330 — the row-forging crash whose fix surfaced this; deliberately scoped to the
engine, with this observation split out rather than bundled. - perf(distribution): validate the manifest in two yq passes, not 274 #320 — introduced the consolidated engine and the row stream.
Activity
fix(distribution): gate record keys so a control character cannot for…
kyle-sexton commentedon Aug 11, 2026
Frontier consensus (Fable + Sol) — ACCEPT
Decision: Add a fixture-agreement contract test (schema ∩ engine on fixtures). Do not add a second live CI gate against
distribution/sync-manifest.yml.Implementing in-session.
🤖
kyle-sexton commentedon Aug 11, 2026
Lease claim for in-session drain. Implementing now. 🤖
test(distribution): add schema-engine fixture-agreement contract (#331)
test(distribution): add schema-engine fixture-agreement contract (#331)