-
Notifications
You must be signed in to change notification settings - Fork 0
fix(coverage): trust validated head-mutated pnpm locks via manifest record #1336
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
Merged
Merged
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
790e397
fix(coverage): trust validated head-mutated pnpm locks via manifest r…
seonghobae 956b11e
test(coverage): require lowercase pnpm manifest identities
seonghobae c5b3856
test(coverage): reject comma-greedy pnpm resolution parsing
seonghobae a56c4d1
fix(coverage): bound pnpm inline resolution tokens
seonghobae 11bc884
fix(coverage): normalize pnpm manifest identities
seonghobae f381885
test(coverage): pin normalized dispatch workflow
seonghobae ac714df
fix(coverage): correct pnpm regex escapes
seonghobae 7a90dea
test(strix): align direct fallback queue contract
seonghobae fde65d9
test(strix): align NVIDIA fallback contract
seonghobae 9f31a17
fix(review): align direct OpenAI fallback model
seonghobae 6dbdb1f
test(review): align direct OpenAI fallback assertions
seonghobae 004216f
test(review): pin aligned dispatch workflow
seonghobae 0b41da2
docs(coverage): correct pnpm trust references
seonghobae b12814d
docs(coverage): preserve authoritative OWASP URL
seonghobae 610c740
test(coverage): reproduce pnpm metadata source-word false rejection
seonghobae ab37151
fix(coverage): classify only pnpm fetch declarations
seonghobae 8f375fe
fix(review): bind pnpm manifest manager and current model docs
seonghobae 86f8d7c
test(review): pin pnpm manager-bound dispatch workflow
seonghobae 70ae3e6
test(review): require pnpm manifest manager binding
seonghobae 1d817cd
fix(coverage): restore executable pnpm source guard
seonghobae 889ebec
test(coverage): reproduce versioned pnpm manifest mismatch
seonghobae ca9b5b9
fix(review): match versioned pnpm manifest specs
seonghobae f0d907a
test(review): pin version-aware pnpm manifest workflow
seonghobae 59315de
test(review): require version-aware pnpm manager predicate
seonghobae c5d847e
merge: reconcile protected main into pnpm lock trust repair
seonghobae 6bc96d4
test(coverage): exercise pnpm lock fail-closed branches
seonghobae 3058b18
Merge protected main into pnpm lock trust owner
seonghobae d798c4c
fix(ci): restore complete merged OpenCode workflow
seonghobae e1f1475
Merge origin/main into fix/pnpm-head-lock-validation
seonghobae c694825
fix(ci): escape materializer diagnostics
seonghobae 20c744f
Merge branch 'main' into fix/pnpm-head-lock-validation
opencode-agent[bot] 335e365
docs(copy): make dependency update guidance actionable
seonghobae 275d4d6
Merge branch 'main' into fix/pnpm-head-lock-validation
opencode-agent[bot] 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
Some comments aren't visible on the classic Files Changed page.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| # OpenCode coverage validated head pnpm locks | ||
|
|
||
| 검토 기준일: **2026-08-25** | ||
|
|
||
| ## Decision | ||
|
|
||
| OpenCode coverage-evidence now trusts a PR-mutated `pnpm-lock.yaml` only when | ||
| the trusted materializer recorded that exact lock blob from the validated HEAD | ||
| revision. The sandbox keeps three integrity boundaries and adds a fourth: | ||
|
|
||
| 1. The coverage source artifact must hash-match the validated `PR_HEAD_SHA` | ||
| lock (tamper evidence between artifact download and use). | ||
| 2. An unchanged base lock (base blob equals head blob) remains trusted exactly | ||
| as before. | ||
| 3. A head-mutated lock is trusted only when | ||
| `/opt/javascript-package-locks/manifest.json` records | ||
| `source`, `revision_sha == PR_HEAD_SHA`, and `lock_blob` for this project — | ||
| proving the offline store was prefetched from the same hash-bounded lock at | ||
| image build time. | ||
| 4. Before materialization, `validate_head_pnpm_lock` fails closed unless every | ||
| package entry pins one SHA-512 SRI, every tarball URL is an HTTPS | ||
| `registry.npmjs.org` URL without userinfo, port, query, or fragment, and any | ||
| workspace link target is a relative in-project directory. VCS or file | ||
| sources are refused. | ||
|
|
||
| The npm path already followed this pattern through | ||
| `validate_head_npm_lock`; the pnpm path now mirrors it. `--offline`, | ||
| `--frozen-lockfile`, and lifecycle-hook suppression remain mandatory, so a | ||
| mutated lock can never fetch anything outside the store that was verified | ||
| against the registry's own integrity metadata during image build (npm, n.d.; | ||
| pnpm, n.d.). | ||
|
|
||
| ## Root-cause analysis | ||
|
|
||
| 1. The previous gate required base blob == head blob == worktree blob for | ||
| every pnpm project. Any dependency-raising pull request necessarily mutates | ||
| the lockfile, so such PRs failed coverage-evidence with "Current pnpm lock | ||
| differs from the validated base" regardless of content quality. | ||
| 2. The failure was not hypothetical: ContextualWisdomLab/inkspan#373 (a | ||
| transitive security-floor raise for fast-uri, nanoid, and postcss) carried | ||
| fully green repository-owned checks but could never satisfy this gate, | ||
| leaving the security fix unmergeable while Dependabot alerts stayed open. | ||
| 3. The image build already consumed strictly registry/hash-bounded inputs from | ||
| the live-validated HEAD (`materialize_base_javascript_packages.py --head-sha`), | ||
| so refusing head-mutated pnpm locks added no integrity guarantee that the | ||
| build did not already enforce; it only blocked legitimate dependency work. | ||
|
|
||
| ## Remediation | ||
|
|
||
| - Materializers validate changed head pnpm locks with the same fail-closed | ||
| posture as npm locks before anything enters the networked build context. | ||
| - The sandbox consults the trusted manifest record instead of refusing every | ||
| mutation, keeping tamper evidence against `PR_HEAD_SHA`. | ||
| - Repositories regain the ability to ship audited dependency updates through | ||
| reviewed pull requests instead of forcing direct-to-main writes. | ||
|
|
||
| Independent OpenCode, Strix, and Noema review remain authorization gates. This | ||
| change does not approve, merge, or weaken hash-pinned Python installs, registry | ||
| allowlists, or the networkless PR sandbox. | ||
|
|
||
| ## APA 7th references | ||
|
|
||
| MITRE. (2026). *CWE-494: Download of code without integrity check*. | ||
| https://cwe.mitre.org/data/definitions/494.html | ||
|
|
||
| National Institute of Standards and Technology. (2022). *Secure software | ||
| development framework (SSDF) version 1.1: Recommendations for mitigating the | ||
| risk of software vulnerabilities* (NIST Special Publication 800-218). | ||
| https://doi.org/10.6028/NIST.SP.800-218 | ||
|
|
||
| npm, Inc. (n.d.). *Package lock specification: integrity fields*. npm Docs. | ||
| Retrieved August 25, 2026, from https://docs.npmjs.com/cli/v10/configuring-npm/package-lock-json | ||
|
|
||
| Open Worldwide Application Security Project. (2025). *OWASP Top 10: A06 | ||
| — vulnerable and outdated components*. https://owasp.org/Top10/A06_2021-Vulnerable_and_Outdated_Components/ | ||
|
|
||
| pnpm. (n.d.). *Settings: lockfile and frozen-lockfile*. pnpm Docs. | ||
| Retrieved August 25, 2026, from https://pnpm.io/settings |
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.