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

F17 Per-Gate `last_fired_at` Index — Derived Telemetry Materialization (v7.9.1)

Mechanism A accumulated ~1800 gate-coverage.jsonl rows by v7.9. The planned v7.10 GATE_COVERAGE_ZERO meta-check would scan that stream for every "is this gate alive?" query — O(records × gates). F17 ships a derived per-gate index at .claude/shared/gate-last-fired.json that answers in O(1). Refresh wall-clock under 1 second for the canonical ledger; 4 integration callsites; 14 tests pass in 0.04s. AWS Config Rules LastSuccessfulInvocationTime pattern. Highest RICE (66.7) of all v7.9.1 candidates.

O(1)
per-gate "when did this last fire?" lookup — down from O(records × gates) over the ~1,800-row gate-coverage stream
The derived index at .claude/shared/gate-last-fired.json refreshes in under 1s for 1,828 rows (PRD budget under 2s), covers all 16 gates that have ever emitted, and is consumed at 4 callsites. AWS Config Rules LastSuccessfulInvocationTime pattern; highest RICE (66.7) of all v7.9.1 candidates.
What do T1 / T2 / T3 mean?
T1Instrumented — from a ledger/commit
T2Declared — stated, not measured
T3Narrative — estimate from memory

F17 Per-Gate last_fired_at Index

By v7.9, Mechanism A had accumulated ~1800 rows in .claude/logs/gate-coverage.jsonl. Every "when did this gate last fire?" query was scanning the full stream.

F17 ships the derived index that answers in O(1).

What ships

.claude/shared/gate-last-fired.json — per-gate aggregate of Mechanism A telemetry. For each gate that ever produced a row, the index captures:

  • last_fired_at — most recent timestamp where checked >= 1 (strict "the gate actually evaluated")
  • last_checked_at — most recent timestamp of any candidate row
  • last_skipped_at — most recent timestamp where skipped >= 1
  • first_seen_at — earliest timestamp ever observed for the gate
  • total_firings, total_skips, total_candidates

Plus top-level schema_version, refreshed_at, source_ledger, source_rows_read, and source_rows_malformed for future-proofing.

Refresh paths

WhereWhen
make gate-last-firedDirect, on-demand
make integrity-checkChained before integrity scan (every operator + every CI run)
scripts/daily-integrity-checkpoint.pyInherits via integrity-check (no separate edit)
.github/workflows/framework-status-weekly.ymlNightly index materialization, snapshot included in weekly history

Pattern reference

AWS Config Rules LastSuccessfulInvocationTime — derive a small index from a large append-only stream so consumers query "when did X last happen?" in O(1) instead of O(records).

Why it matters

Resilience

  • Malformed JSON rows are counted (source_rows_malformed) and skipped — not crashed on
  • Blank lines + whitespace are tolerated (common in append-only streams that flush periodically)
  • Idempotent re-runs verified by test_idempotent_re_runs — daily + weekly cron can both refresh without interaction effects
  • Schema-versioned at 1; readers can detect future format drift

Sequencing

F17 shipped same day as F16 (and on top of F6 + T14 stub). The two combine to mature the framework's gate observability:

  • F16 validates that gates ARE wired correctly via subprocess integration testing
  • F17 materializes "when did each gate last fire?" so meta-checks stay O(1)

Both are independent (no dependency cycle), and F17's read-only-derived-artifact nature means no advisory/enforcement calibration window is required.

Shipped via

  • PR #617 — script + tests + integration + docs + case study

Where to read more