Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

eval longmemeval: route the time-scope arm through one harness hook

garrytaneb37e2e5b31a
diff --git a/scripts/module-size-limits.tsv b/scripts/module-size-limits.tsv
index 4760586293..ed3d9244b1 100644
--- a/scripts/module-size-limits.tsv
+++ b/scripts/module-size-limits.tsv
@@ -41,4 +41,4 @@ src/core/bootstrap/harness.ts 2711 ratchet +29 live-PGLite-serve lane: LIVE_SERV
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 1527 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
-src/commands/eval-longmemeval.ts 1518 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)
+src/commands/eval-longmemeval.ts 1520 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); +2 P6: eval-only retrieval arms wiring (logic in eval/longmemeval/retrieval-arms.ts)
diff --git a/src/commands/eval-longmemeval.ts b/src/commands/eval-longmemeval.ts
index 8b6998404e..ec3ad639dd 100644
--- a/src/commands/eval-longmemeval.ts
+++ b/src/commands/eval-longmemeval.ts
@@ -1435,11 +1435,7 @@ async function runOneQuestion(
? { onRerankPool: (p: readonly SearchResult[], pre?: readonly SearchResult[]) => { pool = [...p]; preRerank = pre ? [...pre] : undefined; } }
: {}),
};
- const found = await hybridSearch(engine, q.question, searchOpts);
- if (!opts.arms.timeScope) return found;
- const scoped = retrievalArms.applyTimeScopeArm(found, q, pageMeta, opts.arms.timeScope, opts.topK);
- Object.assign(extra0, retrievalArms.timeScopeRowExtras(scoped.row, slugToRaw, gold, opts.topK));
- return scoped.results;
+ return retrievalArms.scopeResults(await hybridSearch(engine, q.question, searchOpts), opts.arms, { q, pageMeta, slugToRaw, gold, k: opts.topK, extra: extra0 });
});
// Trajectory routing for temporal / knowledge_update intents. Skips for
diff --git a/src/eval/longmemeval/retrieval-arms.ts b/src/eval/longmemeval/retrieval-arms.ts
index d3d83727a2..203b57cb45 100644
--- a/src/eval/longmemeval/retrieval-arms.ts
+++ b/src/eval/longmemeval/retrieval-arms.ts
@@ -298,3 +298,15 @@ export function timeScopeRowExtras(row: TimeScopeArmRow, slugToRaw: SlugToRawMap
...(score ? { unscoped_recall_all_hit: score.recall_all_hit, unscoped_recall_any_hit: score.recall_any_hit } : {}),
};
}
+
+/** Harness hook: applies the time-scope arm (when on) to a widened search result and records its row fields. */
+export function scopeResults(
+ found: SearchResult[],
+ o: RetrievalArmOptions,
+ c: { q: { question: string; question_date?: string }; pageMeta: ReadonlyArray<{ slug: string; content: string; date?: string }>; slugToRaw: SlugToRawMap; gold: readonly string[]; k: number; extra: Record<string, unknown> },
+): SearchResult[] {
+ if (!o.timeScope) return found;
+ const scoped = applyTimeScopeArm(found, c.q, c.pageMeta, o.timeScope, c.k);
+ Object.assign(c.extra, timeScopeRowExtras(scoped.row, c.slugToRaw, c.gold, c.k));
+ return scoped.results;
+}