Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

Chain the Google sweeps key-files page from the API access page, and tag the Request Log page test's source read

garrytan941801f440ab
diff --git a/docs/architecture/key-files/google-api-access.md b/docs/architecture/key-files/google-api-access.md
index 166714dd5f..3440412ce2 100644
--- a/docs/architecture/key-files/google-api-access.md
+++ b/docs/architecture/key-files/google-api-access.md
@@ -10,3 +10,5 @@
- Tests: `test/google-api-access-7073.test.ts`, `test/google-api-access-cmd-7073.serial.test.ts`, `test/google-api-access-managed-7073.test.ts` (real PGLite, and Postgres under `DATABASE_URL`).
- `src/commands/doctor/checks/google-api-access.ts` — doctor `google_api_access` (wave check, resolution operator, zero network): warns per Google source whose stored `api_access` names a service it still syncs, listing each disabled API with project and enable link, with `googleApiAccessFix` for the first source.
- `src/core/persistence/connector-google-receipts.ts` — the managed Google attachment-repair preparer checks account/thread/message ownership from the current canonical snapshot, changes only the owned receipt frontmatter field, and installs provider-free text projections under the existing source-before-page publication locks. Page identity/revision, current authorization, source incarnation and file recovery guards remain mandatory; body, unrelated frontmatter, tags and the withdrawal ledger are preserved. It schedules no embeddings, loop detection or fact extraction. `connector-sync.ts` admits this narrow mutation and banks its committed receipts through the existing managed connector checkpoints.
+
+[Continue this subsystem](google-sweeps.md).
diff --git a/docs/architecture/key-files/google-sweeps.md b/docs/architecture/key-files/google-sweeps.md
index a6f7a4b7d9..eb7d87692a 100644
--- a/docs/architecture/key-files/google-sweeps.md
+++ b/docs/architecture/key-files/google-sweeps.md
@@ -1,5 +1,5 @@
# Google connector sweeps (key files cluster)
-[Subsystem index](../KEY_FILES.md) · [Google connector + open-loop engine](google-and-loops.md) · [Account identity and API access](google-api-access.md).
+[Subsystem index](../KEY_FILES.md) · [Google connector + open-loop engine](google-and-loops.md) · [Previous entries](google-api-access.md).
- `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. `importRendered` sends a managed source's render to `ManagedConnectorSync.importMarkdown` and 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 naming `gbrain pages unpurge`, before any drift check or file write, as the managed connector skips it. Otherwise `replaceableFile` (`facts/file-body-guard.ts`) decides whether the checkout file may be replaced; its `alsoHeldAs` callback gets each stored state and puts that state's own `## Facts` fence 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 refuses `file_database_drift`. The render is written to a private temporary file, imported, checked against the compared bytes and renamed over the page. `deletePageByRelPath` deletes 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`.
diff --git a/test/serve-http-admin-request-log-retention.test.ts b/test/serve-http-admin-request-log-retention.test.ts
index f4e27c6a03..1d571112c1 100644
--- a/test/serve-http-admin-request-log-retention.test.ts
+++ b/test/serve-http-admin-request-log-retention.test.ts
@@ -91,6 +91,7 @@ describe('admin dashboard across a request-log prune', () => {
describe('admin Request Log page', () => {
test('shows the retention window and prune date the endpoint returns', () => {
+ // test-reads-source-ok[structural]: the admin SPA has no component harness, so this pins that the page renders the endpoint's retention fields
const page = readFileSync('admin/src/pages/RequestLog.tsx', 'utf8');
expect(page).toContain('data.retention_days');
expect(page).toContain('data.pruned_before');