2.9 KiB
2.9 KiB
1. Composer Prompt Contract
- 1.1 Add
src/main/resources/prompts/chat-composer-prompt.md. - 1.2 Define Composer input fields:
original_query,verdict,allowed_claims,allowed_hypotheses,missing_info,recommended_actions, andrationale. - 1.3 Define strict JSON output fields:
answer_summary,recommended_actions, anduser_facing_answer. - 1.4 State verdict-specific wording rules for PASS, LOW_CONFID, and REJECT.
- 1.5 State that Composer must not add facts, call tools, output Markdown, or use raw Executor/tool output.
2. Composer Invocation And Input Filtering
- 2.1 Load the Composer prompt in
ChatService. - 2.2 Add a
chat_composerAgent or equivalent Composer model call after final Verifier decision. - 2.3 Build Composer input from Verifier decision and Executor structured output.
- 2.4 Filter
allowed_claimsfromclaim_checksusingdirect_observationand boundedreasonable_inference. - 2.5 Exclude
unsupported,external_unknown, andcontradictedclaims from confirmed output. - 2.6 Downgrade
overstatedclaims toallowed_hypothesesormissing_info. - 2.7 Ensure REJECT Composer input has
allowed_hypotheses=[]. - 2.8 Ensure Composer input contains no raw tool output, full unscreened Executor output, or Executor
user_facing_answer.
3. Composer Output Parsing, Fallback, And Audit
- 3.1 Parse Composer strict JSON output.
- 3.2 Add safe fallback rendering for malformed Composer output.
- 3.3 Ensure fallback rendering never exposes raw Composer JSON, raw Executor JSON, or Executor
user_facing_answer. - 3.4 Persist
composer_outputunderdiagnosis_session.self_evaluation.verifier_evaluation. - 3.5 Preserve existing verifier audit fields when writing Composer output.
4. Final Answer Routing
- 4.1 Replace PASS temporary V2 renderer usage with Composer or safe template rendering.
- 4.2 Ensure LOW_CONFID final answer uses Composer-safe filtered material.
- 4.3 Ensure REJECT final answer does not include root-cause conclusions and does not pass through Executor raw answer.
- 4.4 Ensure Executor
user_facing_answeris not read by any final answer path.
5. Tests And Verification
- 5.1 Add or update tests proving Composer input excludes raw tool output and full Executor output.
- 5.2 Add or update tests proving unsupported claims do not appear as confirmed final-answer content.
- 5.3 Add or update tests for PASS root-cause wording only when an allowed root-cause claim exists.
- 5.4 Add or update tests for LOW_CONFID separation of confirmed information, possible directions, and evidence gaps.
- 5.5 Add or update tests for REJECT with
allowed_hypotheses=[]and no root-cause conclusion. - 5.6 Add or update tests for malformed Composer fallback with no raw JSON leakage.
- 5.7 Run targeted Maven tests.
- 5.8 Validate this OpenSpec change and all specs.