Files
self-directed-learning/eval/queries.py
T
Krystie dc5dc94d79 Initial commit: Adaptive Recall sidecar for UMP (Phase 5)
Multi-channel retrieval sidecar over Universal Memory Protocol:
- 3-channel RRF (UMP FTS5 + Qdrant vector + knowledge graph)
- ACT-R re-ranking (Anderson 1983) with access tracking
- Co-occurrence graph edges (Phase 6) for dense traversal
- Memory lifecycle decay (Phase 4) with per-kind confidence
- MCP shim routes recall through sidecar, falls back to canonical UMP

Architecture:
- src/server.js      HTTP sidecar on port 4380
- src/graph.js       2592-node / 111-edge graph from UMP (or +cooccur: 13k+)
- src/actr.js        A_i = -d*ln(age) + beta*log1p(freq) + epsilon*conf
- src/access_log.js  per-URN counter + last_accessed_at
- src/ump-recall-mcp.js  MCP shim (recall via sidecar, others passthrough)

Eval results (851-record UMP corpus):
- 2ch RRF over baseline: +50pp recall@10
- 3ch RRF (+graph): +60pp, 12 unique wins
- ACT-R re-rank: 4/20 #1 changes, 84% top-5 retention

Tests: 76/76 passing across graph (27), actr (27), access_log (28),
decay (20), mcp-shim (sidecar + fallback). Run with: npm test

Inspired by AIAppsAPI/adaptive-recall but built from scratch against
existing DNS2 infrastructure (UMP at :4317, Qdrant at :6333,
Ollama at :11434). No paid SaaS, MIT-licensed.
2026-07-12 19:24:47 -07:00

148 lines
6.4 KiB
Python

# Eval queries for Adaptive Recall sidecar (Phase 1F).
# Each query: {"query": str, "expected_id": urn, "expected_subject": str, "category": str, "source": str}
#
# Acceptance for Phase 1: recall@3 on the sidecar must exceed UMP-only by >30%.
QUERIES = [
{
"query": "TOTP secret DashCaddy DNS2",
"expected_id": "urn:ump:krystie-knowledge-infrastructure-md-s10", # TrueRecall section covers TOTP setup
"expected_subject": "TrueRecall Memory System (DNS2)",
"category": "DashCaddy",
"source": "2026-06-11 dashboard-lockout fix session",
},
{
"query": "ump silent drop long uptime restart",
"expected_id": "urn:ump:krystie-knowledge-ump-skill-md-s12", # ump skill Bug 1 silent-drop
"expected_subject": "Bug 1 — silent-drop after long uptime",
"category": "UMP",
"source": "2026-07-12 three-bug fix session",
},
{
"query": "cPanel 134 mass edit zone add record format",
"expected_id": "urn:ump:krystie-knowledge-reference-memories-md-s3", # cPanel 134 mass_edit_zone format
"expected_subject": "cPanel 134 mass_edit_zone format",
"category": "cPanel",
"source": "recurring — DNS record updates on Liquid Web",
},
{
"query": "Triangles fuzz harness CI gflags missing",
"expected_id": "urn:ump:krystie-triangles-test-suite-audit-md-s14", # P-14 fuzz CI gflags
"expected_subject": "Triangles fuzz harness CI gflags",
"category": "Triangles",
"source": "2026-07-11 autonomous overnight PR chain",
},
{
"query": "DNS1 port 53 firewall blocked secondary",
"expected_id": "urn:ump:krystie-knowledge-infrastructure-md-s11", # DNS architecture
"expected_subject": "DNS architecture Primary/Secondary",
"category": "DNS",
"source": "2026-05-30 DNS1 sync session",
},
{
"query": "Krystie OpenClaw migrated Hermes profile",
"expected_id": "urn:ump:krystie-knowledge-sami-md-s7", # Krystie migration
"expected_subject": "Krystie converted from OpenClaw to Hermes",
"category": "Krystie",
"source": "2026-06-30 OpenClaw→Hermes migration",
},
{
"query": "BitNet dead replaced ollama",
"expected_id": "urn:ump:krystie-ump-first-thing-2026-06-22", # BitNet dead note
"expected_subject": "BitNet dead since 2026-06-06",
"category": "Infrastructure",
"source": "recurring reference",
},
{
"query": "git.sami A record Hetzner DNS3 74.208",
"expected_id": "urn:ump:krystie-knowledge-infrastructure-md-s4", # DNS records
"expected_subject": "git.sami → 74.208.167.19",
"category": "DNS",
"source": "2026-05-30 DNS work",
},
{
"query": "Triangles PoW PoS cutoff nonce zero",
"expected_id": "urn:ump:krystie-knowledge-projects-triangles-md-s2", # hybrid PoW/PoS
"expected_subject": "Triangles hybrid PoW/PoS",
"category": "Triangles",
"source": "triangle skill + 2026-06-20 PoW/PoS sync fix",
},
{
"query": "Samihost fail2ban nftables blacklist permanent",
"expected_id": "urn:ump:krystie-knowledge-reference-samihost-md-s2", # fail2ban 4-layer
"expected_subject": "Samihost fail2ban 4-layer defense",
"category": "Security",
"source": "2026-06-20 fail2ban work",
},
{
"query": "KFM token static krystie file manager md5",
"expected_id": "urn:ump:krystie-knowledge-infrastructure-md-s6", # KFM API
"expected_subject": "KFM API static token",
"category": "WordPress",
"source": "recurring — KFM plugin management",
},
{
"query": "DashCaddy license DC-20000 developer lifetime",
"expected_id": "urn:ump:krystie-knowledge-projects-dashcaddy-md-s3", # license
"expected_subject": "Sami's DashCaddy developer license",
"category": "DashCaddy",
"source": "recurring",
},
{
"query": "auto-scope patch npx cache chunk file did key",
"expected_id": "urn:ump:krystie-knowledge-ump-skill-md-s10", # Bug 2 npx cache
"expected_subject": "Bug 2 — missing auto-scope patch in npx cache",
"category": "UMP",
"source": "2026-07-12 fixes",
},
{
"query": "Technitium DNS credentials sami7777 both servers",
"expected_id": "urn:ump:krystie-knowledge-reference-infrastructure-md-s5", # Tech creds
"expected_subject": "Technitium DNS credentials",
"category": "DNS",
"source": "recurring",
},
{
"query": "Triangles multisig stack walk test audit",
"expected_id": "urn:ump:krystie-triangles-test-suite-audit-md-s2", # multisig bug
"expected_subject": "Multisig stack-walk fix",
"category": "Triangles",
"source": "2026-07-10 autonomous audit",
},
# Additional 5 queries from session_search, broader topics
{
"query": "Ollama reinstall missing systemd",
"expected_id": "urn:ump:krystie-knowledge-infrastructure-md-s7", # ollama state
"expected_subject": "Ollama reinstall on DNS2",
"category": "Infrastructure",
"source": "2026-07-12 build session",
},
{
"query": "RRF ranker reciprocal rank fusion formula k constant",
"expected_id": None, # new in this session, may not be in UMP yet
"expected_subject": "RRF ranker",
"category": "Adaptive Recall",
"source": "2026-07-12 build session",
},
{
"query": "Triangles test coverage PR keystore V5 soft cap",
"expected_id": "urn:ump:krystie-triangles-test-suite-audit-md-s18", # PR 29
"expected_subject": "Triangles test coverage PR chain",
"category": "Triangles",
"source": "2026-07-11 PR chain",
},
{
"query": "DashCaddy TOTP recovery panel disable bak fallback",
"expected_id": "urn:ump:krystie-knowledge-projects-dashcaddy-md-s4", # 4-part TOTP defense
"expected_subject": "DashCaddy 4-part TOTP defense",
"category": "DashCaddy",
"source": "2026-06-18 TOTP fixes",
},
{
"query": "mem-watcher krystie TrueRecall sessions ingest",
"expected_id": "urn:ump:krystie-knowledge-infrastructure-md-s10", # TrueRecall mem watcher
"expected_subject": "mem-watcher-krystie",
"category": "TrueRecall",
"source": "recurring",
},
]