Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
test: export-surface goldens for sourceGitScope; changelog command text
time-attackf16f33552473
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex eca5477c9c..8defb3fcaa 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -28,7 +28,7 @@ An agent that shells out to `gbrain` pays process start-up and exit on every cal### Itemized changes- **No fixed exit delay.** A one-shot command now exits as soon as its piped output is delivered. It still waits for a slow reader: stdout goes through the delivery-exact write chain, and a backlog on stderr holds the exit until Bun reports the pipe drained. The 250 ms grace (`GBRAIN_FLUSH_GRACE_MS`) is now only an upper bound for that wait.-- **Lazy start-up.** `gbrain --version`, `gbrain version`, bare `gbrain` and `gbrain --help` answer without loading the dispatcher. Real commands skip the schema-migration modules unless the brain is behind, skip the version-upgrade registry, and load the MCP HTTP client only for thin-client calls. Output, exit codes, the CLI surface and the MCP tool list are unchanged.+- **Lazy start-up.** `gbrain --version`, bare `gbrain` and `gbrain --help` answer without loading the dispatcher. Real commands skip the schema-migration modules unless the brain is behind, skip the version-upgrade registry, and load the MCP HTTP client only for thin-client calls. Output, exit codes, the CLI surface and the MCP tool list are unchanged.- **Faster code stripping.** Link extraction, citation parsing and the doctor checks that read page bodies strip code 23-33x faster, with byte-identical output.- **Faster chunk token counts.** Import counts are still exact cl100k counts, memoized per pre-token, so chunk boundaries are identical. The chunk pass is about 3.5x faster, and `extract all` uses about 2.5x less CPU.- **Cheaper `gbrain doctor`.** One `git ls-files` per checkout per run (34 git spawns instead of 50), no citation parsing on pages without `[Source:`, and one `.git` lookup per source instead of one per page. Output and exit codes are unchanged. At 50,030 pages `doctor --json` takes 15.8 s instead of 19.4 s (p50).diff --git a/test/fixtures/goldens/exports/runtime.json b/test/fixtures/goldens/exports/runtime.jsonindex f342f8e8be..36e4848069 100644--- a/test/fixtures/goldens/exports/runtime.json+++ b/test/fixtures/goldens/exports/runtime.json@@ -695,6 +695,7 @@"resolveSourceLocalFilePath","serializeMarkdown","serializePageToMarkdown",+ "sourceGitScope","splitBody","yamlAliasesWithinLimit","yamlBlockError"diff --git a/test/fixtures/goldens/exports/types.json b/test/fixtures/goldens/exports/types.jsonindex c240d79230..fd67d51293 100644--- a/test/fixtures/goldens/exports/types.json+++ b/test/fixtures/goldens/exports/types.json@@ -5391,7 +5391,7 @@"kind": "function","name": "resolveSourceLocalFilePath","signature": [- "(localPath: string, rawSourcePath: string | null | undefined, pageSlug?: string | null, slugRootMode?: \"git-root\" | \"source-root\") => string | null"+ "(localPath: string, rawSourcePath: string | null | undefined, pageSlug?: string | null, slugRootMode?: \"git-root\" | \"source-root\", gitScope?: string[] | null) => string | null"]},{@@ -5408,6 +5408,13 @@"(page: Page, tags: string[], opts?: SerializePageOpts) => string"]},+ {+ "kind": "function",+ "name": "sourceGitScope",+ "signature": [+ "(localPath: string) => string[] | null"+ ]+ },{"kind": "function","name": "splitBody",