Skip to content

fix(ci): submit npm audit graphs in one request - #137865

Closed
vincentkoc wants to merge 1 commit into
mainfrom
fix/npm-audit-single-bulk-request
Closed

vincentkoc wants to merge 1 commit into
mainfrom
fix/npm-audit-single-bulk-request

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

Related: #137059

What Problem This Solves

Fixes an issue where npm bulk-advisory outages were amplified by splitting each dependency graph into arbitrary 400-package batches. During https://github.com/openclaw/openclaw/actions/runs/33829936761, both attempt 1 and attempt 2 failed in security-fast while the npm bulk endpoint did not return a response.

Why This Change Was Made

Each non-empty dependency graph is now submitted as one complete npm bulk payload. npm Arborist and pnpm both use one request per graph; OpenClaw's 400-package limit had no upstream contract:

The change preserves the exact three-attempt timeout, network-error, and HTTP 5xx retry behavior landed in #137825. Response caps, timeout aborts, HTTP client-error handling, fail-closed results, and empty release production-graph skipping are unchanged.

Request exposure drops:

  • security-fast: 3 requests / 9 maximum attempts to 1 request / 3 maximum attempts.
  • Full release gate: 11 requests / 33 maximum attempts to 6 requests / 18 maximum attempts.

This does not weaken the vulnerability policy, change the advisory authority, or fail open during registry outages.

User Impact

Maintainers get fewer sequential npm advisory requests and materially less outage amplification during pre-commit and full release validation. A genuine npm outage still blocks the security gate with the existing actionable failure.

Evidence

No live npm endpoint rerun was performed because the observed endpoint outage had not produced new recovery evidence.

Release State

Draft only. Do not merge while release hold frv-reliability-repairs-2026-09-03 is active.

@clawsweeper

clawsweeper Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@vincentkoc vincentkoc added scripts Repository scripts maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. release-validation-finding Bug found during release validation merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. labels Sep 4, 2026
@vincentkoc vincentkoc self-assigned this Sep 4, 2026
@clawsweeper

clawsweeper Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 4, 2026, 12:19 AM ET / 04:19 UTC.

ClawSweeper review

What this changes

The PR removes caller-side 400-package batching so each non-empty npm audit dependency graph is sent in one bulk-advisory request, with 401-package coverage for both audit callers.

Regression provenance

Possible regression — probable (reviewed change; failure trace). No predecessor PR is attributed.

Merge readiness

⛔ Blocked before merge - 4 items remain

Keep open: the focused simplification is source-correct and covered at 401 packages, but it changes the external npm request-size boundary without a successful real result for the much larger current graph; the draft also states an active release hold.

Priority: P2
Reviewed head: 2590ffd8b86edd712c4b841b720755cd368f4e02
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) PR readiness rating was derived from proof quality, review findings, security review, and reviewer confidence.
Proof confidence 🌊 off-meta tidepool Not applicable: Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Real behavior proof is not required for maintainer- or bot-authored pull requests.
Evidence reviewed 7 items Introduced request-boundary change: Both callers now pass each complete non-empty payload to the shared bulk-request owner; the release gate still keeps all and production graphs distinct.
Shared request owner and CI entry point: The shared owner serializes the entire payload as the npm bulk request, and the security-fast workflow invokes the production audit with a 20-minute job budget.
Regression coverage: The changed tests assert that each caller submits one complete 401-package payload, including the blocking and non-blocking audit outcomes.
Findings None None.
Security None None.

How this fits together

OpenClaw’s pre-commit and release security scripts turn lockfile dependency graphs into npm bulk-advisory requests, then use returned advisories to block unsafe commits or releases. This change alters request aggregation while retaining the shared retry and fail-closed request owner.

flowchart LR
  A[Lockfiles] --> B[Dependency graph builder]
  B --> C[Bulk advisory request]
  C --> D[npm advisory service]
  D --> E[Advisory results]
  E --> F[Security gate result]
Loading

Decision needed

Question Recommendation
Should this draft land without independent evidence that npm accepts the largest current release graph as one bulk-advisory payload? Verify the full payload first: Attach a redacted successful npm bulk-advisory result for the largest release graph, then reassess the release hold.

Why: The branch deliberately changes an external security-gate request boundary; source and mock tests prove the call count but not acceptance by the authoritative registry at the production graph size.

Before merge

  • Resolve merge risk (P1) - The removed 400-package limit makes the security gate depend on npm accepting the full current graph in one request; the supplied mock tests cover 401 packages, while static lockfile inspection finds a much larger pnpm graph and no successful real maximum-payload result is available.
  • Complete next step (P2) - Attach a redacted successful npm bulk-advisory result for the largest release graph and resolve the active release hold before merge.
  • Resolve review confidence - ClawSweeper must reach high confidence before merge readiness is known.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.
Agent review details

Security

None.

PR surface

Tests +20, Other -19. Total +1 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 30 10 +20
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 11 30 -19
Total 4 41 40 +1

Review metrics

Metric Value Why it matters
Production versus test delta production -19; tests +20 The patch deletes duplicated batching from both callers and adds focused 401-package regression cases.

Merge-risk options

Maintainer options:

  1. Prove the largest real request (recommended)
    Before merging, obtain a redacted successful bulk-advisory response for the largest release graph so the changed external request shape is verified.
  2. Accept the changed failure mode
    A maintainer may accept unbounded graph submission based on cited upstream implementations despite unavailable live confirmation.
  3. Hold this refactor
    Leave the draft paused until npm acceptance or a documented maximum request size is verified.

Technical review

Best possible solution:

Keep the one-request-per-graph design only after attaching a redacted successful npm bulk-advisory result for the largest current release graph, or retain a validated request-size bound if npm rejects it.

Do we have a high-confidence way to reproduce the issue?

Yes for the source-level behavior: both callers previously split a 401-package graph at 400, and the changed tests assert one request after the fix. Real npm acceptance at the largest graph remains unproven.

Is this the best way to solve the issue?

Unclear: deleting duplicated caller-side batching is the clean owner-boundary shape, but the npm payload limit and successful production-size behavior could not be independently verified.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 72930f7c8758.

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.

Label justifications:

  • P2: This is a bounded reliability change to CI and release vulnerability checks.
  • merge-risk: 🚨 automation: A changed npm request shape could cause the automated security gate to fail or time out on existing release graphs.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Tighten the PR description with what changed, how it was validated, and any remaining risk.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-04T03:47:19.305Z sha 2590ffd :: blocked before merge. :: none

steipete added a commit that referenced this pull request Sep 4, 2026
Reject malformed npm advisory responses before filtering. Submit each dependency graph once, cap ordinary CI requests at 30 seconds, and publish audit summaries. Add a daily strict production audit with documented ownership and recovery.

Builds on the single-request simplification in #137865 and the incomplete-coverage policy in #137881.

Co-authored-by: Vincent Koc <[email protected]>
@steipete

steipete commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

The single-complete-graph change is now on main through #137960, commit ec87f91.

Both the production audit and release gate now send one request per non-empty graph. The replacement includes the 401-package request coverage, shared malformed-response validation, a total ordinary-CI deadline, audit summaries, and the separate strict scheduled audit. All 186 focused tests passed, and the replacement's exact-head CI run completed successfully. The hosted audit also verified the live npm outage: a 30.09-second timeout produced an explicit incomplete-coverage warning while ordinary CI continued.

Vincent Koc is credited as co-author in the landed commit. Closing this proposal as superseded by the verified implementation; its original branch remains untouched. Successful full-size npm-response proof remains explicitly unclaimed while the service is unavailable.

@steipete steipete closed this Sep 4, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 5, 2026
…#137960)

Reject malformed npm advisory responses before filtering. Submit each dependency graph once, cap ordinary CI requests at 30 seconds, and publish audit summaries. Add a daily strict production audit with documented ownership and recovery.

Builds on the single-request simplification in openclaw#137865 and the incomplete-coverage policy in openclaw#137881.

Co-authored-by: Vincent Koc <[email protected]>
@RomneyDa
RomneyDa deleted the fix/npm-audit-single-bulk-request branch October 22, 2026 00:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P2 Normal backlog priority with limited blast radius. release-validation-finding Bug found during release validation scripts Repository scripts size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants