Skip to content

Let the brain owner's remote credential read private fact rows, hop context and takes (GST-3058) - #9707

Merged
capy-ai[bot] merged 15 commits into
masterfrom
capy/owner-reads-protected-sections-3058
Nov 18, 2026
Merged

capy-ai[bot] merged 15 commits into
masterfrom
capy/owner-reads-protected-sections-3058

Conversation

@garrytan

@garrytan garrytan commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

A credential bound to the brain owner, making a direct remote MCP call for itself with no room declared, now reads what the local CLI reads: private and held Facts rows on get_page and fetch_page, the stored edge context on graph hops, and every take holder when the credential has no holders list of its own. Every other caller and context reads exactly as before.

This restores the owner's full read access for the owner's own remote callers (GST-3058, R94) without adding exposure anywhere a room mark doesn't cover.

Known limits: agent jobs and group chats (a declared room) read as before this PR until GST-3066; an owner's edit or delete of a private Facts row through remote put_page does not stick yet (GST-3064); owner tokens minted with gbrain auth create store ['world'], so they read world takes unless the list is changed.

What changed
  • One switch: the owner's wider reads are off by default. Dispatch switches them on (CallerAccess.ownerReads, read through ownerWidened()) for exactly one case: a direct remote call from an owner-bound credential, not over stdio, with no room, audience, attested actor, read mode or enforced member. Agent jobs, on-behalf-of audiences, stdio, attested actors and group chats read as on master. test/owner-widening-census-gst3058.test.ts fails if a second site sets the flag.
  • get_page / fetch_page: that call gets the Facts fence as stored, and the Takes fence as stored when it reads every holder. A credential with a holders list gets no Takes fence and reads its takes through takes_list. A segmented page's view: 'markdown' reads as for the local CLI when the credential has no list. The read view (windows, lines, bytes, section, grep) is the same text for every caller, as on master.
  • Takes: credentialHolders gives both HTTP transports a credential's stored list, none for an owner-bound credential without one, and ['world'] for everyone else. readHolders gives every holder only under the switch. Every read that filters takes by holder goes through it, among them takes_list, takes_search, takes_scorecard, takes_calibration, search, query, recall, delta, think and synthesize; synthesize now reads world takes only for a non-owner with no list.
  • traverse_graph hops: under the switch the owner reads the stored edge context; one with a holders list skips evidence pages that hold takes.
  • Agent jobs: a job reads its client's stored takes holders list, read fresh with the grant, else world takes as on master.
  • Room marks: with a room declared, a get_page whole-body read or view: 'markdown' whose returned body carries rows a world-only read strips is marked room_access: {readable: false, reason: 'private_label'}, per page. Remote owners read master's body in a room, so the mark there catches the held rows an owner already read on master. The local CLI's --room marks private rows, held rows and takes the same way.
  • put_page: unchanged from master.
  • Guard: test/takes-holders-read-guard.test.ts fails when code reads ctx.takesHoldersAllowList outside readHolders.
  • Docs: upgrade notice, changelog fragment, docs/operations/mcp-surface-runbook.md, docs/mcp/ADMIN.md and docs/architecture/key-files/security.md (two write-gate entries moved to its continuation page to stay under the size cap).
Tests
  • test/access-owner-protected-sections-gst3058.test.ts on PGLite and Postgres: local CLI, owner token with a [world] list, owner OAuth client with no list, member token and client, unbound token, owner speaking for a channel. Takes on takes_list / takes_search / get_page fence with no room: local 4/4/4, owner client 4/4/4, every other caller 1/1/0, matching master.
  • An owner client's agent job (search, query, get_page, traverse_graph) reads master's result; red at 8bb7507 on both engines, where the job read a private row. takes_list and takes_search are not job tools.
  • In a room the owner client and owner token read master's takes and hop results; red at 623d6b0 on both engines.
  • Room marks (owner bodies with held rows, local CLI --room with private rows, takes and segmented markdown, fetch never marked readable, a member unchanged).
  • The census, and test/minions/delegated-execution.serial.test.ts for the job's stored list.
  • Owner put_page round trips keep every private row exactly once (inline and segmented).
Agent notes
  • Reviews: one full panel and two fix rounds; a read-only full review at 1ccf966 whose CRITICAL (the missing room mark) was fixed under a GBRA-108 grant; scoped fix-checks on 1ccf966..623d6b0 and 623d6b0..8bb7507 (review_loop_exception, GBRA-108, GST-3058); the delegated-job fix, then one read-only full review of 6b4eae6 (specialists, red-team, adversarial, second-model review on GPT-6.1 Sol) with no fix round. Later commits: a docs note (63a6b4e), the census moved into its own test file, the master merge (4fb1613), verify registrations (Postgres arm list, two reviewed body-reader rows, pages.ts size ceiling 745 to 753) and a lazy import of readHolders in synthesize so ops/context.ts stays out of the PGLite schema closure (no behaviour change).
  • Ruled notes (GBRA-108):
    • outside-voice#1: the room mark is judged with the caller's own fact grant, so a caller with a private-facts grant gets master's mark for held rows it can read (GST-3066).
    • fix-check#1 (p4): held rows in read-view windows and in segmented markdown are not marked, as on master (GST-3066).
  • Notes: remoteReadStrips compares text, so a non-canonical world-only fence over-marks on the local CLI's --room; the room deadline does not stop the body checks; group-chat safety depends on the harness declaring a room; the owner's edit_page matches against the remote fence view; one extra config read per credential with no list; belief history treats "no list" as world; an owner on stdio gets [world] takes.
  • Gate disposition for the holders default in serve-http-mcp.ts: keep, per GBRA-108's ruling of 2026-11-18 on GST-3058 under R94.
{
  "schema_version": 1,
  "pr": 9707,
  "head": "63a6b4e4a1bd066bfba57df64c4cb76d6b11a0c6",
  "version": "0.60.737.0",
  "base": "master",
  "session_kind": "unattended",
  "head_tree": "f11806f8968132d28d6a95c8181ca3361b201d1d",
  "product_patch_id": "a706492abfb9052111379bd8914ddca2a46b7736",
  "gstack_version": "1.100.0.0",
  "review_depth": {
    "depth": "full",
    "class": "code",
    "runtime_lines": 229,
    "rules": "1afa38a4be3b5eef",
    "base": "82fdd00001833d0cbcc03c3952c3b5635d79dd92",
    "registry": "82fdd00001833d0cbcc03c3952c3b5635d79dd92",
    "gate_scan": {
      "tagged": 0,
      "head": "63a6b4e4a1bd066bfba57df64c4cb76d6b11a0c6"
    },
    "reasons": [
      "risk:data",
      "runtime=229"
    ],
    "risk": [
      "data"
    ],
    "mode": "panel"
  },
  "gate_dispositions": [],
  "review_exclude": {
    "source": "origin/master@82fdd0000183",
    "patterns": [
      "docs/**",
      "test/fixtures/goldens/**"
    ],
    "applied": [
      "docs/**"
    ],
    "excluded": 2,
    "excluded_bytes": 71771,
    "kept": 2,
    "gate_tagged": [],
    "patterns_sha256": "19818beb6b21b5c9a857948db2c3d8bbc2aa719704441fc5d045f98f4573f354",
    "list_sha256": "275888b250ae4655b5c42b6864c25be658a3d7b53fe64661d59d8ac3ac3e35fb",
    "digest": "fb35aff1ee2221d956ee32504d8caaab05110ca98ef40e84cccff61c4d66f4b7"
  }
}

garrytan and others added 2 commits November 18, 2026 06:47
…ext and takes like the local CLI

A credential bound to the brain owner and speaking for itself now gets the
Facts fence as stored on get_page and fetch_page, the stored edge context on
graph hops, and every take holder when it carries no holders list of its own.
An explicit holders list stays honoured, and every other remote caller reads
exactly what it read before (GST-3058, R94).

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Review-Finding: p1/red-team#1 reader=red-team
Review-Finding: p1/specialist-batched#1 reader=security
Review-Finding: test/access-owner-protected-sections-gst3058.test.ts:1:testing reader=core
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@trunk-io

trunk-io Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 12 commits November 18, 2026 08:46
… the owner's markdown

The brain owner's own put_page now takes the Facts fence as written, so editing a
private row leaves one row with the new text and deleting one removes it. Every
other remote writer still gets the rows it could not read restored. The owner
mark comes from the server-verified owner binding, re-checked when the stored
write is applied.

A segmented page's view: 'markdown' now reads for the owner credential with no
holders list as it does for the local CLI. The get_page read view stays the same
text for every caller, the local CLI included.

Review-Finding: p1/adversarial-native#1 reader=adversarial-native
Review-Finding: p1/outside-voice#1 reader=outside-voice
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Round two's owner skip of the hidden-row restore deleted a private Facts row
for good when an owner token with a holders list read a segmented page's
markdown view, which hides the row, and put the page back. The write path is
back to master's: every remote writer, the owner included, has the private
rows restored, so an owner's edit or delete of a private row does not stick
yet (follow-up GST-3064). The segmented markdown read fix stays.

Tests now pin both round trips: the owner token's segmented markdown put
keeps the private row, and the owner client's unchanged inline put keeps
every private row exactly once.

Review-Finding: p2/fix-check#1 reader=fix-check
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
With a room declared, the owner's own credential reads private Facts rows,
held rows and takes in get_page, but the room mark judged only the page row
and said the room could read it. get_page results now carry a check the room
marker runs only under a room: remoteReadStrips compares the body the caller
gets with what a world-only read of it keeps, and any difference marks the
page room_access {readable: false, reason: 'private_label'}. The mark is per
page. A member in the same room is marked as before.

Also adds the upgrade-notice row and the changelog fragment, and states the
known limit that an owner's private-row edit through put_page does not stick.

Review-Finding: p3/red-team#1 reader=red-team
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…efore

The owner's every-holder default and its graph-hop text exemption now apply
only when no room is declared. In a declared room the owner's credential reads
world takes and gated hop text, as before this change, until GST-3066 adds
room marks to those operations. Its get_page keeps the Facts rows and the room
mark; a segmented page's markdown view in a room reads as before. With no
room nothing changes. The room switch reads the same declaration the room
marker uses, through one internal caller-access flag.

Also corrects the upgrade notice, changelog fragment and runbook to say what
the room mark covers and what it does not (held rows in read-view windows and
in a holders-list owner's segmented markdown, as before), that the local CLI's
--room marks change, and which reads give the owner every take holder.

Review-Finding: p4/fix-check#1 reader=fix-check
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Shortens the owner-read entry and moves the two write-gate entries to the continuation page, which the room note pushed over the 60000-byte cap.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ct call

The owner's wider reads (Facts rows as stored on get_page and fetch_page, a
segmented page's markdown view, every take holder for a credential with no
holders list, and graph-hop text) were on wherever a context resolved to the
owner, with each exception switched off by hand; delegated agent jobs were
one nobody had switched off. They are now off by default, and dispatch
switches them on for exactly one case: a direct remote call from an
owner-bound credential speaking for itself with no room declared. Agent jobs,
group chats, stdio, on-behalf-of audiences and attested actors read as before
this change. A census test fails if a second site sets the flag.

An agent job also reads its client's stored takes holders list, read fresh
with the grant, else world takes as before.

Review-Finding: p5/fix-check#1 reader=fix-check
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Known limits from #9707's final review: the room mark is judged with the caller's own fact grant (GST-3066), and owner tokens minted with gbrain auth create store ['world'].

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…er-reads-protected-sections-3058

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

# Conflicts:
#	src/mcp/http-transport.ts
The census shells out to git grep, which made the structural-suite classifier list the whole database suite as structural; on its own file only the census is.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…d the pages.ts size

verify on the master merge: the test's Postgres arm runs in the Postgres lane, bodyStripsFor (inline pages only) and protectedTakesFilter (body flags on a segmented page) are reviewed body readers, and pages.ts grows 8 lines for the owner option and the room body check.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…of the schema closure

A static import from verbs.ts pulled src/core/ops/context.ts (and through it src/version.ts) into the PGLite snapshot schema closure, which test/snapshot-inputs-closure.test.ts refuses. The handler already imports ops/context.ts lazily; readHolders now comes from that import.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot marked this pull request as ready for review November 18, 2026 13:52
@capy-ai capy-ai Bot added the full-ci Maintainer-only: run the full Test and E2E suite on this PR head label Nov 18, 2026
@github-actions github-actions Bot removed the full-ci Maintainer-only: run the full Test and E2E suite on this PR head label Nov 18, 2026
keepRoomBody put a fresh closure on every get_page result under an
enumerable symbol key, so two get_page calls on the same page stopped
comparing equal (test/get-page-timeline-entries.test.ts, "body fields
match the call without the flag"). The check is now a non-enumerable
property on the object the handler returns.

The room marker still reads it through the real handler path, pinned by
test/access-owner-protected-sections-gst3058.test.ts:
"room marks: in a room the owner's credential reads get_page as before
this change and a page showing held rows is marked ..." and "room marks
on a segmented page and fetch_page ...". Both fail when the check is
not attached.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai capy-ai Bot added the full-ci Maintainer-only: run the full Test and E2E suite on this PR head label Nov 18, 2026
@github-actions github-actions Bot removed the full-ci Maintainer-only: run the full Test and E2E suite on this PR head label Nov 18, 2026
@capy-ai
capy-ai Bot merged commit 455b6dc into master Nov 18, 2026
213 of 214 checks passed
garrytan added a commit that referenced this pull request Nov 18, 2026
garrytan added a commit that referenced this pull request Nov 18, 2026
garrytan pushed a commit that referenced this pull request Nov 18, 2026
…9707, small-fix wave #9710) into rust-store

The three new BrainEngine members (listIdentityDecisions, listRestrictedIdentityMembers,
applyIdentityDecisions) are classified 'pages' in the Rust member table and refuse with a
typed engine_capability_missing; the pages capability was already unreported. Goldens,
coverage table and module-size ceilings re-summed at the merge.
capy-ai Bot added a commit that referenced this pull request Nov 19, 2026
Publishes gbrain v0.60.741.0 from master e50f391, folding the 12 changelog fragments landed since v0.60.740.0.
In it: embedding_disabled stops every route that still sent text to the embedding provider, including reindex work already queued or running (#9723, #9754); the Mac helper can send a one-to-one iMessage for the owner's agent, with nothing installed by upgrading and sending off until the owner turns it on (#9729); duplicate people and companies can be confirmed or rejected (#9701, #9732); the owner's remote credential reads what the local CLI reads (#9707); calls imported before attendee scoping can be fixed with a preview (#9679); the Rust storage engine ships as a library that nothing selects yet (#9688, #9731); plus two small-fix waves (#9710, #9724).
This commit changes only version files, CHANGELOG.md, the upgrade-notice rows and their generated table, and removes the folded fragments.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: garrytan <garrytan@gmail.com>
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