Skip to content

Decide whether validate-sync-manifest.mjs should gate the live manifest in CI #331

Closed

Description

@kyle-sexton

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 node invocation 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

  1. 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.
  2. On disagreement, which is authoritative — and is a disagreement itself a CI
    failure worth surfacing?
  3. Should this run on the live manifest only, or on every consumer repo's
    materialized sync-manifest.yml too?

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

Activity

  1. kyle-sexton commented on Aug 11, 2026

    @kyle-sexton
    MemberAuthor

    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.

    🤖

  2. self-assigned this
    on Aug 11, 2026
  3. kyle-sexton commented on Aug 11, 2026

    @kyle-sexton
    MemberAuthor

    Lease claim for in-session drain. Implementing now. 🤖

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions