Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
Merge remote-tracking branch 'origin/capy/6865-slug-autoheal' into capy/6803-wave
garrytan0024333e9aa9
diff --cc docs/architecture/key-files/managed-sync-bookkeeping.mdindex 087a44fce5,2a852243ed..17ef4bd0b1--- a/docs/architecture/key-files/managed-sync-bookkeeping.md+++ b/docs/architecture/key-files/managed-sync-bookkeeping.md@@@ -36,7 -36,8 +36,8 @@@ run, and the supersession of a checkpoi- `src/core/persistence/terminal-failures.ts` — #6650: the bounded readers over that classifier. `readTerminalFailureSummary` is one set-based aggregate (GROUPING SETS per source; `TERMINAL_STATEMENT_MS` 5 s statement and `TERMINAL_ACQUIRE_MS` 2 s connection deadlines; past either it returns `status: 'unknown'`, never an empty pile) splitting active blockers (recovery records plus the passed-in `checkpoint_blockers` of `sync-status.ts`, read by `readCheckpointBlockerMap`), unresolved rows (count, distinct slugs and intents, oldest age), historical rows (a later write superseded them, or older than `TERMINAL_FIXED_IN` via the SQL twin `TERMINAL_HISTORICAL_SQL`), 24 h and 7-day daily counts, categories and defect classes; archived sources are skipped. Thresholds `persistence.terminal_failures.window_days` (clamped to `persistence.receipt_retention_days`), `spike_factor`, `spike_min` (`readTerminalThresholds`, `validateTerminalConfigValue`, refused at `config set` by `commands/config/preparation-keys.ts`); `isSpike` against `sevenDayMedian`. `readTerminalFailures` is the drill-down (batches of 200, at most 2,000 rows scanned per call, a sequence cursor, verdict filters, `--group-by category` groups with an exact `drill_down` argv each). Consumers: doctor `persistence_terminal_failures` (`commands/doctor/checks/persistence-requests.ts`), `sync status` `terminal_failures` (`sync-status.ts`, `next` falls back to a recovery blocker's action), the `writer_failures` administration operation, and the admin `/metrics` gauges (`serve-http-metrics.ts` `renderTerminalFailureMetrics`, one aggregate per engine shared by scrapes for `TERMINAL_METRICS_TTL_MS` = 60 s via `cachedTerminalSummary`; never `/health`). Each source also reports `new_last_24h_older_builds` (rows and builds older than their class's fix), and doctor's spike message says an older write owner is producing them when they are most of the spike. Tests: `test/terminal-failures-6650.test.ts`, `test/sync-status-terminal-6650.test.ts`, `test/terminal-failure-metrics-6650.test.ts`, the CLI journey `test/agent-journey-terminal-failures-6650.test.ts`.- `src/commands/sources-writer-failures.ts` — #6650: output of `gbrain sources writer failures <source> [--state all] [--group-by category] [--since Nd] [--limit N] [--before <cursor>] [--category|--code|--origin] [--json]`, dispatched by `persistence-admin.ts` as `writer_failures` (validated in `administration.ts` `writerFailuresQuery`, locally or through the resident owner). A table by default, one JSON document with `--json`; row and group `fix` / `inspect` actions are rendered for the CLI; a full page prints `truncated` with the exact next command. The operation is advertised to clients in the owner's `administration_extensions` (`ipc.ts`, `admin-contract.ts` `PERSISTENCE_ADMIN_EXTENSIONS`), never in the `administration` list an older client validates strictly, and `local-client.ts` delegates it only to an owner that lists it (`ownerAdministers`). Tests: `test/writer-failures-cli-6650.test.ts`.- `src/core/persistence/public-category.ts` — #6712 PR 2 (L5): `publicCategory({ category?, code })`, the closed public vocabulary (`drift`, `conflict`, `content_refused`, `file_missing`, `permission`, `storage`, `config`, `superseded`, `transient`, `defect`) that sits beside the unchanged diagnosis `category`. `PUBLIC_BY_TERMINAL` maps every `TerminalCategory`, `PUBLIC_BY_CODE` every `SYNC_FAULT_TABLE` code (a new fault code needs a row: `test/public-category.test.ts`), and anything else goes by its registry class (unknown codes are `defect`). `classifyTerminal` carries it as `public_category`; `classifyRecordedFault` (terminal-classify.ts) reads a hold, a managed-sync failure row or a run stop as the failed receipt it stands for, so the receipt diagnosis, `managedWrite`, sync status holds and `last_error`, the terminal summary and doctor `sync_failures` (`details.failures`) render one verdict.-- `src/core/persistence/sync-tail.ts` + `sync-tail-record.ts` — #6712 PR 2 (L5): the tail of a committed checkpoint (projection statistics, then link extraction for the run's imported slugs read from its manifest). `recordSyncTail` runs inside the checkpoint's publication transaction (`applyManagedSyncCheckpoint`) and appends `{run_id, changed, extract}` to `op_checkpoints` `managed-sync-tail` / `<source>` (at most 16), so the tail is owed before anyone can read the run as synced. `withSyncTail` runs it after the outermost drain lease is released (`performManagedBranch`, and `performManagedSync` when it took the lease itself; a call still inside a lease, a dry run and a lease-held follower run none), bounded by `SYNC_TAIL_BUDGET_MS` (5 min) and the caller's deadline, and folds `tail` (`done` / `truncated` / `degraded` / `deferred` / `failed`) and `links` into the result. The obligation is cleared by compare-and-swap only when every step ran; a failed, deferred or truncated tail attaches a degraded `sync_tail_degraded` notice with its fix (the sync CLI prints it with the capacity notices). Fault point `sync:tail_started`. Tests: `test/sync-drain-finish-tail.test.ts`.+- `src/core/persistence/sync-tail.ts` + `sync-tail-record.ts` — #6712 PR 2 (L5): the tail of a committed checkpoint (projection statistics, then link extraction for the run's imported slugs read from its manifest). `recordSyncTail` runs inside the checkpoint's publication transaction (`applyManagedSyncCheckpoint`) and appends `{run_id, changed, extract}` to `op_checkpoints` `managed-sync-tail` / `<source>` (at most 16), so the tail is owed before anyone can read the run as synced. `withSyncTail` runs it after the outermost drain lease is released (`performManagedBranch`, and `performManagedSync` when it took the lease itself; a call still inside a lease, a dry run and a lease-held follower run none), bounded by `SYNC_TAIL_BUDGET_MS` (5 min) and the caller's deadline, and folds `tail` (`done` / `truncated` / `degraded` / `deferred` / `failed`, with `underived`: the run's imports its link extraction left underived, which the per-source "still owe extraction" line prints) and `links` into the result. The obligation is cleared by compare-and-swap only when every step ran; a failed, deferred or truncated tail attaches a degraded `sync_tail_degraded` notice with its fix (the sync CLI prints it with the capacity notices). Fault point `sync:tail_started`. Tests: `test/sync-drain-finish-tail.test.ts`.+ - `src/core/repair/slug-autoheal.ts` — the sync-time heal of stray `slug:` lines (#6865): `healAfterManagedSync`, called once from `commands/sync/perform.ts` `performManagedBranch` after the drain lease is released, runs `slug-conflicts`' `healAbsentSlugLine` (deterministic `absent_page` only, bound to the held bytes, nothing recorded for any other analysis) over the source's slug-conflict holds through the same `submitManagedFileRepair` write, with the receipt's `declared_alias` recorded as a `slug_aliases` row in that write. Skipped (and said why on `slug_lines_removed`) under `sync.slug_conflicts.auto_remove false`, `fences.repair.enabled false`, remote submission authority, an unfinished managed-sync cursor, or a host that may not write the checkout; bounded by `SLUG_HEAL_MAX_FILES` and `SLUG_HEAL_BUDGET_MS` (or the caller deadline), one checkout scan per source; never throws. Lane verdicts carry `lane_version` (`CONTENT_REPAIR_LANE_VERSION` in `persistence/sync-fault-class.ts`): an older verdict is `repair` in `contentHoldDisposition` and never a person's decision in `classifySyncFault`. Tests: `test/slug-autoheal-6865.test.ts` (Postgres arm `test/e2e/slug-autoheal-6865-postgres.test.ts`), `test/slug-conflict-verdict-6865.test.ts`.- `src/core/since.ts` — #6712 PR 2: `parseSince(input, flag, now)`, the one `--since` parser (`gbrain agent logs --since`, `gbrain repair file-drift --since`). An age (`90s`, `30m`, `12h`, `7d`) becomes one concrete UTC instant at parse time; an ISO-8601 date or timestamp is normalized; anything else throws `invalid_params` naming the flag. Callers print and hash the instant, never the age. Tests: `test/sync-exits-l4-6712.test.ts`, `test/agent-cli.test.ts`.- `src/core/persistence/sync-ghosts.ts` — #6712 PR 2: `countSyncGhosts(engine, sourceId)`, the post-sync ghost count. It reuses `scanGhostSource` from `repair/ghost-pages.ts` (no second classifier) with a candidate bound of `SYNC_GHOST_CHECK_LIMIT` (50) stats, leaves out paths sync holds (a held file is the hold's to explain), and returns the count, samples and the `gbrain repair ghost-pages --source <id>` preview as its fix. Sync never deletes or tombstones a ghost; `commands/sync/perform.ts` prints one line and sets `SyncResult.ghostPages`. Test: `test/sync-exits-l4-6712.test.ts`.- `src/core/persistence/soak-counters.ts` — #6712 PR 2: the soak counters doctor `sync_soak_counters` reports (one `op_checkpoints` row per UTC day under op `sync-soak-counters`). Interventions: `sync_non_plain` (`nonPlainSyncFlags`, from `sync/run.ts`), `repair_apply` (`repair.ts`), `unblock_apply` (`sync/operator.ts`), `retry_held` (`sources-retry-held.ts`) and `needs_human` (`sweepNeedsHumanHolds`, run after each managed sync: stamps `needs_human_at` on a hold the fault table now calls `needs_human` and counts it once; the stamp survives same-code re-holds). Content decisions: `file_drift_apply` and `file_drift_hold`. `readSoakCounters` sums the last seven days. Counting never fails the command that counts. Test: `test/sync-exits-l4-6712.test.ts`.diff --cc scripts/module-size-limits.tsvindex 4929d58dfa,dc6bfa30ae..bc4442197c--- a/scripts/module-size-limits.tsv+++ b/scripts/module-size-limits.tsv@@@ -43,7 -43,7 +43,7 @@@ src/core/oauth-provider.ts 1236 ratchesrc/core/ops/pages.ts 710 ratchet crossed the unlisted 1500 cap in the fix wave: pack-vocabulary enforcement on capture (#4721) + get_page alias follow (#4275) landed together; next growth should peel a pages-ops submodule; +3: alias hop reads the canonical in the owning source (ship-review); +5: explicit source_id liveness check in get_page/list_pages (#4620); +3: #4857 total-order slug sort + list_pages source_id parse; +5: #4620 explicit removed-source id fails loudly; master integration: +4: authenticated delegated private-write boundary and auto-link suppression; #5105: canonical page mutations peeled into persistence modules; +2 v0.50.5.0 purge parameter and shared preflight call; preparation composes through the persistence modules; +7: source-qualified deep-research fetch authorization and ambiguity refusal (codec lives in deep-research-id.ts); +1 #5567: remote get_page keeps materialized markers; +1 #5622: trusted local capture file parameter; +5 #5709: get_page include_timeline_entries (rows via get_timeline's read policy); +8 GBRA-36 security wave: required outputRedaction policy on each pages op; +1 #5154: list_pages passes listColumnsOnly; +17 #5641: list_pages exposes the updated_after_slug keyset cursor and updated_at_iso; +8 agent operator wave A2: every op declares mutating + idempotent (tags only); +7 F3b (#5954): list_pages pagination meta + listing_truncated notice for MCP callers (logic in ops/list-pages-pagination.ts); +4 #5988: get_page file_held (one indexed hold lookup; logic in persistence/held-reads.ts); +6 #6103: list_pages maps an unreadable updated_after (SQLSTATE 22007/22008) to invalid_params; wave 10 collector: #6103 (+6) and #4807 (+2) compose; +1 wave 11 W4.3 (#5969 D3): put_page drop_timeline param; +1 wave 11 security review: purge_deleted_pages yes param + trusted-CLI guard (consent logic in persistence/purge-deleted.ts); +1 Q2 parser gaps: get_page grammar_diagnostics param (report logic in core/line-grammar-report.ts); master v0.60.136.0 merge into #5575 memory trust (both sides kept); +21 large pages (Wave A): get_page body-mode dispatch, fetch window branch, put_page large-page admission and allow_shrink param, description text (logic in ops/get-page-body.ts and persistence/large-page-guard.ts); +1 D8 funnel: committed put_page records a save when the opt-in funnel is on; +1 #6609: restore_page detach param (logic in persistence/detached-pages.ts); +1 Wave B gem A: post-batch auto-link reads a segmented page materialized (helpers in persistence/segmented-apply.ts); merge v0.60.249.0: composes at 707; +3 W2 page-at-time: get_page known_as_of param and dispatch (logic in ops/known-as-of.ts and belief/page-at-time.ts)src/core/search/mode.ts 1669 ratchet +53 W3 confidence-gated reranking: reranker_gate / reranker_gate_min_gap bundle fields, overrides, config parse and KNOB_CONFIG_KEY rows, knobsHash v=31 rrg=/rrgg=/ecf= parts (parse contracts in crag.ts); +10 System One v1: decide.* snapshot subset in loadSearchModeConfig, append-only dec= knobsHash part; +5 #3617 follow-up: v27 same-knobs behavioral-change note (relaxed-row fusion demotion rides the bump); new row: crossed the 1500 unlisted cap in the 2026-08 eval fix wave — KNOBS_HASH v=27 adaptive-return fold (ar/arem/arom/armk/ari parts + KnobsHashContext.adaptiveReturn field + contamination rationale comments) | merged v0.48.1.0 (+#4787) true-up; +master v0.48 merge true-up (reranker succession: no_key preflight, reranker_skipped stage, readiness); ranker wave v0.48.4.0: four knobs (expansion_variant_budget, relational_rerank_pin, keyword_arm_confidence_floor, metadata_boost_gate) + v29 hash parts + doc receipts (+218); #4781 loadSearchModeConfig reads the config table once via loadConfigSnapshot (+6); +4 #4359: update loadSearchModeConfig docstring — the cached path now reads config once (threaded snapshot), not twice; retired provider integration removed; +12 fw3-search: search.source_boosts + search.alias_token_hop read in the mode snapshot; +10 #5691: KnobsHashContext.queryPrefix and its append-only qp= part; P7 relational_planner / relational_orient_onehop knobs (interface docs, bundles, overrides, config parse, hash parts); +18 P7 relational_chain_slots knob (interface doc, bundles, override, config parse, rcs= hash part); +22 GBRA-60 S1 diverse_pool_depth knob (interface doc, bundles, overrides, pick, config parse, append-only dpd= hash part)src/commands/eval-longmemeval.ts 1544 ratchet new row: crossed the 1500 unlisted cap in fw3-search (#5092 benchmark-brain recycling: configureBrain split + recycler wiring + test seams; the recycler itself lives in src/eval/longmemeval/harness.ts); +1 P6: tokenmax synopsis-tier wiring (logic in eval/longmemeval/synopsis-tier.ts); +13 GBRA-81 lane A: --via-operation query|search (flags, per-call expansion pin, the run's expectExpansion, the op branch in runOneQuestion, row field, via_operation_summary and its FAIL line; logic in eval/longmemeval/via-operation.ts); +12 --call-plan FILE / --call-plan-gate CMD: two LME_FLAGS entries (CLI help lines), two ParsedArgs fields, the parseArgs pairing check and the header invariant (planner lives in eval/longmemeval/call-plan.ts; runEvalLongMemEval is one line shorter)-src/commands/doctor/checks/extraction-sync.ts 1543 ratchet +1 undeclared_db_only_pages computes the source Git scope once per source (logic in core/markdown.ts sourceGitScope); new row: crossed the 1500 unlisted cap at the fix wave 9 merge: +7 lane W #5028 (extract_atoms freshness judged by the phase itself) and +3 lane F #5863 (extract_health dates a high halt rate by its last halt), each under the cap alone; +7 #5019: content_hash_duplicates fix pins the pairs' source (GBRAIN_SOURCE) and names a delete that runs; +1 fix wave 10 lane L1 #5556: links_extraction_lag denominator excludes quarantined pages (quarantineFilterFragment import); +11 fix wave 15 P2.8 (#5495): extract_health reads the 7-day halt reasons per kind (halt_reasons, top_halt_reason in details and the top reason in the warn line); the read, the unknown bucket and the ranking live in core/extract/rollup-writer.ts; +20 wave 18b lane 1: links_extraction_lag names the columns its pre-migration degrade reads (#6599 strict predicate), sync_freshness separates sync outcome from freshness for a source with no successful sync (#4960; verdict text, fixes and the attempt read live in doctor/sync-outcome.ts and core/sync-attempt.ts) and exempts read-only skill-pack catalogs (#6076; core/shared-skills/adopted-packs.ts)+src/commands/doctor/checks/extraction-sync.ts 1492 ratchet +1 undeclared_db_only_pages computes the source Git scope once per source (logic in core/markdown.ts sourceGitScope); new row: crossed the 1500 unlisted cap at the fix wave 9 merge: +7 lane W #5028 (extract_atoms freshness judged by the phase itself) and +3 lane F #5863 (extract_health dates a high halt rate by its last halt), each under the cap alone; +7 #5019: content_hash_duplicates fix pins the pairs' source (GBRAIN_SOURCE) and names a delete that runs; +1 fix wave 10 lane L1 #5556: links_extraction_lag denominator excludes quarantined pages (quarantineFilterFragment import); +11 fix wave 15 P2.8 (#5495): extract_health reads the 7-day halt reasons per kind (halt_reasons, top_halt_reason in details and the top reason in the warn line); the read, the unknown bucket and the ranking live in core/extract/rollup-writer.ts; +20 wave 18b lane 1: links_extraction_lag names the columns its pre-migration degrade reads (#6599 strict predicate), sync_freshness separates sync outcome from freshness for a source with no successful sync (#4960; verdict text, fixes and the attempt read live in doctor/sync-outcome.ts and core/sync-attempt.ts) and exempts read-only skill-pack catalogs (#6076; core/shared-skills/adopted-packs.ts); -51 #6803 (D1): links_extraction_lag reads its counts and verdict from core/extraction-lag.ts (shared with the sync nudge)src/core/search/evidence-delivery.ts 1673 ratchet +5 W5: EvidencePlan.rankCut resolved with the plan (logic in search/page-rank-cut.ts); +20 W5 whole_pages: wholeCost prices a block as delivery would emit it whole (needs the private Block/enrichBlock internals) and the cut is wired before allocate (cutWholePages lives in search/page-rank-cut.ts); new row: crossed the 1500 unlisted cap at the #6367 merge (master 1479, its explicit-budget cap) by the C1 date header threaded through every block path, cap included; pagePlanHits (search/page-plan-hits.ts) and the header loader (evidence-date.ts blockDateHeaders) were peeled first; peel candidate: allocateCapped; +8 at the #6396 merge: page evidence text cut through the fence-chunk trust overlay and the caller minTrust floor (re-summed: our 1504 + master +8); +119 Cat 40 next wave F2: the search.long_page_unit policy (withLongPagePolicy, selectLongPages size preflight with page/byte/deadline limits) and the long-page fetch and fallback in deliverEvidence, kept in the shared seam the plan names (gbrain-evals docs/plans/2026-10-11-cat40-next-wave, F2); +17 F2 rework to the frozen-comparison policy: search.long_page_min_chars (rendered-body characters, default 20,000) read in withLongPagePolicy, a character count in the preflight, the rendered-body confirmation in deliverEvidence, and the long-page row exemption in capDeliveredSnippets (re-summed at the 0.60.225.0 merge: master 1537 + F2 136)- src/commands/config.ts 1510 ratchet new row: crossed the 1500 unlisted cap in wave 15 P7.4 #5461: set-time validation of think.pages_budget_chars / think.excerpt_ceiling_chars (range + parser live in core/think/pages-budget.ts), mirroring the cycle.consolidate.cluster_threshold hook; +1 wave 16 G5.1 (#6495): set-time refusal hook for search.keyword_statement_timeout_ms (check lives in commands/config/keyword-timeout-value.ts); +1 wave 18b lane 5 (#5012 item 6): search.contextual_retrieval prints the existing-pages hint after the write (text lives in commands/config/contextual-mode-hint.ts); +1 #6712 PR 2: retired/rollback sync key dispatch line (logic in core/sync-config-keys.ts handleSyncKeyConfig)+ src/commands/config.ts 1511 ratchet new row: crossed the 1500 unlisted cap in wave 15 P7.4 #5461: set-time validation of think.pages_budget_chars / think.excerpt_ceiling_chars (range + parser live in core/think/pages-budget.ts), mirroring the cycle.consolidate.cluster_threshold hook; +1 wave 16 G5.1 (#6495): set-time refusal hook for search.keyword_statement_timeout_ms (check lives in commands/config/keyword-timeout-value.ts); +1 wave 18b lane 5 (#5012 item 6): search.contextual_retrieval prints the existing-pages hint after the write (text lives in commands/config/contextual-mode-hint.ts); +1 #6712 PR 2: retired/rollback sync key dispatch line (logic in core/sync-config-keys.ts handleSyncKeyConfig); +1 #6865: sync.slug_conflicts.auto_remove boolean validation at set time (refusal text in repair/slug-autoheal.ts)src/commands/mcp-expose.ts 1512 ratchet hosted_option: Session carries the gbrain.io coaching notice on the first-receipt run and Tailscale/service friction exits (copy, refs and gating live in core/onboard/hosted-option.ts)diff --cc src/core/behavior-change-notice.tsindex f3bc932f1b,a29d636786..caeb961f14--- a/src/core/behavior-change-notice.ts+++ b/src/core/behavior-change-notice.ts@@@ -752,16 -752,8 +752,18 @@@ export const BEHAVIOR_CHANGES: Readonly{ since: '0.60.276.0', text: 'On a writer-claimed brain, background writes are refused before any receipt, so they spend no write-request id, when their source cannot publish: the worktree is in recovery, or the claim\'s owner verification fails on the owner host (a missing canonical or coordination path, or a physical root whose owner marker .gbrain-owner.json or reservation is gone or changed; a device-only change is still re-stamped by the write). The refusal is owner_unavailable with the fix `gbrain sources writer status --source <id> --json`, checked once per source per run. Background writes are every write not made from an interactive surface: the autopilot cycle and its maintenance phases (extraction, synthesis, patterns, consolidation, fence and content repair, lint fixes), Minion jobs (sync, extract and the other job handlers), connector syncs, delegated serve syncs started as background, the keep-DB reconcile, autopilot and job managed syncs, and the transcript stale-part delete. Interactive CLI, MCP and repair writes are unaffected; a paused (draining) owner still accepts and replays.' },{ since: '0.60.276.0', text: 'The managed purge (autopilot purge phase, the purge job and `gbrain pages purge-deleted`) submits nothing for a source whose writer needs recovery (reported `writer_not_active` with its state and reason) and parks a page after five failed purges (doctor `purge_parked_pages`: actor agent on the CLI, host_admin remotely). The cycle purge phase reports warn, not fail, for either. `gbrain pages purge-deleted --retry-parked` retries parked pages once; it obeys `--older-than` (a parked page younger than the cutoff is not retried) and the rename-recovery hold, and its preview, its consent text (which names the parked count) and its run come from one selector.' },{ since: '0.60.276.0', text: '`gbrain repair content` / `repair slug-conflicts` now clears a frontmatter_slug_conflict hold deterministically (remove_slug) when the only other change autoFixFrontmatter would make is a style-only NESTED_QUOTES re-quote of a valid JSON-style tag or alias array. Only the slug: line is removed; the array is left as written and listed as style_only in the preview, the run result and the content_repair receipt. Such holds used to stay still_invalid and needed `repair frontmatter --include-ambiguous`. When the lane still cannot clear a hold because the frontmatter needs other fixes, the still_invalid message now names those fix codes (for example NULL_BYTES).' },+ // #6865 (GBRA-122): `since` is a placeholder equal to the branch's VERSION, restamped when the merge slot is called.+ { since: '0.60.277.0', text: 'A managed `gbrain sync` now removes a stray frontmatter `slug:` line by itself when the slug it names has no page and no file (#6865, the content-repair lane\'s deterministic `absent_page` rule): right after the sync releases its drain lease, each such held file is rewritten without that one line, imported under the slug its path gives, its `frontmatter_slug_conflict` hold cleared and the edit committed as `gbrain: repair frontmatter slug in <path>` with the `gbrain-repair:` trailer, through the same coordinated repair write the maintenance run already used; the declared slug becomes an alias of the page so links written against it keep resolving. At most 200 files and 60 s per sync; the result\'s `slug_lines_removed` counts them and the rest. A line naming an existing page (with a file or database-only, checked again inside the write), a hold the lane already judged, a file edited since sync held it, a source with an unfinished sync, and a sync submitted by a remote job or agent are left held. Preview what the lane would do with `gbrain repair content --source <id> --no-llm`; opt out with `gbrain config set sync.slug_conflicts.auto_remove false` (or pause the whole lane with `fences.repair.enabled false`); undo one edit with `git revert` of its commit and a sync, which holds the file again (the alias stays, so the restored line then names the file\'s own page and needs a hand edit). Nothing runs at upgrade. Slug-conflict hold status now follows what the lane found: "decide which page keeps the slug" appears only when the line names a live page, a hold with no verdict yet never escalates to a person, and a verdict an older gbrain recorded is rechecked once by the next sync or maintenance run instead of being listed for a person.' },+ // #6803 wave (projection queue, held embedding budgets, bounded doctor/status reads, extraction nudge). `since` is the branch VERSION until the merge-slot stamp.- { since: '0.60.276.0', text: '`gbrain sync --status` now prints the `gbrain sync status` envelope (with a one-line hint) instead of running a full sync of the source, which nothing used to stop because no sync path read the flag. `gbrain sync --preview` and `--check`, which sync never read either, now refuse with `invalid_params` and a `--dry-run` fix; `--dry-run` is unchanged.' },- { since: '0.60.276.0', text: 'A plain non-interactive CLI `gbrain doctor --json` (stderr not a terminal, no `--budget-ms`, `--tier`, `--fix` or remediation flag) now caps its check run at `doctor.default_budget_ms` (90000 ms; file plane; connect and migrations are not counted) and prints one stderr line saying so; checks past it report health unknown, and the JSON gains `tier`, `complete`, `unknown_sections`, `elapsed_ms` and `budget_ms`. `--budget-ms 0` turns it off for one run and `gbrain config set doctor.default_budget_ms 0` for good. `gbrain config set` now accepts `doctor.entry_budget_ms` and `doctor.orphan_ratio.full_scan_max_pages`.' },- { since: '0.60.276.0', text: 'Doctor entries now stop their database statements at their own budget on every tier (Postgres cancels the statement; PGLite refuses the next one), so a slow check no longer keeps a backend running after the report. The cheap incident checks (`persistence_capacity`, `managed_sync_not_moving`, `managed_sync_blocked`, `text_projection_readiness`, `partial_embedding` and `links_extraction_lag`, now its own entry) run right after the ops sections, the frontmatter and fence scans report partial results at the deadline, `--only <check> --budget-ms N` gives that check the whole N, and a check past its budget names which budget (`details.limit`) and prints that rerun.' },- { since: '0.60.276.0', text: '`gbrain sync status` and write and sync receipts wait at most 1.5 s for the shared capacity snapshot and read capacity as unknown for that call when it is late, without clearing or re-announcing a background pause; a snapshot fetch that timed out is no longer cached for a minute. Doctor now computes the capacity forecast once per run instead of twice.' },- { since: '0.60.276.0', text: '`gbrain projections drain` now seals image pages the importer already attested safe (one image chunk written at or after the safe-chunk fence, unchanged since) in place, keyless, with no chunk write or provider call, so image search ranks them again; every other image page stays queued and out of search until its importer re-imports it (`gbrain embed --stale --images --dry-run`, then the paid run). Its `--json` gains `limited`, `sealed`, `sealed_with_visual`, `sealed_text_only`, `statistics_refreshed` and `remaining_by_class`, and under a resident PGLite owner it prints an exclusive stop, drain and start step instead of only refusing. The resident drains text only and probes at most 500 queued rows per tick.' },- { since: '0.60.276.0', text: 'Doctor `text_projection_readiness` counts the queue by class (`pending`, `sealable`, `reimport`, `protected`, `archived`, `failed`, `as_of`): it warns on pending, sealable, reimport and failed rows, with `gbrain projections drain --limit <n>` (asks first) or the paid importer as the fix, and reports protected-OCR and archived-source images as by design (search reports the `projection_by_design` stage for them instead of `projection_pending`). On a PGLite resident it can move from ok to warn; on Postgres it can move from warn to ok. Embed paths no longer queue `embedding_recovery` rows for image pages, `gbrain embed --stale --images` skips sealable pages and reports `ocr_required`, and a read-only notice after upgrading names `gbrain projections drain --dry-run` when image rows are queued.' },- { since: '0.60.276.0', text: '`gbrain embed --stale` and the embed-backfill job report `budget_limited` (pages held for approval or at their per-page cap, by source) and print one line instead of saying nothing; it is never a failure. Doctor `partial_embedding` is its own entry (`--only oversized_pages` no longer emits it) and its fix is a per-source approve, `gbrain embed --held --source <id> --max-usd <N>` with a concrete N, with every other source in `details.by_source`. `gbrain embed --held --dry-run` lists every source and exits 0 on a multi-source brain; `--held --max-usd` without `--source` there refuses with `invalid_params`. Receipts name `gbrain embed --held --dry-run --source <id>` instead of `gbrain reindex --held`, which does not exist.' },- { since: '0.60.276.0', text: 'An explicit `--max-usd N` on `gbrain embed --slugs` or `--held` now releases a held page on a free embedding provider too (#6847); it used to reprint the hold. Free-recipe models cost $0 in the per-page ledger, printed approve commands carry a concrete N (a paid N includes the 1.5x headroom and $0.25 floor), a free provider\'s approve asks for no paid or egress consent, and an approval when embeddings cannot run or the paid model has no price is refused before the hold is released. `--yes` still never releases a hold.' },- { since: '0.60.276.0', text: '`gbrain extract --stale --source <id>` now refuses with `invalid_params` naming `--source-id <id>` instead of running brain-wide; `--source fs` exits 2 `invalid_params` (it exited 1), and `--source db` refuses as ambiguous when a source is named `db`. Rendered extract fixes pin `--source-id`. The end-of-sync extraction nudge stays silent when doctor `links_extraction_lag` would not warn (attendance-blocked meetings no longer count), names both `gbrain extract --stale` and `gbrain extract --stale --catch-up` with estimates, and becomes a run-it-yourself step above two minutes; `extract --stale` JSON gains `actionable`, `attendance_blocked`, `mention_due` and `complete`; the per-source "still owe extraction" line counts only pages that sync imported; and an owner-delegated plain `extract --stale` keeps the 30-minute budget (`--catch-up` is carried through).' },++ { since: '0.60.278.0', text: '`gbrain sync --status` now prints the `gbrain sync status` envelope (with a one-line hint) instead of running a full sync of the source, which nothing used to stop because no sync path read the flag. `gbrain sync --preview` and `--check`, which sync never read either, now refuse with `invalid_params` and a `--dry-run` fix; `--dry-run` is unchanged.' },++ { since: '0.60.278.0', text: 'A plain non-interactive CLI `gbrain doctor --json` (stderr not a terminal, no `--budget-ms`, `--tier`, `--fix` or remediation flag) now caps its check run at `doctor.default_budget_ms` (90000 ms; file plane; connect and migrations are not counted) and prints one stderr line saying so; checks past it report health unknown, and the JSON gains `tier`, `complete`, `unknown_sections`, `elapsed_ms` and `budget_ms`. `--budget-ms 0` turns it off for one run and `gbrain config set doctor.default_budget_ms 0` for good. `gbrain config set` now accepts `doctor.entry_budget_ms` and `doctor.orphan_ratio.full_scan_max_pages`.' },++ { since: '0.60.278.0', text: 'Doctor entries now stop their database statements at their own budget on every tier (Postgres cancels the statement; PGLite refuses the next one), so a slow check no longer keeps a backend running after the report. The cheap incident checks (`persistence_capacity`, `managed_sync_not_moving`, `managed_sync_blocked`, `text_projection_readiness`, `partial_embedding` and `links_extraction_lag`, now its own entry) run right after the ops sections, the frontmatter and fence scans report partial results at the deadline, `--only <check> --budget-ms N` gives that check the whole N, and a check past its budget names which budget (`details.limit`) and prints that rerun.' },++ { since: '0.60.278.0', text: '`gbrain sync status` and write and sync receipts wait at most 1.5 s for the shared capacity snapshot and read capacity as unknown for that call when it is late, without clearing or re-announcing a background pause; a snapshot fetch that timed out is no longer cached for a minute. Doctor now computes the capacity forecast once per run instead of twice.' },++ { since: '0.60.278.0', text: '`gbrain projections drain` now seals image pages the importer already attested safe (one image chunk written at or after the safe-chunk fence, unchanged since) in place, keyless, with no chunk write or provider call, so image search ranks them again; every other image page stays queued and out of search until its importer re-imports it (`gbrain embed --stale --images --dry-run`, then the paid run). Its `--json` gains `limited`, `sealed`, `sealed_with_visual`, `sealed_text_only`, `statistics_refreshed` and `remaining_by_class`, and under a resident PGLite owner it prints an exclusive stop, drain and start step instead of only refusing. The resident drains text only and probes at most 500 queued rows per tick.' },++ { since: '0.60.278.0', text: 'Doctor `text_projection_readiness` counts the queue by class (`pending`, `sealable`, `reimport`, `protected`, `archived`, `failed`, `as_of`): it warns on pending, sealable, reimport and failed rows, with `gbrain projections drain --limit <n>` (asks first) or the paid importer as the fix, and reports protected-OCR and archived-source images as by design (search reports the `projection_by_design` stage for them instead of `projection_pending`). On a PGLite resident it can move from ok to warn; on Postgres it can move from warn to ok. Embed paths no longer queue `embedding_recovery` rows for image pages, `gbrain embed --stale --images` skips sealable pages and reports `ocr_required`, and a read-only notice after upgrading names `gbrain projections drain --dry-run` when image rows are queued.' },++ { since: '0.60.278.0', text: '`gbrain embed --stale` and the embed-backfill job report `budget_limited` (pages held for approval or at their per-page cap, by source) and print one line instead of saying nothing; it is never a failure. Doctor `partial_embedding` is its own entry (`--only oversized_pages` no longer emits it) and its fix is a per-source approve, `gbrain embed --held --source <id> --max-usd <N>` with a concrete N, with every other source in `details.by_source`. `gbrain embed --held --dry-run` lists every source and exits 0 on a multi-source brain; `--held --max-usd` without `--source` there refuses with `invalid_params`. Receipts name `gbrain embed --held --dry-run --source <id>` instead of `gbrain reindex --held`, which does not exist.' },++ { since: '0.60.278.0', text: 'An explicit `--max-usd N` on `gbrain embed --slugs` or `--held` now releases a held page on a free embedding provider too (#6847); it used to reprint the hold. Free-recipe models cost $0 in the per-page ledger, printed approve commands carry a concrete N (a paid N includes the 1.5x headroom and $0.25 floor), a free provider\'s approve asks for no paid or egress consent, and an approval when embeddings cannot run or the paid model has no price is refused before the hold is released. `--yes` still never releases a hold.' },++ { since: '0.60.278.0', text: '`gbrain extract --stale --source <id>` now refuses with `invalid_params` naming `--source-id <id>` instead of running brain-wide; `--source fs` exits 2 `invalid_params` (it exited 1), and `--source db` refuses as ambiguous when a source is named `db`. Rendered extract fixes pin `--source-id`. The end-of-sync extraction nudge stays silent when doctor `links_extraction_lag` would not warn (attendance-blocked meetings no longer count), names both `gbrain extract --stale` and `gbrain extract --stale --catch-up` with estimates, and becomes a run-it-yourself step above two minutes; `extract --stale` JSON gains `actionable`, `attendance_blocked`, `mention_due` and `complete`; the per-source "still owe extraction" line counts only pages that sync imported; and an owner-delegated plain `extract --stale` keeps the 30-minute budget (`--catch-up` is carried through).' },];/** The newest disclosed change's release: the notice id moves only when a release adds rows. */