feat(orchestration): ground PRD on the codebase graph via AP (refactor handlers)#4
Merged
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Wire the existing host-driven reducer to use automatised-pipeline more fully — no new module/tool, two action emissions through the existing
call_pipeline_toolprotocol:index_codebase, emitprepare_prd_input(FEATURE mode, nofinding_id) and store the returned grounding onstate.codebase_grounding. Idempotent viaprd_input_prepared.validate_prd_against_graphand merge the hallucination/community/process report into the existingdone.verificationasprd_graph_validation. Idempotent viaprd_validated.codebase_pathare unchanged (zero AP calls).codebase_graph_path/codebase_indexed). Usedcodebase_grounding, notprd_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