Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
chore(#7632): regenerate llms-full, structural suites manifest and the Postgres doctor golden; behavior-change-notice ceiling +2
garrytan23af5bd959a1
diff --git a/llms-full.txt b/llms-full.txtindex a134c186ef..9f5ada6c94 100644--- a/llms-full.txt+++ b/llms-full.txt@@ -5836,6 +5836,26 @@ segmented chunk (`test/e2e/segmented-switch-off-write-role.test.ts`). With thepolicies above it creates segmented pages and sees only its sources' rows(`test/e2e/segmented-rls-scope.test.ts`).+**Purge and withdrawal guards.** The seven triggers that refuse purged content and+keep withdrawn facts withdrawn read their ledgers (`fact_purges`, `fact_withdrawals`,+`take_purges`, `page_purges` and the two derivation purge tables) as the role that owns+them, which ran the migrations: they are `SECURITY DEFINER` with+`search_path = pg_catalog, public, pg_temp` (migration v276, #7632). Before, they read+under the writing role's RLS, so a write role with no policy on a ledger saw no purge+and no withdrawal and stored the claim again. Nothing changes for an owner or a role+that bypasses RLS, and `anon` / `authenticated` gain nothing: EXECUTE on the guards is+revoked from them and from PUBLIC, the three raising guards fire `AFTER ROW` (after RLS+has accepted the row), and the derivation guard fires only when the writing role can+see the page (`gbrain_caller_sees_page`). A scoped write role is now refused where it+was let through, and learns whether content it supplies itself is purged or withdrawn+in a source it can already write; the guards also perform two fixed side effects for+it as the owner (expiring the facts its own statement just inserted when they are+withdrawn, and adding its page to a running derivation purge's page list). Every other+gbrain function that pins a search_path now ends it with `pg_temp`. Where the migrating+role does not own a guard or its table, the migration names it on stderr and leaves it;+`gbrain doctor` (`guard_functions`) prints the SQL to run as the owner+(`test/e2e/guard-definer-postgres.test.ts`).+**In engine-sql.** A read in a migrated domain takes a `ScopedRead` when itruns through this helper and a `LegacyUnscopedRead` when it runs on the pool(`src/core/engine-sql/brands.ts`); the engine obtains the branded executor, sodiff --git a/scripts/module-size-limits.tsv b/scripts/module-size-limits.tsvindex 4d9b63679a..34ff041632 100644--- a/scripts/module-size-limits.tsv+++ b/scripts/module-size-limits.tsv@@ -47,4 +47,4 @@ src/commands/doctor/checks/extraction-sync.ts 1500 ratchet +7 GBRA-130 A-1: linksrc/core/search/evidence-delivery.ts 1733 ratchet +5 W5: EvidencePlan.rankCut resolved with the plan (logic in search/page-rank-cut.ts); +20 W5 whole_pages: wholeCost prices a block as delivery would emit it whole (needs the private Block/enrichBlock internals) and the cut is wired before allocate (cutWholePages lives in search/page-rank-cut.ts); new row: crossed the 1500 unlisted cap at the #6367 merge (master 1479, its explicit-budget cap) by the C1 date header threaded through every block path, cap included; pagePlanHits (search/page-plan-hits.ts) and the header loader (evidence-date.ts blockDateHeaders) were peeled first; peel candidate: allocateCapped; +8 at the #6396 merge: page evidence text cut through the fence-chunk trust overlay and the caller minTrust floor (re-summed: our 1504 + master +8); +119 Cat 40 next wave F2: the search.long_page_unit policy (withLongPagePolicy, selectLongPages size preflight with page/byte/deadline limits) and the long-page fetch and fallback in deliverEvidence, kept in the shared seam the plan names (gbrain-evals docs/plans/2026-10-11-cat40-next-wave, F2); +17 F2 rework to the frozen-comparison policy: search.long_page_min_chars (rendered-body characters, default 20,000) read in withLongPagePolicy, a character count in the preflight, the rendered-body confirmation in deliverEvidence, and the long-page row exemption in capDeliveredSnippets (re-summed at the 0.60.225.0 merge: master 1537 + F2 136); +39 Wave B PR 2 lane 2b: planSegmentedBlock joins the windows search/segmented-evidence.ts reads around a segmented page's hits into one run-marked document (needs the private Doc/Piece/buildDoc/locateAnchor internals), planBlock's unit cut split into blockFromDoc for both, sections bounded by their run, selectionCost counts a gap between runs, and the fetch skips the whole-body fence overlay for a segmented page; +4 segmented pages read at once before planning (segmentedReads; the read is search/segmented-evidence.ts, the statements page-body/read-range.ts); +17 GBRA-156: tail trim plan flag, DeliverOptions.query, DeliveryMeta.tail_trim, the trim call and the frozen-hit score/query library fields (logic in search/evidence-tail-trim.ts; interface fields cannot move)src/commands/config.ts 1523 ratchet new row: crossed the 1500 unlisted cap in wave 15 P7.4 #5461: set-time validation of think.pages_budget_chars / think.excerpt_ceiling_chars (range + parser live in core/think/pages-budget.ts), mirroring the cycle.consolidate.cluster_threshold hook; +1 wave 16 G5.1 (#6495): set-time refusal hook for search.keyword_statement_timeout_ms (check lives in commands/config/keyword-timeout-value.ts); +1 wave 18b lane 5 (#5012 item 6): search.contextual_retrieval prints the existing-pages hint after the write (text lives in commands/config/contextual-mode-hint.ts); +1 #6712 PR 2: retired/rollback sync key dispatch line (logic in core/sync-config-keys.ts handleSyncKeyConfig); +1 #6865: sync.slug_conflicts.auto_remove boolean validation at set time (refusal text in repair/slug-autoheal.ts); +1 #6948: sync.origin_twins.auto_resolve boolean validation at set time (refusal text in repair/origin-twins-heal.ts); +2 #6795: config set chat_model/expansion_model help line and the model-pin import (shadow report and file-pin unset live in commands/config/model-pin-shadow.ts); +1 #6712 PR 4b: sync.admission set-time hook (value logic in commands/config/sync-admission-value.ts); +4 #7130: set-time refusal hook for sync.max_deletes / sync.max_delete_ratio (and .source.<id>) / purge.retention_hours (check lives in core/sync-reconcile.ts deleteSafetyConfigRefusal); +1 GBRA-150: sync.metafile_pages set-time route (body in config/sync-metafile-pages-value.ts); re-summed at the v0.60.330.0 merge (1520 measured); +2 #7242 minions.terminal_hook file-plane key and its set branch (logic in minions/terminal-hook.ts); +1 GBRA-161: generations.* set-time route (refusal in commands/config/generations-values.ts)src/commands/mcp-expose.ts 1512 ratchet hosted_option: Session carries the gbrain.io coaching notice on the first-receipt run and Tailscale/service friction exits (copy, refs and gating live in core/onboard/hosted-option.ts)-src/core/behavior-change-notice.ts 1502 ratchet new row: crossed the 1500 unlisted cap with the GBRA-95 RLS backfill disclosure row (+2); the behavior-change table split (#7607) retires this row+src/core/behavior-change-notice.ts 1504 ratchet new row: crossed the 1500 unlisted cap with the GBRA-95 RLS backfill disclosure row (+2); +2 the #7632 guard-definer disclosure row; the behavior-change table split (#7607) retires this rowdiff --git a/scripts/structural-suites.tsv b/scripts/structural-suites.tsvindex 8c1400538b..a1289fc46a 100644--- a/scripts/structural-suites.tsv+++ b/scripts/structural-suites.tsv@@ -202,6 +202,7 @@ test/gbrain-owned-page-types.test.ts #5881 gbrain-owned page types are declaredtest/get-page-federated-scope.test.ts #2555 get_chunks federated scope 5 source-surface-helpertest/get-page-federated-scope.test.ts #4275 alias hop scope: archived sources, include_deleted, fuzzy precedence, grant precedence 5 source-surface-helpertest/grant-execution-prerequisites.test.ts execution prerequisite table 1 readFileSync+test/guard-definer-source.test.ts guard definitions keep SECURITY DEFINER (#7632) 2 readFileSynctest/harness-onboarding.test.ts harness identity and private handoff 6 readFileSynctest/hook-command.serial.test.ts user-prompt 18 source-surface-helpertest/hook-push-spawn-env.test.ts spawnDetachedPush env handoff 2 readFileSyncdiff --git a/test/fixtures/goldens/doctor/json-postgres-fresh.json b/test/fixtures/goldens/doctor/json-postgres-fresh.jsonindex feaf1fa688..1419e88562 100644--- a/test/fixtures/goldens/doctor/json-postgres-fresh.json+++ b/test/fixtures/goldens/doctor/json-postgres-fresh.json@@ -1005,6 +1005,13 @@"name": "rls","status": "ok"},+ {+ "category": "ops",+ "elapsed_ms": "<volatile>",+ "message": "The 7 purge and withdrawal guards read their ledgers as their owner; every gbrain function pins pg_temp last",+ "name": "guard_functions",+ "status": "ok"+ },{"category": "meta","elapsed_ms": "<volatile>",