phase: 23_llm_rate_responsiveness
Phase 23 final verification complete — all green.
```
VERIFIED (criteria)
1 /api/llm/snapshot windows ≈2 s live (1.98–2.00), /api/system window_seconds ≈10 s (9.996–10.005);
/api/config llm.rate_window_seconds=2=LLM_INTERVAL_SECONDS; browser re-check ALL CHECKS PASSED
(data/logs/23-window-{llm,system}.png — /llm prints Δ2.0s, /system footnote Δ10.0s)
2 Phase-13 pins unchanged: floor, 2×span ceiling, 8× jump gate + independent anchor — all pass
(only import/span-line diffs in tests/; git diff confirms no assertion rewritten)
3 Live proof re-derived from artifacts: 780 rows, 0 unlabelled, windows 0.61–3.38 s, 5 starts +
5 ends settled by poll 2 (0 unsettled), 1 m rollups max 42.3 vs raw 201.6, 0 over 300 tok/s;
counterfactual 10 s window: median settle poll 3, |ln| 0.924 vs 0.037
4 uv run pytest: 1494 passed / 15 skipped · coverage 98.94% (floor 94) · ruff clean · pyright 0
errors · node --check clean · bash .agents/validate.sh exit 0 · live 11 passed · store_perf 4 passed
Dev server up, all nine sources ok. No git add/commit run; everything left in the working tree.
DOCS PASS — 4 inconsistencies fixed in AGENTS.md (last two runs above include them)
- UI conventions hero example still said the `.sub` footnote reads `Δ10.0s`; the only hero that
prints a Δ is /llm's → now `Δ2.0s` on /llm, "at the current load" on /ups
- gap 9: "found 10 busy-edges" contradicted its own artifact (17 edges, 10 judged, 7 reported-not-
judged) → 17; and the poll-2 ratios were a 3-of-5 cherry-pick → full five values both windows
- gap 12: the responsive-table fix is now scheduled — names 27_mobile_tables_and_audit
README, config table, .env.example, rates/prom docstrings, app/api bullets and the testing-policy
pins all re-checked against code and found consistent (store pragmas, budgets, throttle, fleet).
NOTES
- Advisory only, not phase 23: fastapi 0.153.0 → 0.156.8 available; dependencies untouched here,
so rule 8's "update on purpose" is left to the operator.
- NOTES.md is empty in the working tree (its items became phases 24–27); left as-is, untracked-file
rules forbid me removing it.
- Next phase: 24_dev_mtls_rollout (25–27 follow).
```
This commit is contained in:
+21
-1
@@ -3,7 +3,7 @@ from __future__ import annotations
|
||||
|
||||
import importlib
|
||||
import os
|
||||
from dataclasses import FrozenInstanceError
|
||||
from dataclasses import FrozenInstanceError, fields
|
||||
from typing import Any
|
||||
|
||||
import pytest
|
||||
@@ -109,6 +109,26 @@ def test_the_disk_cadence_is_an_env_var_like_every_other_one(monkeypatch: pytest
|
||||
importlib.reload(config)
|
||||
|
||||
|
||||
def test_there_is_one_window_knob_per_measuring_cadence() -> None:
|
||||
"""Phase 23: `RATE_WINDOW_SECONDS` is the **host's** Δ window; the LLM's *is* its interval.
|
||||
|
||||
These are the defaults `app.build_hub` spans its two estimators with — the wiring is pinned in
|
||||
`tests/test_api.py`, the payload labels in `tests/test_llm_source.py` and
|
||||
`tests/test_host_source.py`, both through `tests/rate_window_contract.py`. And there is
|
||||
exactly **one** `*window*` setting: the LLM window tracks `LLM_INTERVAL_SECONDS` by
|
||||
construction, so it cannot drift from the cadence it belongs to, while the host's cannot
|
||||
shrink to match it either (a 2 s span over a 10 s poll has nothing inside it to diff, which
|
||||
`test_the_host_rates_keep_their_own_cadence_s_window` pins as `n/a`).
|
||||
"""
|
||||
settings = Settings()
|
||||
assert settings.rate_window == 10.0
|
||||
assert settings.llm_interval == 2.0
|
||||
assert settings.host_interval == 10.0
|
||||
window_knobs = {field.name for field in fields(Settings) if "window" in field.name}
|
||||
assert window_knobs == {"rate_window"}, (
|
||||
"the LLM window must stay `LLM_INTERVAL_SECONDS`: a second knob drifts from its cadence")
|
||||
|
||||
|
||||
def test_actions_need_the_flag_and_are_dead_under_read_only() -> None:
|
||||
assert Settings(nut_allow_actions=True, read_only=False).actions_allowed is True
|
||||
assert Settings(nut_allow_actions=True, read_only=True).actions_allowed is False
|
||||
|
||||
Reference in New Issue
Block a user