Repository navigation
SDK-backed Plan contracts and truthful mutation outcomes - #644
Conversation
Forward the complete governed create contract through Plan CLI, SDK, and MCP surfaces, preserve semantic relationship kinds, make linked-test sandboxes non-interactive, and expose truthful delete outcomes. Add strict contract regressions, generated docs/changelog evidence, and tighten the static-quality suppression budget.
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
📝 WalkthroughWalkthroughThe PR expands governed Plan creation contracts, adds semantic relationship kinds and promotion normalization, makes delete JSON results explicit, enables injectable linked-test initialization, updates documentation and changelog entries, and lowers the ESLint suppression budget. ChangesCore CLI and SDK contract changes
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant CLI
participant Contracts
participant Runtime
participant Storage
CLI->>Contracts: submit Plan metadata and relationship options
Contracts->>Runtime: normalize and validate inputs
Runtime->>Storage: create Plan and persist promoted links
Storage-->>CLI: return mutation result
sequenceDiagram
participant DeleteCommand
participant Projection
participant JSONResponse
DeleteCommand->>Projection: provide deletion outcome fields
Projection->>JSONResponse: select outcome as status
JSONResponse-->>DeleteCommand: emit deleted or would_delete result
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@greptileai review this exact head /gemini review @coderabbitai full review |
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
✅ Action performedFull review finished. Your included review limit is currently reached under our Fair Usage Limits Policy. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 11 minutes. |
Merging this PR will regress 5 benchmarks
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing |
|
Review-surface acknowledgement for exact head
There are currently no review threads. Greptile remains pending and will be inventoried before merge. |
|
@greptileai please review exact head |
Restore the canonical create required-key contract, move governed metadata to the Plan optional-key allowlist, and lock both surfaces with a regression assertion.
|
@greptileai review exact head /gemini review @coderabbitai full review Correction since the prior head: restored the canonical create required-key contract, moved the complete governed metadata allowlist to the Plan action, added direct regression assertions, regenerated contracts/changelog, and reran 6,084 tests at 100/100/100/100. |
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
Rate Limit Exceeded
|
|
@coderabbitai full review exact head |
|
✅ Action performedFull review finished. |
There was a problem hiding this comment.
Actionable comments posted: 4
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/tool-schema.ts (1)
1-1: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick winAdd the missing
estimateproperty for MCPplan.
estimatedMinutesis added to theplanaction’s MCP optional keys, but the generatedpm_planschema hasadditionalProperties: falseand noestimate/estimatedMinutesproperty, so MCP clients validating against that contract can’t pass CLI-supported--estimate/--estimated-minutes. Define the corresponding schema property for plan and regeneratetests/fixtures/contracts/full.json.🤖 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/tool-schema.ts` at line 1, Add the missing estimate/estimatedMinutes property to the generated pm_plan MCP schema alongside its existing optional keys, matching the CLI-supported --estimate/--estimated-minutes contract and preserving additionalProperties: false. Then regenerate the full contract fixture at tests/fixtures/contracts/full.json.
🤖 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 `@docs/SDK.md`:
- Line 233: Remove the “Tracked” banner and its internal issue links from the
public SDK reference in docs/SDK.md. Preserve the surrounding documentation
content, with issue association maintained only in the PM docs collection.
In `@src/core/output/mutation-projection.ts`:
- Around line 106-110: Update both status projection paths in the mutation
projection logic to use the envelope outcome only when it is exactly "deleted"
or "would_delete"; otherwise preserve the subject/item lifecycle status. Apply
the same predicate at the primary projection and the corresponding path around
the alternate status handling, and add coverage for a non-delete outcome such as
"success" retaining the item status.
In `@src/sdk/cli-contracts/tool-schema.ts`:
- Around line 571-610: Add the Plan action’s estimate property to the contract
schema, supporting the documented estimate/estimatedMinutes option from the Plan
action options metadata while preserving additionalProperties: false. Then
regenerate or refresh the contract fixture so the exposed schema and fixture
match.
In `@tests/unit/sdk/agent-contract-correctness.spec.ts`:
- Around line 88-112: The assertions at
tests/unit/sdk/agent-contract-correctness.spec.ts:88-112 must verify the
supplied status, priority, deadline, estimate, tags, and exact linked-resource
contents instead of only checking array types; update the item contract
assertion accordingly. At
tests/unit/sdk/agent-contract-correctness.spec.ts:188-205, reload the Plan and
assert metadata.dependencies includes the promoted implements and verifies
edges, including normalization of depends_on to blocked_by.
---
Outside diff comments:
In `@src/sdk/cli-contracts/tool-schema.ts`:
- Line 1: Add the missing estimate/estimatedMinutes property to the generated
pm_plan MCP schema alongside its existing optional keys, matching the
CLI-supported --estimate/--estimated-minutes contract and preserving
additionalProperties: false. Then regenerate the full contract fixture at
tests/fixtures/contracts/full.json.
🪄 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: ASSERTIVE
Plan: Pro
Run ID: 7736e3b1-491a-4e61-b9c3-3776db4b40d0
📒 Files selected for processing (30)
.agents/pm/extensions/.managed-extensions.json.agents/pm/history/pm-lcnk2n.jsonl.agents/pm/history/pm-qd3woa.jsonl.agents/pm/history/pm-tz2ikr.jsonl.agents/pm/history/pm-ypuc39.jsonl.agents/pm/issues/pm-lcnk2n.toon.agents/pm/issues/pm-qd3woa.toon.agents/pm/issues/pm-tz2ikr.toon.agents/pm/issues/pm-ypuc39.toonCHANGELOG.mddocs/COMMANDS.mddocs/SDK.mdeslint-suppressions.jsonpackage.jsonscripts/release/static-quality-gate.mtssrc/cli/commands/delete.tssrc/cli/commands/plan.tssrc/cli/register-mutation.tssrc/core/output/mutation-projection.tssrc/sdk/cli-contracts/flag-contracts.tssrc/sdk/cli-contracts/tool-schema.tssrc/sdk/relationships.tssrc/sdk/test/execution.tssrc/types.tstests/fixtures/contracts/full.jsontests/integration/release-automation-contract.spec.tstests/integration/release-readiness-runtime.spec.tstests/unit/commands/delete-command.spec.tstests/unit/core/output/mutation-projection.spec.tstests/unit/sdk/agent-contract-correctness.spec.ts
💤 Files with no reviewable changes (1)
- eslint-suppressions.json
Expose the canonical estimate key in the strict Plan MCP schema, strengthen persisted Plan metadata/resource and semantic dependency assertions, and prevent generic mutation outcomes from overriding lifecycle status. Record full release evidence and the advisory Greptile quota state in pm lineage.
|
Exact-head review follow-up is pushed as
@greptileai review exact head /gemini review @coderabbitai full review exact head |
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
✅ Action performedFull review finished. Your included review limit is currently reached under our Fair Usage Limits Policy. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 30 minutes. |
|
Exact-head review closeout for |
|
Branch-protection closeout: every created required context is green on exact head |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Summary
implementsandverifiesas first-class directed relationship kinds during Plan promotiondeleted/would_delete) with previous lifecycle statepm items
Verification
pnpm release:gatesrepository-owned gates passedpnpm changelog:pm:checkandpnpm contracts:checkpassedpm validate --check-resolution --check-history-drift: no history drift; selected items have complete closeout metadata (277 historical resolution warnings remain outside this PR)Closes #635
Closes #638
Closes #641
Closes #642
Summary by cubic
Unifies Plan creation behind the shared SDK/CLI/MCP create contract and completes strict MCP metadata parity, including the canonical
estimatekey. Makes delete mutations report truthful outcomes and applies them only to deletion projections; also preservesimplements/verifiesduring Plan promotion and removes interactive linked-test init.estimatekey, and added parity regression coverage (addresses pm plan create cannot satisfy strict Plan required fields #635).implementsandverifiesas first-class directed kinds in the relationship registry (addresses Plan link promotion rejects advertised implements relationship kind #641).outcome(deleted|would_delete),deletedboolean, andprevious_status; projections mapstatusto the deleteoutcomeonly for deletions, keeping lifecycle for other mutations (addresses Agent UX:pm delete --jsonreportsstatus: "open"for an item it just deleted (misleading mutation result) #638).Written for commit b1c63da. Summary will update on new commits.