test_a_master_flow_takes_the_subtree_a_test_trace_reaches

Tests › tests/test_wiki_tracerun.py

passed Passed in the packaged run.

What this test is for

Why it exists

X-2 (owner review 2, 2026-11-22): "I don't see the dossier being built"; owner Q/A: real values, traced. A traced test's root span is the TEST, so its trace could light only the test's own flow, never the `dossier` master flow it calls. A flow with no trace rooted at its entry takes the subtree under the first span named after its entry, from any trace.

Verifies REQ-DDB-WIKI-049

Given

  1. def span(i, name, parent, start): return {"spanId": i, "parentSpanId": parent, "name": name, "startTimeUnixNano": start}
  2. otlp = { "resourceSpans": [ { "scopeSpans": [ { "spans": [ span("1", "test_dossier_caps", "", 1), span("2", "dossier", "1", 2), span("3", "_answered", "2", 3), span("4", "other", "1", 9), ] } ] } ] }
→

When

  1. traces = {root_name(otlp): ("build/traces/t.json", otlp)}
  2. rel, sub = trace_for("dossier", traces)
  3. root_name(sub)
3 more
  1. spans_of(sub)
  2. trace_for("test_dossier_caps", traces)
  3. trace_for("absent", traces)
→

Then

  1. ✓ rel equals "build/traces/t.json"
  2. ✓ root_name(sub) equals "dossier"
  3. ✓ sorted(s["name"] for s in spans_of(sub)) equals ["_answered", "dossier"]
  4. ✓ trace_for("test_dossier_caps", traces) equals traces["test_dossier_caps"]
  5. ✓ trace_for("absent", traces) is None

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.

Build this wiki from the index · 2 of 400 steps

… 83 earlier steps

callercallercallercallerclew/wiki/build.pyclew/wiki/build.pyclew/wiki/build.pyclew/wiki/build.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyother filesother filesother filesother filesloop (line 281)loopbuild_wiki84. load_traces → redact_local_paths84redact_local_paths85. _build_site → root_name85root_name86. root_name → spans_of86spans_of▶ test enters87. _build_site → _test_flows87_test_flows88. _test_flows → connect88connect

… 160 steps between

callercallercallercallerclew/wiki/build.pyclew/wiki/build.pyclew/wiki/build.pyclew/wiki/build.pyclew/wiki/symbols.pyclew/wiki/symbols.pyclew/wiki/symbols.pyclew/wiki/symbols.pyother filesother filesother filesother filesloop (line 207)looptry (line 209)tryloop (line 355)loopbuild_wiki249. _build_site → _with_role249_with_role250. _build_site → trace_for250trace_for251. trace_for → spans_of251spans_of▶ test enters252. _build_site → _actor_of252_actor_of253. _build_site → symbol_pages253symbol_pages

… 147 later steps

tests/test_wiki_tracerun.py:506 · its file's page

What it checks (4)

  1. assert rel == "build/traces/t.json" and root_name(sub) == "dossier" observes root_name
  2. assert sorted(s["name"] for s in spans_of(sub)) == ["_answered", "dossier"] observes spans_of
  3. assert trace_for("test_dossier_caps", traces) == traces["test_dossier_caps"] observes trace_for
  4. assert trace_for("absent", traces) is None observes trace_for

Where the product reaches it

  • build_wiki → _build_site → root_name (flow)
  • build_wiki → _build_site → root_name → spans_of (flow)
  • build_wiki → _build_site → trace_for (flow)

Call flow

test_a_master_flow_takes_the_subtree_a_test_trace_reaches→root_name→trace_for→spans_of

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.

test_a_master_flow_takes_the_subtree_a_test_trace_reaches · 4 checksspans_ofREQ-DDB-WIKI-035 · measuredroot_nameREQ-DDB-WIKI-036 · measured

Requirements it verifies (1)

requirementlinked byimplementers exercised
REQ-DDB-WIKI-049catalogunknown
Also reaches 2 requirements

Its run touches their code; that is reach, not proof.