Repository navigation
feat(output): pm list csv/table + pm context --fields focus-row projection - #297
Conversation
…cus-row projection Combines two CLI output-shaping features under the CLI command surface & agent-ergonomics epic (pm-mpbb): both let agents and humans control the shape of pm output, serving token efficiency and human export. pm list --format <csv|table|json|toon> (pm-1lll, GH-154 remainder): - New shared renderer src/core/output/tabular.ts: renderRowsAsCsv (RFC 4180: quotes values containing commas/quotes/newlines, arrays join with ';') and renderRowsAsTable (fixed-width aligned columns with a dashed header rule). - csv/table are human-export modes; json/toon reuse the existing resolveReadCommandOutputFormat override (honouring the --json + toon conflict). - Rendered columns follow the active projection (--fields/--brief/--compact). - Rejects --format csv|table + --stream; CLI-only (agents read --json), so it is added to LIST_FILTER_FLAG_CONTRACTS but not the MCP list option contracts. pm context --fields <a,b,c> (pm-hnjf, GH-156 follow-up to --depth full): - Projects every focus-row section (high_level, low_level, blocked_fallback, recently_created, unparented) to a chosen field subset for low-token reads. - New exported helpers parseContextFocusFields (validate + de-dupe) and projectContextFocusRows; ContextResult.focus_fields echoes the projection. - Applies across markdown (projected key:value lines, drops the recently-created date prefix), TOON, and JSON; exposed on the pm_context MCP tool via options.fields and wired through CONTEXT_FLAG_CONTRACTS + TOOL_CONTEXT_OPTION_CONTRACTS. Tests: new tests/unit/core/output/tabular.spec.ts; extended register-list-query.spec.ts and context-command.spec.ts. Full suite green at 100/100/100/100 coverage (4643 tests). Docs: COMMANDS.md (output render formats + context --fields). Contracts snapshot + changelog regenerated. Closes pm-1lll, pm-hnjf. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WPY4oWVsYs2FjZ6shgUyrL
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
@coderabbitai full review |
|
/gemini review |
|
@codex review |
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
✅ Action performedFull review finished. |
|
Warning Review limit reached
More reviews will be available in 48 minutes and 42 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy 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 (2)
📝 WalkthroughWalkthroughTwo output-shaping features are added to the CLI. Changespm list --format output formats
pm context --fields focus-row projection
Sequence Diagram(s)sequenceDiagram
participant User
participant CLI as register-list-query
participant parseListFormat
participant runList
participant tabular as tabular.ts
participant stdout as writeStdout
User->>CLI: pm list --format csv
CLI->>parseListFormat: "csv"
parseListFormat-->>CLI: ListOutputFormat.CSV
CLI->>runList: query options
runList-->>CLI: { items, count }
CLI->>tabular: renderRowsAsCsv(items)
tabular-->>CLI: CSV string
CLI->>stdout: write CSV string
sequenceDiagram
participant User
participant CLI as register-list-query
participant normalizeContextOptions
participant runContext
participant parseContextFocusFields
participant projectContextFocusRows
participant renderContextMarkdown
User->>CLI: pm context --fields id,title,priority
CLI->>normalizeContextOptions: options
normalizeContextOptions-->>CLI: ContextOptions { fields: "id,title,priority" }
CLI->>runContext: ContextOptions
runContext->>parseContextFocusFields: "id,title,priority"
parseContextFocusFields-->>runContext: ["id","title","priority"]
runContext->>projectContextFocusRows: focus arrays + fields
projectContextFocusRows-->>runContext: projected ContextFocusItem[]
runContext->>renderContextMarkdown: result with focus_fields set
renderContextMarkdown-->>CLI: field:value token lines
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 |
|
To use Codex here, create a Codex account and connect to github. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@tests/fixtures/contracts/full.json`:
- Around line 16720-16727: The schema examples in the "fields" property contain
search-specific fields (score and matched_fields) that are invalid for context
focus-row projection. Remove these invalid fields from the examples array and
update only those entries to use valid context projection fields such as id,
title, type, status, priority, order, deadline, assignee, tags, updated_at,
parent, children_total, children_closed, completion_pct, and created_at.
Additionally, update the description text to clarify that this projection is
context-specific rather than claiming it applies to get, search, or list-family
outputs.
🪄 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: e4d38447-4cad-49ad-97eb-656e474ebbac
📒 Files selected for processing (19)
.agents/pm/extensions/.managed-extensions.json.agents/pm/features/pm-1lll.toon.agents/pm/features/pm-hnjf.toon.agents/pm/history/pm-1lll.jsonl.agents/pm/history/pm-hnjf.jsonlCHANGELOG.mddocs/COMMANDS.mdsrc/cli/commands/context.tssrc/cli/register-list-query.tssrc/cli/registration-helpers.tssrc/core/output/tabular.tssrc/mcp/tool-definitions.tssrc/sdk/cli-contracts.tssrc/sdk/cli-contracts/commander-types.tssrc/sdk/cli-contracts/tool-option-contracts.tstests/fixtures/contracts/full.jsontests/unit/cli/register-list-query.spec.tstests/unit/commands/context-command.spec.tstests/unit/core/output/tabular.spec.ts
…tion Addresses CodeRabbit review on PR #297: adding `fields` to the pm_context tool extended the shared `fields` parameter description, which previously named only get/search/list and carried search-specific example fields (score/matched_fields) that are not valid for context focus-row projection. Clarify that valid field names are command-specific, name context explicitly, and add a context-shaped example (id,title,priority,deadline). Contracts snapshot regenerated. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WPY4oWVsYs2FjZ6shgUyrL
|
@coderabbitai review |
|
@codex review |
✅ Action performedReview finished.
|
|
To use Codex here, create a Codex account and connect to github. |
Summary
Combines two CLI output-shaping features under the CLI command surface & agent-ergonomics epic (pm-mpbb). Both give agents and humans control over the shape of pm output — directly serving the project philosophy that project management = context management (token-efficient projection) plus practical human export.
Closes pm-1lll (GH-154 remainder) and pm-hnjf (GH-156 follow-up).
pm list --format <csv|table|json|toon>(pm-1lll)src/core/output/tabular.ts:renderRowsAsCsv— RFC 4180 compliant (quotes values containing commas/quotes/newlines; array fields liketagsjoin with;).renderRowsAsTable— fixed-width aligned columns with a dashed header rule.csv/tableare human export modes;json/toonreuse the existingresolveReadCommandOutputFormatoverride (honouring the--json+--format toonconflict).--formatcomposes with--fields/--brief/--compact.--format csv|table+--stream. CLI-only (agents read--json), so added toLIST_FILTER_FLAG_CONTRACTSbut not the MCP list option contracts.pm list-open --format table pm list-all --fields id,title,priority --format csv > backlog.csvpm context --fields <a,b,c>(pm-hnjf)high_level,low_level,blocked_fallback,recently_created,unparented) to a chosen field subset for low-token reads — the same shapingpm list --fields/pm get --fieldsprovide.parseContextFocusFields(validate + de-dupe) andprojectContextFocusRows;ContextResult.focus_fieldsechoes the projection.key:valuelines; drops the recently-created date prefix), TOON, and JSON; exposed on thepm_contextMCP tool viaoptions.fields(wired throughCONTEXT_FLAG_CONTRACTS+TOOL_CONTEXT_OPTION_CONTRACTS).Testing & quality
tests/unit/core/output/tabular.spec.ts; extendedregister-list-query.spec.tsandcontext-command.spec.ts.contracts:check,quality:static,quality:docs-skillsall pass; contracts snapshot + CHANGELOG regenerated.🤖 Generated with Claude Code
https://claude.ai/code/session_01WPY4oWVsYs2FjZ6shgUyrL