Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
wave18b lane 5: release notes and shared-file manifest (#5012)
garrytan3cecb6abb636
diff --git a/.wave18b/lane5-manifest.md b/.wave18b/lane5-manifest.mdnew file mode 100644index 0000000000..6eaedeae01--- /dev/null+++ b/.wave18b/lane5-manifest.md@@ -0,0 +1,24 @@+# Wave 18b lane 5: shared-file manifest++Every edit this lane made to a shared registry, generated file or ratchet.+Each is a minimal append; resolve merge conflicts by keeping every lane's rows.++| File | Edit |+|---|---|+| `src/core/config.ts` | One `KNOWN_CONFIG_KEYS` row: `loops.updates_require_reciprocity` (with a one-line comment). Validator lives in `src/core/google/loops-reciprocity.ts`, wired in `src/commands/config/loops-values.ts`. |+| `src/core/error-registry.ts` | One entry: `calendar_unreadable` (class `caller`, docs `docs/guides/google-connect.md#unreadable-calendar`, fix argv `gbrain google calendars --json`, verify `gbrain doctor --only google_calendar_readable --json`). |+| `docs/guides/error-codes.md` | Regenerated with `bun run build:error-codes` after the registry append. Regenerate again after merging other lanes' codes. |+| `src/core/doctor-categories.ts` | `google_calendar_readable` appended to the `ops` category. |+| `src/commands/doctor/wave-checks.ts` | One check registration: `google_calendar_readable` (resolution `operator`, registration `wave`, hostOnly). |+| `src/commands/doctor/checks/graph-health.ts` | `google_calendar_readable` appended to the `timelineHistoryEntry` emits list. |+| `test/fixtures/goldens/doctor/registry-build-checks.json` | One golden row `{ category: ops, name: google_calendar_readable }`. |+| `src/core/operation-manifest.generated.ts` | Regenerated (`bun run scripts/build-operation-manifest.ts`) for the new `loops_mute` / `loops_unmute` / `open_loops` descriptions. Regenerate after merging other lanes' op changes. |+| `llms.txt`, `llms-full.txt` | NOT regenerated (integrator's job): `bun run verify` reports them stale from this lane's doc edits; `bun run regen:all` fixes it. |+| `scripts/module-size-limits.tsv` | `src/core/config.ts` 1979 → 1981; `src/commands/config.ts` 1508 → 1509 (each note names lane 5). `src/commands/sources.ts` stays under its existing 2059 ceiling (2052 lines). |+| `src/commands/sources.ts` | `case 'set-calendar'` dispatch and one help row; `runSetCrMode` prints the contextual-mode hint. |+| `skills/google-loops/SKILL.md` → `skills/skills.lock.json`, `plugin/skills/google-loops/SKILL.md` | Runbook lines for mute/unmute/drop sender and `withheld_noise`; lock and plugin tree regenerated (`bun run scripts/generate-skills-manifest.ts`, `bun run scripts/generate-plugin-tree.ts --out plugin --variants-out plugin-variants`). Regenerate after merging if another lane edits skills. |+| `docs/architecture/key-files/{open-loops-engine,google-and-loops,google-and-loops-continued,commands-1,commands-5}.md` | Bullets updated; new bullets for `loops-reciprocity.ts`, `google-calendar-status.ts`, `sources-set-calendar.ts`, `doctor/checks/google-calendar.ts`, `config/contextual-mode-hint.ts`. `google-and-loops-continued.md` is at 59,769 of its 60,000-byte cap. |++Not touched: VERSION, CHANGELOG, `BEHAVIOR_CHANGES` (rows are in `lane5-release-notes.md`), `llms*.txt`, any `persistence/sync*` file.++Connector state additions (no migration): `GoogleSourceState.loop_withheld_senders`, `loop_automated_backfill_done`, `calendar_unreadable`, published by `loopRecoveryState` in `google-source.ts` on partial managed runs. `open_loops.closed_by` gains the values `muted`, `mute_recheck`, `unmuted` (free text column; no schema change).diff --git a/.wave18b/lane5-release-notes.md b/.wave18b/lane5-release-notes.mdnew file mode 100644index 0000000000..8f78722c0d--- /dev/null+++ b/.wave18b/lane5-release-notes.md@@ -0,0 +1,47 @@+# Wave 18b lane 5: release notes (#5012 items 8, 9, 6)++The integrator merges these into CHANGELOG.md and `BEHAVIOR_CHANGES`+(`src/core/behavior-change-notice.ts`) at stamp time. `since` is the wave's+release; nothing here sets a version.++Issue status for the PR body: `Addresses #5012` (item 8: the reporter's own+bank alerts were not replayed, so this lane does not claim them fixed; item 9+and item 6 are fixed by the code and probes below).++## CHANGELOG bullets++### What you'd see++| Situation | Before | Now |+|---|---|---|+| A bank, payment or shipping alert sent with `Precedence: bulk`, `list` or `junk`, a `List-Id`, or a no-reply `Reply-To` | `gbrain waiting` lists it as a person waiting on you | no reply-owed loop opens; the sync log prints `[google] reply-owed loops withheld: automated_mail=N` |+| Older reply-owed loops from those senders | stay listed with no way out but one `loops drop <id>` at a time | `gbrain waiting` counts them and prints `gbrain loops drop sender <email> --source <id> --dry-run` per sender; the dry run lists ids, the apply closes them (cannot be undone) |+| `gbrain loops mute sender <email>` / `mute thread <id>` | stops new loops; existing loops stay open | also closes that sender's or thread's open reply-owed loops and prints the count and the `Undo:` command; `--dry-run` lists them first |+| `gbrain loops unmute ...` | loops closed during the mute stay closed | the loops the mute closed are re-checked on the next Gmail sync; one reopens only if nothing answered its thread since; `--dry-run` lists them |+| Gmail files a cold introduction under Updates | opens a loop | unchanged by default; `gbrain config set loops.updates_require_reciprocity true` (opt-in) requires that you wrote to the sender before Updates mail opens a loop |+| The source's calendar id is one the account cannot read (HTTP 403/404) | the sweep looks like an empty calendar | the sync logs `calendar_unreadable` with the fix; `gbrain google status` names it (`ok: false`, exit 1); doctor `google_calendar_readable` warns |+| Pointing a Google source at another calendar | edit `g_calendar_id` by hand | `gbrain sources set-calendar <source> <calendar-id>` |+| `gbrain config set search.contextual_retrieval <mode>` or `gbrain sources set-cr-mode` | silent about existing pages | prints that existing pages keep their recorded mode and names `gbrain repair contextual-mode` |++### Itemized changes++- Loop noise (#5012 item 8). `src/core/google/google-clients.ts` captures `Precedence`, `List-Id` and `Reply-To`; `isPositivelyAutomated` (`google-render.ts`) and `detectThreadLoop` (`loop-detect.ts`) withhold the reply-owed open with a typed `withheld` reason (`automated_mail`, `updates_without_reciprocity`); closes are unaffected. The sweep records withheld senders in connector state (`loop_withheld_senders`, at most 2,000) and, once, re-checks the newest thread of up to 500 senders with open reply-owed loops (`loop-catchup.ts` `seedLoopRechecks`).+- Mute closes, unmute re-checks. `loops-store.ts` `closeMutedLoops` / `requeueMutedLoops` / `settleMuteRecheck`; the upsert never reopens a `muted` loop for the same counterparty and reopens a `mute_recheck` loop on the re-check's verdict. `loops_mute` returns `closed` (dry run `would_close`) and `undo_command`; `loops_unmute` returns `requeued`, `unverifiable`, `stale_source` with `recheck_command`, and `undo_command` (dry run `would_requeue`). Manual closes are never touched; a loop another mute still covers stays closed.+- `gbrain loops drop sender <email> [--source] [--note] [--dry-run]` (`src/commands/loops.ts`); `open_loops` grouped view and `gbrain waiting` add `withheld_noise`.+- New opt-in key `loops.updates_require_reciprocity` (default `false`, boolean, off value `false`; validated at `config set`) in `src/core/google/loops-reciprocity.ts`.+- Unreadable calendar (#5012 item 9). `GoogleForbiddenError` and `CalendarClient.probeCalendar`; the calendar sweep records `calendar_unreadable` without failing the run (`people-calendar-sweep.ts`); `gbrain google status` probes live (`--no-probe` reads the record); new doctor check `google_calendar_readable`; new error code `calendar_unreadable`; new `gbrain sources set-calendar` (`src/commands/sources-set-calendar.ts`; on a managed brain whose source also syncs Gmail or Contacts it needs `--yes`, exit 3 `confirmation_required` otherwise, because the cursor is keyed by the source's configuration).+- Contextual retrieval hint (#5012 item 6): `src/commands/config/contextual-mode-hint.ts`, printed by `config set search.contextual_retrieval` and `sources set-cr-mode`.+- Tests: `test/loops-noise-5012.test.ts`, `test/loops-noise-5012-store.test.ts` (+ `test/e2e/loops-noise-5012-postgres.test.ts`), `test/google-calendar-unreadable-5012.test.ts`, new cases in `test/google-loop-detect.test.ts` and `test/google-clients.test.ts`. Every case fails on master 3c16e9ba (31 failing tests) and passes on the branch.+- Docs: `docs/guides/open-loops.md`, `docs/guides/google-connect.md` (Unreadable calendar), `docs/guides/troubleshooting.md`, `docs/guides/multi-source-brains.md`, `skills/google-loops/SKILL.md`, key-files entries.++## BEHAVIOR_CHANGES rows (append; `since` = the wave's stamp)++```ts+ // Wave 18b lane 5 (#5012 item 8).+ { since: '<wave release>', text: 'Gmail mail sent with `Precedence: bulk`, `list` or `junk`, a `List-Id` header, or a no-reply `Reply-To` no longer opens a reply-owed loop in `gbrain waiting`. Loops opened before this release stay open: `gbrain waiting` counts those from such senders and prints `gbrain loops drop sender <email> --source <id> --dry-run` for each (preview, then run without `--dry-run`; a drop cannot be undone).' },+ { since: '<wave release>', text: '`gbrain loops mute sender|thread` (`loops_mute`) now also closes the muted sender\'s or thread\'s open reply-owed loops (status `dropped`, `closed_by: muted`) and returns their ids in `closed`; before, existing loops stayed open. `gbrain loops unmute` (`loops_unmute`) queues those loops for a re-check on the next Gmail sync, which reopens one only when nothing answered its thread since, and returns `requeued`. Both take `--dry-run` (`dry_run`) and return an `undo_command`. Commitment and decision loops and manually closed loops are not touched.' },+ // Wave 18b lane 5 (#5012 item 9).+ { since: '<wave release>', text: '`gbrain google status` now reads each linked Google source\'s calendar once (`--no-probe` skips it) and, when the account cannot read it (HTTP 403 or 404), names it with `code: calendar_unreadable` and the fix, and reports `ok: false` with exit code 1. The sync records the same result instead of looking like an empty calendar, and doctor warns `google_calendar_readable`.' },+```++The item 6 hint and the opt-in key change nothing by default and need no row.