feat(release-artifact): decode and bound-extract the provider's signed assets archive - #266
Open
Alan-TheGentleman wants to merge 2 commits into
Open
Conversation
…ed extractor Decode gentle-ai's gentle-ai.release-artifact contract exactly as the provider declares it: unsupported contract major fails closed before any entries/tree layout is interpreted, entries are validated against the provider's exact path-confinement and mode/type/digest rules, and the gentle-ai.release-artifact-tree/v1 preimage reproduces the provider's Go known-vector digest byte-for-byte. Bounded extraction (design D2) stages size caps and exact path-set equality before any archive byte is written, so an archive member the manifest never declared is rejected before bulk extraction runs, not merely detected afterward by a digest that could never have noticed it was there. A bootstrap-archive evidence path stays explicit and is barred from pin/final-acceptance evidence. Scoped to PR 1 / P1a: the stdlib-only, no-network decode/extract surface. Network download, minisign verification, and checksum matching stay with scripts/sync-gentle-ai-release.mjs in a later PR.
Tick tasks 1.1-1.8 in the consume-gentle-ai-release-artifacts tracker and record RED-then-GREEN TDD evidence for the batch in apply-progress.md.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This was referenced Aug 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First slice of the consumer chain. Adds the bootstrap decoder that targets the shape gentle-ai declares, without re-authoring any part of that format.
Prerequisites, verified rather than assumed
The tracker was rebased onto
mainand all three landed prerequisites confirmed present: the single authoritative pin (#262), additive-tolerant gates and projections with mandatory features still exact (#263), andopenspec/specs/package-runtime/spec.mdfrom the archive (#265). None of them were re-implemented here.Two ordering decisions that are the whole point
Exact path-set equality runs before digesting. A tree digest computed over the files you found produces the same digest whether or not an extra file exists, because the digest walk only ever revisits declared entries. It structurally cannot notice an addition. So the member set is compared against the manifest first, and only then digested.
That is proven three ways, not asserted: a pure unit test, an orchestration test asserting extraction is never reached once the check rejects, and an end-to-end test that builds two real
.tar.gzarchives with the system tar, one carrying an undeclared file, and watches the production listing path reject it.Extraction is bounded before any byte is written. The manifest's
entries[].sizeis enforced during a listing pass ahead of extraction. A digest check after the fact is too late against a decompression bomb.The unsupported-major failure names the major and happens before any layout inference. Failing closed after guessing a layout is not failing closed.
Reproducing the provider's digest
The tree-digest preimage is the tag plus a NUL byte, then per entry
path\0type\0mode\0size\0digest\n. Verified byte-identical against the provider's Go known-vector output rather than reimplemented from the prose description.One honest limitation
The real system-tar listing parser is tuned to GNU tar's verbose column format. On a BSD or bsdtar dialect it fails closed — it rejects rather than silently misparsing. That is the safe direction, but it is a real gap to harden when the macOS and Windows install paths are exercised in P2b, and it is flagged rather than left to be discovered.
Tests
42/42 green.
pnpm run check:transaction-runnerclean, with the new module registered in the generator's sources and regenerated rather than hand-edited.Rollback
Delete the new lib, runtime, test and fixture files, and revert the one-line sources entry. Nothing else references them.