Skip to content

Coverage observe baseline: FLEET_COVERAGE_OBSERVE (issue #2, clean-baseline follow-up)#10

Open
jdkajewski wants to merge 1 commit into
jdkajewski/ts-rewrite-planfrom
dk-coverage-observe
Open

Coverage observe baseline: FLEET_COVERAGE_OBSERVE (issue #2, clean-baseline follow-up)#10
jdkajewski wants to merge 1 commit into
jdkajewski/ts-rewrite-planfrom
dk-coverage-observe

Conversation

@jdkajewski

Copy link
Copy Markdown
Owner

What & why

The merged coverage controller (PR #6) has no zero-behavior-change observe path: turning on FLEET_COVERAGE_ADAPTIVE both emits telemetry and changes new-probe target + placement. So a "partial observe" already deviates from legacy — it can't serve as a clean baseline for measuring what the brain would do before we trust it.

This adds an explicit observe-only lever so we can run the TS bot live and watch the coverage brain's decisions (tiers, probesSaved, would-prune / would-redeploy) against real lanes at zero behavior change — the data that justifies flipping mutation on, and justifies PR3's scheduler.

Design — FLEET_COVERAGE_OBSERVE (default OFF)

Extracted a pure coverageMode() resolver (fleet/scale.ts) that owns the lever precedence; the manager loop just reads its flags.

Precedence — OBSERVE forces a pure-observe baseline: when OBSERVE is set the brain runs for telemetry only (legacy probe buys/placement, no redeploys) even if ADAPTIVE/PRUNE are also set. Flip OBSERVE off + ADAPTIVE/PRUNE on to enact. With all three off the brain never runs → byte-for-byte legacy.

Levers Brain runs? Probe target/placement Redeploys Telemetry
all off no legacy none none
OBSERVE (± adaptive/prune) yes legacy none tiers + probesSaved + wouldPrune/wouldRedeploy
ADAPTIVE (observe off) yes value-driven none full
ADAPTIVE+PRUNE (observe off) yes value-driven enacted full

Telemetry (dry-run signal)

state.coverage gains, alongside the existing tierCounts/target/covered/probesSaved/recheckDue:

  • wouldPrune — DEAD prune candidates the brain flags this tick.
  • wouldRedeploy — the subset that has a movable probe parked and a value destination, i.e. what enacting would actually move.
  • observe flag.

Surfaced through main.ts exactly as before (whole state.coverage passed through; no status-shape change when the brain is off).

Reversibility unchanged

This PR only adds the observe gate; the merged reversible-prune semantics (vacated DEAD markets re-enter cold re-check, never forgotten) are untouched. wouldRedeploy mirrors the same parked-probe + value-dest conditions the enact path uses.

Tests / verification

  • 8 coverageMode unit tests: all-off ⇒ null telemetry + legacy target + no enactment; OBSERVE ⇒ zero enactment + populated wouldPrune/wouldRedeploy; OBSERVE precedence over ADAPTIVE+PRUNE; ADAPTIVE / ADAPTIVE+PRUNE enact paths; wouldRedeploy gating on parked-probe + value-dest.
  • 273 bot tests green, @st/shared build + @st/bot tsc --noEmit clean, eslint clean on all changed files.

Scope

Small, standalone, branched off the latest jdkajewski/ts-rewrite-plan. Lands before PR3 (#9, the global req/s scheduler) so PR3 measures against a clean observe baseline. No calibration data reachable from env → principled defaults + the metric, as agreed.

…ssue #2)

The merged coverage controller had no zero-behavior-change observe path:
turning on FLEET_COVERAGE_ADAPTIVE both emitted telemetry AND changed
new-probe target + placement, so it couldn't serve as a clean baseline for
measuring what the brain WOULD do before trusting it. Add an explicit
observe-only lever so we can run TS live and watch the brain's decisions at
zero risk — the data that justifies flipping mutation (and PR3's scheduler) on.

- config: FLEET_COVERAGE_OBSERVE (boolOff, default OFF).
- fleet/scale.ts: extract a PURE `coverageMode()` resolver. Precedence —
  OBSERVE forces a pure-observe baseline: the brain runs for TELEMETRY ONLY
  (legacy probe buys/placement, no redeploys) even if ADAPTIVE/PRUNE are set;
  flip OBSERVE off + ADAPTIVE/PRUNE on to ENACT. All three off ⇒ brain never
  runs ⇒ byte-for-byte legacy.
- telemetry: `state.coverage` gains wouldPrune (DEAD prune candidates) and
  wouldRedeploy (the subset with a movable probe parked + a value destination —
  what enacting WOULD actually move) plus an `observe` flag, alongside the
  existing tiers/target/probesSaved/recheckDue. Surfaced via main.ts as before.
- 8 coverageMode unit tests: all-off ⇒ null telemetry + legacy target + no
  enactment; OBSERVE ⇒ zero enactment + populated wouldPrune/wouldRedeploy;
  OBSERVE precedence over ADAPTIVE+PRUNE; ADAPTIVE/PRUNE enact paths;
  wouldRedeploy gating on parked-probe + value-dest.

273 bot tests green, @st/shared build + @st/bot tsc --noEmit clean, eslint
clean on changed files. Branched off latest ts-rewrite-plan; own small PR.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant