Repository navigation
[PG-01] Preserve hosted runner metadata for provenance - #12
Conversation
|
@codex review |
|
@codex security review |
|
OpenRouter review posted ( |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
There was a problem hiding this comment.
OpenRouter pull-request review
Verdict: issues
Scope: full-pr (full-pr)
Mode: initial
Commit: ce1a88ba6f97234d0eb64cbbbe4a17ffcf08b94e
Judge: openai/gpt-5.6-luna
Cost: $0.2146 (lanes $0.2109 + judge $0.0036)
Lanes
openai/gpt-6.1-sol: ok (3 finding(s), 49.0s, 226552+2382 tokens (181456 cached), 6 tool round(s), via Azure, $0.17)z-ai/glm-5.3-flash: ok (4 finding(s), 340.1s, 626521+41080 tokens (555520 cached), 12 tool round(s), via InferenceNet, $0.0408)
Findings
🟠 Issue 1 — Uncorrected alternate publication entry point
scripts/release-package.mjs:58 · risk · identified by openai/gpt-6.1-sol
Calling pnpm run release:publish from a GitHub release job with a matching prepared artifact still drops RUNNER_ENVIRONMENT, allowing another publication with the same undefined builder identity this change is intended to prevent.
package.json still exposes this command through publishPrepared() in scripts/release-package.mjs:1001. Its runNpm() uses isolatedNpmEnvironment(), whose separate allowlist at lines 58–74 lacks RUNNER_ENVIRONMENT; there is also no hosted-runner admission check in publishPrepared(). Preserve the metadata there too and enforce admission specifically on publication, without preventing local packing, smoke, or registry checks.
The normal publish.yml job does not call this helper, so its corrected path is unaffected. I checked the helper's release-event, artifact, and version guards: those restrict invocation but do not prevent the metadata omission. test/release-package.test.ts tests this second environment constructor without a runner-metadata fixture.
🟠 Issue 2 — Missing regression coverage for the npm child environment
scripts/release-workflow-environment.test.mjs:11 · risk · identified by openai/gpt-6.1-sol
Removing env: npmEnvironment from the actual spawnSync() call, or replacing it with process.env, leaves all ten new regressions passing while npm loses configuration isolation and receives ambient credentials/configuration.
boundary() stops immediately before runNpm, and replay() returns the constructed object rather than observing the options passed to the command runner. This establishes construction and admission, but does not pin their connection to the final npm child—the boundary responsible for the published provenance.
The current workflow correctly passes env: npmEnvironment. I also checked test/release-package.test.ts and the sibling Node release tests; none asserts or replays that spawn-option binding. Extend the restricted replay with an inert command-runner stub, or otherwise assert the actual child-environment wiring and include a disconnecting mutation that fails.
🟠 Issue 3 — Undefined strict postflight procedure
docs/RELEASING.md:161 · risk · identified by openai/gpt-6.1-sol
A maintainer preparing 0.3.3 cannot reproduce the newly emphasized adoption gate from the release operations document: it requires strict postflight but supplies neither a command nor a linked procedure for authenticating and checking the provenance claims.
The documented release:registry:check only verifies local artifact metadata/digests and compares registry integrity. It does not perform npm signature/Sigstore verification or enforce the authenticated builder, repository, commit, tag, and invocation policy described in the new release record. This distinction is consequential because 0.3.2 already passed the byte checks while failing the required policy.
I checked all of docs/RELEASING.md, the release scripts, workflow jobs, and repository-wide searches for strict, postflight, and builder. An external postflight procedure may exist, but it is not linked or specified here. Document or link the reproducible authenticated verification procedure and its acceptance criteria before presenting it as the release/adoption gate.
🟠 Issue 4 — Twin npm-environment allowlist in release-package.mjs still drops RUNNER_ENVIRONMENT and has no github-hosted gate
scripts/release-package.mjs:61 · risk · identified by z-ai/glm-5.3-flash
The exact 0.3.2 failure mode this PR fixes is still reachable through the sibling publisher: pnpm run release:publish runs npm publish --provenance via runNpm, whose child environment comes from isolatedNpmEnvironment — and that copy of the allowlist still omits RUNNER_ENVIRONMENT and has no github-hosted refusal.
A maintainer who runs release:publish inside a release-workflow context (the path publishPrepared explicitly enables: it requires GITHUB_ACTIONS === "true" and GITHUB_EVENT_NAME === "release" and is exported and tested) would publish the 0.3.3 bytes with builder id https://github.com/actions/runner/undefined again — the very defect this PR exists to eliminate — with no gate to stop it, and would have to re-run the whole strict-postflight recovery a third time.
Evidence: scripts/release-package.mjs lines 60–79 (NPM_ENVIRONMENT_KEYS has RUNNER_TEMP but not RUNNER_ENVIRONMENT), line 125 (env: isolatedNpmEnvironment(...)), line 1036 ("--provenance"), package.json line 23 (release:publish script), and publishPrepared's release-event gating at lines ~1000–1006. The drift is now unpoliced from both sides: the new node:test suite pins the workflow's inline copy while the existing vitest suite (test/release-package.test.ts "constructs an allowlisted npm environment") pins the script copy without RUNNER_ENVIRONMENT, so nothing fails if the two copies diverge further or are later unified in either direction.
The workflow intentionally inlines its copy (the publish job must not execute repository code, per test/release-package.test.ts), so the fix cannot simply deduplicate — but the script-side allowlist and publishPrepared need the same RUNNER_ENVIRONMENT preservation and builder-policy refusal (or an explicit documented statement that release:publish is not a supported publication path), plus a cross-check asserting the two allowlists stay identical.
🔵 Issue 5 — New runner-refusal gate throws before the cleanup finally block, leaking the npm temp directories
.github/workflows/publish.yml:431 · nit · identified by z-ai/glm-5.3-flash
When the new gate refuses (e.g. a runner image or future GitHub change stops setting RUNNER_ENVIRONMENT, or a misconfigured self-hosted runner label sneaks in), the thrown fail(...) aborts the script before the try { ... } finally { rmSync(configDirectory ...); rmSync(publishDirectory ...) } block begins, so the freshly created rate-limit-npm-config-* and rate-limit-npm-cwd-* directories under RUNNER_TEMP are never removed.
Every other failure after the try starts cleans these up; this refusal path and the pre-existing npm-version gate (fail("npm 11.5.1 or newer is required for trusted publishing")) are the only post-mkdtempSync failures that leak. On ephemeral hosted runners the cost is nil, but on any future runner where RUNNER_TEMP persists the refusal leaves droppings behind, and the file's own cleanup contract is inconsistent.
Moving the gate above the mkdtempSync calls (it only reads process.env, which is available earlier) would make the refusal path cleanup-free. I checked the current file: the gate at ~line 431 sits after the config/publish directory creation at ~lines 385–398 and before the try at ~line 470.
🔵 Issue 6 — New poison fixture omits proxy/CA variables that the sibling environment contract pins as dropped
scripts/release-workflow-environment.test.mjs:131 · nit · identified by z-ai/glm-5.3-flash
The new workflow-boundary test's poison list (NPM_TOKEN, NODE_AUTH_TOKEN, NODE_OPTIONS, npm_config_registry, etc.) does not include HTTPS_PROXY, HTTP_PROXY, ALL_PROXY, NO_PROXY, or NODE_EXTRA_CA_CERTS, while the vitest contract for the twin implementation (test/release-package.test.ts, "constructs an allowlisted npm environment") explicitly pins HTTPS_PROXY and NODE_EXTRA_CA_CERTS as dropped.
Concrete regression that would now slip through: a future edit adding proxy variables to the workflow keep set (a plausible change for egress-configured or corporate runners, since npm cannot otherwise reach the registry through a proxy) would pass all ten new regressions while making npm route the OIDC-authenticated publish traffic through a runner-controlled proxy — the same ambient-environment poisoning class this test file exists to pin. The current keep set correctly drops them, so this is purely a missing regression guard, not a present bug.
I verified the current workflow keep set contains no proxy entries and that the vitest file pins HTTPS_PROXY/NODE_EXTRA_CA_CERTS as dropped for isolatedNpmEnvironment only.
🔵 Issue 7 — "Strict postflight" gates host adoption but is defined nowhere in the repository
docs/RELEASING.md:116 · nit · identified by z-ai/glm-5.3-flash
The new status narrative makes an undefined procedure the acceptance gate: README.md, docs/PROJECT_PLAN.md, and docs/RELEASING.md now say 0.3.2 is "not qualified" because "strict postflight failed", and that hosts must await 0.3.3 publication "and strict registry verification" — but no document, script, or workflow in the repository defines what "strict postflight" consists of, who runs it, or where its result is recorded. grep postflight matches only the four docs introduced/edited by this PR.
The docs even reference a component of it that has no home: "Checks downstream of that failure, including strict postflight's consumer execution, did not complete" (docs/RELEASING.md line 143) — the workflow's smoke job runs before publication, so this post-publication consumer execution is a separate, unspecified procedure. A maintainer executing the 0.3.3 release from these docs cannot determine which checks qualify the publication, which is the same class of process gap that produced the 0.3.0–0.3.2 failure chain this document exists to prevent.
Defining the postflight checklist in docs/RELEASING.md (or linking to wherever it lives) would close this; the surrounding record-keeping is otherwise accurate and internally consistent.
|
Commit b0f7ae6 fixes all current review items. The duplicate alternate-publisher findings r1-1/r1-4 are addressed by preserving canonical runner metadata and enforcing the actual filtered child environment in publication-only contexts, including the final provenance publish. Ordinary metadata queries keep their existing behavior. All 148 Vitest tests across four files and all 35 Node release regressions pass locally with zero skips. The actual workflow command binding now has inert-child regression coverage, including disconnecting mutations and proxy/CA poison. Cleanup covers runner/npm-version refusals. The public handbook provides reproducible cryptographic, authenticated-policy and public-consumer postflight instructions. Five applicable inline threads are fixed and resolved. Please review this current head and update the canonical ledger. |
|
@codex review |
|
@codex security review |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
There was a problem hiding this comment.
OpenRouter pull-request review
Verdict: issues
Scope: latest-commit (commit-range)
Mode: verify
Commit: b0f7ae605b5e5dd608196584c3d65c7f8955e007
Judge: openai/gpt-5.6-luna
Cost: $0.1702 (lanes $0.1696 + judge $0.0007)
Lanes
openai/gpt-6.1-sol: ok (0 finding(s), 23.9s, 112583+1244 tokens (82903 cached), 4 tool round(s), via Azure, $0.10)z-ai/glm-5.3-flash: ok (1 finding(s), 376.9s, 1045192+53974 tokens (968704 cached), 17 tool round(s), via Modal, $0.0652)
Round 2 resolution
- ✅
r1-1fixed correctly — Uncorrected alternate publication entry point:isolatedNpmEnvironment()now preserves canonicalRUNNER_ENVIRONMENT.publishPrepared()requires hosted-runner metadata through its version probe, andrunNpm()rechecks the filtered environment beforepublish --provenance. Tests cover invalid metadata, child-environment isolation, and a runner-value change between registry lookup and publication. - ✅
r1-2fixed correctly — Missing regression coverage for the npm child environment: The YAML replay now includes the actualrunNpm()definition and captures itsspawnSync()options. Assertions require the child to receive exactly the constructed filtered environment. Mutation regressions demonstrate failure when that binding is omitted or replaced withprocess.env; invalid runner cases also assert that no command reaches the stub. - ✅
r1-3fixed correctly — Undefined strict postflight procedure:docs/RELEASING.mdnow provides a linked public postflight procedure with byte comparisons, isolated installation, npm signature/Sigstore auditing, authenticated certificate and provenance-policy checks, consumer assertions, and retained PASS/FAIL evidence. It explicitly distinguishesrelease:registry:checkfrom cryptographic and policy verification and does not claim that the unpublished candi… - ✅
r1-4fixed correctly — Twin npm-environment allowlist in release-package.mjs still drops RUNNER_ENVIRONMENT and has no github-hosted gate: The sibling publisher's allowlist now retains canonicalRUNNER_ENVIRONMENT, and hosted-runner admission is enforced against the actual filtered npm environment both during publishing preflight and immediately before provenance publication. Ordinary local registry reads remain unrestricted. This fixes the same alternate-entry-point mechanism described inr1-1. - 3 nit finding(s) from earlier rounds retired (severity floor for follow-up rounds is
risk). - Open findings after this round: 1 (0 bug-severity).
Findings
🟠 Issue 1 — New vitest mock result helper may not typecheck under the CI type gate
test/release-package.test.ts:260 · risk · identified by z-ai/glm-5.3-flash
If tsc resolves ReturnType<typeof spawnSync> to Node's buffer-encoding overload, pnpm run check fails to compile the new test file, which fails this PR's own CI: .github/workflows/ci.yml runs pnpm run check, and tsconfig.test.json includes test/**/*.ts.
The helper added at lines 259-269 annotates its return as ReturnType<typeof spawnSync> and returns output: [null, stdout, stderr] with plain string stdout/stderr. In @types/node, spawnSync's last overload (the one with args) returns SpawnSyncReturns<Buffer>, and TypeScript resolves ReturnType of an overloaded function from the last overload, so string is not assignable to Buffer for stdout, stderr, or the output array; the vi.mocked(spawnSync).mockImplementation(...) callback return is checked against the same resolved type.
Proof gap: node_modules is absent from the inert checkout, so I could not read @types/node@26.1.1 to confirm the overload order for that exact version, and the PR body claims TypeScript validation passed locally — the two conflict, so re-running pnpm run check would settle it. If it does fail, the fix is small: construct the stub returns as the resolved (Buffer) variant or cast the literal through the resolved return type.
| stdout: string, | ||
| status = 0, | ||
| stderr = "", | ||
| ): ReturnType<typeof spawnSync> => ({ |
There was a problem hiding this comment.
🟠 New vitest mock result helper may not typecheck under the CI type gate (risk)
If tsc resolves ReturnType<typeof spawnSync> to Node's buffer-encoding overload, pnpm run check fails to compile the new test file, which fails this PR's own CI: .github/workflows/ci.yml runs pnpm run check, and tsconfig.test.json includes test/**/*.ts.
The helper added at lines 259-269 annotates its return as ReturnType<typeof spawnSync> and returns output: [null, stdout, stderr] with plain string stdout/stderr. In @types/node, spawnSync's last overload (the one with args) returns SpawnSyncReturns<Buffer>, and TypeScript resolves ReturnType of an overloaded function from the last overload, so string is not assignable to Buffer for stdout, stderr, or the output array; the vi.mocked(spawnSync).mockImplementation(...) callback return is checked against the same resolved type.
Proof gap: node_modules is absent from the inert checkout, so I could not read @types/node@26.1.1 to confirm the overload order for that exact version, and the PR body claims TypeScript validation passed locally — the two conflict, so re-running pnpm run check would settle it. If it does fail, the fix is small: construct the stub returns as the resolved (Buffer) variant or cast the literal through the resolved return type.
There was a problem hiding this comment.
The helper is correctly typed and is retained. The exact pinned @types/node@26.1.1 final spawnSync overload returns SpawnSyncReturns<string | NonSharedBuffer> at child_process.d.ts lines 1258–1262, so string stdout/stderr/output are permitted.
The official registry archive https://registry.npmjs.org/@types/node/-/node-26.1.1.tgz was independently downloaded and matched its registry SRI. Its declaration is byte-identical to the installed file, SHA256 177459cba484e2f1e08872a3d2fdbca3162d9d43ca5ec9dc0c946835b55f74be. This is exact-version evidence, rather than an assumption about another Node type release.
Actual current-head CI run 42520675781 passed Check types on Node 22.23.4 and 24.22.2 (jobs 128853252948 and 128853253209), and both executed all 148 Vitest and 35 Node regressions with zero skips. Local current-head checks also pass. Please re-evaluate r2-1 against those primary declarations and actual compile results. This incorrect thread remains visible for review.
There was a problem hiding this comment.
OpenRouter pull-request review
Verdict: clean
Scope: full-pr (full-pr)
Mode: verify
Commit: b0f7ae605b5e5dd608196584c3d65c7f8955e007
Judge: openai/gpt-5.6-luna
Cost: $0.3109 (lanes $0.3108 + judge $0.0001)
Lanes
openai/gpt-6.1-sol: ok (0 finding(s), 34.9s, 317319+1687 tokens (250661 cached), 6 tool round(s), via Azure, $0.23)z-ai/glm-5.3-flash: ok (0 finding(s), 266.5s, 1760137+36189 tokens (1672704 cached), 29 tool round(s), via Modal, $0.0814)
Round 3 resolution
- 🤝
r2-1disputed — New vitest mock result helper may not typecheck under the CI type gate: The helper remains unchanged, but the exact-version rebuttal invalidates the original overload assumption: the supplied declaration evidence identifies the final overload in@types/node@26.1.1as returningSpawnSyncReturns<string | NonSharedBuffer>, which permits the helper's string outputs. Bothpackage.jsonandpnpm-lock.yamlpin that version. The supplied current-head CI results also re… - Open findings after this round: 0 (0 bug-severity).
No structured findings from the successful lane(s).
|
Exact head b0f7ae6 has green current-head CI and clean completed reviews. Latest actual CI42521666304 ran148 Vitest cases across4files plus35 Node release regressions on each of Node22.23.4 and24.22.2, with zero skips. Codex code6726806966 and security6726818034 are clean for this head. Full-PR OpenRouter42521666195 reviewed all10paths/68,795bytes through both complete, unsalvaged, error-null and cost-complete lanes; canonical review5819610084 is clean with0OPEN. Five valid inline findings are fixed and resolved. The incorrect @types/node overload concern remains visibly disputed with exact registry bytes/declarations and passing type-check evidence (reply4507735818); this is not a claim that every thread is resolved. Raw provider finish reasons and tool transcripts are not retained by the pinned action and remain unverifiable. Copilot was requested successfully for this head at2026-11-08T20:36:38.7977619Z. After more than30minutes, the final all-page reviews, inline comments, issue comments and thread audit at21:10:17.0796474Z found no actual Copilot activity. Copilot has not passed; no quota or authorization cause is inferred. Per the documented bounded review wait, proceeding on the completed independent verification, bot reviews and green CI. Merging normally at this exact head. Version0.3.3 still requires a new protected signed tag, original artifact audit, normal publishing-environment approval, actual publication and complete registry cryptography/source-policy/consumer verification before any host adopts it. Existing0.3.0/0.3.1 failure identities and published-but-unqualified0.3.2 remain immutable. |
The isolated npm publisher dropped
RUNNER_ENVIRONMENT, so the signed provenance for 0.3.2 records the builder ashttps://github.com/actions/runner/undefined. Both publishing entry points now preserve the canonical metadata and refuse provenance publication unless the actual npm child environment identifies a GitHub-hosted runner. Ordinary registry queries retain their existing behavior. The limiter API is unchanged.Regressions execute the actual workflow environment construction and command binding with an inert child stub, including disconnecting mutations and proxy/configuration poison. Alternate-publisher cases exercise its real filtered environment and publication guard. Cleanup covers refusal paths, and the public handbook defines byte, cryptographic, authenticated provenance-policy and registry-consumer verification. The release history retains 0.3.2's qualification failure; 0.3.3 requires a fresh signed release and complete postflight.
Validation: formatting, TypeScript, release metadata, all 148 Vitest tests across four files, all 35 Node release regressions, and independent review passed locally with zero skips. Current-head Node 22/24 CI and bot reviews remain merge gates. Actual OIDC publication and authenticated provenance verification remain release gates.