Commit graph

404 commits

Author SHA1 Message Date
DESKTOP-RTLN3BA\$punk
9642d7ced0 feat: antropic model added fix & kb tooling fixes
- Updated main-agent middleware to clarify that both filesystem reads/writes and knowledge-base retrieval are handled by the `knowledge_base` subagent.
- Introduced `_forward_mention_pins` function to carry `@`-mention pins into subagent state.
- Revised system prompts to reflect the new retrieval method and ensure proper citation handling.
- Removed the `search_knowledge_base` tool and its related tests, consolidating functionality under the `task` tool.
- Enhanced documentation to guide usage of the new retrieval approach and citation practices.
2026-06-25 20:19:44 -07:00
Rohan Verma
94fdb8a113
Merge pull request #1539 from CREDO23/improve-chat-agent-context-and-citations
[FEAT] Unified [n] citation registry for KB + web, pull-based retrieval
2026-06-25 13:34:52 -07:00
Rohan Verma
5a6ea29610
Merge pull request #1537 from DhruvTilva/test/validators-unit-tests
test: cover validation helpers with unit tests
2026-06-25 13:33:03 -07:00
Rohan Verma
96e42a1003
Merge pull request #1536 from CREDO23/feature-mention-chat-in-chat
[Feat] Chat : Reference past chats via @-mention as read-only context
2026-06-25 13:32:25 -07:00
CREDO23
232cc937c5 docs: remove ADR 0001 (RAG/citation architecture shipped)
The RAG/citation/context redesign in ADR 0001 is implemented and validated
(KB + web on the unified [n] citation spine, pull-based retrieval, eager path
retired). Drop the ADR and the one stale docstring reference to it.
2026-06-25 18:50:58 +02:00
CREDO23
2beafbdec8 agent: retire eager KB priority/planner path and its dead flags
The pull-based KB design (on-demand search_knowledge_base tool + pre-injected
workspace tree) fully replaced the old eager retrieval path. Remove its last
remnants:

- Delete KnowledgePriorityMiddleware (knowledge_search.py) and its tests.
- Drop the kb_priority state field + reducer default; trim
  KbContextProjectionMiddleware to project only workspace_tree_text.
- Remove the now-dead feature flags enable_kb_priority_preinjection and
  enable_kb_planner_runnable across backend (flags, route schema, tests,
  env examples) and frontend (settings toggle, zod schema).
- Scrub <priority_documents> and stale KnowledgePriorityMiddleware references
  from prompts, docstrings, and the ADR.

No functional change: nothing wrote kb_priority and neither flag gated live
behavior after the cutover. Full backend suite green (pre-existing unrelated
failures aside).
2026-06-25 18:37:14 +02:00
CREDO23
0148647b98 prompts: remove orphaned system_prompt_composer surface
The legacy system_prompt_composer fragments and its default_system_instructions
wrapper were no longer referenced by any live code path (the main-agent prompt
builder owns composition now). Delete the whole orphaned tree and its test.
2026-06-25 18:37:04 +02:00
CREDO23
5bda944321 citations: normalize word-glued [n] markers
The model frequently writes citations glued to the preceding word
(docs[17]); the (?<!\w) lookbehind (added to dodge arr[1] array indexing)
silently skipped these, leaving raw [n] that fails to render and reads
like array access. Drop the lookbehind so glued citations resolve; genuine
code/array syntax stays protected by the existing code-region carve-out and
unresolved ordinals still drop harmlessly.
2026-06-25 16:28:31 +02:00
CREDO23
ce15016533 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.
2026-06-25 15:27:09 +02:00
CREDO23
49d675c065 web-search: register results on the citation registry (Channel B -> A)
web_search now registers each result as a WEB_RESULT (locator {url}) and
renders a <web_results> block of <document view="excerpt"> [n] passages,
returning Command(update={messages, citation_registry}) like
search_knowledge_base. Collapse the duplicate research-subagent web_search
into the shared tool and teach the prompts to cite web hits with [n].
2026-06-25 15:26:51 +02:00
CREDO23
c98bdea5cf search-kb: on-demand KB tool on the [n] spine; drop kb_matched_chunk_ids
The main agent's search_knowledge_base tool runs the hybrid spine, renders
a <retrieved_context> of numbered [n] passages, and persists the registry.
KB subagent prompts teach citing [n] from <document view="full"> reads
(evidence.chunk_ids -> evidence.citations). Delete the now-unused
search->read highlighting hand-off: the kb_matched_chunk_ids state field,
its reducer default, the tool's _matched_chunk_ids writer, and the dead
KnowledgePriorityMiddleware writes.
2026-06-25 15:26:39 +02:00
CREDO23
04a76b163b citations: conversation-scoped registry with finalize-time [n] resolution
Add the checkpointed CitationRegistry (load/merge helpers + state field)
and a lightweight CitationStateMiddleware so subagents can register into
the same conversation registry. Resolve [n] -> [citation:<payload>] at
stream finalize from the registry, polymorphically by source type.
2026-06-25 15:26:25 +02:00
CREDO23
265888d21c document-render: unify KB/web rendering on numbered [n] passages
Add a shared document_render package that renders sources as
<document view="excerpt|full"> blocks with server-assigned [n] passage
labels (KB locator {document_id, chunk_id}, web locator {url}). Wire the
KB read backend (kb_postgres) and read_file to the new renderer and drop
the legacy per-document XML renderer (document_xml, retrieved_context) and
the old chunk_index / matched="true" / <chunk id> read format.
2026-06-25 15:26:16 +02:00
CREDO23
915ad80e19 retrieval: add unit tests for pure components 2026-06-25 08:23:30 +02:00
CREDO23
26a1431e87 retrieved_context: drop document completeness concept 2026-06-25 08:23:29 +02:00
CREDO23
6bb20df510 citations: rewrite model [n] ordinals to frontend [citation:] markers 2026-06-25 06:48:25 +02:00
Anish Sarkar
d6bffa6f07 chore: fix linting 2026-06-25 04:31:22 +05:30
CREDO23
db442b3961 retrieved_context: renderer tests 2026-06-24 22:38:47 +02:00
CREDO23
939bfb2c18 references: discriminated per-kind reference types 2026-06-24 22:07:54 +02:00
CREDO23
efe9429133 references: connector field tests 2026-06-24 21:52:31 +02:00
CREDO23
5faf0da5bf references: folder path tests 2026-06-24 21:48:52 +02:00
CREDO23
7e147137d6 references: pointer renderer tests 2026-06-24 21:42:17 +02:00
CREDO23
ff5ea157bb test(chat): add citation registry tests 2026-06-24 21:35:19 +02:00
DhruvTilva
ca21a03775
test: add unit tests for validators 2026-06-23 23:29:56 +05:30
CREDO23
208ad9a643 test(chat): cover referenced-chat resolver and transcript budgeting
Add unit tests for role-specific turn extraction in the resolver and for
the transcript renderer: full rendering within budget, dropping oldest
turns with a marker, partial-tail fill of an overflowing turn, and
multi-chat tagging.
2026-06-23 17:04:43 +02:00
Anish Sarkar
bf8772e312 Merge remote-tracking branch 'upstream/dev' into feat/auth-revamp 2026-06-23 15:52:11 +05:30
Rohan Verma
cb9da1bc8b
Merge pull request #1533 from Glodykajabika/test/blocknote-to-markdown-unit-tests
Test/blocknote to markdown unit tests
2026-06-23 02:25:42 -07:00
Anish Sarkar
3695e1d5c5 Merge remote-tracking branch 'upstream/dev' into feat/api-key 2026-06-23 13:09:53 +05:30
Anish Sarkar
7241a7a894 fix(authz):add zero context authorization checks 2026-06-23 12:55:25 +05:30
DESKTOP-RTLN3BA\$punk
a08de01cc7 Revert "Merge pull request #1523 from CREDO23/fix/chat-citations"
This reverts commit cd2242147a, reversing
changes made to a4bb0a5253.
2026-06-22 22:55:29 -07:00
Glody Kajabika
5625ca1d5d test: add unit tests for blocknote_to_markdown 2026-06-23 01:42:10 +02:00
Thierry CH.
fb955d3201
Merge pull request #1525 from yuvrajsingh2428/test/async-retry-unit-tests
test: add unit tests for async_retry.raise_for_status
2026-06-22 22:44:22 +02:00
Thierry CH.
b86846e809
Merge pull request #1530 from Anofff/test/content-utils-unit-tests
test: add unit tests for content_utils text helpers
2026-06-22 20:17:06 +02:00
Anofff
bf9be8face test: add unit tests for content_utils text helpers 2026-06-21 17:47:41 +00:00
Yuvraj Singh
6926b7a8fe test: add unit tests for async_retry.raise_for_status 2026-06-20 17:05:57 +05:30
Anish Sarkar
fd31ac34fd Merge remote-tracking branch 'upstream/dev' into feat/api-key 2026-06-20 10:50:03 +05:30
Anish Sarkar
1e8baa10ec refactor(routes): replace user variable with auth context in tests 2026-06-20 03:34:40 +05:30
Anish Sarkar
af5a112212 refactor(auth): replace user variable with auth context in integration and unit tests 2026-06-20 03:11:00 +05:30
Anish Sarkar
b3fa96bef8 test(auth): cover PAT fail-closed authorization 2026-06-20 02:13:05 +05:30
CREDO23
1cb7633920 Merge upstream/main into fix/chat-citations 2026-06-19 18:25:37 +02:00
CREDO23
73dd4e8e3a feat: embed line-citation tokens in search hits 2026-06-19 17:37:41 +02:00
CREDO23
188ae053ac feat: serve numbered source_markdown reads with citation preamble 2026-06-19 17:37:41 +02:00
CREDO23
691685dd16 test: cover read preamble and matched line ranges 2026-06-19 15:43:21 +02:00
CREDO23
7d7cb12a43 test: cover matched-passage hit rendering 2026-06-19 14:53:49 +02:00
CREDO23
90502d21d3 test: cover char-span line-range helper 2026-06-19 14:53:49 +02:00
CREDO23
5ed62e712b test: stub build_chunk_embeddings in parity tests 2026-06-18 20:17:45 +02:00
CREDO23
a0046483a9 test: assert chunker routing via use_code_chunker flag 2026-06-18 20:06:33 +02:00
CREDO23
94229213f4 test: cover span chunker invariants 2026-06-18 20:06:33 +02:00
Anish Sarkar
9005e992c0 feat: add unit tests for LLM bundle streaming functionality
- Introduced a new test file to validate the LLM bundle construction for streaming flows in chat.
- Implemented tests to ensure that both DB-backed and global models enable streaming correctly.
- Utilized mocking to isolate dependencies and verify the expected behavior of the LLM constructor.
2026-06-18 23:32:36 +05:30
DESKTOP-RTLN3BA\$punk
55f91a29d5 chore: linting 2026-06-17 22:31:36 -07:00