Repository navigation
feat(chat)!: Bind per-message actor provenance through runs, plugins, and memory - #785
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
dcramer
marked this pull request as ready for review
July 7, 2026 17:41
…and memory
Instructions from multiple people can join one run (batched mentions,
mid-run steering, continuation), but identity was flattened to a single
latest-wins requester at every projection boundary. By the time anything
reached a plugin, the only author signal left was prompt text — which
must never be treated as authority. Confirmed failure: another
participant's first-person preference stored as the requester's personal
memory.
Record provenance ({ authority: "instruction" | "context", actor })
on every user-role pi_message; project it per-entry through the session
log, projection resets, compaction, and the turn session record, failing
closed to unattributed context for legacy entries. Expose it on the
plugin run contract as run.actor (the actor the run executes as),
run.actors (all distinct instruction actors, a derived projection), and
per-entry provenance with isRunActor.
Memory extraction now cites evidence message indices and a deterministic
router verifies them: personal-scope memories require every cited entry
to be a run-actor instruction (unproven preferences are dropped, never
downgraded); public thread messages reach plugins as context-authority
evidence so conversation-scope knowledge still lands. Strip embedded
thread-context blocks from instruction entries in the plugin projection
so another user's text can never ride inside an instruction-authority
citation.
This also lands the actor naming contract (specs/multi-actor-runs.md):
one identity concept — actor — annotated per instruction; "requester"
is retired vocabulary with the codebase-wide rename tracked in #778.
Refs GH-773
Co-Authored-By: Claude Fable 5 <[email protected]>
The memory eval threads used label-suffixed thread_ts values (e.g. "17000000.memory-bystander") that fail Slack timestamp parsing, so the runtime keyed stored memories by per-message ts while assertions filtered on the thread-based source key: every positive DB assertion could never match and every no-store assertion passed vacuously. Replace them with valid numeric timestamps in both memory eval files — the assertions are now meaningful for the first time. Sharpen the multi-actor rubrics to the precise harm (claiming another participant's preference belongs to the requester) so the judge no longer fails replies that correctly attribute or apply thread feedback, and give the bystander-preference thread real retro content so the recap question is satisfiable. Case 1's DB assertion becomes content-exclusion: whether the requester owns a well-phrased memory of her own words is extraction quality, not this eval's contract. With fixtures fixed, five workflows cases stay correctly red: they document the live memory write/forget tool paths failing, previously masked by the vacuous assertions. Tracked in #784; the evals are the evidence and must not be relaxed to green. Refs GH-773 Refs GH-784 Co-Authored-By: Claude Fable 5 <[email protected]>
… actor records Address three review findings against the per-message provenance work: Turn-session records written before this deploy persist the bound identity as 'requester'; rehydration now decodes that legacy field as the actor when the new field is absent, so in-flight OAuth resumes and continuations keep their bound user across the rollout. Malformed values still fail closed. Mid-run steering checkpoints committed drained messages under the run actor's default provenance, tagging another author's steered message as the run actor's instruction. Steering commits now thread each drained message's own provenance through resume and the session log as an explicit trailing override, with alignment guards that throw instead of guessing. Compaction recovered retained-message provenance through a sanitized-text map, so two authors with identical wording collided and the later author overwrote the earlier. Retained messages now keep their source projection index and provenance is copied by index. Refs GH-773 Co-Authored-By: Claude Fable 5 <[email protected]>
dcramer
force-pushed
the
eval/multi-actor-provenance
branch
from
July 8, 2026 02:17
099a1fc to
1703b34
Compare
Address review findings on the provenance work: Conversation-scope memory evidence now accepts attributed instruction messages from participants other than the run actor. Text-dedup between context and run entries could leave only the instruction copy of a co-participant's message, which the router previously rejected — blocking the shared-knowledge path this change set exists to keep open. Personal scope still requires run-actor instruction citations only. pluginRunContextSchema.actor is optional again: legacy completed records predate first-class run actors, and a required field made ctx.run.load() throw at parse time for them. Absent actor means unavailable authority. Stale passive-extraction cache entries without evidenceMessageIndices are discarded and re-extracted instead of failing the retried task until the cache expires. Also adds a regression test for Slack identity-key delimiter collisions (already NUL-delimited on this branch; the reviewed commit predated the rebase). Refs GH-773 Co-Authored-By: Claude Fable 5 <[email protected]>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 7874c3c. Configure here.
The plugin transcript's public-thread context entries were read from persisted thread state at task time with no cutoff, so messages posted after the run completed could appear as that run's context-authority evidence and be cited by passive memory extraction. Context entries are now bounded to messages whose runtime timestamp is at or before the record's completion time; messages without a usable timestamp are excluded, since inclusion grants evidentiary standing. Refs GH-773 Co-Authored-By: Claude Fable 5 <[email protected]>
5 of 8 tasks
This branch was successfully deployed
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.

A run's instructions can come from multiple people (batched mentions, mid-run steering, continuation), but identity was flattened to a single latest-wins requester at every projection boundary — by the time anything reached a plugin, the only author signal left was prompt text, which must never be treated as authority. Confirmed failure: Bob posts "I prefer terse code reviews" in Alice's thread and it lands as Alice's personal memory. This is the confused deputy problem tracked in #773; this PR is Track 1.
The runtime now records provenance (
{ authority: "instruction" | "context", actor }) on every user-role message and carries it per-entry through the session log, projection resets, compaction, and the turn session record, failing closed to unattributed context for legacy entries. Memory extraction must cite evidence message indices, and a deterministic router verifies them: personal-scope writes require every cited entry to be a run-actor instruction (unproven preferences are dropped, never downgraded), while public thread messages now reach plugins as context-authority evidence so shared operational knowledge still becomes conversation-scope memory. Instruction entries in the plugin projection are stripped of embedded thread-context blocks so another user's text can never ride inside an instruction-authority citation.This also lands the naming contract from
specs/multi-actor-runs.md: one identity concept — actor — annotated per instruction. "requester" is retired vocabulary; the codebase-wide rename is #778.Breaking plugin contract (
@sentry/junior-plugin-api); all in-repo consumers are updated:The multi-actor evals were written first and red (
packages/junior-evals/evals/memory/multi-actor-provenance.eval.ts); they pass deterministically with this change. Along the way both memory eval files turned out to have label-suffixedthread_tsfixtures that fail Slack timestamp parsing, which mis-keyed every stored memory and made all DB assertions silently vacuous — fixtures are repaired here, so those assertions are meaningful for the first time. Fiveworkflows.eval.tscases are now correctly red: they document the live memory write/forget tool paths failing, a pre-existing bug the vacuous fixtures had masked (#784). They are intentionally left red as evidence.Review order:
chat/state/session-log.ts(the provenance primitive) →chat/state/turn-session.ts→chat/plugins/task-runner.ts+junior-plugin-api/src/tasks.ts(the contract) →junior-memory/src/process-session.ts(the deterministic router) →specs/multi-actor-runs.md.Refs GH-773
Refs GH-784
🤖 Generated with Claude Code