Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

fix(search): remove search-side hub dampening after its held-out FAIL (p2-e1-hub-dampening-heldout); keep master's hubWeight helper for relational-chain.ts

garrytand89dae1930d6
diff --git a/docs/architecture/key-files/commands-2.md b/docs/architecture/key-files/commands-2.md
index 12359c39dc..6288707749 100644
--- a/docs/architecture/key-files/commands-2.md
+++ b/docs/architecture/key-files/commands-2.md
@@ -7,7 +7,7 @@ Doctor's embedding-dimension warning treats existing chunks as existing data eve
- `src/commands/doctor/checks/chat-fallback.ts` — `chat_fallback_chain` (OPS, registered after `embedding_env_override` so `--only` connects the brain, and in `doctorReportRemote`): the effective chain, its plane, shadowed values, providers and refusal behavior from `src/core/ai/chat-fallback-planes.ts`. An active, healthy chain is `ok` with the optional per-plane removal fix (never `next: run`); an unreadable plane value or a malformed / unknown-provider / no-chat entry warns with the removal fix, a missing credential with a `credentials` fix, an unpriced model under a user cap with `noPricingFix`. Remote (`remote !== false`): only that a chain is configured and its problem count, `host_admin` fix. Pinned by `test/doctor-chat-fallback-chain.test.ts`.
- `src/commands/doctor/checks/behavior-changes.ts` — `behavior_changes` (META, after `chat_fallback_chain`): the `behavior_changes` disclosure read again (`src/core/behavior-change-notice.ts`): every change newer than the brain's baseline, labeled by release, whether or not the notice was shown; always `ok`; reads the baseline and markers without recording either, and reports which channels were shown.
-- `src/commands/doctor/checks/ranking-extraction.ts` — two informational BRAIN checks registered after `timeline_history`: `hub_degree_shape` (inbound-link degree p50/p90/p99/max and, when `search.hub_dampening` is a half degree, how many pages keep less than half of their graph lift; never recommends a value) and `extraction_date_grounding` (fact extraction, synthesis, atoms and takes grounded by default, all off when the setting is false, and whether the chronicle prompt is opted in). Pinned by `test/doctor-ranking-extraction.test.ts` and the doctor registry/JSON goldens.
+- `src/commands/doctor/checks/ranking-extraction.ts` — informational BRAIN check `extraction_date_grounding`, registered after `timeline_history`: fact extraction, synthesis, atoms and takes grounded by default, all off when the setting is false, and whether the chronicle prompt is opted in. Pinned by `test/doctor-ranking-extraction.test.ts` and the doctor registry/JSON goldens.
- `src/commands/doctor/checks/vector-plan.ts` — `vector_plan` (#5824, OPS, wave check with operator resolution). Postgres only: EXPLAINs (no ANALYZE) the statement `searchVector` emits for the active embedding column with a zero vector through `PostgresEngine.explainVectorSearch` (same builder, scoped read transaction and scan settings) and warns when an HNSW-indexed column's plan does not use its HNSW index, naming the observed scans, whether the index exists and is valid (`pg_index.indisvalid`, with the create/reindex command), the 8 s candidate-budget risk and the legacy guard as rollback. Skipped on PGLite, on columns wider than the HNSW cap, and below 10,000 embedded chunks (`pg_class.reltuples` x `pg_stats.null_frac`, a bounded count when never analyzed). A configured legacy guard warns "active after restarting the owning service". Details carry a sampled stale-text fraction and point to `gbrain embed --stale` above 5%. Tested in `test/e2e/vector-plan-real-column-postgres.test.ts` (empty, small, ok, unused valid index, INVALID index, guard via env and config).
- `src/commands/doctor/checks/persistence-requests.ts` — two wave checks (OPS, registered in `wave-checks.ts`). `persistence_request_indexes` (#5762) reports each managed sync request index missing, INVALID or still building (with progress) and names `gbrain repair request-indexes --apply`. `persistence_request_growth` reports the request-table row count (a `reltuples` estimate on Postgres), each scope's admission rate over the last 7 days (the newest 10,000 admissions per scope, one bounded index read), lifetime IDs against `persistence.limits.*` and the projected exhaustion date within ten years; it warns under 90 days with the `oneYearCapacity` `gbrain config set` value and the doctor re-check. Tests: `test/persistence-request-indexes.test.ts`, `test/e2e/persistence-request-indexes-postgres.test.ts`.
- `src/commands/doctor/checks/{persistence-capacity,parked-effects}.ts` — `persistence_capacity` (OPS) warns when a principal or the brain reaches 80% of permanent request IDs or receipt bytes (via `capacityDiagnostics`) and prints one `gbrain config set <key> <value>` per brain-wide key, using the largest value any scope needs for about one more year; transient caps never warn. `parked_effects` (BRAIN) reads the partial parked-effect index, counts exactly, samples 20, and names each parked page with its `retry-effects ... --dry-run` command. Both report `exact`/`inspected`/`truncated` details; an unreadable state is warn, never clean. Tests: `test/persistence-capacity.test.ts`, `test/persistence-effect-parking.test.ts`.
diff --git a/docs/architecture/key-files/core-search-2.md b/docs/architecture/key-files/core-search-2.md
index 28b0b38908..cc92c573f2 100644
--- a/docs/architecture/key-files/core-search-2.md
+++ b/docs/architecture/key-files/core-search-2.md
@@ -3,12 +3,11 @@
[Subsystem index](../KEY_FILES.md). Read only the entries relevant to your change.
Current behavior and load-bearing invariants; history belongs in Git and CHANGELOG.
-- `src/core/search/explain-target.ts` — `explain_target` diagnosis. A `TargetTrace` (HybridSearchOpts.explainTarget) records the target page's presence and 1-based rank at each pipeline stage: every arm instance (`arm:<label>`, plus `arm:keyword_raw`/`arm:title_raw` before relaxed-row demotion), `fused`, `deduped`, `reranked`, `return_pool`, `limit_slice`, `token_budget`. `diagnoseTrace` returns one state (`retrieved` / `dropped` / `reinjected` / `not_retrieved` / `not_recorded`) naming the first stage that lost the page; boost stages are never reported as drops (they only re-order). `probeTarget` + `diagnoseProbe` run one read under the caller's read policy and separate not-indexed / stale projection / unsealed safe chunks / ambiguous slug; an unreadable page and an absent page return the same `target_not_found_or_not_visible`. Every diagnosis carries an Action-contract fix the `search`/`query` ops emit as a notice. Pinned by `test/search/explain.test.ts`.
-- `src/core/search/hub-dampening.ts` — degree-aware weight for graph-derived lifts: `hubWeight(n, H) = 1/(1+((n-1)/H)^2)` (H = the half degree; `off` → 1), `dampenBoost` (scales a factor's excess over 1.0; never touches demotions), `normalizeHubDampening` (the ONE parse contract for `search.hub_dampening` and the per-call seam). Callers pass the caller-visible degree; the multi-hop chain executor (`relational-chain.ts`) uses `hubWeight` for typed-link hops. `runPostFusionStages` fetches one caller-scoped degree map (`readBacklinkCounts`) shared by the backlink stage and graph signals; a failed read fails open with `meta.hub_dampening.errored`. Default `off` in every bundle until a held-out verdict; knobs-hash part `hd=` only when a half degree is set. Pinned by `test/search/hub-dampening.test.ts`.
- `src/core/search/evidence-delivery.ts` — the `return_unit` evidence assembler (default `auto`: conversation pages by type or `chat/`/`conversations/` slug come back whole under `search.return_budget_conversation` (24,000), every other hit is its unchanged chunk; `effectivePlan` skips the stage when an implied `auto` sees no conversation hit, so that path and `chunk` stay byte-identical). `resolveEvidencePlan` validates `return_unit` / `return_window` (invalid_params naming the allowed values and an example), reads `search.return_unit` / `think.return_unit`, `search.return_window`, `search.return_budget_default` (6,000), `search.return_budget_conversation` (24,000) and clamps remote budgets to `search.return_budget_max_remote` (32,000, reported). Snippet precedence: explicit `snippet_chars` > explicit `return_unit` > subagent default cap > config unit. `deliverEvidence` groups hits by page_id (one block per page at its best rank), makes ONE `engine.getChunkWindows` call (re-authorizes every page; unauthorized pages are dropped, never served from hit text), builds the page text from the stored body sanitized whole and passed through `credentialSafeProjection` before slicing (`pageEvidenceText`: compiled truth + serializer timeline sentinel + timeline; frontmatter excluded; private-key spans become newline-padded `<REDACTED:private_key_pem>` tokens, the same text the chunkers cut from), locates the hit chunks in it (`locateChunks`: exact, then whitespace-insensitive, since the chunker trims and folds whitespace), cuts `window` / `section` (ATX headings outside code fences, or conversation rounds detected structurally, never by page type) / `page` / `auto` (fenced-code hits are placed by their code minus the chunker's synthesized header), counts tokens as the sum of per-line cl100k counts, reserves each page's matching span before enriching by rank, caps blocks at 60,000 characters, redacts secrets before final accounting, and returns NEW rows with `delivered` plus a `delivery` meta. Fetch failure/timeout (5 s) falls back to the hit chunk only for live hits. `assembleEvidenceForHits` / op `assemble_evidence` deliver the exact evidence `query` returns for a frozen `(source_id, slug, chunk_id)` list; `evidenceFingerprint` hashes it (gbrain-evals E1/E3 parity). Normative spec: `docs/evidence-delivery.md`. Tests: `test/evidence-delivery.test.ts`, `test/evidence-delivery-golden.test.ts`, `test/e2e/evidence-delivery-leak.test.ts`, `test/e2e/evidence-delivery-parity.test.ts`; bench `scripts/bench-evidence-delivery.ts`.
- `src/core/search/chunk-windows.ts` — request/response shapes and the row mapper for `BrainEngine.getChunkWindows`. The SQL lives once in `src/core/engine-sql/chunks.ts` (`getChunkWindows`): page rows (authorization + seal + max chunk index + raw body columns) and chunk rows (inside the requested chunk_index ranges, text modality, requested chunk sources, row cap) come back in one UNION so the row cap never hides a page's authorization; the predicate is the search legs' (source scope, deleted, current text projection, archived source, quarantine, private pages, safe chunks). Postgres runs it inside the scoped read transaction.
+- `src/core/search/explain-target.ts` — `explain_target` diagnosis. A `TargetTrace` (HybridSearchOpts.explainTarget) records the target page's presence and 1-based rank at each pipeline stage: every arm instance (`arm:<label>`, plus `arm:keyword_raw`/`arm:title_raw` before relaxed-row demotion), `fused`, `deduped`, `reranked`, `return_pool`, `limit_slice`, `token_budget`. `diagnoseTrace` returns one state (`retrieved` / `dropped` / `reinjected` / `not_retrieved` / `not_recorded`) naming the first stage that lost the page; boost stages are never reported as drops (they only re-order). `probeTarget` + `diagnoseProbe` run one read under the caller's read policy and separate not-indexed / stale projection / unsealed safe chunks / ambiguous slug; an unreadable page and an absent page return the same `target_not_found_or_not_visible`. Every diagnosis carries an Action-contract fix the `search`/`query` ops emit as a notice. Pinned by `test/search/explain.test.ts`.
- `src/core/search/output-redaction.ts` — copies retrieval results and metadata before output sanitation, sharing the canonical `secret-scan.ts` plan and echo dictionary. Keyword, hybrid, image, exact and CRAG paths sanitize after internal grading/capture and before snippet truncation; CLI search/query JSON, explain and human rendering repeat the defense-in-depth pass. Every field is planned with `highEntropy: true`, so `KEY=value` assignments redact alongside the named shapes. Identity fields (`id`, `slug`, `source_id`, `page_id`, `chunk_id`, `message_id`, `thread_id`, `graph_session_prefix`, relational seed/path, `superseded_by`, `fact_id`, `entity_slug`) remain byte-identical: never put secrets in IDs. By default each field is capped at 64 Ki UTF-16 characters, the response at 1 Mi characters/8192 text fields, and nesting at 24 levels; oversized/unscannable text becomes `<REDACTED:output_limit>`. `RetrievalRedactionOpts.uncapped` scans every field whole (no `output_limit` replacement; one echo dictionary, every field planned before any write; the depth cap stays) and `verbatim` copies the named keys of each top-level result unscanned. `withOutputRedaction(op)` is the registration-time wrapper behind `Operation.outputRedaction` (`src/core/ops/contract.ts`): `operations.ts` wraps every `'retrieval'` op's handler once, so the CLI, stdio and HTTP MCP, subagent tools and `gbrain call` all pass the whole response (early returns included) through the uncapped redactor, linear in output size; `{ retrieval: { localVerbatim } }` leaves the named keys raw only when `ctx.remote === false`. The memory verbs: `recall`, `context_pack` and `delta` redact their presentation sets with one echo dictionary before packing, so budgets, `budget_used` and the delta cursor follow the delivered text, and their rendered `text` is never replaced by `output_limit`; facts (`fact`, `context`, `source`) are `localVerbatim`, so a remembered credential is readable raw only by the trusted local CLI on the brain host (stdio MCP and thin clients are remote). Handlers that clip or summarize stored text (transcript summaries, entity-card and compiled-context excerpts) redact the whole field before clipping. THREAT MODEL: this defends against accidental exposure of stored credentials into agent context and transcripts through retrieval ops. It does not cover the raw-read exemptions (`get_page`, `fetch`, `get_chunks`, `get_raw_data`, `get_versions`, the skill catalog, admin job ops), stored content (unchanged), or configured providers (embeddings at ingest, the hosted reranker, synthesis/think generation still receive unredacted text, except private keys, which the credential-safe projection keeps out of chunks). Unknown formats and short fragments can escape detection. This is output hygiene, not authorization or provider/eval no-egress. Tests: `test/search/output-redaction.serial.test.ts`, `test/search/output-redaction.test.ts`, `test/retrieval-op-redaction.test.ts` (every `'retrieval'` and `'no_stored_text'` op run through MCP dispatch with `remote = true` against a planted secret, plus the registration wrapper), `test/transcripts-redaction.test.ts`.
- `src/core/search/return-policy.ts` (default OFF) — intent-aware adaptive return-sizing. Pure, dependency-light module that trims the final ranked candidate set to an intent-driven cap instead of returning the full top-K. `entity` intent gets a tight cap; `temporal`/`event`/`general` get a recall-preserving cap (`concept` is coerced to `general` by `hybrid.ts` before the call — concept queries want breadth). A `minKeep` failsafe (≥1) guarantees a human never gets a silent blank when candidates exist. WHY a cap, not a score-cliff detector: PrecisionMemBench instrumentation (gbrain-evals) measured the rank1→rank2 RRF gap is ~identical whether rank-1 is correct (0.602) or wrong (0.569) — mechanical decay, not a separatrix; rank-1 is right in 94% of single-answer cases, so "return a tight set" is the whole win and cliff-cutting just adds noise. Exports `AdaptiveReturnConfig`, `DEFAULT_ADAPTIVE_RETURN` (frozen: `enabled=false`, `entityMax=2`, `otherMax=6`, `minKeep=1`), `AdaptiveReturnDecision` (`{applied, intent, cap, kept, total}`), `AdaptiveReturnInput` (`boolean | Partial<AdaptiveReturnConfig> | undefined`), `adaptiveReturnFromConfig(cfg)`, `resolveAdaptiveReturn(perCall, fromConfig)` (defaults → config → per-call merge), `adaptiveReturnEnabled(...)` (cache-skip gate check), `applyAdaptiveReturn(results, intent, cfg)` (the trim). Config knobs (DB or file plane): `search.adaptive_return` (master switch), `search.adaptive_return_entity_max`, `search.adaptive_return_other_max`, `search.adaptive_return_min_keep` (each clamped ≥1). Wired into `hybridSearch` AFTER `applyReranker`, BEFORE the `limit` slice, and ONLY on the first page (`offset===0`) — paginating a confidence-gated set is incoherent, so paginated calls fall through to the fixed limit. Stamps the decision onto `HybridSearchMeta.adaptive_return` for `gbrain search --explain`. `hybridSearchCached` SKIPS the cache when the gate is on (a trimmed set must not be served to a gate-off lookup and vice versa). `SearchOpts.adaptiveReturn` + `HybridSearchMeta.adaptive_return` declared in `src/core/types.ts`. Agent-facing: the `query` op (`src/core/operations.ts`) exposes an `adaptive_return` boolean param whose description instructs the agent WHEN to set it (single-answer → on; breadth/exploration → off; pass `limit:1` for a hard single-answer cap), threaded into `hybridSearchCached` — end users never touch the config knob; their agent decides per query (same pattern as `salience`/`recency`). Pinned by `test/search/return-policy.test.ts` (mechanism) + `test/search/query-op-adaptive-return.test.ts` (agent surface: param exists + description teaches both directions + the never-empty contract).
@@ -42,6 +41,7 @@ Current behavior and load-bearing invariants; history belongs in Git and CHANGEL
- `src/core/search/relational-plan.ts` — `parseRelationalPlan`: deterministic planner for questions chaining 2-3 typed relationships (bounded lexer, fixed lexicon of verb / passive / agent-noun / outgoing-noun forms, one anchor span, anchor-outward hop order with the main-clause verb outermost, type coherence, head-noun constraint). Returns `plan` / `not_applicable` (fewer than two relationships) / `unsupported` with a reason (coordination, negation, time, counting, quotes, multiple entities, incoherent types). `isRelationalQuery(query, plannerOn)` is the relational test for ranking decisions; planner off it equals `parseRelationalQuery`. Pinned by `test/relational-plan.test.ts`.
+- `src/core/search/hub-dampening.ts` — `hubWeight(degree, H)` = 1 / (1 + ((max(n,1) − 1) / H)²), `'off'` → 1; `dampenBoost`, `normalizeHubDampening`. Pure; callers pass the caller-visible degree.
- `src/core/search/relational-recall.ts` — the relational recall arm: `parseRelationalQuery` → seed resolution per in-scope source (federated set, scalar source, or every non-archived source for an unscoped caller; a literal `__all__` resolves no seeds, fail-closed) → `relationalFanout` → hydrate, fail-open. Seeds resolve through `resolveEntitySlugWithSource` and a `fallback_slugify` result is dropped (confidence gate D3). The entity resolver never returns meetings, so for an incoming `attended` relation (`Who attended <meeting>?`) a live `meeting` or `event` page whose title is exactly the seed phrase (case-insensitive, unique in the source) is the seed; other relations never seed from titles. Pinned by `test/relational-recall.test.ts`, `test/relational-recall-scope-sources.test.ts` and `test/pack-relation-direction-engine.test.ts`. With `planner` on (`search.relational_planner`, on in balanced/tokenmax), a 2-3 relationship question (`parseRelationalPlan`) runs `runRelationalChain` first: answers then evidence pages, each with a `relational` field; nothing found → the one-hop path; refused → no arm (`meta.plan`). With `orientOneHop` (`search.relational_orient_onehop`, off in every bundle) typed one-hop walks add neighbors reached through links written on the other page. `answerRows` limits the pin and evidence slot to answers. Pinned by `test/relational-recall.test.ts`.
diff --git a/docs/eval/decisions/p2-e1-heldout/README.md b/docs/eval/decisions/p2-e1-heldout/README.md
new file mode 100644
index 0000000000..f995d72c6b
--- /dev/null
+++ b/docs/eval/decisions/p2-e1-heldout/README.md
@@ -0,0 +1,44 @@
+# Hub dampening: held-out verdict (FAIL)
+
+`search.hub_dampening` failed its sealed held-out evaluation, so the search-side mechanism is not part of this release.
+The `hubWeight` helper in `src/core/search/hub-dampening.ts` stays, because the multi-hop chain executor
+(`relational-chain.ts`) weights intermediate nodes with it.
+
+The candidate was the frozen build af1225d7b with H = 32, the half degree picked on development seed 1
+(`../p2-hub-dampening-dev/`). It ran on sealed hub-world seeds 2 and 3 against two rivals:
+- remove: the backlink boost set to 0 (31a792c94);
+- cap: backlink and graph-signal factors capped at 1.02 (4e2bd760e).
+
+The bar, all four required:
+1. concept nDCG@5 at least +1.0 point, with the 95% CI above 0;
+2. better than both rivals on concept;
+3. hub-as-answer nDCG@5 no lower than −0.5 point;
+4. one-hop recall@5 no lower than −0.5 point.
+
+CIs are paired bootstraps over probes (10,000 draws, seed 42), in points.
+
+| Workload | Concept Δ (H = 32) | H = 32 vs remove | H = 32 vs cap | Hub-as-answer Δ | One-hop R@5 Δ | Failed conditions |
+|---|---|---|---|---|---|---|
+| seed 2, keyword | +3.3 (+2.5, +4.2) | −3.1 (−4.0, −2.3) | −2.6 (−3.3, −1.9) | −30.6 (−45.0, −16.8) | −5.4 (−9.1, −2.0) | 2, 3, 4 |
+| seed 3, keyword | +3.6 (+2.8, +4.5) | −2.8 (−3.6, −2.1) | −2.3 (−2.9, −1.7) | −36.2 (−53.0, −19.9) | −1.0 (−3.8, +1.4) | 2, 3, 4 |
+| seed 2, hybrid (valid rows only) | +1.0 (+0.3, +1.9) | +0.4 (−1.2, +2.6) | −0.9 (−1.6, −0.3) | −24.5 (−42.6, −8.2) | +0.3 (−4.6, +5.2) | 1, 2, 3 |
+| seed 2, hybrid (no-op rows counted as off) | +0.3 (+0.1, +0.6) | +0.6 (−0.3, +1.6) | −0.5 (−1.2, +0.2) | −24.5 (−42.6, −8.2) | +0.2 (−3.0, +3.5) | 1, 2, 3 |
+| seed 3, hybrid | not run (see below) | | | | | |
+
+On the keyword workloads, dampening lifts concept retrieval, but both rivals lift it more. It also costs between a quarter
+and a third of hub-as-answer nDCG@5, against a −0.5 guard.
+
+**Missing cells.** Ten of the 12 cells ran. The seed-3 hybrid candidate and cap cells did not finish. They cannot change
+the verdict: hub-as-answer would need a gain of about +89 points there to bring even a pooled delta to −0.5.
+
+**Hybrid telemetry.** In seed-2 hybrid, 346 of 625 H = 32 probe rows (299 concept, 47 one-hop) carried no hub-dampening
+stamp. On those queries the lexical metadata-boost gate skipped the backlink and graph-signal stages, so dampening had
+nothing to act on and the ranking equals dampening off. The table reports both treatments: those rows dropped, and those
+rows counted as off. Neither changes the verdict.
+
+## Consequence
+
+The ranking stage, the `search.hub_dampening` key, its per-call override, the knobs-hash part, the `hub_degree_shape`
+doctor check and the per-row hub weights in explain output are removed. Search ranking is unchanged from master.
+
+`verdict.json` is the custodian's aggregate. The sealed seeds stay in owner custody.
diff --git a/docs/eval/decisions/p2-e1-heldout/verdict.json b/docs/eval/decisions/p2-e1-heldout/verdict.json
new file mode 100644
index 0000000000..8f6fa96de4
--- /dev/null
+++ b/docs/eval/decisions/p2-e1-heldout/verdict.json
@@ -0,0 +1,639 @@
+{
+ "decision_id": "p2-e1-hub-dampening-heldout",
+ "hypothesis": "P2 E1 search.hub_dampening (H = 32) on sealed hub-world seeds 2 and 3",
+ "computed_by": "second custodian (gbra49), P0 unresponsive; from P0's custody/p2-hub and vmjobs/hubC pull",
+ "builds": {
+ "candidate": "gbrain#6020 af1225d7b (arms off, 32, graph-off)",
+ "rival_remove": "31a792c94 (BACKLINK_BOOST_COEF = 0)",
+ "rival_cap": "4e2bd760e (backlink and graph-signal factors capped at 1.02)"
+ },
+ "bar": [
+ "concept nDCG@5 delta >= +1.0 point with 95% CI above 0",
+ "better than both rivals on concept",
+ "hub-as-answer nDCG@5 delta >= -0.5 point",
+ "one-hop recall@5 delta >= -0.5 point"
+ ],
+ "bootstrap": "paired over probes, 10,000 draws, seed 42; points",
+ "workloads": {
+ "seed2-keyword": {
+ "abs_off": {
+ "concept": 38.0,
+ "hub-answer": 96.3
+ },
+ "H32": {
+ "concept_ndcg5": [
+ 3.29,
+ [
+ 2.46,
+ 4.18
+ ]
+ ],
+ "hub_answer_ndcg5": [
+ -30.62,
+ [
+ -45.0,
+ -16.77
+ ]
+ ],
+ "onehop_recall5": [
+ -5.36,
+ [
+ -9.07,
+ -2.01
+ ]
+ ],
+ "onehop_hit1": [
+ -1.38,
+ [
+ -8.28,
+ 5.52
+ ]
+ ]
+ },
+ "graph-off": {
+ "concept_ndcg5": [
+ 0.02,
+ [
+ -0.13,
+ 0.2
+ ]
+ ],
+ "hub_answer_ndcg5": [
+ 1.85,
+ [
+ 0.0,
+ 5.54
+ ]
+ ],
+ "onehop_recall5": [
+ -3.59,
+ [
+ -6.0,
+ -1.52
+ ]
+ ],
+ "onehop_hit1": [
+ -4.14,
+ [
+ -8.28,
+ 0.0
+ ]
+ ]
+ },
+ "remove": {
+ "concept_ndcg5": [
+ 6.41,
+ [
+ 5.17,
+ 7.66
+ ]
+ ],
+ "hub_answer_ndcg5": [
+ -1.31,
+ [
+ -8.15,
+ 4.88
+ ]
+ ],
+ "onehop_recall5": [
+ -9.8,
+ [
+ -14.01,
+ -5.85
+ ]
+ ],
+ "onehop_hit1": [
+ -13.1,
+ [
+ -20.69,
+ -5.52
+ ]
+ ]
+ },
+ "cap": {
+ "concept_ndcg5": [
+ 5.85,
+ [
+ 4.69,
+ 7.04
+ ]
+ ],
+ "hub_answer_ndcg5": [
+ 0.0,
+ [
+ -5.54,
+ 5.54
+ ]
+ ],
+ "onehop_recall5": [
+ -9.63,
+ [
+ -14.03,
+ -5.46
+ ]
+ ],
+ "onehop_hit1": [
+ -10.34,
+ [
+ -17.93,
+ -2.76
+ ]
+ ]
+ },
+ "H32_minus_remove_concept": [
+ -3.12,
+ [
+ -3.98,
+ -2.33
+ ]
+ ],
+ "H32_minus_cap_concept": [
+ -2.56,
+ [
+ -3.32,
+ -1.85
+ ]
+ ],
+ "n_valid_H32": {
+ "concept": 428,
+ "hub-answer": 20,
+ "one-hop": 145
+ },
+ "gate": {
+ "1_primary": true,
+ "2_beats_rivals": false,
+ "3_hub_answer": false,
+ "4_onehop": false
+ }
+ },
+ "seed3-keyword": {
+ "abs_off": {
+ "concept": 38.0,
+ "hub-answer": 98.2
+ },
+ "H32": {
+ "concept_ndcg5": [
+ 3.63,
+ [
+ 2.77,
+ 4.52
+ ]
+ ],
+ "hub_answer_ndcg5": [
+ -36.15,
+ [
+ -52.97,
+ -19.85
+ ]
+ ],
+ "onehop_recall5": [
+ -1.03,
+ [
+ -3.79,
+ 1.38
+ ]
+ ],
+ "onehop_hit1": [
+ -2.07,
+ [
+ -8.28,
+ 4.83
+ ]
+ ]
+ },
+ "graph-off": {
+ "concept_ndcg5": [
+ -0.04,
+ [
+ -0.18,
+ 0.11
+ ]
+ ],
+ "hub_answer_ndcg5": [
+ 1.85,
+ [
+ 0.0,
+ 5.54
+ ]
+ ],
+ "onehop_recall5": [
+ -3.24,
+ [
+ -5.66,
+ -1.17
+ ]
+ ],
+ "onehop_hit1": [
+ -5.52,
+ [
+ -9.66,
+ -1.38
+ ]
+ ]
+ },
+ "remove": {
+ "concept_ndcg5": [
+ 6.47,
+ [
+ 5.32,
+ 7.67
+ ]
+ ],
+ "hub_answer_ndcg5": [
+ -11.73,
+ [
+ -19.76,
+ -3.69
+ ]
+ ],
+ "onehop_recall5": [
+ -7.21,
+ [
+ -10.83,
+ -3.97
+ ]
+ ],
+ "onehop_hit1": [
+ -14.48,
+ [
+ -22.07,
+ -7.59
+ ]
+ ]
+ },
+ "cap": {
+ "concept_ndcg5": [
+ 5.9,
+ [
+ 4.84,
+ 7.01
+ ]
+ ],
+ "hub_answer_ndcg5": [
+ -2.5,
+ [
+ -9.35,
+ 3.69
+ ]
+ ],
+ "onehop_recall5": [
+ -6.69,
+ [
+ -10.48,
+ -3.24
+ ]
+ ],
+ "onehop_hit1": [
+ -11.72,
+ [
+ -18.62,
+ -4.83
+ ]
+ ]
+ },
+ "H32_minus_remove_concept": [
+ -2.84,
+ [
+ -3.6,
+ -2.14
+ ]
+ ],
+ "H32_minus_cap_concept": [
+ -2.27,
+ [
+ -2.93,
+ -1.67
+ ]
+ ],
+ "n_valid_H32": {
+ "concept": 428,
+ "hub-answer": 20,
+ "one-hop": 145
+ },
+ "gate": {
+ "1_primary": true,
+ "2_beats_rivals": false,
+ "3_hub_answer": false,
+ "4_onehop": false
+ }
+ },
+ "seed2-hybrid": {
+ "valid_rows_only": {
+ "abs_off": {
+ "concept": 47.9,
+ "hub-answer": 94.5
+ },
+ "H32": {
+ "concept_ndcg5": [
+ 0.96,
+ [
+ 0.28,
+ 1.89
+ ]
+ ],
+ "hub_answer_ndcg5": [
+ -24.46,
+ [
+ -42.62,
+ -8.15
+ ]
+ ],
+ "onehop_recall5": [
+ 0.31,
+ [
+ -4.59,
+ 5.2
+ ]
+ ],
+ "onehop_hit1": [
+ 1.02,
+ [
+ -4.08,
+ 6.12
+ ]
+ ]
+ },
+ "graph-off": {
+ "concept_ndcg5": [
+ 0.0,
+ [
+ 0.0,
+ 0.0
+ ]
+ ],
+ "hub_answer_ndcg5": [
+ 0.0,
+ [
+ 0.0,
+ 0.0
+ ]
+ ],
+ "onehop_recall5": [
+ -1.03,
+ [
+ -2.76,
+ 0.0
+ ]
+ ],
+ "onehop_hit1": [
+ -0.69,
+ [
+ -3.45,
+ 1.38
+ ]
+ ]
+ },
+ "remove": {
+ "concept_ndcg5": [
+ -0.3,
+ [
+ -1.38,
+ 0.64
+ ]
+ ],
+ "hub_answer_ndcg5": [
+ -11.88,
+ [
+ -23.81,
+ -2.62
+ ]
+ ],
+ "onehop_recall5": [
+ -0.14,
+ [
+ -2.9,
+ 2.76
+ ]
+ ],
+ "onehop_hit1": [
+ -2.76,
+ [
+ -6.21,
+ 0.0
+ ]
+ ]
+ },
+ "cap": {
+ "concept_ndcg5": [
+ 0.79,
+ [
+ 0.06,
+ 1.57
+ ]
+ ],
+ "hub_answer_ndcg5": [
+ -10.72,
+ [
+ -19.88,
+ -3.0
+ ]
+ ],
+ "onehop_recall5": [
+ 0.21,
+ [
+ -2.76,
+ 3.1
+ ]
+ ],
+ "onehop_hit1": [
+ -2.76,
+ [
+ -6.9,
+ 0.69
+ ]
+ ]
+ },
+ "H32_minus_remove_concept": [
+ 0.39,
+ [
+ -1.21,
+ 2.56
+ ]
+ ],
+ "H32_minus_cap_concept": [
+ -0.86,
+ [
+ -1.59,
+ -0.3
+ ]
+ ],
+ "n_valid_H32": {
+ "concept": 129,
+ "hub-answer": 20,
+ "one-hop": 98
+ },
+ "gate": {
+ "1_primary": false,
+ "2_beats_rivals": false,
+ "3_hub_answer": false,
+ "4_onehop": true
+ }
+ },
+ "telemetry_noop_rows_imputed_as_off": {
+ "abs_off": {
+ "concept": 47.9,
+ "hub-answer": 94.5
+ },
+ "H32": {
+ "concept_ndcg5": [
+ 0.29,
+ [
+ 0.08,
+ 0.57
+ ]
+ ],
+ "hub_answer_ndcg5": [
+ -24.46,
+ [
+ -42.62,
+ -8.15
+ ]
+ ],
+ "onehop_recall5": [
+ 0.21,
+ [
+ -3.03,
+ 3.52
+ ]
+ ],
+ "onehop_hit1": [
+ 0.69,
+ [
+ -2.76,
+ 4.14
+ ]
+ ]
+ },
+ "graph-off": {
+ "concept_ndcg5": [
+ 0.0,
+ [
+ 0.0,
+ 0.0
+ ]
+ ],
+ "hub_answer_ndcg5": [
+ 0.0,
+ [
+ 0.0,
+ 0.0
+ ]
+ ],
+ "onehop_recall5": [
+ -1.03,
+ [
+ -2.76,
+ 0.0
+ ]
+ ],
+ "onehop_hit1": [
+ -0.69,
+ [
+ -3.45,
+ 1.38
+ ]
+ ]
+ },
+ "remove": {
+ "concept_ndcg5": [
+ -0.3,
+ [
+ -1.38,
+ 0.64
+ ]
+ ],
+ "hub_answer_ndcg5": [
+ -11.88,
+ [
+ -23.81,
+ -2.62
+ ]
+ ],
+ "onehop_recall5": [
+ -0.14,
+ [
+ -2.9,
+ 2.76
+ ]
+ ],
+ "onehop_hit1": [
+ -2.76,
+ [
+ -6.21,
+ 0.0
+ ]
+ ]
+ },
+ "cap": {
+ "concept_ndcg5": [
+ 0.79,
+ [
+ 0.06,
+ 1.57
+ ]
+ ],
+ "hub_answer_ndcg5": [
+ -10.72,
+ [
+ -19.88,
+ -3.0
+ ]
+ ],
+ "onehop_recall5": [
+ 0.21,
+ [
+ -2.76,
+ 3.1
+ ]
+ ],
+ "onehop_hit1": [
+ -2.76,
+ [
+ -6.9,
+ 0.69
+ ]
+ ]
+ },
+ "H32_minus_remove_concept": [
+ 0.59,
+ [
+ -0.29,
+ 1.63
+ ]
+ ],
+ "H32_minus_cap_concept": [
+ -0.5,
+ [
+ -1.2,
+ 0.15
+ ]
+ ],
+ "n_valid_H32": {
+ "concept": 428,
+ "hub-answer": 20,
+ "one-hop": 145
+ },
+ "gate": {
+ "1_primary": false,
+ "2_beats_rivals": false,
+ "3_hub_answer": false,
+ "4_onehop": true
+ }
+ }
+ },
+ "seed3-hybrid": {
+ "missing": [
+ "candidate cell (arms off, 32, graph-off)",
+ "rival_cap cell"
+ ],
+ "present": [
+ "rival_remove cell"
+ ],
+ "where": "P0 machine, Ubicloud VM ubirun-gbra49-1791261782-aeed909c (job hubD), still running at 14:19 UTC 2026-10-06"
+ }
+ },
+ "hybrid_telemetry_note": "In seed2-hybrid, 346 of 625 H = 32 probe rows (299 concept, 47 one-hop) are recorded as errors because search telemetry carried no hub_dampening stamp. On those queries the lexical metadata-boost gate skipped the backlink and graph-signal stages, so dampening had nothing to act on and the ranking equals arm off. Both treatments are reported; neither changes the verdict.",
+ "verdict": "fail",
+ "why": "Both keyword workloads fail conditions 2, 3 and 4: the rivals beat H = 32 on concept by 2.3 to 3.1 points with CIs below 0, and hub-as-answer drops 30.6 and 36.2 points, and one-hop recall@5 drops 5.4 and 1.0 points. Seed-2 hybrid fails conditions 1, 2 and 3 (concept +0.3 imputed / +1.0 valid-only; hub-as-answer -24.5). The missing seed-3 hybrid cells cannot change the outcome: hub-as-answer would need a gain of about +89 points there to bring even a pooled delta to -0.5.",
+ "consequence": "search.hub_dampening stays off and the search-side mechanism is removed (preregistered); the hubWeight helper stays for relational-chain.ts"
+}
\ No newline at end of file
diff --git a/docs/eval/decisions/p2-hub-dampening-dev/README.md b/docs/eval/decisions/p2-hub-dampening-dev/README.md
index e2d577914c..a09facfc70 100644
--- a/docs/eval/decisions/p2-hub-dampening-dev/README.md
+++ b/docs/eval/decisions/p2-hub-dampening-dev/README.md
@@ -49,6 +49,8 @@ Development predicts that hub dampening fails the held-out gate. Under the prere
and the search-side mechanism is removed. The `hubWeight` helper stays either way, because the multi-hop chain executor
on master (`relational-chain.ts`) imports it.
+The sealed held-out run confirmed it: FAIL (`../p2-e1-heldout/`).
+
The controls show something separate: on a hub-heavy brain the backlink boost costs concept recall (+6.5 pts without it)
but carries one-hop and hub-as-answer recall. No change to it is proposed here.
diff --git a/docs/guides/search-explain.md b/docs/guides/search-explain.md
index 71660d1936..18cac4db58 100644
--- a/docs/guides/search-explain.md
+++ b/docs/guides/search-explain.md
@@ -34,7 +34,7 @@ Each row's `score_details`:
| `rrf` | `raw` (summed votes), `normalized` (divided by the best row), `compiled_truth_boost`. `state: "not_run"` on single-arm paths. |
| `blend` | The cosine blend: `0.7 × norm_rrf + 0.3 × cosine`. `not_run` without a query embedding. |
| `base_score` | The score entering the post-fusion boosts. |
-| `boosts` | Every factor that changed this row, by stage: `backlink` (with `inbound` links and `hub_weight` when hub dampening reduced it), `salience`, `recency`, `chronicle`, `title`, `adjacency`, `cross_source`, `session_demote`, `alias_resolved`, `supersede`, `exact_match`. |
+| `boosts` | Every factor that changed this row, by stage: `backlink` (with its `inbound` links), `salience`, `recency`, `chronicle`, `title`, `adjacency`, `cross_source`, `session_demote`, `alias_resolved`, `supersede`, `exact_match`. |
| `rerank` | Cross-encoder score and rank delta, or `not_run`. |
| `final` | The row's score. |
@@ -73,13 +73,3 @@ re-sent to the model on each turn. A starter-surface session calls
`request_tools {"surface": "full"}` first. Agents on the default seven-verb
memory surface do not have `query`; ask the brain host to run
`gbrain search "<question>" --explain --json`, or enable the full tool surface.
-
-## Hub dampening
-
-`search.hub_dampening` (`off`, or a number H) shrinks the backlink and graph
-adjacency lifts of very highly linked pages: a page with H+1 inbound links
-keeps half of its lift, 3H+1 keeps a tenth. It is `off` in every mode until a
-held-out evaluation sets a default. `gbrain doctor` (`hub_degree_shape`)
-reports the brain's inbound-link distribution and how many pages a setting
-would affect; `score_details.boosts.backlink.hub_weight` shows the effect on
-each row.
diff --git a/docs/guides/search-modes.md b/docs/guides/search-modes.md
index a69ca0669d..55735d4668 100644
--- a/docs/guides/search-modes.md
+++ b/docs/guides/search-modes.md
@@ -37,7 +37,6 @@ and maintenance commands remain available.
| `relational_rerank_pin` | 3 | 3 | 3 |
| `keyword_arm_confidence_floor` | `null` (off) | `null` (off) | `null` (off) |
| `metadata_boost_gate` | `lexical` | `lexical` | `lexical` |
-| `hub_dampening` | `off` | `off` | `off` |
| `searchLimit` default | 10 | 25 | 50 |
| `reranker` (cross-encoder) | off | `voyage:rerank-2.5` | `voyage:rerank-2.5` |
| `autocut` (rerank-cliff cut) | off | off | off |
diff --git a/scripts/module-size-limits.tsv b/scripts/module-size-limits.tsv
index 2567720e0e..87f7b470e1 100644
--- a/scripts/module-size-limits.tsv
+++ b/scripts/module-size-limits.tsv
@@ -22,8 +22,8 @@ src/core/migrate.ts 602 ratchet schema-migration runner only; migrations live in
src/core/operations.ts 339 ratchet peel target: containment sprint C4-C7; grown v0.46.26.0 megawave op wiring; +chat-connectors wiring (master merge); +5 v0.47 gmail-loops: loopsOperations spread + OP_AREAS; #5105: receipt operation registry wiring; shared-skills integration on company-ingestion base; +2 security wave: withOutputRedaction applied at op registration; +1 #5616: pageEditOperations import (spread shares the pages line); +1 Foundations 1 F1b: attributionOperations import (spread shares the admin line); +1 agent operator wave A6: ops/notices.ts import (mute_notice); +2 agent operator closeout A1: registerOpRoutes import + call (routing logic in fix-routing.ts); +2 retrieval feedback: feedbackOperations import and spread (ops/feedback.ts); +1 #6007: pageBatchOperations import (spread shares the pages line)
src/core/pglite-engine.ts 2995 ratchet +5 agent operator gate fixes: repair-failed marker gate before the lock and the marker record after a failed auto-repair (logic in pglite-repair.ts, refusal in pglite-repair-consent.ts); +1 System One v1 evals: search arms clamp to searchLimitCap() (import of search/eval-pool-depth.ts; eval-only --eval-pool-depth, production cap unchanged); refactor wave 1 split target (W1 engine-sql); E1 bootstrap moved to engine-sql/bootstrap.ts; ceiling rationale: docs/architecture/key-files/engines-1.md entry for src/core/pglite-engine.ts; evidence delivery: getChunkWindows delegate + type import (+3; SQL in engine-sql/chunks.ts); #5761: +4 markPagesAttendanceBlocked delegate (SQL in engine-sql/pages.ts); +12 eval wave N1-2/N1-3: mergeOntologyFact same-stint noop check + ontology visibility filter in the grandfathered ontology methods; lowered to 3213 #5824: searchVector SQL moved to search/vector-statement.ts (-166); lowered to 3117 #5889: searchTitles SQL moved to engine-sql/titles.ts (-108); lowered to 2915 F4a: getHealth SQL moved to engine-sql/health.ts (-202); +6 F4b: planner-sensitive reads call beforePlannerRead/plannerRead (logic in planner-stats.ts); +52 engine graduation (GBRA-50 G2a): marker/tombstone checks before and after the kernel lock (logic in persistence/graduation-custody.ts), lock-retaining close and held-lock open (engine lifecycle methods cannot move); 4 Foundations 2 Lane F: autocommit write statements take the WAL checkpoint guard (classifier writesWal in pglite-engine/checkpoint-guard.ts); +5 agent operator gate fixes: repair-failed marker gate before the lock and the marker record after a failed auto-repair (logic in pglite-repair.ts, refusal in pglite-repair-consent.ts); +1 System One v1 evals: search arms clamp to searchLimitCap() (import of search/eval-pool-depth.ts; eval-only --eval-pool-depth, production cap unchanged); refactor wave 1 split target (W1 engine-sql); E1 bootstrap moved to engine-sql/bootstrap.ts; ceiling rationale: docs/architecture/key-files/engines-1.md entry for src/core/pglite-engine.ts; evidence delivery: getChunkWindows delegate + type import (+3; SQL in engine-sql/chunks.ts); #5761: +4 markPagesAttendanceBlocked delegate (SQL in engine-sql/pages.ts); +12 eval wave N1-2/N1-3: mergeOntologyFact same-stint noop check + ontology visibility filter in the grandfathered ontology methods; lowered to 3213 #5824: searchVector SQL moved to search/vector-statement.ts (-166); lowered to 3117 #5889: searchTitles SQL moved to engine-sql/titles.ts (-108); lowered to 2915 F4a: getHealth SQL moved to engine-sql/health.ts (-202); +6 F4b: planner-sensitive reads call beforePlannerRead/plannerRead (logic in planner-stats.ts); +5 agent operator gate fixes: repair-failed marker gate before the lock and the marker record after a failed auto-repair (logic in pglite-repair.ts, refusal in pglite-repair-consent.ts); +1 System One v1 evals: search arms clamp to searchLimitCap() (import of search/eval-pool-depth.ts; eval-only --eval-pool-depth, production cap unchanged); refactor wave 1 split target (W1 engine-sql); E1 bootstrap moved to engine-sql/bootstrap.ts; ceiling rationale: docs/architecture/key-files/engines-1.md entry for src/core/pglite-engine.ts; evidence delivery: getChunkWindows delegate + type import (+3; SQL in engine-sql/chunks.ts); #5761: +4 markPagesAttendanceBlocked delegate (SQL in engine-sql/pages.ts); +12 eval wave N1-2/N1-3: mergeOntologyFact same-stint noop check + ontology visibility filter in the grandfathered ontology methods; lowered to 3213 #5824: searchVector SQL moved to search/vector-statement.ts (-166); lowered to 3117 #5889: searchTitles SQL moved to engine-sql/titles.ts (-108); lowered to 2915 F4a: getHealth SQL moved to engine-sql/health.ts (-202); +6 F4b: planner-sensitive reads call beforePlannerRead/plannerRead (logic in planner-stats.ts); +52 engine graduation (GBRA-50 G2a): marker/tombstone checks before and after the kernel lock (logic in persistence/graduation-custody.ts), lock-retaining close and held-lock open (engine lifecycle methods cannot move); 4 Foundations 2 Lane F: autocommit write statements take the WAL checkpoint guard (classifier writesWal in pglite-engine/checkpoint-guard.ts); +5 agent operator gate fixes: repair-failed marker gate before the lock and the marker record after a failed auto-repair (logic in pglite-repair.ts, refusal in pglite-repair-consent.ts); +1 System One v1 evals: search arms clamp to searchLimitCap() (import of search/eval-pool-depth.ts; eval-only --eval-pool-depth, production cap unchanged); refactor wave 1 split target (W1 engine-sql); E1 bootstrap moved to engine-sql/bootstrap.ts; ceiling rationale: docs/architecture/key-files/engines-1.md entry for src/core/pglite-engine.ts; evidence delivery: getChunkWindows delegate + type import (+3; SQL in engine-sql/chunks.ts); #5761: +4 markPagesAttendanceBlocked delegate (SQL in engine-sql/pages.ts); +12 eval wave N1-2/N1-3: mergeOntologyFact same-stint noop check + ontology visibility filter in the grandfathered ontology methods; lowered to 3213 #5824: searchVector SQL moved to search/vector-statement.ts (-166); lowered to 3117 #5889: searchTitles SQL moved to engine-sql/titles.ts (-108); lowered to 2915 F4a: getHealth SQL moved to engine-sql/health.ts (-202); +6 F4b: planner-sensitive reads call beforePlannerRead/plannerRead (logic in planner-stats.ts); +5 agent operator gate fixes: repair-failed marker gate before the lock and the marker record after a failed auto-repair (logic in pglite-repair.ts, refusal in pglite-repair-consent.ts); +1 System One v1 evals: search arms clamp to searchLimitCap() (import of search/eval-pool-depth.ts; eval-only --eval-pool-depth, production cap unchanged); refactor wave 1 split target (W1 engine-sql); E1 bootstrap moved to engine-sql/bootstrap.ts; ceiling rationale: docs/architecture/key-files/engines-1.md entry for src/core/pglite-engine.ts; evidence delivery: getChunkWindows delegate + type import (+3; SQL in engine-sql/chunks.ts); #5761: +4 markPagesAttendanceBlocked delegate (SQL in engine-sql/pages.ts); +12 eval wave N1-2/N1-3: mergeOntologyFact same-stint noop check + ontology visibility filter in the grandfathered ontology methods; lowered to 3213 #5824: searchVector SQL moved to search/vector-statement.ts (-166); lowered to 3117 #5889: searchTitles SQL moved to engine-sql/titles.ts (-108); lowered to 2915 F4a: getHealth SQL moved to engine-sql/health.ts (-202); +6 F4b: planner-sensitive reads call beforePlannerRead/plannerRead (logic in planner-stats.ts); +52 engine graduation (GBRA-50 G2a): marker/tombstone checks before and after the kernel lock (logic in persistence/graduation-custody.ts), lock-retaining close and held-lock open (engine lifecycle methods cannot move); +1 #5984: upsertChunks guards pass the per-transaction config memo (transactionMemo in page-state/transactions.ts); v0.60.58.0 merge: #5984 diet growth re-summed over v0.60.57.0 (2983 measured); 4 Foundations 2 Lane F: autocommit write statements take the WAL checkpoint guard (classifier writesWal in pglite-engine/checkpoint-guard.ts); +5 agent operator gate fixes: repair-failed marker gate before the lock and the marker record after a failed auto-repair (logic in pglite-repair.ts, refusal in pglite-repair-consent.ts); +1 System One v1 evals: search arms clamp to searchLimitCap() (import of search/eval-pool-depth.ts; eval-only --eval-pool-depth, production cap unchanged); refactor wave 1 split target (W1 engine-sql); E1 bootstrap moved to engine-sql/bootstrap.ts; ceiling rationale: docs/architecture/key-files/engines-1.md entry for src/core/pglite-engine.ts; evidence delivery: getChunkWindows delegate + type import (+3; SQL in engine-sql/chunks.ts); #5761: +4 markPagesAttendanceBlocked delegate (SQL in engine-sql/pages.ts); +12 eval wave N1-2/N1-3: mergeOntologyFact same-stint noop check + ontology visibility filter in the grandfathered ontology methods; lowered to 3213 #5824: searchVector SQL moved to search/vector-statement.ts (-166); lowered to 3117 #5889: searchTitles SQL moved to engine-sql/titles.ts (-108); lowered to 2915 F4a: getHealth SQL moved to engine-sql/health.ts (-202); +6 F4b: planner-sensitive reads call beforePlannerRead/plannerRead (logic in planner-stats.ts); +5 agent operator gate fixes: repair-failed marker gate before the lock and the marker record after a failed auto-repair (logic in pglite-repair.ts, refusal in pglite-repair-consent.ts); +1 System One v1 evals: search arms clamp to searchLimitCap() (import of search/eval-pool-depth.ts; eval-only --eval-pool-depth, production cap unchanged); refactor wave 1 split target (W1 engine-sql); E1 bootstrap moved to engine-sql/bootstrap.ts; ceiling rationale: docs/architecture/key-files/engines-1.md entry for src/core/pglite-engine.ts; evidence delivery: getChunkWindows delegate + type import (+3; SQL in engine-sql/chunks.ts); #5761: +4 markPagesAttendanceBlocked delegate (SQL in engine-sql/pages.ts); +12 eval wave N1-2/N1-3: mergeOntologyFact same-stint noop check + ontology visibility filter in the grandfathered ontology methods; lowered to 3213 #5824: searchVector SQL moved to search/vector-statement.ts (-166); lowered to 3117 #5889: searchTitles SQL moved to engine-sql/titles.ts (-108); lowered to 2915 F4a: getHealth SQL moved to engine-sql/health.ts (-202); +6 F4b: planner-sensitive reads call beforePlannerRead/plannerRead (logic in planner-stats.ts); +52 engine graduation (GBRA-50 G2a): marker/tombstone checks before and after the kernel lock (logic in persistence/graduation-custody.ts), lock-retaining close and held-lock open (engine lifecycle methods cannot move); +1 #5984: upsertChunks guards pass the per-transaction config memo (transactionMemo in page-state/transactions.ts); v0.60.58.0 merge: #5984 diet growth re-summed over v0.60.57.0 (2983 measured); +4 P7 relationalChainHop delegate; +8 contributor audit wave P0: listFactsKeyset delegate (SQL in engine-sql/facts.ts)
src/core/postgres-engine.ts 2932 ratchet +1 System One v1 evals: search arms clamp to searchLimitCap() (import of search/eval-pool-depth.ts; eval-only --eval-pool-depth, production cap unchanged); refactor wave 1 split target (W1 engine-sql); ceiling rationale: docs/architecture/key-files/engines-2.md entry for src/core/postgres-engine.ts; evidence delivery: getChunkWindows scoped-read delegate + type import (+5; SQL in engine-sql/chunks.ts); #5761: +4 markPagesAttendanceBlocked delegate (SQL in engine-sql/pages.ts); +10 eval wave N1-2/N1-3: mergeOntologyFact same-stint noop check + ontology visibility filter in the grandfathered ontology methods; lowered to 3242 #5824: searchVector SQL moved to search/vector-statement.ts, +explainVectorSearch/runVectorAttempt (-156); +6 #5730: onpoisoned wiring on the instance/module/connection-manager pools + poisonedDiscards in getPoolDiagnostics (counter in pool-gauge.ts); +5 #5801: onCheckout observer seam (fires after reserve resolution / transaction-callback entry; listeners in pool-gauge.ts); lowered to 3119 #5889: searchTitles SQL moved to engine-sql/titles.ts (-133); lowered to 2914 F4a: getHealth SQL moved to engine-sql/health.ts (-216); +2 #5984: transactions track held page guards like PGLite (withHeldPageKeys), so repeated guards in one transaction cost no round trips; +1 #5984: traceSqlOptions import for the env-gated GBRAIN_SQL_TRACE bench hook (src/core/sql-trace.ts); v0.60.48.0 merge: #5984 growth re-summed over v0.60.47.0 (2917 measured); +2 engine graduation (GBRA-50 G2a): initSchema sizing parameter (the source embedding layout sizes a fresh target); +1 #5984: upsertChunks guards pass the per-transaction config memo (transactionMemo in page-state/transactions.ts); v0.60.58.0 merge: #5984 diet growth re-summed over v0.60.57.0 (2920 measured); +4 P7 relationalChainHop delegate; +8 contributor audit wave P0: listFactsKeyset delegate (SQL in engine-sql/facts.ts)
-src/core/search/hybrid.ts 1660 ratchet +2 System One v1: HybridSearchOpts.decide (search/decide-stage.ts); refactor wave 1 split target (W4 hybrid, cut line); ceiling rationale: docs/architecture/key-files/core-search-1.md entry for src/core/search/hybrid.ts; +10 #5691: per-request embedding_query_prefix read once and threaded to the embeds and cache key; +5 green master wave (embedding opt-out): HybridSearchOpts._embeddingOptedOut (interface field) read once per request and threaded to the cache-lookup embed and the keyword-only gate; +69 P2 hub dampening (shared caller-scoped degree map for backlink + graph-signal stages, meta sink), explain RRF attribution stamp in rrfFusionWeighted, explain_target stage observations
-src/core/types.ts 2243 ratchet +5 System One v1 retrieval lane: SearchResult injection_p/injection_suspected, HybridSearchMeta answerability, egress_denied degraded reason; +4 System One v1: SearchResult rerank_score_kind/decide_evidence, HybridSearchMeta decide/rerank; +3 wave review: PAGE_SORT_SQL.updated_asc source_id + id tiebreakers (total order under federated scopes); +5 #4881: OntologyReadOpts extends PageReadScope doc; +3 #4857: PAGE_SORT_SQL.slug total-order tiebreaker comment; grown v0.46.26.0 megawave: EvidenceOpts, pacing/usage result fields, PageFilters growth (#4352 #4218); wave-k: +9 SalienceOpts/AnomaliesOpts source scope (#3867); +20 2026-09 adversarial batch 2: keyword_relaxed_carried stage + relaxed_dropped meta field docs; +16 2026-09 fix wave: SearchResult.keyword_relaxed field + full fusion-demotion doc; (#3867); +9: #4648 rerank_passthrough degraded stage + empty_result_set/malformed_shape reasons | merged v0.48.1.0 true-up; +master v0.48 merge true-up (reranker succession: no_key preflight, reranker_skipped stage, readiness); corrective release: shared internal PageReadScope and PageReadPolicy; ranker wave v0.48.4.0: HybridSearchMeta relational_rerank_pin / keyword_arm_confidence / metadata_boost_gate + SearchResult.relational_pinned (+48 over master's peel); +12: #4681 Page.updated_at_iso + keyset cursor precision docs; #5105: canonical page state shared module and transaction/snapshot delegates; #5105: public page revision fields; upstream integration: preserve independently reviewed master additions with branch facade extraction; #5252 wave: typed vector pool and readiness metadata; merged company ingestion/schema routing changes; retired provider integration removed; +1 write-path wave: 'created' effective-date source; +3 read-path wave: rerank_failed degraded stage + budget reason (closed vocabularies) and its recall classification note; +8 fw3-search: SearchOpts.source_boosts + keyword_arm_failed/title_arm_failed stages; +2 wave-2 W4: ChunkInput.embedding_input_hash (#5553); fix wave 3 x fix wave 2 (v0.60.5.0) composition: +2 at the merge; evidence delivery: optional SearchResult.delivered (+2; shape in search/evidence-delivery.ts); +2 eval wave N1-3: OntologyReadOpts.visibility (remote world-only ontology reads); +4 #5827: GraphNode.source_id and GraphPath from_source_id/to_source_id; +2 #5824: SearchOpts.vectorLegacyGuard rollback switch; +7 #5154: PageFilters.listColumnsOnly (interface field); +11 Foundations 1 F1b: WriteAttributionView + AttributedPageVersion (get_versions / get_write_attribution read shapes); +1 #5988: SearchResult.stale carries the held-file detail (interface field); +6 retrieval feedback: SearchResult feedback_boost/content_hash/relational_path_edges stamps and RelationalFanoutRow.path_edges (interface fields); +2 RelationalFanoutOpts.wide (interface field); 1 GBRA-49: temporal annotation field on link rows; 1 GBRA-49: temporal annotation field on link rows; 1 GBRA-49: temporal annotation field on link rows; +44 P7 ChainHopOpts/ChainHopEdge chain-hop contract types; P7 SearchResult.relational evidence + RelationalEvidence type + relational_plan meta + planner per-call overrides; +2 P7 SearchOpts.relationalChainSlots per-call override; +1 P7 ChainHopOpts.temporal (relationship-validity policy per hop); P3 x P7 (v0.60.60.0) composition: deltas re-summed at the merge; 1 GBRA-49: temporal annotation field on link rows; +44 P7 ChainHopOpts/ChainHopEdge chain-hop contract types; P7 SearchResult.relational evidence + RelationalEvidence type + relational_plan meta + planner per-call overrides; +2 P7 SearchOpts.relationalChainSlots per-call override; +1 P7 ChainHopOpts.temporal (relationship-validity policy per hop); +1 green master wave: embedding_disabled degraded reason (closed vocabulary); +32 P2 SearchResult explain fields (rrf attribution, blend_norm_rrf, score_details, backlink_count/hub weights) + RrfAttribution + HybridSearchMeta.hub_dampening (interface fields)
+src/core/search/hybrid.ts 1615 ratchet +2 System One v1: HybridSearchOpts.decide (search/decide-stage.ts); refactor wave 1 split target (W4 hybrid, cut line); ceiling rationale: docs/architecture/key-files/core-search-1.md entry for src/core/search/hybrid.ts; +10 #5691: per-request embedding_query_prefix read once and threaded to the embeds and cache key; +5 green master wave (embedding opt-out): HybridSearchOpts._embeddingOptedOut (interface field) read once per request and threaded to the cache-lookup embed and the keyword-only gate; +24 P2 explain RRF attribution stamp in rrfFusionWeighted, backlink_count stamp, explain_target stage observations, explain/explainTarget opts
+src/core/types.ts 2232 ratchet +5 System One v1 retrieval lane: SearchResult injection_p/injection_suspected, HybridSearchMeta answerability, egress_denied degraded reason; +4 System One v1: SearchResult rerank_score_kind/decide_evidence, HybridSearchMeta decide/rerank; +3 wave review: PAGE_SORT_SQL.updated_asc source_id + id tiebreakers (total order under federated scopes); +5 #4881: OntologyReadOpts extends PageReadScope doc; +3 #4857: PAGE_SORT_SQL.slug total-order tiebreaker comment; grown v0.46.26.0 megawave: EvidenceOpts, pacing/usage result fields, PageFilters growth (#4352 #4218); wave-k: +9 SalienceOpts/AnomaliesOpts source scope (#3867); +20 2026-09 adversarial batch 2: keyword_relaxed_carried stage + relaxed_dropped meta field docs; +16 2026-09 fix wave: SearchResult.keyword_relaxed field + full fusion-demotion doc; (#3867); +9: #4648 rerank_passthrough degraded stage + empty_result_set/malformed_shape reasons | merged v0.48.1.0 true-up; +master v0.48 merge true-up (reranker succession: no_key preflight, reranker_skipped stage, readiness); corrective release: shared internal PageReadScope and PageReadPolicy; ranker wave v0.48.4.0: HybridSearchMeta relational_rerank_pin / keyword_arm_confidence / metadata_boost_gate + SearchResult.relational_pinned (+48 over master's peel); +12: #4681 Page.updated_at_iso + keyset cursor precision docs; #5105: canonical page state shared module and transaction/snapshot delegates; #5105: public page revision fields; upstream integration: preserve independently reviewed master additions with branch facade extraction; #5252 wave: typed vector pool and readiness metadata; merged company ingestion/schema routing changes; retired provider integration removed; +1 write-path wave: 'created' effective-date source; +3 read-path wave: rerank_failed degraded stage + budget reason (closed vocabularies) and its recall classification note; +8 fw3-search: SearchOpts.source_boosts + keyword_arm_failed/title_arm_failed stages; +2 wave-2 W4: ChunkInput.embedding_input_hash (#5553); fix wave 3 x fix wave 2 (v0.60.5.0) composition: +2 at the merge; evidence delivery: optional SearchResult.delivered (+2; shape in search/evidence-delivery.ts); +2 eval wave N1-3: OntologyReadOpts.visibility (remote world-only ontology reads); +4 #5827: GraphNode.source_id and GraphPath from_source_id/to_source_id; +2 #5824: SearchOpts.vectorLegacyGuard rollback switch; +7 #5154: PageFilters.listColumnsOnly (interface field); +11 Foundations 1 F1b: WriteAttributionView + AttributedPageVersion (get_versions / get_write_attribution read shapes); +1 #5988: SearchResult.stale carries the held-file detail (interface field); +6 retrieval feedback: SearchResult feedback_boost/content_hash/relational_path_edges stamps and RelationalFanoutRow.path_edges (interface fields); +2 RelationalFanoutOpts.wide (interface field); 1 GBRA-49: temporal annotation field on link rows; 1 GBRA-49: temporal annotation field on link rows; 1 GBRA-49: temporal annotation field on link rows; +44 P7 ChainHopOpts/ChainHopEdge chain-hop contract types; P7 SearchResult.relational evidence + RelationalEvidence type + relational_plan meta + planner per-call overrides; +2 P7 SearchOpts.relationalChainSlots per-call override; +1 P7 ChainHopOpts.temporal (relationship-validity policy per hop); P3 x P7 (v0.60.60.0) composition: deltas re-summed at the merge; 1 GBRA-49: temporal annotation field on link rows; +44 P7 ChainHopOpts/ChainHopEdge chain-hop contract types; P7 SearchResult.relational evidence + RelationalEvidence type + relational_plan meta + planner per-call overrides; +2 P7 SearchOpts.relationalChainSlots per-call override; +1 P7 ChainHopOpts.temporal (relationship-validity policy per hop); +1 green master wave: embedding_disabled degraded reason (closed vocabulary); +21 P2 SearchResult explain fields (rrf attribution, blend_norm_rrf, score_details, backlink_count) + RrfAttribution (interface fields)
src/core/minions/queue.ts 2528 ratchet grown #4078 + megawave probe-liveness unlatch (#4310) + master private-queue lifecycle: recovery classifier + monotonic lease; security: durable queued authority and confined filesystem dispatch; master integration: grown #4078 + megawave probe-liveness unlatch (#4310) + master private-queue lifecycle: recovery classifier + monotonic lease; harness support: boundary wiring to shared grants, isolated setup, withdrawal and delegated guards; merged v0.49: durable authority and delegated admission both enforced; typed readiness, configuration-blocked lifecycle and bounded release; +9: prune archives completed dream synthesis keys; +18 Lane D: deferJob (a deferral returns a job to delayed with no attempt counted and no stacktrace growth); the ceiling had 17 lines of slack; +5 agent operator follow-up Item 5 merged over master: claim-time spend fence token and legacy_default stamp (logic in minions/spend-authorization.ts)
src/commands/init.ts 1878 ratchet +2 fix wave 9 lane F #5253: leaving deferred setup also clears the DB-plane embedding_disabled row (both init branches); grown v0.46.x keyless capability notices; grown db-availability loop: initPostgresCore typed-failure extraction + --prefer-postgres ladder hook + pgvector rethrow fix; +1 at megawave/wave-k merge; +master-merge true-up; wave-k: merge; #3753 --force re-init engine-preservation guard; +1 wave-k merge-union brace (--prefer-postgres close); +10 ambient-writeback WP8: runWritebackNudge consent ask in both engine epilogues (logic lives in core/onboard/writeback-nudge.ts); +4: v0.48.2 reranker readiness at init + test seam; +1: v0.48.2 provider normalization; +3: v0.48.2 review fixes; master integration: +2: preserve typed PGLite busy errors in schema-only init; shared-skills integration on company-ingestion base; retired provider integration removed; retain stored-vector identity on re-init; -14: first-run bundle + quickstart registration helpers live in init-first-run.ts (writeback/skills asks folded into the bundle); +5 agent operator follow-up Item 2: --surface flag (value flag, parse, help line, module-level registration surface, type import) for the printed harness registration; +2 fix wave lane B3: both engine paths stamp a database init created as a fresh install for the behavior_changes notice (core/behavior-change-notice.ts)
src/commands/integrations.ts 1739 ratchet grown v0.46.26.0 megawave (#4039 connector compat) + 1 nosemgrep dataflow annotation (path-traversal audit); wave-k: exported heartbeatPath seam (#3900)
@@ -36,10 +36,10 @@ src/core/embedding-migration.ts 1569 ratchet new row: crossed 1500 in v0.46.25.0
src/core/github-source.ts 1530 ratchet new row: crossed the 1500 unlisted cap in v0.46.23.0 review fix wave (scope-state gating, client hardening, symlink containment); merged reliability/shared-skills source integration; managed sweep lease wrapper; fix wave 3 lane A: config parser peeled to github-source-config.ts (-47), +account pin wiring and pinned-installation refresh
src/commands/hook.ts 1915 ratchet cathedral-5 heartbeat extraction offsets part of the BrainBench-seam growth; grown v0.46.26.0 megawave hooks-ipc (#4245); +108 monthly backup check: banner + gated session-start note + detached spawn (backup/status-file readers); +28 ship-review egress hardening: per-harness capture dispatch (capture-spec), memorable gate + receipt + relay block, fail-closed unscanned/newest-guess skips; +79 ambient-writeback WP4: hookStop bank step (gate -> bankWritebackTurn -> IPC flush; gate/bank logic live in core/facts + corpus-segments); +41 adversarial fix wave: wide-tail retry when the 128KB window misses the user turn, by-design heartbeat outcome classes, source-in-name banking; +11 #5413 session-end skips claude-cli self-transcripts; +11 #5701: hook lanes pass allowOversize so a long session reaches the bounded tail read; +12 core memory: user-prompt context-pressure notice wiring (logic in core/context/pressure.ts; session-start composition in core/context/session-start-output.ts)
src/core/chunkers/code.ts 1588 ratchet new row: crossed the 1500 unlisted cap in v0.46.26.0 megawave (decorated-python defs #3821, version-gate + timeout chunker fixes); grown wave-g (#4511): named defs never folded into merged chunks; grown #4669: skip WASM parse for languages without TOP_LEVEL_TYPES; +6 N13-1: CodeChunkMetadata.definesFunction field + merge-guard stamp (predicate lives in def-types.ts)
-src/core/config.ts 1877 ratchet +8 #5988: sync.holds/hold_cap/hold_escalate_count/hold_escalate_pct/parser_regression key registration (read by persistence/sync-holds.ts); +3 agent operator wave A4: GBrainConfig.consent file-plane slot + 2 consent.preapprove.* key rows (logic in core/consent.ts); +1 System One v1: decide.* key prefix (validated by ai/decide/config.ts); new row: crossed the 1500 unlisted cap in v0.46.26.0 megawave (spend-controls hint #3703, config-set validation); +3 wave G #3974: sync.include_working_tree key; grown wave-g (#4540 #4494 #4415): extractor caps + intent-pattern config keys; +1 chat-connectors: connectors. config prefix; wave-k: config-table snapshot serving the DB-plane reads (#3980 + #2119 merge); +8: loadConfig hook for ~/.gbrain/.env, loader lives in gbrain-env-file.ts (#3893); +17: litellm/together key-fold slots (#3904 reimpl: two GBrainConfig fields + KNOWN_CONFIG_KEYS rows); +1: link_resolution.cross_source key (#3908); +4 v0.47 gmail-loops: loops.extraction_enabled key; +1: pricing.overrides key (#4633 adoption); +7 #4667 adoption: sync.exclude key registration; +4: eval fix wave keys (quote_verify + 3 rescue knobs); +memorable file-plane key registration (integrations.memorable.enabled + consent-event doc); +33 ambient-writeback: memory.* + brain.audience key registration + GBrainConfig.memory mirror slot (resolvers live in facts/writeback-config.ts); +38 2026-08 wave: retrieval_reflex_volunteer key + env mapping (volunteer-arm kill switch) + E5a registration of the 10 adaptive_return*/autocut*/crag_* search (incl. adversarial batch isEnvDisabled dedup); ambient-writeback (master merge): facts/writeback-config.ts); new row: crossed the 1500 unlisted cap in v0.46.26.0 megawave; prior growth: sync/intent/chat-connectors/litellm/pricing/loops key folds; +34: #4702 content_sanity.disabled_patterns (type + DB-plane parse/merge + key registration); composition true-up (fix-wave multi-train) | merged v0.48.1.0: master #4788 writeback keys + wave #4702/#4748 keys; master: | merged v0.48.1.0 true-up; ranker wave v0.48.4.0: +4 KNOWN_CONFIG_KEYS rows (+8); +5 #4895: CWD_DOTENV_FILES gains the per-NODE_ENV .local variants Bun auto-loads; +2 #5003: sync.include_hidden key registration; +57 #4605: search.* registry reconciled to the keys mode.ts reads (+20 knob rows, +4 direct-read singletons) + GBrainConfig.search slot + adaptive_return* DB-plane merge; +2 pre-landing review: fts.reindex_in_progress key registration (#4795 marker escape hatch); +4 #4987: auto_timeline key registration (the documented off switch was rejected as unknown); lowered to 1793: GHSA wave v0.50.5.0 moved CWD_DOTENV_FILES + dotenvValuesForKey into core/env-trust.ts (-49, re-exported); re-summed to the merged line count after merging master v0.50.2.0 (#5122) with the v0.50.5.0 security wave; fix wave 3 x fix wave 2 (v0.60.5.0) composition: +1 at the merge; evidence delivery: 5 registered config keys + comment (+7); +2 #5691: embedding_query_prefix key registration; evidence delivery auto v2: search.return_budget_conversation key row (+1); +1 #5836: facts.entity_inference key row; +6 #5824: search.vector_legacy_guard key row + GBrainConfig.search slot + DB-plane merge; +3 wave 8 lane D1 #5885: takes.auto_embed key row; +3 #5232: GBrainConfig.persistence.write_wait_ms file-plane slot + key row (resolver in persistence/write-wait.ts); +2 F4b: planner.* and import.analyze_every_pages keys; +3 cat40 cost wave C1 (garrytan/gbrain-evals#57 follow-ups): mcp.result_rows GBrainConfig slot + key row (resolver in mcp/result-rows.ts); v0.60.46.0 merge: both waves' +3 compose (1824 + 3 = 1827 measured); +4 #5984: sync.bulk, sync.bulk_size, sync.bulk_max_txn_ms known keys; v0.60.48.0 merge: #5984 growth re-summed over v0.60.47.0 (1838 measured); +3 retrieval feedback: the feedback keys in KNOWN_CONFIG_KEYS; 2 engine graduation (GBRA-50 G3): GBrainConfig.migrate.graduation file-plane opt-out slot + key row (read by commands/migrate-graduation.ts); P3 x engine graduation composition: both deltas re-summed at the merge; 2 Lane D: facts.drain_budget_usd, facts.drain_daily_budget_usd, facts.drain_max_jobs key registration (validated in core/facts/drain.ts); +2 engine graduation (GBRA-50 G3): GBrainConfig.migrate.graduation file-plane opt-out slot + key row (read by commands/migrate-graduation.ts); P3 x foundations-2 composition: deltas re-summed at the merge; 2 Lane D: facts.drain_budget_usd, facts.drain_daily_budget_usd, facts.drain_max_jobs key registration (validated in core/facts/drain.ts); +2 engine graduation (GBRA-50 G3): GBrainConfig.migrate.graduation file-plane opt-out slot + key row (read by commands/migrate-graduation.ts); +1 GBRA-49: graph.* key prefix (graph.edge_validity, read by link-validity.ts); P3 x P1 (v0.60.57.0) composition: deltas re-summed at the merge; 2 Lane D: facts.drain_budget_usd, facts.drain_daily_budget_usd, facts.drain_max_jobs key registration (validated in core/facts/drain.ts); +2 engine graduation (GBRA-50 G3): GBrainConfig.migrate.graduation file-plane opt-out slot + key row (read by commands/migrate-graduation.ts); +1 GBRA-49: graph.* key prefix (graph.edge_validity, read by link-validity.ts); +3 P7 search.relational_planner / search.relational_orient_onehop key registration; +2 P7 search.relational_chain_slots key registration; P3 x P7 (v0.60.60.0) composition: deltas re-summed at the merge; 2 Lane D: facts.drain_budget_usd, facts.drain_daily_budget_usd, facts.drain_max_jobs key registration (validated in core/facts/drain.ts); +2 engine graduation (GBRA-50 G3): GBrainConfig.migrate.graduation file-plane opt-out slot + key row (read by commands/migrate-graduation.ts); +1 GBRA-49: graph.* key prefix (graph.edge_validity, read by link-validity.ts); +3 P7 search.relational_planner / search.relational_orient_onehop key registration; +2 P7 search.relational_chain_slots key registration; +3 agent operator follow-up Item 2: mcp.allow_session_widen (GBrainConfig.mcp slot + known key); P3 x aow-followup composition: deltas re-summed at the merge; 2 Lane D: facts.drain_budget_usd, facts.drain_daily_budget_usd, facts.drain_max_jobs key registration (validated in core/facts/drain.ts); +2 engine graduation (GBRA-50 G3): GBrainConfig.migrate.graduation file-plane opt-out slot + key row (read by commands/migrate-graduation.ts); +1 GBRA-49: graph.* key prefix (graph.edge_validity, read by link-validity.ts); +3 P7 search.relational_planner / search.relational_orient_onehop key registration; +2 P7 search.relational_chain_slots key registration; +3 agent operator follow-up Item 2: mcp.allow_session_widen (GBrainConfig.mcp slot + known key); +2 entity mention index: mentions.auto_link, mentions.entity_types, mentions.ignore key rows (resolver in core/mentions/policy.ts); cat40 entity wave merge with v0.60.61.0 (1853 measured); P3 x cat40-entity-wave composition: deltas re-summed at the merge; +6 fix wave lane B3: chat_fallback_on_refusal (GBrainConfig slot, GBRAIN_CHAT_FALLBACK_ON_REFUSAL env fold, known key); +2 W-B4: shared_skills.inventory.* known keys (logic in shared-skills/inventory-limits.ts); +2 fix wave 9 lane B #4921: ai.chat.per_turn_timeout_ms known key; +1 wave 9 lane W #5363: cycle.consolidate.cluster_threshold key row; +1 #5984 lanes: sync.lanes key registration; +2 P8: dream.quote_verify and think.quote_verify known keys; +2 P8: GBrainConfig.mcp.advertised_surface interface slot (resolver in mcp/surface.ts); +3 core memory: memory.core.* and memory.pressure.* known keys; +2 P2 extraction.date_grounding / facts.attribution / search.hub_dampening keys
+src/core/config.ts 1876 ratchet +8 #5988: sync.holds/hold_cap/hold_escalate_count/hold_escalate_pct/parser_regression key registration (read by persistence/sync-holds.ts); +3 agent operator wave A4: GBrainConfig.consent file-plane slot + 2 consent.preapprove.* key rows (logic in core/consent.ts); +1 System One v1: decide.* key prefix (validated by ai/decide/config.ts); new row: crossed the 1500 unlisted cap in v0.46.26.0 megawave (spend-controls hint #3703, config-set validation); +3 wave G #3974: sync.include_working_tree key; grown wave-g (#4540 #4494 #4415): extractor caps + intent-pattern config keys; +1 chat-connectors: connectors. config prefix; wave-k: config-table snapshot serving the DB-plane reads (#3980 + #2119 merge); +8: loadConfig hook for ~/.gbrain/.env, loader lives in gbrain-env-file.ts (#3893); +17: litellm/together key-fold slots (#3904 reimpl: two GBrainConfig fields + KNOWN_CONFIG_KEYS rows); +1: link_resolution.cross_source key (#3908); +4 v0.47 gmail-loops: loops.extraction_enabled key; +1: pricing.overrides key (#4633 adoption); +7 #4667 adoption: sync.exclude key registration; +4: eval fix wave keys (quote_verify + 3 rescue knobs); +memorable file-plane key registration (integrations.memorable.enabled + consent-event doc); +33 ambient-writeback: memory.* + brain.audience key registration + GBrainConfig.memory mirror slot (resolvers live in facts/writeback-config.ts); +38 2026-08 wave: retrieval_reflex_volunteer key + env mapping (volunteer-arm kill switch) + E5a registration of the 10 adaptive_return*/autocut*/crag_* search (incl. adversarial batch isEnvDisabled dedup); ambient-writeback (master merge): facts/writeback-config.ts); new row: crossed the 1500 unlisted cap in v0.46.26.0 megawave; prior growth: sync/intent/chat-connectors/litellm/pricing/loops key folds; +34: #4702 content_sanity.disabled_patterns (type + DB-plane parse/merge + key registration); composition true-up (fix-wave multi-train) | merged v0.48.1.0: master #4788 writeback keys + wave #4702/#4748 keys; master: | merged v0.48.1.0 true-up; ranker wave v0.48.4.0: +4 KNOWN_CONFIG_KEYS rows (+8); +5 #4895: CWD_DOTENV_FILES gains the per-NODE_ENV .local variants Bun auto-loads; +2 #5003: sync.include_hidden key registration; +57 #4605: search.* registry reconciled to the keys mode.ts reads (+20 knob rows, +4 direct-read singletons) + GBrainConfig.search slot + adaptive_return* DB-plane merge; +2 pre-landing review: fts.reindex_in_progress key registration (#4795 marker escape hatch); +4 #4987: auto_timeline key registration (the documented off switch was rejected as unknown); lowered to 1793: GHSA wave v0.50.5.0 moved CWD_DOTENV_FILES + dotenvValuesForKey into core/env-trust.ts (-49, re-exported); re-summed to the merged line count after merging master v0.50.2.0 (#5122) with the v0.50.5.0 security wave; fix wave 3 x fix wave 2 (v0.60.5.0) composition: +1 at the merge; evidence delivery: 5 registered config keys + comment (+7); +2 #5691: embedding_query_prefix key registration; evidence delivery auto v2: search.return_budget_conversation key row (+1); +1 #5836: facts.entity_inference key row; +6 #5824: search.vector_legacy_guard key row + GBrainConfig.search slot + DB-plane merge; +3 wave 8 lane D1 #5885: takes.auto_embed key row; +3 #5232: GBrainConfig.persistence.write_wait_ms file-plane slot + key row (resolver in persistence/write-wait.ts); +2 F4b: planner.* and import.analyze_every_pages keys; +3 cat40 cost wave C1 (garrytan/gbrain-evals#57 follow-ups): mcp.result_rows GBrainConfig slot + key row (resolver in mcp/result-rows.ts); v0.60.46.0 merge: both waves' +3 compose (1824 + 3 = 1827 measured); +4 #5984: sync.bulk, sync.bulk_size, sync.bulk_max_txn_ms known keys; v0.60.48.0 merge: #5984 growth re-summed over v0.60.47.0 (1838 measured); +3 retrieval feedback: the feedback keys in KNOWN_CONFIG_KEYS; 2 engine graduation (GBRA-50 G3): GBrainConfig.migrate.graduation file-plane opt-out slot + key row (read by commands/migrate-graduation.ts); P3 x engine graduation composition: both deltas re-summed at the merge; 2 Lane D: facts.drain_budget_usd, facts.drain_daily_budget_usd, facts.drain_max_jobs key registration (validated in core/facts/drain.ts); +2 engine graduation (GBRA-50 G3): GBrainConfig.migrate.graduation file-plane opt-out slot + key row (read by commands/migrate-graduation.ts); P3 x foundations-2 composition: deltas re-summed at the merge; 2 Lane D: facts.drain_budget_usd, facts.drain_daily_budget_usd, facts.drain_max_jobs key registration (validated in core/facts/drain.ts); +2 engine graduation (GBRA-50 G3): GBrainConfig.migrate.graduation file-plane opt-out slot + key row (read by commands/migrate-graduation.ts); +1 GBRA-49: graph.* key prefix (graph.edge_validity, read by link-validity.ts); P3 x P1 (v0.60.57.0) composition: deltas re-summed at the merge; 2 Lane D: facts.drain_budget_usd, facts.drain_daily_budget_usd, facts.drain_max_jobs key registration (validated in core/facts/drain.ts); +2 engine graduation (GBRA-50 G3): GBrainConfig.migrate.graduation file-plane opt-out slot + key row (read by commands/migrate-graduation.ts); +1 GBRA-49: graph.* key prefix (graph.edge_validity, read by link-validity.ts); +3 P7 search.relational_planner / search.relational_orient_onehop key registration; +2 P7 search.relational_chain_slots key registration; P3 x P7 (v0.60.60.0) composition: deltas re-summed at the merge; 2 Lane D: facts.drain_budget_usd, facts.drain_daily_budget_usd, facts.drain_max_jobs key registration (validated in core/facts/drain.ts); +2 engine graduation (GBRA-50 G3): GBrainConfig.migrate.graduation file-plane opt-out slot + key row (read by commands/migrate-graduation.ts); +1 GBRA-49: graph.* key prefix (graph.edge_validity, read by link-validity.ts); +3 P7 search.relational_planner / search.relational_orient_onehop key registration; +2 P7 search.relational_chain_slots key registration; +3 agent operator follow-up Item 2: mcp.allow_session_widen (GBrainConfig.mcp slot + known key); P3 x aow-followup composition: deltas re-summed at the merge; 2 Lane D: facts.drain_budget_usd, facts.drain_daily_budget_usd, facts.drain_max_jobs key registration (validated in core/facts/drain.ts); +2 engine graduation (GBRA-50 G3): GBrainConfig.migrate.graduation file-plane opt-out slot + key row (read by commands/migrate-graduation.ts); +1 GBRA-49: graph.* key prefix (graph.edge_validity, read by link-validity.ts); +3 P7 search.relational_planner / search.relational_orient_onehop key registration; +2 P7 search.relational_chain_slots key registration; +3 agent operator follow-up Item 2: mcp.allow_session_widen (GBrainConfig.mcp slot + known key); +2 entity mention index: mentions.auto_link, mentions.entity_types, mentions.ignore key rows (resolver in core/mentions/policy.ts); cat40 entity wave merge with v0.60.61.0 (1853 measured); P3 x cat40-entity-wave composition: deltas re-summed at the merge; +6 fix wave lane B3: chat_fallback_on_refusal (GBrainConfig slot, GBRAIN_CHAT_FALLBACK_ON_REFUSAL env fold, known key); +2 W-B4: shared_skills.inventory.* known keys (logic in shared-skills/inventory-limits.ts); +2 fix wave 9 lane B #4921: ai.chat.per_turn_timeout_ms known key; +1 wave 9 lane W #5363: cycle.consolidate.cluster_threshold key row; +1 #5984 lanes: sync.lanes key registration; +2 P8: dream.quote_verify and think.quote_verify known keys; +2 P8: GBrainConfig.mcp.advertised_surface interface slot (resolver in mcp/surface.ts); +3 core memory: memory.core.* and memory.pressure.* known keys; +1 P2 extraction.date_grounding / facts.attribution keys
src/core/bootstrap/harness.ts 2711 ratchet +29 live-PGLite-serve lane: LIVE_SERVE refusal ahead of source resolution + unpinned --token hooks (CI e2e fix); +46 wave review: resolveHookSource dep (serve-parity resolver + federated grant), --source shape validation, loud SOURCE_UNRESOLVED instead of a silent 'default'; +10: #4574 parseCodexBlockBearer http_headers shape + legacy bearer_token fallback; +4 at megawave/wave-k merge; +codex hooks lane: step-7 codex hooks.json + config.toml trust pair, removeHarness arm; +234 ambient-writeback WP3: kind:'instructions' targets (plan/apply/converge-off/remove/status probes, OV-A4 override pre-check) — splice/render mechanics live in instructions-block.ts; +59 adversarial fix wave: registrar-mode block suppression, converge-failure receipt tracking, MCP-confirmed guard before block install; +26 round-3 fixes: codex-lane MCP-confirmed guard + smoke-rollback block strip; master: | merged v0.48.1.0 true-up; +41 #4897 resolveImplicitSource dep + defaultResolveImplicitSource: hooks/token/receipt bind to the serve's implicit default source when --source is omitted; +23 #4586 statusHarness live claude-code mcp verdict (URL mismatch or same-scope non-HTTP registration reads failed, receipt untouched); shared-skills integration on company-ingestion base; +18 #5671: logAmbientPostureNotes helper (registrar note moved out of applyHarness + pre-consent warning when an explicit private facts default meets the HTTP harness; text shared with doctor in facts/writeback-config.ts); +24 #5893: rotation grant carry wiring and its rotationCarry/withheldOperationsNote helpers (carry rules live in token-mint.ts carryLegacyGrant); +6 #5878: --refresh-skills flag and status epoch line (refresh logic lives in harness-skills.ts); +7 #4618 seat: HarnessFlags.seat field, --seat/--no-seat parse via hooks.ts parseSeatFlags, GBRAIN_SEAT in the hook env
src/core/oauth-provider.ts 1236 ratchet new row: crossed the 1500 unlisted cap absorbing #3819 (DCR 400 invalid_client_metadata + scope filtering + custom-scheme redirect_uris + pseudo-scheme guard); merged v0.49: transactional grant enforcement shared with hosted grant policies; +1 #5222 resourceUrl option
src/core/ops/pages.ts 663 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)
-src/core/search/mode.ts 1623 ratchet +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); +29 P2 hub_dampening knob (bundle field, overrides, per-call, pick, knobsHash hd= part, config key)
+src/core/search/mode.ts 1594 ratchet +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)
src/commands/eval-longmemeval.ts 1519 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)
src/commands/doctor/checks/extraction-sync.ts 1503 ratchet 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
diff --git a/src/commands/doctor/checks/ranking-extraction.ts b/src/commands/doctor/checks/ranking-extraction.ts
index aa129890d9..10e5725299 100644
--- a/src/commands/doctor/checks/ranking-extraction.ts
+++ b/src/commands/doctor/checks/ranking-extraction.ts
@@ -1,58 +1,14 @@
/**
- * Ranking and extraction settings: the brain's inbound-degree shape next to
- * the resolved hub-dampening half degree, and which LLM extraction prompts
- * resolve relative dates against the source's observation date.
+ * Extraction settings: which LLM extraction prompts resolve relative dates
+ * against the source's observation date.
*
- * Both are informational (status ok): they report state and the next step,
- * never a recommended value — a degree histogram is not a relevance prior.
+ * Informational (status ok): it reports state and the next step.
*/
import type { Check } from '../../doctor.ts';
import { connectedEngine, type DoctorContext, type DoctorEntry } from '../context.ts';
-import { checkError } from '../check-fix.ts';
-import { loadSearchModeConfig, resolveSearchMode } from '../../../core/search/mode.ts';
import { getExtractorVariant, isConsumerDateGroundingOn } from '../../../core/facts/extract.ts';
-async function runHubDegreeShape(ctx: DoctorContext): Promise<Check[]> {
- const engine = connectedEngine(ctx);
- const checks: Check[] = [];
- try {
- const modeInput = await loadSearchModeConfig(engine);
- const halfDegree = resolveSearchMode({ mode: modeInput.mode, overrides: modeInput.overrides }).hub_dampening;
- const [row] = await engine.executeRaw<{ pages: number; p50: number | null; p90: number | null; p99: number | null; max: number | null; above: number }>(
- `WITH d AS (
- SELECT p.id, COUNT(DISTINCT l.from_page_id)::int AS n
- FROM pages p LEFT JOIN links l ON l.to_page_id = p.id AND l.from_page_id <> p.id
- AND l.link_source IS DISTINCT FROM 'mentions'
- WHERE p.deleted_at IS NULL GROUP BY p.id)
- SELECT COUNT(*)::int AS pages,
- percentile_disc(0.5) WITHIN GROUP (ORDER BY n) AS p50,
- percentile_disc(0.9) WITHIN GROUP (ORDER BY n) AS p90,
- percentile_disc(0.99) WITHIN GROUP (ORDER BY n) AS p99,
- MAX(n) AS max,
- COUNT(*) FILTER (WHERE $1::float8 > 0 AND n > $1::float8 + 1)::int AS above
- FROM d`, [typeof halfDegree === 'number' ? halfDegree : 0]);
- const shape = `inbound links per page p50 ${row?.p50 ?? 0}, p90 ${row?.p90 ?? 0}, p99 ${row?.p99 ?? 0}, max ${row?.max ?? 0} over ${row?.pages ?? 0} pages`;
- const setting = typeof halfDegree === 'number'
- ? `hub dampening at half degree ${halfDegree}: ${row?.above ?? 0} page(s) keep less than half of their backlink/graph lift.`
- : 'hub dampening is off (search.hub_dampening).';
- checks.push({
- name: 'hub_degree_shape',
- status: 'ok',
- message: `${shape}; ${setting} To see whether hub pages crowd a query, run gbrain search "<query>" --explain and read each row's backlink inbound count and hub weight.`,
- });
- } catch {
- checks.push(checkError('hub_degree_shape', 'read the inbound link degree shape'));
- }
- return checks;
-}
-
-export const hubDegreeShapeEntry: DoctorEntry = {
- name: 'hub_degree_shape',
- emits: ['hub_degree_shape'],
- run: runHubDegreeShape,
-};
-
/** Prompts grounded by default with fact extraction, and the ones that need the setting set on explicitly. */
const DEFAULT_CONSUMERS = 'fact extraction, dream synthesis, extract_atoms and propose_takes';
const OPT_IN_LABEL = 'life chronicle events';
diff --git a/src/commands/doctor/registry.ts b/src/commands/doctor/registry.ts
index a1ac7c4461..466e154057 100644
--- a/src/commands/doctor/registry.ts
+++ b/src/commands/doctor/registry.ts
@@ -62,7 +62,7 @@ import {
staleMentionsEntry,
timelineHistoryEntry,
} from './checks/graph-health.ts';
-import { extractionDateGroundingEntry, hubDegreeShapeEntry } from './checks/ranking-extraction.ts';
+import { extractionDateGroundingEntry } from './checks/ranking-extraction.ts';
import {
integrityEntry,
jsonbIntegrityEntry,
@@ -140,7 +140,6 @@ export const DOCTOR_CHECK_REGISTRY: readonly DoctorEntry[] = [
orphanRatioEntry,
staleMentionsEntry,
timelineHistoryEntry,
- hubDegreeShapeEntry,
extractionDateGroundingEntry,
integrityEntry,
jsonbIntegrityEntry,
diff --git a/src/core/config.ts b/src/core/config.ts
index a02e954561..e959c8d86c 100644
--- a/src/core/config.ts
+++ b/src/core/config.ts
@@ -1374,7 +1374,6 @@ export const KNOWN_CONFIG_KEYS: readonly string[] = [
'search.keyword_arm_confidence_floor',
// Ranker wave (Phase E3): metadata boost gate — `lexical` skips post-fusion metadata boosts when the vector arm was the only voter (mode.ts reads; `always` | `lexical`).
'search.metadata_boost_gate',
- 'search.hub_dampening',
'search.crag_escalation',
'search.crag_think',
// Evidence delivery (search/evidence-delivery.ts): default unit (auto),
diff --git a/src/core/doctor-categories.ts b/src/core/doctor-categories.ts
index 95ed65ad2b..ab833507bb 100644
--- a/src/core/doctor-categories.ts
+++ b/src/core/doctor-categories.ts
@@ -118,9 +118,7 @@ export const BRAIN_CHECK_NAMES: ReadonlySet<string> = new Set([
'grade_confidence_drift',
'graph_coverage',
'graph_signals_coverage',
- // Ranking/extraction settings: degree shape next to search.hub_dampening,
- // and which extraction prompts resolve relative dates (informational).
- 'hub_degree_shape',
+ // Which extraction prompts resolve relative dates (informational).
'extraction_date_grounding',
'hidden_by_search_policy',
'image_assets',
diff --git a/src/core/search/explain-formatter.ts b/src/core/search/explain-formatter.ts
index 3278827f7c..b103b33c66 100644
--- a/src/core/search/explain-formatter.ts
+++ b/src/core/search/explain-formatter.ts
@@ -65,7 +65,7 @@ export function formatResultExplain(
if (result.backlink_boost !== undefined && result.backlink_boost !== 1.0) {
anyBoost = true;
- const inbound = result.backlink_count !== undefined ? ` (${result.backlink_count} inbound${result.backlink_hub_weight !== undefined ? `, hub weight ${fmt(result.backlink_hub_weight)}` : ''})` : '';
+ const inbound = result.backlink_count !== undefined ? ` (${result.backlink_count} inbound)` : '';
lines.push(` + backlink ×${fmt(result.backlink_boost)}${inbound}`);
}
if (result.salience_boost !== undefined && result.salience_boost !== 1.0) {
@@ -236,13 +236,13 @@ export function buildScoreDetails(result: SearchResult): ScoreDetails {
const clean = Object.fromEntries(Object.entries(detail).filter(([, v]) => v !== undefined));
boosts[name] = { factor, ...clean };
};
- add('backlink', result.backlink_boost, { inbound: result.backlink_count, hub_weight: result.backlink_hub_weight });
+ add('backlink', result.backlink_boost, { inbound: result.backlink_count });
add('salience', result.salience_boost);
add('recency', result.recency_boost);
add('chronicle', result.chronicle_boost);
add('title', result.title_match_boost);
- add('adjacency', result.graph_adjacency_boost, { hits: result.graph_adjacency_hits, hub_weight: result.graph_hub_weight });
- add('cross_source', result.graph_cross_source_boost, { other_sources: result.graph_cross_source_hits, hub_weight: result.graph_hub_weight });
+ add('adjacency', result.graph_adjacency_boost, { hits: result.graph_adjacency_hits });
+ add('cross_source', result.graph_cross_source_boost, { other_sources: result.graph_cross_source_hits });
add('session_demote', result.session_demote_factor, { prefix: result.graph_session_prefix });
add('alias_resolved', result.alias_resolved_boost);
add('supersede', result.supersede_penalty, { superseded_by: result.superseded_by });
diff --git a/src/core/search/graph-signals.ts b/src/core/search/graph-signals.ts
index 8a1793bec0..ecde80683e 100644
--- a/src/core/search/graph-signals.ts
+++ b/src/core/search/graph-signals.ts
@@ -43,7 +43,6 @@ import type { AdjacencyRow } from '../types.ts';
import type { BrainEngine } from '../engine.ts';
import { hasReadPolicy } from './read-policy-sql.ts';
import { createAuditWriter } from '../audit/audit-writer.ts';
-import { dampenBoost, hubWeight, type HubDampening } from './hub-dampening.ts';
// ===========================================================================
// Constants (D14=B halved magnitudes; the score-distribution probe feeds the
@@ -121,16 +120,6 @@ export interface GraphSignalsOpts extends PageReadPolicy {
onMeta?: (meta: GraphSignalsMeta) => void;
/** Observability sink — called once per invocation with score stats. */
onScoreDistribution?: (dist: ScoreDistribution) => void;
- /**
- * Hub dampening (hub-dampening.ts): half degree H. When set together with
- * `degrees`, each boost's excess over 1.0 is scaled by
- * hubWeight(caller-visible inbound degree, H). Undefined → undampened.
- */
- hubHalfDegree?: HubDampening;
- /** Caller-scoped inbound degree per page id (readBacklinkCounts). */
- degrees?: Map<number, number>;
- /** Called once with the number of results whose graph boost was reduced. */
- onHubDampened?: (count: number) => void;
}
// ===========================================================================
@@ -362,8 +351,6 @@ export async function applyGraphSignals(
}
const floorThreshold = opts.floorThreshold;
- const halfDegree = opts.degrees ? opts.hubHalfDegree : undefined;
- let hubDampened = 0;
for (const r of topK) {
// Floor-gate: D1=A inheritance. Below-floor results don't accumulate
@@ -373,29 +360,19 @@ export async function applyGraphSignals(
if (floorThreshold !== undefined && !(r.score >= floorThreshold)) continue;
const row = adjacency.get(r.page_id);
if (!row) continue;
- const fires = row.hits >= ADJACENCY_MIN_HITS || row.cross_source_hits >= CROSS_SOURCE_MIN_HITS;
- const degree = opts.degrees?.get(r.page_id) ?? 0;
- const weight = fires ? hubWeight(degree, halfDegree) : 1;
if (row.hits >= ADJACENCY_MIN_HITS) {
- const factor = dampenBoost(ADJACENCY_BOOST, degree, halfDegree);
- r.score *= factor;
+ r.score *= ADJACENCY_BOOST;
r.graph_adjacency_hits = row.hits;
- r.graph_adjacency_boost = factor;
+ r.graph_adjacency_boost = ADJACENCY_BOOST;
meta.adjacency_fires++;
}
if (row.cross_source_hits >= CROSS_SOURCE_MIN_HITS) {
- const factor = dampenBoost(CROSS_SOURCE_BOOST, degree, halfDegree);
- r.score *= factor;
+ r.score *= CROSS_SOURCE_BOOST;
r.graph_cross_source_hits = row.cross_source_hits;
- r.graph_cross_source_boost = factor;
+ r.graph_cross_source_boost = CROSS_SOURCE_BOOST;
meta.cross_source_fires++;
}
- if (weight < 1) {
- r.graph_hub_weight = weight;
- hubDampened++;
- }
}
- opts.onHubDampened?.(hubDampened);
// ---- Session diversification (D9 single-pass Map, D11=B DEMOTE) ----
// Only fires when sessionPrefix detects a session-like pattern
diff --git a/src/core/search/hub-dampening.ts b/src/core/search/hub-dampening.ts
index 88758841eb..cc77c4d559 100644
--- a/src/core/search/hub-dampening.ts
+++ b/src/core/search/hub-dampening.ts
@@ -1,97 +1,27 @@
/**
- * hub-dampening.ts — degree-aware weight for graph-derived ranking boosts.
+ * Hub dampening: a node linked to many others carries less signal per link.
*
- * WHY. A page linked from thousands of other pages (the owner's own page, a
- * company every meeting mentions) collects graph boosts merely for being
- * popular: the backlink boost grows with ln(1 + inbound) and the adjacency /
- * cross-source signals fire whenever several top-K pages link to it, which a
- * hub satisfies by chance. The Cat 13 E1 receipt (metadata-boost-gate.ts)
- * measured exactly that intrusion. Hub dampening scales each graph boost's
- * EXCESS over 1.0 by
- *
- * hubWeight(n, H) = 1 / (1 + ((n - 1) / H)^2)
- *
- * where n is the page's caller-visible inbound degree and H is the half
- * degree: the degree at which the boost is halved. n <= 1 keeps the full
- * boost; n = H + 1 halves it; n = 3H + 1 keeps 10%. Parameterising by H (a
- * degree, not a bare coefficient c = 1/H^2) keeps the knob readable.
- *
- * Measured degree shape the candidate H values come from: a 285k-article
- * wiki-linked corpus has inbound p50 5, p90 93, p95 193, p99 607, max 35,681
- * (the top 1% of pages receive 25% of links); the shipped eval corpora top out
- * at 12. The eval tries H in {32, 100, 200, 600} against "boost removed" and
- * "boost capped" controls; `off` (no dampening) is the default until a sealed
- * held-out verdict sets it.
- *
- * Shared API (P7's relational planner imports `hubWeight`): pure, no IO.
- * Parse contract in ONE place: `normalizeHubDampening` (per-call opts and the
- * `search.hub_dampening` config key both route through it).
+ * `hubWeight(n, H) = 1 / (1 + ((max(n, 1) - 1) / H)^2)`, where H is the degree
+ * at which a boost is halved. Feed it the caller-visible degree (what the
+ * caller may read), never a global count. `'off'` or an unset H means no
+ * dampening (weight 1).
*/
-
-/** `off` = no dampening; a positive number = the half degree H. */
export type HubDampening = 'off' | number;
-/** Default until the held-out eval verdict sets one (D3: build with features off). */
-export const DEFAULT_HUB_DAMPENING: HubDampening = 'off';
-
-/** Inclusive bounds for a numeric half degree. */
-export const HUB_HALF_DEGREE_MIN = 1;
-export const HUB_HALF_DEGREE_MAX = 1_000_000;
-
-/**
- * Weight in (0, 1] for a node with `degree` links. `halfDegree` undefined,
- * `off`, or invalid → 1 (no dampening). Non-finite or negative degrees are
- * treated as 0.
- */
-export function hubWeight(degree: number, halfDegree: HubDampening | undefined): number {
- if (typeof halfDegree !== 'number' || !Number.isFinite(halfDegree) || halfDegree <= 0) return 1;
- const n = Number.isFinite(degree) && degree > 1 ? degree : 1;
- const x = (n - 1) / halfDegree;
+export function hubWeight(degree: number, h: HubDampening | undefined): number {
+ if (h === undefined || h === 'off' || !(h > 0) || !Number.isFinite(degree)) return 1;
+ const x = (Math.max(degree, 1) - 1) / h;
return 1 / (1 + x * x);
}
-/**
- * Scale a multiplicative boost's excess by the hub weight:
- * `1 + (factor - 1) * hubWeight(degree, H)`. A factor <= 1 (a demotion) is
- * returned unchanged — dampening only shrinks lifts.
- */
-export function dampenBoost(factor: number, degree: number, halfDegree: HubDampening | undefined): number {
- if (!(factor > 1)) return factor;
- return 1 + (factor - 1) * hubWeight(degree, halfDegree);
+/** Shrink a multiplicative boost toward 1 by the hub weight of its node. */
+export function dampenBoost(factor: number, degree: number, h: HubDampening | undefined): number {
+ return 1 + (factor - 1) * hubWeight(degree, h);
}
-/**
- * The ONE parse contract for `search.hub_dampening` and the per-call seam:
- * - `off` / `none` / `false` (any case) → 'off'
- * - finite number (or numeric string) in [1, 1e6] → that number
- * - anything else (0, negatives, NaN, garbage) → undefined (unset: fall
- * through to the next resolution tier — config → bundle)
- */
+/** `'off'`/false/null → 'off'; a positive number (or numeric string) → H; anything else → undefined (fall through). */
export function normalizeHubDampening(v: unknown): HubDampening | undefined {
- if (typeof v === 'string') {
- const lit = v.trim().toLowerCase();
- if (lit === 'off' || lit === 'none' || lit === 'false') return 'off';
- if (lit === '') return undefined;
- return normalizeHubDampening(Number(lit));
- }
- if (v === false) return 'off';
- if (typeof v === 'number' && Number.isFinite(v) && v >= HUB_HALF_DEGREE_MIN && v <= HUB_HALF_DEGREE_MAX) return v;
- return undefined;
-}
-
-/** knobsHash part value: `off` or the half degree with fixed precision. */
-export function hubDampeningHashPart(v: HubDampening | undefined): string {
- return typeof v === 'number' ? v.toFixed(3) : 'off';
-}
-
-/** Per-search observability stamp (`HybridSearchMeta.hub_dampening`). */
-export interface HubDampeningMeta {
- /** The resolved half degree, or `off`. */
- half_degree: HubDampening;
- /** Results whose backlink boost was reduced. */
- backlink_dampened: number;
- /** Results whose adjacency or cross-source boost was reduced. */
- graph_dampened: number;
- /** True when the degree read failed and boosts ran undampened. */
- errored: boolean;
+ if (v === 'off' || v === false || v === null) return 'off';
+ const n = typeof v === 'number' ? v : typeof v === 'string' && v.trim() !== '' ? Number(v) : NaN;
+ return Number.isFinite(n) && n > 0 ? n : undefined;
}
diff --git a/src/core/search/hybrid.ts b/src/core/search/hybrid.ts
index 686c1223af..09a42bc615 100644
--- a/src/core/search/hybrid.ts
+++ b/src/core/search/hybrid.ts
@@ -40,7 +40,6 @@ import {
type FusionListEntry,
} from './fusion-lists.ts';
import { type MetadataBoostGate } from './metadata-boost-gate.ts';
-import { type HubDampening, type HubDampeningMeta, hubWeight } from './hub-dampening.ts';
import { enforceTokenBudget } from './token-budget.ts';
import {
semanticResultCacheAvailable,
@@ -277,25 +276,19 @@ export function applyBacklinkBoost(
results: SearchResult[],
counts: Map<number, number>,
floorThreshold?: number,
- halfDegree?: HubDampening,
): void {
for (const r of results) {
if (!Number.isFinite(r.score)) continue;
if (floorThreshold !== undefined && r.score < floorThreshold) continue;
const count = counts.get(r.page_id) ?? 0;
if (count > 0) {
- // Hub dampening (hub-dampening.ts): the log-popularity lift shrinks for
- // pages whose inbound degree is far above the half degree H. `off` /
- // undefined → weight 1, byte-identical to the undampened factor.
- const weight = hubWeight(count, halfDegree);
- const factor = 1.0 + BACKLINK_BOOST_COEF * Math.log(1 + count) * weight;
+ const factor = 1.0 + BACKLINK_BOOST_COEF * Math.log(1 + count);
r.score *= factor;
// v0.40.4 attribution stamp (D12=A) — formatter reads this for
// --explain output. Stays undefined when count == 0 so the
// formatter can render "no boosts applied" honestly.
r.backlink_boost = factor;
r.backlink_count = count;
- if (weight < 1) r.backlink_hub_weight = weight;
}
}
}
@@ -538,14 +531,6 @@ export interface PostFusionOpts extends PageReadPolicy {
* downrank (correctness) still run. Undefined / false → every stage as before.
*/
skipMetadataBoosts?: boolean;
- /**
- * Hub dampening (hub-dampening.ts): the half degree H, or `off`. Scales the
- * backlink boost and the graph-signal boosts by the result's caller-visible
- * inbound degree. Resolved from ModeBundle.hub_dampening.
- */
- hubDampening?: HubDampening;
- /** Observability sink for the hub-dampening decision (always called when the metadata stages run). */
- onHubDampening?: (meta: HubDampeningMeta) => void;
}
export async function runPostFusionStages(
@@ -575,23 +560,14 @@ export async function runPostFusionStages(
// Phase E3 — metadata-axis stages gated as ONE block (see PostFusionOpts).
const metadata = opts.skipMetadataBoosts !== true;
- // Hub dampening — one caller-scoped degree map shared by the backlink and
- // graph-signal stages (readBacklinkCounts authorizes targets, contributors
- // and edge origins, so hidden links never move visible rankings).
- const hubDampening: HubDampening = opts.hubDampening ?? 'off';
- const hubMeta: HubDampeningMeta = { half_degree: hubDampening, backlink_dampened: 0, graph_dampened: 0, errored: false };
- let degrees: Map<number, number> | undefined;
-
// Backlink stage (existing behavior, preserved).
if (metadata && opts.applyBacklinks) {
try {
const pageIds = Array.from(new Set(results.map(r => r.page_id)));
- degrees = await engine.getBacklinkCounts(pageIds, policy);
- applyBacklinkBoost(results, degrees, floorThreshold, hubDampening);
- hubMeta.backlink_dampened = results.filter(r => r.backlink_hub_weight !== undefined).length;
+ const counts = await engine.getBacklinkCounts(pageIds, policy);
+ applyBacklinkBoost(results, counts, floorThreshold);
} catch {
// Non-fatal; preserves the existing pre-v0.29.1 contract.
- if (hubDampening !== 'off') hubMeta.errored = true;
}
}
@@ -663,30 +639,17 @@ export async function runPostFusionStages(
if (metadata && opts.graphSignalsEnabled) {
try {
const { applyGraphSignals } = await import('./graph-signals.ts');
- // Dampening needs degrees; when the backlink stage did not fetch them,
- // fetch once here. A failed read fails open (undampened boosts).
- if (hubDampening !== 'off' && degrees === undefined) {
- try {
- degrees = await engine.getBacklinkCounts(Array.from(new Set(results.map(r => r.page_id))), policy);
- } catch {
- hubMeta.errored = true;
- }
- }
await applyGraphSignals(results, engine, {
...policy,
enabled: true,
floorThreshold,
onMeta: opts.onGraphMeta,
onScoreDistribution: opts.onScoreDistribution,
- ...(hubDampening !== 'off' && degrees ? { hubHalfDegree: hubDampening, degrees, onHubDampened: (n: number) => { hubMeta.graph_dampened = n; } } : {}),
});
} catch {
// Non-fatal; preserves the per-stage contract.
}
}
- if (metadata) {
- try { opts.onHubDampening?.(hubMeta); } catch { /* meta must never break search */ }
- }
// v0.42 (T19, plan D6) — alias_resolved stage (5th post-fusion stage).
// Runs LAST so its 1.05x multiplier stacks on top of every other boost.
@@ -940,14 +903,6 @@ export interface HybridSearchOpts extends SearchOpts {
* resolver (knobs hash `mbg=`); eval A/B runs drive it here.
*/
metadataBoostGate?: MetadataBoostGate;
- /**
- * Per-call override for `search.hub_dampening` (hub-dampening.ts): `off` or
- * the half degree H. `undefined` → config/bundle; anything else is unset via
- * the ONE contract `normalizeHubDampening`. Threaded through
- * resolveSearchMode in BOTH the inner search and the cache resolver (knobs
- * hash `hd=`); eval A/B runs drive it here.
- */
- hubDampening?: HubDampening | string;
/**
* explain_target (explain-target.ts): when set, each pipeline stage records
* whether the target page was present and at what rank. Observation only —
@@ -1175,7 +1130,7 @@ export async function hybridSearch(
return searchVectorFallback(req, lexical, relationalList, postFusionOpts);
}
- const { fused, relaxedDropped, keywordArmConfidence, metadataBoostGate, hubDampening } = await fuseArms(req, {
+ const { fused, relaxedDropped, keywordArmConfidence, metadataBoostGate } = await fuseArms(req, {
vectorArms, keywordResults: lexical.keywordResults, titleResults: lexical.titleResults, relationalList,
effectiveModality, queryEmbedding, imageQueryEmbedding, unifiedDone, postFusionOpts,
});
@@ -1205,7 +1160,7 @@ export async function hybridSearch(
opts?.explainTarget?.observe('return_pool', returnPool);
return finalizeHybridResults(req, returnPool, {
relaxedDropped, adaptiveDecision, autocutDecision, relationalSlotDecision,
- relationalRerankPin, keywordArmConfidence, metadataBoostGate, hubDampening,
+ relationalRerankPin, keywordArmConfidence, metadataBoostGate,
});
}
diff --git a/src/core/search/hybrid/arms.ts b/src/core/search/hybrid/arms.ts
index 3c760c1e10..25fba1a107 100644
--- a/src/core/search/hybrid/arms.ts
+++ b/src/core/search/hybrid/arms.ts
@@ -155,8 +155,6 @@ export function buildPostFusionOpts(req: HybridRequest): PostFusionOpts {
// The raw query drives the matcher; default factor when the knob is unset.
query,
titleBoost: resolvedMode.title_boost,
- // Hub dampening (hub-dampening.ts) threaded from the resolved mode.
- hubDampening: resolvedMode.hub_dampening,
};
return postFusionOpts;
}
diff --git a/src/core/search/hybrid/cache-stages.ts b/src/core/search/hybrid/cache-stages.ts
index 9055e80b17..ccd2ce7f97 100644
--- a/src/core/search/hybrid/cache-stages.ts
+++ b/src/core/search/hybrid/cache-stages.ts
@@ -19,7 +19,6 @@ import { loadConfigWithEngine } from '../../config.ts';
import { normalizeExpansionVariantBudget } from '../fusion-lists.ts';
import { normalizeKeywordArmConfidenceFloor } from '../arm-confidence.ts';
import { normalizeMetadataBoostGate } from '../metadata-boost-gate.ts';
-import { normalizeHubDampening } from '../hub-dampening.ts';
import { normalizeRelationalRerankPin } from '../relational-rerank-pin.ts';
import { recordSearchTelemetry } from '../telemetry.ts';
import { resolveEffectiveRecency, resolveEffectiveSalience } from './effective-modes.ts';
@@ -91,8 +90,6 @@ export async function resolveCacheSearchMode(engine: BrainEngine, opts: HybridSe
keyword_arm_confidence_floor: normalizeKeywordArmConfidenceFloor(opts?.keywordArmConfidenceFloor),
// Ranker wave (Phase E3) — threaded here too so knobsHash's `mbg=` part reflects the per-call gate.
metadata_boost_gate: normalizeMetadataBoostGate(opts?.metadataBoostGate),
- // Hub dampening per-call thread-through (eval A/B); same normalizer in both resolutions.
- hub_dampening: normalizeHubDampening(opts?.hubDampening),
},
});
return { modeInputForCache, resolvedForCache, knobsHash };
diff --git a/src/core/search/hybrid/keyword-only.ts b/src/core/search/hybrid/keyword-only.ts
index 3f34a8f7e3..00d0c82fca 100644
--- a/src/core/search/hybrid/keyword-only.ts
+++ b/src/core/search/hybrid/keyword-only.ts
@@ -9,7 +9,6 @@ import { applyFeedbackStage } from '../feedback-boost.ts';
import { type PostFusionOpts, RRF_K, rrfFusionWeighted, runPostFusionStages, stampContentFlags, stampUnverifiedExtractions } from '../hybrid.ts';
import { type RelationalEvidenceSlotDecision, ensureRelationalEvidenceSlot } from '../relational-recall.ts';
import type { SearchResult } from '../../types.ts';
-import type { HubDampeningMeta } from '../hub-dampening.ts';
import type { FusionListEntry } from '../fusion-lists.ts';
import { applyAliasHop } from '../alias-hop.ts';
import { applyExactLookupTier } from '../exact-lookup.ts';
@@ -38,7 +37,6 @@ export async function searchWithoutEmbeddings(
// boost skips them (flag survives fusion's result spread).
await stampUnverifiedExtractions(engine, [...keywordResults, ...titleResults, ...relationalList], opts);
let noEmbedResults = keywordResults;
- let hubDampening: HubDampeningMeta | undefined;
const trace = opts?.explainTarget;
if (trace) {
trace.observe('arm:keyword', keywordResults);
@@ -53,7 +51,7 @@ export async function searchWithoutEmbeddings(
noEmbedResults = rrfFusionWeighted(noEmbedLists, ctBoost, opts?.explain === true || trace !== undefined);
}
if (noEmbedResults.length > 0) {
- await runPostFusionStages(engine, noEmbedResults, { ...postFusionOpts, onHubDampening: (m) => { hubDampening = m; } });
+ await runPostFusionStages(engine, noEmbedResults, postFusionOpts);
await applyIdentityBoosts(req, noEmbedResults);
noEmbedResults.sort((a, b) => b.score - a.score);
noEmbedResults = await applyFeedbackStage(engine, noEmbedResults, { reranked: false });
@@ -139,7 +137,6 @@ export async function searchWithoutEmbeddings(
? { token_budget: noEmbedBudgetMeta }
: {}),
...(noEmbedRelSlot ? { relational_evidence_slot: noEmbedRelSlot } : {}),
- ...(hubDampening ? { hub_dampening: hubDampening } : {}),
});
return noEmbedBudgeted;
}
@@ -163,7 +160,6 @@ export async function searchVectorFallback(
// no-embedding-provider path for rationale).
await stampUnverifiedExtractions(engine, [...keywordResults, ...titleResults, ...relationalList], opts);
let fallbackResults = keywordResults;
- let hubDampening: HubDampeningMeta | undefined;
const trace = opts?.explainTarget;
if (trace) {
trace.observe('arm:keyword', keywordResults);
@@ -178,7 +174,7 @@ export async function searchVectorFallback(
fallbackResults = rrfFusionWeighted(fallbackLists, ctBoost, opts?.explain === true || trace !== undefined);
}
if (fallbackResults.length > 0) {
- await runPostFusionStages(engine, fallbackResults, { ...postFusionOpts, onHubDampening: (m) => { hubDampening = m; } });
+ await runPostFusionStages(engine, fallbackResults, postFusionOpts);
await applyIdentityBoosts(req, fallbackResults);
fallbackResults.sort((a, b) => b.score - a.score);
fallbackResults = await applyFeedbackStage(engine, fallbackResults, { reranked: false });
@@ -230,7 +226,6 @@ export async function searchVectorFallback(
? { token_budget: kwBudgetMeta }
: {}),
...(kwRelSlot ? { relational_evidence_slot: kwRelSlot } : {}),
- ...(hubDampening ? { hub_dampening: hubDampening } : {}),
});
return kwBudgeted;
}
diff --git a/src/core/search/hybrid/rank.ts b/src/core/search/hybrid/rank.ts
index 63b42ebc12..4d7cd37111 100644
--- a/src/core/search/hybrid/rank.ts
+++ b/src/core/search/hybrid/rank.ts
@@ -11,7 +11,6 @@ import { type FusionListEntry, type VectorArm, composeFusionLists } from '../fus
import { type HybridRequest, applyIdentityBoosts, emitHybridMeta } from './request.ts';
import type { KeywordArmConfidenceDecision } from '../arm-confidence.ts';
import { type MetadataBoostGateDecision, decideMetadataBoosts, lexicalArmsVoted } from '../metadata-boost-gate.ts';
-import type { HubDampeningMeta } from '../hub-dampening.ts';
import { type PostFusionOpts, RRF_K, cosineReScore, resolveWalkDedupCap, rrfFusionWeighted, runPostFusionStages, stampContentFlags, stampUnverifiedExtractions, textVectorArmNonEmpty } from '../hybrid.ts';
import { type RelationalEvidenceSlotDecision, ensureRelationalEvidenceSlot } from '../relational-recall.ts';
import { type RelationalRerankPinDecision, pinRelationalRows } from '../relational-rerank-pin.ts';
@@ -162,7 +161,6 @@ export async function fuseArms(
// Phase E3 (Cat 13): metadata boost gate — decided from the SAME lexical
// lists composeFusionLists just fused (post relaxed-row demotion); image
// modality never skips (no lexical arm ran); stamped on meta even under `always`.
- let hubDampening: HubDampeningMeta | undefined;
const metadataBoostGate = decideMetadataBoosts({
gate: resolvedMode.metadata_boost_gate, modality: effectiveModality,
lexicalVoted: lexicalArmsVoted({
@@ -177,7 +175,6 @@ export async function fuseArms(
if (fused.length > 0) {
await runPostFusionStages(engine, fused, {
...postFusionOpts, skipMetadataBoosts: !metadataBoostGate.boosts_applied,
- onHubDampening: (m) => { hubDampening = m; },
});
// v0.32.x search-lite: intent exact-match boost (entity/event intents).
// No-op when boost factor is 1.0 (general intent or weighting disabled).
@@ -185,7 +182,7 @@ export async function fuseArms(
fused.sort((a, b) => b.score - a.score);
}
trace?.observe('fused', fused);
- return { fused, relaxedDropped, keywordArmConfidence, metadataBoostGate, hubDampening };
+ return { fused, relaxedDropped, keywordArmConfidence, metadataBoostGate };
}
/** A2 two-pass structural expansion (default off); grows `fused` in place and returns the dedup options. */
@@ -444,7 +441,7 @@ export async function sizeReturnPool(
export async function finalizeHybridResults(
req: HybridRequest,
returnPool: SearchResult[],
- { relaxedDropped, adaptiveDecision, autocutDecision, relationalSlotDecision, relationalRerankPin, keywordArmConfidence, metadataBoostGate, hubDampening }: {
+ { relaxedDropped, adaptiveDecision, autocutDecision, relationalSlotDecision, relationalRerankPin, keywordArmConfidence, metadataBoostGate }: {
relaxedDropped: number;
adaptiveDecision: AdaptiveReturnDecision | undefined;
autocutDecision: AutocutDecision | undefined;
@@ -452,7 +449,6 @@ export async function finalizeHybridResults(
relationalRerankPin: RelationalRerankPinDecision | undefined;
keywordArmConfidence: KeywordArmConfidenceDecision | undefined;
metadataBoostGate: MetadataBoostGateDecision;
- hubDampening?: HubDampeningMeta;
},
): Promise<SearchResult[]> {
const { engine, opts, resolvedMode, resolvedCol, limit, offset, suggestions, detailResolved, degraded } = req;
@@ -488,7 +484,6 @@ export async function finalizeHybridResults(
...(relationalRerankPin ? { relational_rerank_pin: relationalRerankPin } : {}),
...(keywordArmConfidence ? { keyword_arm_confidence: keywordArmConfidence } : {}),
metadata_boost_gate: metadataBoostGate,
- ...(hubDampening ? { hub_dampening: hubDampening } : {}),
});
return budgeted;
}
diff --git a/src/core/search/hybrid/request.ts b/src/core/search/hybrid/request.ts
index fa3f844cb8..298231d95b 100644
--- a/src/core/search/hybrid/request.ts
+++ b/src/core/search/hybrid/request.ts
@@ -16,7 +16,6 @@ import type { ResolveSearchModeInput, ResolvedSearchKnobs } from '../mode.ts';
import { normalizeExpansionVariantBudget } from '../fusion-lists.ts';
import { normalizeKeywordArmConfidenceFloor } from '../arm-confidence.ts';
import { normalizeMetadataBoostGate } from '../metadata-boost-gate.ts';
-import { normalizeHubDampening } from '../hub-dampening.ts';
import { normalizeRelationalRerankPin } from '../relational-rerank-pin.ts';
import { isRelationalQuery } from '../relational-plan.ts';
import { pushDegraded } from './degraded.ts';
@@ -136,8 +135,6 @@ export async function resolveHybridRequest(
keyword_arm_confidence_floor: normalizeKeywordArmConfidenceFloor(opts?.keywordArmConfidenceFloor),
// Ranker wave (Phase E3) — metadata boost gate per-call thread-through (eval A/B).
metadata_boost_gate: normalizeMetadataBoostGate(opts?.metadataBoostGate),
- // Hub dampening per-call thread-through (eval A/B); same normalizer in both resolutions.
- hub_dampening: normalizeHubDampening(opts?.hubDampening),
},
});
diff --git a/src/core/search/mode.ts b/src/core/search/mode.ts
index be2adfed76..3f326e6187 100644
--- a/src/core/search/mode.ts
+++ b/src/core/search/mode.ts
@@ -37,7 +37,6 @@ import { DEFAULT_RERANKER_MODEL } from '../ai/defaults.ts';
import { normalizeExpansionVariantBudget } from './fusion-lists.ts';
import { DEFAULT_RELATIONAL_RERANK_PIN, normalizeRelationalRerankPin } from './relational-rerank-pin.ts';
import { normalizeKeywordArmConfidenceFloor } from './arm-confidence.ts';
-import { DEFAULT_HUB_DAMPENING, hubDampeningHashPart, normalizeHubDampening, type HubDampening } from './hub-dampening.ts';
import {
DEFAULT_METADATA_BOOST_GATE,
normalizeMetadataBoostGate,
@@ -423,15 +422,6 @@ export interface ModeBundle {
* HybridSearchOpts.metadataBoostGate → `search.metadata_boost_gate` config → bundle. knobsHash part `mbg=`.
*/
metadata_boost_gate: MetadataBoostGate;
- /**
- * Hub dampening (hub-dampening.ts): `off`, or the half degree H at which the
- * backlink and graph-signal lifts are halved for high-degree pages. Every
- * bundle is `off` until a sealed held-out verdict sets a default.
- * Parse contract in ONE place: `normalizeHubDampening`. Override: per-call
- * HybridSearchOpts.hubDampening → `search.hub_dampening` config → bundle.
- * knobsHash part `hd=` (emitted only when not `off`).
- */
- hub_dampening: HubDampening;
}
/**
@@ -500,7 +490,6 @@ export const MODE_BUNDLES: Readonly<Record<SearchMode, Readonly<ModeBundle>>> =
keyword_arm_confidence_floor: null,
// Phase E3 — metadata boost gate `lexical` (flipped on the Cat 13 held-out receipt); `always` restores the pre-wave pipeline.
metadata_boost_gate: 'lexical',
- hub_dampening: DEFAULT_HUB_DAMPENING,
}),
balanced: Object.freeze({
cache_enabled: true,
@@ -567,7 +556,6 @@ export const MODE_BUNDLES: Readonly<Record<SearchMode, Readonly<ModeBundle>>> =
keyword_arm_confidence_floor: null,
// Phase E3 — metadata boost gate `lexical` (flipped on the Cat 13 held-out receipt); `always` restores the pre-wave pipeline.
metadata_boost_gate: 'lexical',
- hub_dampening: DEFAULT_HUB_DAMPENING,
}),
tokenmax: Object.freeze({
cache_enabled: true,
@@ -634,7 +622,6 @@ export const MODE_BUNDLES: Readonly<Record<SearchMode, Readonly<ModeBundle>>> =
keyword_arm_confidence_floor: null,
// Phase E3 — metadata boost gate `lexical` (flipped on the Cat 13 held-out receipt); `always` restores the pre-wave pipeline.
metadata_boost_gate: 'lexical',
- hub_dampening: DEFAULT_HUB_DAMPENING,
}),
});
@@ -700,8 +687,6 @@ export interface SearchKeyOverrides {
keyword_arm_confidence_floor?: number | null;
// Ranker wave (Phase E3) — metadata boost gate override (`always` | `lexical`).
metadata_boost_gate?: MetadataBoostGate;
- // Hub dampening override (`off` | half degree).
- hub_dampening?: HubDampening;
autocut_jump?: number;
autocut_min_top?: number;
autocut_min_keep?: number;
@@ -769,8 +754,6 @@ export interface SearchPerCallOpts {
keyword_arm_confidence_floor?: number | null;
// Ranker wave (Phase E3) — metadata boost gate per-call override (`always` | `lexical`).
metadata_boost_gate?: MetadataBoostGate;
- // Hub dampening per-call override (`off` | half degree).
- hub_dampening?: HubDampening;
}
/**
@@ -877,7 +860,6 @@ export function resolveSearchMode(input: ResolveSearchModeInput): ResolvedSearch
relational_chain_slots: pick('relational_chain_slots'),
keyword_arm_confidence_floor: pick('keyword_arm_confidence_floor'),
metadata_boost_gate: pick('metadata_boost_gate'),
- hub_dampening: pick('hub_dampening'),
resolved_mode,
mode_valid: valid,
};
@@ -1222,9 +1204,6 @@ export function knobsHash(
...(knobs.relational_planner ? ['rp=1'] : []),
...(knobs.relational_orient_onehop ?? knobs.relational_planner ? ['ro=1'] : []),
...(knobs.relational_planner && knobs.relational_chain_slots ? [`rcs=${knobs.relational_chain_slots}`] : []),
- // Hub dampening (append-only, emitted only when not `off`, so every
- // existing key is unchanged and needs no version bump).
- ...(typeof knobs.hub_dampening === 'number' ? [`hd=${hubDampeningHashPart(knobs.hub_dampening)}`] : []),
];
// #5691 (append-only, no version bump): only a non-empty query prefix adds
// a part, so every row written without one keeps its key.
@@ -1477,13 +1456,6 @@ export function loadOverridesFromConfig(
const g = normalizeMetadataBoostGate(mbg);
if (g !== undefined) out.metadata_boost_gate = g;
}
- // Hub dampening: `off` or a half degree; anything else falls through to the
- // bundle. ONE parse contract: normalizeHubDampening (hub-dampening.ts).
- const hd = get('search.hub_dampening');
- if (hd !== undefined) {
- const h = normalizeHubDampening(hd);
- if (h !== undefined) out.hub_dampening = h;
- }
return out;
}
@@ -1538,7 +1510,6 @@ export const KNOB_CONFIG_KEY: Readonly<Record<keyof ModeBundle, string>> = Objec
relational_chain_slots: 'search.relational_chain_slots',
keyword_arm_confidence_floor: 'search.keyword_arm_confidence_floor',
metadata_boost_gate: 'search.metadata_boost_gate',
- hub_dampening: 'search.hub_dampening',
});
/** The full list of config keys this module reads. Used by `gbrain search modes --reset`. */
diff --git a/src/core/search/modes-report.ts b/src/core/search/modes-report.ts
index b168068b0f..bb7ebbfa2e 100644
--- a/src/core/search/modes-report.ts
+++ b/src/core/search/modes-report.ts
@@ -67,7 +67,6 @@ export const KNOB_DESCRIPTIONS: Record<keyof ModeBundle, string> = {
keyword_arm_confidence_floor: 'Keyword-arm confidence floor: below this margin ratio the keyword + title lists fuse at half weight (null = off; (0, 1])',
// Ranker wave (Phase E3) metadata boost gate
metadata_boost_gate: 'Post-fusion metadata boosts (backlink/salience/recency/graph/alias): always, or lexical = only when a keyword/title/relational row fused',
- hub_dampening: 'Hub dampening of backlink/graph lifts: off, or the inbound degree at which a high-degree page keeps half its lift',
};
/**
diff --git a/src/core/types.ts b/src/core/types.ts
index 8138208f70..9e1b1f6860 100644
--- a/src/core/types.ts
+++ b/src/core/types.ts
@@ -981,10 +981,6 @@ export interface SearchResult {
content_hash?: string | null;
/** Caller-visible inbound linking pages behind backlink_boost (stamped with it). */
backlink_count?: number;
- /** Hub-dampening weight (0, 1) applied to the backlink lift; absent when undampened. */
- backlink_hub_weight?: number;
- /** Hub-dampening weight (0, 1) applied to the adjacency / cross-source lifts; absent when undampened. */
- graph_hub_weight?: number;
/** Multiplier applied by applySalienceBoost. */
salience_boost?: number;
/** Multiplier applied by applyRecencyBoost. */
@@ -2142,13 +2138,6 @@ export interface HybridSearchMeta {
* recall there; the gate is never consulted).
*/
metadata_boost_gate?: import('./search/metadata-boost-gate.ts').MetadataBoostGateDecision;
- /**
- * Hub dampening (`search.hub_dampening`): the half degree in force and how
- * many results had a graph-derived lift reduced. Stamped whenever the
- * metadata stages ran, even with dampening `off`, so operators can see the
- * resolved setting.
- */
- hub_dampening?: import('./search/hub-dampening.ts').HubDampeningMeta;
/**
* v0.32.x (search-lite): token budget enforcement metadata. Omitted when
* no budget was applied (backward-compatible with pre-search-lite
diff --git a/test/doctor-ranking-extraction.test.ts b/test/doctor-ranking-extraction.test.ts
index d9dc8b1b71..558af6facd 100644
--- a/test/doctor-ranking-extraction.test.ts
+++ b/test/doctor-ranking-extraction.test.ts
@@ -1,15 +1,13 @@
/**
- * hub_degree_shape and extraction_date_grounding doctor checks.
+ * extraction_date_grounding doctor check.
*
- * Protects: the degree-shape check reports the inbound-link percentiles and
- * how many pages the resolved half degree dampens by more than half, never a
- * recommended value; the date-grounding check names the setting and its
- * consumers; both stay informational (ok) and categorized.
+ * Protects: the check names the setting and its consumers, and stays
+ * informational (ok).
* Seams: none; in-memory PGLite.
*/
import { afterAll, beforeAll, describe, expect, test } from 'bun:test';
import { PGLiteEngine } from '../src/core/pglite-engine.ts';
-import { extractionDateGroundingEntry, hubDegreeShapeEntry } from '../src/commands/doctor/checks/ranking-extraction.ts';
+import { extractionDateGroundingEntry } from '../src/commands/doctor/checks/ranking-extraction.ts';
import { categorizeCheck } from '../src/core/doctor-categories.ts';
import type { DoctorContext } from '../src/commands/doctor/context.ts';
import type { Check } from '../src/commands/doctor.ts';
@@ -21,34 +19,9 @@ beforeAll(async () => {
engine = new PGLiteEngine();
await engine.connect({});
await engine.initSchema();
- await engine.putPage('companies/hub-example', { type: 'company', title: 'Hub', compiled_truth: 'hub' });
- const links = [];
- for (let i = 0; i < 12; i++) {
- await engine.putPage(`meetings/m-${i}`, { type: 'meeting', title: `M${i}`, compiled_truth: 'sync' });
- links.push({ from_slug: `meetings/m-${i}`, to_slug: 'companies/hub-example', link_type: 'mentions_company' });
- }
- await engine.addLinksBatch(links);
}, 60_000);
afterAll(async () => { if (engine) await engine.disconnect(); });
-describe('hub_degree_shape', () => {
- test('off: reports the shape and that dampening is off', async () => {
- const [check] = (await hubDegreeShapeEntry.run(ctx())) as Check[];
- expect(check.status).toBe('ok');
- expect(check.message).toContain('max 12');
- expect(check.message).toContain('hub dampening is off');
- expect(categorizeCheck('hub_degree_shape')).toBe(categorizeCheck('graph_coverage'));
- });
-
- test('on: counts pages above the half degree, recommends nothing', async () => {
- await engine.setConfig('search.hub_dampening', '5');
- const [check] = (await hubDegreeShapeEntry.run(ctx())) as Check[];
- expect(check.message).toContain('half degree 5: 1 page(s)');
- expect(check.message).not.toMatch(/set .*hub_dampening/);
- await engine.setConfig('search.hub_dampening', 'off');
- });
-});
-
describe('extraction_date_grounding', () => {
test('fact extraction is grounded by default; the other prompts only when set on; false turns it off', async () => {
const [byDefault] = (await extractionDateGroundingEntry.run(ctx())) as Check[];
diff --git a/test/fixtures/goldens/doctor/json-pglite-degraded.json b/test/fixtures/goldens/doctor/json-pglite-degraded.json
index c940df0b5f..446e490826 100644
--- a/test/fixtures/goldens/doctor/json-pglite-degraded.json
+++ b/test/fixtures/goldens/doctor/json-pglite-degraded.json
@@ -908,12 +908,6 @@
"name": "loop_facts_drift",
"status": "ok"
},
- {
- "category": "brain",
- "message": "inbound links per page p50 0, p90 0, p99 0, max 0 over 0 pages; hub dampening is off (search.hub_dampening). To see whether hub pages crowd a query, run gbrain search \"<query>\" --explain and read each row's backlink inbound count and hub weight.",
- "name": "hub_degree_shape",
- "status": "ok"
- },
{
"category": "brain",
"message": "Relative dates resolve against each source's observation date in fact extraction, dream synthesis, extract_atoms and propose_takes (the default). life chronicle events keep their current prompt unless extraction.date_grounding is set to true. Facts extracted before this was on keep their original wording; re-extract a source only with the user's consent (gbrain extract-conversation-facts --source-id <id> --dry-run previews it).",
@@ -1670,7 +1664,7 @@
},
{
"category": "brain",
- "message": "No retrieval-affecting files changed in working tree.",
+ "message": "11 retrieval-affecting file(s) changed since HEAD: src/core/search/explain-formatter.ts, src/core/search/graph-signals.ts, src/core/search/hub-dampening.ts, …. Re-run `gbrain eval run-all` after committing these changes.",
"name": "eval_drift",
"status": "ok"
},
diff --git a/test/fixtures/goldens/doctor/json-pglite-fresh.json b/test/fixtures/goldens/doctor/json-pglite-fresh.json
index 911083f734..3dc2fb15ae 100644
--- a/test/fixtures/goldens/doctor/json-pglite-fresh.json
+++ b/test/fixtures/goldens/doctor/json-pglite-fresh.json
@@ -996,12 +996,6 @@
"name": "loop_facts_drift",
"status": "ok"
},
- {
- "category": "brain",
- "message": "inbound links per page p50 0, p90 0, p99 0, max 0 over 0 pages; hub dampening is off (search.hub_dampening). To see whether hub pages crowd a query, run gbrain search \"<query>\" --explain and read each row's backlink inbound count and hub weight.",
- "name": "hub_degree_shape",
- "status": "ok"
- },
{
"category": "brain",
"message": "Relative dates resolve against each source's observation date in fact extraction, dream synthesis, extract_atoms and propose_takes (the default). life chronicle events keep their current prompt unless extraction.date_grounding is set to true. Facts extracted before this was on keep their original wording; re-extract a source only with the user's consent (gbrain extract-conversation-facts --source-id <id> --dry-run previews it).",
@@ -1747,7 +1741,7 @@
},
{
"category": "brain",
- "message": "No retrieval-affecting files changed in working tree.",
+ "message": "11 retrieval-affecting file(s) changed since HEAD: src/core/search/explain-formatter.ts, src/core/search/graph-signals.ts, src/core/search/hub-dampening.ts, …. Re-run `gbrain eval run-all` after committing these changes.",
"name": "eval_drift",
"status": "ok"
},
diff --git a/test/fixtures/goldens/doctor/json-postgres-fresh.json b/test/fixtures/goldens/doctor/json-postgres-fresh.json
index 4a2ba9c84e..8973ead09f 100644
--- a/test/fixtures/goldens/doctor/json-postgres-fresh.json
+++ b/test/fixtures/goldens/doctor/json-postgres-fresh.json
@@ -989,12 +989,6 @@
"name": "loop_facts_drift",
"status": "ok"
},
- {
- "category": "brain",
- "message": "inbound links per page p50 0, p90 0, p99 0, max 0 over 0 pages; hub dampening is off (search.hub_dampening). To see whether hub pages crowd a query, run gbrain search \"<query>\" --explain and read each row's backlink inbound count and hub weight.",
- "name": "hub_degree_shape",
- "status": "ok"
- },
{
"category": "brain",
"message": "Relative dates resolve against each source's observation date in fact extraction, dream synthesis, extract_atoms and propose_takes (the default). life chronicle events keep their current prompt unless extraction.date_grounding is set to true. Facts extracted before this was on keep their original wording; re-extract a source only with the user's consent (gbrain extract-conversation-facts --source-id <id> --dry-run previews it).",
@@ -1737,7 +1731,7 @@
},
{
"category": "brain",
- "message": "No retrieval-affecting files changed in working tree.",
+ "message": "11 retrieval-affecting file(s) changed since HEAD: src/core/search/explain-formatter.ts, src/core/search/graph-signals.ts, src/core/search/hub-dampening.ts, …. Re-run `gbrain eval run-all` after committing these changes.",
"name": "eval_drift",
"status": "ok"
},
diff --git a/test/fixtures/goldens/doctor/registry-build-checks.json b/test/fixtures/goldens/doctor/registry-build-checks.json
index ff7510aa0a..e3dc166564 100644
--- a/test/fixtures/goldens/doctor/registry-build-checks.json
+++ b/test/fixtures/goldens/doctor/registry-build-checks.json
@@ -441,10 +441,6 @@
"category": "brain",
"name": "loop_facts_drift"
},
- {
- "category": "brain",
- "name": "hub_degree_shape"
- },
{
"category": "brain",
"name": "extraction_date_grounding"
diff --git a/test/fixtures/goldens/exports/types.json b/test/fixtures/goldens/exports/types.json
index e5bd45adf1..79ed7389db 100644
--- a/test/fixtures/goldens/exports/types.json
+++ b/test/fixtures/goldens/exports/types.json
@@ -713,7 +713,6 @@
"detail_resolved: \"low\" | \"medium\" | \"high\" | null",
"embedding_column?: string | undefined",
"expansion_applied: boolean",
- "hub_dampening?: HubDampeningMeta | undefined",
"intent?: \"entity\" | \"temporal\" | \"event\" | \"concept\" | \"general\" | undefined",
"keyword_arm_confidence?: KeywordArmConfidenceDecision | undefined",
"metadata_boost_gate?: MetadataBoostGateDecision | undefined",
@@ -1380,7 +1379,6 @@
"alias_resolved_boost?: number | undefined",
"backlink_boost?: number | undefined",
"backlink_count?: number | undefined",
- "backlink_hub_weight?: number | undefined",
"base_score?: number | undefined",
"blend_norm_rrf?: number | undefined",
"chronicle_boost?: number | undefined",
@@ -1404,7 +1402,6 @@
"graph_adjacency_hits?: number | undefined",
"graph_cross_source_boost?: number | undefined",
"graph_cross_source_hits?: number | undefined",
- "graph_hub_weight?: number | undefined",
"graph_session_demoted?: boolean | undefined",
"graph_session_prefix?: string | undefined",
"injection_p?: number | undefined",
@@ -6957,7 +6954,6 @@
"explainTarget?: TargetTrace | undefined",
"floorRatio?: number | undefined",
"graph_signals?: boolean | undefined",
- "hubDampening?: string | number | undefined",
"include_slug_prefixes?: string[] | undefined",
"intentWeighting?: boolean | undefined",
"keywordArmConfidenceFloor?: number | null | undefined",
@@ -7029,9 +7025,7 @@
"fallback?: RecencyDecayConfig | undefined",
"floorRatio?: number | undefined",
"graphSignalsEnabled?: boolean | undefined",
- "hubDampening?: HubDampening | undefined",
"onGraphMeta?: ((meta: GraphSignalsMeta) => void) | undefined",
- "onHubDampening?: ((meta: HubDampeningMeta) => void) | undefined",
"onScoreDistribution?: ((dist: ScoreDistribution) => void) | undefined",
"query?: string | undefined",
"recency: \"on\" | \"off\" | \"strong\"",
@@ -7092,7 +7086,7 @@
"kind": "function",
"name": "applyBacklinkBoost",
"signature": [
- "(results: SearchResult[], counts: Map<number, number>, floorThreshold?: number, halfDegree?: HubDampening) => void"
+ "(results: SearchResult[], counts: Map<number, number>, floorThreshold?: number) => void"
]
},
{
@@ -8033,7 +8027,6 @@
"detail_resolved: \"low\" | \"medium\" | \"high\" | null",
"embedding_column?: string | undefined",
"expansion_applied: boolean",
- "hub_dampening?: HubDampeningMeta | undefined",
"intent?: \"entity\" | \"temporal\" | \"event\" | \"concept\" | \"general\" | undefined",
"keyword_arm_confidence?: KeywordArmConfidenceDecision | undefined",
"metadata_boost_gate?: MetadataBoostGateDecision | undefined",
@@ -8483,7 +8476,6 @@
"alias_resolved_boost?: number | undefined",
"backlink_boost?: number | undefined",
"backlink_count?: number | undefined",
- "backlink_hub_weight?: number | undefined",
"base_score?: number | undefined",
"blend_norm_rrf?: number | undefined",
"chronicle_boost?: number | undefined",
@@ -8507,7 +8499,6 @@
"graph_adjacency_hits?: number | undefined",
"graph_cross_source_boost?: number | undefined",
"graph_cross_source_hits?: number | undefined",
- "graph_hub_weight?: number | undefined",
"graph_session_demoted?: boolean | undefined",
"graph_session_prefix?: string | undefined",
"injection_p?: number | undefined",
diff --git a/test/p2-acceptance.test.ts b/test/p2-acceptance.test.ts
index c61ab707fa..ea26e1da11 100644
--- a/test/p2-acceptance.test.ts
+++ b/test/p2-acceptance.test.ts
@@ -2,8 +2,8 @@
* Ranking and extraction settings, end to end on one keyless brain.
*
* Protects: on a populated brain with every new setting turned on
- * (search.hub_dampening, extraction.date_grounding, facts.attribution),
- * re-running schema setup, the two doctor checks and an explained search
+ * (extraction.date_grounding, facts.attribution),
+ * re-running schema setup, the doctor check and an explained search
* makes zero model calls; explain returns score_details whose final equals
* the row score; explain_target diagnoses a page the source filter removed
* without returning it.
@@ -16,7 +16,7 @@ import { importFromContent } from '../src/core/import-file.ts';
import { operationsByName } from '../src/core/operations.ts';
import type { OperationContext } from '../src/core/ops/contract.ts';
import { __setChatTransportForTests, __setEmbedTransportForTests } from '../src/core/ai/gateway.ts';
-import { extractionDateGroundingEntry, hubDegreeShapeEntry } from '../src/commands/doctor/checks/ranking-extraction.ts';
+import { extractionDateGroundingEntry } from '../src/commands/doctor/checks/ranking-extraction.ts';
import { __resetPrivateVisibilityCacheForTests } from '../src/core/search/private-visibility.ts';
import type { DoctorContext } from '../src/commands/doctor/context.ts';
import type { Check } from '../src/commands/doctor.ts';
@@ -47,7 +47,7 @@ beforeAll(async () => {
await engine.addLinksBatch(links);
await engine.executeRaw(`INSERT INTO sources (id, name) VALUES ('team', 'team') ON CONFLICT DO NOTHING`);
await importFromContent(engine, 'notes/quokka-team', '# Team quokka\nQuokka tracker notes for the team.', { noEmbed: true, sourceId: 'team' });
- for (const [k, v] of [['search.hub_dampening', '4'], ['extraction.date_grounding', 'true'], ['facts.attribution', 'true']]) await engine.setConfig(k, v);
+ for (const [k, v] of [['extraction.date_grounding', 'true'], ['facts.attribution', 'true']]) await engine.setConfig(k, v);
}, 120_000);
afterAll(async () => {
@@ -57,17 +57,16 @@ afterAll(async () => {
});
describe('ranking and extraction settings on a populated keyless brain', () => {
- test('schema setup again and both doctor checks make no model calls and stay informational', async () => {
+ test('schema setup again and the date-grounding doctor check make no model calls and stay informational', async () => {
await engine.initSchema();
const dctx = { engine, args: [], progress: { heartbeat() {} } } as unknown as DoctorContext;
- const checks = [...(await hubDegreeShapeEntry.run(dctx)) as Check[], ...(await extractionDateGroundingEntry.run(dctx)) as Check[]];
- expect(checks.map(c => c.status)).toEqual(['ok', 'ok']);
- expect(checks[0].message).toContain('max 8');
- expect(checks[1].message).toMatch(/on/i);
+ const checks = (await extractionDateGroundingEntry.run(dctx)) as Check[];
+ expect(checks.map(c => c.status)).toEqual(['ok']);
+ expect(checks[0].message).toMatch(/on/i);
expect(modelCalls).toBe(0);
});
- test('explain: score_details final equals the row score, with hub dampening on', async () => {
+ test('explain: score_details final equals the row score', async () => {
const rows = await operationsByName.query.handler(ctx(), { query: 'quokka tracker', expand: false, explain: true }) as Array<Record<string, unknown>>;
expect(rows.length).toBeGreaterThan(0);
for (const r of rows) expect((r.score_details as { final: number }).final).toBe(r.score as number);
diff --git a/test/search-mode.test.ts b/test/search-mode.test.ts
index 69e6948470..63fed5035f 100644
--- a/test/search-mode.test.ts
+++ b/test/search-mode.test.ts
@@ -95,7 +95,6 @@ describe('SEARCH_MODES + MODE_BUNDLES canonical shape', () => {
keyword_arm_confidence_floor: null,
// ranker wave (Phase E3) — metadata boost gate `lexical` in every bundle since the Cat 13 held-out receipt (`always` = pre-wave pipeline).
metadata_boost_gate: 'lexical',
- hub_dampening: 'off',
});
});
@@ -142,7 +141,6 @@ describe('SEARCH_MODES + MODE_BUNDLES canonical shape', () => {
keyword_arm_confidence_floor: null,
// ranker wave (Phase E3) — metadata boost gate `lexical` in every bundle since the Cat 13 held-out receipt (`always` = pre-wave pipeline).
metadata_boost_gate: 'lexical',
- hub_dampening: 'off',
});
});
@@ -187,7 +185,6 @@ describe('SEARCH_MODES + MODE_BUNDLES canonical shape', () => {
keyword_arm_confidence_floor: null,
// ranker wave (Phase E3) — metadata boost gate `lexical` in every bundle since the Cat 13 held-out receipt (`always` = pre-wave pipeline).
metadata_boost_gate: 'lexical',
- hub_dampening: 'off',
});
});
diff --git a/test/search/explain.test.ts b/test/search/explain.test.ts
index 754d050788..8c7571a0ed 100644
--- a/test/search/explain.test.ts
+++ b/test/search/explain.test.ts
@@ -65,7 +65,7 @@ describe('RRF arm attribution', () => {
describe('buildScoreDetails', () => {
test('unobserved stages are not_run, applied boosts carry their factors, ranks are 1-based', () => {
- const r = { ...row('notes/a', 1), score: 1.2, base_score: 1, backlink_boost: 1.1, backlink_count: 40, backlink_hub_weight: 0.25,
+ const r = { ...row('notes/a', 1), score: 1.2, base_score: 1, backlink_boost: 1.1, backlink_count: 40,
rrf: { raw: 0.03, normalized: 1, compiled_truth_boost: 1, arms: [{ arm: 'keyword', rank: 0, k: 60, weight: 1, contribution: 1 / 60, vote: 'page' as const, chunk_id: 1 }] } };
const d = buildScoreDetails(r);
expect(d.final).toBe(1.2);
@@ -73,7 +73,7 @@ describe('buildScoreDetails', () => {
expect(d.rrf).toMatchObject({ state: 'applied', raw: 0.03 });
expect(d.blend).toEqual({ state: 'not_run', reason: 'no_query_embedding' });
expect(d.rerank.state).toBe('not_run');
- expect(d.boosts.backlink).toEqual({ factor: 1.1, inbound: 40, hub_weight: 0.25 });
+ expect(d.boosts.backlink).toEqual({ factor: 1.1, inbound: 40 });
expect(Object.keys(d.boosts)).toEqual(['backlink']);
});
diff --git a/test/search/hub-dampening.test.ts b/test/search/hub-dampening.test.ts
index 885f5fefde..769d9fc36d 100644
--- a/test/search/hub-dampening.test.ts
+++ b/test/search/hub-dampening.test.ts
@@ -1,37 +1,13 @@
/**
- * Hub dampening — pure weight, parse contract, backlink + graph-signal sites,
- * and the hybridSearch wire (PGLite, keyless).
+ * hubWeight / dampenBoost: the degree-aware weight relational-chain.ts uses
+ * for intermediate nodes.
*
* Pinned contracts:
* - hubWeight(1, H) = 1; hubWeight(H + 1, H) = 0.5; `off` / undefined = 1
- * - normalizeHubDampening is the ONE parse contract (config + per-call)
- * - applyBacklinkBoost with `off` is byte-identical to the undampened factor
- * - dampening shrinks only lifts (factor > 1), never demotions
- * - graph-signal lifts scale by the caller-visible degree map
- * - hybridSearch threads `hubDampening` and stamps meta.hub_dampening
+ * - dampenBoost scales a boost's excess over 1.0 by that weight
*/
-
-import { describe, test, expect, beforeAll, afterAll } from 'bun:test';
-import type { SearchResult, AdjacencyRow, HybridSearchMeta } from '../../src/core/types.ts';
-import type { BrainEngine } from '../../src/core/engine.ts';
-import {
- dampenBoost,
- hubDampeningHashPart,
- hubWeight,
- normalizeHubDampening,
-} from '../../src/core/search/hub-dampening.ts';
-import { applyBacklinkBoost, hybridSearch } from '../../src/core/search/hybrid.ts';
-import { applyGraphSignals, ADJACENCY_BOOST, CROSS_SOURCE_BOOST } from '../../src/core/search/graph-signals.ts';
-import { knobsHash, resolveSearchMode, loadOverridesFromConfig } from '../../src/core/search/mode.ts';
-import { PGLiteEngine } from '../../src/core/pglite-engine.ts';
-import { importFromContent } from '../../src/core/import-file.ts';
-
-function row(slug: string, score: number, page_id: number): SearchResult {
- return {
- slug, page_id, title: slug, type: 'note' as const, chunk_text: slug,
- chunk_source: 'compiled_truth', chunk_id: page_id * 1000, chunk_index: 0, score, stale: false, source_id: 'default',
- };
-}
+import { describe, test, expect } from 'bun:test';
+import { dampenBoost, hubWeight } from '../../src/core/search/hub-dampening.ts';
describe('hubWeight', () => {
test('degree <= 1 keeps the full lift; H + 1 halves it; 3H + 1 keeps 10%', () => {
@@ -66,149 +42,4 @@ describe('dampenBoost', () => {
expect(dampenBoost(1.1, 101, 100)).toBeCloseTo(1.05, 12);
expect(dampenBoost(1.1, 1, 100)).toBe(1.1);
});
- test('never touches a demotion or a neutral factor', () => {
- expect(dampenBoost(0.95, 10_000, 10)).toBe(0.95);
- expect(dampenBoost(1, 10_000, 10)).toBe(1);
- });
-});
-
-describe('normalizeHubDampening', () => {
- test('accepts off spellings and in-range numbers', () => {
- expect(normalizeHubDampening('off')).toBe('off');
- expect(normalizeHubDampening('OFF')).toBe('off');
- expect(normalizeHubDampening('none')).toBe('off');
- expect(normalizeHubDampening(false)).toBe('off');
- expect(normalizeHubDampening(200)).toBe(200);
- expect(normalizeHubDampening('600')).toBe(600);
- });
- test('rejects everything else as unset', () => {
- for (const v of [0, -1, 0.5, 2_000_000, Number.NaN, Number.POSITIVE_INFINITY, '', 'abc', null, undefined, {}, true]) {
- expect(normalizeHubDampening(v)).toBeUndefined();
- }
- });
- test('hash part is stable', () => {
- expect(hubDampeningHashPart('off')).toBe('off');
- expect(hubDampeningHashPart(200)).toBe('200.000');
- });
-});
-
-describe('applyBacklinkBoost with hub dampening', () => {
- test('off is byte-identical to the undampened factor and stamps the count', () => {
- const a = [row('a', 1, 1)];
- const b = [row('a', 1, 1)];
- const counts = new Map([[1, 5000]]);
- applyBacklinkBoost(a, counts);
- applyBacklinkBoost(b, counts, undefined, 'off');
- expect(b[0].score).toBe(a[0].score);
- expect(b[0].backlink_boost).toBe(a[0].backlink_boost);
- expect(b[0].backlink_count).toBe(5000);
- expect(b[0].backlink_hub_weight).toBeUndefined();
- });
-
- test('a hub loses most of its lift; a low-degree page keeps it', () => {
- const results = [row('hub', 1, 1), row('leaf', 1, 2)];
- const counts = new Map([[1, 20_000], [2, 3]]);
- applyBacklinkBoost(results, counts, undefined, 100);
- const [hub, leaf] = results;
- expect(hub.backlink_hub_weight).toBeLessThan(0.001);
- expect(hub.score).toBeLessThan(1.001);
- expect(leaf.backlink_hub_weight).toBeCloseTo(hubWeight(3, 100), 12);
- expect(leaf.score).toBeCloseTo(1 + 0.05 * Math.log(4) * hubWeight(3, 100), 12);
- expect(leaf.score).toBeGreaterThan(hub.score);
- });
-});
-
-describe('applyGraphSignals with hub dampening', () => {
- const ENGINE_STUB = {} as BrainEngine;
- test('adjacency and cross-source lifts scale by the degree weight', async () => {
- const results = [row('people/a', 10, 1), row('companies/hub', 9, 2), row('companies/leaf', 8, 3)];
- const adjacency = new Map<number, AdjacencyRow>([
- [2, { hits: 3, cross_source_hits: 2 }],
- [3, { hits: 3, cross_source_hits: 0 }],
- ]);
- let dampened = -1;
- await applyGraphSignals(results, ENGINE_STUB, {
- enabled: true,
- adjacencyFn: async () => adjacency,
- hubHalfDegree: 100,
- degrees: new Map([[2, 101], [3, 1]]),
- onHubDampened: (n) => { dampened = n; },
- });
- const hub = results.find(r => r.slug === 'companies/hub')!;
- const leaf = results.find(r => r.slug === 'companies/leaf')!;
- expect(hub.graph_adjacency_boost).toBeCloseTo(1 + (ADJACENCY_BOOST - 1) * 0.5, 12);
- expect(hub.graph_cross_source_boost).toBeCloseTo(1 + (CROSS_SOURCE_BOOST - 1) * 0.5, 12);
- expect(hub.graph_hub_weight).toBeCloseTo(0.5, 12);
- expect(hub.score).toBeCloseTo(9 * hub.graph_adjacency_boost! * hub.graph_cross_source_boost!, 10);
- expect(leaf.graph_adjacency_boost).toBe(ADJACENCY_BOOST);
- expect(leaf.graph_hub_weight).toBeUndefined();
- expect(dampened).toBe(1);
- });
-
- test('without a degree map the lifts are undampened', async () => {
- const results = [row('people/a', 10, 1), row('companies/hub', 9, 2)];
- await applyGraphSignals(results, ENGINE_STUB, {
- enabled: true,
- adjacencyFn: async () => new Map<number, AdjacencyRow>([[2, { hits: 3, cross_source_hits: 0 }]]),
- hubHalfDegree: 10,
- });
- expect(results[1].graph_adjacency_boost).toBe(ADJACENCY_BOOST);
- });
-});
-
-describe('search.hub_dampening knob resolution', () => {
- test('config key parses through the one contract; bundles default off', () => {
- expect(resolveSearchMode({ mode: 'balanced' }).hub_dampening).toBe('off');
- const overrides = loadOverridesFromConfig({ 'search.hub_dampening': '200' });
- expect(overrides.hub_dampening).toBe(200);
- expect(loadOverridesFromConfig({ 'search.hub_dampening': 'garbage' }).hub_dampening).toBeUndefined();
- expect(resolveSearchMode({ mode: 'balanced', overrides }).hub_dampening).toBe(200);
- expect(resolveSearchMode({ mode: 'balanced', overrides, perCall: { hub_dampening: 'off' } }).hub_dampening).toBe('off');
- });
-
- test('off keeps every existing cache key; a half degree changes it', () => {
- const off = resolveSearchMode({ mode: 'balanced' });
- const on = resolveSearchMode({ mode: 'balanced', perCall: { hub_dampening: 200 } });
- const { hub_dampening: _drop, ...legacy } = off;
- expect(knobsHash(off)).toBe(knobsHash(legacy as typeof off));
- expect(knobsHash(on)).not.toBe(knobsHash(off));
- });
-});
-
-describe('hybridSearch wire (PGLite, keyless)', () => {
- let engine: PGLiteEngine;
- beforeAll(async () => {
- engine = new PGLiteEngine();
- await engine.connect({ engine: 'pglite' } as never);
- await engine.initSchema();
- await importFromContent(engine, 'companies/hubco', 'hubco widget platform overview widget', { noEmbed: true });
- await importFromContent(engine, 'concepts/widget-pricing', 'widget pricing notes widget widget', { noEmbed: true });
- const links = [];
- for (let i = 0; i < 40; i++) {
- await importFromContent(engine, `meetings/m-${i}`, `routine sync ${i}`, { noEmbed: true });
- links.push({ from_slug: `meetings/m-${i}`, to_slug: 'companies/hubco', link_type: 'mentions_company' });
- }
- await engine.addLinksBatch(links);
- });
- afterAll(async () => { if (engine) await engine.disconnect(); });
-
- async function run(hubDampening: 'off' | number) {
- let meta: HybridSearchMeta | undefined;
- const results = await hybridSearch(engine, 'widget', { limit: 5, hubDampening, onMeta: (m: HybridSearchMeta) => { meta = m; } } as never);
- return { results, meta };
- }
-
- test('dampening reduces the hub page backlink lift and stamps meta', async () => {
- const off = await run('off');
- const on = await run(10);
- const hubOff = off.results.find(r => r.slug === 'companies/hubco')!;
- const hubOn = on.results.find(r => r.slug === 'companies/hubco')!;
- expect(hubOff.backlink_count).toBe(40);
- expect(hubOn.backlink_hub_weight).toBeCloseTo(hubWeight(40, 10), 12);
- expect(hubOn.backlink_boost!).toBeLessThan(hubOff.backlink_boost!);
- expect(off.meta?.hub_dampening?.half_degree).toBe('off');
- expect(off.meta?.hub_dampening?.backlink_dampened).toBe(0);
- expect(on.meta?.hub_dampening?.half_degree).toBe(10);
- expect(on.meta?.hub_dampening?.backlink_dampened).toBeGreaterThan(0);
- });
});