Repository navigation
v0.11: assemble a contract bundle from digest-locked artifact references #106
Description
Activity
- addedenhancementNew feature or requestNew feature or requestrelease:bundlesContract bundle assembly and identity release workContract bundle assembly and identity release work
on Jun 29, 2026 coderabbitai commented
on Jun 29, 2026 coderabbitaiboton Jun 29, 2026 – with coderabbitaiMore actions🔗 Related PRs
#30 - feat: expose surface validation stage [merged]
#32 - docs: add workflow standards [merged]
#37 - Add v1 lowerability and target-profile conformance checks [merged]
#41 - Add Gate C admission boundary checks [merged]
#67 - Add Echo Target IR lowering [merged]
📝 Issue Planner
Check the box below or use the
@coderabbitai plancommand to generate an implementation plan and prompts that you can use with your favorite coding assistant.- Create Plan
🧪 Issue enrichment is currently in open beta.
You can configure auto-planning by selecting labels in the issue_enrichment configuration.
To disable automatic issue enrichment, add the following to your
.coderabbit.yaml:issue_enrichment: auto_enrich: enabled: false
💬 Have feedback or questions? Drop into our discord!
🤝 Handoff — v0.11 bundle assembly (foundation done, assembler next)
Branch
bundles/assembly-v0.11(pushed,cargo xtask verifygreen, 288+ tests). Clean stopping point: the freeze-critical preimage helper is done; the assembler + golden freeze is the next focused pass.Done on the branch
docs/design/contract-bundle-assembly-v0.11.md— scope/non-claim/test-matrix (option b; target-IR digest is a supplied reference; Canonical Target IR bytes + digest (reviewed goldens), then integrate into bundle assembly #105 owns canonical target-IR bytes).- Planned RED rows
BUNDLE-REQ-008/BUNDLE-TP-010..014indocs/topics/contract-bundles/test-plan.md. canonical::digest_bundle_layer(domain: BundleDigestDomain, &[BundlePreimageComponent]) -> CoreDigest— the byte-shape foundation, with 8 byte-shape tests. Structured, not digest-only: components areDigest/DigestList/Resource(binds coordinate+digest, reuses{id,digest}encoding which rejects a missing digest) /ResourceList/SourceArtifacts(bindslogical_path+ artifact). Proven: a coordinate or logical-path change moves the digest even with identical digest bytes.
Next pass —
assemble_contract_bundle(RED→GREEN)1. Typed, lowercase-strict inputs. Make computed-vs-supplied unrepresentable and reject uppercase at construction (don't lean on the validator after hashing):
SuppliedDigest::new/SuppliedTargetIrDigest::new/DigestLockedResource::newvalidate^sha256:[0-9a-f]{64}$. The Core digest is computed inside assembly from a realCoreModuleviadigest_core_module— the caller cannot supply it.2. Exact preimage mapping (this is the whole spec —
CONTINUUM-BUNDLE-SUBJECT-001). Build withdigest_bundle_layerin this exact order:semanticBundleDigest=BundleDigestDomain::Semantic, components in order:# spec component manifest field component type 1 coreIrDigest (computed from CoreModule) Digest2 targetProfileDigest target_profile.digestDigest3 targetIrDigest supplied Digest4 lawpackDigests lawpacks[].digestDigestList5 sourceProfileSemanticFactsDigest source_profile_semantic_facts.digestDigest6 generatedArtifactDigests generated_artifacts[].digestDigestList7 canonicalizationProfileDigest canonicalization_profile.digestDigest8 semanticCompileOptionsDigest semantic_compile_options.digestDigest9 conformanceFixtureCorpusDigests conformance_fixture_corpora[].digestDigestList10 verifierReportDigest verifier_report.digestDigestreleaseBundleDigest=BundleDigestDomain::Release, components in order:# spec component manifest field component type 1 semanticBundleDigest (just computed) Digest2 rawSourceArtifactDescriptors source_artifacts[](logical_path + artifact)SourceArtifacts3 compilerIdentityAndDigest compilerResource4 lowererIdentityAndDigest lowererResource5 verifierIdentityAndDigest verifierResource6 nonSemanticCompileOptionsDigest non_semantic_compile_options.digestDigest7 buildProvenance build_provenance.digestDigest8 compileExplanationDigest compile_explanation.digestDigestNote the split: semantic binds digests; release binds structured identities (Resource = coordinate+digest) and source descriptors (path+artifact). That is what makes the semantic/release mutation matrix hold.
3. Assemble + validate. Fill
ContractBundleManifest(setsemantic_bundle_digest/release_bundle_digestto the computed.to_review_string()), then round-trip throughvalidate_contract_bundle_manifest→Valid.4. Mutation tests (the design-doc matrix;
crates/edict-syntax/tests/contract_bundle.rs): semantic-layer ⇒ both; release-only (source path, toolchain coordinate-with-same-digest, nonsemantic options, build provenance, compile explanation) ⇒ release only; optional assurance evidence ⇒ no top-level digest change; admission inserted ⇒ rejected; uppercase supplied digest ⇒ rejected.5. Freeze. Check in bundle-digest goldens + an
xtaskcheck/regenerate path (mirrorcore-goldens). This is the deliberate freeze. Then flipBUNDLE-REQ-008/BUNDLE-TP-010..014toimplementedwith evidence, update the contract-bundles README (only now), CHANGELOG, open the PR (Closes #106).Gotchas
- Test modules must be at EOF (clippy
items_after_test_module). ContractBundleManifesthas ~20ResourceReffields → the input struct is large but mechanical; reuseSourceArtifactRef/ResourceReftypes.digest_valueaccepts uppercase hex; enforce lowercase in the input constructors (the existing bundle validator already rejects uppercase refs at validation).Resourceencoding requires a present digest (errors onNone) — good, that's the digest-locked invariant.
First v0.11 slice. Design record:
docs/design/contract-bundle-assembly-v0.11.md.Move bundle digest recomputation from out-of-scope to implemented:
assemble_contract_bundle(...)computessemanticBundleDigestandreleaseBundleDigestper the exact spec preimages (CONTINUUM-BUNDLE-SUBJECT-001), reusing theedict.digest/v1framing.coreIrDigestis computed from a real compiledCoreModule;targetIrDigestand all other layer hashes are supplied digest-locked references (typed so computed-vs-supplied is unrepresentable as a mistake).validate_contract_bundle_manifest.Target-IR byte identity is explicitly not in scope (tracked in #105).
Acceptance criteria