Skip to content

Commit f614746

Browse files
Pigbibicodex
andcommitted
Add pure weekly period bundle binding contract
Co-Authored-By: Codex <noreply@openai.com>
1 parent d20719f commit f614746

3 files changed

Lines changed: 616 additions & 0 deletions

File tree

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# `pert.weekly.period_bundle.v1`
2+
3+
This is a pure contract library for a later trusted Actions acquisition
4+
harness. It performs no filesystem, GitHub API, upload, download, or producer
5+
work. The existing `pert.weekly.period_lock.v1` remains the period source of
6+
truth.
7+
8+
## Immutable models
9+
10+
- `BundleContext` fixes the original `run_id`, `source_attempt=1`, exact
11+
reviewed workflow SHA, producer SHA, expected period lock, and external
12+
artifact evidence (`name`, `id`, digest, retention).
13+
- `BundleWire` contains only canonical `period_lock.json`,
14+
`input_snapshot.json`, and `bundle_manifest.json` bytes plus the external
15+
artifact evidence. Its SHA-256 properties cover all three byte members.
16+
- `RerunContext` accepts only current `run_attempt=2` and reuses the original
17+
context; it cannot derive a new period or snapshot.
18+
19+
The canonical manifest binds the bundle version, artifact name, original run
20+
identity, workflow and producer SHAs, lock/snapshot versions, and exact lock
21+
and snapshot hashes. Artifact id/digest/retention are external Actions
22+
evidence and are required to match the immutable `BundleContext`; manifest
23+
self-hashing is intentionally avoided.
24+
25+
## Verification rules
26+
27+
`verify_period_bundle()` reconstructs the expected lock, snapshot, and manifest
28+
from the complete context and requires byte-for-byte equality. It does not
29+
accept a manifest recomputed from a replacement lock or snapshot. Duplicate,
30+
unknown, missing, reordered, malformed, noncanonical, unsafe-integer, wrong
31+
run/attempt/SHA/artifact, and tampered values fail closed with sanitized
32+
`WeeklyBundleError` codes. `verify_bundle_collection()` requires exactly one
33+
bundle. Unexpected programming/system exceptions are not broad-caught.
34+
35+
This library is PR-1A only. A privileged workflow that has `actions:read` must
36+
be a later PR sourced from the trusted default branch and must never execute
37+
PR-controlled code.

0 commit comments

Comments
 (0)