Skip to content

Carry a person's Open-shared memory only into turns that carry their authority - #3974

Merged
capy-ai[bot] merged 3 commits into
mainfrom
capy/open-recall-needs-person-authority
Nov 30, 2026
Merged

capy-ai[bot] merged 3 commits into
mainfrom
capy/open-recall-needs-person-authority

Conversation

@garrytan

@garrytan garrytan commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

In an Open shared conversation, QM now carries a person's memory into a turn only when that turn carries the person's authority, the same rule files, skills and the memory API already follow.
Why: a turn the person didn't start, such as QM answering their emoji reaction in a channel, could still show memory carried from their own notebook, while that same turn got none of their files or skills.
Nothing to do: a person's own messages in conversations QM can confirm are internal, and their own scheduled fires, keep seeing it.

What changes
  • resolveTurnContext (src/resolution/turn-context.ts) turns Open disclosure on only when the sharing posture is Open and the turn carries the person's authority. Before, it needed only an Open posture and a turn that wasn't a Slack bot's work.
  • Turns that carry the person's authority already exclude a bot's work and require an internal audience, so the context's separate botActor field had no other use and is gone, with the line that passed it from the orchestrator.
  • The memory API, and file and skill sharing into a turn, already used this rule. In-process recall and the memory tool's search now match them.
  • README: the Open line now says what the security notes say, "a turn that carries a person's authority", instead of "a live human turn".
Why this should go to main now

In an Open org today, a turn QM starts on its own in a shared conversation, such as its answer to a member's emoji reaction, can quote facts carried from that member's own notebook. The same turn already gets none of their files or skills, and the memory API already refuses it. Every Open org with private channels where QM follows threads has this gap. The fix is one condition plus the removal of a field nothing else used, so a later, cleaner version would look the same.

Review points this PR leaves for later

Turn kinds in the outcome table. The Category gate reviewer asked for outcome-table rows for every turn the new rule changes: groups outside a project, Slack channels opened in web chat, turns with no origin, subagents opened with no computer, private session messages and DM detection turns, plus a note that the memory tool's edit and delete refuse facts a turn no longer sees. The table now lists all of them, and the code is unchanged. Those turns already get none of the person's files or skills, so no risk stands beyond what the table says.

Live runs of subagent turns. The Prod-like QA reviewer asked for live runs of a subagent opened from the member's own message and one opened with no computer. Both ran on this branch: the first showed the carried fact and the second withheld it (see Live QA). Whether a subagent turn carries the person's authority is main's existing delegation check, which this PR doesn't change.

A sentence in SECURITY.md. Lines 105-106 say Open sharing doesn't change automation or ambient turns. A person's own scheduled job already gets Open sharing on main, and still does with this PR. The sentence predates this PR, and this PR makes its "ambient" half true. The security notes are the maintainers' text, so this PR leaves the sentence for them to word: keep it, or narrow it to automation that carries no person's authority.

A person's own message where QM can't confirm the members. In a web or partner-chat group outside a project, or a Slack channel opened in web chat, the person's own message now loses carried memory, because QM can't confirm that every member is internal. Their files and skills already follow that rule on main. If those turns should keep carried memory, the fix belongs in how those surfaces report members, for all three kinds of sharing at once.

Outcome table

What a turn in an Open shared conversation can see of a person's carried memory: facts in that conversation or the person's DM whose source is the person's own notebook or another Open conversation. A conversation's own facts, org facts and team facts don't change.

A turn carries the person's authority when the person started it (their own message, a live message of theirs QM picks up in a shared conversation, their own fire, or a subagent turn whose chain starts with one of those) and QM can confirm that every member of the conversation is internal: a DM, a Slack channel, or a web or partner-chat group tied to a project. File and skill sharing into a turn already follow this rule, so each row that changes below now matches what those turns get of the person's files and skills.

Turn Before After
The person's own message in their DM, or in a shared conversation whose members QM can confirm are internal Shown Unchanged
QM picking up the person's live message in such a shared conversation, when it wasn't addressed Shown Unchanged
QM picking up a message in a DM that wasn't addressed to it Shown Withheld
The person's own cron, loop, webhook or job-watch fire Shown Unchanged
A subagent or session turn whose chain starts with the person Shown Unchanged
A subagent opened with no computer, or a private message into a session, even when its chain starts with the person Shown Withheld
The person's own message in a shared conversation whose member list QM can't confirm: a web or partner-chat group outside a project, or a Slack channel opened in web chat Shown Withheld
A turn with no origin: an admin acting as the person in web chat, or an API caller that sends none Shown Withheld
QM answering the person's emoji reaction, or another turn QM starts on its own Shown Withheld
An automation turn that belongs to no person (system or swarm work), and a session turn delegated from one Shown Withheld
A Slack bot's work done in the person's name Withheld Unchanged
A conversation with an external member Withheld Unchanged
The memory API with an agent capability Needs the person's authority Unchanged

No turn gains access. On a turn that no longer sees a carried fact, the memory tool's edit and delete refuse that fact's id, as they already do for any fact a turn can't see. Nothing is sent differently.

Configuration, schema and prompt

No environment variable, setting, table, persisted shape or prompt changes. The internal botActor input to resolveTurnContext is removed; nothing outside the orchestrator passed it.

Tests

test/sharing-context-e2e.test.ts: in an Open channel, a memory search on a turn QM starts on its own (an ambient turn that isn't a live message) no longer finds an ordinary fact sourced from the person's notebook. That assertion fails on main, which returns the fact. The other sharing, Open-posture, team and turn-context suites pass, and typecheck, eslint, oxlint and prettier are clean.

Live QA

A dev instance of QM on a real Postgres and model with a Slack twin, main against this branch. The org is Open. A private channel's notebook holds a fact whose source is the member's own notebook (sensitivity ordinary) and a control fact whose source is the channel itself.

Cell Main This branch
The member's own message asks QM to search memory for the carried fact Quotes the carried fact Quotes the carried fact
The member reacts with an emoji on the thread, and QM's reaction turn searches memory The memory tool returns the carried fact and QM posts it The memory tool returns only the control fact and [no remembered facts match …] for the carried one; QM says it found nothing for it
The member's own message in web chat, opened on the same channel, where QM can't confirm the members, asks QM to search memory The memory tool returns the carried fact and the control fact The memory tool returns the control fact and other channel facts, but not the carried fact
The member's own scheduled job fires in the channel and searches memory for both facts Not run The memory tool returns the carried fact and the control fact, and QM posts both
QM opens a subagent from the member's own message, and the subagent searches memory Not run The memory tool returns the carried fact and the control fact
QM opens a subagent with no computer from the member's own message, and it searches memory Not run The memory tool returns the control fact and other channel facts, but not the carried fact

QM's check for whether to answer a reaction declined some reactions on both builds before any memory search ran; those tries are left out above.

Wall of shame review report

Reviewed commit: 21dfdff3ec0fc6a280f580682d8a6bce07c39a05

Every lens was read at b668ada2. This head merges main, which leaves the PR's own added and removed lines unchanged, and folds the bot and ambient assertions into one loop so the test lines fit Over-testing. gstack's review plan ran again over the whole diff at this head and found nothing blocking. Every row carries forward, because the test reshape changes nothing a lens judges. Over-testing is checked by CI.

Lens Reviewer Verdict Score Assessment
Overengineering claude-opus-5-5, fresh subagent, at b668ada, carried forward Accept 97/100 The source change is net negative (+1/−3). src/resolution/turn-context.ts:125 now gates Open disclosure on the personAuthority input that resolveTurnContext already receives, the same flag sharingSourcesForTurn checks, and the redundant botActor field is deleted with its only caller, so no helper, flag, setting or layer is added.
Band-aid fixes claude-opus-5-5, fresh subagent, at b668ada, carried forward Accept 94/100 The fix works at the cause: Open disclosure used its own narrow !botActor check and now uses personAuthorityTurn, the rule file and skill sharing and the memory API already use, with no new branch, string match or exception. Every other place that builds a memory disclosure either uses the same rule or hardcodes open: false.
Duplication claude-opus-5-5, fresh subagent, at b668ada, carried forward Accept 96/100 The diff removes a second source of truth: Open memory disclosure had its own !botActor rule and now reads the existing personAuthority input, which already gates file and skill sharing and the memory API. The README Open line now matches SECURITY.md:88, and the test reuses the existing harness.
Hand-rolling claude-sonnet-5-5, fresh subagent, at b668ada, carried forward Accept 96/100 The diff only deletes the redundant botActor plumbing and reuses the existing input.personAuthority, so it adds no custom plumbing in place of a library or SDK.
Non-durability claude-sonnet-5-5, fresh subagent, at b668ada, carried forward Accept 96/100 The diff changes a per-turn boolean and removes an input. It adds no process-local Map, cache, queue or timer, and no schema or persisted-state change.
Config-matrix expansion claude-opus-5-5, fresh subagent, at b668ada, carried forward Accept 97/100 No environment variable, setting, schema or mode is added, so the config matrix gets smaller: two gating conditions collapse into the one personAuthority already owns, with nothing new to configure.
Provider drift claude-haiku-5-5 triage Not relevant — No sandbox provider code is touched.
God files claude-haiku-5-5 triage Not relevant — Edits are one-line changes in existing files with no new responsibilities added.
Mismatched UI claude-haiku-5-5 triage Not relevant — No UI code changed; README wording only.
Over-indexing on YC claude-haiku-5-5 triage Not relevant — Changes are generic sharing-posture wording and test identifiers with no organization-specific architecture.
Regex claude-haiku-5-5 triage Not relevant — No regular expressions added or changed.
YC info leaking into public qm claude-haiku-5-5 triage Not relevant — README and test changes use generic terms with no organization-specific names.
Discarded error evidence claude-haiku-5-5 triage Not relevant — No error handling, catches or swallowed failures changed.
Arbitrary limits claude-haiku-5-5 triage Not relevant — No caps, timeouts or retry budgets added or changed.
Explaining-away UI claude-haiku-5-5 triage Not relevant — No user-facing copy or UI added.
Category gate without census claude-opus-5-5, fresh subagent, at b668ada, carried forward Waived 72/100 Waived by Garry Tan: the reviewer asked for outcome-table rows for subagents opened with no computer, private session messages and DM detection turns, and a note on edit and delete. The table now has those rows and the note, and the code is unchanged, so this PR has nothing left to change for it.
Historylessness claude-opus-5-5, fresh subagent, at b668ada, carried forward Accept 97/100 The diff replaces the parallel !botActor rule with the existing typed personAuthority field and deletes the unused botActor input outright, with no shim, fallback or second path. Nothing persisted changes shape.
Prod-like QA claude-opus-5-5, fresh subagent, at b668ada, carried forward Waived 72/100 Waived by Garry Tan: the reviewer asked for live runs of a subagent opened from the member's own message and one opened with no computer. Both ran on this branch: the first showed the carried fact and the second withheld it. Whether a subagent turn carries the person's authority is main's existing delegation check, which this PR doesn't change.
Performance claude-haiku-5-5 triage Not relevant — No queries, loops or I/O added or changed.
Token performance claude-haiku-5-5 triage Not relevant — No prompt or per-turn context text changed.
Agent notes

Plan: exempt: diagnosed fix of a reported inconsistency.

  • Round 1 at b668ada2: /ship's review plan (a specialist reader and a native adversarial reader), the triaged lens set and live QA. Neither reader marked anything blocking. The adversarial reader left four notes: a fact hidden on a turn without authority is described to the model as consolidated or removed (src/memory/recall-delta.ts:121); the SECURITY.md sentence in Review points; the new assertion covered one turn shape; and turns with no origin lose carried memory, which the outcome table lists.
  • Merge of main at 8dc5bb46: one conflict in test/sharing-context-e2e.test.ts, next to the new assertion. Main's line was kept, and the PR's own added and removed lines are unchanged.
  • Round 2 at this head: CI's Over-testing count needed the test reshaped, so the bot and ambient assertions became one loop, both still asserted. gstack's review plan ran once over the whole diff. The specialist reader found nothing. The adversarial reader marked nothing blocking and left two low notes: turns without a person's authority (swarm workers, non-live ambient turns, system automations, subagent chains that don't verify) withhold Open-carried room facts and can't edit or forget them, as the outcome table lists; and facts shown on an earlier turn with authority stay in that session's transcript for later turns, as they already did for bot turns. No live QA, because behaviour didn't change.

REVIEW_LOOP: passes=2 blocking_found=0 deferred=0 noted=0 fixed=0 scope=frozen ledgers_read=2
Tests: CI is green at this head apart from this report's check. Locally: test/turn-context.test.ts and test/sharing-context-e2e.test.ts (24 pass on the merge), typecheck, and eslint, oxlint and prettier on the changed test.
Pregate: the test stage is attested by this head's CI run.
Version: none (the repo has no version file).

Documentation exception: accepted by qm minder 2026-11-25 via reply to the documentation-risk question, 2026-11-25 15:03 UTC: qm minder accepts the pre-existing SECURITY.md lines 105-106 as a named documentation risk on #3974. The security-model text belongs to the maintainers, so this PR leaves it unchanged and puts the sentence in Review points for Josh and Regan.

Documentation:

Status: blocked. This branch's own change needed no doc edits, but one sentence in SECURITY.md needs a maintainer's wording decision, so it was left as is.

Scope: the one commit on this branch against its base: README.md, src/core/orchestrator.ts, src/resolution/turn-context.ts and two tests, with nothing staged, unstaged or untracked. The change: in an Open shared conversation, memory recall now shares a person's opted-in memory only on a turn that carries that person's authority, the same rule the sharing sources for files and skills already use. Read in full: README.md, SECURITY.md, AGENTS.md, CONTRIBUTING.md, docs/capability-tokens.md, docs/composio.md, docs/memory-records.md, docs/sandbox-resources.md, docs/session-sharing.md, skills-seed/memory/SKILL.md and skills-seed/hand-off/SKILL.md. Read at the passages on authority, sharing and memory: docs/SPEC.md, docs/memory-providers.md, docs/persistent-subagent-sessions.md, docs/swarms.md and src/resolution/protocols/shared-core.md.

Documentation health:
  README.md                      Current (the Open line this branch rewrote matches the code and SECURITY.md lines 87-88)
  SECURITY.md                    Blocked (lines 105-106 need a wording decision, see below; not edited)
  CONTRIBUTING.md                Current (no setup or workflow change)
  ARCHITECTURE.md                Skipped (file does not exist)
  CHANGELOG.md                   Skipped (file does not exist)
  TODOS.md                       Skipped (file does not exist)
  AGENTS.md                      Current
  docs/capability-tokens.md      Current (defines when a turn carries a person's authority)
  docs/composio.md               Current
  docs/memory-records.md         Current (see debt)
  docs/sandbox-resources.md      Current
  skills-seed/memory/SKILL.md    Current
  skills-seed/hand-off/SKILL.md  Current

Needs a decision: SECURITY.md says Open "does not change ... automation or ambient turns" (lines 105-106). Since main moved Open from live human turns to turns that carry a person's authority, a person's own cron, loop, webhook or monitor fires do get Open sharing, as README.md, SECURITY.md lines 87-88, docs/capability-tokens.md, docs/composio.md and docs/sandbox-resources.md say. This branch doesn't change that for fires. It removes Open memory from ambient turns and other turns that carry no person's authority, which matches the "ambient" part. Security-model text isn't edited by this audit, so the owner decides: leave it, or narrow it to automation that carries no person's authority.

Documentation coverage:
  [entity]                                    [reference]                 [how-to]  [tutorial]  [explanation]
  Open memory recall needs person authority   ✅ README.md, SECURITY.md   n/a       n/a         ✅ SECURITY.md, docs/capability-tokens.md

No new command, flag, setting, endpoint, environment variable or schema. The removed botActor input to turn context is internal, and no doc names it.

Debt: docs/memory-records.md ("Fresh reads") says an ordinary personal fact can follow its owner into an eligible internal Open room, but doesn't say the turn must carry the owner's authority. That is a reference gap, left for a later doc pass. Unrelated to this branch: 26 of the 42 Markdown docs reviewed for discovery, including docs/composio.md, docs/capability-tokens.md and docs/memory-records.md, aren't linked from README.md or AGENTS.md.

Diagram drift: none. README.md's architecture diagram (Postgres, headless core, per-scope sandbox) names nothing this branch renamed or removed.

{
  "schema_version": 1,
  "pr": 3974,
  "head": "21dfdff3ec0fc6a280f580682d8a6bce07c39a05",
  "version": "0.1.0",
  "base": "main",
  "gate": {
    "targeted": {
      "pass": 15,
      "fail": 0,
      "skip": 0
    }
  },
  "calls": 98,
  "session_kind": "unattended",
  "head_tree": "9d2d2ad398c42ddfe7c4ff4e4460c2d7e0959907",
  "product_patch_id": "5360c0a6d974a9f4560f20560f4ea1e1942f426f",
  "gstack_version": "1.103.3.0",
  "review_depth": {
    "depth": "light",
    "class": "code",
    "runtime_lines": 4,
    "rules": "33831f8248a814fd",
    "base": "2a4e7bb42267e6faf6481f574fe2cc89c6becad2",
    "registry": "2a4e7bb42267e6faf6481f574fe2cc89c6becad2",
    "gate_scan": {
      "tagged": 0,
      "head": "21dfdff3ec0fc6a280f580682d8a6bce07c39a05"
    },
    "reasons": [
      "runtime=4"
    ],
    "risk": [],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @9d2d2ad398c4 (8 checks, current for 21dfdff3ec0f)",
  "requires_remote": [
    "test_backend/ubicloud: attested:https://github.com/yc-software/qm/actions/runs/45642863072"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "blocked",
    "scope": "README.md, SECURITY.md and docs/ for the branch's one commit against ea9fab83; no edits; SECURITY.md lines 105-106 left for the maintainers",
    "exception": {
      "accepted_by": "qm minder",
      "date": "2026-11-25",
      "via": "reply to the documentation-risk question, 2026-11-25 15:03 UTC",
      "reason": "qm minder accepts the pre-existing SECURITY.md lines 105-106 as a named documentation risk on #3974. The security-model text belongs to the maintainers, so this PR leaves it unchanged and puts the sentence in Review points for Josh and Regan."
    }
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 0,
    "fixed": 0,
    "scope": "frozen",
    "rounds": 2,
    "ledgers_read": 2
  },
  "gate_dispositions": []
}

…thority

In an Open shared conversation, in-process recall disclosed a person's
carried memory on any turn that wasn't a bot's work, so a turn nobody
started, such as an ambient read that isn't a live mention, could still
show it. The memory API, the sharing sources for files and skills, and the
security notes already require a turn that carries the person's authority.
Recall now uses that same rule, and the context no longer needs a separate
bot flag for it.

The README's Open line now says the same thing as the security notes.
Both assertions stay; the change brings the net test lines added within the source lines added.
@capy-ai

capy-ai Bot commented Nov 25, 2026

Copy link
Copy Markdown

@16francej @ReganBell This changes which turns can see a person's Open-shared memory, so we're checking with you before it merges. It's ready at head 21dfdff.

What changes: in an Open shared conversation, in-process recall and the memory tool's search now bring in a person's memory only on a turn that carries that person's authority. That's the rule files, skills and the memory API already follow. Until now, recall turned Open sharing on from the posture alone for any automation that wasn't a bot, so a reaction-style turn could show a fact the memory API would have withheld. The person's own messages, scheduled jobs and subagents still see it. The internal botActor input the old check used is removed. No schema, setting, stored field or payload shape changes.

There's one point for you in Review points. SECURITY.md lines 105-106 say Open sharing doesn't change automation turns. But a person's own scheduled job already gets Open sharing on main, and it still does here. We left that text for you to word rather than edit your security notes.

Two review rows are waived on our side, and each has its reason in the description: "Category gate without census" at 72, with the rows it asked for added to the outcome table, and "Prod-like QA" at 72, after the two subagent cells it asked about ran live on this branch. If you'd rather either stay open, say so.

If neither of you objects or asks for changes before 2026-11-30 15:40 UTC (Mon Nov 30, 7:40 AM PT), we'll merge at this head as if approved. The deadline counts 48 working hours and skips Thanksgiving. A push that changes the PR's own diff restarts the clock with a new comment.

@capy-ai
capy-ai Bot added this pull request to the merge queue Nov 30, 2026
Merged via the queue into main with commit 661d8e7 Nov 30, 2026
32 of 33 checks passed
@capy-ai
capy-ai Bot deleted the capy/open-recall-needs-person-authority branch November 30, 2026 15:49
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