docs(6209): coverage, guidance-ownership, shape, warnings tests and shared fixtures
CI & Build / Python lint (push) Successful in 2s
CI & Build / Plugin hooks (push) Successful in 12s
CI & Build / TypeScript typecheck (push) Successful in 52s
CI & Build / integration (push) Successful in 1m12s
CI & Build / Python tests (push) Successful in 1m56s
CI & Build / Build & push image (push) Successful in 13s

test_pattern_coverage, test_guidance_ownership, test_integration_shape_classify,
test_instruction_surfaces_agree, test_retrieval_warnings, helpers.py and
conftest.py state the property each test or fixture holds. The issue and
milestone numbers, consolidation dates and one-install measurements that
recorded how each was found are dropped; fixture dates and ids stay.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-21 21:21:52 -04:00
co-authored by Claude Opus 5.5
parent 8518afb54d
commit 91c96a8b8a
7 changed files with 199 additions and 256 deletions
+24 -31
View File
@@ -1,4 +1,4 @@
"""`retrieval_telemetry` says what is wrong, rather than implying it (#3431).
"""`retrieval_telemetry` says what is wrong, rather than implying it.
WHY THIS IS TESTED AS ARITHMETIC AND NOT THROUGH THE DATABASE. The warnings
are a pure function of the blocks the readout already built — that is the
@@ -8,12 +8,12 @@ the wrong shape. Every case below is a shape that once produced, or would
produce, a wrong reading:
* an arm that never declines, which is either a missing floor or a missing
LOG (#3497 — the rule arms recorded only their hits, so their decline
count was structurally zero and the obvious warning would have sent a
reader to move a threshold that was never involved);
LOG (an arm that records only its hits has a structurally zero decline
count, and the obvious warning would send a reader to move a threshold
that was never involved);
* a search that never declines, which is a search working correctly;
* a quiet window, where firing every check would describe an empty database
rather than a broken one (rule 115);
rather than a broken one;
* a floor the band is sitting on, which is the case where tuning changes
volume while looking like it changes quality.
@@ -76,7 +76,7 @@ def test_the_warning_carries_the_numbers_that_produced_it() -> None:
def test_a_quiet_window_flags_nothing() -> None:
"""Three calls returning nothing is an afternoon, not a defect (rule 115)."""
"""Three calls returning nothing is an afternoon, not a defect."""
assert codes(warn({"auto_inject": src(calls=3, zero_result_calls=0)})) == set()
@@ -98,7 +98,7 @@ def test_an_arm_that_does_decline_is_not_flagged() -> None:
def test_an_arm_not_known_to_log_unconditionally_is_exempt(monkeypatch) -> None:
"""#3497: a structurally-zero decline count is a logging bug, not a floor.
"""A structurally-zero decline count is a logging bug, not a floor.
Flagging it would report a ranking problem and send the reader to a
threshold that was never involved.
@@ -183,7 +183,7 @@ def test_records_shown_and_never_opened_are_reported_per_corpus() -> None:
def test_each_corpus_is_sent_only_to_a_tool_that_takes_it() -> None:
"""#4798: one remedy for both corpora sent the rules reader to
"""One remedy for both corpora would send the rules reader to
`menus_to_review`, which refuses every source but the notes menu. Tied to
`REVIEWABLE` itself, so it goes red in either direction: the rules text
naming the tool while no rule arm is reviewable, or a rule arm becoming
@@ -231,7 +231,7 @@ def test_an_unregistered_source_gets_no_other_verdict() -> None:
def test_every_registered_source_stays_quiet_when_healthy() -> None:
"""The negative control for the whole suite (rule 167).
"""The negative control for the whole suite.
A guard that cannot pass cleanly is not a guard — if a healthy window
produced warnings, every assertion above would be meaningless.
@@ -256,7 +256,7 @@ def test_a_point_that_emitted_is_not_reported() -> None:
def test_a_deliberately_quiet_point_is_never_reported() -> None:
"""A justified silence must not read as a gap (#2475)."""
"""A justified silence must not read as a gap."""
quiet = {p["source"] for p in _silent_surfaces({}, {}, {}, active=True)}
for web_only in ("rest_search", "browse_search", "rest_note", "rest_rule"):
assert web_only not in quiet
@@ -264,7 +264,7 @@ def test_a_deliberately_quiet_point_is_never_reported() -> None:
def test_an_inactive_window_reports_no_silence_at_all() -> None:
"""On a fresh install every point is silent; the list would be the
registry printed back (rule 115)."""
registry printed back."""
assert _silent_surfaces({}, {}, {}, active=False) == []
@@ -292,14 +292,13 @@ def test_a_setting_falls_back_rather_than_raising(raw, fallback, want) -> None:
assert _num(raw, fallback) == want
# ── read_and_unacted / outcomes_never_recorded (#4213, milestone 419) ─────
# ── read_and_unacted / outcomes_never_recorded ──────────────────────────
#
# The pair exists because ZERO OUTCOMES IS AMBIGUOUS, and getting that wrong
# would have been this milestone's own failure mode in miniature: a window
# with no outcome rows cannot tell "every rule was ignored" from "nothing
# reports outcomes yet". Reporting the first when the truth is the second
# manufactures a finding out of an unwired feature — #3311, where a statistic
# that could not vary was read as a fact about the corpus.
# The pair exists because ZERO OUTCOMES IS AMBIGUOUS: a window with no outcome
# rows cannot tell "every rule was ignored" from "nothing reports outcomes
# yet". Reporting the first when the truth is the second manufactures a
# finding out of an unwired feature — a statistic that cannot vary, read as a
# fact about the corpus.
def ru(**kw) -> dict:
base = {
@@ -358,7 +357,7 @@ def test_every_opened_rule_acted_on_reports_nothing() -> None:
def test_no_rules_opened_at_all_reports_neither() -> None:
"""Silence is not a finding. A window where nothing was opened has nothing
to say about outcomes, and saying it anyway would put a warning on every
fresh install (rule 115)."""
fresh install."""
ws = warn({}, rule_usage=ru(distinct_rules_surfaced=12))
assert "read_and_unacted" not in codes(ws)
assert "outcomes_never_recorded" not in codes(ws)
@@ -367,7 +366,7 @@ def test_no_rules_opened_at_all_reports_neither() -> None:
def test_an_absent_rule_usage_block_is_not_a_finding() -> None:
"""A failed rule-usage read leaves the keys missing or zero. Neither may
become a warning, because a warning computed over rows that could not be
loaded describes the outage, not the corpus (#2663)."""
loaded describes the outage, not the corpus."""
assert "read_and_unacted" not in codes(warn({}, rule_usage={}))
assert "outcomes_never_recorded" not in codes(warn({}, rule_usage={}))
assert "outcomes_never_recorded" not in codes(
@@ -375,7 +374,7 @@ def test_an_absent_rule_usage_block_is_not_a_finding() -> None:
)
# ── floor_moved_mid_window (#4225) ────────────────────────────────────────
# ── floor_moved_mid_window ────────────────────────────────────────────────
#
# WHY THE BAND CHECK IS SUSPENDED RATHER THAN SOFTENED.
#
@@ -481,16 +480,10 @@ def test_a_quiet_arm_is_not_suspended_either_way() -> None:
# floor row, "no move recorded" and "no move" are different statements, and
# the first was standing in for the second.
#
# It showed up the day this instance's ledger was seeded. Its earliest event
# of any kind is 2026-09-17; `write_path_rule`'s only floor row is a release
# baseline written 2026-09-21; a 30-day window opens 2026-08-22. The readout
# printed that arm's band as "-0.0208 above its floor" — the impossible
# negative the section above exists to prevent — with the suspension silent,
# because there was nothing on record for it to notice.
#
# The distinction is not academic for #4261: every window for the next month
# opens before that date, and measuring a change against an instrument that
# reports a number it cannot support is the #4225 trap one level up.
# The case: an arm whose first floor row is dated inside the window. Without
# this check the readout prints its band as a negative distance above its
# floor — the impossible number the section above exists to prevent — with
# the suspension silent, because there is nothing on record for it to notice.
GAP_FROM = "2026-09-21T11:58:00+00:00"