Skip to content

Gate bundle build on the Composition check #52

Closed

Description

@Sandstorm831

Parent

Spec: #49 (M1 — Shell and Catalog). Milestone: #48.

What to build

A Bundle that builds is a Bundle that can compose: bundle build runs the Composition check and refuses on any error-severity finding.

  • The Workflow Module owns the Composition check over a validated manifest: every required artifact is bound earlier by a producer or launch input with a matching type; every Prompt slot names an artifact the Step requires, with unknown or malformed slots failing; every Repeat group's verdict is bound before entry; every reviewCheckpoint is a positive-integer interval under Secant's safety ceiling with a plain-text message; every schema-bearing declaration names a valid schema asset (UTF-8 JSON, $ref only within that document); every supported platform resolves exactly one command invocation; every referenced asset exists with the right kind.
  • Findings carry a stable code, severity, the Step or field they point at, and a human explanation. build returns them alongside identity and digest; the headless client prints them in plain text, and any error-severity finding exits non-zero with no output file written.
  • Focused negative cases over hand-written manifests cover each rule; the Proof Bundle covers the positive path through the real build.

Acceptance criteria

  • The Proof Bundle builds with zero error-severity findings.
  • Hand-written manifests exercising an unbound artifact, a type mismatch, an unknown Prompt slot, a malformed slot, a Repeat group whose verdict is not bound before entry, an out-of-range reviewCheckpoint, an invalid schema asset, a platform with zero or two command invocations, and a missing or wrong-kind asset each yield a finding with a distinct stable code pointing at the offending Step or field.
  • bundle build --no-install --output on a non-composing folder exits non-zero, prints the findings, and writes nothing.
  • Nothing in the check executes, loads, or fetches anything.
  • CI scenario: the package smoke, from the installed package on all three operating systems, asserts the Proof Bundle build reports zero error findings.

Blocked by

Activity

  1. Sandstorm831 commented on Sep 9, 2026

    @Sandstorm831
    CollaboratorAuthor

    Starting context

    Final blocker #51 closed at main commit 670b323. It landed the validated manifest, the execution-free Workflow vocabulary, and the non-executing build path this ticket now gates with the Composition check. The check is a new responsibility of the Workflow Module over the already-validated manifest; identity, digest, and the headless bundle build surface exist and only gain findings here.

    Input Why it matters Authority
    Spec #49 — Workflow Module (Composition check) and Proof Bundle sections Fixes the slice's shape: the Workflow Module owns the check over a validated manifest, findings carry a stable code/severity/target/explanation, and an error-severity finding blocks the build. Canonical
    #13 resolution The composition rules: artifact binding with matching type, Prompt-slot resolution against required artifacts, a Repeat group's verdict bound before entry, and the reviewCheckpoint interval/message contract. Canonical
    #9 resolution with its 2026-09-03 and 2026-09-07 amendments The schema-asset rule (JSON Schema Draft 2020-12, UTF-8 JSON, $ref only within one document), the structured command invocation with per-platform overrides resolving exactly one invocation per supported platform, and asset reference kinds. Canonical
    Crucible Run lifecycle (Composition check, Review checkpoint, Verdict) and the Workflow Bundle cluster Canonical vocabulary for exactly what the check must prove and the terms findings are written in. Canonical vocabulary
    ADR 0021 The non-executing invariant: the check resolves references and bindings statically and executes, loads, or fetches nothing. Canonical
    #51 landed surfaces at 670b323: workflow.ts (the vocabulary the check consults), bundle/manifest.ts (the validated AuthoredManifest the check runs over — Steps, Repeat groups, references, commands, inputs, assets), bundle/bundle.ts (the build path that will invoke the check and already resolves the asset tree), bundle-management.ts + build-bundle.ts (the build result that carries findings), headless.ts (prints findings), projection-port.ts (the Problem/FieldViolation shape) What the check plugs into: it reads the validated manifest, returns findings, and surfaces them through the existing build path rather than reinventing any of it. Canonical
    module-policy.ts Confirms the Composition check lives in the Workflow Module (which imports nothing) and that Bundle/Application consume it through the declared entrypoints. Canonical

    Reading rule. Read the spec for the slice's shape and the finding contract; #13 for the binding/slot/verdict rules and #9's amendments for the schema, command, and reviewCheckpoint rules; the two glossary clusters for the exact predicates the check proves and the vocabulary findings use; ADR 0021 for the non-executing invariant. Then read #51's landed workflow.ts and bundle/manifest.ts to see the validated shape the check runs over, and bundle/bundle.ts/build-bundle.ts for where findings join the build result. The check is Workflow-owned and static regardless of how it is surfaced.

    Owner: Workflow Module (src/workflow/) gains the Composition check over the validated manifest and the finding type; Bundle's build path (src/bundle/) invokes it and returns findings with identity and digest; Application's Bundle-management result and the headless bundle build command carry and print them.
    Ratchet: a negative-case suite over hand-written manifests, one distinct stable code per composition rule; the three-OS package smoke asserts the Proof Bundle build reports zero error-severity findings.
    Deletes: nothing.
    Gate: the ADR 0027 three-OS package smoke (extended to assert zero error findings on the Proof Bundle); no new blocking job.
    Dependencies: none.

  2. Sandstorm831 commented on Sep 11, 2026

    @Sandstorm831
    CollaboratorAuthor

    Starting context — #63 update

    The remaining blocker #63 closed at main commit a7d84b8, so this ticket is fully unblocked. One delta for the Starting context above: #63 replaced the npm-tarball package smoke with a compiled-binary smoke. The seam this ticket extends (AC5 and the Gate line) is now scripts/package-smoke.mjs — it copies the Bun single-file executable into an isolated temp dir and runs it. Add the "Proof Bundle build reports zero error-severity findings" assertion there; its install-then-run isolation and the other assertions are unchanged, and it already builds the Proof Bundle with --no-install --output. Nothing else in the context above changes.

  3. added a commit that references this issue on Sep 11, 2026
  4. Sandstorm831 commented on Sep 11, 2026

    @Sandstorm831
    CollaboratorAuthor

    Change review

    Landed at main commit 9f5863b. CI green on the three-OS matrix.

    • Owner / Interface. The Workflow Module gains checkComposition and the CompositionFinding type (code, severity, target, explanation) over a validated manifest. Bundle's build path invokes it after shape and asset-tree validation and refuses on any error-severity finding; Application's Bundle-management and the headless bundle build carry and print them. The authored-manifest vocabulary (AuthoredManifest and its constituent types, Platform/PLATFORMS, AssetKind) moved from bundle/manifest.ts to workflow/workflow.ts — its rightful owner, and the only direction the boundary allows, since Bundle imports Workflow. manifest.ts now validates untrusted JSON into that vocabulary.

    • Non-executing invariant (ADR 0021). The check resolves references and bindings statically and reads no files: the build hands it the prompt and schema asset text it already decodes. The boundary suite continues to enforce that Workflow imports no Node mechanism.

    • Rules → stable codes. Unbound artifact, type mismatch, unknown/malformed prompt slot, repeat verdict unbound before entry, out-of-range reviewCheckpoint (engine ceiling MAX_REVIEW_CHECKPOINT_INTERVAL = 100), invalid schema asset (UTF-8 + JSON + in-document $ref only), a supported platform not resolving exactly one command invocation, and a missing/wrong-kind asset reference (two codes). Two review additions beyond the nine: duplicate-step-id (ids are Bundle-unique per Define the self-contained Workflow Bundle contract and trust model #9 and findings key on them) and invalid-prompt-asset (a non-UTF-8 prompt, symmetric with the schema rule).

    • Proof Bundle. Added a baseline-test step before the repeat group so test-verdict is bound before entry, per Define the minimum generic Workflow capabilities #13's canonical shape; the Proof Bundle now composes.

    • Test evidence. tests/workflow/composition.test.ts negative suite (one distinct code per rule, plus the two additions), a bundle-level non-composing case, the headless refusal case (exit non-zero, findings printed, nothing written), and the existing Proof Bundle positive path. Full gate: 97 tests, build, and the compiled-binary package smoke — whose successful Proof Bundle build now stands as the zero-error-findings assertion on all three OSes (AC5).

    • Deletes / dependencies / ADR changes. None. No new dependency; no guidance or ADR change required.

  5. Sandstorm831 commented on Sep 11, 2026

    @Sandstorm831
    CollaboratorAuthor

    Complete: implemented, reviewed, committed (9f5863b), and CI green on the three-OS matrix. Change-review recorded above; Starting context curated for the newly-unblocked #53.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agentFully specified and ready for an AFK agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions