Skip to content

fix(llm): add rationale guidance to API extraction prompt - #2515

Closed
hopstreax wants to merge 2 commits into
Graphify-Labs:v8from
hopstreax:fix/2482-rationale-extraction-system
Closed

fix(llm): add rationale guidance to API extraction prompt#2515
hopstreax wants to merge 2 commits into
Graphify-Labs:v8from
hopstreax:fix/2482-rationale-extraction-system

chore: rerun CI

31e5dc2
Select commit
Loading
Failed to load commit list.
Graphify Labs / Graphify succeeded Aug 6, 2026 in 0s

Graphify — looks good

Looks safe to merge — no coupling regressions and no blocking issues, checked against the code graph (not a self-assessment).

Details

Graphify reviewed this change.

Looks safe to merge — no coupling regressions and no blocking issues, checked against the code graph (not a self-assessment).


Graphify review — findings

This PR adds a new instruction to the LLM extraction system prompt (_EXTRACTION_SYSTEM) directing the model to capture design rationale as a rationale attribute on nodes rather than as separate rationale nodes, and updates the output schema example to include a "rationale":null field on nodes. It also adds a corresponding test (test_native_extraction_prompt_requests_rationale) that verifies the prompt contains the new rationale wording and schema entry for both the deep and non-deep extraction variants. The changes touch graphify/llm.py and tests/test_llm_backends.py.

No blocking issues surfaced. 2 lower-confidence candidates did not survive cross-model review.

Analysis details — impact, health, verification

Impact & health

Graphify review

Impact — 660 functions depend on the 251 functions this change touches.

Health — grade B; 10 existing hotspot(s) in the area this change touches (pre-existing, not introduced here):

  • deduplicate_entities() — 49 callers, 21 callees (high)
  • build_merge() — 41 callers, 14 callees (high)
  • extract_files_direct() — 15 callers, 20 callees (high)
  • dispatch_command() — 2 callers, 118 callees (high)
  • extract_corpus_parallel() — 23 callers, 10 callees (high)
  • _call_claude_cli() — 26 callers, 8 callees (high)
  • _call_openai_compat() — 23 callers, 8 callees (high)
  • _extract_with_adaptive_retry() — 14 callers, 9 callees (high)
  • …and 2 more

Verification — 660 functions in the blast radius were not formally verified this run (proofs are advisory here).

Gate & verification

graphify gate

PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.

Advisory (not blocking):

  • verification_scope: 435 function(s) in the blast radius were not formally verified this run