Skip to content

fix(repair): suppress target pnpmfile via npm_config env spelling - #1068

Merged
steipete merged 1 commit into
mainfrom
steipete/ecstatic-gates-6eb745
Aug 8, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/ecstatic-gates-6eb745

Conversation

@steipete

@steipete steipete commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Problem

test/repair/process-env.test.ts ("Codex subprocess prevents pnpm deploy from installing target Git hooks") fails reproducibly on current main: the pnpmfile leg of the containment test observes a target .pnpmfile.cjs executing and installing core.hooksPath despite codexSubprocessEnv() suppression.

This is not the @pnpm/exe mirror resolution issue — the fixture deploys a local workspace package with no registry access, and the deploy succeeds; the containment assertion afterwards is what fails.

Root cause

pnpm 11.10.0 (the pinned version) does not honor PNPM_CONFIG_* environment settings at all — verified empirically for both PNPM_CONFIG_IGNORE_PNPMFILE and PNPM_CONFIG_IGNORE_SCRIPTS against pnpm deploy. Only npm_config_* spellings (case-insensitive) and CLI flags work.

Lifecycle-script suppression silently survived via the redundant npm_config_ignore_scripts key; pnpmfile suppression had no working spelling, so a target repository's .pnpmfile.cjs could run arbitrary code during Codex-driven installs.

Fix

  • codexSubprocessEnv() now also sets npm_config_ignore_pnpmfile=true; the PNPM_CONFIG_* keys stay as belt-and-braces for pnpm versions in target repos that may read them.
  • The test asserts the new key survives an inherited false, and the unsafe-pnpmfile leg now disables the spelling pnpm actually reads.
  • Changelog entry under 0.3.1 Unreleased.

Proof

  • node --test test/repair/process-env.test.ts — 7/7 pass (previously failing).
  • Full repair suite: 1190 pass / 0 fail.
  • pnpm run check — exit 0.
  • Codex autoreview clean ("patch is correct (0.99)").

pnpm 11 only honors npm_config_* environment settings, so the
PNPM_CONFIG_IGNORE_PNPMFILE key in codexSubprocessEnv() was inert and a
target repository's .pnpmfile.cjs could execute arbitrary code during
repair installs (caught by the pnpm-deploy hook containment test).
Scripts suppression only survived through the redundant
npm_config_ignore_scripts key.

Add npm_config_ignore_pnpmfile alongside the retained PNPM_CONFIG_*
belt-and-braces keys, and make the test's unsafe-pnpmfile leg disable
the spelling pnpm actually reads.
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P1 Urgent regression or broken agent/channel workflow affecting real users now. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. labels Aug 8, 2026
@clawsweeper

clawsweeper Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 8, 2026, 2:17 AM ET / 06:17 UTC.

ClawSweeper review

What this changes

The PR sets npm_config_ignore_pnpmfile=true in the Codex subprocess environment and extends the pnpm deploy containment test to exercise that spelling.

Regression provenance

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

Merge readiness

⛔ Blocked until real behavior proof from a real setup is added - 5 items remain

Keep open. The small containment fix aligns Codex-launched pnpm deploys with the repair lane’s existing explicit --ignore-pnpmfile policy, but the PR needs current-head real-behavior proof and should not edit the release-owned changelog.

Priority: P1
Reviewed head: 547a281d3689c73cb6289e9bd793c3e4bb49d1ff

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The implementation is narrow and well-targeted, but reported test results alone do not satisfy the required real-behavior proof gate.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The PR body reports focused tests and checks, but it does not provide the required current-head Docker-backed Crabbox trace, artifact, provider, image, lease, and limits for the real pnpm deployment behavior. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🐚 platinum hermit (4/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The PR body reports focused tests and checks, but it does not provide the required current-head Docker-backed Crabbox trace, artifact, provider, image, lease, and limits for the real pnpm deployment behavior. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 5 items Containment setting: The branch adds the lowercase npm configuration spelling that pnpm 11 reads, while retaining the existing PNPM_CONFIG variables for compatibility.
Focused regression coverage: The fixture first demonstrates target pnpmfile execution when suppression is disabled, then asserts that the safe subprocess environment leaves Git hooks unchanged.
Existing repair policy: Target dependency setup already passes the explicit --ignore-pnpmfile flag, so suppressing target pnpmfiles is established repair-lane behavior rather than a new product direction.
Findings 1 actionable finding [P3] Remove the release-owned changelog entry
Security None None.

How this fits together

ClawSweeper’s repair lane gives Codex a restricted subprocess environment before it runs package-manager commands in a target checkout. That environment is intended to prevent target install hooks and pnpmfiles from executing code during repair work.

flowchart LR
  A[Repair job] --> B[Codex subprocess environment]
  B --> C[pnpm deploy in target checkout]
  C --> D[pnpmfile suppression]
  D --> E[Target hook execution]
  E --> F[Contained repair result]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR body reports focused tests and checks, but it does not provide the required current-head Docker-backed Crabbox trace, artifact, provider, image, lease, and limits for the real pnpm deployment behavior. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Remove the release-owned changelog entry (P3) - CHANGELOG.md is release-owned under the repository policy, while the PR body and commit already preserve the needed release context. Remove this normal-PR changelog edit.
  • Resolve merge risk (P1) - This intentionally makes Codex-driven pnpm deploys fail rather than run a target .pnpmfile.cjs; repair flows that implicitly relied on pnpmfile behavior will no longer receive it.
  • Resolve merge risk (P1) - The PR body reports test results but lacks the repository-required current-head Docker-backed Crabbox containment trace and artifact metadata.
  • Complete next step (P2) - The remaining release-note cleanup and real-behavior proof are PR-owner work, not a repair-lane handoff.

Findings

  • [P3] Remove the release-owned changelog entry — CHANGELOG.md:183
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Containment diff 2 production, 3 test, 1 changelog line The behavioral change is tightly scoped, with focused coverage for inherited and deploy-time configuration.

Merge-risk options

Maintainer options:

  1. Prove the intended fail-closed deploy behavior (recommended)
    Run the pnpm deploy containment scenario in Docker-backed Crabbox and record the current head, provider, image, lease, artifact, and limits before merge.

Technical review

Best possible solution:

Keep the environment-level fail-closed setting, remove the release-owned changelog edit, and attach a redacted current-head local-container trace proving that a target pnpmfile cannot alter Git configuration.

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

Yes, at source level: the focused fixture runs pnpm deploy against a target pnpmfile that changes Git configuration, but this read-only review did not independently execute it.

Is this the best way to solve the issue?

Yes. Environment-level suppression is the narrow maintainable boundary for arbitrary pnpm commands launched by Codex, and it matches the repair lane’s existing explicit pnpmfile suppression.

Full review comments:

  • [P3] Remove the release-owned changelog entry — CHANGELOG.md:183
    CHANGELOG.md is release-owned under the repository policy, while the PR body and commit already preserve the needed release context. Remove this normal-PR changelog edit.
    Confidence: 0.98

Overall correctness: patch is correct
Overall confidence: 0.94

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 62acb03356bb.

Labels

Label changes:

  • add P1: Without this correction, a target repository’s pnpmfile can execute code during a Codex-driven repair install.
  • add merge-risk: 🚨 compatibility: The correction deliberately stops target pnpmfile behavior during deploys, which can change repair outcomes for targets that depended on it.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body reports focused tests and checks, but it does not provide the required current-head Docker-backed Crabbox trace, artifact, provider, image, lease, and limits for the real pnpm deployment behavior. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Label justifications:

  • P1: Without this correction, a target repository’s pnpmfile can execute code during a Codex-driven repair install.
  • merge-risk: 🚨 compatibility: The correction deliberately stops target pnpmfile behavior during deploys, which can change repair outcomes for targets that depended on it.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body reports focused tests and checks, but it does not provide the required current-head Docker-backed Crabbox trace, artifact, provider, image, lease, and limits for the real pnpm deployment behavior. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

Likely related people:

  • steipete: Recent history on the subprocess environment builder is authored by Peter Steinberger, and the proposed patch is narrowly in that same containment path. (role: recent repair-environment contributor; confidence: high; commits: 2c3ad8f46c9a, 66ee8bbffaed; files: src/repair/process-env.ts, test/repair/process-env.test.ts)

Rank-up moves

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

  • Remove the release-owned CHANGELOG.md entry.
  • Add redacted current-head Docker-backed Crabbox evidence showing the pnpmfile cannot change target Git configuration.

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.

@steipete
steipete merged commit 36179dc into main Aug 8, 2026
18 checks passed
@steipete
steipete deleted the steipete/ecstatic-gates-6eb745 branch August 8, 2026 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. P1 Urgent regression or broken agent/channel workflow affecting real users now. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. 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