mirror of
https://github.com/ruvnet/ruflo.git
synced 2026-11-24 06:06:02 +09:00
ADR-152 §"Smallest demonstrable spike" gate REACHED. Both invariants verified on synthetic fixtures; ADR-152 graduates Proposed → Accepted. MEASURED RESULTS similarity(LEGAL, LEGAL).overall = 1.0000 ✓ Invariant 1 (self-match exact) similarity(LEGAL, SUPPORT) = 0.8296 similarity(LEGAL, DEVOPS) = 0.5840 ✓ Invariant 2 (vertical affinity) Per-component (LEGAL vs SUPPORT): cosine=0.9987 categorical=0.75 jaccard=0.2857 Per-component (LEGAL vs DEVOPS): cosine=0.9734 categorical=0 jaccard=0 NOTABLE SPIKE FINDINGS - Numerical cosine alone is too coarse: LEGAL vs DEVOPS scored cosine 0.9734 despite being unrelated verticals. The numerics cluster around similar score ranges. Categorical + jaccard pulled the composite correctly to 0.58 vs 0.83. - The 0.6/0.25/0.15 weighting from ADR-152 §Decision reproduces the intended ordering on the synthetic LEGAL/SUPPORT/DEVOPS fixtures. - `categorical: 0` for LEGAL/DEVOPS correctly fires because they share no enum field (different archetypes, templates, modes). This is a strong feature of the design — categorical disagreement is a clean kill-switch for similarity. THE SPIKE (50 LOC) IMPLEMENTS - projectToVec() — 9-dim numerical feature vector - cosine() — over the 9 numerics - categoricalAgreement() — 4-field enum agreement / 4 - jaccard() — set similarity over agent_topology - similarity() — weighted composite per ADR-152 ARCHITECTURAL CONSTRAINTS (all four preserved) - Removable ✓ pure-TS, reads JSON the CLI emits - Optional ✓ no new @metaharness/* dep - Graceful ✓ guards on missing fields, never throws - CI gate ✓ standalone unit-runnable, no npx required LIFECYCLE NOTE The spike STAYS in the codebase as the regression-suite anchor for the two invariants. When the full feature lands (ADR-152 implementation PR), it goes into `_similarity.mjs`; this `_spike-similarity.mjs` remains as the gate that any future weight tweak must still pass. DOCS UPDATED - ADR-152 status: Proposed → Accepted, with measured spike results and per-component breakdown inlined - ADR-151 §3.1 marker upgraded: "DRAFTED iter 34" → "ACCEPTED iter 35 — spike landed, both invariants pass" SMOKE STEP 17x - Spike script exists, parses, declares the 3-component formula literal - Both invariants explicitly named in source - LEGAL/SUPPORT/DEVOPS fixtures present (anti-regression on the spike) - Fail-closed exit - ADR-152 status = Accepted in source - ADR-151 §3.1 marker upgraded Smoke: 39 → 40. Fleet: 33/33. The Phase-3 critical path is now unblocked. ADR-153 (Recommendation Engine), ADR-154 (Fleet Drift), and ADR-156 (Plugin Compat) can begin once the user/maintainer decides to start them — they all consume similarity() as the iter-35 spike implements it. Co-Authored-By: RuFlo <ruv@ruv.net>