Repository navigation
[AI-701] validate-plan artifact endpoint + workspace_root emission - #318
Conversation
ValidatePlanCommand now tries GET /api/sessions/{id}/plan-artifacts?chain=true
first (new plan/spec/design/checklist discovery), rendering the primary
artifact under "## Plan" with truncated/unavailable markers; work rows and
"what's done" summaries still come from the existing recap endpoint. A 404
(older server or non-visible session) falls back to the original recap-only
rendering byte-for-byte.
Adds PlanArtifactDto/PlanArtifactsResponseDto to Capacitor.Cli.Core, mirroring
the server's Capacitor.Plans.PlanArtifact field-for-field, registered in the
AOT source-generated CapacitorJsonContext.
Session-start hook payloads across every harness (Claude, Codex, Gemini,
Copilot, Kiro, Pi, OpenCode, Antigravity) and the historical importer now
carry a best-effort workspace_root (via the existing GitRepository.FindRoot
git-root discovery), fail-open — omitted when cwd is absent or no repo is
found.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…_root Fix three review findings: the degraded (is_complete==false) plan state was never rendered in `kcap validate-plan`'s plan section; the historical importer derived workspace_root from the raw, unremapped transcript cwd instead of the already resolved cwd; add a multi-artifact rendering-order regression test.
PR Summary by QodoValidate-plan via plan-artifacts endpoint and emit workspace_root in session hooks
AI Description
Diagram
High-Level Assessment
Files changed (14)
|
Code Review by Qodo
Context used 1.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9806bb81d4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| importResult = r!; | ||
| } else { | ||
| importResult = await ImportChainsAsync(httpClient, baseUrl, chains, events, CancellationToken.None); | ||
| importResult = await ImportChainsAsync(httpClient, baseUrl, chains, events, CancellationToken.None, sessionCwds); |
There was a problem hiding this comment.
Thread workspace roots through routed imports
Passing sessionCwds only into ImportChainsAsync fixes the file-based chain path, but routed imports skip this call entirely and enter the ImportSessionAsync phase just below; I checked the routed source payload builders (for example OpenCode/Pi/Copilot/Kiro/Antigravity/Cursor) and they still post cwd/workspace_roots without the new workspace_root. As a result kcap import for those vendors still cannot provide workspace-scoped artifact identity even when the discovered cwd is inside a git repo, so the new plan-artifact matching remains unavailable for those historical sessions.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in c903411 — routed imports (OpenCode/Pi/Copilot/Kiro/Antigravity) now derive workspace_root via the same fail-open GitRepository.FindRoot in their session-start payload builders. Cursor intentionally untouched (its workspace_roots is a different, pre-existing IDE concept). Tests added on the OpenCode source.
… 2 on unavailable, routed-import workspace_root Four findings from the Qodo/Codex PR review of the plan-artifacts change: - README: document the new plan-artifacts fetch + recap-fallback + degraded/truncated/unavailable markers under "Plan validation". - RenderPlanArtifacts: a null OriginalBytes now renders "of ? bytes" instead of "of bytes", and a "truncated" artifact with null Content renders like "unavailable" instead of "first 0 of ... bytes". - HandleCore now returns exit code 2 when the PRIMARY artifact's content is unavailable (distinct from 0 success/no-plan and 1 generic error). - Routed imports (OpenCode/Pi/Copilot/Kiro/Antigravity) now derive workspace_root from cwd via GitRepository.FindRoot, matching the file-based ImportChainsAsync path. Cursor is untouched (separate workspace_roots concept).
…ndows AV race) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CLI half of AI-701 — pairs with kurrent-io/kcap-server#1039 (either side works without the other).
kcap validate-plannow makes two calls on new servers:GET /api/sessions/{id}/plan-artifacts?chain=truefor plans (primary selected byis_primary, degraded/truncated/unavailable markers byte-identical to the server'sPlanRowRendering) plus the existing recap call for current-session work rows andwhats_done. A 404 from plan-artifacts falls back to the legacy recap-only filtering unchanged; 200-empty renders "No plan found"; an unavailable primary is reported as not validatable.workspace_rootfrom the existing fail-open git-root discovery — feeds workspace-scoped artifact identity server-side.PlanArtifactDto/PlanArtifactsResponseDtoregistered in the AOTCapacitorJsonContext; osx-arm64 publish clean with zero AOT warnings.🤖 Generated with Claude Code