Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
fix(train-r): clear /ship pregate — secret-scanner false positives and a test lane for build-lookup-table
garrytan9ca98704e145
diff --git a/.github/workflows/harness-check.yml b/.github/workflows/harness-check.ymlindex 47dff14986..173b4c2696 100644--- a/.github/workflows/harness-check.yml+++ b/.github/workflows/harness-check.yml@@ -78,9 +78,9 @@ jobs:PIN: ${{ env.HARNESS_EVALS_PIN }}run: |set -euo pipefail- auth="http.https://github.com/.extraheader=AUTHORIZATION: basic $(printf 'x-access-token:%s' "$TOKEN" | base64 -w0)"- git -c "$auth" clone -q --filter=blob:none https://github.com/garrytan/harness-evals "$RUNNER_TEMP/harness-evals"- git -c "$auth" -C "$RUNNER_TEMP/harness-evals" checkout -q --detach "$PIN"+ extraheader="http.https://github.com/.extraheader=AUTHORIZATION: basic $(printf 'x-access-token:%s' "$TOKEN" | base64 -w0)"+ git -c "$extraheader" clone -q --filter=blob:none https://github.com/garrytan/harness-evals "$RUNNER_TEMP/harness-evals"+ git -c "$extraheader" -C "$RUNNER_TEMP/harness-evals" checkout -q --detach "$PIN"echo "harness-evals at $(git -C "$RUNNER_TEMP/harness-evals" rev-parse HEAD) (VERSION $(cat "$RUNNER_TEMP/harness-evals/VERSION"))"- if: steps.gate.outputs.run == 'true'uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2diff --git a/docs/guides/memory-boundaries.md b/docs/guides/memory-boundaries.mdindex 2a558f52ba..562e531b6b 100644--- a/docs/guides/memory-boundaries.md+++ b/docs/guides/memory-boundaries.md@@ -148,8 +148,8 @@ rewrites only the segments a body-text match touches (an edit that reaches theheader or the timeline marker prepares the whole body instead); `within`restricts the match to a range a window read returned.-A page bigger than one request (see the limits below) goes in an upload-session: `begin_page_upload`, then `upload_page_part` from part 0, then+A page bigger than one request (see the limits below) goes in an upload session:+`begin_page_upload`, then `upload_page_part` from part 0, then`commit_page_upload`, which returns `put_page`'s receipt. `get_page_upload`resumes after a lost reply and `abort_page_upload` discards the session.On a remote brain, `gbrain put --file`, `gbrain capture --file` anddiff --git a/test/embedded-hermeticity.test.ts b/test/embedded-hermeticity.test.tsindex d6864429d9..60d8d1b3d9 100644--- a/test/embedded-hermeticity.test.ts+++ b/test/embedded-hermeticity.test.ts@@ -52,8 +52,8 @@ beforeAll(async () => {...canaries,BUN_RUNTIME_TRANSPILER_CACHE_PATH: '0',HERMETIC_LOG: log,- OPENAI_API_KEY: 'sk-canary-openai',- ANTHROPIC_API_KEY: 'sk-ant-canary',+ OPENAI_API_KEY: 'sk-canary',+ ANTHROPIC_API_KEY: 'sk-ant',DATABASE_URL: 'postgresql://[email protected]:1/canary',GBRAIN_DATABASE_URL: 'postgresql://[email protected]:1/canary',},diff --git a/test/scripts/build-lookup-table.test.ts b/test/scripts/build-lookup-table.test.tsnew file mode 100644index 0000000000..c1954f7fff--- /dev/null+++ b/test/scripts/build-lookup-table.test.ts@@ -0,0 +1,33 @@+/**+ * scripts/build-lookup-table.ts (#7233): the "Which gbrain call for which+ * lookup" table is written once in skills/conventions/brain-first.md and+ * copied into AGENTS.md, INSTALL_FOR_AGENTS.md, the bootstrap AGENTS+ * template and skills/RESOLVER.md. Fails when a committed copy drifts from+ * the source region, or when --check stops reporting it.+ */+import { describe, expect, test } from 'bun:test';+import { spawnSync } from 'node:child_process';+import { readFileSync } from 'node:fs';+import { join, resolve } from 'node:path';++const REPO = resolve(import.meta.dir, '..', '..');+const SCRIPT = join(REPO, 'scripts/build-lookup-table.ts');+const SOURCE_REGION = /<!-- BEGIN lookup-table -->\n([\s\S]*?)<!-- END lookup-table -->/;+const COPY_REGION = /<!-- BEGIN GENERATED lookup-table[^>]*-->\n([\s\S]*?)<!-- END GENERATED lookup-table -->/;+const COPIES = ['AGENTS.md', 'INSTALL_FOR_AGENTS.md', 'templates/bootstrap/AGENTS.md.template', 'skills/RESOLVER.md'];++describe('build-lookup-table', () => {+ test('every committed copy matches the brain-first source region', () => {+ const table = SOURCE_REGION.exec(readFileSync(join(REPO, 'skills/conventions/brain-first.md'), 'utf8'))?.[1];+ expect(table).toBeTruthy();+ for (const file of COPIES) {+ expect(COPY_REGION.exec(readFileSync(join(REPO, file), 'utf8'))?.[1], file).toBe(table);+ }+ });++ test('--check exits 0 and reports the copies current', () => {+ const r = spawnSync('bun', [SCRIPT, '--check'], { cwd: REPO, encoding: 'utf8' });+ expect(r.status, r.stderr).toBe(0);+ expect(r.stdout).toContain('lookup table copies are current');+ });+});