Skip to content

Tell the brain owner when a remote put_page kept private fact rows (GST-3064) - #9760

Merged
capy-ai[bot] merged 995 commits into
masterfrom
capy/owner-private-fact-edits-3064
Nov 19, 2026
Merged

capy-ai[bot] merged 995 commits into
masterfrom
capy/owner-private-fact-edits-3064

Conversation

@garrytan

Copy link
Copy Markdown
Owner

A remote put_page from the brain owner's own credential that leaves out or rewords private fact rows now says so in its receipt (private_rows_kept: counts only, with a read-only recall lookup), and the docs explain how the owner withdraws or replaces a private claim with forget_fact.
Why: a remote put_page never deletes a private row or rewords its claim, even for the owner, so an owner whose edit "didn't take" needs to be told and pointed at the right tool. The project owner changed GST-3064 from "edits and deletes stick through put_page" to "edits and deletes go through forget".
Stacked on #9733 (the read side); review that first. Nothing to do on upgrade.

What changed
  • Receipt advisory. When the stored writer is the owner's own credential and the merge kept active private rows the content left out or reworded, the receipt carries private_rows_kept: {count, renumbered, message, fix}. fix is recall {entity, source_id}, described as a lookup of the facts filed under that page. Struck (forgotten) rows aren't counted, so the advisory doesn't repeat after a forget.
  • Owner-only on every read. receiptFor drops private_rows_kept unless the reader is the owner's widened read (no room declared). That covers the immediate reply, idempotent replays and get_write_request. Members and unbound tokens never get it, and nor does a receipt read with a room declared.
  • Restore unchanged. Which rows a remote write restores is byte-for-byte what master does; the merge now only reports its counts.
  • Docs. docs/guides/memory-boundaries.md ("Remote writes and private fact rows") says what is kept, that a row with the same number and claim takes the incoming cells, that a fence that doesn't parse cleanly isn't merged, that forget_fact withdraws every row of that entity with the same claim (so a replacement needs a different statement), and that forget_fact refuses private pages and more trusted rows, with gbrain forget <id> as the local fallback. The MCP runbook and key-files index match. There is a changelog fragment and an upgrade-notice row (owner_private_fact_edits_gst3064).
Tests

test/owner-private-fact-edits-gst3064.test.ts, on PGLite and Postgres:

  1. Filtered-read guard matrix: known_as_of, as_of in a room, get_page in a room, a member, an unbound token, an agent job, fetch on an over-cap page and on a segmented page, and the markdown view with a holders list. In each, the owner writes the filtered view back with the returned revision and keeps every private row.
  2. The owner's client and token each recall a private fact's id, forget_fact it and add a replacement private row: the old row reads struck and forgotten, the new row is private and active, and a member sees neither.
  3. Advisory: dropping a row gives count 1, renumbered 0 and the recall fix; rewording a row gives count 1, renumbered 1; an unchanged write gets none; a member and an unbound token get none and no mention. The receipt via get_write_request and a replay keep it for the owner and drop it with a room declared. After a forget, a write that omits the struck row gets no advisory.

Mutation probes: removing the owner gate in the prepare step, the receiptFor redaction or the active-row filter each turns test 3 red.

Pre-push at 97db68b: typecheck and verify pass, census shards 625 and 1365 pass with 0 fail, Postgres arm 79 pass. 343 of 344 get_page unit files pass; test/setup-brain-first.test.ts fails the same way on master on this machine (spawn timeouts).

Review

One full review of the earlier head (adversarial, second-model, red-team and specialist readers), with one fix round. All 11 findings were fixed in that round: owner-only receipt reads and replays, counting only active rows, source_id on the recall lookup, and the docs and advisory text narrowed to what forget actually does (same-claim withdrawal, refusals, the local CLI fallback, legacy fences).

Open note, not built: the owner check runs when the write is prepared, not re-checked when it is published.

Agent notes

GST-3064 write side. Base: capy/owner-private-fact-reads-3064 (#9733). No version stamp, per direct landing.

Open in Capy

vorflux Bot and others added 30 commits November 18, 2026 09:30
The title vector's trigger form now reads the lead the page's last flip
published (page_body::timeline_lead from lane 3), as PGLite's trigger
does with coalesce(timeline, timeline_lead, ''), instead of a NULL
stand-in. Closes follow-up title-vector-segmented-lead.

(cherry picked from commit 97a99fe)
(cherry picked from commit f13e3644118d5152ad687542f9b47ae1ab63c483)
…L 18.6

The stemmer, parser and full-text goldens (english_stem.tsv, ts_parse.json, tsearch.json) came from a probe script that was never committed. This script re-asks PGLite 0.5.16 (PostgreSQL 18.6) for every output in them, reading the inputs from the committed files, and reports any difference. Run with --write to rewrite them. On the committed files it reports no difference.

(cherry picked from commit a1fa8385aa1cce125c93e7964b5749c632a2ce54)
Drop the #9692 consolidation restore from this wave: on a managed brain a consolidate closes fenced members in the entity page's facts fence, and a database-only restore would reopen them in the database while the page still holds them closed. Managed restores keep refusing, as before. The synopsis frontmatter check uses the indexable containment form, and a held move's planning reads share one deadline signal.

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

Marks the keyword search, title search, title-similarity, chunk page and chunk
window members as served by the Rust engine, and updates the parity case counts.
Produced by test/engine-parity/coverage.ts --write.
…les through the bounded YAML loader

- entity_identity_reviews gets a carried user_data row in the graduation inventory: on a brain with no repository it is
  the only record of a confirm or reject, so graduation must copy it. Without the row graduation refused with an
  unclassified relation.
- An e2e test graduates a PGLite brain with a confirmed and a rejected group to Postgres and checks both decisions,
  the confirm's identity rows and rank_entities counting the confirmed person once survive.
- Decision files are read with loadBoundedYaml (data-frontmatter.ts), the one js-yaml load entry point master now
  enforces.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
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>
The Postgres engine read the segmented chunker version from the chunker
module, so loading the engine pulled in the code chunker and its tree-sitter
wasm asset. Node (the OpenClaw host) cannot load that asset, so the reflex's
direct Postgres connection failed and every turn shipped with no entity
pointers. The constant now lives beside SAFE_FENCE_CHUNKER_VERSION in
search/safe-chunks.ts (segment-chunks.ts re-exports it), and the Node-load
guard now also checks src/core/postgres-engine.ts.
…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>
…or and upgrade-replay goldens count the new table

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>
…o a brain without the pages refuse

A page rename now moves the places the secret redactor recorded on the page, so purging a page that later
takes the old name no longer deletes the renamed page's originals, and purging the renamed page removes them.
The purge also keeps any place whose page id names a live page outside the purge (rows renamed before this fix).

A backup restore now reports originals whose page is not in this brain as skipped_no_page ("skipped because
their page is not in this brain"), with the next step to sync the pages and run the same restore again. When
every entry is skipped that way it refuses with invalid_params and writes nothing.

Also: the next backup is due for entries sealed while a backup ran (database high-water mark, not the host
clock); a spooled duplicate records its commit places on the existing original so a purge keeps it; a restore
groups occurrences by entry once.

Review-Finding: p1/red-team#1 reader=red-team
Review-Finding: p1/specialist-batched#1 reader=state-machines
Review-Finding: p1/specialist-batched#2 reader=data-migration
Review-Finding: p1/specialist-batched#4 reader=performance
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
A host that restores the thin-client tree without its node_modules got a launcher that passed its runtime check and then failed in Bun's module resolver ("Cannot find package 'js-yaml'"). When the CLI runs from a tree with its own bun.lock and node_modules, the launcher now checks that directory and prints the lockfile restore command (bun install --frozen-lockfile --ignore-scripts in that tree).

Reported by @Kkkkkuro; first fixed by @Masashi-Ono0611 in #9666.

Co-Authored-By: Masashi-Ono0611 <98894508+Masashi-Ono0611@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
A rebuilt brain numbers its pages in another order, so a restored occurrence could name an unrelated page; the purge cascade then kept the original when its real page was purged. Restore now looks the page up by source and slug.

Review-Finding: p2/outside-voice#1 reader=outside-voice
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ript changes (#9648)

A oneshot child that decides correctly to write nothing but answers in prose instead of the skip JSON dead-letters under require_writes and releases its key, so every cycle paid for the same transcript again and doctor reported dream_paid_loop. A dead synthesize child that finished cleanly with no page write now counts as settled for that content key; a changed transcript has a new key and is synthesized again.

Reported by @andreineacsu; first fixed by @Masashi-Ono0611 in #9651.

Co-Authored-By: Masashi-Ono0611 <98894508+Masashi-Ono0611@users.noreply.github.com>
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>
A timestamp like 2026-02-30 or 25:61 used to be accepted by the Rust store and stored as written. The store now checks the calendar: the day must exist in its month, hours, minutes and seconds must be in range, and 24:00:00 and a :60 leap second roll over the same way Postgres does. Page dates (effective_date) use the same check.

Review-Finding: specialist-batched#1 reader=specialist-batched
…d) pages

Three writes could leave a segmented page's search text wrong on the Rust store:
- sealChunks accepted a segmented page and replaced the chunks built from its segments. It now refuses (invalid_state), and a page in an archived source is not found, as on Postgres.
- deleteChunks removed the chunks but kept the page's seal, so a later unsealed write was read as current. It now clears the seal.
- createVersion of a segmented page wrote a version with no body and no reference to one. It now refuses with a typed capability_missing instead of writing an empty version. This changes the store's contract on purpose: the old test that pinned a version of a shell page is rewritten to expect the refusal.

Also adds a test that an impossible effective date is refused and writes nothing.

Review-Finding: adversarial-native#2 reader=adversarial-native
Review-Finding: adversarial-native#3 reader=adversarial-native
Review-Finding: adversarial-native#1 reader=adversarial-native
… holds

Creating a segmented page, or moving or reviving one with a new body, skipped the check that two live pages never share one source file. Both paths now run the same check as an ordinary page write and refuse with origin_claimed, as Postgres refuses with its unique index.

Review-Finding: red-team#1 reader=red-team
…EXCLUDE names

The Rust store hid only its built-in prefixes (test/, attachments/, .raw/). Pages under prefixes the operator lists in GBRAIN_SEARCH_EXCLUDE showed up in results. The adapter now passes the same resolved list Postgres uses, and include_slug_prefixes still brings a prefix back.

Review-Finding: outside-voice#1 reader=outside-voice
…it locked

If close() ran while an open() waited in the worker queue, the open finished afterwards and held the brain's lock with no handle to release it. The open now sees the close and refuses with store_closed, so the brain can be opened again.

Review-Finding: outside-voice#3 reader=outside-voice
…d) page

The export read the body of every page as one string, which a segmented page refuses, so it stopped with no manifest. It now skips each segmented page and counts it in the manifest (skipped_pages_segmented).

Review-Finding: outside-voice#4 reader=outside-voice
…s, search excludes, close during open, corpus export)
garrytan and others added 18 commits November 19, 2026 10:50
Return the rename's handling of a place with no page id to what master does: it moves with the renamed page, so no page that later takes the old slug can reveal the original. The changelog now says a full copy of the marker still counts as holding it.

Review-Finding: v2/outside-voice#1 reader=outside-voice
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…concept-purge-rebuild

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Review-Finding: p1/specialist-batched#1 reader=testing
Review-Finding: p1/specialist-batched#2 reader=testing
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… original

The rebuild's purge would delete a sealed original recorded only on the hidden concept's page, which nothing removes
today because the automatic expiry skips a held tombstone. A page-level secret occurrence now keeps the concept
hidden. A concept that only copied a redaction from a live member stays hidden too, until entries can be compared
across pages.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…t its slug with no page

The purge deletes a slug's page-level secret occurrences that name the purged page or no page at all, so the hold
now matches both, as the purge's own predicate does.

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

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…nclaw-skill-resolver-real-gateway

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot changed the base branch from capy/owner-private-fact-reads-3064 to master November 19, 2026 12:58
@trunk-io

trunk-io Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

@capy-ai
capy-ai Bot marked this pull request as ready for review November 19, 2026 12:58
@capy-ai capy-ai Bot added the full-ci Maintainer-only: run the full Test and E2E suite on this PR head label Nov 19, 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 19, 2026
…er-private-fact-edits-3064

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

# Conflicts:
#	test/postgres-unit-arms.txt
@capy-ai
capy-ai Bot merged commit 6756d19 into master Nov 19, 2026
62 checks passed
@garrytan garrytan mentioned this pull request Nov 19, 2026
capy-ai Bot added a commit that referenced this pull request Nov 19, 2026
Releases v0.60.747.0 with seven changes since v0.60.746.0, including `gbrain access member handover` for when someone leaves a company brain (#9684, adds migration v327, an empty new table).
- A person's pages are never linked without you: a person pair that shares an id is confirmed on its own, after you read why it was proposed (#9762)
- A remote put_page now tells the brain owner when it kept private fact rows the content left out or reworded, and points at forget_fact (#9760)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: garrytan <garrytan@gmail.com>
garrytan pushed a commit that referenced this pull request Nov 19, 2026
What users get from master in this sync:
- gbrain access member handover hands a leaver's pages to the owner (#9684)
- Duplicate-person linking now asks first and confirms people who share an id one at a time (#9762)
- Company-brain tutorial explains how imported calls are kept to their attendees; --propose heading fixed for partly matched calls (#9718)
- One-script install of GBrain Helper on a Mac that keeps its macOS permissions (#9816)
- The brain owner is told when a remote put_page kept private fact rows (#9760)
- The brain owner sees the same private fact rows in as_of and known_as_of reads as in get_page (#9733)
- Turning iMessage sending off cancels a text still on its way, and --off only reports success it can show (#9791)
- Starter MCP clients can date a remembered fact with valid_from (#9802)
- A secret store restore ties an original only to a page that still holds its marker (#9806)
- Concepts hidden by a purged input come back rebuilt from their current members (#9794)
- Nightly test of the OpenClaw skill-resolver plugin inside a real gateway (#9799)
- Version stamps v0.60.746.0 and v0.60.747.0 (#9814, #9828)

Conflict resolution: valid-time-read.ts keeps the trunk's engine-sql imports and adds master's owner fence view. The generated files (migration registry, CLI flag registry, raw-SQL baseline, export and migration goldens) take master's copy for now and are regenerated in the next commit. Master took migration v327 (access handovers), which clashes with the trunk's v327; the renumber follows.
@capy-ai
capy-ai Bot deleted the capy/owner-private-fact-edits-3064 branch November 21, 2026 17:16
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