Skip to content

feat(format): 1.1.0 — manifest specURL, coverage, scopes, bundleDigest - #10

Merged
Krivoblotsky merged 1 commit into
mainfrom
feat/manifest-1.1
Sep 14, 2026
Merged

Krivoblotsky merged 1 commit into
mainfrom
feat/manifest-1.1

Conversation

@Krivoblotsky

Copy link
Copy Markdown
Contributor

Item 1 of the checklist from Stan Tyan's portability article: his manifest template asks for a spec URL, coverage dates, a scope enumeration and an archive-level checksum. We had none of the first three.

Format 1.1.0 (spec §3.1) — four optional manifest fields

Field Meaning
specURL URL of the specification the bundle follows
coverage {from, to} — earliest/latest episode eventTime in this bundle (incremental exports describe their own contents)
scopes sorted (code point), de-duplicated context ids the records reference — episode contextID ∪ exported context record ids
bundleDigest sha256 of the exact CHECKSUMS bytes — one hash for the whole archive; the validator recomputes it when present

Minor bump 1.0.0 → 1.1.0. Readers MUST accept the fields' absence, so every 1.0 bundle stays valid — the shipped 1.0 fixtures (sample.mem, signed.mem) now double as backward-compatibility tests. Absent optional fields are omitted, never null (canonical rules).

Changes

  • format.py: MemFormat.VERSION = "1.1.0", MemFormat.SPEC_URL, new MemCoverage dataclass, optional MemManifest fields (exported from the package).
  • exporter.py: emits all four (_write_checksums now returns the bytes it wrote; coverage/scopes computed from the episodes actually in the bundle). Evidence Pack manifests carry bundleDigest too.
  • validator.py: verifies bundleDigest against the on-disk CHECKSUMS (size-bounded); reports missing CHECKSUMS when a digest is declared.
  • Schemas/manifest.schema.json + spec §3 example, new §3.1, §9 format history — byte-identical in the Swift repo.

Tests (+7 → 80 passed)

Field values and on-disk JSON · scopes sorted/unique/empty-skipped · incremental coverage · empty bundle · validator catches a smuggled CHECKSUMS line, a lying digest, and a missing CHECKSUMS · 1.0 fixture validates + imports · manifest validates against the JSON Schema. The transfer-fixture bundle's bundleDigest (1f7f0cdc…) is pinned as a literal in both SDK suites — cross-SDK parity for the new field.

Pairs with the Swift PR.

🤖 Generated with Claude Code

Four optional manifest fields (spec §3.1) so a bundle answers 'what does this archive
cover, in which scopes, and is it whole?' without opening a stream — the questions a
procurement or erasure audit asks first (and the fields Stan Tyan's portability
checklist expects in a manifest):

- specURL      — URL of the specification the bundle follows.
- coverage     — {from, to}: earliest/latest episode eventTime IN THIS BUNDLE.
- scopes       — sorted (code point), de-duplicated context ids the records reference
                 (episode contextID ∪ exported context record ids).
- bundleDigest — sha256 of the exact CHECKSUMS bytes: one hash for the whole archive.
                 The validator recomputes it when present.

Minor bump 1.0.0 → 1.1.0: readers MUST accept absence, so every 1.0 bundle stays valid;
the shipped 1.0 fixtures now double as backward-compatibility tests. MemCoverage is
exported. Schema + spec updated (byte-identical in the Swift repo). Tests: 80 passed.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@Krivoblotsky
Krivoblotsky merged commit 38b4a79 into main Sep 14, 2026
9 checks passed
@Krivoblotsky
Krivoblotsky deleted the feat/manifest-1.1 branch September 14, 2026 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants