Skip to content

fix(server): conversation summaries name the peer who spoke - #131

Merged
ScriptedAlchemy merged 27 commits into
mainfrom
t3/peer-reply-summary-attribution
Nov 17, 2026
Merged

ScriptedAlchemy merged 27 commits into
mainfrom
t3/peer-reply-summary-attribution

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Nov 16, 2026 •

Copy link
Copy Markdown
Owner

Why

In a group conversation, a seat model's reply is a peer's words. Production summaries said "The assistant answered…" for them, crediting the thread's own agent, because the peer reached the summarizer as a nameless assistant message. Assisted learning read the same messages and could save a peer's proposal as a fact.

What changed

  • Summary and assisted-learning input give a peer reply a peer role with { label, model }, printed as [M2] peer Astra (gpt-6-astra):. A seat named by its model is named once. No prompt rule was added: the eval below showed none helped, so prompts for threads without peers are byte-identical to main.
  • Assisted learning saves a decision only with a user citation. Corroboration now counts a seat's own thread and the replies it published into the parent as one source (the publication run names its seat thread), so a peer cannot corroborate itself into a convention or constraint.
  • ProjectKnowledgeSource and summary sources gain an optional speaker. t3_knowledge_read_source, t3_conversation_summary_expand, and the web, desktop and mobile source labels (summaries and knowledge) read Astra (gpt-6-astra).
  • ProjectionStoreV2.getPeerSpeakers seeks the message or type index, which a query-plan test pins. Summary verification still pays one speaker read, now inside readSources.

Scope

  • New summary passes, assisted learning, read-source and expand results, and source labels. Stored summaries keep their old attribution; rewriting them is a follow-up.
  • Handoffs still render a peer reply as a historical user message, since there the receiving model is in the conversation.
  • The decision gate accepts any cited user message that is not a bare acknowledgement, including a question like "Where should sessions live? I have not decided." A model citing it can still save a peer's proposal as a decision. Code cannot tell acceptance from a question, so this PR adds no heuristic for it.

Verification

evals/conversation-summaries, 8 samples per case on morph-kimik31 through Morph's free API. main sends the peer as a nameless assistant, peer-as-user renders it as handoff history does, no-rule named the peer without the prompt rules, full named it with them.

Arm Leaf: peer proposal Leaf: control Knowledge: peer proposal Knowledge: control
main 0/8 8/8 8/8 8/8
peer-as-user 8/8 8/8 — —
no-rule 8/8 8/8 8/8 8/8
full 8/8 8/8 8/8 8/8
  • main reproduces the production failure: "The assistant first recommended dropping Redis and using Postgres for sessions". Naming the peer fixes it.
  • Summary peer rule: cut, since no-rule passed 8/8 like full. Knowledge peer rule: cut, since the knowledge case passed 8/8 on main and no-rule. The knowledge cases and the no-rule arm were then removed, since without a rule they guard nothing this PR changes.
  • The roll-up cases (no peer) ran once: reversal 5/8, control 8/8. The three misses are the existing "tests" rule not accepting "reported 41 passing tests".
  • The grader now flags assistant as well as user and agent as the subject, and every review sentence is a row graded through the full leaf grade. Regexes still miss paraphrase, so read the statements too.
  • The earlier gpt-6-luna and morph-dsv41flash numbers on this PR were scored by a grader later found to pass the production failure, so they prove nothing.
  • Failing tests landed first for the grader rows and for corroboration across a seat and its publications. Earlier fixes (the decision gate, the read-source speaker) shipped with their tests in the same commit.
  • Touched tests pass: eval grader 31, provider-core prompts 3, server knowledge and summaries 105. vp run check:changed passes (244 tests in 9 files, typecheck of 37 packages).

🤖 Generated with Claude Code

@changeset-bot

changeset-bot Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 521c296

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

ScriptedAlchemy and others added 2 commits November 16, 2026 03:43
A seat model's reply is still handed to the summarizer as the user, and to assisted learning as the assistant. These tests require a peer role that carries the speaker.

Co-authored-by: Cursor <cursoragent@cursor.com>
The summarizer was given a peer reply as the user, so a seat model's proposal could be stored as the user's decision. Summary input now carries a peer role, and the prompt attributes those words to the speaker by name.

Grok 4.7 through Cursor.

Co-authored-by: Cursor <cursoragent@cursor.com>
@ScriptedAlchemy ScriptedAlchemy changed the title fix(server): conversation summaries attribute group-seat replies to the peer fix(server): conversation summaries name the peer who spoke Nov 16, 2026
ScriptedAlchemy and others added 23 commits November 16, 2026 04:21
The leaf grader treats any Postgres mention as Astra's proposal, and it misses a user who agrees or an agent who proposes it.

Co-authored-by: Cursor <cursoragent@cursor.com>
An open choice that names Postgres was graded as Astra's proposal. A user who agrees or chooses Postgres, and an agent who proposes it, now fail on their own.

Co-authored-by: Cursor <cursoragent@cursor.com>
…e user's

The knowledge prompt names the peer twice in parentheses and tells the model to put that name in a fact that has to stand alone.

Co-authored-by: Cursor <cursoragent@cursor.com>
A saved fact has to stand alone, so the knowledge rule no longer asks for the peer's name. The source line names that peer once.

Co-authored-by: Cursor <cursoragent@cursor.com>
Ordering that read by ordinal makes SQLite walk every item in the thread, even when the caller already named the messages.

Co-authored-by: Cursor <cursoragent@cursor.com>
The rows land in a map keyed by message. Sorting them by ordinal made SQLite walk every item in the thread instead of the message index.

Co-authored-by: Cursor <cursoragent@cursor.com>
The summary request widened every row to an optional speaker, and the prompt type rejected that.

Co-authored-by: Cursor <cursoragent@cursor.com>
Corroboration counted a peer's reply and the seat's own copy in its seat
thread as independent evidence, so a peer proposal could be saved as a
decision with no user citation. Decisions now need user support.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
t3_knowledge_read_source presented a peer reply as the thread's assistant.
ProjectKnowledgeSource now carries an optional speaker, attached in
knowledge.readSources, and summary expansion reuses it instead of a second
lookup. The speaker query moves onto ProjectionStoreV2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A seat without a label falls back to its model, so labels and prompts
rendered "gpt-x (gpt-x)". Also drops the exact-wording prompt and label
tests; the conversation-summaries eval covers wording.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The leaf grader failed open statements such as "the user has yet to
decide" and passed wrong ones such as "the user went with Postgres".
The patterns now need the user or agent to be the subject of an
affirmative verb, and catch "per the user". Every reviewed sentence is a
row. Adds a knowledge-candidates case where a peer proposes and no
decision may come out, with a plain-convention control, and gives the
peer case its real source.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
--arm main, peer-as-user, no-rule and full reproduce each way a peer reply
has reached the model, from one checkout. A morph-* model calls Morph
directly with the production prompt builders and reply decoder, waiting
out its per-minute token limit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The helper kept only mustNot failures, so a row the attributed rule failed
looked green, and the assistant phrasing production wrote was never tried.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…bare proposal

Production wrote "The assistant answered…" for the peer's words, and the
grader only knew user and agent. A proposal noun with no subject no longer
needs Astra, and words that keep a choice open stop a match.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The user asked and hedged, so every arm returned nothing. Now Astra proposes
Postgres and the agent agrees and starts the migration while the user never
accepts. The peer-as-user arm skips knowledge, which never rendered peers so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both views printed the raw role, so a peer source read "assistant". They now
use the author label the summary views use.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A seat's own thread and its published reply in the parent corroborated each
other, so the peer's words were saved as a convention.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Assisted learning counted a peer's published reply in the parent and the
seat's own thread as two threads, so one speaker corroborated itself. The
publication run names its seat thread; both gates now count by it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rule

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The peer rules now appear only when a peer message is in the input.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On morph-kimik31, naming the peer was enough: the leaf peer case passed 8/8
without the summary rule, and the knowledge case passed 8/8 on main and
without the knowledge rule. With no rule left, prompts without a peer match
main and the conditional and its test go too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With the prompt rules gone, no-rule equals full, and a knowledge prompt
without a peer is main's, so neither knowledge case guards this change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ScriptedAlchemy
ScriptedAlchemy merged commit 93b610b into main Nov 17, 2026
20 checks passed
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