Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
chore(wave18b): lane 4 release notes and shared-file manifest for the integrator
garrytanbc5b384eea2c
diff --git a/.wave18b/lane4-manifest.md b/.wave18b/lane4-manifest.mdnew file mode 100644index 0000000000..7c776512c3--- /dev/null+++ b/.wave18b/lane4-manifest.md@@ -0,0 +1,50 @@+# Wave 18b lane 4: shared-file manifest++Every edit lane 4 made to a file another lane or the integrator also owns. Each is a minimal append or a+one-line change; regenerate the generated files once after merging all lanes.++## Registries (append-only entries)++| File | Entry | Item |+|---|---|---|+| `src/core/error-registry.ts` | `ipc_path_too_long` (host_only) | 4.2 |+| `src/core/error-registry.ts` | `backup_too_large` (host_only, physical-copy fix) | 4.5 |+| `src/core/error-registry.ts` | `unmanaged_database_path` (host_only, physical-copy fix; the code was already thrown, now registered) | 4.5 |+| `src/core/error-registry.ts` | `pending_verify` (host_only, `exit: 13`) | 4.4 |+| `src/core/exit-codes.ts` | `HARNESS_PENDING_VERIFY_EXIT_CODE = 13` (header comment updated) | 4.4 |+| `test/exit-codes.test.ts` | two expectations: the constant is 13, `exitCodeForCode('pending_verify')` is 13 | 4.4 |+| `src/commands/doctor/registry.ts` | `ipcSocketPathEntry` after `pgliteDataDirEntry` | 4.2 |+| `src/core/doctor-categories.ts` | `ipc_socket_path` → `ops` | 4.2 |+| `test/fixtures/goldens/doctor/registry-build-checks.json` | 4 lines for the `ipc_socket_path` entry | 4.2 |+| `scripts/serial-files.tsv` | row for `test/resolve-ipc-rebind.serial.test.ts` | 4.1 |+| `scripts/check-agent-contract.ts` | `READ_ONLY_SUBCOMMANDS` gains `bootstrap harness --status` (it takes no lock and writes nothing) | 4.4 |+| `scripts/check-windows-hide.ts` | `NOT_YET_MIGRATED` trimmed from 84 to 13 entries, each naming its owner | 4.3 |+| `test/scripts/windows-hide-guard.test.ts` | ratchet fixture repointed from `src/core/tailscale.ts` (migrated) to `src/core/persistence/topology-filesystem.ts` | 4.3 |+| `.github/workflows/persistence-validation.yml` | `test/e2e/transaction-cancel-held-lock.test.ts` added to the direct + pooled step (`Require canonical reconciliation through direct and pooled PostgreSQL`) so its PgBouncer arm runs in CI | 4.6 |+| `.github/workflows/test.yml` | Windows-only step `Long Windows PGLite IPC paths use the per-user run dir (#6573)`, after the #4992 hidden-console step | 4.2 |++## Generated docs (committed regenerated; regenerate once after merge)++- `docs/guides/error-codes.md` (`bun run build:error-codes`): the four codes above.++## Shared docs (hand-edited)++| File | Change | Item |+|---|---|---|+| `docs/guides/troubleshooting.md` | symptom rows and sections `#ipc-path-too-long`, `#backup-too-large` | 4.2, 4.5 |+| `docs/guides/in-agent-setup.md` | §6 preflight paragraph, new `### Large or non-standard brains: quiesced physical copy`, troubleshooting row | 4.5 |+| `docs/guides/bootstrap.md` | `#pending-verify` paragraph in the PGLite note | 4.4 |+| `docs/guides/exit-codes.md` | row for exit 13 | 4.4 |+| `docs/protocol/AGENT_OPERATOR_v1.md` | row for exit 13 in the exit-code table | 4.4 |+| `docs/architecture/key-files/{engines-2,mcp,core-services-1-continued,google-and-loops,agent-bootstrap}.md` | per-file entries for the touched modules | all |+| `vendor/README.md` | the `own()` cancel-and-discard hunk in the patch inventory | 4.6 |++## Driver patch (4.6, its own commit 255e2357)++`patches/[email protected]` is the source of truth; `vendor/postgres/{src,cjs/src,cf/src}/index.js` and+`vendor/postgres/types/index.d.ts` were rebuilt with `bash vendor/update-postgres.sh` and `--check` is clean.++## Not touched++No `src/core/persistence/*` or `sync*` edits; VERSION, CHANGELOG headers, BEHAVIOR_CHANGES `since:` values and+`llms*.txt` are untouched (rows are in `lane4-release-notes.md`).diff --git a/.wave18b/lane4-release-notes.md b/.wave18b/lane4-release-notes.mdnew file mode 100644index 0000000000..cabe26db76--- /dev/null+++ b/.wave18b/lane4-release-notes.md@@ -0,0 +1,56 @@+# Wave 18b lane 4: release notes for the integrator++Version stamps, CHANGELOG headers and `since:` values are the integrator's. Rows below use `since: '<WAVE_VERSION>'`.++## CHANGELOG bullets (Itemized changes)++- **Transaction aborts cancel their running statement (#6598).** An aborted Postgres transaction now sends the+ driver's cancel for the statement it is running before it discards the reserved connection, so a statement blocked+ on a lock no longer keeps running on the server after the caller gave up. `vendor/postgres` (and+ `patches/[email protected]`) gain `own()` cancel-and-discard; `transaction-abort.ts` uses it with a settle window+ (`cancelSettleMs`). The abort's `cause` stays the driver error; a failed cancel is reported as `cancelFailure`.+ Contributed by @Kkkkkuro (re-land of the cancel hunk from #6790). Proven on direct Postgres and PgBouncer+ (`test/e2e/transaction-cancel-held-lock.test.ts`).+- **A surviving `gbrain serve` takes over resolve IPC once the owner exits (#6647).** Each socket a serve could not+ bind (source and legacy) retries on an unref'd timer every 30 s plus jitter, through the single-owner probe, so+ hooks keep their per-turn context after the first serve stops.+- **Long Windows PGLite paths keep working IPC (#6573).** On Windows, a data-dir socket path over the 107-byte+ afunix limit moves to `%USERPROFILE%\.gbrain\run\<kind>-<hash12>.sock`, still guarded by `.gbrain-ipc-secret`.+ A path still too long there is reported as `ipc_path_too_long` in the serve log and by the new doctor check+ `ipc_socket_path`, with the move-the-brain fix.+- **Process launches hide their console window on Windows (#4992).** 71 more files now launch through+ `src/core/spawn.ts`; the `NOT_YET_MIGRATED` ratchet lists 13 files (open PRs and the persistence write path).+- **`gbrain backup create` refuses brains its archive cannot hold, up front (#6649).** A flat or symlinked data dir+ is `unmanaged_database_path` (before: a one-line refusal, or a generic `symlink_path` for a `.gbrain` alias) and an+ estimated archive over 8 GiB is `backup_too_large` (before: the dump ran and failed late, "Out of memory"). Both+ refuse before the lock or any write and point at the new quiesced physical-copy runbook+ (`docs/guides/in-agent-setup.md`), proven by a restore drill test. Doctor's `pglite_data_dir` warns from 75% of+ the cap. #6649 stays open for native archives over 8 GiB.+- **`bootstrap harness --token` on PGLite no longer needs the serve running to wire (#6661).** With no serve+ answering and none holding the brain, the run wires every target and ends `pending_verify` (exit 13, JSON+ `status: "pending_verify"`); its `fix` is the same `--token` re-run once the serve is up, which runs while the serve+ holds the brain. `bootstrap harness --status` stays `partial` (exit 1) until then.++## BEHAVIOR_CHANGES rows (src/core/behavior-change-notice.ts)++```ts+ // Wave 18b lane 4 item 4.6 (#6598).+ { since: '<WAVE_VERSION>', text: 'On Postgres, an aborted transaction (a request deadline, a cancelled job or a closed client) now cancels the statement it is running before it releases the connection, instead of leaving that statement running on the server until it finished on its own. A statement waiting on a lock is cancelled within the settle window; the abort error keeps the driver error as `cause` and reports a failed cancel as `cancelFailure`.' },+ // Wave 18b lane 4 item 4.1 (#6647).+ { since: '<WAVE_VERSION>', text: 'A second `gbrain serve` that could not bind the resolve IPC socket (another serve owned it) now retries every 30 seconds (plus up to 5 s jitter) and takes the socket over once the owner is gone, so hooks keep per-turn context without restarting the surviving serve. The single-owner rule is unchanged: a live owner is never displaced.' },+ // Wave 18b lane 4 item 4.2 (#6573).+ { since: '<WAVE_VERSION>', text: 'On Windows, a PGLite brain whose data directory makes the IPC socket path longer than 107 bytes now places its sockets at `%USERPROFILE%\\.gbrain\\run\\<kind>-<hash>.sock` (the Postgres scheme, same `.gbrain-ipc-secret` guard) instead of failing to bind them, so hooks and local commands reach `gbrain serve` again. A path still too long is logged as `ipc_path_too_long` and reported by the new doctor check `ipc_socket_path`.' },+ // Wave 18b lane 4 item 4.5 (#6649).+ { since: '<WAVE_VERSION>', text: '`gbrain backup create` on PGLite now refuses before it takes the lock or writes anything when the brain is outside what its archive holds: a data directory that is not `<root>/.gbrain/brain.pglite` or is reached through a symlink is `unmanaged_database_path` (a `.gbrain` alias used to get `symlink_path`), and an estimated archive over 8 GiB is `backup_too_large` (it used to run the dump and fail late). Under `--json` both are their own envelope with an ask-the-user physical-copy fix instead of `storage_error`; the legacy `reason` is unchanged. Doctor `pglite_data_dir` now warns on a healthy PGLite brain whose estimated archive passes 6 GiB.' },+ // Wave 18b lane 4 item 4.4 (#6661).+ { since: '<WAVE_VERSION>', text: '`gbrain bootstrap harness --token` on a PGLite brain now wires the harness when no serve answers at the serve URL and none holds the brain, and exits 13 with JSON `status: "pending_verify"` instead of exit 1 before writing anything. Re-run the same command with the same `--token` once `gbrain serve --http` runs to verify it; `gbrain bootstrap harness --status` reports `status: "partial"` and exits 1 until that run passes. A serve holding the brain at another URL, any HTTP answer, no `--token` and Postgres brains still fail as before. The harness `--json` result gains `status` (`ok`, `failed` or `pending_verify`).' },+```++## PR body notes++- Partially supersedes #6790 (Kkkkkuro): this lane re-lands its `own()` cancel-and-discard hunk, the+ `types/index.d.ts` hunk and its offline cancel-order test. Design change from #6790: the abort's `cause` stays the+ driver error (callers such as `publication-deadline.ts` classify `cause.code`), and a cancel failure is a new+ enumerable `cancelFailure` field; the #6790 test is adjusted to that. Credit: `Contributed by @Kkkkkuro` plus the+ `Co-Authored-By` trailer on commit 255e2357.+- Addresses #6647, #6573, #4992 (ratchet step), #6598, #6661; refs #6649 (stays open: archives over 8 GiB).