Skip to content

[codex] fix verification source ordering - #2

Merged
sarthakagrawal927 merged 3 commits into
mainfrom
codex/verification-citation-sources
Jun 13, 2026
Merged

[codex] fix verification source ordering#2
sarthakagrawal927 merged 3 commits into
mainfrom
codex/verification-citation-sources

Conversation

@sarthakagrawal927

Copy link
Copy Markdown
Member

What changed

  • Wired citation verification to the same source ordering the model sees, including graph-route sources plus retrieval sources.
  • Added a small helper to flatten verification sources in prompt order.
  • Added a regression test that locks graph-first / retrieval-second ordering.

Why

  • The prompt numbering was already combined across graph and retrieval sources, but verification still saw only the retrieval hits.
  • That could make citation verification reason over a different source set than the model and final citations, which weakens the gate and traceability.

Validation

  • uv run pytest -q tests/test_query_synthesis.py tests/test_duckdb_helpers.py
  • uv run ruff check src/kb/query/engine.py tests/test_query_synthesis.py

@sarthakagrawal927
sarthakagrawal927 force-pushed the codex/verification-citation-sources branch 2 times, most recently from 927a0e7 to 3ae59d4 Compare June 13, 2026 05:46
@sarthakagrawal927
sarthakagrawal927 marked this pull request as ready for review June 13, 2026 05:47
@sarthakagrawal927
sarthakagrawal927 force-pushed the codex/verification-citation-sources branch from 3ae59d4 to 6f48e95 Compare June 13, 2026 05:49
@sarthakagrawal927
sarthakagrawal927 merged commit 8266898 into main Jun 13, 2026
2 checks passed
@sarthakagrawal927
sarthakagrawal927 deleted the codex/verification-citation-sources branch June 13, 2026 05:51
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