feat(telemetry): discovery-yield-per-served-turn baseline (ADR-0255) #104
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/discovery-yield-baseline-telemetry"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
2026-07-23 directive: instrument
discovery-yield-per-served-turntelemetry, scoped exactly as ruled — "candidates proposed per served turn on clean, post-reset traffic."Problem
The T11 reset (#102) wiped the discovery-candidate ledger 465→0 but deliberately left
turn_count(14990) unchanged — resetting a scalar that tracks real historical turns would be fabrication. That leaves no way to measure repopulation speed:turn_countspans the whole pre-reset history, while the ledger is now clean.candidates / turn_countwould silently blend pre- and post-reset traffic.Fix
engine_state/__init__.py::save_manifest— new additive-optionalturn_count_baseline: int | None = Noneparam. Stamps theturn_countvalue at the moment the ledger was last reset. Does not bumpschema_version(same discipline asengine_identity/parent_engine_identity).teaching/discovery_yield.py(new) — purecompute_discovery_yield(store):served_turns_since_reset = turn_count - turn_count_baseline,candidates_since_reset = len(candidates),yield_rate = candidates/served_turns(orNonewhen zero served turns — never aZeroDivisionError). Fails closed: returnsNonewhen no baseline is stamped, rather than fabricating a denominator against an un-marked epoch.core teaching discovery-yield [--json](new CLI,core/cli_teaching.py+core/cli.py) — read-only, mirrors thecore teaching coverageshape. Exits 1 with a clear stderr message when no baseline exists.scripts/ops/stamp_discovery_yield_baseline_20260723.py(new) — the one-off that stamps the T11 reset epoch into the live store, mirroringreset_candidate_corpus_t11_20260722.py's atomic generation-dir pattern (begin_generation→ carry forward everything faithfully →save_manifest(turn_count_baseline=turn_count)→commit_generation(keep=1)) with the same idempotent abort-if-already-stamped guard.docs/adr/ADR-0255— the decision, explicit non-goals (not a live/background rate — no always-on PROCESS exists yet; not a new telemetry sink; no serving-physics touched), and validation record.Not yet executed
The stamping script has been dry-run verified against a throwaway copy of the live store's
gen-21703(idempotent guard confirmed, identity/candidates preserved byte-faithfully) but not yet run against the real live store — that mutation was blocked by the local sandbox as a cross-worktree write and needs to be run explicitly, either viaCORE_ENGINE_STATE_DIR=<repo>/engine_state uv run python scripts/ops/stamp_discovery_yield_baseline_20260723.pyafter this merges, or by me with your go-ahead.[Verification]
tests/test_discovery_yield.py— 13 passed (RED→GREEN, each gate has a_bitesmutation-proof variant per CLAUDE.md schema-as-proof discipline)tests/test_adr_0219_generation_checkpoint.py+tests/test_discovery_candidates.py+tests/test_conftest_engine_state_isolation.py+tests/test_adr_0146_engine_state.py— 73 passed (no regression in engine_state/discovery)tests/test_cli.py+tests/test_cli_test_suites.py— 21 passedBase
da3447e9, headde6e3929. Merge on your authorization (no-merge-automation).