Skip to content

feat(session-query): CJK search recall, merged session_search scopes, summary extraction, O(1) live fingerprints - #104

Merged
KeepLost merged 6 commits into
devfrom
feat/session-search-overhaul
Sep 15, 2026
Merged

KeepLost merged 6 commits into
devfrom
feat/session-search-overhaul

Conversation

@KeepLost

Copy link
Copy Markdown
Owner

Summary

  • CJK recall: FTS5 unicode61 gains bigram folding on the indexing and query sides (ngramFtsText); two-character sub-words now match inside CJK/kana/hangul runs, whitespace-separated query terms AND as independent quoted phrases (quoteFtsData), and snippet presentation strips the inserted joins. SESSION_QUERY_SQLITE_SCHEMA_VERSION 9 → 10 so derived indexes rebuild. Verified against node:sqlite that the previous tokenizer made Chinese sub-word queries return nothing (the root cause behind "messages unsearchable after compaction" misattribution).
  • Tool merge (owner-directed): session_event_search is withdrawn; session_search absorbs the one-session scope — exactly one session_ids entry returns every matching event in that session (caller's own session allowed, stopping before the active step; per-target authorization and SESSION_QUERY_TOOL_NO_CURRENT_STEP preserved), zero/several ids keep the per-session best-match reading. compaction_history_search stays current-session-only by decision.
  • Model-facing rewrite: shared prompt and three descriptions are decision-path guidance naming compacted-turn searchability, the messages/history distinction, and the compaction-history recovery path.
  • Extraction: compaction/summary events project summary blocks into shared search documents (dsh-session-query gains a type-only dsh-compaction dependency, token-meter precedent).
  • Performance: live fingerprints become the O(1) (event count, last seq, surface replace generation) identity; an unchanged fingerprint skips cloning, folding, and document rebuilding before every search — the per-search sha256-over-entire-log observation tax is gone.

Tests

  • New: CJK integration spec (live+persisted, double-character, phrase, absent, AND semantics); compaction/summary extraction spec; merged-scope routing (authorization, step clamp, paging cap, cancellation, diagnostics sanitization, exclusivity).
  • Updated: quoteFtsData and unordered-term ranking (AND semantics is the intended contract change), tool catalogs (en/zh/website), acp/headless prompt & schema snapshots re-recorded keyless.
  • Scoped vitest 318 passed / 266 with coverage; changed packages per-file 100%; typecheck, lint, doc-sync, verify-tool-catalog green. Known pre-existing local-only failure: rescope-vendor --check fails identically on a clean tree of dev.

Agent Note: .agents/notes/implemented/feature/2026-09-15-session-search-cjk-and-merged-scopes.md (+zh, +i18n). PLUGINS.md ledger row records 60d68484ee.

… summary extraction, O(1) live fingerprints

CJK recall: FTS5 unicode61 gains bigram folding on the indexing and query
sides (ngramFtsText), two-character sub-words match inside CJK/kana/hangul
runs, whitespace-separated terms AND as independent quoted phrases, and
snippet presentation strips the inserted joins; SESSION_QUERY_SQLITE_SCHEMA_VERSION
bumps to 10 so derived indexes rebuild.

Tool merge: session_event_search is withdrawn and session_search absorbs
the one-session scope — exactly one session_ids entry routes to the full
event listing (caller's own session allowed, stopping before the active
step, per-target authorization preserved) while absent or multiple ids keep
the per-session best-match reading. Prompt text and descriptions are
rewritten as decision-path guidance that names compacted-turn
searchability and the compaction-history recovery path.

Extraction: compaction/summary events project their summary blocks into
shared search documents (dsh-session-query gains the dsh-compaction
type-only dependency).

Performance: live fingerprints become the O(1) (event count, last seq,
surface replace generation) identity, and an unchanged fingerprint skips
cloning, folding, and document rebuilding before every search.
…aul SHA

The previous ledger commit truncated PLUGINS.md to zero bytes (a failed
in-place edit swallowed the whole file); restore it from the feature
commit and fill the placeholder with 60d6848.
…dens

The shipped-composition expectation loses session_event_search (36
tools), the fresh-round-trip system-prompt golden carries the rewritten
session-query guidance, and docs/module-graph.md regenerates for the
new dsh-session-query -> dsh-compaction type-only edge.
… folders

The /goal retry treated the mounted command bubble as pollution: on
slow runners the bubble mounts before the composer re-renders the
'/goal ' prefix, the poll timed out, and the pollution check counted
the bubble itself. Accept either signal as engagement.

The workspace dialog's Open could run before the host mkdir landed
the new folder's selection on slow runners, adopting the parent and
failing the follow-up realpath with ENOENT (8-test cascade). Wait for
the created folder row before Open.
@KeepLost
KeepLost merged commit 23a3ddb into dev Sep 15, 2026
38 of 39 checks passed
@KeepLost
KeepLost deleted the feat/session-search-overhaul branch September 16, 2026 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant