Improve agent token UX and blocked dependency handling#37
Conversation
Implement MCP comment paging metadata, add health --summary output, and derive create --blocked-by dependency edges for existing item ids. Also redact approved legacy pm history topology details via pm history-redact and record pm evidence.
Reviewer's GuideAdds token-efficient pm_comments defaults with paging metadata, introduces a summary-focused pm health projection and CLI flag, derives real blocked_by dependency edges from create --blocked-by when referencing existing items (while preserving free-text usage), and updates agent histories/evidence for redaction and validation. Sequence diagram for updated pm_comments MCP tool defaultssequenceDiagram
actor Agent
participant McpServer as McpServer.runAction
participant Comments as runComments
Agent->>McpServer: invoke pm_comments (no add/stdin/file)
McpServer->>McpServer: detect isListing
McpServer->>McpServer: set commentOptions.includeMeta = true
McpServer->>McpServer: default commentOptions.limit = "20" (if undefined and full !== true)
McpServer->>McpServer: delete commentOptions.full
McpServer->>Comments: runComments(id, commentOptions, global)
Comments->>Comments: limitComments(allComments, limit)
Comments-->>McpServer: {comments, count, total_count, returned_count, has_more, limit}
McpServer-->>Agent: paged comment list with metadata
Sequence diagram for pm health --summary projectionsequenceDiagram
actor User
participant Cli as healthCommand
participant Health as runHealth
participant Summary as applySummaryHealthProjection
User->>Cli: pm health --summary --check-only
Cli->>Health: runHealth(global, {summary: true, checkOnly: true})
Health->>Health: compute checks and warnings
Health->>Health: summaryMode = options.summary && !options.full
Health->>Summary: applySummaryHealthProjection(result)
Summary->>Summary: summarizeStringList(result.warnings, BRIEF_HEALTH_DETAIL_LIMIT)
Summary->>Summary: filter isSkippedHealthCheck
Summary-->>Health: summaryResult {checks, warning_count, projection.omitted_checks}
Health-->>Cli: HealthResult with mode summary
Cli-->>User: concise health status with check names and warning count
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Warning Rate limit exceeded
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 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 configurationConfiguration used: Repository UI (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (8)
📝 WalkthroughWalkthroughThis PR completes three features that improve the pm-cli: comments pagination with token-efficient defaults and text-prefix parsing, a new health summary projection mode that omits expensive checks, and create command support for --blocked-by item references with automatic dependency edge derivation. ChangesFeature Implementation
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="src/cli/commands/comments.ts" line_range="150-156" />
<code_context>
}
const loaded = await readLocatedItem(located, { schema: settings.schema });
- const comments = limitComments(loaded.document.metadata.comments ?? [], limit);
+ const allComments = loaded.document.metadata.comments ?? [];
+ const comments = limitComments(allComments, limit);
return {
id: located.id,
comments,
count: comments.length,
+ ...(options.includeMeta === true
+ ? {
+ total_count: allComments.length,
</code_context>
<issue_to_address>
**issue (bug_risk):** The `limit` field in `CommentsResult` is typed as a number but is now populated with a string value.
`limit` is passed from the CLI as a string (e.g. "20"), but `CommentsResult` defines `limit?: number;`. This mismatch can break static typing and surprise consumers expecting a numeric field.
Please either convert `limit` to a number before using/returning it (ideally where `limitComments` is called) or change the type to `string | number` if preserving the original string is required.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| const allComments = loaded.document.metadata.comments ?? []; | ||
| const comments = limitComments(allComments, limit); | ||
| return { | ||
| id: located.id, | ||
| comments, | ||
| count: comments.length, | ||
| ...(options.includeMeta === true |
There was a problem hiding this comment.
issue (bug_risk): The limit field in CommentsResult is typed as a number but is now populated with a string value.
limit is passed from the CLI as a string (e.g. "20"), but CommentsResult defines limit?: number;. This mismatch can break static typing and surprise consumers expecting a numeric field.
Please either convert limit to a number before using/returning it (ideally where limitComments is called) or change the type to string | number if preserving the original string is required.
There was a problem hiding this comment.
Actionable comments posted: 6
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/sdk/cli-contracts.ts (1)
982-993:⚠️ Potential issue | 🟠 Major | ⚡ Quick winKeep health schema in sync with new
--summaryflag.
HEALTH_FLAG_CONTRACTSnow includes--summary, butPM_TOOL_ACTION_SCHEMA_CONTRACTS.health.optionalstill excludes"summary". This creates a CLI/contracts mismatch for strict schema consumers.Proposed fix
@@ health: { optional: [ "strictDirectories", "strictExit", "failOnWarn", "checkOnly", "checkTelemetry", "noRefresh", "refreshVectors", "verboseStaleItems", + "summary", "skipVectors", "skipIntegrity", "skipDrift", "full", ], },🤖 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 982 - 993, HEALTH_FLAG_CONTRACTS now includes the "--summary" flag but the health schema in PM_TOOL_ACTION_SCHEMA_CONTRACTS.health.optional does not include "summary", causing a mismatch; update PM_TOOL_ACTION_SCHEMA_CONTRACTS.health.optional to include "summary" (matching the flag name used in HEALTH_FLAG_CONTRACTS) so the CLI flag list and schema remain consistent, and run the unit/schema validation to ensure no other flags are out of sync.
🤖 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/features/pm-rnpb.toon:
- Line 9: The PR directly modified the system-of-record file
.agents/pm/features/pm-rnpb.toon (updated_at value) which violates the
`.agents/pm/**` policy; instead revert this direct change and perform the
state/evidence update via the pm command path (use the pm CLI or service API
that manages PM feature state) so the pm service updates updated_at and related
fields atomically; locate changes touching pm-rnpb.toon and any other
`.agents/pm/**` entries (also referenced at the other occurrences) and re-apply
those updates through the pm command(s) that update feature state/evidence
(e.g., the pm update/patch endpoint or pm CLI subcommand) rather than committing
file edits.
In @.agents/pm/history/pm-orrl.jsonl:
- Around line 2-12: The PR modified the system-of-record history file
.agents/pm/history/pm-orrl.jsonl directly; revert those direct edits and
re-apply the changes through the pm workflow/commands instead (do not edit
.agents/pm/** files by hand). Restore the file to its original state, then run
the appropriate pm commands (e.g., the pm CLI flow that implements "pm create
--blocked-by" semantics referenced in metadata/resolution) to produce the
intended metadata/patch updates so the history is recorded by the
system-of-record; ensure any intended changes to metadata fields like
metadata/updated_at, metadata/status, metadata/comments, metadata/files,
metadata/tests, and metadata/close_reason are created via pm commands rather
than manual file edits.
In @.agents/pm/history/pm-rnpb.jsonl:
- Line 425: The audit comment at metadata/comments/159 (value.text) contains
dropped tokens making evidence ambiguous—restore the missing values or replace
them with explicit placeholders; update the string so "stale habit failed"
becomes "stale habit <old_value> failed" (or the actual old value), "replacement
is ," becomes "replacement is <new_value>" (or the discovered runtime value),
and ensure the clause about allowed values clearly includes
"brief|standard|deep"; edit the entry in .agents/pm/history/pm-rnpb.jsonl at
metadata/comments/159 to include these non-empty concrete values or explicit
placeholder tokens to keep audits and downstream search reliable.
- Line 425: The change directly mutates the agent history entry
(metadata/comments/159) for pm-rnpb.jsonl instead of recording it through the pm
system of record; revert this direct edit and reproduce the same state
transition by invoking the pm operation/CLI/API that appends the comment/state
update so the history is canonical (do not write to metadata/comments/* by
hand), ensure the new comment is created via the pm command that manages pm-rnpb
history, and add a guard in your workflow to prevent direct edits to any
.agents/pm history files in future.
In @.agents/pm/issues/pm-orrl.toon:
- Around line 5-24: This change edited an authoritative issue record directly
instead of using the pm system of record; revert any manual edits to the agent
issue (pm-orrl) and reapply the updates by running the pm CLI so the record
chain remains authoritative: use the pm create/update commands to set
acceptance_criteria, resolution, expected_result and comments (preserve parent
pm-rnpb), ensure the CLI behavior changes are implemented via the code changes
already referenced (create --blocked-by behavior), and re-run the provided
focused unit/integration tests to confirm the pm-managed record and CI artifacts
match the intended resolution.
In `@src/cli/commands/completion.ts`:
- Line 1006: Add the same --summary flag description used for Zsh to the Fish
health completions so both shells behave the same; locate where Fish health
completions are defined in completion.ts (the fish health completions
array/registration for the health command) and append or insert the exact entry
'--summary[Emit one-line-style health status with check names and warning
count]' into that Fish list so tests and Zsh/Fish parity are preserved.
---
Outside diff comments:
In `@src/sdk/cli-contracts.ts`:
- Around line 982-993: HEALTH_FLAG_CONTRACTS now includes the "--summary" flag
but the health schema in PM_TOOL_ACTION_SCHEMA_CONTRACTS.health.optional does
not include "summary", causing a mismatch; update
PM_TOOL_ACTION_SCHEMA_CONTRACTS.health.optional to include "summary" (matching
the flag name used in HEALTH_FLAG_CONTRACTS) so the CLI flag list and schema
remain consistent, and run the unit/schema validation to ensure no other flags
are out of sync.
🪄 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: a24c2a58-18d3-4aa9-812f-f839c725a5af
📒 Files selected for processing (30)
.agents/pm/features/pm-rnpb.toon.agents/pm/history/pm-6vfg.jsonl.agents/pm/history/pm-nbht.jsonl.agents/pm/history/pm-ny6y.jsonl.agents/pm/history/pm-orrl.jsonl.agents/pm/history/pm-r9ei.jsonl.agents/pm/history/pm-rnpb.jsonl.agents/pm/history/pm-vhdc.jsonl.agents/pm/history/pm-xk39.jsonl.agents/pm/issues/pm-6vfg.toon.agents/pm/issues/pm-nbht.toon.agents/pm/issues/pm-orrl.toon.agents/pm/issues/pm-r9ei.toon.agents/pm/issues/pm-vhdc.toon.agents/pm/issues/pm-xk39.toonsrc/cli/commands/comments.tssrc/cli/commands/completion.tssrc/cli/commands/create.tssrc/cli/commands/health.tssrc/cli/register-operations.tssrc/mcp/server.tssrc/sdk/cli-contracts.tstests/integration/cli.integration.spec.tstests/integration/mcp-dynamic-package-actions.spec.tstests/integration/release-readiness-runtime.spec.tstests/unit/comments-command.spec.tstests/unit/completion-command.spec.tstests/unit/contracts-command.spec.tstests/unit/create-command.spec.tstests/unit/health-command.spec.ts
| tags[10]: agent-ux,audit,calendar,ci,dogfood,pm-cli,sdk,search,security,telemetry | ||
| created_at: "2026-05-03T13:20:01.343Z" | ||
| updated_at: "2026-05-21T04:42:33.995Z" | ||
| updated_at: "2026-05-21T17:42:51.746Z" |
There was a problem hiding this comment.
System-of-record policy violation in .agents/pm feature file.
Please apply these state/evidence updates through the pm command path rather than direct file modification.
As per coding guidelines .agents/pm/**: pm is the system of record. Do not edit .agents/pm files directly.
Also applies to: 17-17, 177-178
🤖 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/features/pm-rnpb.toon at line 9, The PR directly modified the
system-of-record file .agents/pm/features/pm-rnpb.toon (updated_at value) which
violates the `.agents/pm/**` policy; instead revert this direct change and
perform the state/evidence update via the pm command path (use the pm CLI or
service API that manages PM feature state) so the pm service updates updated_at
and related fields atomically; locate changes touching pm-rnpb.toon and any
other `.agents/pm/**` entries (also referenced at the other occurrences) and
re-apply those updates through the pm command(s) that update feature
state/evidence (e.g., the pm update/patch endpoint or pm CLI subcommand) rather
than committing file edits.
| {"ts":"2026-05-21T17:27:10.427Z","author":"codex-gpt5","op":"claim","patch":[{"op":"replace","path":"/metadata/updated_at","value":"2026-05-21T17:27:10.427Z"},{"op":"add","path":"/metadata/assignee","value":"codex-gpt5"}],"before_hash":"041fc561f59488447ffd4ceb0816df037658e97054f830774c7f71895deddf31","after_hash":"955347a07c5a06e4378b9545802f3db5294c95833a062d36fab3564443a60c21"} | ||
| {"ts":"2026-05-21T17:27:13.200Z","author":"codex-gpt5","op":"update","patch":[{"op":"replace","path":"/metadata/updated_at","value":"2026-05-21T17:27:13.200Z"},{"op":"replace","path":"/metadata/status","value":"in_progress"}],"before_hash":"955347a07c5a06e4378b9545802f3db5294c95833a062d36fab3564443a60c21","after_hash":"f62a486df1fcb7f8cbd3c5e37c47822423d60255780e7ef6c4311bfec64a1a07","message":"Start blocked-by dependency semantics implementation"} | ||
| {"ts":"2026-05-21T17:27:14.467Z","author":"codex-gpt5","op":"comment_add","patch":[{"op":"replace","path":"/metadata/updated_at","value":"2026-05-21T17:27:14.467Z"},{"op":"add","path":"/metadata/comments","value":[{"created_at":"2026-05-21T17:27:14.467Z","author":"codex-gpt5","text":"Execution start 2026-05-21: duplicate check reused existing pm-orrl under pm-rnpb. Sub-agent review found pm plan already maps blocked-by to kind=blocked_by dependencies; implementing create behavior to derive a real edge only when the blocked-by value resolves to an existing pm item, preserving free-text metadata fallback."}]}],"before_hash":"f62a486df1fcb7f8cbd3c5e37c47822423d60255780e7ef6c4311bfec64a1a07","after_hash":"0b605ca2ce2bbb4ca36b1bc86ede3bb91e551559098f7ec12fa748dcdcb64377"} | ||
| {"ts":"2026-05-21T17:30:24.105Z","author":"codex-gpt5","op":"files_add","patch":[{"op":"replace","path":"/metadata/updated_at","value":"2026-05-21T17:30:24.105Z"},{"op":"add","path":"/metadata/files","value":[{"path":"src/cli/commands/create.ts","scope":"project","note":"derive blocked_by dependency edge for existing item ids"}]}],"before_hash":"0b605ca2ce2bbb4ca36b1bc86ede3bb91e551559098f7ec12fa748dcdcb64377","after_hash":"b51ac7f33642dce6d6d8047fea7f0591d0c56b7170125c9a6f44994b8d97727e"} | ||
| {"ts":"2026-05-21T17:30:26.287Z","author":"codex-gpt5","op":"files_add","patch":[{"op":"add","path":"/metadata/files/1","value":{"path":"tests/unit/create-command.spec.ts","scope":"project","note":"blocked-by id/free-text/dedupe regression"}},{"op":"replace","path":"/metadata/updated_at","value":"2026-05-21T17:30:26.287Z"}],"before_hash":"b51ac7f33642dce6d6d8047fea7f0591d0c56b7170125c9a6f44994b8d97727e","after_hash":"5e2623375324238553836c6d867a3f4c8d1b8f4d82cbbf62857b88c72611964b"} | ||
| {"ts":"2026-05-21T17:30:28.848Z","author":"codex-gpt5","op":"files_add","patch":[{"op":"replace","path":"/metadata/files/1/note","value":"CLI deps regression for create --blocked-by existing id"},{"op":"replace","path":"/metadata/files/1/path","value":"tests/integration/cli.integration.spec.ts"},{"op":"add","path":"/metadata/files/2","value":{"path":"tests/unit/create-command.spec.ts","scope":"project","note":"blocked-by id/free-text/dedupe regression"}},{"op":"replace","path":"/metadata/updated_at","value":"2026-05-21T17:30:28.848Z"}],"before_hash":"5e2623375324238553836c6d867a3f4c8d1b8f4d82cbbf62857b88c72611964b","after_hash":"bd503a2c3b81857ead7ddaffef2139b9f0f84b8e90782df9a012e4e4f0186ebd"} | ||
| {"ts":"2026-05-21T17:30:31.319Z","author":"codex-gpt5","op":"tests_add","patch":[{"op":"replace","path":"/metadata/updated_at","value":"2026-05-21T17:30:31.319Z"},{"op":"add","path":"/metadata/tests","value":[{"command":"PM_RUN_TESTS_SKIP_BUILD=1 node scripts/run-tests.mjs test -- tests/unit/create-command.spec.ts tests/integration/cli.integration.spec.ts -t 'blocked_by dependency|blocked-by references|extended optional field'","scope":"project","timeout_seconds":300}]}],"before_hash":"bd503a2c3b81857ead7ddaffef2139b9f0f84b8e90782df9a012e4e4f0186ebd","after_hash":"73e9a1e666df8a733072c1acd8e0d7637a5bb1529b15bd2adccdcd866efd1c0f"} | ||
| {"ts":"2026-05-21T17:40:17.167Z","author":"codex-gpt5","op":"comment_add","patch":[{"op":"add","path":"/metadata/comments/1","value":{"created_at":"2026-05-21T17:40:17.167Z","author":"codex-gpt5","text":"Evidence 2026-05-21: implemented create --blocked-by semantics for existing item IDs. The CLI preserves blocked_by metadata, derives one blocked_by dependency edge when the value resolves to an existing item, defaults status to blocked only when status was omitted, preserves explicit statuses, and keeps free-text reasons as metadata without edges. Manual temp-project smoke verified deps edge_count=1 and via=blocked_by. Verification passed: focused blocked-by suite, combined focused suite 8 files / 310 tests, package-first dogfood 84 workflows, semantic dogfood 86 workflows, and full release gate 96 files / 1406 tests at 100 percent coverage plus required Sentry/telemetry."}},{"op":"replace","path":"/metadata/updated_at","value":"2026-05-21T17:40:17.167Z"}],"before_hash":"73e9a1e666df8a733072c1acd8e0d7637a5bb1529b15bd2adccdcd866efd1c0f","after_hash":"ef9c17cedd1e9b6955c4f31f23315c2e98fe5d1447449299c2906084489b89b2"} | ||
| {"ts":"2026-05-21T17:41:14.271Z","author":"codex-gpt5","op":"close","patch":[{"op":"remove","path":"/metadata/assignee"},{"op":"replace","path":"/metadata/updated_at","value":"2026-05-21T17:41:14.271Z"},{"op":"replace","path":"/metadata/status","value":"closed"},{"op":"add","path":"/metadata/close_reason","value":"Implemented create --blocked-by existing-id semantics with real blocked_by dependency edge, blocked default status only when omitted, explicit-status preservation, free-text fallback, and dedupe coverage; verified by focused tests, temp dogfood, semantic dogfood, and full release gate with required Sentry/telemetry."}],"before_hash":"ef9c17cedd1e9b6955c4f31f23315c2e98fe5d1447449299c2906084489b89b2","after_hash":"ce7fbbbb16d171b4d54a3066524856f0cdbddcaaa1f284342a5441f099f2cd7d"} | ||
| {"ts":"2026-05-21T17:41:16.413Z","author":"codex-gpt5","op":"release","patch":[{"op":"replace","path":"/metadata/updated_at","value":"2026-05-21T17:41:16.413Z"}],"before_hash":"ce7fbbbb16d171b4d54a3066524856f0cdbddcaaa1f284342a5441f099f2cd7d","after_hash":"f0e4fd528f03f4fc12a5c6eaf69bf642e0205b4d4c3c42757860088a9234d408"} | ||
| {"ts":"2026-05-21T17:41:37.203Z","author":"codex-gpt5","op":"update_audit","patch":[{"op":"replace","path":"/metadata/updated_at","value":"2026-05-21T17:41:37.203Z"},{"op":"add","path":"/metadata/resolution","value":"pm create --blocked-by now derives a real blocked_by dependency edge when the value resolves to an existing item id, defaults status to blocked only when status is omitted, preserves explicit statuses, and keeps free-text reasons as metadata only."},{"op":"add","path":"/metadata/expected_result","value":"Agents can use --blocked-by with an item id and get dependency graph semantics without losing the free-text reason workflow."},{"op":"add","path":"/metadata/actual_result","value":"Focused tests and manual temp-project smoke verified dependency edge_count=1 with via=blocked_by, free-text fallback, explicit-status preservation, and dedupe behavior."}],"before_hash":"f0e4fd528f03f4fc12a5c6eaf69bf642e0205b4d4c3c42757860088a9234d408","after_hash":"3610347097be557f3e45d04384aa0c28939a437c342b0fc1dc611642aeb95d47"} |
There was a problem hiding this comment.
Do not edit .agents/pm history files directly.
This file is under the system-of-record path and should be updated through the pm workflow/commands rather than direct file edits.
As per coding guidelines .agents/pm/**: pm is the system of record. Do not edit .agents/pm files directly.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.agents/pm/history/pm-orrl.jsonl around lines 2 - 12, The PR modified the
system-of-record history file .agents/pm/history/pm-orrl.jsonl directly; revert
those direct edits and re-apply the changes through the pm workflow/commands
instead (do not edit .agents/pm/** files by hand). Restore the file to its
original state, then run the appropriate pm commands (e.g., the pm CLI flow that
implements "pm create --blocked-by" semantics referenced in metadata/resolution)
to produce the intended metadata/patch updates so the history is recorded by the
system-of-record; ensure any intended changes to metadata fields like
metadata/updated_at, metadata/status, metadata/comments, metadata/files,
metadata/tests, and metadata/close_reason are created via pm commands rather
than manual file edits.
| {"ts":"2026-05-21T04:40:06.326Z","author":"codex-full-manual-audit","op":"comment_add","patch":[{"op":"add","path":"/metadata/comments/157","value":{"created_at":"2026-05-21T04:40:06.326Z","author":"codex-full-manual-audit","text":"Evidence: latest sub-agent/manual audit and fixes completed under pm-5k2w. Dogfood passed normal 84 workflows and semantic 86 workflows using qwen3-embedding:0.6b; release gate passed with coverage 96 files / 1399 tests at 100 percent and required Sentry/telemetry gate. Residual performance/coverage breadth/semantic provider-staleness findings remain mapped to existing pm-rnpb/pm-gt82/pm-mbdu/pm-59gj follow-ups, not duplicated."}},{"op":"replace","path":"/metadata/updated_at","value":"2026-05-21T04:40:06.326Z"}],"before_hash":"a5dc529e78b7a274c7a8cba1ac06ba14ec119c2112b57d3541ec5ec2b53c2907","after_hash":"8d3151783bec6150d9703bde1d6fcefc4e0e4db1933448b42f2db708fe9899a3"} | ||
| {"ts":"2026-05-21T04:42:32.110Z","author":"codex-full-manual-audit","op":"comment_add","patch":[{"op":"add","path":"/metadata/comments/158","value":{"created_at":"2026-05-21T04:42:32.110Z","author":"codex-full-manual-audit","text":"Audit closeout evidence: broad manual dogfood and sub-agent review completed for this slice. Local release gate passed with telemetry required, package-first dogfood passed including semantic qwen Ollama mode, Sentry/telemetry gate passed against current baseline, GitHub issue/PR/vulnerability scan found no open actionable GitHub items. Residuals remain tracked under existing lineage: broader read-path performance, semantic provider staleness/auto-index parity, CI duration reduction beyond current selected coverage gate, and telemetry queue backlog investigation."}},{"op":"replace","path":"/metadata/updated_at","value":"2026-05-21T04:42:32.110Z"}],"before_hash":"8d3151783bec6150d9703bde1d6fcefc4e0e4db1933448b42f2db708fe9899a3","after_hash":"e517f235a79c56993d9b37491d2aea0e5db9acfd15af3484b6463de782d66197"} | ||
| {"ts":"2026-05-21T04:42:33.995Z","author":"codex-full-manual-audit","op":"release","patch":[{"op":"remove","path":"/metadata/assignee"},{"op":"replace","path":"/metadata/updated_at","value":"2026-05-21T04:42:33.995Z"}],"before_hash":"e517f235a79c56993d9b37491d2aea0e5db9acfd15af3484b6463de782d66197","after_hash":"7bb74c15805433c505e385db88b4ed37dc5ba9be420eaf75a24683a4498f38e1"} | ||
| {"ts":"2026-05-21T17:23:31.764Z","author":"codex-gpt5","op":"comment_add","patch":[{"op":"add","path":"/metadata/comments/159","value":{"created_at":"2026-05-21T17:23:31.764Z","author":"codex-gpt5","text":"Execution start 2026-05-21: bootstrap passed (npm install -g ., pm --version 2026.5.18, node v25.9.0, pnpm 10.33.0, pnpm build). Duplicate checks used pm context/search/list-open/list-in-progress; reusing active parent pm-rnpb and existing open children pm-6vfg/pm-nbht/pm-orrl, no duplicate items created. Dogfood finding: stale habit failed; runtime-discovered replacement is , and clearly reports allowed values brief|standard|deep."}},{"op":"replace","path":"/metadata/updated_at","value":"2026-05-21T17:23:31.764Z"}],"before_hash":"7bb74c15805433c505e385db88b4ed37dc5ba9be420eaf75a24683a4498f38e1","after_hash":"90abf675c360777f8235bf8a1a8dd829fd27cb02c415fc67b849332e1dd7aab5"} |
There was a problem hiding this comment.
Fix malformed audit evidence text placeholders.
The new comment string has dropped tokens (stale habit failed, replacement is , and ), which makes the evidence ambiguous and hard to trust in downstream audits/search.
🤖 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 at line 425, The audit comment at
metadata/comments/159 (value.text) contains dropped tokens making evidence
ambiguous—restore the missing values or replace them with explicit placeholders;
update the string so "stale habit failed" becomes "stale habit <old_value>
failed" (or the actual old value), "replacement is ," becomes "replacement is
<new_value>" (or the discovered runtime value), and ensure the clause about
allowed values clearly includes "brief|standard|deep"; edit the entry in
.agents/pm/history/pm-rnpb.jsonl at metadata/comments/159 to include these
non-empty concrete values or explicit placeholder tokens to keep audits and
downstream search reliable.
Do not mutate .agents/pm history files directly.
This change directly edits .agents/pm/history/pm-rnpb.jsonl, which should be written via pm operations so history/state transitions stay canonical and verifiable.
As per coding guidelines, "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 at line 425, The change directly mutates
the agent history entry (metadata/comments/159) for pm-rnpb.jsonl instead of
recording it through the pm system of record; revert this direct edit and
reproduce the same state transition by invoking the pm operation/CLI/API that
appends the comment/state update so the history is canonical (do not write to
metadata/comments/* by hand), ensure the new comment is created via the pm
command that manages pm-rnpb history, and add a guard in your workflow to
prevent direct edits to any .agents/pm history files in future.
| status: closed | ||
| priority: 2 | ||
| tags[5]: agent-ux,cli,create,dependencies,dogfood | ||
| created_at: "2026-05-20T20:32:50.496Z" | ||
| updated_at: "2026-05-20T20:32:50.496Z" | ||
| updated_at: "2026-05-21T17:41:37.203Z" | ||
| author: claude-code-agent | ||
| acceptance_criteria: "Behavior of --blocked-by is unambiguous: either it creates a real dependency edge (and documents status implications) when given a valid item id, or help/docs clearly state it is free-text metadata distinct from --dep; chosen behavior is tested." | ||
| parent: pm-rnpb | ||
| resolution: "pm create --blocked-by now derives a real blocked_by dependency edge when the value resolves to an existing item id, defaults status to blocked only when status is omitted, preserves explicit statuses, and keeps free-text reasons as metadata only." | ||
| expected_result: Agents can use --blocked-by with an item id and get dependency graph semantics without losing the free-text reason workflow. | ||
| actual_result: "Focused tests and manual temp-project smoke verified dependency edge_count=1 with via=blocked_by, free-text fallback, explicit-status preservation, and dedupe behavior." | ||
| comments[2]{created_at,author,text}: | ||
| "2026-05-21T17:27:14.467Z",codex-gpt5,"Execution start 2026-05-21: duplicate check reused existing pm-orrl under pm-rnpb. Sub-agent review found pm plan already maps blocked-by to kind=blocked_by dependencies; implementing create behavior to derive a real edge only when the blocked-by value resolves to an existing pm item, preserving free-text metadata fallback." | ||
| "2026-05-21T17:40:17.167Z",codex-gpt5,"Evidence 2026-05-21: implemented create --blocked-by semantics for existing item IDs. The CLI preserves blocked_by metadata, derives one blocked_by dependency edge when the value resolves to an existing item, defaults status to blocked only when status was omitted, preserves explicit statuses, and keeps free-text reasons as metadata without edges. Manual temp-project smoke verified deps edge_count=1 and via=blocked_by. Verification passed: focused blocked-by suite, combined focused suite 8 files / 310 tests, package-first dogfood 84 workflows, semantic dogfood 86 workflows, and full release gate 96 files / 1406 tests at 100 percent coverage plus required Sentry/telemetry." | ||
| files[3]{path,scope,note}: | ||
| src/cli/commands/create.ts,project,derive blocked_by dependency edge for existing item ids | ||
| tests/integration/cli.integration.spec.ts,project,CLI deps regression for create --blocked-by existing id | ||
| tests/unit/create-command.spec.ts,project,blocked-by id/free-text/dedupe regression | ||
| tests[1]{command,path,scope,timeout_seconds,pm_context_mode,env_set,env_clear,shared_host_safe,assert_stdout_contains,assert_stdout_regex,assert_stderr_contains,assert_stderr_regex,assert_stdout_min_lines,assert_json_field_equals,assert_json_field_gte,note}: | ||
| PM_RUN_TESTS_SKIP_BUILD=1 node scripts/run-tests.mjs test -- tests/unit/create-command.spec.ts tests/integration/cli.integration.spec.ts -t 'blocked_by dependency|blocked-by references|extended optional field',null,project,300,null,null,null,null,null,null,null,null,null,null,null,null |
There was a problem hiding this comment.
Avoid direct edits to .agents/pm issue records.
These updates should be produced via pm operations so the record chain stays authoritative and policy-compliant.
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/issues/pm-orrl.toon around lines 5 - 24, This change edited an
authoritative issue record directly instead of using the pm system of record;
revert any manual edits to the agent issue (pm-orrl) and reapply the updates by
running the pm CLI so the record chain remains authoritative: use the pm
create/update commands to set acceptance_criteria, resolution, expected_result
and comments (preserve parent pm-rnpb), ensure the CLI behavior changes are
implemented via the code changes already referenced (create --blocked-by
behavior), and re-run the provided focused unit/integration tests to confirm the
pm-managed record and CI artifacts match the intended resolution.
There was a problem hiding this comment.
Code Review
This pull request introduces token-efficiency enhancements for agent workflows, including a new --summary mode for the health command and paging metadata for MCP comment listings. It also improves the create command by automatically deriving blocked_by dependency edges when referencing existing item IDs and fixes a parsing quirk related to the text= prefix in comments. Feedback was provided to simplify the boolean logic used to trigger fast health checks for better readability.
| const fastBriefCheckOnly = | ||
| ((options.brief === true && options.checkOnly === true) || (summaryMode && options.checkOnly === true)) && | ||
| options.full !== true; |
There was a problem hiding this comment.
The logic for fastBriefCheckOnly can be simplified for better readability. Since summaryMode already incorporates the options.full !== true check, and options.checkOnly === true is common to both conditions, the expression can be streamlined.
| const fastBriefCheckOnly = | |
| ((options.brief === true && options.checkOnly === true) || (summaryMode && options.checkOnly === true)) && | |
| options.full !== true; | |
| const fastBriefCheckOnly = (options.brief === true || options.summary === true) && options.checkOnly === true && options.full !== true; |
Add the health summary option to MCP action schema contracts and Fish completions so shell/runtime contracts stay aligned. Simplify the health summary check-only fast path and tighten the completion regression assertion. Record PR review follow-up evidence and corrected dogfood notes through pm comments.
|
Review follow-up pushed in c059e65. Addressed the actionable items:
The .agents/pm file changes in this PR were generated through pm commands (including pm comments and pm history-redact), not by hand-editing tracker files. Focused validation after the review fix passed: pnpm build plus contracts/completion/health/release-readiness runtime tests (4 files, 169 tests), and node scripts/check-secrets.mjs passed. |
Summary
Verification
pm items
Summary by Sourcery
Improve agent-facing health and comments ergonomics while tightening blocked dependency modeling for created items.
New Features:
Enhancements:
Tests: