Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
docs(wave18): lane 1 S2 fragment rows move to .wave18-fragments/lane1.md; the S1 rows live in lane1-s1.md on capy/wave18-lane1-s1
garrytanf45bed2eb2f8
diff --git a/.wave18-fragments/lane1.md b/.wave18-fragments/lane1.mdnew file mode 100644index 0000000000..fe05ab1a7d--- /dev/null+++ b/.wave18-fragments/lane1.md@@ -0,0 +1,44 @@+# Wave 18 lane 1 fragment rows, S2 (integrator: apply, then delete this file)++Branch `capy/wave18-lane1`. Its `INTEGRATOR-ROW:` commits (`14758692e` FACTS_ABSORB_REASONS, `61909f1df`+regeneration, `d28162a45` upgrade-replay golden, `0cd5f30d6` llms-full.txt) hold the generated output and+registry rows the lane's tests and guards need; the S1 share of them is redone S1-only on `capy/wave18-lane1-s1`.+Drop or redo them at slot time as you prefer. Everything below is what each S2 item needs in integrator-owned files.++## Slot-time steps++This file holds the S2 rows (#6779, #6773, #6778, #6761, #6791, #6753). The S1 rows (#6757, #6782, wave 18a) are in+`lane1-s1.md`, from `capy/wave18-lane1-s1`, which this branch merges.++1. [S2] **Plugin trees and llms (#6753).** `skills/maintain/SKILL.md` changed:+ `bun run scripts/generate-plugin-tree.ts --out plugin --variants-out plugin-variants`, then+ `bun run build:llms` (llms-full.txt inlines docs/guides/cron-schedule.md). `bun run regen:all --goldens` does both.++## Registry rows++- [S2] **`src/core/facts/absorb-log.ts` `FACTS_ABSORB_REASONS` (#6778):** append+ `'write_pending_accepted', 'write_deferred_unadmitted',` after `'write_refused'`, and bump+ `test/facts-absorb-log.test.ts` from `length).toBe(17)` to `19` with two `toContain` asserts.+ Already in commit "INTEGRATOR-ROW: FACTS_ABSORB_REASONS ..." (typecheck needs it: commit+ "fix(facts): facts absorb waits ..." alone does not typecheck).+- [S2] **`src/core/error-registry.ts` `CODES` (#6791), alphabetical position, then `bun run build:error-codes`.** The adapter's+ once-per-process stderr notice already names the code and points at `gbrain errors continuation_unproven`:+ ```ts+ continuation_unproven: { class: 'retryable', summary: "Claude Code continued an answer past its output cap and gbrain could not prove the full text, so the claude-cli call returned no text and no tool calls and finished as length.", why: "Print mode reports only the text after an automatic continuation; parsing or dispatching that tail as a complete answer would act on a fragment. The caller retries or escalates as for any capped answer; the gateway does not resend it to a fallback model.", reasons: ['events_missing', 'no_assistant_events', 'segments_unmatched'], docs: 'docs/ai-providers/claude-cli.md#claude-cli-troubleshooting', fix: { argv: ['gbrain', 'config', 'set', '<KEY>', '<TOKENS>'], inputs: [{ name: 'KEY', how: "The output cap the failing caller's truncation warning names (for example dream.propose_takes.max_tokens, facts.extraction_max_tokens or models.synopsis_max_tokens)." }, { name: 'TOKENS', how: 'A larger whole number of output tokens; ask the user, since a larger cap can cost more per call.' }], consent: [], actor: 'agent', ask_user: true, why: 'A cap the whole answer fits under ends the call before Claude Code continues it, so the full text arrives in one response.', requires_exclusive: false, verify: { argv: ['gbrain', 'config', 'get', '<KEY>'] } } },+ ```+ Adjust the `fix` envelope to the registry's current consent/ask_user shape if it differs.+ The code is provider metadata, not a thrown code, so no contract test requires the row.++## BEHAVIOR_CHANGES rows (`src/core/behavior-change-notice.ts`, `since: '<wave version>'`)++- [S2] **#6778:** "Facts absorb now waits for its write up to the job deadline instead of 5 s. A write still committing is logged `write_pending_accepted` and writer contention before admission `write_deferred_unadmitted`; neither counts toward the doctor's facts_extraction_health threshold, and persistent contention gets its own warning (`gbrain sources writer status --source <id> --json`)."+- [S2] **#6761:** "facts_extraction_health reports its 24 h failure count as history (rolling, with an ages-out time) and separately names facts-absorb jobs still dead, with `gbrain jobs retry <id>` as the fix; it no longer suggests raising `facts.absorb_warn_threshold`, and the thresholds are unchanged."+- [S2] **#6791:** "A `claude-cli` answer that Claude Code continued after hitting its output cap is now rebuilt in full from the call's event stream (the CLI runs with `--verbose`) instead of returning only the text after the continuation as a complete answer. When the full text cannot be proven, the call returns no text and no tool calls, finishes `length` (callers retry or escalate as for any capped answer) and reports `providerMetadata['claude-cli'].code = 'continuation_unproven'` with reason `events_missing`, `no_assistant_events` or `segments_unmatched`, and one stderr line per reason per process naming its remedy (upgrade the claude CLI for the first two, raise the caller's output cap for the third)."+- [S2] **#6773 (optional):** "Generated dream-cycle summaries now carry `created: <summary date>` in their frontmatter, so they pass `gbrain lint`'s temporal check."++## CHANGELOG credit++- #6773 reimplements PR #6773 by @lubosxyz ("Contributed by @lubosxyz", `Supersedes #6773`). The branch+ commit's `Co-Authored-By` trailer uses `[email protected]`; GitHub attributes this+ account (id 159481718) only through `[email protected]`, so use that+ address in the PR body or squash message. The pushed commit was not rewritten (no force-push).diff --git a/docs/.wave18-fragments/lane1.md b/docs/.wave18-fragments/lane1.mddeleted file mode 100644index 314a1a2f2f..0000000000--- a/docs/.wave18-fragments/lane1.md+++ /dev/null@@ -1,75 +0,0 @@-# Wave 18 lane 1 fragment rows (integrator: apply, then delete this file)--Branch `capy/wave18-lane1`. The two `INTEGRATOR-ROW:` commits at the end of the-branch already contain the generated output and registry rows the lane's tests-and guards need; drop or redo them at slot time as you prefer. Everything below-is what each item needs in integrator-owned files.--## Slot-time steps--Rows are tagged [S1] (#6757, #6782: wave 18a) or [S2]. For 18a, see "S1 cherry-pick list" at the end.--1. [S1] **Migration number (#6757).** `src/core/schema-migrations/v250-persistence-request-id-index.ts`- (name `persistence_request_id_index`) uses v250 provisionally. Renumber to the next free- version at slot time (file name, `version` field, and the test- `test/migration-persistence-request-id-index.test.ts` which imports it by path), then run- `bun run build:schema-migrations && bun run build:schema`.-2. [S1] **Generated files (#6757).** `src/core/schema-migrations/registry.generated.ts`,- `src/core/schema-migrations/latest.generated.ts`, `src/core/pglite-schema.generated.ts`- (regenerated by the step above; the INTEGRATOR-ROW commit carries the v250 version).-3. [S1] **Goldens (#6757).** The new index and the `persistence_request_indexes` wording- ("Request-table indexes are valid.") change these goldens; regenerate after renumbering:- - `GBRAIN_TEST_UPDATE_GOLDENS=1 bun test test/doctor-content-golden.test.ts test/doctor-hot-checks-golden.test.ts test/doctor-json-golden.test.ts test/migrations-golden.test.ts test/schema-catalog-golden.test.ts`- - `GBRAIN_TEST_UPDATE_GOLDENS=1 DATABASE_URL=<test db> bun test --timeout=60000 test/e2e/schema-catalog-golden.test.ts test/e2e/doctor-json-golden.test.ts test/e2e/doctor-hot-checks-golden.test.ts`-4. [S2] **Plugin trees and llms (#6753).** `skills/maintain/SKILL.md` changed:- `bun run scripts/generate-plugin-tree.ts --out plugin --variants-out plugin-variants`, then- `bun run build:llms` (llms-full.txt inlines docs/guides/cron-schedule.md). `bun run regen:all --goldens` does both.--## Registry rows--- [S2] **`src/core/facts/absorb-log.ts` `FACTS_ABSORB_REASONS` (#6778):** append- `'write_pending_accepted', 'write_deferred_unadmitted',` after `'write_refused'`, and bump- `test/facts-absorb-log.test.ts` from `length).toBe(17)` to `19` with two `toContain` asserts.- Already in commit "INTEGRATOR-ROW: FACTS_ABSORB_REASONS ..." (typecheck needs it: commit- "fix(facts): facts absorb waits ..." alone does not typecheck).-- [S2] **`src/core/error-registry.ts` `CODES` (#6791), alphabetical position, then `bun run build:error-codes`.** The adapter's- once-per-process stderr notice already names the code and points at `gbrain errors continuation_unproven`:- ```ts- continuation_unproven: { class: 'retryable', summary: "Claude Code continued an answer past its output cap and gbrain could not prove the full text, so the claude-cli call returned no text and no tool calls and finished as length.", why: "Print mode reports only the text after an automatic continuation; parsing or dispatching that tail as a complete answer would act on a fragment. The caller retries or escalates as for any capped answer; the gateway does not resend it to a fallback model.", reasons: ['events_missing', 'segments_unmatched'], docs: 'docs/ai-providers/claude-cli.md#claude-cli-troubleshooting', fix: { argv: ['gbrain', 'config', 'set', '<KEY>', '<TOKENS>'], inputs: [{ name: 'KEY', how: "The output cap the failing caller's truncation warning names (for example dream.propose_takes.max_tokens, facts.extraction_max_tokens or models.synopsis_max_tokens)." }, { name: 'TOKENS', how: 'A larger whole number of output tokens; ask the user, since a larger cap can cost more per call.' }], consent: [], actor: 'agent', ask_user: true, why: 'A cap the whole answer fits under ends the call before Claude Code continues it, so the full text arrives in one response.', requires_exclusive: false, verify: { argv: ['gbrain', 'config', 'get', '<KEY>'] } } },- ```- Adjust the `fix` envelope to the registry's current consent/ask_user shape if it differs.- The code is provider metadata, not a thrown code, so no contract test requires the row.--## BEHAVIOR_CHANGES rows (`src/core/behavior-change-notice.ts`, `since: '<wave version>'`)--- [S1] **#6757:** "Dream synthesis postprocess finds committed outputs by request id through a new online index (`persistence_requests_request_id`, built concurrently on Postgres, covered by `gbrain repair request-indexes`). A statement timeout on that read now defers the postprocess to a later pass (kept in `dream.synthesize.postprocess_pending`, finished without another synthesis call) instead of failing the pass (the replay runs no child job and verifies the output's quotes against the current transcript; a quote not found goes to `unverified_claims`); three deferrals in a row add a line to doctor `persistence_request_indexes`, whose messages now say \"request-table indexes\"."-- [S1] **#6782:** "`propose_takes` now treats a reply of `[]` followed by prose as an empty extraction and tombstones the page, instead of retrying the paid call every cycle. Pages that were retried forever get a tombstone on their next run. There is no per-page force flag: the tombstone is keyed by a hash of the page body, so any edit to the body re-extracts the page (docs/guides/cron-schedule.md)."-- [S2] **#6778:** "Facts absorb now waits for its write up to the job deadline instead of 5 s. A write still committing is logged `write_pending_accepted` and writer contention before admission `write_deferred_unadmitted`; neither counts toward the doctor's facts_extraction_health threshold, and persistent contention gets its own warning (`gbrain sources writer status --source <id> --json`)."-- [S2] **#6761:** "facts_extraction_health reports its 24 h failure count as history (rolling, with an ages-out time) and separately names facts-absorb jobs still dead, with `gbrain jobs retry <id>` as the fix; it no longer suggests raising `facts.absorb_warn_threshold`, and the thresholds are unchanged."-- [S2] **#6791:** "A `claude-cli` answer that Claude Code continued after hitting its output cap is now rebuilt in full from the call's event stream (the CLI runs with `--verbose`) instead of returning only the text after the continuation as a complete answer. When the full text cannot be proven, the call returns no text and no tool calls, finishes `length` (callers retry or escalate as for any capped answer) and reports `providerMetadata['claude-cli'].code = 'continuation_unproven'` with reason `events_missing` or `segments_unmatched`, with one stderr line per process."-- [S2] **#6773 (optional):** "Generated dream-cycle summaries now carry `created: <summary date>` in their frontmatter, so they pass `gbrain lint`'s temporal check."--## CHANGELOG credit--- #6773 reimplements PR #6773 by @lubosxyz ("Contributed by @lubosxyz", `Supersedes #6773`). The branch- commit's `Co-Authored-By` trailer uses `[email protected]`; GitHub attributes this- account (id 159481718) only through `[email protected]`, so use that- address in the PR body or squash message. The pushed commit was not rewritten (no force-push).--## S1 cherry-pick list (wave 18a)--The S1 items are #6757 and #6782. Their commits, in order, depend on no S2 commit:--1. `7bd759177` fix(dream) #6757 request-id index, uuid lookup, statement-timeout deferral-2. `da0bcac7f` fix(propose_takes) #6782 extractorOutcome-3. `1c23ae2d8` test(persistence) #6757 suites list the request-id index-4. `76f4349b0` docs(propose_takes) #6782 no per-page force re-extract-5. `40ccfcbea` fix(dream) #6757 replay stamps verification-deferred on a changed transcript (reverted by 6)-6. `6d22a2dec` fix(dream) #6757 replay verifies against the current transcript-7. INTEGRATOR-ROW `d28162a45` (pglite-upgrade-replay catalog golden, S1 only)--`61909f1df` is the other INTEGRATOR-ROW for #6757 but also carries the #6753 plugin trees and llms-full.txt, so-for 18a regenerate instead of cherry-picking it: `bun run regen:all --goldens`, the five unit goldens and the three-Postgres goldens in slot-time step 3. Checked on a detached worktree of `cadaf5cd7` with commits 1 to 7 picked (before 6 existed; 6 only reverts 5's source change):-they apply cleanly; the regenerated registry, latest and PGLite blob, migrations records and doctor json golden are-identical to `61909f1df`'s; typecheck passes; the S1 suites give 135 pass, 0 fail.