-
Notifications
You must be signed in to change notification settings - Fork 0
fix(coverage): trust validated Python head locks #1398
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
seonghobae
wants to merge
17
commits into
main
Choose a base branch
from
fix/coverage-python-head-lock-trust
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
5f34e2d
fix(coverage): trust validated Python head locks
seonghobae b9c2c66
fix(coverage): revalidate head requirement includes
seonghobae fe131b7
fix(coverage): refresh changed uv inputs
seonghobae 366ffd9
fix(coverage): preserve shared uv source ownership
seonghobae 2ef42b6
docs(doctoring): include newly added VCS projects
seonghobae ac5c3aa
Merge remote-tracking branch 'origin/main' into fix/coverage-python-h…
seonghobae a04be2e
Merge remote-tracking branch 'origin/main' into fix/coverage-python-h…
seonghobae 727e724
fix(coverage): preserve exact-head uv repairs
seonghobae 8c0869a
fix(coverage): classify exact-head include changes
seonghobae f018f1d
fix: preserve VCS owners and bound Pingora evidence
seonghobae 4db2000
fix: accept empty changed dependency locks
seonghobae ca084e7
fix(coverage): reject malformed empty head locks
seonghobae 57bb89c
Merge branch 'main' into fix/coverage-python-head-lock-trust
claude c641b13
Merge branch 'main' into fix/coverage-python-head-lock-trust
opencode-agent[bot] 8f31cf4
Merge remote-tracking branch 'origin/main' into test-fix/coverage-pyt…
claude a3f3c96
Merge remote-tracking branch 'origin/main' into fix/coverage-python-h…
claude 68a51d7
fix(pingora-edge-policy): make PDF verification share the content evi…
claude File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| # OpenCode coverage validated-head Python locks | ||
|
|
||
| 검토 기준일: **2026-08-29** | ||
|
|
||
| ## Decision | ||
|
|
||
| OpenCode coverage may use a pull request's changed Python requirements lock when | ||
| the lock is read from the authenticated, validated HEAD SHA and every logical | ||
| requirement is an exact `==` pin with one or more complete SHA-256 hashes. A | ||
| changed HEAD lock must be flat: URLs, VCS sources, relative includes, and | ||
| unpinned lines do not cross into the networked coverage-image build context. | ||
|
|
||
| An unchanged lock remains materialized from the validated base SHA. When a | ||
| tracked base lock changes, the validated flat HEAD lock replaces it rather than | ||
| installing both revisions. For an unchanged base lock with a bounded relative | ||
| include, the include blob is compared with the exact HEAD tree: a changed | ||
| include is materialized only when it remains flat and fully SHA-256 pinned, while | ||
| deleted or invalid content fails closed. A base lock that becomes unbounded | ||
| fails closed. A changed or newly added `uv.lock` project with a regular sibling | ||
| `pyproject.toml` is re-exported from the exact HEAD through the existing frozen, | ||
| offline, checksum-validating exporter; deleted projects remove their base | ||
| registry and VCS inputs, and unchanged projects remain base-bound. Base and HEAD | ||
| `uv.lock` inventories are completed before export, so a changed or deleted HEAD | ||
| project never requires its stale base export to succeed first. | ||
|
|
||
| The workflow keeps this materialization enabled for every tracked `.txt` change: | ||
| the path alone cannot prove that a file is not a bounded include target. Content | ||
| validation still decides whether that candidate can enter the trusted image. | ||
|
|
||
| ## Root cause | ||
|
|
||
| The coverage image was built only from `PR_BASE_SHA` Python locks. A legitimate | ||
| dependency pull request could therefore add a platform wheel hash to its | ||
| current-head lock, while the image builder still saw the older base file. Pip | ||
| then failed before PR tests because the compatible wheel's hash was absent from | ||
| the stale lock. The JavaScript materializer already handled this case by | ||
| validating and recording changed HEAD locks; Python had no equivalent path. | ||
|
|
||
| ## Security boundary | ||
|
|
||
| The central workflow and materializer validate the exact base and head revisions | ||
| before any Git tree read. Only a regular candidate lock from the exact HEAD is | ||
| read, and only a flat SHA-256-pinned file can replace a base lock. Changed | ||
| `uv.lock` projects reuse the same isolated exporter against exact HEAD | ||
| `uv.lock` and sibling metadata, then apply the established registry hash and | ||
| organization-owned full-commit VCS validation. A bounded | ||
| include beneath an unchanged base lock is likewise read from HEAD only after | ||
| its exact base/head blob comparison and regular-file check; its content must be | ||
| flat and fully pinned. The image installer retains | ||
| `pip install --require-hashes --only-binary=:all:`; source distributions, build | ||
| backends, VCS dependencies, unbounded requirements, deleted includes, and | ||
| invalid include content remain rejected or outside this path. The later PR | ||
| sandbox remains networkless and credential-free. | ||
|
|
||
| This is a provenance and compatibility repair, not an approval or merge | ||
| mechanism. Current-head OpenCode, Strix, other required Checks, review threads, | ||
| and protected-branch rules remain independent gates. | ||
|
|
||
| ## Verification contract | ||
|
|
||
| Regression coverage proves that a changed exact-head lock replaces stale base | ||
| content; a changed, deleted, or invalid include beneath an unchanged parent is | ||
| handled from the exact HEAD; and changed, deleted, registry-only, VCS-only, and | ||
| mixed `uv.lock` projects replace or remove every base export component before | ||
| image build. Workflow contract coverage proves that the materializer receives | ||
| both `PR_BASE_SHA` and `PR_HEAD_SHA`. The central quality gate must retain | ||
| complete statement, branch, and docstring coverage. | ||
|
|
||
| ## APA 7th references | ||
|
|
||
| Python Packaging Authority. (n.d.). *Secure installs*. pip documentation. | ||
| Retrieved August 29, 2026, from | ||
| https://pip.pypa.io/en/stable/topics/secure-installs/ | ||
|
|
||
| Python Packaging Authority. (n.d.). *pip install*. pip documentation. Retrieved | ||
| August 29, 2026, from https://pip.pypa.io/en/stable/cli/pip_install/ | ||
|
|
||
| Supply-chain Levels for Software Artifacts. (2025). *SLSA specification (version | ||
| 1.2)*. https://slsa.dev/spec/v1.2/ |
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.