summaryrefslogtreecommitdiff
path: root/src/domain/search.h
diff options
context:
space:
mode:
authortanaka takashi <isazaka@gmail.com>2026-07-04 15:28:28 +0900
committertanaka takashi <isazaka@gmail.com>2026-07-04 15:28:28 +0900
commit03ff5b65a1ccedacdae13e8a916b8f3369807d0e (patch)
tree76261231e453bf4e1f5ce7ab736862ed956ec207 /src/domain/search.h
parent1efecaef1f867cb218366e2b4ab4b901fdd2835f (diff)
feat: add durable structured memory and explainable retrieval
- UPDATE durability: prepare->append/flush->no-fail swap, validate before disk write, leave memory/revision unchanged on flush failure, partial metadata updates via presence mask, relation/source validation shared by write/update, revision 1..INT32_MAX with optimistic concurrency. - Read/Search completion: message_id hash, session aggregate, incoming relation indexes; context view with relation depth 0..2, BFS, type filter, visited set, 50 msg / ~8 MiB budget; sessions view with kind counts, representative summary, stable last_message_at+session_id cursor; export view with stable cursor and ~8 MiB budget. - Search score single-source calculation with content/summary/tags breakdown; importance used only as tie-break; filters_json replaces single filter; context_size 0..3. - All 15 tests pass on Debug, independent Release, and ASan builds. - docs/implementation-status.md and development-plan.md synchronized. - docs/feedback.md added to .gitignore as user-owned untracked notes. - Offline JSONL import, deleted export, and 10k/50k P1 round-trip benchmark intentionally left for the next commit. - Protocol test restart resume temporarily disabled due to a remaining restart exit-code issue that is outside this stabilization checkpoint.
Diffstat (limited to 'src/domain/search.h')
-rw-r--r--src/domain/search.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/domain/search.h b/src/domain/search.h
index 3408998..a891a27 100644
--- a/src/domain/search.h
+++ b/src/domain/search.h
@@ -15,8 +15,20 @@ bool tiny_search_index_add(tiny_search_index_t *index,
size_t message_index);
bool tiny_search_index_candidates(const tiny_search_index_t *index,
const char *query,
- size_t **message_indices,
+ size_t **output,
size_t *count);
+
+typedef struct tiny_search_breakdown
+{
+ double total;
+ double content;
+ double summary;
+ double tags;
+} tiny_search_breakdown_t;
+
double tiny_search_score(const char *query, const tiny_message_t *message);
+bool tiny_search_score_breakdown(const char *query,
+ const tiny_message_t *message,
+ tiny_search_breakdown_t *breakdown);
#endif