test_status_reports_which_tier_chose_the_seeds¶
Tests › tests/test_tiers.py
What this test is for
Why it exists
RECORDED IS NOT ENOUGH — it has to be REPORTED. A tiered resolution whose winner never reaches a consumer is the same opacity as an untiered one with more moving parts, so `status` carries the section beside scope and coverage.
Given
db = tmp_path / "clew.db"
When
_options_meta(db)_stamp(db, _entry_patterns(argparse.Namespace(entry_patterns=["%mine%"]), {}))_stamp(db, _entry_patterns(argparse.Namespace(entry_patterns=None), {}))
Then
- ✓ _options_meta(db) equals {}
- ✓ _options_meta(db) equals { f"{OPTION_ENTRY_PATTERNS}.{TIER_KEY}": TIER_EXPLICIT, f"{OPTION_ENTRY_PATTERNS}.{EXPLICIT_KEY}": "%mine%", }
- ✓ _options_meta(db)[f"{OPTION_ENTRY_PATTERNS}.{TIER_KEY}"] equals TIER_HEURISTIC
What it exercises
The parts of the system's flows this test ran, measured by per-test coverage: lit steps ran in this test, dimmed ones did not, and ▶ marks where the test called in. Each title opens the whole flow with these steps lit.
thread `clew-first-build-` — `_first_build_worker` (clew/mcp_server/server.py) · 2 of 142 steps
… 64 earlier steps
… 72 later steps
2 more
- Build, refresh and check the index · 2 of 153 steps
- `main` (scripts/stage_probe.py) · 2 of 37 steps
tests/test_tiers.py:492 · its file's page
What it checks (3)
assert _options_meta(db) == {}, "a nonexistent index reports nothing, not a default"observes_options_metaassert _options_meta(db) == { f"{OPTION_ENTRY_PATTERNS}.{TIER_KEY}": TIER_EXPLICIT, f"{OPTION_ENTRY_PATTERNS}.{EXPLICIT_KEY}": "%mine%", }observes_options_metaassert _options_meta(db)[f"{OPTION_ENTRY_PATTERNS}.{TIER_KEY}"] == TIER_HEURISTICobserves_options_meta
Where the product reaches it
index→_index_action→build_or_refresh→db_status→_options_meta(flow)
Call flow
What it reaches
Each row runs from this test, through the calls it makes, to the code a requirement names. If that code breaks, the test's checks are what should catch it. Reaching is not proving: a check only proves what it observes. No mutation records were given, so these rows say what the test REACHES.
Also reaches 5 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-CONFIG-001 measured
- REQ-DDB-CONFIG-006 measured
- REQ-DDB-CONFIG-007 measured
- REQ-DDB-MCP-001 measured
- REQ-DDB-PIPE-005 measured