Skip to content

test(evals): Add multi-actor provenance evals and mailbox batch harness support - #774

Merged
dcramer merged 3 commits into
mainfrom
eval/multi-actor-provenance
Jul 7, 2026
Merged

dcramer merged 3 commits into
mainfrom
eval/multi-actor-provenance

Conversation

@dcramer

@dcramer dcramer commented Jul 7, 2026 •

Copy link
Copy Markdown
Member

Adds TDD eval coverage for the actor/instruction provenance work in #773: four multi-user Slack thread scenarios where Alice is the run requester and Bob is another participant, asserting against the memory plugin's stored rows plus a reply-attribution rubric.

Two cases are intentionally red — they are the acceptance gates for the provenance fix, not eval bugs:

  • Batched cross-actor mention: when Bob's pending mention batches into Alice's turn, the reply attributes his first-person preference to Alice ("You asked for short bullet summaries" — she didn't). Reproduced through the real mailbox batching path; whether it fails on a given run depends on the model honoring prompt-text author labels from fix(slack): Attribute current instructions by author #772, which is exactly the fragility the provenance fix removes.
  • Cross-author conversation knowledge (fails deterministically): operational knowledge stated by a passive participant never reaches passive memory extraction today — it only exists in runtime context blocks that stripRuntimeTurnContext removes from the plugin transcript, so no conversation-scoped memory is ever created from it.

The two sequential-turn cases pass today and guard against over-tightening: per-turn attribution already holds when each message gets its own run, and the fix must not break that.

To make the batched arrangement expressible, the eval harness gains a batch() event builder (message_batch event). Batch members persist through the real Slack ingress boundary (buildSlackInboundMessage → appendAndEnqueueInboundMessage) and are claimed by the real conversation worker as one mailbox batch — the last message becomes the live turn, earlier ones arrive as queued context, exactly the production flow. Two harness seams support this: worker-claimed turns deliver through the harness TestThread (the worker's restored thread has no posting surface on the eval adapter), and the FakeSlackAdapter fixture gains single-workspace internals (botUserId, defaultBotTokenProvider) so runWithSlackInstallation treats it as a default-token install. Non-batch events keep the existing direct delivery path unchanged.

Review order: src/helpers.ts (the batch() builder), src/behavior-harness.ts (the message_batch ingress path and worker thread seam), then the eval file.

Refs #773

🤖 Generated with Claude Code

…ss support

Add TDD evals for issue #773 covering per-message actor provenance in
multi-user Slack threads: a bystander's first-person preference must not
become the requester's personal memory (sequential, conflicting, and
batched-mention arrangements), while cross-author operational knowledge
should still produce conversation-scoped memory.

Add a batch() event builder plus a message_batch harness event so a
scenario can express messages that are pending together in the
conversation mailbox and handled as one worker turn, matching production
mailbox batching. Previously the scenario runner delivered each event to
completion, so the batched multi-actor paths were not expressible.

The shared-knowledge case is an intentional TDD red: passive
participants' messages never reach memory extraction today because
runtime context blocks are stripped from the plugin transcript. The
batched-mention case is model-dependent today and becomes deterministic
once runtime-owned provenance lands.

Refs GH-773
Co-Authored-By: Claude Fable 5 <[email protected]>
@vercel

vercel Bot commented Jul 7, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
junior-docs Ready Ready Preview, Comment Jul 7, 2026 4:27am

Request Review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 5d1f437. Configure here.

The message_batch event previously enqueued each member through the
harness's direct delivery path, which runs a full turn per message and
never exercises production mailbox batching (caught by review). Batch
members now persist through the real Slack ingress boundary
(buildSlackInboundMessage + appendAndEnqueueInboundMessage) so the
conversation worker claims them as one turn: the last message is live
and earlier ones arrive as queued context, exactly as in production.

Worker-claimed turns deliver through the harness TestThread because the
worker's restored thread has no posting surface on the eval adapter,
and the FakeSlackAdapter fixture gains single-workspace internals
(botUserId, defaultBotTokenProvider) so runWithSlackInstallation treats
it as a default-token install.

With the real path, the batched multi-actor eval reproduces the exact
issue #773 failure: the reply attributes the other user's first-person
preference to the live requester ('You asked for short bullet
summaries').

Refs GH-773
Co-Authored-By: Claude Fable 5 <[email protected]>
@dcramer
dcramer marked this pull request as ready for review July 7, 2026 04:19
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Jul 7, 2026
Hardcoding botUserId on the shared FakeSlackAdapter fixture changed
leading-mention stripping from generic to exact-id matching for every
consumer, breaking integration tests that mention the bot as <@U0APP>.
Single-workspace install mode (bot user id plus default token provider)
is now an explicit constructor option, and only the eval harness opts
in with its own U_APP bot id. Default construction keeps the previous
fixture behavior.

Refs GH-773
Co-Authored-By: Claude Fable 5 <[email protected]>
@dcramer
dcramer merged commit 4a82701 into main Jul 7, 2026
19 checks passed
@dcramer
dcramer deleted the eval/multi-actor-provenance branch July 7, 2026 04:37

This branch was successfully deployed

1 active deployment
Preview – junior-docs — 75135e23 Deployed Jul 7, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant