Skip to content

Expose promoted template content digests - #61

Merged
CMGS merged 5 commits into
mainfrom
codex/template-content-identity
Aug 11, 2026
Merged

Expose promoted template content digests#61
CMGS merged 5 commits into
mainfrom
codex/template-content-identity

Conversation

@CMGS

@CMGS CMGS commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • compute one canonical SHA-256 identity over the regular-file export produced by Promote
  • persist the digest with the exact published generation and return it from Promote and promoted-template Claim
  • expose the identity through the Go and Python SDKs
  • keep generation selection exact across supported shared backends: striped cross-process flock for shared directories, retained immutable S3 generations, and retryable exports-first S3 deletion

Integration

This closes the mutable-template identity gap identified while reviewing cocoonstack/instar#4 and the T11 item in cocoonstack/instar#1. Instar can pin and compare the digest returned by the exact Claim generation instead of trusting a reusable template name.

Validation

  • make go-test
  • make go-lint
  • python -m pytest -q: 137 passed
  • python -m ruff check .
  • asl ./store/...
  • git diff --check

Boundary

Existing templates have an empty digest until they are promoted again. Shared directory stores must provide cross-node POSIX flock, and S3 keeps superseded generations until Delete under the existing single-writer-per-id contract. This PR does not add a template registry, version API, or claim-time full rehash.

CMGS added 4 commits August 11, 2026 13:23
The retry sweep ran at reapOnce's tail, so a failed reap commit skipped
it; trigger it from the tick loop like retryRemovals. Reuse
pinnedArchiveCks for the single-id check, skip the sweep scan when no
markers exist, and tighten digest/store comments.
@CMGS
CMGS marked this pull request as ready for review August 11, 2026 09:36
@CMGS

CMGS commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

Before this ships: decide the digest stream format. cocoonstack/cocoon#193 proposes engine-side digest emission, which is only practical if the stream moves from the v1 single ordered stream to a v2 per-file manifest (per-file sha256 computed in write order, sorted manifest hashed last). The wire fields and sha256: prefix are unchanged either way, but the digest values differ - switching is free before the first release of this API and needs a version bump plus re-promotion afterwards. If v2 is agreed, the sandbox-side swap in exportContentDigest is small and also parallelizes the local fallback.

A delete backlog re-checks every marker per tick; building the full pin
map under m.mu for each one adds allocation and lock hold exactly when
the store is already failing.
@CMGS
CMGS merged commit 0a21882 into main Aug 11, 2026
2 checks passed
@CMGS
CMGS deleted the codex/template-content-identity branch August 11, 2026 09:45
@CMGS

CMGS commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

Format decision resolved: #64 replaces the v1 stream with a v2 chunked manifest (16 MiB chunks) computed by the store backends themselves - PublishDigested, dir parallel hash, s3 upload tee, digest moved out of meta.json. No compatibility kept; digest values change, which is why it lands before this API first ships.

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.

1 participant