Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
Google connector sweeps (key files cluster)
Subsystem index · Google connector + open-loop engine · Previous entries.
src/core/google/sweep-shared.ts— the per-run dependency bag (GoogleSyncDeps,GoogleSyncSummary) and the page write and delete primitives the contacts, calendar and Gmail sweeps share.importRenderedsends a managed source's render toManagedConnectorSync.importMarkdownand returns null when the session skipped it as purged content (purged: true, #8938), so the Gmail sweep derives no loops from it. On an unmanaged source it carries the stored fences into the render, then screens it against the source's page purge tombstones (intentCarriesPurgedContent, the content hash the import guard compares) and skips a match with one log line naminggbrain pages unpurge, before any drift check or file write, as the managed connector skips it. OtherwisereplaceableFile(facts/file-body-guard.ts) decides whether the checkout file may be replaced; itsalsoHeldAscallback gets each stored state and puts that state's own## Factsfence back into a file that lacks one (the live row stores the fence without the withdrawal overlay a page read adds, versions store the overlaid view), so a file missing only gbrain's fence is replaceable and any other file edit refusesfile_database_drift. The render is written to a private temporary file, imported, checked against the compared bytes and renamed over the page.deletePageByRelPathdeletes by recorded source path inside the source directory. Tests:test/google-classic-purged-item-8644.test.ts,test/google-withdrawn-fence-carry-8645.test.ts,test/google-connector-facts-fence-7292.test.ts.