Repository navigation
TR-1208 Decisions keep who decided, when and where; answers cite them - #10
Conversation
…rry them kind=decision documents take decided_by, decided_at, changed_by, changed_at, pr, where, repo, project and added_by in metadata (decided_by and decided_at required). Fast, sources and deep answers show the decider and date in front of each decision passage and put the metadata on the citation. search and ask take a kind filter, and GET /v1/documents lists documents by kind, paged by a keyset cursor. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
factory/review: changes requested (round 1, head 88bb21a)Verdict: changes. One finding blocks: the deep-mode kind check (F1). It is a one-line fix plus one test. The rest of this PR is solid. Every mutation I tried was caught, and paging one row at a time gives exactly the single-page list. Findings
What I verifiedAll runs were on 88bb21a, in
Mutations. Each one was caught by a failing test, then restored.
Probes. I added these for the review and then removed them.
Your three questions
Not verified
A second model challenged this review. Its prompt-injection-via-names point was rejected: the passage text and the title already reach the prompt unescaped from the same ingest key, so names open no new channel. ashish-crew-reviewer |
…e the decided_at sort in usage Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
factory/review: pass (round 2, head 8696a53)Verdict: pass. F1 and F4 are fixed. F2 and F3 stay open as P3 follow-ups and don't block.
What I verifiedAll runs were on 8696a53, in
Not verified
Merging is by hand: lore needs a GitHub approval. ashish-crew-reviewer |
Ticket: TR-1208 (M2, software-second-brain). The release is TR-1221 (Ashish), not part of this PR.
What changed
POST /v1/documentstakeskind: "decision". Metadata fields, names exactly as the tares side (TR-1210..1212) will send them:decided_by(list of names, required),decided_at(YYYY-MM-DDor RFC 3339, required),changed_by,changed_at,pr,where(repo_folder|factory_project|by_hand),repo,project,added_by. Bad values are a 400 in the existing style. Other kinds are unchanged.0011_decision_kind.sqlwidens thedocuments.kindCHECK to allowdecision. No new column: the metadata stays in the existingmetadataJSON.[1] Title (decision, decided by Ashish Bagri on 3 August 2026)in front of each decision passage (fast, sources and deep modes), and the system prompts say to name who decided and when. Missing or empty values are left out, never "None".metadatafor decisions (omitted for other kinds and when nothing usable is stored).GET /v1/documents/{id}returns it.kindfilter onGET /v1/searchand/v1/ask, applied in SQL before the cut to k; in deep mode the request's filter overrides the search tool's ownkind.GET /v1/documents?kind=decision&source=&limit=&cursor=: read key, tenant scoped, newest decided first, keyset cursor (next_cursor, null on the last page), limit 1..200 (default 50).docs/usage.md: a Decisions section with the field table, an example and the listing.Checks (run on this branch, in the rust:1.95 image against the local pg17)
cargo test --all-targets --no-fail-fast: lib 344 passed, 0 failed, 2 ignored; every target passed exceptcli_search(3 passed, 2 failed) and onecli_repopool timeout that passed on rerun (13 passed).cli_searchfailures:no_hits_is_a_note_on_stderr_and_still_successandplain_output_is_path_lines_score_symbols_and_three_snippet_lines. The stderr getsonnxruntime cpuid_info warning: Unknown CPU vendorfrom the aarch64 docker VM, ahead of any lore output; the diff insrc/cli/search.rsis two lines of kind plumbing. I did not run a clean main to prove it, so CI on x86 is the check.cargo test --lib --test decisions: 344 + 13 passed, 0 failed.cargo clippy --all-targets -- -D warnings: finished, no warnings.cargo fmt --check: rc 0.metadata: hit.decision.clone()insrc/answer/fast.rsreplaced bymetadata: None,decision_citation_has_who_and_when_in_the_prompt_and_on_the_citationfailed (citation metadataNull); with the prompt label replaced by the plain kind it failed at the prompt assertion. Both restored, test passes again.The decision citation test is
decision_citation_has_who_and_when_in_the_prompt_and_on_the_citationintests/decisions.rs.Notes for the reviewer
decided_byanddecided_atonly (git always gives an author and a date; by-hand names the decider). Limits: 50 names, 256 bytes a name, 2048 bytes forpr.added_by; the working doc has it, so it is included.