Add pure weekly period bundle binding contract - #31
Conversation
Co-Authored-By: Codex <noreply@openai.com>
🤖 Codex PR Review🚫 Merge blocked: 1 serious issue(s) found in high-risk files ⚖️ Codex Review Arbitration🚫 block: 🚫 Blocking IssuesThese issues must be fixed before this PR can be merged: 1. 🟠 [HIGH] Security in
|
Co-Authored-By: Codex <noreply@openai.com>
|
Concentrated closure applied at
Pure PR-1A boundary is unchanged: no workflow, permissions, Actions, producer, or privileged integration changes. |
|
PERMANENT_FREEZE/CLOSE_RESLICE per control-plane stop rule. Preserving branch, worktree, commits, review threads, CI/review evidence; no further code action. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 119149b036
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if period_lock != context.period_lock: | ||
| raise _error("bundle_lock_mismatch") | ||
| try: | ||
| lock_bytes = serialize_period_lock(period_lock) |
There was a problem hiding this comment.
Reject oversized generated bundle members
When period_lock is valid but serializes above the verifier caps, build_period_bundle() still returns a BundleWire that verify_period_bundle() rejects immediately (for example, 17 source artifacts with 4096-character paths are under the snapshot limits but produce lock_bytes > MAX_LOCK_BYTES, causing bundle_lock_oversized). Please enforce the same member-size limits while building so a locally built bundle cannot be unverifiable by this contract.
Useful? React with 👍 / 👎.
| if self.period_lock.source_run_id != self.run_id or self.period_lock.source_attempt != 1: | ||
| raise _error("bundle_lock_context_mismatch") | ||
| if self.period_lock.producer_ref != self.producer_sha: |
There was a problem hiding this comment.
Reject locks from a different workflow ref
When the supplied period_lock.workflow_ref names a different owner/repo than repository, this context still validates because only the run id/attempt and producer SHA are compared. build_period_bundle() and verify_period_bundle() then accept a bundle whose manifest is bound to the expected repository while the lock source of truth points elsewhere, so inconsistent origin evidence does not fail closed. Please bind the lock's workflow ref to the bundle repository before accepting the context.
Useful? React with 👍 / 👎.
Scope
PR-1A pure foundation from
pert_weekly_trusted_workflow_period_lock_redesign_d0_2026-07-15.md. No workflow, GitHub API, filesystem, upload/download, producer, QAR, Pages, legacy, migration, or privileged permission changes. This does not reuse PR #30.Contract
BundleContextfixes originalrun_id,source_attempt=1, expected merged period lock, exact reviewed workflow SHA, producer SHA, and external artifact evidence (name/id/digest/retention).BundleWireis canonical bytes for exactly period lock, input snapshot, and bundle manifest, with SHA-256 properties.verify_period_bundle()reconstructs the complete expected lock, snapshot, and manifest from the full context and requires byte-for-byte equality; a replacement payload plus recomputed manifest cannot pass.RerunContextaccepts only current attempt 2 and reuses the original context. Collection verification requires exactly one bundle.Validation
python3 -m pytest -q: 107 passeduv sync --locked --extra test && uv run --locked pytest -q: 107 passedpython3 -m compileall -q src tests scripts: passedgit diff --check: passedruff: unavailable in environmentExplicit non-scope
No
actions:read,artifact-metadata:write, workflow changes, arbitrary ref checkout, or PR privileged execution. PR-1B is blocked until this PR is merged and post-merge main CI succeeds; only then may a trusted default-branch harness be created and the one controlled rerun performed.