Skip to content

Merge dev to main#1356

Merged
zbigniewsobiecki merged 2 commits into
mainfrom
dev
May 12, 2026
Merged

Merge dev to main#1356
zbigniewsobiecki merged 2 commits into
mainfrom
dev

Conversation

@zbigniewsobiecki
Copy link
Copy Markdown
Member

Routine dev → main promotion. Single feature PR:

Commits

  • fix(envFilter): plumb PM_WRITE + FRICTION sidecar env vars to subprocesses (MNG-741) #1355 — fix(envFilter): plumb PM_WRITE + FRICTION sidecar env vars to subprocesses (MNG-741)
    • Adds PM_WRITE_SIDECAR_ENV_VAR + FRICTION_SIDECAR_ENV_VAR to SHARED_ALLOWED_ENV_EXACT.
    • New regression-net test iterating all sidecar env-var constants from sessionState.ts.
    • Direct unblock for MNG-741 / MNG-736 / MNG-739 (every planning run was failing the requiresPMWrite gate).

🤖 Generated with Claude Code

zbigniewsobiecki and others added 2 commits May 12, 2026 10:54
…esses

Three consecutive planning runs on prod (2026-05-12) failed identically:

  MNG-741 (run 44c1bc3f)  11m  "Agent completed but no PM write recorded"
  MNG-736 (run 98ae7010)  13m  same
  MNG-739 (run 1534ab74)  16m  same

All planning/codex, all "Done." outputs. The agents finished their work
but the requiresPMWrite completion gate rejected them because the
sidecar evidence file was never written.

Root cause: `src/gadgets/sessionState.ts` defines five sidecar env-var
constants (PR / PUSHED_CHANGES / REVIEW / PM_WRITE / FRICTION). The
adapter creates a temp file path for each via sidecarManager and
injects it into projectSecrets. But `src/backends/shared/envFilter.ts`
SHARED_ALLOWED_ENV_EXACT — the bottleneck for what reaches the
subprocess engine — listed only the first three. PM_WRITE and
FRICTION were silently filtered out before reaching the agent's
`cascade-tools pm add-checklist` invocation, so writePMWriteSidecar
hit its `path === undefined` early-return and the gate always failed.

PM_WRITE fix is load-bearing (every planning run was broken).
FRICTION fix is defensive (the code path has fallbacks today via
getFrictionSidecarPath() and DEFAULT_FRICTION_SIDECAR_PATH, but the
design intent is to flow through the env var like the others).

Regression net: new "sidecar env-var allowlist invariant" describe
block iterates every sidecar constant defined in sessionState.ts and
asserts (a) presence in SHARED_ALLOWED_ENV_EXACT and (b) round-trip
survival through filterProcessEnv. A future maintainer adding a sixth
sidecar without registering it gets a precise CI failure.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ar-envvar-allowlist

fix(envFilter): plumb PM_WRITE + FRICTION sidecar env vars to subprocesses (MNG-741)
@zbigniewsobiecki zbigniewsobiecki merged commit 0a95096 into main May 12, 2026
13 checks passed
@codecov
Copy link
Copy Markdown

codecov Bot commented May 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant