-
Notifications
You must be signed in to change notification settings - Fork 0
fix(coverage): run pnpm 9 evidence without --trust-lockfile #1258
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
seonghobae
merged 4 commits into
main
from
fix/coverage-pnpm9-trust-lockfile-and-js-provider
Aug 24, 2026
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
a6ea72c
fix(coverage): run pnpm 9 evidence without --trust-lockfile
seonghobae 1b6f4d7
fix(coverage): gate --trust-lockfile on pnpm 11 and keep Jest coverage
seonghobae 9b5dba9
fix(coverage): pass --trust-lockfile only on pnpm 11.3+
seonghobae 897819c
fix(coverage): keep missing frontend coverage fail-closed
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| # OpenCode coverage pnpm lock compatibility | ||
|
|
||
| 검토 기준일: **2026-08-23** | ||
|
|
||
| ## Decision | ||
|
|
||
| OpenCode coverage-evidence honors the repository-owned `packageManager` | ||
| pin through Corepack. `--trust-lockfile` is valid only on pnpm 11.3 and | ||
| newer (`trustLockfile` landed in pnpm 11.3; Kochan, 2026). pnpm 11.0, | ||
| 11.1, and 11.2 still reject the flag. Exact trusted-base lock matching | ||
| remains mandatory before any offline install. The sandbox never invents a | ||
| JavaScript coverage instrumenter when the package did not declare one, | ||
| except that a bare `jest` test script still receives Jest's documented | ||
| `--coverage` flag and a Vitest script receives it only when a compatible | ||
| Vitest coverage provider is lock-pinned. | ||
|
|
||
| This keeps LineageWeave and other pnpm 9.x products measurable after | ||
| Corepack started activating the repository pin instead of a central | ||
| pnpm 11.5.3 binary. A paying reviewer of lineage reconstruction would | ||
| otherwise see every frontend head blocked on `Unknown option: | ||
| 'trust-lockfile'` and, after that, on `vitest --coverage` without | ||
| `@vitest/coverage-v8`. | ||
|
|
||
| ## Root-cause analysis | ||
|
|
||
| 1. Coverage images now activate the exact `packageManager` from the | ||
| validated base (for LineageWeave, `pnpm@9.15.9`). | ||
| 2. The install command still passed `--trust-lockfile`, a pnpm 11.3 flag. | ||
| pnpm 9, pnpm 10, and pnpm 11.0–11.2 exit before reading the store. | ||
| 3. After a successful install, coverage appended `--coverage` to `vitest run` | ||
| even when no coverage provider was declared, so tests never became | ||
| evidence. | ||
|
|
||
| The lock-matching gate is unchanged: a PR-added or PR-mutated | ||
| `pnpm-lock.yaml` is still refused. `--offline`, `--frozen-lockfile`, | ||
| `--ignore-scripts`, and the writable clone of `/opt/pnpm-store` remain | ||
| required. Python still never runs `uv sync --project`. | ||
|
|
||
| ## Remediation | ||
|
|
||
| - When `corepack pnpm --version` reports 11.3 or newer (major greater | ||
| than 11, or major 11 with minor 3 or greater), keep `--trust-lockfile` | ||
| so registry attestation lookups stay suppressed for an exact | ||
| trusted-base lock (Kochan, 2026; pnpm, n.d.). | ||
| - When the version is below 11.3, omit that flag. pnpm 9, 10, and | ||
| 11.0–11.2 already treat `--frozen-lockfile` plus `--offline` as the | ||
| integrity boundary. | ||
| - When `package.json` has a test script but no coverage script or compatible | ||
| coverage-collecting runner, run the tests without synthesizing an undeclared | ||
| instrumenter and fail the coverage result with the next action: add a | ||
| lock-pinned provider and repository-owned coverage command. Plain passing | ||
| tests are not 100% frontend coverage evidence. | ||
| - A bare Jest script receives `--coverage` because Jest documents that native | ||
| flag (Jest, n.d.). Vitest receives `--coverage` only with | ||
| `@vitest/coverage-v8` or `@vitest/coverage-istanbul`. A generic `c8`, `nyc`, | ||
| or Istanbul dependency is not proof that an arbitrary runner accepts the | ||
| flag; those collectors count only when the test script actually invokes | ||
| them. | ||
|
|
||
| Independent OpenCode, Strix, and Noema review remain authorization | ||
| gates. This change does not approve, merge, or weaken hash-pinned | ||
| Python or npm installs. | ||
|
|
||
| ## APA 7th references | ||
|
|
||
| GitHub, Inc. (n.d.). *Using a package.json file to specify the package | ||
| manager*. GitHub Docs. Retrieved August 23, 2026, from | ||
| https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry | ||
|
|
||
| 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 | ||
|
|
||
| Jest. (n.d.). *Jest CLI options: --coverage*. Jest Docs. Retrieved | ||
| August 23, 2026, from https://jestjs.io/docs/cli#--coverageboolean | ||
|
|
||
| Kochan, Z. (2026, May 24). *pnpm 11.3*. pnpm Blog. | ||
| https://pnpm.io/blog/releases/11.3 | ||
|
|
||
| pnpm. (n.d.). *pnpm install*. pnpm Docs. Retrieved August 23, 2026, from | ||
| https://pnpm.io/cli/install | ||
|
|
||
| Vitest. (n.d.). *Coverage*. Vitest Docs. Retrieved August 23, 2026, from | ||
| https://vitest.dev/guide/coverage |
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.