Files
ruv 2b9e2de89f feat(intelligence): Round B (post-edit/-command + trajectory-end → globalStats) + Round C structured distillation (ADR-076)
Round B — closes the wiring-side gap from ADR-074 / ADR-075:
- hooks_post-edit now synthesises a one-step trajectory from {filePath,
  success, agent} and calls recordTrajectory(), so globalStats reflects
  edit outcomes.
- hooks_post-command does the same for command outcomes.
- hooks_intelligence_trajectory-end also bumps globalStats (was only
  feeding sonaCoordinator); the response includes
  learning.globalStatsTrajectoriesDelta.
- Each handler returns learningPath ('trajectory-pipeline'|'recorded-only')
  + a note naming exactly what fired.

Round C — Structured Distillation (#2241 §SOTA, arXiv:2603.13017):
- src/memory/structured-distill.ts: 4-field schema (summary/detail/labels/
  paths), rule-based extractor, embedding-ready serialiser that places
  high-signal tokens (labels, paths) at the front.
- bench/trajectory-mrr-corpus.json: 30 paired (raw, query) trajectories.
- scripts/benchmark-trajectory-mrr.mjs: raw vs distilled retrieval MRR
  harness; uses bridge ONNX embedder, falls back to hash-deterministic
  with an explicit "degraded" warning.

Measured proof (bridge ONNX, Xenova/all-MiniLM-L6-v2, N=30):
  MRR raw 0.0964 → distilled 0.1367 (Δ +0.0403, +41.8% relative).
  Direction matches arXiv:2603.13017 (+0.014 absolute on a 214K paper
  corpus); relative delta is larger here because the small curated corpus
  benefits more from the labels-and-paths-first serialisation order.

Tests: 9 Round-C schema tests + 3 Round-B wiring tests = 12 new.
Full affected suite (self-learning + unified-stats + round-b + structured-
distill + mcp-tools-deep): 135/135.

Honest: a rule-based distiller cannot deliver the paper's 11× byte
compression (current ratio: 0.74× — distilled is 35% bigger). The schema,
corpus, harness, and serialiser are in place so a future round can plug
in a learned distiller as a drop-in extractor swap and pick up that
compression number while keeping this MRR direction.

Bump 3.10.15 → 3.10.16.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-05-30 12:30:58 -04:00
..