citations: consolidate prompts, retire eager path, refresh ADR

Rewrite the main-agent citation contract to a single [n] channel and sync
the orphaned system_prompt_composer surface to match; drop stale
[citation:chunk_id] / <chunk_index> references from dynamic_context and
provider hints. Reuse the shared hybrid search in the deliverables report
(citations omitted for now) and delete the orphaned report KB helper.
Remove the dead eager KnowledgePriorityMiddleware wiring (knowledge_priority
+ stack) and its legacy browse test. Update ADR 0001 to reflect the cutover.
This commit is contained in:
CREDO23 2026-06-25 15:27:09 +02:00
parent 49d675c065
commit ce15016533
20 changed files with 316 additions and 1127 deletions

View file

@ -86,9 +86,10 @@ class TestCompose:
# Tools
assert "<tools>" in prompt
assert "</tools>" in prompt
# Citations on by default
# Citations on by default — the [n] / <retrieved_context> contract
assert "<citation_instructions>" in prompt
assert "[citation:chunk_id]" in prompt
assert "<retrieved_context>" in prompt
assert "[1][2]" in prompt
def test_team_visibility_uses_team_variants(self, fixed_today: datetime) -> None:
prompt = compose_system_prompt(
@ -116,9 +117,9 @@ class TestCompose:
def test_citations_disabled_swaps_block(self, fixed_today: datetime) -> None:
prompt_on = compose_system_prompt(today=fixed_today, citations_enabled=True)
prompt_off = compose_system_prompt(today=fixed_today, citations_enabled=False)
assert "Citations are DISABLED" in prompt_off
assert "Citations are DISABLED" not in prompt_on
assert "[citation:chunk_id]" in prompt_on
assert "Citation markers are **disabled**" in prompt_off
assert "Citation markers are **disabled**" not in prompt_on
assert "<retrieved_context>" in prompt_on
def test_enabled_tool_filter_only_includes_listed_tools(
self, fixed_today: datetime