feat: single component release transaction (marqdo#96 M1) #98

Merged
cflmy merged 4 commits from feat/component-release-kit into main 2026-12-02 23:12:57 +08:00
Owner

Implements the shared component release transaction required by
marqdo#96 M1:
one implementation for stdlib and extension repositories, no parallel
release protocol, no second manifest and no new release service.

What this adds

  • scripts/component-release/release.py — self-contained release transaction:
    • package: deterministic archive of only the reviewed release paths of
      the exact tagged commit (git archive <sha> -- <allow> + gzip -n), built
      twice and byte-compared; refuses unsafe/empty paths and archive members
      outside the released paths.
    • evidence: the existing ecosystem release-evidence.json schema
      (verified by scripts/reconcile-releases.py), with the same-SHA Woodpecker
      ci pipeline discovered through the public read-only API; publishing is
      refused when no successful same-SHA CI exists.
    • publish: Gitea draft transaction — payload assets first,
      release-evidence.json last, byte-for-byte readback of every asset, then
      make public. Published bytes are never overwritten; identical re-runs are
      idempotent; different bytes for the same tag fail closed.
  • scripts/component-release/README.md + templates/publish.yml — how a
    component repository pins the kit (root commit + sha256) in a protected
    tag-only Woodpecker workflow; push/PR lanes only run the deterministic
    package self-check and never hold the publish token.
  • tests/integration/test_component_release.py — 14 contract tests for
    determinism, path safety, version/dependency identity, evidence shape, CI
    discovery and publish ordering.

Rollout

The kit is consumed by the stdlib repositories through a pinned raw file at a
reviewed root commit; the first independent releases produced with the same
logic were published in the respective component repositories and verified by
the root reconcile path (progress recorded on #96). This PR itself publishes
nothing and changes no existing release bytes.

Tests

  • python3 -m unittest discover -s tests/integration — 142 tests OK
  • python3 scripts/check-layout.py — OK
  • python3 scripts/check-repo-conventions.py — PASS (38 components)
Implements the shared component release transaction required by [marqdo#96](https://git.cflmy.cn/cflmy/marqdo/issues/96) M1: **one implementation** for stdlib and extension repositories, no parallel release protocol, no second manifest and no new release service. ## What this adds - `scripts/component-release/release.py` — self-contained release transaction: - **package**: deterministic archive of *only* the reviewed release paths of the exact tagged commit (`git archive <sha> -- <allow>` + `gzip -n`), built twice and byte-compared; refuses unsafe/empty paths and archive members outside the released paths. - **evidence**: the existing ecosystem `release-evidence.json` schema (verified by `scripts/reconcile-releases.py`), with the same-SHA Woodpecker `ci` pipeline discovered through the public read-only API; publishing is refused when no successful same-SHA CI exists. - **publish**: Gitea draft transaction — payload assets first, `release-evidence.json` last, byte-for-byte readback of every asset, then make public. Published bytes are never overwritten; identical re-runs are idempotent; different bytes for the same tag fail closed. - `scripts/component-release/README.md` + `templates/publish.yml` — how a component repository pins the kit (root commit + sha256) in a protected `tag`-only Woodpecker workflow; push/PR lanes only run the deterministic package self-check and never hold the publish token. - `tests/integration/test_component_release.py` — 14 contract tests for determinism, path safety, version/dependency identity, evidence shape, CI discovery and publish ordering. ## Rollout The kit is consumed by the stdlib repositories through a pinned raw file at a reviewed root commit; the first independent releases produced with the same logic were published in the respective component repositories and verified by the root reconcile path (progress recorded on #96). This PR itself publishes nothing and changes no existing release bytes. ## Tests - `python3 -m unittest discover -s tests/integration` — 142 tests OK - `python3 scripts/check-layout.py` — OK - `python3 scripts/check-repo-conventions.py` — PASS (38 components)
cflmy added 1 commit 2026-12-02 22:17:36 +08:00
Add one shared, self-contained component release implementation for stdlib and
extension repositories (marqdo#96 M1): deterministic allowlisted packaging of
the exact tagged commit, release-evidence.json with same-SHA Woodpecker CI
discovery, and an immutable Gitea draft->publish transaction with byte readback.

The kit is pinned by root commit + sha256 in each component repository's
protected tag workflow; ordinary push/PR lanes only run the deterministic
package self-check and never receive the publish token. No stdlib/ext specific
manifest or second release service is introduced.

Adds contract tests for packaging determinism, archive path safety, evidence
shape, dependency identity, CI discovery and publish ordering.
cflmy added 1 commit 2026-12-02 22:42:26 +08:00
cflmy added 2 commits 2026-12-02 23:12:45 +08:00
- Build the archive from exact Git objects (git ls-tree / git cat-file) with
  fixed tar and gzip metadata instead of git archive + gzip, so export-ignore,
  export-subst and local attribute files cannot silently drop or rewrite
  released bytes; verify every member and byte against the commit blobs.
- Select the same-SHA CI pipeline deterministically (lowest successful number)
  so re-running the transaction reproduces already published evidence.
- Preflight the remote tag identity, require channel consistency on idempotent
  re-runs, add --reset-draft recovery for interrupted drafts, and stop
  forwarding the publish token across redirects.
- Reject case/NFC collisions, backslash/control-character members, wildcard
  allow entries, unknown/duplicate dependency fields; honor --source-sha and
  --out-dir in check; clean temporary directories.
- Fix the documented/template dependency syntax and add regression tests for
  determinism, export attributes, collisions, deterministic CI selection and
  remote tag identity.
cflmy merged commit c367d1df3e into main 2026-12-02 23:12:57 +08:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: cflmy/marqdo#98