feat(projection): show staged projection with evidence ladder
Report a projection stage, an evidence ladder and the sustained-regime write rate from compute_projection, per ADR 0012. A provisional lifespan appears after 3 observed hours and carries the hours observed and a short-horizon spread; the complete-local-day condition becomes a fact instead of a gate, and the write rate replaces the lifespan when no baseline applies. The TUI and CLI render the stage, ladder count and full ladder, and drop their own two-sample pre-gates.
This commit is contained in:
+10
-10
@@ -398,16 +398,16 @@ class TestArithmetic:
|
||||
_insert_day(store, d, bw=1024*1024*100)
|
||||
_insert_sample(store, "2026-09-30T10:00:00+00:00", pu=5)
|
||||
result = compute_projection(store, _clock())
|
||||
if result.headline_remaining_seconds is not None:
|
||||
E_rated = 1.0 * TBW_TO_BYTES
|
||||
regime_bytes = 30 * 1024 * 1024 * 100
|
||||
# Actual wall-clock: Sep 1 00:00 -> Sep 30 12:00 = 29.5 days
|
||||
period_start = datetime(2026, 9, 1, 0, 0, 0, tzinfo=timezone.utc)
|
||||
period_end = _clock()
|
||||
actual_wc = int((period_end - period_start).total_seconds())
|
||||
rate = regime_bytes / actual_wc
|
||||
expected = max(E_rated - regime_bytes, 0) / rate
|
||||
assert abs(result.headline_remaining_seconds - expected) < 1.0
|
||||
E_rated = 1.0 * TBW_TO_BYTES
|
||||
W_t = 512000000000 # lifetime bytes written of the newest published sample
|
||||
regime_bytes = 30 * 1024 * 1024 * 100
|
||||
# Actual wall-clock: Sep 1 00:00 -> Sep 30 12:00 = 29.5 days
|
||||
period_start = datetime(2026, 9, 1, 0, 0, 0, tzinfo=timezone.utc)
|
||||
actual_wc = int((_clock() - period_start).total_seconds())
|
||||
rate = regime_bytes / actual_wc
|
||||
expected = max(E_rated - W_t, 0) / rate
|
||||
assert result.headline_remaining_seconds is not None
|
||||
assert abs(result.headline_remaining_seconds - expected) < 1.0
|
||||
|
||||
def test_implied_baseline_formula(self, store):
|
||||
W_t = 1024 * 1024 * 1000
|
||||
|
||||
Reference in New Issue
Block a user