Repository navigation
feat(services): read a project's linked chats as their own evidence lane - #1690
Merged
Merged
Conversation
Collaborator
Author
|
Resume fix verified on the new large-document benchmark (cli-testing#185):
So the stall is fixed by this PR alone. 🤖 Generated with Claude Code |
gatherProjectEvidence takes linkedChats: [{ provider, account, chat }] (at
most 16, the host's confirmed member-of links). Each chat in scope becomes a
lane (kinds ["linked-chat"], query null, chat <reference>) read whole through
the selected source of its own account; a chat whose account is outside
sources is listed as out-of-scope and never read, with no account fallback.
Items found only that way are labelled context "linked-chat" and get no
around; a reference a word lane also finds keeps context "project". The
result lists every linked chat with ref, source, lane and state.
The context reader takes an optional chat in place of query: it reads that
chat or mail thread newest first, including a chat hidden from search, with
coverage.matching "chat". Cursor scope hashes chat only when present, so old
cursors stay valid. Record reads by reference see hidden chats too, so their
fingerprints can be rechecked at staging.
Checkpoints stay version 1. A run without linked chats keeps its fingerprint;
a changed link set is refused with "start again without --cursor".
knowledge.relate accepts a chat reference as the from of member-of to a
project (NEED-1575 A), and confirmRelation confirms it.
Also fixes a resumed gathering that read nothing when every open unit
already had a page: rounds now start at the shallowest open unit.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
leemour
force-pushed
the
feat/evidence-linked-chats
branch
from
October 20, 2026 18:55
c951474 to
1c4d9e5
Compare
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.
Core slice of the linked-chats plan (item 4.3 of the evidence follow-ups; owner answers NEED-1575 A, NEED-1576 A).
What changes
gatherProjectEvidencelinkedChats?: { provider: string; account: string; chat: string }[](at most 16). These are the host's confirmedmember-oflinks. Core checks only their shape and refuses one chat given twice.mailforprovider: "email", otherwisemessage). If its account is not insources, the chat is never read and there is no fallback to another account.{ id, kinds: ["linked-chat"], query: null, people: [], chat: "chat:<provider>/<account>/<chat>" }. Its ids come after the word lanes. It has one unit per 90-day chunk, and those units come after all word units, so in each round a word lane labels a shared hit first.context: "linked-chat", the first 300 characters as the excerpt, and noaround. When several lanes find a reference it keeps the strongest context:project>linked-chat>person-only.linkedChats: [{ provider, account, chat, ref, source: number | null, lane: string | null, state: "in-scope" | "out-of-scope" | "unavailable" }].version: 1. A run without linked chats keeps its old fingerprint and checkpoint. A run with linked chats stores the optionallinkedChatshash. If the links changed, the run is refused with "the project's linked chats changed; start again without --cursor".Context reader: an optional
chattakes the place ofquery. It reads one chat or mail thread, newest first, and also reads a chat hidden from search. It reportscoverage.matching: "chat"andindex: "ready"(no word index is used), andavailable: falsewhen the chat is not stored. It is refused together withqueryand on document or meeting sources. The cursor scope includeschatonly when one is given, so old cursors stay valid.knowledge.relate: a chat reference may be thefromofmember-ofto aproject:, andconfirmRelationworks on that link. The account comes from the reference itself. A scope key for another account is refused, and a chat cannot be related to anything else.Also
contextRecords.readnow resolves messages in chats hidden from search, so evidence from a linked hidden chat can be staged.Checks
pnpm typecheck,pnpm lint,pnpm docs:check, the fullpnpm test(5850 passed, 14 skipped) andbun run scripts/smoke.ts, all sandboxed.🤖 Generated with Claude Code