Skip to content

fix(release): revalidate plugin recovery before npm token exchange - #191641

Merged
RomneyDa merged 5 commits into
mainfrom
fix/plugin-oidc-current-authority
Nov 3, 2026
Merged

RomneyDa merged 5 commits into
mainfrom
fix/plugin-oidc-current-authority

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Plugin trusted-publisher recovery could exchange package-scoped npm credentials after its source or protected tooling changed while the job waited or acquired a GitHub token.

Verified release plan production also rejected the current package contract because its retained tooling inventory omitted the newly imported recommended-prompts module.

Related: #190034

User Impact

Stale recovery attempts now stop before npm credential exchange. This changes no published package, release version, or approval scope.

Why This Change Was Made

The exchange reuses the preview's source-admission policy and the existing tooling-identity verifier after GitHub token acquisition, immediately before each npm exchange. Source and trusted tooling remain separate checkouts, with shared admission inputs. The extracted Python policy is byte-equivalent to its previous inline form; authority and prepared-worker inventories include its new path. Lifecycle fixtures stage that actual policy at the workflow checkout path. Both existing release-plan tooling inventories now retain the package contract's recommended-prompts dependency.

Evidence

  • Exchange, plugin workflow, and release-plan producer suites: 161/161 passed. The final test-only cleanup leaves production unchanged and reruns all 58 affected workflow cases.
  • Both new invalidation regressions fail with the original helper because npm exchange still occurs; the repaired helper rejects moved tooling and an advanced canonical source before the npm POST.
  • Fixtures use a real synthetic Git remote, fixed GitHub CLI responses, and synthetic token HTTP responses.
  • Tooling test typecheck, targeted lint, changed-file formatting, workflow validation, Python syntax/equivalent extraction, and git diff --check passed.
  • Lifecycle suite: 45/45 passed in 80s, including real supervised Git failure, cancellation, and descendant-cleanup boundaries. These process-lifecycle contracts require the production owner.
  • Workflow/policy suite: 58/58 passed in 16s after removing obsolete source-text assertions. Every executable case and the workflow-to-exchange-helper call check remains; exact test-line ratchet passes with net growth 0, without baseline or allocation changes.
  • Release-plan producer suite: 97/97 passed after adding the missing import to both retained tooling inventories; two real producer cases failed before that repair.
  • Independent Codex autoreviews of the exchange repair and inventory repair: scoped-clean through P2; no actionable findings. Maintainer inspection also accepted the seven-line fixture correction.
  • The corrected branch integrates main because its observed CI merge introduced the package-contract import; no stale CI result is claimed as proof for the corrected head.
  • No live GitHub approval, npm token exchange, or publication was performed. Hosted workflow execution remains CI evidence to collect.

@clawsweeper

clawsweeper Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@RomneyDa
RomneyDa marked this pull request as ready for review November 3, 2026 03:40
@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: L labels Nov 3, 2026
@RomneyDa
RomneyDa enabled auto-merge (squash) November 3, 2026 03:45
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 3, 2026
@clawsweeper

clawsweeper Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

What this changes

Rechecks source eligibility and protected tooling after GitHub token acquisition, before each npm credential exchange.

Example: The extended-stable/2026.8.33 branch advances while recovery acquires its GitHub OIDC token.

  • Before: The recovery attempt still requests package-scoped npm credentials for the previously admitted source.
  • After: The refreshed source check rejects the stale attempt before the npm POST.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) Useful, focused repair with a confirmed lifecycle-fixture regression and only mocked credential-exchange evidence.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A recovery attempt can request npm credentials after the source or protected tooling that authorized it becomes invalid.
Reason: The maintainer-authored direction restores the existing admission boundary at credential issuance without adding options or expanding publication scope.

Merge readiness

⛔ Blocked before merge - 2 items remain

Keep open: this maintainer-authored PR addresses a real credential-admission gap, but its policy extraction breaks existing lifecycle tests.

Priority: P2
Reviewed head: c720d8fe04f64bb75ba00aa8f9cb2f094cc19930

Before merge

  • Add real behavior proof - Authority-chain proof required: the supplied helper tests use real synthetic Git state but fixed GitHub CLI responses and mocked token HTTP responses; provide redacted production-path evidence that valid recovery reaches npm exchange and moved or revoked tooling and an advanced canonical source are rejected after token acquisition before the npm POST, without publishing packages. After adding proof, update the PR body, then request a new review with @clawsweeper re-review. The PR author or someone with repository write access can request it.
  • Migrate the Git lifecycle fixtures with the extracted policy (P2) - Adding WORKFLOW_REF_NAME to the admission environment makes every npm-trust lifecycle scenario fail in stepEnvironment because neither its defaults nor the scenario environment supplies that key. The exact-head CI job confirms this error: https://github.com/openclaw/openclaw/actions/runs/41573582894/job/125712402638. The same fixture also does not create .release-tooling/scripts/plugin-npm-release-admission.py, so supplying the variable alone leaves the extracted step unable to run. Update the existing lifecycle fixture to provide the environment and trusted policy file, preserving its ancestry, cancellation, and cleanup assertions.

Findings

  • [P2] Migrate the Git lifecycle fixtures with the extracted policy — .github/workflows/plugin-npm-release.yml:211

Tests

  • Low-value test test/scripts/plugin-npm-extended-stable-workflow.test.ts: Remove the adapted Python source-substring assertions at lines 823–852: executable admission cases already cover these rules, while the substrings pin implementation formatting.
  • Missing end-to-end proof: Supply production-path allowed and invalidated-authority traces through the exchange entry point; the reported red/green regressions currently use mocked token transport.
Agent review details

How this fits together

The plugin release workflow takes a pinned source, protected tooling identity, and selected package roster, then verifies npm authentication without publishing packages.

flowchart TD
 A[Recovery dispatch] --> B[Preview admission and selection]
 B --> C[Separate source and tooling checkouts]
 C --> D[GitHub OIDC token acquisition]
 D --> E[Refresh source and tooling authority]
 E --> F[npm package credential exchange]
 E --> G[Reject stale recovery]
Loading

Technical review

Best possible solution:

Retain one shared admission policy and the existing tooling verifier, complete the lifecycle-fixture cutover, and establish credential-boundary behavior.

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

Current-main source shows an awaited GitHub token request followed by npm exchange without refreshed admission; the PR supplies invalidation regressions, but this review ran no target code.

Is this the best way to solve the issue?

Reusing the existing admission policy and tooling verifier is the smallest coherent repair; the extraction must also migrate the existing lifecycle-test consumer.

Full review comments:

  • [P2] Migrate the Git lifecycle fixtures with the extracted policy — .github/workflows/plugin-npm-release.yml:211
    Adding WORKFLOW_REF_NAME to the admission environment makes every npm-trust lifecycle scenario fail in stepEnvironment because neither its defaults nor the scenario environment supplies that key. The exact-head CI job confirms this error: https://github.com/openclaw/openclaw/actions/runs/41573582894/job/125712402638. The same fixture also does not create .release-tooling/scripts/plugin-npm-release-admission.py, so supplying the variable alone leaves the extracted step unable to run. Update the existing lifecycle fixture to provide the environment and trusted policy file, preserving its ancestry, cancellation, and cleanup assertions.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.96

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 52dded4cb015.

Provenance checked

  • Package-specific trusted-publisher exchange keeps the original intent (2c0de87: Verify npm trusted-publisher authentication before publication while discarding the exchanged credential and avoiding registry publication.)
  • Source admission and Git lifecycle ownership keeps the original intent (50b675f: Keep trusted publication policy under the canonical Git lifecycle owner and make inspection or cleanup failures terminal.)
  • Regular and extended-stable recovery admission keeps the original intent (749df76: Require current-main tooling ancestry, explicit regular selection, and the exact canonical extended-stable source tip.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 2c0de87 adds scripts/npm-trusted-publisher-preflight.mjs:76 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 2c0de878c61f; files: scripts/npm-trusted-publisher-preflight.mjs)
  • Vincent Koc: Raw commit 1da7479 adds scripts/lib/plugin-publication-candidates.ts:21 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 1da74794b608; files: scripts/lib/plugin-publication-candidates.ts)

PR surface

Tests +126, Docs +5, Config -190, Other +230. Total +171 across 8 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 143 17 +126
Docs 1 5 0 +5
Config 1 21 211 -190
Generated 0 0 0 0
Other 4 230 0 +230
Total 8 399 228 +171

Labels

Label changes:

  • add P2: This is a focused release-operator credential-admission repair without evidence of a current end-user outage.
  • add merge-risk: 🚨 security-boundary: The patch changes admission immediately before package-scoped credential issuance, which requires final-effect authority evidence beyond ordinary green CI.
  • add merge-risk: 🚨 automation: The changed workflow environment and extracted policy break the existing Git lifecycle fixture suite on the reviewed head.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Label justifications:

  • P2: This is a focused release-operator credential-admission repair without evidence of a current end-user outage.
  • merge-risk: 🚨 automation: The changed workflow environment and extracted policy break the existing Git lifecycle fixture suite on the reviewed head.
  • merge-risk: 🚨 security-boundary: The patch changes admission immediately before package-scoped credential issuance, which requires final-effect authority evidence beyond ordinary green CI.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Rank-up moves

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

  • Add final-effect evidence for valid recovery and for tooling revocation or canonical-source reassignment after GitHub token acquisition; redact credentials and non-public endpoints.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 2, 2026, 10:57 PM ET / November 3, 2026, 03:57 UTC.

@RomneyDa
RomneyDa disabled auto-merge November 3, 2026 04:05
@RomneyDa
RomneyDa merged commit 5e6d9a2 into main Nov 3, 2026
127 checks passed
@RomneyDa
RomneyDa deleted the fix/plugin-oidc-current-authority branch November 3, 2026 04:36
@RomneyDa

RomneyDa commented Nov 3, 2026

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 4, 2026
…penclaw#191641)

* fix(release): revalidate plugin recovery before npm token exchange

* test(release): stage admission policy in Git lifecycle fixtures

* fix(release): retain recommended prompt import in tooling closure

* test(release): replace source scans with boundary proof
tideclaw-bot pushed a commit that referenced this pull request Nov 5, 2026
Adapt merged #191641 (5e6d9a2) to the release branch. Reuse the existing source admission policy and revalidate live tooling authority after OIDC acquisition, before each npm credential exchange. Exclude upstream-only recommended-prompts closure entries.

Focused boundary tests: 98 passing; scripts/tooling typechecks, targeted lint and formatting pass. Workflow lint runtime unavailable locally. Additional producer suite blocked by exhausted /tmp inodes; neither gap is claimed green.

Co-authored-by: RomneyDa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. scripts Repository scripts size: L status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant