Repository navigation
v0.60.720.0
On a brain that serves several people, gbrain now counts the pages with no label, which every member's key can still read, and names the commands that close them; --labelled-only keeps members to the pages labelled for them.
Added
- Open pages count (GST-2670). A key bound to a member reads a page that has no label like any other key, so a chat export or mail import loaded before anyone named its readers is open to every member. gbrain now counts those pages, read-only, in the
gbrain access serves severalpreview and receipt (also shown bygbrain setup <harness> --serves several), ingbrain access serves, in the new doctor checkopen_shared_pagesand ingbrain post-upgrade. Each shows how many members' keys read them, the top folders, and the commands that label them, with the owner already in every reader list. Avisibility: privatepage counts as open only when remote private pages are on for this brain or a reading member's grant opens its source. Doctor warns while DM, chat, conversation or mail pages are open and reports other open folders as information. The count changes nothing, never changes an exit code, and doesn't run on a one-person brain.gbrain access serves --no-open-pagesskips it. See docs/guides/access-designations.md#pages-every-members-key-can-read. --labelled-only(GST-2670).gbrain access serves several --members <ids> --labelled-onlyandgbrain setup <harness> --serves several --labelled-onlykeep each member's key to the pages labelled for that member. It is opt-in and never applies to the owner, so with the owner in the roster the run is BLOCKED before anything is written. Without the flag, no existing key reads anything different.
A storage manifest: agents can register what they archived to object storage and find it again later. A new storage source holds one validated card per archived item: what it is, where every copy lives (store, bucket, path, restic repository and snapshot, size, file count, hash and its kind, when it was verified), where it came from and which skill restores it. gbrain storage-register adds a card (from stdin or --card) and never overwrites one; gbrain storage-update <id> --expected-revision <rev> patches a card bound to the revision it read, keeps the page's access labels and records restores newest first; gbrain storage-find "<words>" ranks the exact id, then an exact alias, then the cards holding most of the words, and a miss lists the closest cards; gbrain storage-get and gbrain storage-list read. On a brain with a Git checkout, gbrain storage init hosts the shelf in its own repository first (preview, then --expect <plan_hash>; it needs managed persistence), so each card is a commit before it is indexed. A repo-less brain gets a database-only shelf on the first register.
Cards never carry credentials or commands. A card is refused when any field looks like a secret, an environment assignment, a credential variable, a URL with user info or a presigned URL, or when any key is named command, cmd, script, exec, shell or instructions; object keys are checked too, a value under a key named for a credential refuses wherever the word sits (password, restic_password, token_value, token_count, application_key) unless the key ends in a suffix that names where something lives (_env, _file, _path, _name, _ref, _id, _var, _variable), and the refusal says to rename a key that holds no credential that way, and the refusal never echoes the value. A first shelf creation that stopped part way is finished by the next register or storage init, and an archived shelf refuses until it is restored. A restore is { skill, args } with flat scalar arguments. gbrain stamps registered_by and origin itself, and holds no store credentials.
The shelf is written only through the storage verbs. put_page, remember and every other page writer are refused storage_source_managed there, a request parameter cannot open the door, register and update run only from the trusted local CLI, and a dream cycle or enrichment run scoped to the shelf skips it. The source is not federated, so a remote connection reads cards only when its grant names storage.
Agents find the shelf, and older archive records move onto it. The brain-first lookup table every harness reads gains one row, "Find something archived to B2, Supabase or S3" (gbrain storage-find / storage_find), and a new storage-manifest skill says when to register, to find before restoring, to restore through the agent's own restore skill with the card's restore.skill and restore.args, and to record the restore with gbrain storage-update. gbrain storage adopt moves interim records (stored-object pages under storage-manifest/ holding their record as JSON under ## Record) onto the shelf: the preview shows each mapped card and every field a card refuses with its reason; --apply --expect <plan_hash> registers each card with origin: adopt and tags the original storage-manifest-adopted, deleting nothing; a record whose page a remote (MCP) client last wrote is blocked and never registered, so only records written on this machine or by sync become cards; each card takes its original's access labels (visibility, access, confidentiality, readable_by, with readable_by narrowed to the readers of every folder rule over the original), so a card is never read wider than its original, and an original whose readers and folder rules share no reader, or whose rules are still being applied, is blocked; and refuses until each refused field is named with --drop-field (a credential-shaped value always refuses); --finalize previews, then soft-deletes the adopted originals only when every card matches its original (a restore recorded since is not a difference); the preview names any other section an original holds and flags one longer than the 64 KiB it reads, and an original edited after the preview, even just before its delete, refuses. gbrain storage export --jsonl and gbrain storage import --jsonl <file> (preview per line, then --apply --expect) rebuild a shelf from a file, registering missing cards with origin: import and never overwriting a differing card; each line carries its card's access labels under labels and import restores them (a card on the shelf with other labels is a conflict); export leaves out and names a stored card that fails the card rules. Applies are idempotent and report side_effects and, when a run stops part way, the command that finishes it; a write gbrain accepted that has not committed yet is listed under pending with its receipt and the gbrain write-request <id> poll (exit 10), never reported as no change. The new doctor check storage_manifest warns about cards that fail the card schema, interim records not adopted yet and a hosted shelf whose directory is gone. On a brain with a Git checkout, adopt and import wait for gbrain storage init.
Itemized changes
src/core/storage-manifest/adopt.ts,src/core/storage-manifest/jsonl.ts,src/commands/storage.ts:gbrain storage adopt(preview, apply, finalize) andgbrain storage export|import --jsonl, each preview-first and bound to its plan_hash (a stale one refusespreview_changed).schema.tsexports the credential-shape rules, the command-key test and the card keys adopt maps onto, pluscardContent/cardDigestfor comparing copies;source.tsgainsshelfWritable(the refusal a storage write would get, without creating anything);find.tsgainsreadShelfCards.src/commands/doctor/checks/storage-manifest.ts,src/commands/doctor/registry.ts,src/core/doctor-categories.ts: the read-onlystorage_manifestcheck (brain category),not_applicablewith no shelf and no interim record. Doctor goldens regenerated for the new check.src/core/error-registry.ts,docs/guides/write-refusals.md,docs/guides/error-codes.md:storage_adopt_field_refused(consent: the user agrees to leave refused fields out) andstorage_adopt_unverified;storage_record_invalidgains reasonsno_record,duplicate_id,access_unpreservable,access_pending,labelsandremote_written.skills/conventions/brain-first.md(and its generated copies inAGENTS.md,INSTALL_FOR_AGENTS.md,skills/RESOLVER.md, the bootstrap template and the plugin trees),skills/storage-manifest/SKILL.md,skills/RESOLVER.md,skills/manifest.json,openclaw.plugin.json: the lookup row and the skill.docs/guides/storage-manifest.md: the guide (verbs, repo-less and Git-checkout brains, adopt, export and import, doctor, privacy).- Tests:
test/storage-manifest-adopt.test.ts,test/storage-manifest-jsonl.test.tsandtest/doctor-storage-manifest.test.ts(PGLite, repo-less) andtest/storage-manifest-adopt-hosted.test.ts(managed PGLite with a Git checkout). src/core/storage-manifest/(schema.ts,door.ts,source.ts,find.ts) andsrc/core/ops/storage-manifest.ts: the card schema and secret checks, the write door, the source lifecycle (storage init), keyless ranked lookup (exact id,page_aliases, word matches,pg_trgmclosest cards) and the five opsstorage_find,storage_get,storage_list,storage_register,storage_update.src/core/persistence/page-mutations.ts,src/core/persistence/memory-mutations.ts: the page door andremember/forgetrefuse writers other than the storage verbs on a source withrole: storage_manifest; the owner's import of commits already in the hosted repository still syncs.src/core/cycle.ts,src/commands/enrich.ts: a cycle scoped to the storage source returnsskippedwith reasonstorage_manifest_source; enrichment considers no card there.src/core/source-resolver.ts: the hosted shelf never counts as the sole non-default source, so afterstorage initbareput,captureandsynckeep routing where they did before.src/core/persistence/preadmit-cache.tscaches the page door's source read with its newrolecolumn.src/core/error-registry.ts,docs/guides/write-refusals.md,docs/guides/error-codes.md:storage_source_managed,storage_manifest_missing,storage_record_invalid,storage_record_secret,storage_card_existsandstorage_revision_conflict, each with its recovery path. Remote register and update refuse with the sharedtrusted_local_only.src/commands/storage.ts:gbrain storage init; the help separates the tiers report (status) from the shelf verbs.- Goldens:
test/fixtures/goldens/cli/tools-json.jsongains the three read tools;test/fixtures/goldens/exports/types.jsongains the new error codes in thecanonicalunion and listsThinkSynthesisStatusin a new order (the new schema module declares thenot_jsonliteral first; the type is unchanged). - Tests:
test/storage-manifest.test.ts(PGLite, repo-less) andtest/storage-manifest-hosted.test.ts(managed PGLite with a Git checkout). src/core/schema-pack/base/gbrain-base-v2.yaml: version 1.6.0 declaresstored-object, so cards never read as an undeclared type andunify-typesleaves them alone (test/schema-pack-stored-object-type.test.ts; doctor goldens regenerated for the new pack identity).src/core/engine-sql/sources.ts: the local-path source list (autopilot's fan-out,cycle_freshness) leaves out the hosted shelf, whose cycle is always skipped. A register that loses a same-id race is refusedstorage_card_exists.storage-updaterewrites a card whose stamped fields were removed by hand instead of failing.
A summary page built from a private note now stays hidden from other people after that note is renamed and another page takes its old name.
Fixed
- Concepts from renamed private notes (GST-2687). gbrain writes short claim pages (atoms) from your notes, then groups atoms into topic pages (concepts). When a private note was renamed and a later rename gave its old name to a different, public page, the concept built from that note's atoms could be read by people other than the brain owner through
get_page,search,queryandlist_pages. The atoms themselves were already hidden in this case; the concept is now hidden the same way, because gbrain follows the note's rename history to the private page it moved to. The brain owner, trusted local commands and a credential allowed to read private pages in that source still read it, exactly as before. Nothing is rewritten: the rule is checked when a page is read. - Doctor and repair.
gbrain doctor'sderived_visibilitycheck now counts such atoms (looser_atoms) and concepts (looser_concepts).gbrain repair visibilitynow follows the same rename history, so it previews them and stamps themprivate; before, it judged them by the public page that took the old name and could stamp an unlabelled oneworld. - Schema migration v311 adds the database function
gbrain_concept_inputs_private, which holds this check so search stays fast on large brains. It changes no rows. On a brain where the migration has not run yet, reads keep working and still hide these concepts.