Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
test: pglite-repair dry-run case uses a provably dead PID, not a fixed 99999
garrytanf89aac8d4f84
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 5ab52d3511..7350dd6647 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -26,6 +26,8 @@ identifiers and attribution are available in the pre-removal Git revision- **`degraded_recall` shows on every affected call on stdio and the CLI.** Transient degradations (`rerank_failed`, `embed_timeout`, a failed keyword or title arm, every other per-call stage) are no longer deduped per session, so a failure after a different earlier failure, or the same failure after a recovery, always carries its notice. A notice made only of configuration-persistent stages (a keyless brain's `embed_unavailable`, about 600 characters on every search otherwise) carries an unrendered `dedupe_key` of its sorted unique stage/reason pairs, which the notice ledger dedupes on per session and the wire never shows. HTTP stays per call. `docs/protocol/AGENT_OPERATOR_v1.md` now states one rule for stdio, CLI and HTTP.- **`entity names[]` is 5 to 17 times faster on a large brain, with byte-identical output.** On a 55,838-page PGLite brain built from the Cat 40 Hard world M generator (seed 20261021, no embeddings), a 20-name batch's median went from 2,250 ms to 129 ms with every name found, from 1,743 ms to 155 ms with half found, and from 1,112 ms to 203 ms with none found. Profiling showed the name lookup itself dominated, not the cards: each found name ran two sequential scans of the source's pages, the alias resolver's "no other live page has this exact title" check and the card's exact-title / exact-slug / slug-suffix arm, about 50 ms each. Migration v240 adds `idx_pages_source_title_lower` (`source_id, lower(title)`) and a trigram index on `slug` (`idx_pages_slug_trgm`), built online on Postgres; the queries are unchanged and now run as index scans in about 1 ms. Single-name `entity`, context_pack cards and search's alias fan-out use the same two reads. The batch also stops assembling a full card per name it then threw away: candidate selection is now one exported function, `selectEntityCandidates`, that `buildEntityCard` and `lookupEntityNames` both call; the lead reuses the candidate row's body; siblings are read without the identity excerpt (`readSiblingIdentity`); and the private-page setting, mention policy and source pack are read once per batch (`entityLookupScope`). Parity tests compare the batch with the old full-card resolver over adversarial names (colliding aliases and titles, namespaced slugs, the same slug in two sources, private, deleted and quarantined candidates, identity siblings, stale aliases, LIKE wildcards) on PGLite and Postgres, and plan tests pin both reads to the new indexes.- **A Postgres statement timeout in the keyword or title arm is reported as a timeout (#6495).** `isTimeoutError` (`src/core/search/hybrid/degraded.ts`) now recognizes SQLSTATE 57014 through `isStatementTimeoutError`, so the arms' 8 s `SET LOCAL statement_timeout` on a large brain stamps `keyword_arm_failed` / `title_arm_failed` with reason `timeout` instead of `provider_error`. Probe in `test/hybrid-arm-rethrow.test.ts` (fails before).+- **Flake fix: `test/pglite-repair-command.serial.test.ts` case 1 no longer writes a fixed PID 99999 as its stale `postmaster.pid`.** On a busy host that PID can belong to a live process, so validation correctly refused ("postmaster.pid names a LIVE process") and the dry-run assertion failed (seen on a Ubicloud gate). The case now uses the file's `deadPid()` helper; a forced probe writing a live PID reproduces the failure.+## [0.60.184.0] - 2026-10-12**Unit and serial CI shards are packed from clean timings again.** CI splits each test lane across several machines using the recorded run time of every test file. The unit timings recorded before v0.60.183.0 carried a cold-boot penalty: three test files cleared the PGLite snapshot for every file after them in the same shard, so those files looked several minutes slower than they are. This release re-measures the unit and serial lanes from the first green master run after that fix. No product behaviour changes.diff --git a/test/pglite-repair-command.serial.test.ts b/test/pglite-repair-command.serial.test.tsindex f03eaec4fd..302f235075 100644--- a/test/pglite-repair-command.serial.test.ts+++ b/test/pglite-repair-command.serial.test.ts@@ -146,7 +146,7 @@ describe('gbrain pglite-repair — dry-run is strictly read-only', () => {const parent = tmp('gbrain-repair-dry-');const dir = join(parent, 'brain.pglite');makeFakeLayout(dir);- writeFileSync(join(dir, 'postmaster.pid'), '99999\n'); // unclean-shutdown marker+ writeFileSync(join(dir, 'postmaster.pid'), `${deadPid()}\n`); // unclean-shutdown marker from a provably dead PIDconst parentBefore = readdirSync(parent).sort();const dirBefore = readdirSync(dir).sort();