Skip to content
fitme·story
Case studies
v7.9.1 · 5 min read · 2026-06-10

HADF Phase 3A — The Sensing Layer (detection-only observability over a validated dispatch signal)

Phase 2-bis established that streaming TTFT/TPS signatures are real, provider-general, substrate-discriminating, and short-term-stable — a sensing result. Phase 3A turns that validated signal into a passive observability surface and stops there, deliberately. Three producers ship: a reference store (8 endpoints, 7197 valid records), an advisory attestation that scores an observed signature via Mahalanobis distance, and a drift monitor that flags a >3σ shift against a locked baseline. Every attestation output carries advisory:true and a "do NOT route" caveat. It makes no dispatch or routing decision — whether routing on a signature improves outcomes is pre-registered as RQ4 (Phase 3B), unbuilt; per-request single-shot accuracy is unvalidated (RQ5). The discipline is refusing to act on a signal validated only for sensing.

7,197
valid records across 8 endpoints — the locked reference store the whole sensing layer reads from (min_n=50, max_ttft 30s)
Three producers ship on top of it — a reference store, an advisory Mahalanobis attestation, and a >3σ drift monitor — and make exactly 0 dispatch decisions. The discipline is refusing to act on a signal validated only for sensing.
What do T1 / T2 / T3 mean?
T1Instrumented — from a ledger/commit
T2Declared — stated, not measured
T3Narrative — estimate from memory
detect · attest · monitor — route nothing
The sensing layer that ships, then stops — instead of quietly closing the loop into routing
Phase 2-bis proved the streaming TTFT/TPS signature is real. Phase 3A makes it observable — and deliberately leaves the acting layer (RQ4 / Phase 3B) unbuilt and gated. Every output carries advisory:true and a 'do NOT route' caveat.

What this feature is

HADF Phase 2-bis established — across four independent sub-experiments, all PASS (2026-06-05) — that streaming TTFT/TPS signatures are real, provider-general, substrate-discriminating, and short-term-stable. That is a sensing result: the signal exists and is measurable. It says nothing yet about whether acting on the signal (routing a request to a substrate based on its signature) improves any outcome.

Phase 3A turns that validated signal into a passive observability surface — and stops there, deliberately. It is the first half of a two-half program whose second half (acting, RQ4) is intentionally not built. It is a b_medium Feature: net-new framework scaffolding on top of an already-validated research result, mechanical enough that the PRD phase was skipped (the spec carries the design), but large enough to warrant the full closure discipline.

The three producers (T1–T3)

ComponentProducerOutputTier
Reference store (T1)hadf-build-reference-store.pyreference-signatures.jsonT1 (instrumented)
Attestation (T2)hadf-attest.pystdout / JSONT1 input → T3 advisory interpretation
Drift monitor (T3)hadf-drift-monitor.pydrift-monitor.jsonl (append-only)T1 (KS / Mahalanobis vs baseline)

Reference store. Built from the closed Phase 2-bis raw collections (Sub-exps 1/2/3/1B). For each (provider, endpoint) it materializes n, TTFT/TPS quantiles + mean/std, and a 2-D mean + covariance (for Mahalanobis attestation), plus provenance. Two filters keep the distributions honest: n < --min-n (default 50) → excluded_low_n (drops the rate-limited v1 partials like mistral n=9, vercel n=5), and TTFT > 30s → dropped as connection-stall / retry artifact. 7 records dropped (the Sub-exp 1B Fire-0 launch-probe stalls of 995s / 886s / 124s + 4 borderline). Current build: 8 endpoints, 7197 valid records, min_n=50, max_ttft 30s [T1].

Attestation (advisory). Scores an observed (ttft_s, tps) against every reference endpoint via Mahalanobis distance and reports the best match + a confidence band: strong (within 2σ AND ≥1σ closer than runner-up), weak (within 4σ), uncertain (beyond 4σ ⇒ unknown / unseen substrate). Every output carries advisory: true and the "do NOT route" caveat.

Drift monitor. Compares a recent window vs each endpoint's locked baseline. Mahalanobis mean-shift in baseline-σ units → stable (<1σ) / minor_drift (1–3σ) / significant_drift (>3σ, re-baseline recommended). A KS divergence on either marginal (p<0.01) raises ks_diverged. Windows below 30 samples report insufficient_window. Drift is expected over time (provider infra changes); flagging it is the point.

The honesty boundary made concrete

anthropic/claude-haiku-4-5 and aws-bedrock/.../claude-haiku-4-5 serve the same model with overlapping TPS, so the attestation runner-up gap is <1σ → confidence is weak, never strong. This is the correct conservative posture and a live demonstration of the RQ5 caveat: the Sub-exp 3 result (these two endpoints ARE distinguishable in aggregate, signature_delta_ratio 2.89) holds at the distribution level — which is what the drift monitor uses — and does not promise per-request separability.

The follow-ons (T4, T5, calibration)

  • T4 — control-room HADF panel (fitme-story PR #207): an advisory observability surface in /control-room. Renders the sensing outputs; decides nothing.
  • T5a — AIOrchestrator emit hook (shipped): emits an honest ai_inference_completed event (duration_ms + source_tier) on live traffic. Observation only — routes nothing.
  • T5b — server-side real streaming ttft_s/tps (deferred): requires an AIEngineClient streaming rewrite + a Railway change. Tracked as a follow-on; not a closure blocker.
  • Signature-expansion / calibration_status honesty layer (PR #644): every recognition row now carries calibration_status (instrumented = measured, real n; prior_unvalidated = spec-sheet). The attester never returns a prior_unvalidated row as a confident match.

Verification

  • test_hadf_sensing.py — 9 tests pass (9 passed in 20.73s, 2026-06-10): builder aggregate + low-n filter + empty-error; attestation centroid-match + unseen-substrate uncertainty + advisory-flag invariant; drift monitor stable / significant / insufficient-window [T1].
  • Platforms tested: ai (AIOrchestrator T5a hook over the ai-engine cohort) + backend (server-side emit path). Not ios / web — this layer ships no product-UI surface; the fitme-story panel (T4) is an operator dashboard, not a tested product platform.

Why the sensing/acting split is the whole point

The discipline this feature demonstrates is refusing to act on a signal you have only validated for sensing. It would have been easy — and wrong — to wire the attestation output into the dispatcher the moment Phase 2-bis confirmed the signal was real. The signal being real (Phase 2-bis), per-request actionable (RQ5, unvalidated), and outcome-improving when routed on (RQ4, unbuilt) are three different claims. Phase 3A ships only the first, labels every output advisory: true, and leaves a visible, pre-registered gap where the other two belong.

A system that ships the sensing layer and then stops — instead of quietly closing the loop into routing — is the honest version of this work.

Source case study (FitTracker2): docs/case-studies/hadf-phase3a-sensing-case-study.md. Provenance: FT2 PR #635 (T1–T3) + FT2 PR #644 (calibration honesty layer) + fitme-story PR #207 (T4 panel).

Honest disclosures
  • Detection-only by construction: the sensing layer makes exactly 0 dispatch or routing decisions, and every attestation output carries advisory: true plus a "do NOT route" caveat. Whether routing on a signature improves outcomes (RQ4) is unbuilt; per-request single-shot accuracy (RQ5) is unvalidated.
  • The signature is validated at the distribution level, not per-request: same-model endpoints (anthropic vs aws-bedrock claude-haiku-4-5) score only "weak" by design (<1σ gap), so aggregate distinguishability does not promise per-request separability.
  • Research-stage, single-operator: the reference store is built from one operator's closed Phase 2-bis collections (8 endpoints, 7197 records after dropping 7 implausible-TTFT outliers); server-side real streaming ttft_s/tps (T5b) is deferred, so live attestation runs on a thinner signal than the offline store.
Kill criterion · not fired
  • Attestation presented as authoritative per-request (violates the RQ5 honesty boundary) → revert T2 to advisory-only or pull it
  • Any T1–T3 producer makes a dispatch/routing decision (violates the Phase 3A non-goal; acting is gated on RQ4 / Phase 3B)