Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
docs: folder-rule rebuild replay and the rename-alias limitation (GBRA-218)
garrytana46a033dcbfe
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 7fa9e86eff..870be57655 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -37,6 +37,8 @@ identifiers and attribution are available in the pre-removal Git revision- Works the same on a repo-less brain: members, groups, bindings and folder rules live in the database. A source records which store holds its folder rules when its first rule is created, and only `gbrain access rule migrate --source <id>` moves them; doctor `access_policy_store_mismatch` names it when the filesystem changes.- The member-access and folder-rule SQL functions end their pinned `search_path` with `pg_temp`, like every other gbrain function (#7632), and frontmatter recovery never guesses a duplicated `readable_by` key: the file is held until a person fixes it.- Remote callers can no longer write pages under `.gbrain/`.+- A database rebuilt from a git-backed source replays its committed `.gbrain/access.yml` history, so a removal that was held stays held. The source reads as nobody remotely until the replay finishes, and a shallow clone stays that way until `git fetch --unshallow`.+- Known limitation: a page's derivatives follow it into a ruled folder through its rename alias, but renaming another page onto the old slug drops that alias and the derivatives are then judged by the new page. Don't reuse such a slug until rename history lands (#8399).- On Postgres, a database role that neither owns the folder access tables nor bypasses row-level security now needs read policies on them (docs/ENGINES.md, "Folder access tables"). Without them its page writes are refused with `writer_coordinator_required` (`unreadable_state`) and its reads show nothing, instead of reading the tables as empty and treating every page as unruled. The owner, BYPASSRLS roles and PGLite are unaffected.- A harness that sends an audience its credential's `may_act_for` does not list gets `on_behalf_of_not_permitted` with the operator's command; an audience inside tool arguments is always refused (`on_behalf_of_in_arguments`). `may_act_for: *` is accepted and doctor warns (`access_may_act_for_wildcard`).diff --git a/docs/tutorials/company-brain.md b/docs/tutorials/company-brain.mdindex 52cfbb83ef..a1acfea976 100644--- a/docs/tutorials/company-brain.md+++ b/docs/tutorials/company-brain.md@@ -142,7 +142,9 @@ gbrain access rule list --source team-a # store, revisions, applied ruA remote read of a page under a rule needs the caller's member to be on every rule covering it and on the page's own `readable_by`; hatches, grants and `--as` never relax it. Narrowing applies at once. Moving a rule's prefix restricts the new folder at once and keeps the old folder under the old readers until approval. A change that widens (removing a rule or a reader, or releasing a moved rule's old folder) is held until `gbrain access apply --source team-a` previews who would gain access and `gbrain access apply --source team-a --yes --expect <plan_hash>` approves it. If an apply stops halfway, its prefixes read as nobody until `gbrain access resume --source team-a`. `gbrain access rule history` and `rule revert --to <revision>` work over the revision log, and `gbrain export` carries the applied rules so `gbrain import` installs them before any page.-On a git-backed source the same rules live in `.gbrain/access.yml`: `rule add|rm` commit it through `gbrain git commit-push`, a hand edit takes effect when you commit it and run `gbrain sync`, and a widening commit stays held until `gbrain access apply` approves it (recorded in `.gbrain/access.approved`). A source keeps the store it had when its first rule was created; `gbrain access rule migrate --source <id>` (preview, then `--yes`) moves the rules when you attach or remove a repo. Remote callers cannot write `.gbrain/`.+Renaming a page into a ruled folder restricts it at once, and the atoms, concepts, chronicle events and `derived_from` pages made from it follow it through the rename's slug alias. Known limitation: renaming another page onto the old slug later drops that alias, so those derivatives are then judged by the new page instead; until rename history lands (#8399), don't reuse the old slug of a page you moved into a ruled folder, or cover the old slug with a rule too.++On a git-backed source the same rules live in `.gbrain/access.yml`: `rule add|rm` commit it through `gbrain git commit-push`, a hand edit takes effect when you commit it and run `gbrain sync`, and a widening commit stays held until `gbrain access apply` approves it (recorded in `.gbrain/access.approved`). A source keeps the store it had when its first rule was created; `gbrain access rule migrate --source <id>` (preview, then `--yes`) moves the rules when you attach or remove a repo. A database rebuilt from the repo replays every committed `access.yml` since the last approval, so a removal that was held stays held; the source reads as nobody remotely until that replay finishes, and a shallow clone stays that way until `git fetch --unshallow`. Remote callers cannot write `.gbrain/`.**Shared agents: one agent, each person's view.** When one agent serves everyone (a Slack or Telegram bot), its harness code names whom each turn serves, and the agent reads only what all of them may read. List the people its credential may act for, then have the harness send the audience on every MCP request: