Repository navigation
Complete agent self-service remediation registry (extension adoption + duplicate-issue-codes gaps) - #306
Conversation
Two diagnostic warning codes were emitted without a matching entry in the shared remediation registry, so agents gating on `pm health --json` / `pm validate --fix-hints` got a warning with no machine-executable fix and had to hardcode the remediation: - extension_update_health_partial_coverage (pm-bdvm): unmanaged extensions the update-health scan had to skip. Added a registry entry pointing at `pm extension --adopt-all --project`, and wired the extensions check into `pm health`'s checkRemediationSources (now total over HealthCheck["name"], dropping the now-dead undefined-source guard). Per-extension findings keep their richer details.triage.remediation and resolve to nothing in the registry, so only the system-wide adoption gap surfaces a remediation_map. - validate_metadata_duplicate_issue_codes (pm-sdbo, GH-235): added a registry entry with `pm update <id> --title "<distinct title>"` plus a summary covering the rename-or-close-as-duplicate fix, so `pm validate --fix-hints` now lists an executable command for duplicate-issue-code findings. Also verified and closed pm-28cf: GH-244 (empty provider/adapter auto-detect source classification) is already fully implemented via resolveProviderConfigSource + the pm health provider_source/vector_store_source surfacing; no code change required. Tests: registry resolveRemediation assertions for both new codes, a health-command remediation_map assertion, and a validate attachValidateFixHints assertion. 100/100/100/100 coverage, static + docs gates green. Sandbox-verified both end-to-end paths. CHANGELOG.md regenerated via pm-changelog. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GGxk19qUjiKKK6JdWjnquB
|
@codex review |
|
To use Codex here, create a Codex account and connect to github. |
📝 WalkthroughWalkthroughTwo new entries are added to the remediation registry for ChangesRemediation Registry Additions and Wiring
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
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 |
There was a problem hiding this comment.
Code Review
This pull request adds remediation registry entries for the extension_update_health_partial_coverage and validate_metadata_duplicate_issue_codes warnings. It updates pm health to make checkRemediationSources total over all health checks, ensuring the extensions check is properly wired into the remediation map. Corresponding integration and unit tests have been added to verify the resolution and mapping of these warnings. Feedback suggests updating the remediation summary for duplicate issue codes to recommend the structured --duplicate-of option instead of the free-text --reason option when closing redundant items.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| { | ||
| code: "validate_metadata_duplicate_issue_codes", | ||
| command: 'pm update <id> --title "<distinct title>"', | ||
| summary: | ||
| "Two or more items share one logical issue code (GH-235); give each a distinct title so the derived code is unique, or close the redundant item with pm close <id> --reason \"duplicate of <other-id>\" (closed-as-duplicate items are excluded from the check).", | ||
| }, |
There was a problem hiding this comment.
Since pm close supports a structured --duplicate-of option (introduced in GH-183/GH-160) for duplicate tracking and auto-populating closure fields, we should suggest using pm close <id> --duplicate-of <other-id> instead of the free-text --reason "duplicate of <other-id>" in the remediation summary.
| { | |
| code: "validate_metadata_duplicate_issue_codes", | |
| command: 'pm update <id> --title "<distinct title>"', | |
| summary: | |
| "Two or more items share one logical issue code (GH-235); give each a distinct title so the derived code is unique, or close the redundant item with pm close <id> --reason \"duplicate of <other-id>\" (closed-as-duplicate items are excluded from the check).", | |
| }, | |
| { | |
| code: "validate_metadata_duplicate_issue_codes", | |
| command: 'pm update <id> --title "<distinct title>"', | |
| summary: | |
| "Two or more items share one logical issue code (GH-235); give each a distinct title so the derived code is unique, or close the redundant item with pm close <id> --duplicate-of <other-id> (closed-as-duplicate items are excluded from the check).", | |
| }, |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "=== PR Info ==="
gh pr view 306 --repo unbraind/pm-cli --json title,body,files,additions,deletions,baseRefName,headRefName
echo ""
echo "=== PR Files Changed ==="
gh pr diff 306 --repo unbraind/pm-cliLength of output: 35944
Overall AssessmentThe PR cleanly closes two genuine agent-UX gaps and the type tightening (
|
| Area | Severity | Note |
|---|---|---|
--project scope hardcoded in remediation command |
Medium | Agents on global-scope extensions will run the wrong command |
Template <id> placeholder in validate_metadata_duplicate_issue_codes |
Low | Ensure consumers handle gracefully |
| No negative assertion for per-extension codes in unit test | Nitpick | toEqual already covers it implicitly |
CHANGELOG Fixed vs Maintenance for GH-244 |
Nitpick | Cosmetic accuracy |
The scope issue in the extension remediation command is the only substantive concern. Everything else is well-executed.
There was a problem hiding this comment.
Code Review
This pull request adds remediation registry entries for the extension_update_health_partial_coverage and validate_metadata_duplicate_issue_codes warnings, mapping them to executable fix commands. To support this, the checkRemediationSources map in src/cli/commands/health.ts was made total over all health checks, and corresponding unit and integration tests were added to verify the new remediation mapping behavior. I have no additional feedback to provide as the implementation is clean and well-tested.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
…e-codes remediation Gemini review: pm close supports a structured --duplicate-of <id> flag (GH-183/GH-160) that auto-fills duplicate closure metadata, so the validate_metadata_duplicate_issue_codes remediation summary now points at 'pm close <id> --duplicate-of <canonical-id>' instead of the free-text --reason "duplicate of <id>". The primary fix command (rename via --title) is unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GGxk19qUjiKKK6JdWjnquB
|
Addressed Gemini's review in ea5f363: the @codex review |
|
To use Codex here, create a Codex account and connect to github. |
🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "=== Latest PR Diff ==="
gh pr diff 306 --repo unbraind/pm-cli
echo ""
echo "=== Commit ea5f3636 ==="
gh api repos/unbraind/pm-cli/commits/ea5f3636 --jq '.files[] | "FILE: \(.filename)\n\(.patch)\n"' 2>/dev/null || echo "Could not fetch commit details"Length of output: 33054
ea5f363 — ✅ Good fixThe switch from free-text
Remaining items from the prior review
OverallThe two substantive issues (extension scope ambiguity, duplicate-code remediation quality) are both addressed. The PR is in good shape. The only remaining note is the CHANGELOG cosmetic — happy to defer that if it's out of scope for this PR. ✅ Action performedFull review finished. |
There was a problem hiding this comment.
Code Review
This pull request adds remediation registry entries for the extension_update_health_partial_coverage and validate_metadata_duplicate_issue_codes warnings. It updates src/cli/commands/health.ts to include the extensions check in checkRemediationSources and ensures the mapping is total over all health checks. Corresponding integration and unit tests have been added to verify the resolution of these warnings to their respective executable commands. Additionally, several tracking items have been closed and the changelog has been updated. There are no review comments to address, and I have no further feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
#254) CodeRabbit + prior triage flagged that closing pm-28cf in this release-bearing PR mis-buckets the CHANGELOG: GH-244's fix shipped in #254 (release 2026.6.16 via pm-gnu2), so listing it under the next release's Fixed is inaccurate. Reopened pm-28cf with the verification note retained; it should be closed only in a non-release-bearing touch. Regenerated CHANGELOG.md — the Unreleased section now contains only this PR's two real additions (pm-bdvm, pm-sdbo), and GH-244 remains correctly attributed to 2026.6.16. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GGxk19qUjiKKK6JdWjnquB
|
Addressed CodeRabbit's CHANGELOG nitpick in 57b3964: GH-244's fix shipped in #254 (release 2026.6.16 via pm-gnu2), so closing pm-28cf in this release-bearing PR was mis-bucketing it under the next release's @coderabbitai full review |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "=== Latest PR Diff (full) ==="
gh pr diff 306 --repo unbraind/pm-cli
echo ""
echo "=== Commit 57b39642 ==="
gh api repos/unbraind/pm-cli/commits/57b39642 --jq '.files[] | "FILE: \(.filename)\nPATCH:\n\(.patch)\n---"' 2>/dev/null || echo "Could not fetch commit details"
echo ""
echo "=== PR Status ==="
gh pr view 306 --repo unbraind/pm-cli --json title,state,commits,reviewDecisionLength of output: 45091
57b3964 — ✅ Correct
One very minor observation (no action needed): Final summary — all prior review items resolved
The PR is clean. Happy to approve. [approve] |
There was a problem hiding this comment.
Code Review
This pull request adds remediation registry entries for the extension_update_health_partial_coverage and validate_metadata_duplicate_issue_codes warnings. It updates src/cli/commands/health.ts to make checkRemediationSources total over all health checks, registers the new commands in src/core/diagnostics/remediation.ts, and adds corresponding integration and unit tests. There are no review comments to evaluate, and I have no additional feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
…ase touch), fix pm-pfxi return-shape note - Reopen pm-28cf: closing a verified-already-shipped tracker in a release-bearing PR mis-buckets pm-changelog (CodeRabbit + prior #306 triage both flagged it); close it in a dedicated non-release touch instead. Regenerate CHANGELOG. - pm-pfxi: drop the non-existent `ok` field from the documented return shape so the task record matches the shipped { used, declared, missing, unused, findings }. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V9qGjDPgdp6iNZ8HbKB6MQ
Summary
Two diagnostic warning codes were emitted without a matching entry in the shared remediation registry (
src/core/diagnostics/remediation.ts), so agents gating onpm health --json/pm validate --fix-hintsreceived a warning with no machine-executable fix command and had to hardcode the remediation. This PR closes both gaps.extension_update_health_partial_coverage— pm-bdvmEmitted by the extensions health check when unmanaged extensions are present (a system-wide adoption gap, not a per-extension triage result).
pm extension --adopt-all --project.extensionscheck intopm health'scheckRemediationSources, which is now total overHealthCheck["name"](the now-deadsources === undefinedguard is removed).details.triage.remediationand resolve to nothing in the registry, so only the system-wide adoption gap surfaces aremediation_map.validate_metadata_duplicate_issue_codes— pm-sdbo (GH-235)pm update <id> --title "<distinct title>"with a summary covering the rename-or-close-as-duplicate fix (using the structuredpm close <id> --duplicate-of <canonical-id>, per Gemini review).pm validate --check-metadata --fix-hintsnow lists an executable command for duplicate-issue-code findings.GH-244 (pm-28cf) — verified, intentionally left open
Verified GH-244 (empty provider/adapter auto-detect source classification) is already fully implemented via
resolveProviderConfigSource+ thepm healthprovider_source/vector_store_sourcesurfacing, shipped in #254 (release 2026.6.16). pm-28cf carries the verification note but is left open so closing it does not mis-bucket the CHANGELOG (it would otherwise list an already-shipped fix under the next release); it should be closed in a non-release-bearing touch.Testing
resolveRemediationassertions for both new codes (tests/integration/remediation-registry.spec.ts).pm health --jsonremediation_mapassertion on the unmanaged-extension path (tests/unit/commands/health-command.spec.ts).attachValidateFixHintsassertion for the duplicate-issue-codes code (tests/unit/commands/validate-command.spec.ts).CHANGELOG.mdregenerated viapm-changelog; Unreleased section contains only pm-bdvm + pm-sdbo.🤖 Generated with Claude Code
https://claude.ai/code/session_01GGxk19qUjiKKK6JdWjnquB