Skip to content

Harden agent UX and Sentry global option handling#38

Merged
unbraind merged 3 commits into
mainfrom
codex/pm-cli-extensive-polish-20260521
May 21, 2026
Merged

Harden agent UX and Sentry global option handling#38
unbraind merged 3 commits into
mainfrom
codex/pm-cli-extensive-polish-20260521

Conversation

@unbraind
Copy link
Copy Markdown
Owner

@unbraind unbraind commented May 21, 2026

Summary

  • Compact create output by omitting body from changed_fields when no body was supplied.
  • Align calendar package help and completions with the accepted scheduled include alias.
  • Improve equal event start/end recovery guidance for create and update.
  • Fix Sentry PM-CLI-T by making getGlobalOptions tolerate command-like extension objects without optsWithGlobals.
  • Sanitize tracked pm evidence for private local-ops wording using pm commands and history-redact.

Verification

  • PM_RUN_TESTS_SKIP_BUILD=1 node scripts/run-tests.mjs test -- tests/unit/registration-helpers.spec.ts tests/unit/create-command.spec.ts tests/unit/update-command.spec.ts tests/unit/completion-command.spec.ts tests/integration/release-readiness-runtime.spec.ts --reporter=dot
  • Manual isolated temp smoke with dist/cli.js covering create changed_fields, equal event recovery, calendar help, and completion aliases.
  • pnpm build
  • pnpm quality:static
  • node scripts/check-secrets.mjs
  • node scripts/dogfood-package-first.mjs
  • node scripts/release/run-gates.mjs --telemetry-mode required --max-sentry-critical 10 --max-sentry-high 20 --max-telemetry-error-rate 10 --json

Observability

  • Resolved Sentry PM-CLI-T after the fix.
  • sentry issue list --query is:unresolved returned no unresolved issues.
  • pm health --check-only --brief --json returned ok with no warnings.

pm Items

  • pm-rnpb
  • pm-5k2w
  • pm-xk39

Summary by Sourcery

Harden CLI agent UX for calendar events and global option handling while aligning calendar include options and updating tracked agent artifacts.

Bug Fixes:

  • Prevent create/update commands from accepting calendar events with equal start and end times, with clearer guidance on valid instant events.
  • Avoid including body in create-command changed_fields output when no body content is provided.
  • Make global option resolution resilient to command-like extensions that lack optsWithGlobals, preventing Sentry-reported runtime errors.

Enhancements:

  • Align calendar extension help text, flags, and shell completions to support the scheduled include option across the CLI.
  • Refresh internal agent configuration and history artifacts to sanitize tracked evidence wording.

Tests:

  • Add unit coverage for create/update equal start/end event validation messaging.
  • Extend completion, registration-helper, and release-readiness tests to cover calendar include=scheduled support and robust global option handling.

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented May 21, 2026

Reviewer's Guide

This PR hardens CLI UX around events and calendar options, fixes global option handling for Sentry-related command-like extensions, and updates agent metadata/history, with targeted unit and integration tests to guard the new behaviors.

Sequence diagram for getGlobalOptions fallback handling

sequenceDiagram
  actor User
  participant Command as CommandLike
  participant Helpers as registration_helpers

  User->>Helpers: getGlobalOptions(command)
  Helpers->>Command: optsWithGlobals()
  alt [optsWithGlobals is a function]
    Command-->>Helpers: optsWithGlobals result
  else [optsWithGlobals missing]
    Helpers->>Command: opts()
    alt [opts is a function]
      Command-->>Helpers: opts result
    else [opts missing]
      Helpers-->>Helpers: use empty options {}
    end
  end
  Helpers-->>User: GlobalOptions { json, quiet, verbose, debug }
Loading

Flow diagram for event start/end validation in create and update commands

flowchart TD
  A[parseEvents / parseEventEntries] --> B[resolveIsoOrRelative for startAt]
  B --> C[resolveIsoOrRelative for endAt]
  C --> D{endAt exists and endAt <= startAt?}
  D -->|Yes| E[throw PmCliError with message --event end must be after start; equal start/end timestamps are invalid. Omit end for an instant event or set end later than start.]
  D -->|No| F[Continue building CalendarEvent and proceed]
Loading

File-Level Changes

Change Details Files
Create command no longer reports body as changed when empty and provides clearer validation for invalid event timestamps.
  • Adjust buildChangedFields to only include body when the request body is non-empty and pass body into this helper from runCreate.
  • Update create-command unit tests to assert that changed_fields omits body when no content is supplied.
  • Enhance event parsing in create to reject end timestamps that are not strictly after start with explicit guidance for equal start/end cases.
src/cli/commands/create.ts
tests/unit/create-command.spec.ts
Update command event parsing now rejects equal start/end timestamps with improved error guidance.
  • Change event parsing in update to emit a more descriptive error when end is not strictly after start, explicitly calling out equal timestamps.
  • Add unit coverage to ensure runUpdate fails with the new guidance when start and end are equal.
src/cli/commands/update.ts
tests/unit/update-command.spec.ts
Global option resolution is made tolerant of command-like extension objects that lack optsWithGlobals to avoid crashes (Sentry PM-CLI-T).
  • Relax getGlobalOptions to safely handle commands that expose optsWithGlobals, only opts, or neither, defaulting to an empty options object when necessary.
  • Introduce unit tests to cover registration helper behavior and guard against regressions in global option handling.
src/cli/registration-helpers.ts
tests/unit/registration-helpers.spec.ts
Calendar include flag gains support for the scheduled source across the extension, help output, and shell completions.
  • Add scheduled to the allowed values for the --include flag in the calendar extension (JS/TS).
  • Extend zsh and fish completion generation to include the scheduled source for calendar include options.
  • Update completion and integration tests to assert that help and completion scripts expose deadlines
reminders
Agent chore/issue/history artifacts are updated to sanitize and refine locally stored pm evidence metadata.
  • Modify agent .toon and .jsonl records for relevant chores, issues, features, and history entries to reflect sanitized wording and updated evidence metadata.
.agents/pm/chores/pm-5jw8.toon
.agents/pm/chores/pm-5k2w.toon
.agents/pm/features/pm-rnpb.toon
.agents/pm/history/pm-5jw8.jsonl
.agents/pm/history/pm-5k2w.jsonl
.agents/pm/history/pm-h4zb.jsonl
.agents/pm/history/pm-rnpb.jsonl
.agents/pm/issues/pm-h4zb.toon

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 21, 2026

Review Change Stack

Warning

Rate limit exceeded

@unbraind has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 53 minutes and 1 second before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, 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 have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro

Run ID: d3605a4f-4630-4a8d-8cc0-204fe88db9b7

📥 Commits

Reviewing files that changed from the base of the PR and between 7998323 and 5fe1777.

📒 Files selected for processing (4)
  • .agents/pm/chores/pm-5k2w.toon
  • .agents/pm/features/pm-rnpb.toon
  • .agents/pm/history/pm-5k2w.jsonl
  • .agents/pm/history/pm-rnpb.jsonl
📝 Walkthrough

Walkthrough

This PR extracts shared event validation messaging, adds support for scheduled events in the calendar extension, improves global option resolution resilience in registration helpers, refines body field tracking in create operations, and comprehensively documents audit completion and feature implementation status across PM metadata files.

Changes

Event Validation and Feature Completion

Layer / File(s) Summary
Shared event validation message extraction
src/cli/commands/event-validation-messages.ts, src/cli/commands/create.ts, src/cli/commands/update.ts, tests/unit/create-command.spec.ts, tests/unit/update-command.spec.ts
New EVENT_END_AFTER_START_MESSAGE constant is imported and used by both create and update commands for consistent end-after-start validation messaging. Tests verify equal timestamp rejection with correct error text.
Calendar scheduled event source support
packages/pm-calendar/extensions/calendar/index.js, packages/pm-calendar/extensions/calendar/index.ts, src/cli/commands/completion.ts, tests/unit/completion-command.spec.ts, tests/integration/release-readiness-runtime.spec.ts
Calendar --include flag now accepts scheduled as a new event source type. Shell completion scripts (Zsh and Fish) are updated, and tests verify the new option appears in help and completion output.
Global options fallback and safer resolution
src/cli/registration-helpers.ts, tests/unit/registration-helpers.spec.ts
New CommandOptionsReader helper safely extracts option readers from command objects. getGlobalOptions now prefers optsWithGlobals() but falls back to opts() for commands lacking the extended method. Test suite covers fallback and explicit option precedence.
Conditional body field in changed_fields
src/cli/commands/create.ts, tests/unit/create-command.spec.ts
buildChangedFields now accepts body and conditionally includes "body" in changed_fields only when body is non-empty. Create flow passes body to helper for accurate field tracking.
PM audit and feature tracking
.agents/pm/chores/pm-5jw8.toon, .agents/pm/chores/pm-5k2w.toon, .agents/pm/features/pm-rnpb.toon, .agents/pm/issues/pm-h4zb.toon, .agents/pm/history/pm-5jw8.jsonl, .agents/pm/history/pm-5k2w.jsonl, .agents/pm/history/pm-h4zb.jsonl, .agents/pm/history/pm-rnpb.jsonl
Release verification metadata updated with test runs and completion status. Chore records extended with new test coverage and regression targets. Feature records document observability audit completion, Sentry issue resolution, telemetry queue draining, and privacy redaction of local ops credentials.

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% 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 accurately summarizes the two main objectives: hardening agent UX (create output, calendar alignment, event validation) and fixing Sentry global option handling via getGlobalOptions robustness.
Description check ✅ Passed The description is directly related to the changeset, detailing all five changes (body omission, calendar scheduling, event recovery, global options, sanitization) with verification steps and observability confirmation.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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.

Fix remaining safe pm-5k2w polish by omitting body from create changed_fields when no body was supplied, documenting the calendar scheduled include alias in package help/completions, and giving equal event start/end timestamps actionable recovery guidance.

Fix Sentry PM-CLI-T by making getGlobalOptions tolerate command-like extension objects without optsWithGlobals, with focused unit coverage.

Sanitize tracked pm evidence by removing private local-ops wording from pm-h4zb and pm-5jw8 current items/history through pm commands and history-redact.

Verification: focused regression suite passed (5 files, 208 tests); manual isolated temp smoke passed; pnpm build passed; pnpm quality:static passed; node scripts/check-secrets.mjs passed; node scripts/dogfood-package-first.mjs passed; node scripts/release/run-gates.mjs --telemetry-mode required --max-sentry-critical 10 --max-sentry-high 20 --max-telemetry-error-rate 10 --json passed with 97 files / 1408 tests and 100% coverage; Sentry PM-CLI-T resolved and unresolved issue list is empty.
@unbraind unbraind force-pushed the codex/pm-cli-extensive-polish-20260521 branch from b222cc8 to 56c60d7 Compare May 21, 2026 18:37
@unbraind unbraind marked this pull request as ready for review May 21, 2026 18:37
@unbraind
Copy link
Copy Markdown
Owner Author

@coderabbitai review
@sourcery-ai review

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey - I've found 1 issue, and left some high level feedback:

  • The new equal start/end validation message is duplicated in both parseEvents and parseEventEntries; consider extracting it into a shared constant to keep UX text consistent over time.
  • In getGlobalOptions, the broad command as Command & { ... } cast and runtime checks on optsWithGlobals/opts could be tightened by introducing a small CommandLike interface or type guard, which would make the fallback behavior clearer and easier to maintain.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The new equal start/end validation message is duplicated in both `parseEvents` and `parseEventEntries`; consider extracting it into a shared constant to keep UX text consistent over time.
- In `getGlobalOptions`, the broad `command as Command & { ... }` cast and runtime checks on `optsWithGlobals`/`opts` could be tightened by introducing a small `CommandLike` interface or type guard, which would make the fallback behavior clearer and easier to maintain.

## Individual Comments

### Comment 1
<location path="src/cli/commands/create.ts" line_range="1080" />
<code_context>
 }

-function buildChangedFields(frontMatter: ItemMetadata, explicitUnsets: string[]): string[] {
+function buildChangedFields(frontMatter: ItemMetadata, body: string, explicitUnsets: string[]): string[] {
   const changed = [
     ...FRONT_MATTER_KEY_ORDER.filter((key) => frontMatter[key] !== undefined),
-    "body",
+    ...(body.length > 0 ? ["body"] : []),
     ...explicitUnsets.map((key) => `unset:${key}`),
   ];
</code_context>
<issue_to_address>
**suggestion (bug_risk):** Revisit how an empty or whitespace-only body is treated when computing changed fields.

Previously, `"body"` was always in `changedFields`, even when empty. Now it’s only added when `body.length > 0`, which changes semantics for callers that explicitly clear the body. If you only want to treat non-whitespace content as a change, consider `body.trim().length > 0`. If you instead want to preserve the old behavior while omitting `"body"` when it was never provided, this condition likely needs to depend on how the body was sourced (explicit vs default), not just its length.

```suggestion
    // Treat only non-whitespace body content as a change
    ...(body.trim().length > 0 ? ["body"] : []),
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

const changed = [
...FRONT_MATTER_KEY_ORDER.filter((key) => frontMatter[key] !== undefined),
"body",
...(body.length > 0 ? ["body"] : []),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

suggestion (bug_risk): Revisit how an empty or whitespace-only body is treated when computing changed fields.

Previously, "body" was always in changedFields, even when empty. Now it’s only added when body.length > 0, which changes semantics for callers that explicitly clear the body. If you only want to treat non-whitespace content as a change, consider body.trim().length > 0. If you instead want to preserve the old behavior while omitting "body" when it was never provided, this condition likely needs to depend on how the body was sourced (explicit vs default), not just its length.

Suggested change
...(body.length > 0 ? ["body"] : []),
// Treat only non-whitespace body content as a change
...(body.trim().length > 0 ? ["body"] : []),

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 21, 2026

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Get PR details and diff
gh pr view 38 --repo unbraind/pm-cli --json title,body,files,additions,deletions,changedFiles
echo "---DIFF---"
gh pr diff 38 --repo unbraind/pm-cli

Length of output: 117623


🏁 Script executed:

#!/bin/bash
# Check if there's a bash completion section for calendar --include that might also need 'scheduled'
rg -n "include.*deadlines|include.*calendar|bash.*calendar|calendar.*bash" src/cli/commands/completion.ts | head -30
echo "---"
# Also check the full context around bash completion for --include
rg -n "deadlines reminders events" src/cli/commands/completion.ts

Length of output: 508


🏁 Script executed:

#!/bin/bash
# Check for bash completion section for calendar
rg -n "bash|BASH|_pm_complete|case.*calendar|calendar.*case" src/cli/commands/completion.ts | head -30
echo "---BASH INCLUDE CHECK---"
# Look for the bash section around calendar include flag
rg -n -A3 -B3 "include.*event|all deadlines" src/cli/commands/completion.ts
echo "---TOTAL SECTIONS---"
# Count how many completion script generators exist (bash/zsh/fish)
rg -n "^function generate|^export function generate|generateBash|generateZsh|generateFish" src/cli/commands/completion.ts

Length of output: 2458


🏁 Script executed:

#!/bin/bash
# Look at the bash completion section for calendar to check if --include needs 'scheduled' there too
sed -n '90,293p' src/cli/commands/completion.ts | grep -n "include\|calendar\|deadlines\|reminders"
echo "---FULL BASH CALENDAR SECTION---"
# Extract the bash script generator and look for calendar-related completions
rg -n "include\|calendar\|deadlines\|reminders\|events\|scheduled" src/cli/commands/completion.ts | grep -v "^664:\|^1439:"

Length of output: 865


@unbraind: Here is the review of PR #38.


Review Summary

The PR is well-structured and thoroughly verified. Five distinct areas are changed — all with regression tests. No critical issues were found.


src/cli/registration-helpers.ts — Sentry PM-CLI-T crash fix ✅

The fallback chain optsWithGlobals → opts → {} is the right defensive strategy. When the fully-empty {} branch is hit, the returned GlobalOptions will have path: undefined, json: undefined, etc. — which is a safe default since callers downstream handle these as optional. The implementation is clean.


src/cli/commands/create.ts + update.ts — equal event timestamp guidance ✅

The improved error message ("equal start/end timestamps are invalid. Omit end for an instant event or set end later than start.") is clearly actionable. Both parseEvents (create) and parseEventEntries (update) are updated in sync.


src/cli/commands/create.tsbuildChangedFields body omission ✅

...(body.length > 0 ? ["body"] : []),

body is typed as string and the caller passes body directly, so the .length check is safe. The signature change (body: string added as second parameter) is correctly threaded through the single call site at the bottom of runCreate.


packages/pm-calendar + completion.tsscheduled alias alignment ✅

Both .ts and compiled .js in the calendar package are updated together. Zsh (line 664) and fish (line 1439) completions both receive scheduled. The bash completion generator (generateBashScript) uses a compgen-based approach that only completes flag names, not their enumerated values — so no bash change is needed, and nothing was missed.


tests/unit/registration-helpers.spec.ts — new file ⚠️ Minor nit

The first test's name is slightly misleading:

it("uses resolved global options when command-like objects lack commander globals", () => {
  const command = { opts: () => ({ json: true, quiet: true, path: ".pm" }) } as unknown as Command;
  // ...

No resolved globals are set here — this is testing the opts() fallback path, not the setResolvedGlobalOptions path (which is covered by the second test). Consider renaming to something like "falls back to opts() for command-like objects without optsWithGlobals" to make the two test cases clearly distinct.


.agents/pm/ — history/metadata sanitization ✅

The history_redact entries are no-ops (before_hash === after_hash) as expected for redaction events that only rewrote earlier entries, with the subsequent docs_add/update_audit operations carrying the actual sanitized data. The diff in pm-h4zb.jsonl and pm-5jw8.jsonl is consistent with the PR objective of removing private local-ops wording from tracked evidence.


Overall: The implementation is correct, all five fixes are independently tested, 100% coverage is maintained per the release gate evidence, and the Sentry issue is confirmed resolved. The one actionable item is the minor test name nit above — up to you whether to rename before merging.

Centralize event timestamp recovery text so create and update stay aligned, tighten the command option fallback helper used by getGlobalOptions, and rename the fallback test for clarity.

Documented the review response and verification evidence in pm-5k2w. Verification: focused 5-file suite passed with 208 tests and pnpm build passed.
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request implements several CLI polish items and bug fixes. It adds a scheduled option to the calendar command's --include flag and updates shell completions accordingly. The create command was updated to avoid reporting body in changed_fields when it is empty, and error messages for invalid event timestamps were made more descriptive. Additionally, a fallback was added to getGlobalOptions to prevent crashes when optsWithGlobals is unavailable. Review feedback suggests simplifying the implementation of this fallback using optional chaining.

I am having trouble creating individual review comments. Click here to see my feedback.

src/cli/registration-helpers.ts (62-70)

medium

The logic for retrieving options can be simplified using optional chaining and the nullish coalescing operator, which improves readability and reduces verbosity.

const opts = (command as any).optsWithGlobals?.() ?? (command as any).opts?.() ?? {};

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 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/history/pm-rnpb.jsonl:
- Around line 429-441: The commit directly modified the system-of-record file
.agents/pm/history/pm-rnpb.jsonl (entries added/replaced) which violates the
rule that .agents/pm/** must be updated only via the pm command; revert these
direct edits to pm-rnpb.jsonl to the prior state and remove the patch/appended
entries, then reapply any needed changes by running the approved CLI flow (pm
<appropriate subcommand> or the documented pm workflow) so the system properly
updates metadata/comments/files/tests; specifically restore the previous
pm-rnpb.jsonl content and perform the updates via the pm command rather than
editing .agents/pm/history/pm-rnpb.jsonl manually.

In @.agents/pm/issues/pm-h4zb.toon:
- Around line 2-3: This change directly edited the system-of-record `.agents/pm`
entry (`.agents/pm/issues/pm-h4zb.toon`) which is forbidden; revert the manual
edits and reapply the intended updates by running the PM workflow/tooling (use
the PM commands that generate `.agents/pm` artifacts), regenerate the files so
the modified content (the hardened secret-scan rules and local-only note) is
produced by the toolchain, and commit the generated artifacts instead of
hand-editing—also ensure any related lines referenced (lines around 9-15 and 21)
are handled through the same PM tooling rather than manual changes.
🪄 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: 665133b2-fe6f-4eb9-8560-61340bcf4f01

📥 Commits

Reviewing files that changed from the base of the PR and between 5fa8e57 and 7998323.

📒 Files selected for processing (20)
  • .agents/pm/chores/pm-5jw8.toon
  • .agents/pm/chores/pm-5k2w.toon
  • .agents/pm/features/pm-rnpb.toon
  • .agents/pm/history/pm-5jw8.jsonl
  • .agents/pm/history/pm-5k2w.jsonl
  • .agents/pm/history/pm-h4zb.jsonl
  • .agents/pm/history/pm-rnpb.jsonl
  • .agents/pm/issues/pm-h4zb.toon
  • packages/pm-calendar/extensions/calendar/index.js
  • packages/pm-calendar/extensions/calendar/index.ts
  • src/cli/commands/completion.ts
  • src/cli/commands/create.ts
  • src/cli/commands/event-validation-messages.ts
  • src/cli/commands/update.ts
  • src/cli/registration-helpers.ts
  • tests/integration/release-readiness-runtime.spec.ts
  • tests/unit/completion-command.spec.ts
  • tests/unit/create-command.spec.ts
  • tests/unit/registration-helpers.spec.ts
  • tests/unit/update-command.spec.ts

Comment on lines +429 to +441
{"ts":"2026-05-21T18:12:21.032Z","author":"codex-extensive-audit","op":"claim","patch":[{"op":"replace","path":"/metadata/updated_at","value":"2026-05-21T18:12:21.032Z"},{"op":"add","path":"/metadata/assignee","value":"codex-extensive-audit"}],"before_hash":"0ac9b985ff20cf811dc82d5b031261929b51ab3fdae17649ae09e6bd8f3ce0ac","after_hash":"ee886a9fe164eb1fd157a3a4a3eeb493abc7eb855e051e63782fd6bce78c06c0","message":"Continue latest extensive audit/remediation pass with sub-agent lanes, temp-project manual dogfood, telemetry/Sentry review, PR/CI follow-through."}
{"ts":"2026-05-21T18:12:38.387Z","author":"codex-extensive-audit","op":"comment_add","patch":[{"op":"add","path":"/metadata/comments/163","value":{"created_at":"2026-05-21T18:12:38.387Z","author":"codex-extensive-audit","text":"Execution plan 2026-05-21: reuse pm-rnpb parent and pm-5k2w child after duplicate checks; use sub-agent lanes for privacy/history scan plus observability/GitHub review; locally implement remaining safe pm-5k2w agent-UX/token-efficiency fixes; verify with focused tests, secret scan, temp-project dogfood, health/validate, Sentry/telemetry gates, PR checks, AI review wait, review fixes, and merge only if green."}},{"op":"replace","path":"/metadata/updated_at","value":"2026-05-21T18:12:38.387Z"}],"before_hash":"ee886a9fe164eb1fd157a3a4a3eeb493abc7eb855e051e63782fd6bce78c06c0","after_hash":"aafa063831032882823391299bf52c75fd11030dcb2d9e7d3930a7c862e16d7a"}
{"ts":"2026-05-21T18:13:32.401Z","author":"codex-observability-review","op":"comment_add","patch":[{"op":"add","path":"/metadata/comments/164","value":{"created_at":"2026-05-21T18:13:32.401Z","author":"codex-observability-review","text":"Investigation note: starting no-edit observability/GitHub review lane. Bootstrap passed: npm install -g . was up to date, pm --version 2026.5.18, node v25.9.0, pnpm 10.33.0, pnpm build passed. Orientation reused parent pm-rnpb; no new pm items created."}},{"op":"replace","path":"/metadata/updated_at","value":"2026-05-21T18:13:32.401Z"}],"before_hash":"aafa063831032882823391299bf52c75fd11030dcb2d9e7d3930a7c862e16d7a","after_hash":"9998c41756e25997f644d1bea2fd9994516d67216c4f863c12d1b135d2d15a57"}
{"ts":"2026-05-21T18:16:00.929Z","author":"codex-observability-review","op":"comment_add","patch":[{"op":"add","path":"/metadata/comments/165","value":{"created_at":"2026-05-21T18:16:00.929Z","author":"codex-observability-review","text":"Observability/GitHub review evidence 2026-05-21: GitHub via gh has no open PRs and no open issues. Latest main CI run 26243975511 on 5fa8e579 passed; recent scheduled Nightly Validation run 26213241053 failed only on Windows Node 20 in tests/unit/check-secrets.spec.ts with SyntaxError, but later main CI passed on newer HEAD, so treat as stale unless it repeats. Sentry CLI is reachable: unresolved issues show one high-priority group PM-CLI-T (command.optsWithGlobals is not a function, getGlobalOptions path, first/last seen 2026-05-21T04:28Z, count 1); last-24h also includes resolved PM-CLI-R and PM-CLI-S. Repo sentry/telemetry gate in best-effort mode passes with Sentry critical=0 high=1 total=1, but required telemetry freshness is blocked because ignored private telemetry SSH target is unreachable; public telemetry endpoint/health probe returns upstream-origin error and pm health reports telemetry_queue_pending:57. Actionable blockers: investigate PM-CLI-T extension command global option handling, restore private telemetry stack reachability/origin health, and rerun required telemetry gate after stack recovery. Sensitive host details intentionally omitted."}},{"op":"replace","path":"/metadata/updated_at","value":"2026-05-21T18:16:00.929Z"}],"before_hash":"9998c41756e25997f644d1bea2fd9994516d67216c4f863c12d1b135d2d15a57","after_hash":"61eff56461342863b4bbe9ea401bc059b50c5f589e6e9c06aba9c946667cf553"}
{"ts":"2026-05-21T18:17:29.463Z","author":"codex-extensive-audit","op":"files_add","patch":[{"op":"replace","path":"/metadata/files/92/note","value":"update event date alias regression"},{"op":"replace","path":"/metadata/files/92/path","value":"tests/unit/update-command.spec.ts"},{"op":"replace","path":"/metadata/files/91/note","value":"regression for nested sentry event scrub behavior"},{"op":"replace","path":"/metadata/files/91/path","value":"tests/unit/sentry-helpers.spec.ts"},{"op":"replace","path":"/metadata/files/90/note","value":"qwen Ollama model preference regression"},{"op":"replace","path":"/metadata/files/90/path","value":"tests/unit/semantic-defaults.spec.ts"},{"op":"replace","path":"/metadata/files/89/note","value":"unit coverage for semantic corpus helper branches"},{"op":"replace","path":"/metadata/files/89/path","value":"tests/unit/search-corpus.spec.ts"},{"op":"replace","path":"/metadata/files/88/note","value":"regression for reminder/event search matches"},{"op":"replace","path":"/metadata/files/88/path","value":"tests/unit/search-command.spec.ts"},{"op":"replace","path":"/metadata/files/87/note","value":"regression for bounded semantic refresh corpus input"},{"op":"replace","path":"/metadata/files/87/path","value":"tests/unit/search-cache.spec.ts"},{"op":"replace","path":"/metadata/files/86/note","value":"direct package runtime coverage"},{"op":"replace","path":"/metadata/files/86/path","value":"tests/unit/search-advanced-runtime.spec.ts"},{"op":"replace","path":"/metadata/files/85/note","value":"regression for malformed config token normalization"},{"op":"replace","path":"/metadata/files/85/path","value":"tests/unit/runtime-schema-command-flags.spec.ts"},{"op":"replace","path":"/metadata/files/84/note","value":"PM-CLI-T regression coverage"},{"op":"replace","path":"/metadata/files/84/path","value":"tests/unit/registration-helpers.spec.ts"},{"op":"add","path":"/metadata/files/93","value":{"path":"vitest.config.ts","scope":"project","note":"coverage include list covers new search corpus helper"}},{"op":"replace","path":"/metadata/updated_at","value":"2026-05-21T18:17:29.463Z"}],"before_hash":"61eff56461342863b4bbe9ea401bc059b50c5f589e6e9c06aba9c946667cf553","after_hash":"c38712ef7a78fc74591a1b8f32b5d57cb47a6aba6033968c306310cb57bcc56f"}
{"ts":"2026-05-21T18:17:29.579Z","author":"codex-extensive-audit","op":"tests_add","patch":[{"op":"replace","path":"/metadata/tests/45/note","value":"docs and skills gate"},{"op":"replace","path":"/metadata/tests/45/command","value":"pnpm quality:docs-skills"},{"op":"replace","path":"/metadata/tests/44/note","value":"focused init defaults integration regression"},{"op":"replace","path":"/metadata/tests/44/timeout_seconds","value":120},{"op":"replace","path":"/metadata/tests/44/command","value":"pnpm exec vitest run tests/integration/cli.integration.spec.ts -t 'accepts agent-friendly non-interactive init defaults and author'"},{"op":"replace","path":"/metadata/tests/43/note","value":"focused typecheck after schema changes"},{"op":"replace","path":"/metadata/tests/43/timeout_seconds","value":300},{"op":"replace","path":"/metadata/tests/43/command","value":"pnpm exec tsc --noEmit -p tsconfig.json"},{"op":"replace","path":"/metadata/tests/42/note","value":"full remediation verification gate"},{"op":"replace","path":"/metadata/tests/42/timeout_seconds","value":1200},{"op":"replace","path":"/metadata/tests/42/command","value":"pnpm build && node scripts/run-tests.mjs coverage && pnpm quality:static && node scripts/check-secrets.mjs"},{"op":"replace","path":"/metadata/tests/41/note","value":"compile CLI after health/help/dogfood changes"},{"op":"replace","path":"/metadata/tests/41/timeout_seconds","value":300},{"op":"replace","path":"/metadata/tests/41/command","value":"pnpm build"},{"op":"replace","path":"/metadata/tests/40/note","value":"focused dependency/UX/Sentry regression suite"},{"op":"replace","path":"/metadata/tests/40/timeout_seconds","value":600},{"op":"replace","path":"/metadata/tests/40/command","value":"PM_RUN_TESTS_SKIP_BUILD=1 node scripts/run-tests.mjs test -- tests/unit/search-command.spec.ts tests/unit/status-normalization.spec.ts tests/unit/extension-command.spec.ts tests/unit/contracts-command.spec.ts tests/unit/error-guidance.spec.ts"},{"op":"replace","path":"/metadata/tests/39/note","value":"focused Sentry crash and package contract hint regression suite"},{"op":"replace","path":"/metadata/tests/39/timeout_seconds","value":300},{"op":"replace","path":"/metadata/tests/39/command","value":"PM_RUN_TESTS_SKIP_BUILD=1 node scripts/run-tests.mjs test -- tests/unit/search-command.spec.ts tests/unit/runtime-schema-command-flags.spec.ts tests/unit/contracts-command.spec.ts"},{"op":"replace","path":"/metadata/tests/38/note","value":"focused package docs search UX regressions"},{"op":"replace","path":"/metadata/tests/38/timeout_seconds","value":900},{"op":"replace","path":"/metadata/tests/38/command","value":"PM_RUN_TESTS_SKIP_BUILD=1 node scripts/run-tests.mjs test -- tests/unit/search-cache.spec.ts tests/unit/extension-command.spec.ts tests/integration/help-runtime.spec.ts"},{"op":"replace","path":"/metadata/tests/37/note","value":"SDK workspace contracts,Plan fields,search-advanced package regression"},{"op":"replace","path":"/metadata/tests/37/command","value":"PM_RUN_TESTS_SKIP_BUILD=1 node scripts/run-tests.mjs test -- tests/unit/sdk-index.spec.ts tests/unit/plan-command.spec.ts tests/integration/release-readiness-runtime.spec.ts"},{"op":"replace","path":"/metadata/tests/36/note","value":"focused SDK and Plan projection regression"},{"op":"replace","path":"/metadata/tests/36/timeout_seconds","value":240},{"op":"replace","path":"/metadata/tests/36/command","value":"PM_RUN_TESTS_SKIP_BUILD=1 node scripts/run-tests.mjs test -- tests/unit/sdk-index.spec.ts tests/unit/plan-command.spec.ts"},{"op":"replace","path":"/metadata/tests/35/note","value":"focused SDK contracts search-advanced regression"},{"op":"replace","path":"/metadata/tests/35/timeout_seconds","value":900},{"op":"replace","path":"/metadata/tests/35/command","value":"PM_RUN_TESTS_SKIP_BUILD=1 node scripts/run-tests.mjs test -- tests/unit/sdk-index.spec.ts tests/unit/contracts-command.spec.ts tests/unit/search-advanced-runtime.spec.ts tests/integration/release-readiness-runtime.spec.ts"},{"op":"replace","path":"/metadata/tests/34/note","value":"SDK runtime contracts regression"},{"op":"replace","path":"/metadata/tests/34/timeout_seconds","value":300},{"op":"replace","path":"/metadata/tests/34/command","value":"PM_RUN_TESTS_SKIP_BUILD=1 node scripts/run-tests.mjs test -- tests/unit/sdk-index.spec.ts tests/unit/contracts-command.spec.ts"},{"op":"replace","path":"/metadata/tests/33/note","value":"focused PM-CLI-T and pm-5k2w UX regressions"},{"op":"replace","path":"/metadata/tests/33/timeout_seconds","value":900},{"op":"replace","path":"/metadata/tests/33/command","value":"PM_RUN_TESTS_SKIP_BUILD=1 node scripts/run-tests.mjs test -- tests/unit/registration-helpers.spec.ts tests/unit/create-command.spec.ts tests/unit/update-command.spec.ts tests/unit/completion-command.spec.ts tests/integration/release-readiness-runtime.spec.ts --reporter=dot"},{"op":"add","path":"/metadata/tests/46","value":{"command":"pnpm quality:static","scope":"project","timeout_seconds":300,"note":"static quality gate"}},{"op":"replace","path":"/metadata/updated_at","value":"2026-05-21T18:17:29.579Z"}],"before_hash":"c38712ef7a78fc74591a1b8f32b5d57cb47a6aba6033968c306310cb57bcc56f","after_hash":"04bcf15adb9318eb5b0208fb7f44c26afb648c299658b7eb00d34952d7ea849e"}
{"ts":"2026-05-21T18:18:21.256Z","author":"codex-extensive-audit","op":"comment_add","patch":[{"op":"add","path":"/metadata/comments/166","value":{"created_at":"2026-05-21T18:18:21.256Z","author":"codex-extensive-audit","text":"Evidence update: focused regression suite passed after PM-CLI-T and pm-5k2w fixes: PM_RUN_TESTS_SKIP_BUILD=1 node scripts/run-tests.mjs test -- tests/unit/registration-helpers.spec.ts tests/unit/create-command.spec.ts tests/unit/update-command.spec.ts tests/unit/completion-command.spec.ts tests/integration/release-readiness-runtime.spec.ts --reporter=dot (5 files, 208 tests). Privacy lane found no raw secrets/private keys/private IP/user@host leaks; sanitized private local-ops wording from pm-h4zb and pm-5jw8 item/history using pm update, pm docs, and pm history-redact."}},{"op":"replace","path":"/metadata/updated_at","value":"2026-05-21T18:18:21.256Z"}],"before_hash":"04bcf15adb9318eb5b0208fb7f44c26afb648c299658b7eb00d34952d7ea849e","after_hash":"fe57189895dcf0bba31f729f078b1ff0261941b667d4c9c3e8406845867ff69f"}
{"ts":"2026-05-21T18:19:29.415Z","author":"codex-extensive-audit","op":"comment_add","patch":[{"op":"add","path":"/metadata/comments/167","value":{"created_at":"2026-05-21T18:19:29.415Z","author":"codex-extensive-audit","text":"Verification update: pnpm build passed, pnpm quality:static passed, node scripts/check-secrets.mjs passed, and manual isolated temp smoke passed after installing calendar + guide-shell. The initial manual smoke also validated optional-package guidance by failing completion before guide-shell install with an install hint."}},{"op":"replace","path":"/metadata/updated_at","value":"2026-05-21T18:19:29.415Z"}],"before_hash":"fe57189895dcf0bba31f729f078b1ff0261941b667d4c9c3e8406845867ff69f","after_hash":"133957f97c803040057a4356723bfbb44b5d77be98c4a88639afeaee9b0a57a6"}
{"ts":"2026-05-21T18:20:20.705Z","author":"codex-extensive-audit","op":"comment_add","patch":[{"op":"add","path":"/metadata/comments/168","value":{"created_at":"2026-05-21T18:20:20.705Z","author":"codex-extensive-audit","text":"Verification update: node scripts/dogfood-package-first.mjs passed in isolated temp project with 84 workflows. Slowest expected command was linked test run; create/close/release/docs/claim remained functional. Running full release gate with required telemetry next."}},{"op":"replace","path":"/metadata/updated_at","value":"2026-05-21T18:20:20.705Z"}],"before_hash":"133957f97c803040057a4356723bfbb44b5d77be98c4a88639afeaee9b0a57a6","after_hash":"6295c3ba4de3ec13f7ab931f0618271d50ed21ccb1a31b9cc349e19f1da99a95"}
{"ts":"2026-05-21T18:20:22.085Z","author":"codex-extensive-audit","op":"tests_add","patch":[{"op":"replace","path":"/metadata/updated_at","value":"2026-05-21T18:20:22.085Z"}],"before_hash":"6295c3ba4de3ec13f7ab931f0618271d50ed21ccb1a31b9cc349e19f1da99a95","after_hash":"ae3a93659a1c9ac0f7455ae2051b987bc45dab9267a84d4d111db9232d849682"}
{"ts":"2026-05-21T18:25:20.991Z","author":"codex-extensive-audit","op":"comment_add","patch":[{"op":"add","path":"/metadata/comments/169","value":{"created_at":"2026-05-21T18:25:20.991Z","author":"codex-extensive-audit","text":"Release gate evidence: node scripts/release/run-gates.mjs --telemetry-mode required --max-sentry-critical 10 --max-sentry-high 20 --max-telemetry-error-rate 10 --json passed. Coverage: 97 files / 1408 tests, 100 percent statements/branches/functions/lines. Gate checks passed: build, typecheck, docs-skills, static quality, version policy, secret scan, npx packed smoke, package-first dogfood 84 workflows, npm pack dry-run, compatibility, and Sentry/telemetry required gate (Sentry critical=0 high=1 total=1 under threshold; telemetry finish_error_rate_pct=3.27, missing error-code rows=0)."}},{"op":"replace","path":"/metadata/updated_at","value":"2026-05-21T18:25:20.991Z"}],"before_hash":"ae3a93659a1c9ac0f7455ae2051b987bc45dab9267a84d4d111db9232d849682","after_hash":"5b2fd7c97ae30798518c42f8a8df1feb957adfba4dfd4c176a181edcaa3d2369"}
{"ts":"2026-05-21T18:25:22.009Z","author":"codex-extensive-audit","op":"tests_add","patch":[{"op":"replace","path":"/metadata/updated_at","value":"2026-05-21T18:25:22.009Z"}],"before_hash":"5b2fd7c97ae30798518c42f8a8df1feb957adfba4dfd4c176a181edcaa3d2369","after_hash":"3b9af761103161e3bc084e3c3d7ae0259d512c80e9a80525f67837bb25671d20"}
{"ts":"2026-05-21T18:25:44.947Z","author":"codex-extensive-audit","op":"comment_add","patch":[{"op":"add","path":"/metadata/comments/170","value":{"created_at":"2026-05-21T18:25:44.947Z","author":"codex-extensive-audit","text":"Observability closeout: Sentry PM-CLI-T was fixed with getGlobalOptions fallback coverage and resolved via sentry CLI; sentry issue list --query is:unresolved now returns no unresolved issues. pm health --check-only --brief --json is ok with no warnings; telemetry queue is draining with recent successful flush at 2026-05-21T18:25:22.812Z and no failed flush."}},{"op":"replace","path":"/metadata/updated_at","value":"2026-05-21T18:25:44.947Z"}],"before_hash":"3b9af761103161e3bc084e3c3d7ae0259d512c80e9a80525f67837bb25671d20","after_hash":"c08a99a1a8220517726146963e90fcf95d5dbc9fe23a9c2c7368b93e731096fa"}
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 | 🟠 Major | ⚡ Quick win

Do not commit direct edits under .agents/pm system-of-record files.

These appended history entries directly modify .agents/pm/history/pm-rnpb.jsonl, which violates repository process rules. Please revert these direct file edits and apply updates only through the approved pm command flow that manages system-of-record artifacts.

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-rnpb.jsonl around lines 429 - 441, The commit directly
modified the system-of-record file .agents/pm/history/pm-rnpb.jsonl (entries
added/replaced) which violates the rule that .agents/pm/** must be updated only
via the pm command; revert these direct edits to pm-rnpb.jsonl to the prior
state and remove the patch/appended entries, then reapply any needed changes by
running the approved CLI flow (pm <appropriate subcommand> or the documented pm
workflow) so the system properly updates metadata/comments/files/tests;
specifically restore the previous pm-rnpb.jsonl content and perform the updates
via the pm command rather than editing .agents/pm/history/pm-rnpb.jsonl
manually.

Comment on lines +2 to +3
title: Harden secret-scan guardrail for GitHub token prefixes and local credential hygiene
description: "A privacy re-audit confirmed the public shipping surface is clean and identified scanner coverage gaps for additional GitHub token prefixes plus a local-only ignored operations note that needed credential hygiene. The implementation broadened scanner coverage, made the rules unit-testable, and removed the local plaintext credential reference without tracking private operations details."
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 | 🟠 Major | ⚡ Quick win

Do not directly modify .agents/pm records.

This file was edited directly, but .agents/pm is designated as the system of record and must be updated via the PM workflow/tooling instead of manual file edits. Please regenerate these changes through the PM commands and commit the resulting artifacts.

As per coding guidelines, .agents/pm/**: pm is the system of record. Do not edit .agents/pm files directly.

Also applies to: 9-15, 21-21

🤖 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/issues/pm-h4zb.toon around lines 2 - 3, This change directly
edited the system-of-record `.agents/pm` entry
(`.agents/pm/issues/pm-h4zb.toon`) which is forbidden; revert the manual edits
and reapply the intended updates by running the PM workflow/tooling (use the PM
commands that generate `.agents/pm` artifacts), regenerate the files so the
modified content (the hardened secret-scan rules and local-only note) is
produced by the toolchain, and commit the generated artifacts instead of
hand-editing—also ensure any related lines referenced (lines around 9-15 and 21)
are handled through the same PM tooling rather than manual changes.

@unbraind
Copy link
Copy Markdown
Owner Author

Review follow-up: I reviewed Gemini Code Assist suggestion to simplify getGlobalOptions with optional chaining and any casts. I am keeping the explicit CommandOptionsReader helper because it addresses Sourcery’s maintainability feedback without reintroducing any, while preserving the same fallback behavior. No code change needed.

@unbraind
Copy link
Copy Markdown
Owner Author

Review follow-up on remaining comments: Sourcery body changed_fields comment was checked and intentionally left as body.length because this fix only omits the default empty body; explicit whitespace body content remains user-supplied content. CodeRabbit .agents/pm findings are false positives: pm-rnpb entries were generated by pm CLI operations during this run, and pm-h4zb was generated via history-redact plus update-audit; pm history pm-h4zb --verify reports ok=true. I did not revert valid system-of-record history.

Record the green post-feedback CI run, bot review disposition, and release the active pm claims for pm-5k2w and pm-rnpb through the pm CLI.
@unbraind unbraind merged commit 6c924a4 into main May 21, 2026
10 checks passed
@unbraind unbraind deleted the codex/pm-cli-extensive-polish-20260521 branch May 21, 2026 19:10
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