Garry's Opinionated OpenClaw/Hermes Agent Brain
Key files: Core Persistence (managed facts)
Subsystem index · Core Persistence. Read only the entries relevant to your change.
Current behavior and load-bearing invariants; history belongs in Git and CHANGELOG.
Managed facts extraction: the entity-intent preparer and publisher, conversation facts batches and the unmanaged derived index. The extraction pipeline itself is in Google and Loops (continued) (src/core/facts/backstop.ts) and Core Services (2/3) (src/core/facts/extract.ts).
src/core/facts/bulk-days.ts— #7247 the one rule doctorfact_bulk_datesandgbrain repair fact-claim-datesshare.findBulkFactDays(one read-only aggregate over active facts of active sources, optionally scoped) returns each UTCvalid_fromday holding at leastBULK_DAY_RULE(200 facts, 25% of the source, 20 entities) with counts, top source tags anddated_claims.claimDatereturns a claim's onlyYYYY-MM-DDtoken when it is a real date from 1900 to the day before; the aggregate's SQL applies the same token and bounds.src/core/persistence/{facts-maintenance,facts-prepare}.ts— the managed facts publisher and preparer behind the backstop'spublishManagedFacts/resumeManagedFactsand the explicit fact writers (managed-fact-write.ts,remember); the shared maintenance dispatch they ride is in Core Persistence. GST-2635: underattributeFallback(writeSingleFact, the loops extraction's call) a page-less entityholdingHomerefuses (an exact page rule, an unreadable access state) throwsrefuseUnheldFact(facts/held-fact-move.ts) before any request is admitted, instead of falling through to a database-onlymemory/unattributedrow. EachManagedFactsSessioncarries oneMaintenanceWriteWait(maintenance-wait.ts) built from the caller'sFactsBackstopCtx.deadlineAtMs(the facts-absorb job passes its deadline; other callers get the 30 s base) and its abort signal:collectManagedFactswaits that long for each accepted request throughawaitWrite, a cancelled job stops waiting at once, and a request still nonterminal after the wait leaves aswrite_pendingwith its receipt (#6778,test/facts-absorb-publish-wait-6778.test.ts). GBRA-130 A-36:collectManagedFactsawaits every row before it throws. An entity request that ended on a code of its own page (ENTITY_REFUSAL_CODES:revision_conflict,invalid_fence,page_body_segmented, …; not a file-check or withdrawal refusal, which the follow-up walks own) is reported asrefused(slug, code, request id) onManagedFactsResultand theextract_factsresult when the session setsreportRefusalsand another entity of the batch committed (the backstop sets it;managed-fact-write.tsandrememberdo not and keep the refusal), and the completion receipt refused only as incomplete is not a failure of its own; any other terminal row, then a pending one, then a refusal with nothing committed beside it, throws as its receipt. Test:test/pathological/a-36-facts-batch-partial-refusal.test.ts(PGLite and Postgres).facts-maintenance.ts/facts-prepare.ts(#6506): an automatic extraction's entity intent carrieswithdrawn: 'skip'(set by the backstop'spublishManagedFactscall, never bymanaged-fact-write.tsorremember), under whichprepareManagedFactsMutationskips a candidateisFactWithdrawnmatches at any visibility (afterassertFactNotPurged, which still refusespurged_content) and counts it aswithdrawn_skippedon the entity outcome, summed into the completion outcome,ManagedFactsResultand theextract_factsresult (the unmanaged pipeline counts its own B-10 skip into the same field); without the flag the refusal stands. At locked validation the per-entry purge and withdrawal checks run before the page's fence re-validation, and under the flag a claim forgotten since preparation refusesrevision_conflictwitherror.withdrawn(so the receipt'serror_detail.originiswithdrawal); noextract_factsrequest is re-prepared.resumeManagedFactsrunsfollowWithdrawalRefusalsfor an input-keyed session (inputKeyed, no request id): thefollowFileRefusalswalk generalized asfollowRefusals, matching entity refusals bywithdrawnFromDetail(error_detail)or the pre-detailinvalid_params+FACT_WITHDRAWN_MESSAGEpair, re-admitting the retained facts underdigest([batchKey, 'withdrawal-retry', n])with the flag (readmitWithdrawnFacts; every follow-up, file-check and moved-entity ones included, carries the flag and narrows its facts to the current default visibility, so a claim forgotten at any visibility is skipped at preparation and refused at locked validation), bounded byMAX_FILE_REFUSAL_RETRIES, historical receipts untouched. Tests:test/managed-facts-withdrawn-skip-6506.test.ts,test/managed-facts-withdrawal-recovery-6506.test.ts(PGLite and Postgres). #7602: an automatic extraction with no caller request id (entityMoveRetry, set by the backstop; explicit writers keep the refusal) also runsfollowEntityMoves, after admission inpublishManagedFactsand on resume: an entity request refusedrevision_conflictbecause another write moved its entity page (FACTS_ENTITY_MOVED_MESSAGESinverb-errors.ts: changed after admission, changed during preparation, deduplication state changed, the coordinator'sPAGE_CHANGED_DURING_PREPARATION_MESSAGE, whichcoordinator.tsandgroup-publish.tsthrow, and the page layer'sPAGE_CHANGED_AFTER_READ_MESSAGE, how a move during preparation was stored before the fix;isEntityMovedRefusalis the one predicate the walk and the repair preview share) is re-admitted underdigest([batchKey, 'entity-moved-retry', n])at the page's current revision with its retained intent (readmitMovedFacts; a deleted or replaced page keeps the refusal), no model call, each batch settled first so a follow-up that loses again is followed in the same run, bounded byMAX_FILE_REFUSAL_RETRIES; a follow-up refused for another reason (a held file) is not re-admitted, and the walk carries every request it did not follow. A follow-up's source-page check infacts-prepare.tsaccepts a source page moved only by a committed request of the same extraction (same principal and input digest, at the page's current revision), such as a fact the batch wrote onto its own source page; any other change still refusesThe source page changed during fact extraction.A refusalcollectManagedFactsstill throws after the walks is markedretryable: false, so the worker ends the facts-absorb job dead on its first attempt (jobRefusal;revision_conflictis not inDETERMINISTIC_WRITE_REFUSALS, so this is not thefacts_absorb_write_refusedpath). Test:test/facts-entity-moved-7602.test.ts(PGLite and Postgres). #8526: a page-triggered or input-keyed session also runsfollowEmbeddingRefusals, re-admitting facts the owner's consumer refusedembedding_configuration(throughreadmitMovedFacts: retained visibility, unattributed groups kept) underdigest([batchKey, 'embedding-retry', n])only once no live full or promoted consumer that started before the refusal remains (ownerRestartedSince: the worktree owner host's consumers, every consumer for a batch with no worktree; with no live consumer row, as on PGLite, admission's check of the retained signature against the brain's current config is the gate), bounded byMAX_FILE_REFUSAL_RETRIES. Test:test/facts-embedding-refusal-heal-8526.test.ts(PGLite and Postgres).gbrain repair failed-writes(failed-writes.ts, Core Utilities (2/2)) lists refused fact extractions. #7602: fact rows (moved-entity refusals included) usefactsRecovery:recover:(retry-dead reset) only while the page write's facts-absorb job is dead and the entity page is the one admitted,pending:while that job runs,not recoverable:for a deleted page, andre-extract:otherwise (replaced page, completed or missing job, exhausted follow-ups, a page write the job's ownreadFactsBackstopJobPagecheck now skips (written again since, or a narrowed writer grant), an extraction whose open entity requests are not all moved-entity or all held-file refusals, a guard refusal). Only the preview reads fact rows (failedWrites(..., { facts: true })); the sync-time remember replay and apply-by-id keep the guard/drift query.src/core/facts/same-page-shadow.ts— #6333 the shadow counter both fact writers share.samePageRewording(engine, sourceId, fact, embedding)re-reads the entity's nearest live same-visibility candidate (listSupersessionCandidates, the pool and filters ofdecideSingleFact's cosine pass) and answers whetherwouldDedupSamePage(capture-dedup.ts: same lane, samesource_session, same visibility, cosine ≥ 0.85, no diverging guard token) would have called the fact a rewording;warnSamePageShadowis the one stderr spelling ([facts-backstop] #6333 shadow: …; both kept).facts-prepare.tscalls it for every candidatedecideSingleFactdid not match and countswould_dedup_same_pageon the entity outcome, the completion outcome,ManagedFactsResultand theextract_factsresult; the count is frozen in the receipt, so a replay reports it and does not recount. Nothing is dropped; this is the managed mirror of the unmanaged backstop's counter (backstop.ts), which never fired on a managed brain. Tests:test/backstop-same-page-shadow-managed-6333.test.ts(PGLite and Postgres),test/backstop-same-page-shadow-6333.test.ts(unmanaged).src/core/persistence/derived-facts.ts—writeDerivedFacts: the unmanaged conversation fact index commits in one maintenance transaction under the maintenance principal; on a managed brain it refuses withwriter_coordinator_required, because every managed facts/takes writer publishes a receipted maintenance request (test/receipt-coverage.test.tslists every coordinated write site). Tests:test/write-attribution-misc.test.ts.src/core/facts/conversation-publication.ts— managed conversation facts as database-onlymanaged_maintenance_conversation_factsbatch requests (submitDatabaseMaintenanceIntentonANCHOR_SLUG, a dot-led slug no page can hold, dispatched fromprepareMaintenanceMutation). Each page's frozen entry (buildConversationPage:FrozenExtractedFactrows, its generation and attempt, vectors only under the brain's facts embedding signature) joins the run's batch;enqueueManagedPagepublishes it onceDEFAULT_BATCH_CAPSis reached (25 pages, 10 with extracted facts, 8 MiB) andflushManagedBatchat the end of the run. The generation key (protocol, source incarnation, page id, revision, parser-input version token,CONVERSATION_EXTRACTOR_VERSION, selectors, newest extractor row id) is checked before model work bystartManagedPageagainstloadGenerationIndex(the writer's unsettled and failed batches on the anchor, read once per run): a member of an unsettled batch waits and replays its receipt, a member of a retryably failed batch is resubmitted from its stored entry, a deterministic failure of a batch that held it alone or three failed batches block it (GBRA-130 A-51:publishBatchre-publishes a multi-page batch that failed deterministically in halves, so only the page that fails alone takes the code;test/pathological/a-51-conversation-batch-booking.test.ts); all without model calls. The batch request id digests its members' (generation, attempt) pairs;submitConversationPagesraises every member's attempt past an id another write holds, or whose receipt lost its intent without committing (#7516: a redactedpurged_contentrefusal or a compacted failure takes the attempt historyloadGenerationIndexreads, so the same id came back on every run asidempotency_conflictafter a paid extraction; testtest/conversation-facts-redacted-batch-7516.test.ts, + Postgres arm). The preparer locks every member's key and applies each on its own (applyEntry): a deleted, replaced or moved page is skipped and reported, a page whose rows fail validation gets a durableblocked:not-extractable outcome, vectors under another signature are dropped; none fails the batch.estimateConversationIntentBytes/conversationIntentByteLimitskip a page whose largest entry cannot fit before any model call;assertConversationAdmissionHeadroomstops admitting at 80% of the writer's outstanding requests, reserved receipt bytes or lifetime ids (maintenance_backpressure, exit 12, naming the resource and a--limitthat fits), up front for the run's planned batches and before each new batch.publishConversationFacts(the managed apply and the unmanaged writer) passes fact rows through the write gate at the page's derived tier and retires the prior batch only for a complete replacement (#7013:fullscope, at least one fact, nothing held or rejected) or on a page with no active extractor facts, throughreplaceConversationFacts, which deletes the page's extractor rows (expiring referenced and keeping label-retired ones) and inserts the rows numbered above every remaining row, failing on a lost insert. Otherwise the prior facts stay: the outcome row replaces the page's prior outcome rows (so the page is not paid for again), awindowrun (--sincedropped messages) adds its facts beside them, and apartialrun (a--segment-limitcut, a page changed mid-run) publishes no facts over them. Each entry carries itsscope; an entry frozen without one ispartialwithout its outcome,windowwith a--sinceselector, elsefull. Rows carry an optional slot (GBRA-574 B2:dimension,value,value_hash,dim_status 'active'):insertableSlotsdrops a slot outside the vocabulary, without an entity, or whose unique slot key the page or an earlier row of the batch already holds (the fact stays), andclearConversationFactsclears the slot of every row it keeps expired in the same UPDATE. Tests:test/pathological/h4-conversation-facts-zero-yield.test.ts(managed and unmanaged, + Postgres arm). Tests:test/conversation-facts-managed.test.ts(+ Postgres arm), managed-connector contract casesextract_conversation_facts*.src/core/facts/slots.ts— GBRA-574 B2/G4 conversation fact slots: the closed vocabulary (location,employer,role),normalizeSlot(entity required, value at most 80 characters),CHANGE_CUEandderiveSlotEnds, which works out read-time validity ends per (source, entity, dimension): a run of one value is one stint, and the next distinct value ends it at itsvalid_fromonly when it starts later and comes from a page the stint came from or its fact states a change; otherwise both values stay open. Nothing is written. The ontology keeps its own domain:getOntology,discoverOntologyDimensions,findOntologyConflicts,mergeOntologyFactand the ontology-facts repair skip conversation rows (chronicle/ontology.tsNOT_CONVERSATION_SLOT_SQL),mergeOntologyFactand the re-key dedup (facts/ontology-rekey.ts, also run by the twin merge) clear the slot of a conversation row that holds an observation's exact stint key instead of dropping either, and windows read conversation rows only. Tests:test/facts-slot-windows-gbra574.test.ts(+ Postgres arm),test/facts/extract-slots.test.ts,test/facts/normalize-slot.test.ts.src/core/facts/slot-tagging.ts— GBRA-574 slot tagging: the main extraction call never asks for a slot, soextractConversationWindowsends a second small call (tagSlots, the facts extraction model,SLOT_TAG_SYSTEM, at most 10 facts and 400 output tokens) over the window'sfactandeventrows whose entity was named exactly (the extractor's name resolves to the same page throughresolveStrictEntityReference: exact slug, unique basename or unique alias, never a prefix guess or a near name; or subject inference) and is a live, unretiredpersonpage, or whose entity is a name key the window kept for a full name with no page (unbacked, bracketed with the extractor's own name text); no candidate, no call, and BrainBench's injected extractor skips it. Each reply pair goes throughnormalizeSlot. A failed or unreadable reply keeps the facts without slots and countsslot_tagging_failed; abort andBudgetExhaustedpropagate. The per-page cap (conversation-incremental.ts) andconversationRunEstimateadd one tagging call per window at its largest (SLOT_TAG_INPUT_CHARS). Tests:test/facts/slot-tagging.test.ts,test/large-pages/conversation-slot-tagging-segmented.test.ts. The name keys come fromsrc/core/entities/resolve-on-save.ts(GBRA-574 F): conversation extraction alone passes theunbackedmap whilefacts.unbacked_entity_keysis on (unbackedEntityKeysEnabled), and a fallback name of at least two words keeps its bare basename key (unbackedEntityKey:Alice Example,alice-exampleandpeople/alice-examplegivealice-example) unless a live page sits at that bare slug, counted asunbacked_key_count; no page is created and every other writer still stores NULL.src/core/facts/subject-infer.ts— zero-LLM fact subject inference shared by the write paths (remember, the facts backstop) andgbrain facts relink.inferFactSubject(engine, sourceId, { fact, pageSlug?, mode, excludePrivate? })returns{ slug, via: 'page' | 'mention' }or a miss reason (ambiguous,unverified_match,no_mention,no_page). Page tier: the trusted page the fact came from, when it is a live fact-entity page. Mention tier: strongextractCandidatesnames plus slugs written in the text (lowercase Unicode page-slug letters without combining marks; a literal glued to further letters is not a literal), resolved throughresolveStrictEntityReference(exact slug, unique basename, unique alias;relinkmode adds the same-name trigram arm); exactly one entity links. Any other real name that does not resolve to the same entity (including names with no page and bare first names) vetoes the link; sentence-start capitals, weekdays/months and role terms (CEO, Q3) do not.excludePrivateremoves private pages before uniqueness is counted. AlsoappendContextNote/contextHead(the" — "note convention),recordedPageSlug(page provenance of page-extraction rows only) andisEntityInferenceEnabled(facts.entity_inferencekill switch for write-time inference; relink ignores it).resolveStrictEntityReferenceinentities/resolve.tsnever guesses from a bare-name prefix and never slug-falls-back. Pinned bytest/facts-subject-infer.test.ts(a 40+ fact labeled fixture: write precision >= 0.99, relink free tiers >= 0.95).src/core/facts/conversation-subject-infer.ts— #6764 write-time subject inference forgbrain extract-conversation-facts(both the classic and managed branches, trusted local only) and the free conversation relink.inferConversationSubjectis the per-fact rule (a withdrawn claim misses aswithdrawn);inferConversationSubjects(engine, sourceId, visibility, rows)gives each row the extractor left without an entity the sluginferFactSubjectproves inwritemode (mention tier;excludePrivatefor world rows) plus theentity inferred from <tier>context note, unlessfacts.entity_inferenceis off or the claim was withdrawn. The row stays a derived row of the conversation page (entity_slugcolumn only). Test:test/conversation-facts-unlinked-6764.test.ts.src/core/facts/conversation-relink.ts—gbrain facts relink --conversation [--source] [--slugs] [--dry-run] [--json](#6764, dispatched fromsrc/commands/facts.ts): the free relink of the conversation extractor's unlinked derived rows, which plain relink never examines. Pages are the named--slugs, else the 50 with the most unlinked rows not yet tried (conversationRelinkPages). Each row runsinferConversationSubject(write mode, visibility-filtered, withdrawn claims skipped; no model); a row the assistant or a third party said is never linked, never picks a page, and is counted asnot_user_attributed(#7270). A page's links are one write: a managed brain publishes one database-onlymanaged_maintenance_conversation_relinkrequest on the anchor.maintenance/conversation-relinkholding the page key (prepareConversationRelink, dispatched inpersistence/prepared-maintenance.ts; the request id comes from the planned links, and a failed attempt retries under the next id), an unmanaged brain onewriteDerivedFactstransaction. The write setsentity_slugand appendsentity relinked from <tier>only on rows still exactly as planned (same claim, unlinked, active, target page live) and records alinkedattempt; unresolved rows get aconversation_unresolvedmemo infact_relink_attempts(reason the miss), which moves doctorunlinked_factsto the paid re-extraction fallback, and the report prints that command for their pages. Test:test/conversation-relink-6764.test.ts. GBRA-574 C1--unbacked(planUnbackedPages): rows on an unbacked name key (withdrawal-schema.tsunbackedEntitySql) re-key onto the page the key's words resolve to throughresolveStrictEntityReferencewithsameName(exact slug, unique basename, unique alias, same name ignoring corporate suffixes; a retired page answers through itssuperseded_bytarget;excludePrivatefor world rows); each planned row carriesfrom(the key), the write re-checks the row is still on that key, runsdropRekeyDuplicatesfirst so a slot never collides, notesentity relinked from unbackedand records alinkedattempt with tierunbacked; misses keep their key and write no memo. Test:test/conversation-unbacked-keys-gbra574.test.ts(both engines; Postgres viatest/e2e/conversation-unbacked-keys-gbra574-postgres.test.ts).src/core/facts/conversation-memo.ts— #6764 what makes free relink, then paid re-extraction, then linking by hand converge, all infact_relink_attempts:conversationTriedSql(aconversation_unresolvedmemo, re-armed for the free relink by any page created in the source after it unlessRELINK_REASONSmemoizes the reason),conversationPaidSqlandrecordReextractMemo(tierpaid_reextract,target_slugthe page,reasonitscontent_hash, keyed on the page's completion outcome row; written when an extraction of the page completes, unmanaged inextract-conversation-facts.tsand managed inconversation-publication.tsapplyEntry). No schema change. Test:test/conversation-memo-6764.test.ts.src/core/facts/conversation-relink-carry.ts— #6764 how a free conversation relink survives a batch replacement:clearConversationFacts(conversation-publication.ts) expires the page's relinked rows (RELINKED_DERIVED_ROW: entity set andentity relinked fromin the context) instead of deleting them, after deleting the previous clear's expired copies, andinheritRelinkedEntitiesgives each inserted row with no entity whose claim matches one of them that entity (live page only) and the relink note, in every insertpublishConversationFactsmakes (managed and unmanaged, replacement or addition) and ininsertGatedFacts. One active copy, link kept. Test:test/conversation-relink-6764.test.ts.src/core/repair/duplicate-facts.ts—gbrain repair duplicate-facts(#7043), explicit-only and preview-bound (consentdestructive).findDuplicateFacts(read-only) groups active facts by source, visibility,attributed_toandgbrain_fact_fingerprint(fact), keeps the oldest fenced row, else the oldest row (created_at, id; G4: a database-only legacy copy of a fenced claim is retired onto the fence row, so the unfenced copy no longer holds its page out of fact reconciliation) and classes each groupsame_entityorcross_entity(retired only with--include-cross-entity). The apply setsexpired_atandsuperseded_byon database-only copies (coordinatedDatabaseWritewith therelink_factsoperation on a managed brain, onemaintenanceTransactionper group otherwise) and strikes a fenced copy assuperseded by #Nthrough a revision-boundput_pagewhen the kept row shares its fence; a copy whose kept row is elsewhere is listed asfence_kept_elsewhere, one on a segmented page assegmented_page(preview and apply). Near duplicates are never touched; a row changed since the preview reportschanged_since_preview. Tests:test/repair-duplicate-facts-7043.test.ts(PGLite and Postgres).src/commands/doctor/checks/fact-bulk-dates.ts—fact_bulk_dates(wave check, #7247):findBulkFactDaysover the scoped sources (remote callers: their permitted sources); warns per day with fact and entity counts, top source tags anddated_claims, says the dates record loading, not occurrence, and names thegbrain repair fact-claim-dates --source <id>preview. Read-only.src/commands/doctor/checks/conversation-coverage.ts—conversation_format_coverage: samples up to 50 newest pages per concrete conversation type, the list the extractor reads (pageTypesForAllowed(ALLOWED_TYPES), granular collector aliases such asslack-threadincluded, #8469), keeps the pagesisConversationFactsEligiblePageadmits, parses each without polish or fallback and warns above 10% unmatched transcript-claiming pages. Test:test/doctor-conversation-granular-coverage-8469.test.ts.src/core/repair/fact-claim-dates.ts—gbrain repair fact-claim-dates --source <id> [--day YYYY-MM-DD](#7247), explicit-only, preview-bound, destructive (--yes). Candidates: active facts on a bulk day (findBulkFactDays, or--day) whose claim has exactly one earlier ISO date (claimDate). A fence row'svalid_fromcell is rewritten in the page's one fence section and published by revision-boundput_page(the facts row is re-projected); a database-only fact is updated in onemaintenanceTransactionon an unmanaged brain and counteddatabase_only_managedon a managed one. Pages with an unparsed, split or segmented fence, or a rewrite that does not read back as the planned rows, are listed and kept. The hash binds revisions, row numbers and new dates; a fresh apply recomputes the plan and refusespreview_changedon any difference. Test:test/repair-fact-claim-dates-7247.test.ts.src/core/facts/fence-fact-append.ts—prepareFenceFactAppend(engine, row, config, snapshot, { fact, pendingTier, mode?, supersede? | rowNum }, signal): the one way a coordinator preparer puts a single fact into the facts fence of the request's page (row.slug); remember uses it, and so does a managed owner release of a held fact (trust/release-publish.ts, thetrust_releaseoperation: append for a held fact with an entity slug, index-existing for a hold namingpayload.row_num, whose cell fields the owner previewed and the request binds: a moved cell refusespreview_changed; journaled as modeindex-previewed, which a preparer built before the field preview refuses, and anindex-existingrequest with no fields digest refusespreview_changedasking for a rerun). It returns{ prepared, rowNum, fencesNormalized, apply(tx) }:preparedis the page write to compose (itsfile,exclusiveSources,validate; null in index-existing), andapplyruns in the publication transaction after the coordinator published the file, writing the page row (tier kept,trust/fence-append.ts) and then the facts row withrow_numandsource_markdown_slug, so a facts row never precedes its fence row in Git.append(default) normalizes the stored fence (#6188), renders the row withfenceRowOf(unfenced-facts.ts, the one renderer) at one past the highest row number in the fence and among the page's facts rows (#6696 C9), strikessupersede.rowNumwhen given, and prepares the page writeunprojected(preparePageMutationoption: the helper writes the facts row, so the page publishes without canonical projection whatever the operation) underwithPendingFenceRowsatpendingTier.index-existingtakes a row the file already holds (a fence-guard hold'spayload.row_num): the cell must passfenceCellReadBackProblemagainst the fact, else it refusesfence_row_changed(reasonrow_missing/struck/empty/visibility/text) and writes nothing; otherwise the facts row derives from the cell (extractFactsFromFenceText, what a re-import projects) with the caller's embedding and session, and no file changes; the caller's observedRevision issnapshot.revision, which the coordinator re-checks under the page lock. An occupied row number fails the insert withstorage_errornaming the occupant. Tests:test/fence-fact-append.test.ts(PGLite and Postgres: append, supersede, index-existing from a real fence-guard hold, each refusal, and remember's fence row byte for byte against the earlier construction). GST-2497: on a holding page (not segmented),applythen keeps the page's newest five inline saved versions (pruneHoldingPageVersions). GST-2492:prepareFenceRowRetirementstrikes one or several rows of another page as a companion (a forgotten held row reads backforgotten:;removetakes the rows out instead of striking them).src/core/facts/held-fact-move.ts— GST-2492moveHeldFacts(engine, sourceId), run by the extract_facts phase: facts a strict source held onmemory/unattributed(anentitycell naming a page that did not exist) move into that page once it exists, onemanaged_maintenance_move_held_factpublication per entity (the fact-fence adoption preparer inpersistence/prepared-maintenance.ts, plus the holding rows struck as a companion, the belief ledger told the rows transferred). A row that cannot move (a database-only target, a malformed fence, a duplicate claim, a prior refusal) stays held and is reportedheld_fact_unmovable; a move into a restricted page removes the holding rows instead of striking them. GST-2497: the sync path's due check (moveRuledSharedHeld) is true only when a rule covers a held row's entity but not its holding page (a rule over the holding page alone narrows nothing), andplanningViewboundsgetConfigtoo.refuseUnheldFactis the one refusal for a factholdingHomewill not hold (remember'splanRememberTargetand, GST-2635,publishManagedFacts' attribute fallback call it before anything is admitted): an exact page rule on a strict source throwsgit_home_required(facts_lane, throughassertStrictGitHome) naming the entity's page, an unreadable access stateaccess_policy_pendingnaming the entity. Test:test/strict-fallback-refusal-gst2635.test.ts(PGLite and Postgres). GST-2667:holdingPageForrethrows an error of its access read that the persistence consumer prepares again (transientDatabaseFailure/transientInterruption: a statement cancel, a stale plan, contention, a lost connection, a pooler's client cap) instead of reading it asaccess_unreadable, so a fact preparing on a strict source is prepared again rather than refused; any other error (permission denied on the access tables) still reads asaccess_unreadable. Test:test/holding-read-transient-gst2667.test.ts(PGLite and Postgres).src/core/page-slug-grammar.ts—OP_PAGE_SLUG_RE/isOpPageSlug, the page slug grammar operations accept (moved out ofops/context.tssofacts-fence.tscan validate theentitycell ofmemory/unattributedwithout importing the operations layer).