Repository navigation
Fix nightly macOS realpath + Windows .cmd EINVAL and dedup extension-policy override builder - #73
Conversation
…ide builder Two real nightly failures from run 26439727168 (2026-05-26) plus an in-place cleanup of the extension-policy override-normalization duplicate identified under the pm-3cbk maintainability decision. Nightly fixes: - tests/integration/cli.integration.spec.ts: add shell:true to execFileSync(npm.cmd) on win32. After CVE-2024-27980 Node hardening, spawnSync of a .cmd file requires shell mode or it fails with EINVAL. The previous PR #68 switched the binary to npm.cmd on Windows but did not enable shell mode, regressing Windows Node 20. - tests/unit/extension-command.spec.ts: realpath the mkdtemp temp root before comparing against resolveInstallSource output. macOS resolves /var/folders to /private/var/folders via fs.realpath, and the production code path canonicalizes, while the test was holding the raw os.tmpdir-prefixed path. pm-3cbk dedup: - Extract buildExtensionPolicyOverride + collectExtensionPolicyOverrides helpers inside src/core/extensions/extension-policy.ts to remove the 25-line duplicate between normalizeExtensionPolicy and hydrateExtensionPolicy override loops. Single-file extraction keeps the existing uncovered allowlist clean. Tracker hygiene: - Backfill resolution/expected_result/actual_result on three closed items (pm-ch59, pm-8nyc, pm-70mi) from PR #72 that pre-dated the --expected-result/--actual-result close flow. pm validate --check-resolution now warning-free. - Close pm-gf6f with full metadata; pnpm changelog:pm regenerated CHANGELOG.md to include the new Fixed entry. Verification: - Targeted tests pass (extension-command + cli.integration matchers). - extension-loader/settings-store/settings-validator/contracts-command: 90 tests pass. - Full release gate ok: build, typecheck, docs, static-quality, coverage (100%/100%/100%/100%), version-policy, secret-scan, npx-smoke, package-first-dogfood, npm-pack, compat, sentry-telemetry. Sentry critical=0 high=5 within threshold; telemetry finish_error_rate_pct=1.95, missing-error-code rows=0. - Manual temp-dir dogfood (init/create/list/search/context/health/ validate) happy path verified. - pm health ok; pm validate --check-resolution --check-history-drift ok; pnpm changelog:pm:check unchanged. Refs pm-7rlp, pm-3cbk, pm-gf6f. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
📝 WalkthroughSummary by CodeRabbit
WalkthroughThis PR consolidates cross-platform test reliability fixes for Windows and macOS nightly test failures, introduces shared helper functions to eliminate extension-policy override normalization duplication, and documents the changes through project-management metadata and changelog entries. ChangesNightly reliability and extension-policy maintenance
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@codex review /gemini review @gemini-code-assist please review cc @coderabbitai full review |
There was a problem hiding this comment.
Code Review
This pull request improves nightly cross-platform test reliability and refactors extension policy handling to eliminate duplicate code. Specifically, it resolves a Windows Node 20 spawn issue by enabling shell: true when invoking npm.cmd (addressing Node CVE-2024-27980 hardening), and fixes a macOS realpath mismatch in extension-command.spec.ts by canonicalizing the temporary directory path. Additionally, it extracts duplicate override-normalization logic in extension-policy.ts into the shared helpers buildExtensionPolicyOverride and collectExtensionPolicyOverrides. I have no feedback to provide as there are no review comments to address.
|
Codex Review: Didn't find any major issues. Chef's kiss. ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
There was a problem hiding this comment.
Code Review
This pull request improves nightly cross-platform test reliability and refactors extension policy handling to eliminate code duplication. Specifically, it resolves a Windows Node 20 spawnSync issue by enabling shell: true when invoking npm.cmd (addressing Node CVE-2024-27980 hardening), and fixes a macOS path mismatch in the extension-command test by resolving the temporary directory path using fs.realpath. Additionally, it extracts the shared helpers buildExtensionPolicyOverride and collectExtensionPolicyOverrides within extension-policy.ts to remove a 25-line duplicate block between normalizeExtensionPolicy and hydrateExtensionPolicy. I have no feedback to provide as the changes are correct and all tests pass.
There was a problem hiding this comment.
Actionable comments posted: 10
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.agents/pm/chores/pm-7rlp.toon:
- Line 9: This change directly edits a system-of-record file
(.agents/pm/chores/pm-7rlp.toon) by altering the updated_at field; revert the
direct mutation in this PR, remove any modifications to files under .agents/pm
(including the updated_at change and any other edits noted at lines 14 and
50-51), and instead regenerate or record the update through the PM workflow/tool
that owns these records so the system-of-record is updated correctly rather than
committing manual edits.
In @.agents/pm/chores/pm-ch59.toon:
- Line 9: Remove the direct edit to the PM tracker (the change to the updated_at
field on tracker pm-ch59) from this commit and re-apply the change using the PM
system workflow instead; revert the mutation to the tracker record (the
updated_at entry) so the commit contains no direct modifications to pm-managed
tracker files and submit the intended update through the PM tool/process.
In @.agents/pm/chores/pm-gf6f.toon:
- Around line 1-16: This PR adds a PM tracker file directly (id: pm-gf6f, title:
"Fix nightly cross-platform reliability...") which must not be committed
directly; revert or remove the added .agents/pm file from the branch, then
create the PM record through the official PM system-of-record flow (UI/CLI)
using the same metadata, and update the PR description or link to the created PM
ticket instead of including the file; ensure no other .agents/pm files are
present in the commit history before merging.
In @.agents/pm/decisions/pm-3cbk.toon:
- Line 9: The .agents/pm decision file was edited directly (see updated_at in
.agents/pm/decisions/pm-3cbk.toon and the other edits referenced at lines 12-12
and 16-17); revert these direct edits and instead apply the change through the
PM tooling/process so the repository has no manual mutations under .agents/pm,
ensure the reverted commit removes the manual updated_at change and any other
direct modifications, and then perform the intended update by invoking the PM
system-of-record tools to generate a proper commit.
In @.agents/pm/extensions/.managed-extensions.json:
- Line 3: You directly edited the managed extensions state by changing the
"updated_at" value in .managed-extensions.json (the "updated_at" field), which
must be produced by the PM system; revert this manual change (reset the file to
the version from main/remote or remove the timestamp edit) and remove the file
from this PR, and if you need the system state changed, invoke the PM system/API
or open a request for it rather than committing .agents/pm/** files—also add a
brief PR note to explain you reverted the manual mutation.
In @.agents/pm/history/pm-3cbk.jsonl:
- Around line 5-6: Remove the direct edits to the PM history file
(.agents/pm/history/pm-3cbk.jsonl) from this PR: revert/remove the added
metadata/comments entries (the two JSONL add/replace patches that appended
comments[3] and comments[4] and updated metadata/updated_at) and restore the
file to its prior state, then record these notes via the PM system-of-record
workflow instead of committing them; update your branch with that revert and
re-run tests/linting so no .agents/pm changes remain in the patch.
In @.agents/pm/history/pm-70mi.jsonl:
- Line 30: The commit directly mutates pm history metadata (fields
metadata/updated_at, metadata/resolution, metadata/expected_result,
metadata/actual_result in the pm-70mi.jsonl record) which violates the
`.agents/pm` edit policy; revert these manual changes in this PR and instead
create the appropriate PM-tooling change request or run the PM backfill workflow
that writes the metadata through the system of record (include the original
commit message "Backfill resolution metadata" in the tooling request so the
automated update targets the same record).
In @.agents/pm/history/pm-7rlp.jsonl:
- Around line 85-86: Revert the manual additions to the JSON history object
(remove the added metadata.comments entries keyed "35" and "36" and restore
metadata.updated_at to the prior value) so the .agents/pm record is not directly
edited; then re-run or request the authoritative PM system-of-record process to
apply these history comments instead of committing them manually and ensure
future changes to pm-7rlp.jsonl come only from that PM workflow.
In @.agents/pm/history/pm-8nyc.jsonl:
- Line 12: The change directly mutates the PM system-of-record JSON by editing
metadata keys (e.g., metadata/updated_at, metadata/resolution,
metadata/expected_result, metadata/actual_result) under the .agents/pm/** path;
revert this manual edit and reapply the update through the official PM
workflow/tooling that owns this file (use the PM tool or API that emits history
entries) so the metadata is recorded correctly and auditably rather than
hand-editing the JSON.
In `@CHANGELOG.md`:
- Line 18: The changelog entry in CHANGELOG.md references
`.agents/pm/chores/pm-gf6f.toon` which is inconsistent with the PR artifact
`pm-gf6f` added under `.agents/pm/history/pm-gf6f.jsonl`; update the link target
in the line containing `.agents/pm/chores/pm-gf6f.toon` to point to the correct
artifact path `.agents/pm/history/pm-gf6f.jsonl` (or add the missing
`.agents/pm/chores/pm-gf6f.toon` file if that was intended) so the changelog
link resolves at release time and does not become broken.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: 1c6bca3e-1c0f-46b3-a429-f5677e6af8e2
📒 Files selected for processing (17)
.agents/pm/chores/pm-7rlp.toon.agents/pm/chores/pm-ch59.toon.agents/pm/chores/pm-gf6f.toon.agents/pm/decisions/pm-3cbk.toon.agents/pm/extensions/.managed-extensions.json.agents/pm/history/pm-3cbk.jsonl.agents/pm/history/pm-70mi.jsonl.agents/pm/history/pm-7rlp.jsonl.agents/pm/history/pm-8nyc.jsonl.agents/pm/history/pm-ch59.jsonl.agents/pm/history/pm-gf6f.jsonl.agents/pm/issues/pm-8nyc.toon.agents/pm/plans/pm-70mi.toonCHANGELOG.mdsrc/core/extensions/extension-policy.tstests/integration/cli.integration.spec.tstests/unit/extension-command.spec.ts
| tags[3]: ci,performance,tests | ||
| created_at: "2026-05-21T21:57:10.762Z" | ||
| updated_at: "2026-05-25T20:37:01.129Z" | ||
| updated_at: "2026-05-26T15:53:37.302Z" |
There was a problem hiding this comment.
Do not commit direct edits under .agents/pm
This file is under the PM system-of-record path and should not be modified directly in PR content. Please regenerate/record these updates through the PM workflow and exclude direct file mutations from this diff.
As per coding guidelines, .agents/pm/**: pm is the system of record. Do not edit .agents/pm files directly.
Also applies to: 14-14, 50-51
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.agents/pm/chores/pm-7rlp.toon at line 9, This change directly edits a
system-of-record file (.agents/pm/chores/pm-7rlp.toon) by altering the
updated_at field; revert the direct mutation in this PR, remove any
modifications to files under .agents/pm (including the updated_at change and any
other edits noted at lines 14 and 50-51), and instead regenerate or record the
update through the PM workflow/tool that owns these records so the
system-of-record is updated correctly rather than committing manual edits.
| tags[3]: agent-ux,dogfood,dx | ||
| created_at: "2026-05-25T18:30:34.477Z" | ||
| updated_at: "2026-05-25T23:47:52.695Z" | ||
| updated_at: "2026-05-26T15:55:59.843Z" |
There was a problem hiding this comment.
Tracker file should not be directly edited in this PR
Please remove direct .agents/pm mutations from the commit and apply them via the PM system workflow instead.
As per coding guidelines, .agents/pm/**: pm is the system of record. Do not edit .agents/pm files directly.
Also applies to: 12-14
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.agents/pm/chores/pm-ch59.toon at line 9, Remove the direct edit to the PM
tracker (the change to the updated_at field on tracker pm-ch59) from this commit
and re-apply the change using the PM system workflow instead; revert the
mutation to the tracker record (the updated_at entry) so the commit contains no
direct modifications to pm-managed tracker files and submit the intended update
through the PM tool/process.
| id: pm-gf6f | ||
| title: "Fix nightly cross-platform reliability: macOS realpath in extension-command test and Windows .cmd spawn EINVAL" | ||
| description: "Two real nightly failures in run 26439727168 (2026-05-26): (a) macOS Node 20 tests/unit/extension-command.spec.ts:756 -- '/private/var/folders/...' != '/var/folders/...' because resolveInstallSource canonicalizes via fs.realpath while the test compared against the raw mkdtemp path. Fixed by realpathing the temp root after mkdtemp. (b) Windows Node 20 tests/integration/cli.integration.spec.ts:234 -- spawnSync('npm.cmd', ...) EINVAL after Node CVE-2024-27980 hardening required shell:true for .cmd dispatch. Fixed by adding shell:isWindows to the execFileSync options. Also extracts buildExtensionPolicyOverride + collectExtensionPolicyOverrides helpers in src/core/extensions/extension-policy.ts to remove the 25-line override-normalization duplicate between normalizeExtensionPolicy and hydrateExtensionPolicy (jscpd hand-maintained cluster identified in pm-3cbk)." | ||
| type: Chore | ||
| status: closed | ||
| priority: 1 | ||
| tags[4]: bug,ci,nightly,tests | ||
| created_at: "2026-05-26T15:54:20.097Z" | ||
| updated_at: "2026-05-26T15:55:03.548Z" | ||
| author: claude-code-agent | ||
| parent: pm-rnpb | ||
| resolution: "Fixed Windows execFileSync(npm.cmd) EINVAL with shell:true on win32; fixed macOS realpath mismatch by canonicalizing mkdtemp output; extracted shared extension-policy override builder. All gates green." | ||
| expected_result: Nightly macOS Node 20 and Windows Node 20 cross-platform jobs pass; extension-policy override normalization de-duplicated via shared helper; coverage + static-quality + release gate remain green. | ||
| actual_result: "Targeted tests pass locally (extension-command + cli.integration matchers); extension-loader/settings-store/settings-validator/contracts-command (90 tests) pass; full release gate ok across build/typecheck/docs/static/coverage/version/secrets/npx-smoke/dogfood/npm-pack/compat/sentry-telemetry; coverage 100%; Sentry critical=0 high=5 within threshold; telemetry finish_error_rate_pct=1.95, missing-error-code rows=0; manual temp-dir dogfood happy path verified." | ||
| close_reason: completed | ||
| body: "" |
There was a problem hiding this comment.
New .agents/pm record should not be added via direct file edit
This PM record creation must come through the PM system-of-record flow, not by directly adding tracker files in the PR.
As per coding guidelines, .agents/pm/**: pm is the system of record. Do not edit .agents/pm files directly.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.agents/pm/chores/pm-gf6f.toon around lines 1 - 16, This PR adds a PM
tracker file directly (id: pm-gf6f, title: "Fix nightly cross-platform
reliability...") which must not be committed directly; revert or remove the
added .agents/pm file from the branch, then create the PM record through the
official PM system-of-record flow (UI/CLI) using the same metadata, and update
the PR description or link to the created PM ticket instead of including the
file; ensure no other .agents/pm files are present in the commit history before
merging.
| tags[1]: agent-ux | ||
| created_at: "2026-05-25T13:55:37.918Z" | ||
| updated_at: "2026-05-25T20:23:56.238Z" | ||
| updated_at: "2026-05-26T15:53:41.314Z" |
There was a problem hiding this comment.
Direct decision-record edits under .agents/pm are out of policy
Please route these updates through PM tooling and keep the repository diff free of direct .agents/pm file mutations.
As per coding guidelines, .agents/pm/**: pm is the system of record. Do not edit .agents/pm files directly.
Also applies to: 12-12, 16-17
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.agents/pm/decisions/pm-3cbk.toon at line 9, The .agents/pm decision file
was edited directly (see updated_at in .agents/pm/decisions/pm-3cbk.toon and the
other edits referenced at lines 12-12 and 16-17); revert these direct edits and
instead apply the change through the PM tooling/process so the repository has no
manual mutations under .agents/pm, ensure the reverted commit removes the manual
updated_at change and any other direct modifications, and then perform the
intended update by invoking the PM system-of-record tools to generate a proper
commit.
| { | ||
| "version": 1, | ||
| "updated_at": "2026-05-26T15:22:54.248Z", | ||
| "updated_at": "2026-05-26T15:56:31.138Z", |
There was a problem hiding this comment.
Managed extensions state must not be directly edited
This timestamp/state update is a direct .agents/pm mutation and should be produced by PM system operations, not committed manually.
As per coding guidelines, .agents/pm/**: pm is the system of record. Do not edit .agents/pm files directly.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.agents/pm/extensions/.managed-extensions.json at line 3, You directly
edited the managed extensions state by changing the "updated_at" value in
.managed-extensions.json (the "updated_at" field), which must be produced by the
PM system; revert this manual change (reset the file to the version from
main/remote or remove the timestamp edit) and remove the file from this PR, and
if you need the system state changed, invoke the PM system/API or open a request
for it rather than committing .agents/pm/** files—also add a brief PR note to
explain you reverted the manual mutation.
| {"ts":"2026-05-26T15:43:50.571Z","author":"claude-code-agent","op":"update","patch":[{"op":"add","path":"/metadata/comments/3","value":{"created_at":"2026-05-26T15:43:50.566Z","author":"claude-code-agent","text":"Linking dedup extraction follow-up to branch fix/nightly-cross-platform-stability-and-extension-policy-dedup: extracting buildExtensionPolicyOverride helper within extension-policy.ts (single-file extraction, no coverage gate change because the file is already in the uncovered allowlist). Removes 25-line duplicate between normalizeExtensionPolicy/hydrateExtensionPolicy override loops."}},{"op":"replace","path":"/metadata/updated_at","value":"2026-05-26T15:43:50.571Z"}],"before_hash":"68610e252777a9d13bbcbb7607876d2a628446fdcbb0c14e7bb45a7802de4daf","after_hash":"ba3c289c6c40b634963d5e19f38f8acac2fb2678e86e074583050500862c3fe3"} | ||
| {"ts":"2026-05-26T15:53:41.314Z","author":"claude-code-agent","op":"update","patch":[{"op":"add","path":"/metadata/comments/4","value":{"created_at":"2026-05-26T15:53:41.309Z","author":"claude-code-agent","text":"Implementation evidence 2026-05-26: extracted buildExtensionPolicyOverride + collectExtensionPolicyOverrides helpers inside src/core/extensions/extension-policy.ts (single-file, no coverage-include change needed because the file is already in the uncovered allowlist). Removed 25-line duplicate between normalizeExtensionPolicy and hydrateExtensionPolicy override loops. The decision pattern is preserved: the existing barrel re-export structure is untouched; consumers continue to import {normalize,hydrate}ExtensionPolicy with no changes. Verified via extension-loader/settings-store/settings-validator/contracts-command tests (90 tests pass) and full release gate (coverage stays at 100%, static-quality gate passes)."}},{"op":"replace","path":"/metadata/updated_at","value":"2026-05-26T15:53:41.314Z"}],"before_hash":"ba3c289c6c40b634963d5e19f38f8acac2fb2678e86e074583050500862c3fe3","after_hash":"fcc544869cf8bee71904fc8a8fea9e24ece172b0a9729cf72ebeae2122ae6270"} |
There was a problem hiding this comment.
History journal entries in .agents/pm should not be directly committed
Please remove direct JSONL history edits from the PR and record this through the PM system-of-record workflow.
As per coding guidelines, .agents/pm/**: pm is the system of record. Do not edit .agents/pm files directly.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.agents/pm/history/pm-3cbk.jsonl around lines 5 - 6, Remove the direct edits
to the PM history file (.agents/pm/history/pm-3cbk.jsonl) from this PR:
revert/remove the added metadata/comments entries (the two JSONL add/replace
patches that appended comments[3] and comments[4] and updated
metadata/updated_at) and restore the file to its prior state, then record these
notes via the PM system-of-record workflow instead of committing them; update
your branch with that revert and re-run tests/linting so no .agents/pm changes
remain in the patch.
| {"ts":"2026-05-26T15:19:28.912Z","author":"codex-review-continuation","op":"close","patch":[{"op":"remove","path":"/metadata/assignee"},{"op":"replace","path":"/metadata/updated_at","value":"2026-05-26T15:19:28.912Z"},{"op":"replace","path":"/metadata/status","value":"closed"},{"op":"add","path":"/metadata/close_reason","value":"PR #72 is green after reviewer follow-up; all plan steps complete and evidence recorded."}],"before_hash":"85ad6fb84100bb46daf65b98bbde43c8a8eed1555139e59b02934bfdbc5606a3","after_hash":"b2cca3abaa874e85ea2837cf69833b73bd3ad2fd826c64f655d5b47a7b855bdf"} | ||
| {"ts":"2026-05-26T15:19:31.887Z","author":"codex-review-continuation","op":"release","patch":[{"op":"replace","path":"/metadata/updated_at","value":"2026-05-26T15:19:31.887Z"}],"before_hash":"b2cca3abaa874e85ea2837cf69833b73bd3ad2fd826c64f655d5b47a7b855bdf","after_hash":"3990fd430f0589140246257236e1815f238419847928b6019739a7d5805ab75d"} | ||
| {"ts":"2026-05-26T15:30:51.313Z","author":"codex-review-continuation","op":"comment_add","patch":[{"op":"add","path":"/metadata/comments/3","value":{"created_at":"2026-05-26T15:30:51.313Z","author":"codex-review-continuation","text":"Final PR #72 readiness: latest head 001fd8c7 has green CI (build, static, typecheck, compat, smokes, coverage, runtime smokes), CodeRabbit passed, review thread fetch reports 11 reviews and 0 active threads, mergeStateStatus CLEAN. Proceeding to merge."}},{"op":"replace","path":"/metadata/updated_at","value":"2026-05-26T15:30:51.313Z"}],"before_hash":"3990fd430f0589140246257236e1815f238419847928b6019739a7d5805ab75d","after_hash":"6115af41084d8a7c2321905c1c3585bbb5ad7940db38181b99bb4a803291e068"} | ||
| {"ts":"2026-05-26T15:56:07.290Z","author":"claude-code-agent","op":"update","patch":[{"op":"replace","path":"/metadata/updated_at","value":"2026-05-26T15:56:07.290Z"},{"op":"add","path":"/metadata/resolution","value":"Bundled the pm-ch59 (compact mutation output) and pm-8nyc (smarter unknown-flag recovery) agent-UX deliverables into PR #72 with shared review/dogfood/release-gate evidence."},{"op":"add","path":"/metadata/expected_result","value":"Single PR ships both improvements; CI/Codex/Gemini reviews pass; release gate stays green; CHANGELOG regenerated from closed items."},{"op":"add","path":"/metadata/actual_result","value":"PR #72 merged 2026-05-25 with all CI checks green; Codex/Gemini feedback addressed across multiple iterations; CHANGELOG auto-regenerated."}],"before_hash":"6115af41084d8a7c2321905c1c3585bbb5ad7940db38181b99bb4a803291e068","after_hash":"79ecea726a7b5becaed24b0ff5d742de43a2992c8661dcc01647f2064cb227eb","message":"Backfill resolution metadata"} |
There was a problem hiding this comment.
Backfill metadata edit violates .agents/pm edit policy
This direct history mutation should be generated via PM tooling rather than committed as a file edit.
As per coding guidelines, .agents/pm/**: pm is the system of record. Do not edit .agents/pm files directly.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.agents/pm/history/pm-70mi.jsonl at line 30, The commit directly mutates pm
history metadata (fields metadata/updated_at, metadata/resolution,
metadata/expected_result, metadata/actual_result in the pm-70mi.jsonl record)
which violates the `.agents/pm` edit policy; revert these manual changes in this
PR and instead create the appropriate PM-tooling change request or run the PM
backfill workflow that writes the metadata through the system of record (include
the original commit message "Backfill resolution metadata" in the tooling
request so the automated update targets the same record).
| {"ts":"2026-05-26T15:43:42.638Z","author":"claude-code-agent","op":"update","patch":[{"op":"add","path":"/metadata/comments/35","value":{"created_at":"2026-05-26T15:43:42.628Z","author":"claude-code-agent","text":"Execution start 2026-05-26: claiming pm-7rlp for nightly cross-platform stability slice. Two real failures in last nightly (26439727168): (1) tests/unit/extension-command.spec.ts:756 macOS realpath mismatch (/var/folders vs /private/var/folders), (2) tests/integration/cli.integration.spec.ts:234 Windows spawnSync npm.cmd EINVAL (Node 20 CVE-2024-27980 hardening still requires shell:true even with .cmd suffix). Combining with pm-3cbk dedup follow-up: extract buildExtensionPolicyOverride helper to remove 25-line duplicate between normalizeExtensionPolicy and hydrateExtensionPolicy. Branch fix/nightly-cross-platform-stability-and-extension-policy-dedup."}},{"op":"replace","path":"/metadata/updated_at","value":"2026-05-26T15:43:42.638Z"}],"before_hash":"c27a50feda4aa35a6fd29153395e57a9bf0b2e4648d023634a9a4a460e808923","after_hash":"4151e1bf268e3ae7f849a9fe70bb5336b6e3287623eb7fdfff37b0012b5e2d55"} | ||
| {"ts":"2026-05-26T15:53:37.302Z","author":"claude-code-agent","op":"update","patch":[{"op":"add","path":"/metadata/comments/36","value":{"created_at":"2026-05-26T15:53:37.292Z","author":"claude-code-agent","text":"Implementation evidence 2026-05-26: applied two surgical nightly fixes on branch fix/nightly-cross-platform-stability-and-extension-policy-dedup. (1) tests/integration/cli.integration.spec.ts:234 added shell:true on Windows for execFileSync(npm.cmd) to satisfy Node CVE-2024-27980 hardening (.cmd files now require shell mode); (2) tests/unit/extension-command.spec.ts:729 wrapped mkdtemp(os.tmpdir()) in await realpath(...) so macOS resolves /var/folders -> /private/var/folders before comparing with resolveInstallSource output (the production code path already realpaths via underlying fs.realpath). Verification: targeted tests pass (extension-command + cli.integration), extension-loader/settings-store/settings-validator/contracts-command (90 tests) pass after the extension-policy override extraction. Full release gate node scripts/release/run-gates.mjs --telemetry-mode best-effort --json reports ok=true across build/typecheck/docs/static/coverage/version/secrets/npx-smoke/package-first-dogfood/npm-pack/compat/sentry-telemetry; coverage at 100% statements/branches/functions/lines; Sentry critical=0, high=5 (within threshold), telemetry finish_error_rate_pct=1.95, missing-error-code rows=0. Manual temp-dir dogfood verified init/create/list/search/context/health/validate happy path with the new extension-policy override path traversed."}},{"op":"replace","path":"/metadata/updated_at","value":"2026-05-26T15:53:37.302Z"}],"before_hash":"4151e1bf268e3ae7f849a9fe70bb5336b6e3287623eb7fdfff37b0012b5e2d55","after_hash":"d89e09d5db7a456768d2bb44b09124a8805bde09e092bce3b5427daae52e40ce"} |
There was a problem hiding this comment.
Do not append tracker history directly in .agents/pm files
These history additions need to come from the PM system-of-record process, not direct repository edits.
As per coding guidelines, .agents/pm/**: pm is the system of record. Do not edit .agents/pm files directly.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.agents/pm/history/pm-7rlp.jsonl around lines 85 - 86, Revert the manual
additions to the JSON history object (remove the added metadata.comments entries
keyed "35" and "36" and restore metadata.updated_at to the prior value) so the
.agents/pm record is not directly edited; then re-run or request the
authoritative PM system-of-record process to apply these history comments
instead of committing them manually and ensure future changes to pm-7rlp.jsonl
come only from that PM workflow.
| {"ts":"2026-05-25T23:19:36.304Z","author":"claude-code-agent","op":"comment_add","patch":[{"op":"add","path":"/metadata/comments/6","value":{"created_at":"2026-05-25T23:19:36.304Z","author":"claude-code-agent","text":"IMPLEMENTED (same branch). Four recovery improvements closing the dogfood findings: (1) Cross-command flag awareness: commander-usage.ts builds a flag->commands index from PM_CORE_COMMAND_NAMES (declaration order, alias/shortcut commands like ctx/list-* excluded); unknown_option errors now add 'X is a valid option on: create, list, list-all' (threaded via new CommanderGuidanceContext.unknownOptionOtherCommands -> error-guidance unknown_option nextSteps). Fixes `pm test-all --type` and `pm create --fields`. (2) Prefix/abbreviation-aware suggestNearestLongFlags: --desc now suggests --description (rank-0 prefix match ahead of levenshtein typos). (3) list --sort aliases: updated->updated_at, created->created_at (+update/create/modified) in list.ts parseSortField; help text + invalid-value error updated; fixes `pm list-all --sort updated`. (4) Semantic map extended: update/create --add-tags/--add-tag/--tag -> --tags. Existing --body->--add (comments/notes/learnings) still works. Tests: list-command (alias accept+reject), error-guidance (cross-command+nearest render), help-runtime (test-all --type cross-command hint, create --desc abbreviation). Manual temp-dir smoke confirmed all four + JSON envelope next_steps carries the hint. Note: guide-shell suggested_retry malformedness (a comment finding) lives in the pm-guide-shell package, out of core scope."}},{"op":"replace","path":"/metadata/updated_at","value":"2026-05-25T23:19:36.304Z"}],"before_hash":"fdcf722ff3ffc807603c0124a7b405e1a903870c78e0963b15e3a51871ea27b1","after_hash":"d7cdcdc995629152dcc03d38fd91ab7e64aca401afb146cdf92d60efcbbe173b"} | ||
| {"ts":"2026-05-25T23:47:42.693Z","author":"claude-code-agent","op":"update","patch":[{"op":"replace","path":"/metadata/updated_at","value":"2026-05-25T23:47:42.693Z"},{"op":"replace","path":"/metadata/title","value":"Improve unknown-option recovery with nearest, abbreviated, and cross-command flag suggestions plus list --sort aliases"}],"before_hash":"d7cdcdc995629152dcc03d38fd91ab7e64aca401afb146cdf92d60efcbbe173b","after_hash":"627babb9048fa7b58c94a1e942788e682bd3068f65328776de5a3ac5708c7403","message":"Retitle to delivered change for changelog clarity (original problem framing retained in description)"} | ||
| {"ts":"2026-05-25T23:47:55.815Z","author":"claude-code-agent","op":"close","patch":[{"op":"remove","path":"/metadata/assignee"},{"op":"replace","path":"/metadata/updated_at","value":"2026-05-25T23:47:55.815Z"},{"op":"replace","path":"/metadata/status","value":"closed"},{"op":"add","path":"/metadata/close_reason","value":"Shipped on same branch. Unknown-option errors now: suggest nearest flags (incl. abbreviation/prefix like --desc->--description), note when a flag is valid on other commands (--type on test-all -> create/list/list-all; --fields on create -> list/get), and map --add-tags/--add-tag->--tags; existing --body->--add retained. Also added list --sort aliases (updated->updated_at, created->created_at) with updated help/error text. Tests: list-command, error-guidance, help-runtime. Full coverage gate green, dogfood 16/16 pass. Out-of-core note: guide-shell suggested_retry phrasing lives in the pm-guide-shell package."}],"before_hash":"627babb9048fa7b58c94a1e942788e682bd3068f65328776de5a3ac5708c7403","after_hash":"ec1c39efc68b9808353cf14dcd17b963687b540af15717e889ca99ff703e61f6"} | ||
| {"ts":"2026-05-26T15:56:03.378Z","author":"claude-code-agent","op":"update","patch":[{"op":"replace","path":"/metadata/updated_at","value":"2026-05-26T15:56:03.378Z"},{"op":"add","path":"/metadata/resolution","value":"Improved unknown-option recovery with nearest-flag suggestions, abbreviated-flag matching, cross-command flag hints, --desc as --description alias, list --sort aliases, and --add-tags support."},{"op":"add","path":"/metadata/expected_result","value":"Misspelled or wrong-command flags surface 'did you mean' hints rather than opaque rejections; agents recover without humans."},{"op":"add","path":"/metadata/actual_result","value":"Cross-command flag hint engine implemented with levenshtein; integration tests cover hints; CI green on PR #72; merged 2026-05-25."}],"before_hash":"ec1c39efc68b9808353cf14dcd17b963687b540af15717e889ca99ff703e61f6","after_hash":"347aa0ecb57277a7fb17bc2acc413313f2d5082a412e5c588270800a59e66e53","message":"Backfill resolution metadata"} |
There was a problem hiding this comment.
Direct edit under .agents/pm/** violates repository policy.
Line 12 updates PM history directly in a system-of-record path. This should be produced via the PM workflow/tooling, not hand-edited in-repo files.
As per coding guidelines, ".agents/pm/**: pm is the system of record. Do not edit .agents/pm files directly."
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.agents/pm/history/pm-8nyc.jsonl at line 12, The change directly mutates the
PM system-of-record JSON by editing metadata keys (e.g., metadata/updated_at,
metadata/resolution, metadata/expected_result, metadata/actual_result) under the
.agents/pm/** path; revert this manual edit and reapply the update through the
official PM workflow/tooling that owns this file (use the PM tool or API that
emits history entries) so the metadata is recorded correctly and auditably
rather than hand-editing the JSON.
|
|
||
| ### Fixed | ||
|
|
||
| - Fix nightly cross-platform reliability: macOS realpath in extension-command test and Windows .cmd spawn EINVAL ([pm-gf6f](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/chores/pm-gf6f.toon)) |
There was a problem hiding this comment.
Changelog link target looks inconsistent with the added PM record.
Line 18 links to .agents/pm/chores/pm-gf6f.toon, but this PR adds pm-gf6f under .agents/pm/history/pm-gf6f.jsonl. Please confirm the linked artifact exists at release time; otherwise this becomes a broken changelog link.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@CHANGELOG.md` at line 18, The changelog entry in CHANGELOG.md references
`.agents/pm/chores/pm-gf6f.toon` which is inconsistent with the PR artifact
`pm-gf6f` added under `.agents/pm/history/pm-gf6f.jsonl`; update the link target
in the line containing `.agents/pm/chores/pm-gf6f.toon` to point to the correct
artifact path `.agents/pm/history/pm-gf6f.jsonl` (or add the missing
`.agents/pm/chores/pm-gf6f.toon` file if that was intended) so the changelog
link resolves at release time and does not become broken.
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Read the key changed files
echo "=== src/core/extensions/extension-policy.ts ==="
cat src/core/extensions/extension-policy.ts
echo ""
echo "=== tests/integration/cli.integration.spec.ts (relevant section) ==="
cat tests/integration/cli.integration.spec.ts
echo ""
echo "=== tests/unit/extension-command.spec.ts ==="
cat tests/unit/extension-command.spec.ts
echo ""
echo "=== CHANGELOG.md ==="
cat CHANGELOG.mdLength of output: 263710
Review SummaryThe PR addresses two nightly CI failures with surgical fixes and follows up with a clean deduplication refactor. All three changes are correct and minimal.
|
|
Review summary:
CI is green across Build foundation, all Runtime smokes (Ubuntu/macOS/Windows × Node 20/22/24), all Gates (coverage/static/typecheck/compat/smokes), Docs, and CodeRabbit. Proceeding to merge. |
PR #73 squash-merged to main as 6065928 after the AI review window: Codex chef's-kiss, Gemini no-feedback, Sourcery rate-limited, and CodeRabbit's 10 actionable comments resolved to known pm-CLI false positives plus an incorrect link concern. CI fully green across all runtime smokes and gates. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Summary
Two real nightly failures from run 26439727168 (2026-05-26) plus an in-place cleanup of the extension-policy override-normalization duplicate identified under the pm-3cbk maintainability decision.
Nightly fixes
tests/integration/cli.integration.spec.ts: addshell: truetoexecFileSync('npm.cmd', ...)on win32. After CVE-2024-27980 Node hardening,spawnSyncof a.cmdfile requires shell mode or it fails withEINVAL. PR Harden history lock-window reliability and repin release workflow action #68 switched the binary tonpm.cmdon Windows but did not enable shell mode, regressing the packed-npm-with-deps integration test.tests/unit/extension-command.spec.ts:realpaththemkdtemptemp root before comparing againstresolveInstallSourceoutput. macOS resolves/var/folders/...to/private/var/folders/...; the production code path canonicalizes viafs.realpath, but the test held the rawos.tmpdir-prefixed path.pm-3cbk dedup
buildExtensionPolicyOverride+collectExtensionPolicyOverrideshelpers insidesrc/core/extensions/extension-policy.tsto remove the 25-line duplicate betweennormalizeExtensionPolicyandhydrateExtensionPolicyoverride loops. Single-file extraction keeps the existing uncovered allowlist clean and consumers continue to import{normalize,hydrate}ExtensionPolicyunchanged.Tracker hygiene
resolution/expected_result/actual_resulton three closed items (pm-ch59, pm-8nyc, pm-70mi) from PR Compact mutation output + smarter unknown-flag recovery (pm-ch59, pm-8nyc) #72 that pre-dated the--expected-result/--actual-resultclose flow.pm validate --check-resolutionnow warning-free.pnpm changelog:pmregeneratedCHANGELOG.mdwith the new "Fixed" entry.Test plan
node scripts/run-tests.mjs test -- tests/unit/extension-command.spec.ts tests/integration/cli.integration.spec.ts -t "resolves existing cwd-relative npm package specs|installs runtime dependencies for packed npm"(2 tests pass)node scripts/release/run-gates.mjs --telemetry-mode best-effort --json: build, typecheck, docs, static-quality, coverage (100/100/100/100), version-policy, secret-scan, npx-smoke, package-first-dogfood, npm-pack, compat, sentry-telemetry — all ok. Sentry critical=0 high=5; telemetry finish_error_rate_pct=1.95pm health --check-only --brief: okpm validate --check-resolution --check-history-drift: ok (no warnings)pnpm changelog:pm:check: unchangednode scripts/check-secrets.mjs: cleanRefs pm-7rlp (CI/test reliability), pm-3cbk (dedup decision), pm-gf6f (this fix).
🤖 Generated with Claude Code