-
Notifications
You must be signed in to change notification settings - Fork 0
fix: keep cross-repo OpenCode evidence healthy #939
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
32
commits into
main
Choose a base branch
from
codex/fix-cross-repo-opencode-evidence
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
32 commits
Select commit
Hold shift + click to select a range
6565efe
fix: keep cross-repo OpenCode evidence healthy
0a48367
test(opencode): require formal review before status skip
seonghobae e05e21f
fix(opencode): prove formal review before status skip
seonghobae a5e8534
fix: fail closed on provider scan evidence
seonghobae aaeb13f
test: align Strix outage contract
seonghobae d57398b
docs: align Strix outage gate contract
seonghobae a956dfc
docs(review): record cross-repo OpenCode evidence fail-closed
seonghobae b7a5eb2
ci: repair bounded Strix scope guidance
seonghobae 83675e1
chore(ci): remove failed one-shot repair workflow
seonghobae 6c6cefb
ci: correct Strix scope repair anchors
seonghobae a9c4e04
ci: fix Strix scope repair test source
seonghobae d007af3
ci: repair Strix scope guidance with literal test fixture
seonghobae 7b89f93
fix(strix): orient bounded CI scope inside sandbox
opencode-agent[bot] 44065b9
docs(strix): record bounded PR scope and CI recursion contract
seonghobae 8c859a9
ci: repair nested requirements lock discovery
seonghobae a867124
ci: route lock-path repair to ubuntu-24.04
seonghobae 3cac38d
ci: execute lock-path regression from repository root
seonghobae a6a7399
fix(ci): discover nested requirements lock paths
github-actions[bot] a55a6cf
docs(ci): record base requirements lock discovery contract
seonghobae 1339c17
fix(ci): stop cancelled required checks from looking failed
cursoragent 701ba6c
test(ci): pin merge scheduler to keep required queue scans
cursoragent 34c1f09
fix: refresh cross-repo reviewer blob contract
seonghobae 2c4c6c6
Reconcile current main for cross-repo fix
seonghobae e141833
fix(review): close cross-repository evidence review gaps
seonghobae 4282c3c
test: tighten current-head review contracts
seonghobae 48de4d5
Merge remote-tracking branch 'origin/main' into codex/pr939-review-fix
seonghobae 0912b86
Merge remote-tracking branch 'origin/main' into codex/pr939-review-fix
seonghobae 084e6d2
Merge branch 'main' into codex/fix-cross-repo-opencode-evidence
opencode-agent[bot] 6213f1e
Merge main into cross-repo evidence repair
seonghobae 6df0cb4
Merge branch 'main' into codex/fix-cross-repo-opencode-evidence
opencode-agent[bot] 07b554d
Merge current main and refresh scheduler contracts
seonghobae 2d267d4
test(scheduler): accept non-cancelling required scans
seonghobae 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
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,59 @@ | ||
| # Base requirements lock discovery contract | ||
|
|
||
| ## Purpose | ||
|
|
||
| This doctoring record defines how the central review and coverage workflows discover hash-pinned Python requirement locks from an authenticated pull-request base commit. It records the nested-path regression repaired in pull request #939 and preserves the security boundary already developed in pull request #785. | ||
|
|
||
| ## Incident | ||
|
|
||
| The materializer intentionally recognizes two candidate forms: | ||
|
|
||
| - conventional file names such as `requirements.txt`, `requirements-dev.txt`, and `requirements.lock`; and | ||
| - direct `.txt` children of any directory named `requirements`, such as `requirements/ci.txt` and `service/requirements/package.txt`. | ||
|
|
||
| The path predicate implemented both forms, but `base_hash_locks()` still called the basename-only predicate. As a result, a direct child such as `requirements/ci.txt` was rejected before its authenticated base blob and hash-pinned content could be evaluated. The implementation advertised path-aware eligibility while the collector enforced only legacy basename eligibility. | ||
|
|
||
| The repair changes the collector to call `_is_candidate_lock_path(candidate)` with the already parsed `PurePosixPath`. It does not broaden the accepted Git object types or relax content validation. | ||
|
|
||
| ## Trust boundary | ||
|
|
||
| A candidate enters the generated build context only when every applicable condition holds: | ||
|
|
||
| 1. The base revision is an exact 40-character hexadecimal commit SHA. | ||
| 2. `git ls-tree` reports a regular `100...` blob in that exact base tree. | ||
| 3. The repository-relative path is non-absolute and contains no `..` component. | ||
| 4. The path is either a conventional requirements lock name or a direct `.txt` child of a directory named `requirements`. | ||
| 5. Every substantive requirement is an exact `==` pin with complete SHA-256 hashes, or a separately bounded relative requirements include. | ||
| 6. Symlinks, gitlinks, malformed tree entries, unpinned files, unsafe includes, and pull-request-only content remain excluded. | ||
| 7. `uv.lock` follows its separate trusted export path and still requires the corresponding base-owned `pyproject.toml`. | ||
|
|
||
| Path eligibility is candidate discovery, not dependency trust. The existing hash, include, export, and downstream closure checks remain authoritative. | ||
|
|
||
| ## Test-first evidence | ||
|
|
||
| Temporary repair workflow run `31787913977` executed the following sequence on head `912313ff92cdcee6f240e9584f79ca37615ee5a2`: | ||
|
|
||
| 1. Created a temporary Git repository containing hash-pinned `requirements/ci.txt` and `service/requirements/package.txt` blobs. | ||
| 2. Confirmed the regression test failed before the implementation change because neither path was collected. | ||
| 3. Replaced the basename-only collector predicate with the repository-relative path predicate. | ||
| 4. Confirmed both paths were returned in deterministic repository order. | ||
| 5. Compiled the implementation and regression test and ran `git diff --check`. | ||
| 6. Deleted the temporary writer workflow before committing the production change. | ||
|
|
||
| An earlier repair attempt failed before exercising the assertion because direct script execution omitted the repository root from `sys.path`. The corrected workflow ran both RED and GREEN phases with the same explicit `PYTHONPATH=.` environment, so the observed transition is attributable to the collector change rather than import setup. | ||
|
|
||
| ## Permanent regression command | ||
|
|
||
| ```bash | ||
| PYTHONPATH=. python3 tests/test_materialize_base_python_requirement_paths.py | ||
| python3 -m compileall -q \ | ||
| scripts/ci/materialize_base_python_requirements.py \ | ||
| tests/test_materialize_base_python_requirement_paths.py | ||
| git diff --check | ||
| ``` | ||
|
|
||
| The repository quality workflow must also run the full materializer and Strix regression suites on the exact pull-request head. Focused repair evidence cannot replace protected-branch checks, semantic review, or required independent approvals. | ||
|
|
||
| ## Change-management rule | ||
|
|
||
| Future changes to candidate naming, path parsing, Git tree filtering, requirement includes, `uv.lock` export, or materialized manifests must update the path-discovery tests and the broader materializer suite together. A path predicate and its collector call site must not evolve independently. |
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,32 @@ | ||
| # Cross-repository OpenCode evidence | ||
|
|
||
| ## Incident and buyer impact | ||
|
|
||
| Sibling-repo reviews (for example `ContextualWisdomLab/naruon#1317`) lost | ||
| coverage-evidence when the former Astral release endpoint rejected requests, | ||
| and the OpenCode App token could not publish a commit status across | ||
| repositories. A later Strix provider outage was also converted into a green | ||
| required check, so incomplete security evidence looked like a pass. | ||
|
|
||
| ## Decision | ||
|
|
||
| 1. Download uv from the literal GitHub Releases HTTPS URL with a fixed | ||
| `User-Agent`, disable proxies, reject redirects, and retain size, checksum, | ||
| and executable-version checks. Repository or user data cannot select the | ||
| network origin. | ||
| 2. Before skipping cross-repository status publication, prove an exact-head | ||
| formal OpenCode review from an accepted author (`opencode-agent[bot]` or | ||
| `opencode-agent`) with state (`APPROVED` or `CHANGES_REQUESTED`). Missing | ||
| proof, an unaccepted author, or a mismatched head fails closed. | ||
| 3. Keep Strix red when the backend is unavailable. Incomplete provider | ||
| evidence is not a clean scan. | ||
|
|
||
| ## References | ||
|
|
||
| Fielding, R., Nottingham, M., & Reschke, J. (Eds.). (2022). *HTTP semantics* | ||
| (RFC 9110). Internet Engineering Task Force. | ||
| https://doi.org/10.17487/RFC9110 | ||
|
|
||
| National Institute of Standards and Technology. (2020). *Security and privacy | ||
| controls for information systems and organizations* (NIST Special Publication | ||
| 800-53 Rev. 5). https://doi.org/10.6028/NIST.SP.800-53r5 |
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.