Roadmap Phase 4: iterative research loop and claim verification - #40
Open
Ndevu12 wants to merge 1 commit into
Open
Roadmap Phase 4: iterative research loop and claim verification#40Ndevu12 wants to merge 1 commit into
Ndevu12 wants to merge 1 commit into
Conversation
Turn the one-shot pipeline into an assess-refine-stop cycle and check report claims against their sources before publication. Research loop (new stage between relevance scoring and fulltext): - Assesses whether the kept papers answer the query — a structured LLM verdict when synthesis LLM mode is on, and a concept-coverage heuristic otherwise (every core query concept must be matched by at least one paper, with a minimum paper floor) - When coverage is thin, generates targeted follow-up queries, retrieves for them, and merges candidates through the existing deduplication, ranking, and relevance machinery — no special-case scoring path — repeating up to research_loop.max_iterations - The final coverage assessment lands in the coverage_assessment artifact for debug dumps Verification (new stage between gap analysis and citation export): - Checks each paper's key points against that paper's own sources (abstract plus grounded full-text passages); a structured LLM verdict per paper when available, and a conservative term-coverage heuristic otherwise - Unsupported points are flagged, never rewritten: paper analyses gain unverified_points, reports mark them '(unverified)', and the report carries an aggregate VerificationSummary (claims checked/unverified, method) in markdown and JSON output Both stages are config-gated (research_loop / verification sections), degrade gracefully on any failure, and are documented in the stage pages, environment reference, and .env.example. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Jefz7XDSjxJ2KVYQgSSDpe
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.
Summary
Implements Phase 4 of the improvement roadmap — the final phase. The pipeline now behaves like a deep-research agent: it assesses whether retrieval actually answered the query and refines with follow-up searches when it did not, and it verifies report claims against their sources before publication, flagging what it cannot support instead of presenting it as fact.
Research loop (new stage: relevance scoring → research_loop → fulltext)
sufficient/missing_aspects/follow_up_queries) when synthesis LLM mode is on; otherwise a concept-coverage heuristic: at leastmin_sufficient_paperskept papers and every core query concept matched by at least one paper. The assessment is stored in thecoverage_assessmentartifact for debug dumps.research_loop.max_iterations(default 1).Verification (new stage: gap analysis → verification → citation export)
unverified_points, reports mark them (unverified) in the thematic findings, and both markdown and JSON reports carry an aggregateVerificationSummary(claims checked/unverified, method) — e.g. Claim verification (heuristic): 11/12 key points supported by paper sources.Plumbing
Config sections
research_loopandverification(pydantic + YAML in sync), stage toggles, progress labels, two newAgentRoles with both structured and legacy prompts, stage docs registered in the navigation, and env vars documented in.env.exampleplus the environment reference.Verification
pipenv run pytest tests/— 441 passed (15 new tests: heuristic coverage sufficiency and follow-up generation, loop refinement/budget/failure paths, heuristic claim support and flagging, passage-extended sources, stage artifacts, and report rendering of unverified markers), 1 skippedruff check src tests setups— clean;scripts/check_docs_policy.py— passes (63 nav pages)🤖 Generated with Claude Code
https://claude.ai/code/session_01Jefz7XDSjxJ2KVYQgSSDpe
Generated by Claude Code