Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

chore(wave5-d): regenerate llms bundle, export-surface golden and e2e map

garrytan6e5d68fdb37e
diff --git a/llms-full.txt b/llms-full.txt
index 5529f172c4..c1f65381f0 100644
--- a/llms-full.txt
+++ b/llms-full.txt
@@ -5013,6 +5013,38 @@ vars — incident-time escape hatches, not everyday knobs.
reads only the filesystem — no database connection — so it keeps working
during the exact outages it exists to diagnose.
+## Several brains on one host
+
+Each brain gets its own autopilot job. The default brain (`~/.gbrain`, that
+is `GBRAIN_HOME` unset or set to your home directory) keeps the shared names:
+launchd label `com.gbrain.autopilot`, systemd unit `gbrain-autopilot.service`,
+start script `~/.gbrain/start-autopilot.sh`, and an unmarked crontab line.
+Any other brain gets names with a suffix: `com.gbrain.autopilot.<suffix>`,
+`gbrain-autopilot-<suffix>.service`, `<brain>/.gbrain/start-autopilot-<suffix>.sh`,
+and a crontab line ending in `# gbrain-autopilot:<suffix>`. The suffix is the
+first 8 hex characters of a random id that `--install` records in
+`<brain>/.gbrain/autopilot-install-id`. Every brain logs to its own
+`<brain>/.gbrain/autopilot.log`.
+
+`gbrain autopilot --status [--json]` prints the brain's job name, suffix,
+install-id path, wrapper path and log path (`job` in `--json`). `--status`
+and `--uninstall` act only on that brain's job.
+
+- **Moving a brain** keeps its id and job. `--status` reports
+ `needs_reinstall: wrapper_missing` until you run
+ `GBRAIN_HOME=<new parent> gbrain autopilot --install`, which repoints the
+ same job.
+- **Copying a brain** (`cp -r`) gives the copy a new id on its first
+ `--install`, so the original brain keeps its job.
+- **Upgrading from an older gbrain**: a non-default brain installed before
+ per-brain names ran under the shared names. `--status` reports
+ `needs_reinstall: legacy_shared_job`; `GBRAIN_HOME=<parent> gbrain autopilot --install`
+ replaces that shared job with the brain's own job and says so.
+- **`autopilot_job_owned_by_other_brain`**: installing the default brain
+ refuses when the shared job still runs another brain. Run the printed
+ `GBRAIN_HOME=<parent> gbrain autopilot --install` for that brain first, then
+ install the default brain again.
+
---
*Part of the [GBrain Skillpack](../GBRAIN_SKILLPACK.md).*
@@ -8053,7 +8085,10 @@ existing launch options throughout the repair.
| Autopilot under user systemd | `gbrain autopilot --status --json`; `systemctl --user status gbrain-autopilot.service` | `systemctl --user stop gbrain-autopilot.service` | `systemctl --user start gbrain-autopilot.service` |
| Autopilot under launchd | `gbrain autopilot --status --json`; `launchctl print "gui/$(id -u)/com.gbrain.autopilot"` | `launchctl bootout "gui/$(id -u)/com.gbrain.autopilot"` | `launchctl bootstrap "gui/$(id -u)" "$HOME/Library/LaunchAgents/com.gbrain.autopilot.plist"` |
-These are the default user-service names. If the installation uses a different
+These are the default brain's user-service names. A brain under any other
+`GBRAIN_HOME` uses its own suffixed names; `gbrain autopilot --status --json`
+prints them under `job` ([several brains on one host](live-sync.md#several-brains-on-one-host)).
+If the installation uses a different
service definition, use its actual name and recorded launcher. For a foreground
autopilot or a container/cron owner, stop and restart that owner through its
existing launcher; do not start a competing standalone supervisor. A timed-out
diff --git a/scripts/e2e-test-map.ts b/scripts/e2e-test-map.ts
index b81fd33413..2ebd77adcf 100644
--- a/scripts/e2e-test-map.ts
+++ b/scripts/e2e-test-map.ts
@@ -449,7 +449,9 @@ export const E2E_TEST_MAP: Record<string, string[]> = {
],
// Autopilot linux install/uninstall lifecycle (PATH-shimmed crontab +
// systemctl; the ubuntu CI runner's only behavioral pin on those arms).
- "src/commands/autopilot.ts": ["test/e2e/autopilot-linux-lifecycle.serial.test.ts", "test/e2e/worker-readiness-cli.test.ts"],
+ "src/commands/autopilot.ts": ["test/e2e/autopilot-linux-lifecycle.serial.test.ts", "test/e2e/autopilot-multi-brain.serial.test.ts", "test/e2e/worker-readiness-cli.test.ts"],
+ "src/commands/autopilot/jobs.ts": ["test/e2e/autopilot-linux-lifecycle.serial.test.ts", "test/e2e/autopilot-multi-brain.serial.test.ts"],
+ "src/core/autopilot-paths.ts": ["test/e2e/autopilot-linux-lifecycle.serial.test.ts", "test/e2e/autopilot-multi-brain.serial.test.ts"],
"src/commands/autopilot-daemon.ts": ["test/e2e/autopilot-linux-lifecycle.serial.test.ts", "test/e2e/worker-readiness-cli.test.ts"],
"src/commands/autopilot-dispatch.ts": ["test/e2e/autopilot-linux-lifecycle.serial.test.ts", "test/e2e/worker-readiness-cli.test.ts"],
"src/commands/autopilot-probes.ts": ["test/e2e/autopilot-linux-lifecycle.serial.test.ts", "test/e2e/worker-readiness-cli.test.ts"],
diff --git a/test/embed-concurrency-pool-clamp.test.ts b/test/embed-concurrency-pool-clamp.test.ts
index 6943d98d25..516fd06dbf 100644
--- a/test/embed-concurrency-pool-clamp.test.ts
+++ b/test/embed-concurrency-pool-clamp.test.ts
@@ -46,6 +46,7 @@ describe('#5183 embed concurrency never exceeds the Postgres pool', () => {
});
test('both embed loops use the clamped value', () => {
+ // test-reads-source-ok[structural]: both embed loops must take the clamped value; the loops need a live Postgres pool to observe.
const src = readFileSync(resolve(import.meta.dir, '..', 'src', 'commands', 'embed.ts'), 'utf-8');
expect(src.match(/const CONCURRENCY = resolveEmbedConcurrency\(engine\.kind, staleOpts\?\.paceMaxConcurrency\);/g)).toHaveLength(2);
expect(src).not.toMatch(/parseInt\(process\.env\.GBRAIN_EMBED_CONCURRENCY/);
diff --git a/test/fixtures/goldens/exports/types.json b/test/fixtures/goldens/exports/types.json
index 5da9850d31..3f228e2783 100644
--- a/test/fixtures/goldens/exports/types.json
+++ b/test/fixtures/goldens/exports/types.json
@@ -6924,7 +6924,7 @@
"kind": "function",
"name": "persistSynthesis",
"signature": [
- "(engine: BrainEngine, result: ThinkResult) => Promise<{ slug: string; evidenceInserted: number; warnings: string[]; }>"
+ "(engine: BrainEngine, result: ThinkResult, scope?: { sourceId?: string; allowedSources?: string[]; }) => Promise<{ slug: string; evidenceInserted: number; warnings: string[]; }>"
]
},
{
diff --git a/test/migration-child-cli.test.ts b/test/migration-child-cli.test.ts
index 931f52f20d..5367ed7e3a 100644
--- a/test/migration-child-cli.test.ts
+++ b/test/migration-child-cli.test.ts
@@ -68,6 +68,7 @@ describe('#5184 no migration spawns a name-resolved gbrain', () => {
const dir = join(REPO, 'src', 'commands', 'migrations');
const offenders: string[] = [];
for (const file of readdirSync(dir).filter(f => f.endsWith('.ts'))) {
+ // test-reads-source-ok[structural]: every migration spawn site, including ones only reachable mid-upgrade, must use the resolved CLI.
const src = readFileSync(join(dir, file), 'utf-8');
const lines = src.split('\n');
lines.forEach((line, i) => {