Skip to content

Guard pm tracker path targeting for agents - #142

Merged
unbraind merged 1 commit into
mainfrom
fix/pm-path-workspace-guardrails
Jun 7, 2026
Merged

unbraind merged 1 commit into
mainfrom
fix/pm-path-workspace-guardrails

Conversation

@unbraind

@unbraind unbraind commented Jun 7, 2026

Copy link
Copy Markdown
Owner

Summary

  • add preferred --pm-path global option while keeping --path as a tracker-root compatibility alias
  • guard pm init when an explicit tracker path points at a likely workspace root, with --force for intentional root-level tracker files
  • update completions, contracts, docs, changelog, and regression tests
  • record broad pm CLI/SDK/ecosystem audit evidence in pm via pm-yo3f and pm-xm98

Closes #140.

Verification

  • pm test pm-yo3f --run --progress
  • node scripts/run-tests.mjs coverage
  • pm validate --check-resolution --check-history-drift
  • pm health --check-only --summary
  • node scripts/release/sentry-telemetry-gate.mjs --json --telemetry-mode best-effort --max-critical 0 --max-high 0 --max-telemetry-error-rate 10 --max-telemetry-missing-error-rows 0
  • node dist/cli.js changelog generate --output CHANGELOG.md --title "Changelog" --mode replace --all-release-tags --status closed --item-url-base https://github.com/unbraind/pm-cli/blob/main/.agents/pm --check
  • external package smoke sub-agent: 17 discovered packages tested, failed=0

Notes

  • pnpm audit --audit-level moderate passed in the GitHub/observability sub-agent lane; later local retries hit npm registry ETIMEDOUT, so this PR also includes pnpm security:scan and live Sentry/telemetry evidence.

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @unbraind, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@unbraind

unbraind commented Jun 7, 2026

Copy link
Copy Markdown
Owner Author

@codex review
/gemini review
@gemini-code-assist

Please review the pm tracker-path guardrail changes, especially --pm-path alias handling, init workspace-root guard behavior, completion/contracts updates, and agent-facing docs.

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@coderabbitai

coderabbitai Bot commented Jun 7, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@unbraind, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 26 minutes and 20 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 58920cce-f70f-4a09-9b25-7b439c4bc97d

📥 Commits

Reviewing files that changed from the base of the PR and between 2cfeaae and fd4869e.

📒 Files selected for processing (21)
  • .agents/pm/history/pm-xm98.jsonl
  • .agents/pm/history/pm-yo3f.jsonl
  • .agents/pm/plans/pm-xm98.toon
  • .agents/pm/tasks/pm-yo3f.toon
  • AGENTS.md
  • CHANGELOG.md
  • docs/CONFIGURATION.md
  • docs/EXTENSIONS.md
  • src/cli/bootstrap-args.ts
  • src/cli/commands/completion.ts
  • src/cli/commands/extension/scaffold.ts
  • src/cli/commands/init.ts
  • src/cli/main.ts
  • src/cli/register-setup.ts
  • src/cli/registration-helpers.ts
  • src/sdk/cli-contracts.ts
  • tests/fixtures/contracts/full.json
  • tests/integration/init-path-guard.integration.spec.ts
  • tests/unit/bootstrap-args.spec.ts
  • tests/unit/completion-command.spec.ts
  • tests/unit/contracts-command.spec.ts
📝 Walkthrough

Walkthrough

This PR implements guardrails and clearer semantics for tracker-path targeting in the PM CLI. It introduces --pm-path as the explicit preferred flag for specifying tracker storage, keeps --path as a backward-compatible alias, and adds a workspace-root detection guard in pm init that blocks accidental tracker creation in repository roots unless overridden with --force.

Changes

PM CLI path flag and init guardrails

Layer / File(s) Summary
Audit and historical records
.agents/pm/history/pm-xm98.jsonl, .agents/pm/history/pm-yo3f.jsonl, .agents/pm/plans/pm-xm98.toon, .agents/pm/tasks/pm-yo3f.toon
Task and plan history files documenting the completed audit work for issue #140, including remediation verification, code reviews, test execution tracking, and resolution confirmation.
CLI flag definition and option resolution
src/cli/main.ts, src/cli/registration-helpers.ts, src/sdk/cli-contracts.ts
Core flag registration: --pm-path is added as the primary tracker-path option with --path as an alias; option resolution logic and CLI contracts are updated to reflect the new flag.
Bootstrap argument parsing for path flags
src/cli/bootstrap-args.ts, tests/unit/bootstrap-args.spec.ts
Updates to argv parsing to recognize both --path and --pm-path (space-separated and inline forms); list-flag coalescing updated to handle --pm-path as a value-consuming global flag; comprehensive unit tests added for both flag forms.
Workspace-root detection and init guardrail
src/cli/commands/init.ts, src/cli/register-setup.ts, tests/integration/cli.integration.spec.ts
Adds force?: boolean to InitCommandOptions and implements workspace-root detection (via .git, package.json, pnpm-workspace.yaml, AGENTS.md, .agents/pm) that blocks initialization unless --force is used; CLI registration wires the --force flag through to runInit; integration test verifies guard behavior and recovery path.
Shell completion generation for path flags
src/cli/commands/completion.ts, tests/unit/completion-command.spec.ts
Updates bash and zsh completion generation to include --pm-path alongside --path in all relevant subcommand options; Zsh redefines --path as an alias for --pm-path; global flags list now includes aliases from contracts; completion tests updated to verify both flags appear.
Documentation and user guidance
docs/CONFIGURATION.md, AGENTS.md, docs/EXTENSIONS.md, CHANGELOG.md, src/cli/commands/extension/scaffold.ts
User-facing documentation clarifying --pm-path vs --path semantics, workspace-root guard behavior, and recommended tracker targeting practices; changelog entry documenting the changes; example guidance and comment cleanup.
Test contract and fixture updates
tests/fixtures/contracts/full.json
Test fixtures updated to include --force flag definition for init command to verify contract snapshot consistency.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • unbraind/pm-cli#102: Both PRs modify the pm init implementation—main PR adds --pm-path/workspace-root guarding plus --force, while retrieved PR adds --type-preset schema persistence—so they overlap in src/cli/commands/init.ts's option surface and runInit flow.
  • unbraind/pm-cli#38: Both PRs modify src/cli/registration-helpers.ts's getGlobalOptions logic for resolving global options (retrieved PR adds tolerance for commands lacking optsWithGlobals, while the main PR changes how path is derived to prefer pmPath).
  • unbraind/pm-cli#70: Both PRs modify src/cli/bootstrap-args.ts's argv normalization/coalescing behavior around value-consuming path flags—main PR extends the skip list to include --pm-path, while the retrieved PR's list-flag coalescer adds logic to avoid mis-consuming --path-like values—so the changes overlap at the same normalization logic level.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 6.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Guard pm tracker path targeting for agents' clearly summarizes the main change: adding guardrails for pm tracker path targeting.
Description check ✅ Passed The description directly relates to the changeset, covering the preferred --pm-path option, workspace root guards, init --force flag, documentation updates, and audit recordings.
Linked Issues check ✅ Passed The PR fully implements all coding requirements from issue #140: introduces --pm-path as preferred flag [#140], keeps --path as compatibility alias [#140], adds workspace root guardrail to pm init [#140], updates completions/contracts/docs [#140], and adds comprehensive test coverage [#140].
Out of Scope Changes check ✅ Passed All changes are directly scoped to issue #140 objectives: path flag semantics, guardrails, documentation, and related tests. Audit recordings (pm-yo3f, pm-xm98) are scope-appropriate evidence documentation.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (5)
src/cli/bootstrap-args.ts (1)

49-87: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Unify --pm-path vs --path precedence with runtime option resolution.

Bootstrap parsing currently applies “last seen wins” across both flags, while runtime getGlobalOptions prefers pmPath. If both flags are supplied with different values, bootstrap-time root resolution can diverge from execution-time root resolution.

🤖 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 `@src/cli/bootstrap-args.ts` around lines 49 - 87, parseBootstrapGlobalOptions
currently applies "last seen wins" to path flags which can diverge from runtime
getGlobalOptions that prefers pmPath; update parseBootstrapGlobalOptions (and
adjust parseBootstrapPathToken usage) to track pmPath and legacy path separately
instead of a single pathValue, and after parsing apply the same precedence as
getGlobalOptions (use pmPath when present, otherwise fall back to --path).
Ensure parseBootstrapPathToken still returns enough info to distinguish a pmPath
vs legacy --path so you can set pmPath/path variables and finally set pathValue
= pmPath ?? path.
src/cli/main.ts (1)

605-616: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Strip pmPath from command-scoped options to avoid polluting mutation payloads.

Line 1615 introduces --pm-path, but extractCommandScopedOptions only deletes path. When --pm-path is used, pmPath can remain in commandOptions and be propagated as an unintended field on create/update flows.

Suggested fix
 function extractCommandScopedOptions(
   command: Command,
   commandArgs: string[],
   extensionFlagDefinitions: Array<Record<string, unknown>> = [],
 ): Record<string, unknown> {
   const allOptions = command.optsWithGlobals() as Record<string, unknown>;
   const scoped: Record<string, unknown> = { ...allOptions };
   delete scoped.json;
   delete scoped.quiet;
   delete scoped.path;
+  delete scoped.pmPath;
   delete scoped.noExtensions;
   delete scoped.extensions;
   delete scoped.profile;
   delete scoped.pager;

Also applies to: 1615-1616

🤖 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 `@src/cli/main.ts` around lines 605 - 616, The extractCommandScopedOptions
function currently deletes generic keys like path but does not remove the pmPath
option introduced for --pm-path, so pmPath can leak into commandOptions and
mutation payloads; update extractCommandScopedOptions (used with
command.optsWithGlobals()) to also delete scoped.pmPath (and any camelCase
variant if present) along with json, quiet, path, noExtensions, and extensions
so that --pm-path is stripped from command-scoped options before returning.
src/sdk/cli-contracts.ts (1)

426-434: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

init --force was added to flags but not to the action schema contract.

The new INIT_FLAG_CONTRACTS entry includes --force, but PM_TOOL_ACTION_SCHEMA_CONTRACTS.init.optional still omits force. This creates a CLI/SDK contract mismatch.

Suggested fix
-  init: { optional: ["prefix", "preset", "typePreset", "defaults", "author", "agentGuidance", "withPackages", "verbose"] },
+  init: { optional: ["prefix", "preset", "typePreset", "defaults", "author", "agentGuidance", "withPackages", "verbose", "force"] },

Also applies to: 1542-1542

🤖 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 `@src/sdk/cli-contracts.ts` around lines 426 - 434, The INIT_FLAG_CONTRACTS
array was updated to include the "--force" flag but the action schema contract
PM_TOOL_ACTION_SCHEMA_CONTRACTS.init.optional does not include a corresponding
"force" entry, causing a contract mismatch; update
PM_TOOL_ACTION_SCHEMA_CONTRACTS.init.optional to include "force" (matching the
flag name used in INIT_FLAG_CONTRACTS) so the init action schema recognizes the
new optional flag (ensure you add the "force" key to the optional array/object
alongside the other init optional entries).
tests/unit/completion-command.spec.ts (1)

635-643: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add test assertion for --pm-path in fish global flags.

Once the fish completion implementation is updated to include --pm-path (per the comment on the source file), this test should be updated to verify that --pm-path appears in the generated fish completion script.

🧪 Proposed fix
 it("includes global flag completions", () => {
   const script = generateFishScript();
   expect(script).toContain("-l json");
   expect(script).toContain("-l quiet");
+  expect(script).toContain("-l pm-path");
   expect(script).toContain("-l path");
   expect(script).toContain("-l no-extensions");
   expect(script).toContain("-l profile");
   expect(script).toContain("-l version");
   expect(script).toContain("-l help");
 });
🤖 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 `@tests/unit/completion-command.spec.ts` around lines 635 - 643, Update the
"includes global flag completions" test in tests/unit/completion-command.spec.ts
(the test that calls generateFishScript()) to assert the new pm-path global flag
is present; add an expectation similar to the other global flags, e.g.
expect(script).toContain("-l pm-path"), so the generated fish completion script
includes the pm-path long flag.
src/cli/commands/completion.ts (1)

1469-1477: ⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Missing --pm-path in fish global flags.

The fish completion global flags section includes --path but is missing the new --pm-path flag. Both bash and zsh completions correctly include both flags (lines 79-83, 586-587), but the fish completion at lines 1469-1477 only defines --path.

Add a corresponding line for --pm-path in the fish global flags section to maintain parity with bash and zsh.

🐟 Proposed fix
 # Global flags (available for all subcommands)
 complete -c pm -l json -d 'Output JSON instead of TOON'
 complete -c pm -l quiet -d 'Suppress stdout output'
 complete -c pm -l no-changed-fields -d 'Omit changed_fields array from mutation output'
+complete -c pm -l pm-path -d 'Explicit tracker storage path for this command' -r
 complete -c pm -l path -d 'Override PM path for this command' -r
 complete -c pm -l no-extensions -d 'Disable extension loading'
 complete -c pm -l profile -d 'Print deterministic timing diagnostics'
🤖 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 `@src/cli/commands/completion.ts` around lines 1469 - 1477, Add the missing
fish global flag for --pm-path by inserting a line mirroring the existing --path
entry in the fish completion global flags block; specifically add a completion
for the pm command with the long flag name "pm-path" and the same
description/option behavior as "--path" (e.g., "Override PM path for this
command", with any required/argument marker like -r) next to the existing
"complete -c pm -l path" entry so fish matches bash/zsh; reference the existing
fish block entries "complete -c pm -l path -d 'Override PM path for this
command' -r" and the missing flag "--pm-path".
🤖 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 `@CHANGELOG.md`:
- Line 7: The Unreleased changelog entry "Add schema show-status status
inspection" is out of scope for this PR; either remove or replace that line with
the correct guardrail entry for this change set (e.g., the `--pm-path` /
workspace-root guardrail text) or move the exact "Add schema show-status status
inspection" item into the PR that actually introduced it; update CHANGELOG.md so
the Unreleased section contains only items relevant to this PR and ensure the
replacement mentions the guardrail flag `--pm-path` (or references the intended
workspace-root guardrail) for clarity.

---

Outside diff comments:
In `@src/cli/bootstrap-args.ts`:
- Around line 49-87: parseBootstrapGlobalOptions currently applies "last seen
wins" to path flags which can diverge from runtime getGlobalOptions that prefers
pmPath; update parseBootstrapGlobalOptions (and adjust parseBootstrapPathToken
usage) to track pmPath and legacy path separately instead of a single pathValue,
and after parsing apply the same precedence as getGlobalOptions (use pmPath when
present, otherwise fall back to --path). Ensure parseBootstrapPathToken still
returns enough info to distinguish a pmPath vs legacy --path so you can set
pmPath/path variables and finally set pathValue = pmPath ?? path.

In `@src/cli/commands/completion.ts`:
- Around line 1469-1477: Add the missing fish global flag for --pm-path by
inserting a line mirroring the existing --path entry in the fish completion
global flags block; specifically add a completion for the pm command with the
long flag name "pm-path" and the same description/option behavior as "--path"
(e.g., "Override PM path for this command", with any required/argument marker
like -r) next to the existing "complete -c pm -l path" entry so fish matches
bash/zsh; reference the existing fish block entries "complete -c pm -l path -d
'Override PM path for this command' -r" and the missing flag "--pm-path".

In `@src/cli/main.ts`:
- Around line 605-616: The extractCommandScopedOptions function currently
deletes generic keys like path but does not remove the pmPath option introduced
for --pm-path, so pmPath can leak into commandOptions and mutation payloads;
update extractCommandScopedOptions (used with command.optsWithGlobals()) to also
delete scoped.pmPath (and any camelCase variant if present) along with json,
quiet, path, noExtensions, and extensions so that --pm-path is stripped from
command-scoped options before returning.

In `@src/sdk/cli-contracts.ts`:
- Around line 426-434: The INIT_FLAG_CONTRACTS array was updated to include the
"--force" flag but the action schema contract
PM_TOOL_ACTION_SCHEMA_CONTRACTS.init.optional does not include a corresponding
"force" entry, causing a contract mismatch; update
PM_TOOL_ACTION_SCHEMA_CONTRACTS.init.optional to include "force" (matching the
flag name used in INIT_FLAG_CONTRACTS) so the init action schema recognizes the
new optional flag (ensure you add the "force" key to the optional array/object
alongside the other init optional entries).

In `@tests/unit/completion-command.spec.ts`:
- Around line 635-643: Update the "includes global flag completions" test in
tests/unit/completion-command.spec.ts (the test that calls generateFishScript())
to assert the new pm-path global flag is present; add an expectation similar to
the other global flags, e.g. expect(script).toContain("-l pm-path"), so the
generated fish completion script includes the pm-path long flag.
🪄 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: 8166dacf-3904-441f-8341-b7919e2701d9

📥 Commits

Reviewing files that changed from the base of the PR and between 9c77af8 and 2cfeaae.

📒 Files selected for processing (20)
  • .agents/pm/history/pm-xm98.jsonl
  • .agents/pm/history/pm-yo3f.jsonl
  • .agents/pm/plans/pm-xm98.toon
  • .agents/pm/tasks/pm-yo3f.toon
  • AGENTS.md
  • CHANGELOG.md
  • docs/CONFIGURATION.md
  • docs/EXTENSIONS.md
  • src/cli/bootstrap-args.ts
  • src/cli/commands/completion.ts
  • src/cli/commands/extension/scaffold.ts
  • src/cli/commands/init.ts
  • src/cli/main.ts
  • src/cli/register-setup.ts
  • src/cli/registration-helpers.ts
  • src/sdk/cli-contracts.ts
  • tests/fixtures/contracts/full.json
  • tests/integration/cli.integration.spec.ts
  • tests/unit/bootstrap-args.spec.ts
  • tests/unit/completion-command.spec.ts
💤 Files with no reviewable changes (1)
  • docs/EXTENSIONS.md

Comment thread CHANGELOG.md

### Added

- Add schema show-status status inspection ([pm-qpus](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/features/pm-qpus.toon))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Unreleased “Added” item appears out of scope for this PR.

Add schema show-status status inspection doesn’t match the path-targeting/guardrail objective in this change set, so the Unreleased section may misrepresent what shipped in this PR. Please either replace it with the --pm-path/workspace-root guardrail entry or move this item to the PR that introduced it.

🤖 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 7, The Unreleased changelog entry "Add schema
show-status status inspection" is out of scope for this PR; either remove or
replace that line with the correct guardrail entry for this change set (e.g.,
the `--pm-path` / workspace-root guardrail text) or move the exact "Add schema
show-status status inspection" item into the PR that actually introduced it;
update CHANGELOG.md so the Unreleased section contains only items relevant to
this PR and ensure the replacement mentions the guardrail flag `--pm-path` (or
references the intended workspace-root guardrail) for clarity.

@unbraind
unbraind force-pushed the fix/pm-path-workspace-guardrails branch from 2cfeaae to 32b99a8 Compare June 7, 2026 09:16
@unbraind

unbraind commented Jun 7, 2026

Copy link
Copy Markdown
Owner Author

@codex review
/gemini review
@gemini-code-assist

Re-triggering after the static-gate fix: moved the workspace-root --pm-path regression into a focused integration spec, kept the omnibus integration spec below the static line threshold, and reran linked pm evidence gates.

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

Add the preferred --pm-path global option while retaining --path as a compatibility alias for tracker storage roots. Guard pm init when an explicit tracker path points at a likely workspace root, with --force as the intentional override.

Update completions, contracts, docs, changelog, and regression coverage for the new path semantics. Record the broad CLI/SDK/ecosystem audit in pm, including sub-agent evidence for external package smoke, GitHub/observability, SDK review, and docs/agent-UX review.

Verification: pm test pm-yo3f --run --progress; node scripts/run-tests.mjs coverage; pm validate --check-resolution --check-history-drift; pm health --check-only --summary; node scripts/release/sentry-telemetry-gate.mjs --json --telemetry-mode best-effort --max-critical 0 --max-high 0 --max-telemetry-error-rate 10 --max-telemetry-missing-error-rows 0; node dist/cli.js changelog generate --output CHANGELOG.md --title Changelog --mode replace --all-release-tags --status closed --item-url-base https://github.com/unbraind/pm-cli/blob/main/.agents/pm --check.
@unbraind
unbraind force-pushed the fix/pm-path-workspace-guardrails branch from 32b99a8 to fd4869e Compare June 7, 2026 09:33
@unbraind

unbraind commented Jun 7, 2026

Copy link
Copy Markdown
Owner Author

@codex review
/gemini review
@gemini-code-assist
@coderabbitai review

Re-triggering after addressing valid review feedback: aligned --pm-path precedence, stripped pmPath from scoped mutation options, added init.force action schema coverage/snapshot, added fish --pm-path completion coverage, and reran linked pm gates.

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@coderabbitai

coderabbitai Bot commented Jun 7, 2026 •

Copy link
Copy Markdown

@unbraind: Got it — I’ll re-run the review with focus on the updated --pm-path precedence/alias handling, scoped mutation option stripping, init.force schema/snapshot coverage, fish completion coverage, and the refreshed pm evidence gates.


🧠 Learnings used
Learnt from: unbraind
Repo: unbraind/pm-cli PR: 0
File: :0-0
Timestamp: 2026-05-28T05:46:05.731Z
Learning: In the `unbraind/pm-cli` repository, `.agents/pm/` files (issues, history, epics, extensions) are the source of truth for the pm CLI tracker and are committed to git as the result of pm CLI mutations (`pm close`, `pm comments`, `pm changelog generate`, etc.). They should not be flagged as hand-edited files in code reviews.

Learnt from: CR
Repo: unbraind/pm-cli PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-20T21:10:16.414Z
Learning: Use sandbox-safe commands for verification. For documentation-only work, run at least `pnpm build` and a focused link/content check. For broader work, run linked tests, coverage, validation, and release gates.

Learnt from: CR
Repo: unbraind/pm-cli PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-20T21:10:16.414Z
Learning: Every code, docs, or test change must be linked to a `pm` item with files/docs/tests and evidence comments.

Learnt from: unbraind
Repo: unbraind/pm-cli PR: 0
File: :0-0
Timestamp: 2026-05-21T22:17:12.545Z
Learning: In the `unbraind/pm-cli` repository, files under `.agents/pm/` (with extensions `.toon` and `.jsonl`) are generated and managed exclusively by the `pm` CLI tool itself (via `pm create`, `pm close`, `pm update`, etc.). They are never manually edited. Committing these files alongside the work they track is the established convention in this repo (see PRs `#36`–#39). These files should NOT be flagged with "do not edit directly" or similar warnings in code review.

Learnt from: unbraind
Repo: unbraind/pm-cli PR: 0
File: :0-0
Timestamp: 2026-05-28T06:10:29.890Z
Learning: In the `unbraind/pm-cli` repository, files under `.agents/pm/` (including `.agents/pm/epics/*.toon`, `.agents/pm/extensions/.managed-extensions.json`, `.agents/pm/history/*.jsonl`, and similar) are intentional source-of-truth tracker files for the pm-cli project management system. They are tracked in git by design and should NOT be flagged as files that shouldn't be edited or committed. Review comments suggesting these files should not be modified are false-positives for this repository.

Learnt from: CR
Repo: unbraind/pm-cli PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-20T21:10:16.414Z
Learning: Orient by running `pm context`, `pm search`, `pm list-open`, and `pm list-in-progress` before `pm create`. If net-new work is required, create or reuse the parent lineage first and record duplicate-check evidence in a create-time comment.

Learnt from: unbraind
Repo: unbraind/pm-cli PR: 0
File: :0-0
Timestamp: 2026-05-30T22:17:32.126Z
Learning: In the `unbraind/pm-cli` repository, files under `.agents/pm/**` (e.g. `.agents/pm/issues/`, `.agents/pm/chores/`, `.agents/pm/features/`, `.agents/pm/history/`) are git-tracked by design and are created/updated exclusively via the sanctioned `pm` CLI tooling (`pm create`, `pm close`, `pm comments`, etc.). These files are the repository's internal system of record and should NOT be flagged as "do not edit directly" — direct edits via the `pm` CLI are the correct and intended workflow.

Learnt from: CR
Repo: unbraind/pm-cli PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-20T21:10:16.414Z
Learning: Keep edits scoped to the claimed item. Link changed files with `pm files`, docs with `pm docs`, and runnable verification with `pm test`.

Learnt from: CR
Repo: unbraind/pm-cli PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-20T21:10:16.414Z
Learning: Before `pm` mutations in this repo, run bootstrap commands: `npm install -g .`, `pm --version`, `node -v`, `pnpm -v`, and `pnpm build`.

Learnt from: CR
Repo: unbraind/pm-cli PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-20T21:10:16.414Z
Learning: Applies to .agents/pm/** : `pm` is the system of record. Do not edit `.agents/pm` files directly.

Learnt from: CR
Repo: unbraind/pm-cli PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-20T21:10:16.414Z
Learning: Applies to **/*.test.{js,ts,mjs,cjs} : Tests must never read or write the real repository `.agents/pm` data. Use `node scripts/run-tests.mjs` for local tests and avoid recursive `pm test-all` item links.
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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.

Clarify --path semantics for agents and add safe guardrails

1 participant