Skip to content

feat(orchestration): ground PRD on the codebase graph via AP (refactor handlers)#4

Merged
cdeust merged 4 commits into
mainfrom
feat/ground-prd-on-codebase-graph
Jun 2, 2026
Merged

feat(orchestration): ground PRD on the codebase graph via AP (refactor handlers)#4
cdeust merged 4 commits into
mainfrom
feat/ground-prd-on-codebase-graph

Conversation

@cdeust
Copy link
Copy Markdown
Owner

@cdeust cdeust commented Jun 2, 2026

Wire the existing host-driven reducer to use automatised-pipeline more fully — no new module/tool, two action emissions through the existing call_pipeline_tool protocol:

  • input-analysis: after index_codebase, emit prepare_prd_input (FEATURE mode, no finding_id) and store the returned grounding on state.codebase_grounding. Idempotent via prd_input_prepared.
  • self-check: after PRD export, emit validate_prd_against_graph and merge the hallucination/community/process report into the existing done.verification as prd_graph_validation. Idempotent via prd_validated.
  • Both advisory: AP failure records the error and advances. Pipelines with no codebase_path are unchanged (zero AP calls).
  • State additions are additive (mirror codebase_graph_path/codebase_indexed). Used codebase_grounding, not prd_context (that's the PRD-kind enum).

Depends on AP feature-mode prepare_prd_input (cdeust/automatised-pipeline#feat/prepare-prd-input-feature-mode).

Verified: orchestration 100/100; build + typecheck clean.

🤖 Generated with Claude Code

cdeust and others added 4 commits June 2, 2026 21:31
…r handlers)

Wire the existing host-driven reducer to use automatised-pipeline more fully —
no new module/tool, just two action emissions through the existing
call_pipeline_tool protocol:

- input-analysis: after index_codebase succeeds, emit prepare_prd_input in
  FEATURE mode { feature_description, output_dir, graph_path } (no finding_id),
  and store the returned grounding on state.codebase_grounding for later steps.
  Idempotent via prd_input_prepared. (AP now returns prd_context inline.)
- self-check: after PRD export, emit validate_prd_against_graph { prd_path,
  graph_path } and merge the symbol-hallucination/community/process report into
  the existing done.verification as prd_graph_validation. Idempotent via
  prd_validated. Both calls are advisory — AP failure records the error and
  advances; pipelines without a codebase_path are unchanged (zero AP calls).

State: +codebase_grounding, +prd_input_prepared, +prd_validation, +prd_validated
(additive, mirror the existing codebase_graph_path/codebase_indexed pair).
Used state.codebase_grounding (not prd_context — that's the PRD-kind enum).

Verified: orchestration 100/100; build + typecheck clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Close the grounding loop: section drafts now USE the AP grounding instead of
ignoring it. buildSectionPrompt gains an optional codebase_grounding input and
renders a concise <codebase_grounding> block (graph stats + up to 15 matched
symbols with file/community + impacted communities/processes, capped) after
<codebase_context>. section-generation normalizes state.codebase_grounding
(prd_context wrapper OR flat) and threads it into the draft call.

Backward compatible: no grounding → byte-identical prompt (asserted via toBe).
No new module — extended the existing interface + builder + call site.

Verified: 124/124 across meta-prompting + orchestration; tsc --noEmit clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The bundle-freshness CI check requires the committed bundle to match source.
Regenerate via pnpm build && pnpm bundle after the input-analysis/self-check/
section-generation grounding refactor.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…debase-graph

# Conflicts:
#	mcp-server/index.js
@cdeust cdeust merged commit 7828f9f into main Jun 2, 2026
2 checks passed
@cdeust cdeust deleted the feat/ground-prd-on-codebase-graph branch June 2, 2026 20:39
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