#6728

feat(ci): require live dependency security evidence for releases

Opengensokyo-devwants to merge intofrom

Summary

Fixes #6708. Follow-up to #6480.

CI previously had no required live advisory/signature evidence, and release canaries discarded the actual consumer lock. Source locks do not pin npm consumers. This adds fresh checks to qualification and the exact consumer installations already exercised before/after publication.

Change and scope

  • Share the lock parser with license inventory generation; join npm-reported installed identities/relationships to the selected lock's declared origins and integrity. Retain raw evidence, optional omissions, unknowns, fingerprints and source-version/integrity differences. Unknown/malformed/unavailable evidence fails; verified-signature count stays unknown.
  • Require a read-only dependency-security lane on relevant changes and fresh scans even when provider qualification is reused. Check the current published consumer daily. Bound registry concurrency to 2, sequential commands, 1 GiB Node heap, 180-second command deadlines and 16 MiB output budgets. Archive passes are never substituted for live results.
  • Reuse one hook-disabled consumer install for security checks and CLI/MCP canaries, retaining its generated lock; require the checks in release and recovery workflows before executing REA. Preserve floating semver resolution and record drift. Bind recovery to its original release source directory and SHA, independently of controller source. Preserve failed-attempt evidence with attempt-specific artifact names. Keep all real-package schemas; the protocol replay fixture omits unused output schemas while retaining all tool/input contracts and the called tool's result contract.

Semantic owners: shared npm lock facts, npm's installed identities/edges, and the existing archive-integrity verifier. Public REA CLI/MCP/provider contracts are unchanged; no target capability or maintainer scope decision applies. No publishing permission, administrative setting or npm release is changed here.

Validation performed

  • Focused CI/release/process suite: 389 passed, 1 Windows-only skip across 8 files. Final security/workflow/no-dependency preflight/inventory follow-up: 26 passed (overlaps that suite). Negative cases include unavailable/malformed/oversized output, signature/advisory failures, changed integrity, registry coverage, unresolved/conflicting identities and modified archive bytes.
  • npm run check: all 6 tasks and architecture guards passed; npm run docs:check: passed, including 9 consistency cases. Shared inventory stays at 775 locked / 180 runtime records with the same runtime fingerprint.
  • Real npm rea-agents@6.7.0 fresh consumers: cold npm cache 108.799 s elapsed / 17.340 s CPU / 359.7 MiB sampled family RSS; warmed cache with a new project 97.378 s / 14.861 s / 384.8 MiB. Both passed live checks: 175 nodes, 242 edges, 8 optional omissions, 0 unknowns, 9 version drifts, 0 changed locked integrities; equal content fingerprints. Node 24.22.1, npm 11.16.0, one CPU, 1 GiB Node heap. OS caches were warm; no general speedup or token savings claimed. Token costs were not measured.
  • Committed-source live check passed: 557 nodes / 965 edges / 264 optional omissions / 0 unknowns / no version or integrity drift, fingerprint 8b7c726d…. Local npm 11.16.0: 112.292 s elapsed / 26.096 s CPU / 692.9 MiB sampled family RSS; the first CI merge also passed with bundled npm 11.19.1 and the same fingerprint (host/environment timings are not comparable).
  • Real archive from commit 48a1312: complete verify:package passed, 393.243 s / 305.841 s CPU / 1251.5 MiB; 220 tools, 6 prompts, update/setup/evidence/CLI and verified cleanup. Local synthetic manifest run 123, not a GitHub qualification or npm publication. Controller 473bcdd then checked the same archive with its original source SHA/lock: live security plus complete CLI/MCP canary passed, 114.447 s / 41.837 s CPU / 1065.9 MiB. Later main changes are covered by final-head CI, not claimed as part of this older archive.
  • Review fixes: raw lock URL validation precedes credential redaction; one shared consumer context binds recovery lock and SHA. Updated regression subset: 73 passed / 1 Windows-only skip; final workflow/inventory follow-up: 7 passed. Final pre-sync npm run check: all 6 tasks and architecture guards passed (33.274 s / 32.790 s CPU / 1712.0 MiB). Latest main was merged to include its independent fixture fixes; current-head CI and focused post-sync checks are running.
  • Earlier prototype failures are retained: npm omits integrity/origin metadata when its hidden cache is stale or a node is deduplicated; the exact-path lock join fixes that representation problem rather than treating absent fields as a clean result.

Compatibility and limits

Linux live evidence covers the selected lock and npm-supported installed registry packages; it does not verify all platform packages, rehash installed files, detect all malware, pin future semver resolutions or validate optional native secondary downloads. No real provider behavior or npm publication is claimed. RSS is a sampled sum of descendant RSS (shared pages may double-count; short-lived/reparented children may be missed), not a hard aggregate cap. Source changes require the normal release process.

Author readiness

Human owner: @gensokyo-dev

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Activity

25
chatgpt-codex-connector[bot]1mo ago

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

ReviewStatusCommitReview trigger
📝 Code Review✅ Completed 2026-10-23T14:01:49.481724Z8465514Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

chatgpt-codex-connector[bot]reviewed1mo ago
chatgpt-codex-connector[bot]1mo ago

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 48a1312237

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

gensokyo-devreviewed1mo ago
gensokyo-devreviewed1mo ago
gensokyo-dev1mo ago

@codex review

gensokyo-devreviewed1mo ago
gensokyo-dev1mo ago

@codex review

chatgpt-codex-connector[bot]reviewed1mo ago
chatgpt-codex-connector[bot]1mo ago

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1cd471487b

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

gensokyo-devreviewed1mo ago
gensokyo-dev1mo ago

@codex review

chatgpt-codex-connector[bot]reviewed1mo ago
chatgpt-codex-connector[bot]1mo ago

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 95eb175457

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

gensokyo-devreviewed1mo ago
gensokyo-dev1mo ago

@codex review

chatgpt-codex-connector[bot]reviewed1mo ago
chatgpt-codex-connector[bot]1mo ago

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 08e8501d7b

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

greptile-apps[bot]1mo ago

Confidence Score: 1/5

[Medium impact] The changes reach CI qualification and release verification for this project.

The PR should not merge while missing-baseline CI can skip dependency checks and the updater executes an unchecked installation.

Findings

  1.   Dependency checks get skipped ▶
  2.   Update dependencies escape checks ▶
  3.  Failed install evidence disappears ▶
  4.  Execution guard lacks coverage ▶
Fix with agent prompt
### Issue 1
scripts/ci/plan.mjs:207-210
If GitHub cannot return a trusted comparison commit for a main push, `baseline.mjs` returns an empty base. The fast fallback selects only `code` and `runtime`, and this loop never runs. Even dependency changes can then pass `CI required` without the new security checks. Select `dependency_security` in the missing-baseline fallback and add a regression case.

**How this was verified:** The empty-baseline path leaves `dependency_security` false, which skips the scan and is accepted by `required.mjs`.

### Issue 2
scripts/verify-published-package.mjs:52-57
The new check covers only `installation.directory`. Later, `verifyPublishedUpdate` installs and executes REA in a separate global prefix without checking that tree. For a prerelease, the updater even targets stable `latest`, not the version scanned here. Missing signatures or advisories in that installation cannot stop the new gate. Check the update installation before its CLI runs, without changing the public updater contract.

**How this was verified:** The scan receives the local consumer directory, while the update path installs into another prefix and directly executes its newly installed CLI.

### Issue 3
scripts/lib/release-package-install.mjs:18-30
If a consumer installation fails, `execNpm` throws before `checkDependencySecurity` creates its report directory. Both verifiers then delete the workspace, so the new upload step has no consumer report or partial lock to retain. This makes failed releases harder to debug. Start the evidence record before installation and save the error output and any available lock before cleanup.

### Issue 4
tests/boundary/filesystem/dependencySecurityWorkflow.test.ts:100-103
These assertions check that workflow text includes `--dependency-security`, but the process test invokes the verifier without that option. The scanner tests also replace npm with fabricated results. No regression test proves that a failed scan stops CLI/MCP execution through the security-enabled verifier, so moving or removing that guard could leave the suite passing. Extend the process fixture with the option, a controlled npm entry point, and a CLI marker. Assert that a failed audit saves its report without executing the fixture.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

The PR adds live dependency checks to CI and release consumers, shares lock parsing, and retains scan evidence.

Changes since the previous review:

  • Dependency scans show what npm actually installed.
  • CI requires fresh dependency checks for relevant changes.
  • Release canaries check the dependencies npm actually installs.

No new findings were identified. Whether another PR supersedes this one could not be checked because GitHub access was unavailable.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Install consumer with scripts disabled] --> B[Keep generated lock]
  B --> C[Check live advisories]
  C --> D[Check installed signatures]
  D --> E[Compare installed identities with locks]
  E --> F[Save redacted evidence]
  F --> G{All checks passed?}
  G -->|Yes| H[Run CLI and MCP canaries]
  G -->|No| I[Stop verification]

Reviews (2) · Last reviewed commit: "fix(ci): preserve incomplete dependency ..." · Reviewed by Greptile

greptile-apps[bot]reviewed1mo ago
gensokyo-devreviewed1mo ago
gensokyo-dev1mo ago

@codex review

chatgpt-codex-connector[bot]reviewed1mo ago
chatgpt-codex-connector[bot]1mo ago

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8465514782

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".