test_wiki_flow.py¶
tests/test_wiki_flow.py
`clew wiki flow`: a sequence diagram derived from the index, not authored.
test_a_flow_follows_the_calls_in_order_with_frames
None test_wiki_flow.test_a_flow_follows_the_calls_in_order_with_frames(tuple[Path, Path] indexed)
main → load → parse, then main → save inside `if`, lanes by package.
Checks
assert steps == [assert [lane.id for lane in flow.lanes] == ["app", "lib"]assert flow.steps[0].from_lane == "app" and flow.steps[0].to_lane == "lib"
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-PIPE-003 | measured | |
| REQ-DDB-PIPE-011 | measured | |
| REQ-DDB-QUERY-001 | measured | test_a_flow_follows_the_calls_in_order_with_frames → derive_flow → connect |
| REQ-DDB-QUERY-003 | measured | test_a_flow_follows_the_calls_in_order_with_frames → derive_flow → qualified_name_of |
| REQ-DDB-QUERY-010 | measured | test_a_flow_follows_the_calls_in_order_with_frames → derive_flow → _entry_rowids → function_candidates |
| REQ-DDB-QUERY-015 | measured | |
| REQ-DDB-WIKI-001 | measured | test_a_flow_follows_the_calls_in_order_with_frames → derive_flow |
| REQ-DDB-WIKI-008 | catalog | |
| REQ-DDB-WIKI-019 | measured | |
| REQ-DDB-WIKI-041 | measured | test_a_flow_follows_the_calls_in_order_with_frames → derive_flow |
| REQ-DDB-WIKI-047 | catalog |
Source · 19 lines
def test_a_flow_follows_the_calls_in_order_with_frames(indexed: tuple[Path, Path]) -> None:
"""@brief main → load → parse, then main → save inside `if`, lanes by package.
@return None.
@version 1
"""
from clew.wiki.flow import derive_flow
db, repo = indexed
flow = derive_flow(db, repo, "main", depth=3, lanes="packages")
steps = [(s.caller, s.callee, [f.kind for f in s.frames]) for s in flow.steps]
assert steps == [
("main", "load", []),
("load", "parse", []),
("main", "save", ["if"]),
], steps
assert [lane.id for lane in flow.lanes] == ["app", "lib"]
assert flow.steps[0].from_lane == "app" and flow.steps[0].to_lane == "lib"
Activity · 7 steps
test_a_flow_names_its_actor
None test_wiki_flow.test_a_flow_names_its_actor(tuple[Path, Path] indexed)
P5.6: the actor.
Checks
assert (derive_flow(db, repo, "main", depth=1, actor="command-line user").actor == "command-line user" )assert derive_flow(db, repo, "main", depth=1).actor == ""
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-PIPE-003 | measured | |
| REQ-DDB-PIPE-011 | measured | |
| REQ-DDB-QUERY-001 | measured | test_a_flow_names_its_actor → derive_flow → connect |
| REQ-DDB-QUERY-003 | measured | test_a_flow_names_its_actor → derive_flow → qualified_name_of |
| REQ-DDB-QUERY-010 | measured | test_a_flow_names_its_actor → derive_flow → _entry_rowids → function_candidates |
| REQ-DDB-QUERY-015 | measured | |
| REQ-DDB-WIKI-001 | measured | test_a_flow_names_its_actor → derive_flow |
| REQ-DDB-WIKI-008 | catalog | |
| REQ-DDB-WIKI-041 | measured | test_a_flow_names_its_actor → derive_flow |
| REQ-DDB-WIKI-047 | catalog |
Source · 16 lines
def test_a_flow_names_its_actor(indexed: tuple[Path, Path]) -> None:
"""OWNER (round 5): an ACTOR lane — who starts the flow. Carried on the flow, never a synthetic
step: slices and replay pair real call sites, and a made-up first call would break both.
@brief P5.6: the actor.
"""
from clew.wiki.flow import derive_flow
db, repo = indexed
assert (
derive_flow(db, repo, "main", depth=1, actor="command-line user").actor
== "command-line user"
)
assert derive_flow(db, repo, "main", depth=1).actor == ""
Activity · 4 steps
test_a_flow_spec_animates_by_default_and_can_opt_out
None test_wiki_flow.test_a_flow_spec_animates_by_default_and_can_opt_out(tmp_path)
`animate:` in a flow entry is a known key; absent means animated.
Checks
assert problems == []assert [f.animate for f in config.flows] == [True, False]
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-GUARD-012 | measured | test_a_flow_spec_animates_by_default_and_can_opt_out → load_wiki_config → _requirements_section → read_requirements_section |
| REQ-DDB-WIKI-001 | catalog | |
| REQ-DDB-WIKI-008 | catalog | |
| REQ-DDB-WIKI-047 | catalog | |
| REQ-DDB-WIKI-054 | inferred | test_a_flow_spec_animates_by_default_and_can_opt_out → load_wiki_config → _comments → all |
Source · 14 lines
def test_a_flow_spec_animates_by_default_and_can_opt_out(tmp_path) -> None:
"""@brief `animate:` in a flow entry is a known key; absent means animated.
@return None.
"""
from clew.wiki.config import load_wiki_config
(tmp_path / ".clew.yaml").write_text(
"wiki:\n flows:\n - entry: a\n - entry: b\n animate: false\n"
)
config, problems = load_wiki_config(tmp_path)
assert problems == []
assert [f.animate for f in config.flows] == [True, False]
Activity · 5 steps
test_a_measured_flow_expands_what_ran_and_folds_what_did_not
None test_wiki_flow.test_a_measured_flow_expands_what_ran_and_folds_what_did_not(tuple[Path, Path] indexed)
Coverage-guided expansion with a per-caller not-run stub.
Checks
assert got == [("main", "load", 0), ("load", "parse", 0), ("main", "", 1)], gotassert flow.measured is True and flow.capped is False
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-PIPE-003 | measured | |
| REQ-DDB-PIPE-011 | measured | |
| REQ-DDB-QUERY-001 | measured | test_a_measured_flow_expands_what_ran_and_folds_what_did_not → derive_flow → connect |
| REQ-DDB-QUERY-003 | measured | test_a_measured_flow_expands_what_ran_and_folds_what_did_not → derive_flow → qualified_name_of |
| REQ-DDB-QUERY-010 | measured | test_a_measured_flow_expands_what_ran_and_folds_what_did_not → derive_flow → _entry_rowids → function_candidates |
| REQ-DDB-QUERY-015 | measured | |
| REQ-DDB-WIKI-001 | measured | test_a_measured_flow_expands_what_ran_and_folds_what_did_not → derive_flow |
| REQ-DDB-WIKI-008 | catalog | |
| REQ-DDB-WIKI-041 | measured | test_a_measured_flow_expands_what_ran_and_folds_what_did_not → derive_flow |
| REQ-DDB-WIKI-047 | catalog |
Source · 19 lines
def test_a_measured_flow_expands_what_ran_and_folds_what_did_not(
indexed: tuple[Path, Path],
) -> None:
"""A CALL THAT RAN EXPANDS past the declared depth (load → parse at depth 1); calls that never
ran fold into ONE stub per caller (`not_run`), so the diagram shows the exercised path and says
how much of the static flow no test reached.
@brief Coverage-guided expansion with a per-caller not-run stub.
@return None.
"""
from clew.wiki.flow import derive_flow
db, repo = indexed
flow = derive_flow(db, repo, "main", depth=1, executed=_RAN_LOAD_ONLY)
got = [(s.caller, s.callee, s.not_run) for s in flow.steps]
assert got == [("main", "load", 0), ("load", "parse", 0), ("main", "", 1)], got
assert flow.measured is True and flow.capped is False
Activity · 6 steps
test_a_not_run_row_names_no_call_site
None test_wiki_flow.test_a_not_run_row_names_no_call_site()
The stub row's call-site cell is empty.
Checks
assert _site_cell(stub, {"link": "x.html#L0", "site": "clew/cli.py:0"}) == ""assert "clew/cli.py:12" in _site_cell(call, {"link": "", "site": "clew/cli.py:12"})
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-WIKI-001 | catalog | |
| REQ-DDB-WIKI-008 | catalog | |
| REQ-DDB-WIKI-047 | catalog |
Source · 15 lines
def test_a_not_run_row_names_no_call_site() -> None:
"""W-8: the folded "… N not run" row showed the call site `clew/cli.py:0`, a line that does not
exist. A stub stands for several calls, so it names none.
@brief The stub row's call-site cell is empty.
@return None.
"""
from types import SimpleNamespace
from clew.wiki.flowpage import _site_cell
stub = SimpleNamespace(not_run=11)
call = SimpleNamespace(not_run=0)
assert _site_cell(stub, {"link": "x.html#L0", "site": "clew/cli.py:0"}) == ""
assert "clew/cli.py:12" in _site_cell(call, {"link": "", "site": "clew/cli.py:12"})1 more lines, not shown
Activity · 6 steps
test_a_not_run_stub_is_drawn_as_a_dim_note_not_a_call
None test_wiki_flow.test_a_not_run_stub_is_drawn_as_a_dim_note_not_a_call(tuple[Path, Path] indexed)
A `not_run` stub reads "… N calls not run", dimmed (class `nr`), never a blank arrow.
Checks
assert "… 1 call not run" in svg and 'class="st nr"' in svg
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-PIPE-003 | measured | |
| REQ-DDB-PIPE-011 | measured | |
| REQ-DDB-QUERY-001 | measured | test_a_not_run_stub_is_drawn_as_a_dim_note_not_a_call → derive_flow → connect |
| REQ-DDB-QUERY-003 | measured | test_a_not_run_stub_is_drawn_as_a_dim_note_not_a_call → derive_flow → qualified_name_of |
| REQ-DDB-QUERY-010 | measured | test_a_not_run_stub_is_drawn_as_a_dim_note_not_a_call → derive_flow → _entry_rowids → function_candidates |
| REQ-DDB-QUERY-015 | measured | |
| REQ-DDB-WIKI-001 | measured | test_a_not_run_stub_is_drawn_as_a_dim_note_not_a_call → derive_flow |
| REQ-DDB-WIKI-008 | catalog | |
| REQ-DDB-WIKI-041 | measured | test_a_not_run_stub_is_drawn_as_a_dim_note_not_a_call → derive_flow |
| REQ-DDB-WIKI-047 | catalog |
Source · 10 lines
def test_a_not_run_stub_is_drawn_as_a_dim_note_not_a_call(indexed: tuple[Path, Path]) -> None:
"""@brief A `not_run` stub reads "… N calls not run", dimmed (class `nr`), never a blank arrow."""
from clew.wiki.flow import derive_flow
from clew.wiki.svg import flow_svg
db, repo = indexed
svg = flow_svg(derive_flow(db, repo, "main", depth=1, executed=_RAN_LOAD_ONLY))
assert "… 1 call not run" in svg and 'class="st nr"' in svg
Activity · 5 steps
test_a_step_cap_stops_the_walk_and_says_so
None test_wiki_flow.test_a_step_cap_stops_the_walk_and_says_so(tuple[Path, Path] indexed)
`max_steps` bounds a measured flow; `capped` discloses that it did.
Checks
assert len(flow.steps) == 1 and flow.capped is True
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-PIPE-003 | measured | |
| REQ-DDB-PIPE-011 | measured | |
| REQ-DDB-QUERY-001 | measured | test_a_step_cap_stops_the_walk_and_says_so → derive_flow → connect |
| REQ-DDB-QUERY-003 | measured | test_a_step_cap_stops_the_walk_and_says_so → derive_flow → qualified_name_of |
| REQ-DDB-QUERY-010 | measured | test_a_step_cap_stops_the_walk_and_says_so → derive_flow → _entry_rowids → function_candidates |
| REQ-DDB-QUERY-015 | measured | |
| REQ-DDB-WIKI-001 | measured | test_a_step_cap_stops_the_walk_and_says_so → derive_flow |
| REQ-DDB-WIKI-008 | catalog | |
| REQ-DDB-WIKI-041 | measured | test_a_step_cap_stops_the_walk_and_says_so → derive_flow |
| REQ-DDB-WIKI-047 | catalog |
Source · 9 lines
def test_a_step_cap_stops_the_walk_and_says_so(indexed: tuple[Path, Path]) -> None:
"""@brief `max_steps` bounds a measured flow; `capped` discloses that it did."""
from clew.wiki.flow import derive_flow
db, repo = indexed
flow = derive_flow(db, repo, "main", depth=1, executed=_RAN_LOAD_ONLY, max_steps=1)
assert len(flow.steps) == 1 and flow.capped is True
Activity · 4 steps
test_an_animated_diagram_plays_the_steps_in_order_with_no_script
None test_wiki_flow.test_an_animated_diagram_plays_the_steps_in_order_with_no_script()
`animate=True` staggers steps in call order, script-free.
Checks
assert delays == [0.0, STEP_SECONDS, 2 * STEP_SECONDS]assert "<script" not in animated and "http" not in animated.replace('xmlns="http://www.w3.org/2000/svg"', "" )assert "prefers-reduced-motion" in animatedassert "animation" not in staticassert re.findall(r">(f\d)<", static) == re.findall(r">(f\d)<", animated) == ["f0", "f1", "f2"]
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-WIKI-001 | catalog | |
| REQ-DDB-WIKI-008 | catalog | |
| REQ-DDB-WIKI-047 | catalog |
Source · 25 lines
def test_an_animated_diagram_plays_the_steps_in_order_with_no_script() -> None:
"""THE ANIMATION IS CSS INSIDE THE SVG: each step is delayed by its position, there is no
script and nothing remote, reduced motion shows the finished diagram, and the static render is
unchanged in content.
@brief `animate=True` staggers steps in call order, script-free.
@return None.
"""
import re
from clew.wiki.svg import STEP_SECONDS, flow_svg
flow = _three_steps()
animated = flow_svg(flow, animate=True)
delays = [float(d) for d in re.findall(r"animation-delay:([\d.]+)s", animated)]
assert delays == [0.0, STEP_SECONDS, 2 * STEP_SECONDS]
assert "<script" not in animated and "http" not in animated.replace(
'xmlns="http://www.w3.org/2000/svg"', ""
)
assert "prefers-reduced-motion" in animated
static = flow_svg(flow)
assert "animation" not in static
assert re.findall(r">(f\d)<", static) == re.findall(r">(f\d)<", animated) == ["f0", "f1", "f2"]
Activity · 11 steps
test_an_entry_no_test_ran_is_walked_statically
None test_wiki_flow.test_an_entry_no_test_ran_is_walked_statically(tuple[Path, Path] indexed)
A measured file whose entry never ran keeps the static steps.
Checks
assert [(s.caller, s.callee) for s in flow.steps] == static, flow.stepsassert not any(s.not_run for s in flow.steps)
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-PIPE-003 | measured | |
| REQ-DDB-PIPE-011 | measured | |
| REQ-DDB-QUERY-001 | measured | test_an_entry_no_test_ran_is_walked_statically → derive_flow → connect |
| REQ-DDB-QUERY-003 | measured | test_an_entry_no_test_ran_is_walked_statically → derive_flow → qualified_name_of |
| REQ-DDB-QUERY-010 | measured | test_an_entry_no_test_ran_is_walked_statically → derive_flow → _entry_rowids → function_candidates |
| REQ-DDB-QUERY-015 | measured | |
| REQ-DDB-WIKI-001 | measured | test_an_entry_no_test_ran_is_walked_statically → derive_flow |
| REQ-DDB-WIKI-008 | catalog | |
| REQ-DDB-WIKI-041 | measured | test_an_entry_no_test_ran_is_walked_statically → derive_flow |
| REQ-DDB-WIKI-047 | catalog |
Source · 18 lines
def test_an_entry_no_test_ran_is_walked_statically(indexed: tuple[Path, Path]) -> None:
"""W-8 (owner review 2026-11-22): `flow-main-clew-cli-py` drew ONE step, "main … 11 not run",
call site `clew/cli.py:0`. The tests call the subcommands, never `main`, so every call was folded
as not run, although nothing about `main` was measured: its file was, it was not. A caller
none of whose lines ran is unmeasured and walked as the static flow is.
@brief A measured file whose entry never ran keeps the static steps.
@return None.
"""
from clew.wiki.flow import derive_flow
db, repo = indexed
static = [(s.caller, s.callee) for s in derive_flow(db, repo, "main", depth=1).steps]
flow = derive_flow(db, repo, "main", depth=1, executed={"app/main.py": {1}})
assert [(s.caller, s.callee) for s in flow.steps] == static, flow.steps
assert not any(s.not_run for s in flow.steps)
Activity · 6 steps
test_an_unknown_entry_is_refused_by_name
None test_wiki_flow.test_an_unknown_entry_is_refused_by_name(tuple[Path, Path] indexed)
No flow is invented for an entry the index does not hold.
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-QUERY-001 | measured | test_an_unknown_entry_is_refused_by_name → derive_flow → connect |
| REQ-DDB-QUERY-003 | measured | test_an_unknown_entry_is_refused_by_name → derive_flow → qualified_name_of |
| REQ-DDB-QUERY-010 | measured | test_an_unknown_entry_is_refused_by_name → derive_flow → _entry_rowids → function_candidates |
| REQ-DDB-WIKI-001 | measured | test_an_unknown_entry_is_refused_by_name → derive_flow |
| REQ-DDB-WIKI-008 | catalog | |
| REQ-DDB-WIKI-041 | measured | test_an_unknown_entry_is_refused_by_name → derive_flow |
| REQ-DDB-WIKI-047 | catalog |
Source · 12 lines
def test_an_unknown_entry_is_refused_by_name(indexed: tuple[Path, Path]) -> None:
"""@brief No flow is invented for an entry the index does not hold.
@return None.
@version 1
"""
from clew.wiki.flow import derive_flow
db, repo = indexed
with pytest.raises(ValueError, match="no_such_entry"):
derive_flow(db, repo, "no_such_entry")
Activity · 4 steps
test_an_unmeasured_file_is_walked_statically_never_folded_as_not_run
None test_wiki_flow.test_an_unmeasured_file_is_walked_statically_never_folded_as_not_run(tuple[Path, Path] indexed)
A file outside the coverage keeps its static steps.
Checks
assert got == [("main", "load", 0), ("load", "parse", 0), ("main", "", 1)], got
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-PIPE-003 | measured | |
| REQ-DDB-PIPE-011 | measured | |
| REQ-DDB-QUERY-001 | measured | test_an_unmeasured_file_is_walked_statically_never_folded_as_not_run → derive_flow → connect |
| REQ-DDB-QUERY-003 | measured | test_an_unmeasured_file_is_walked_statically_never_folded_as_not_run → derive_flow → qualified_name_of |
| REQ-DDB-QUERY-010 | measured | test_an_unmeasured_file_is_walked_statically_never_folded_as_not_run → derive_flow → _entry_rowids → function_candidates |
| REQ-DDB-QUERY-015 | measured | |
| REQ-DDB-WIKI-001 | measured | test_an_unmeasured_file_is_walked_statically_never_folded_as_not_run → derive_flow |
| REQ-DDB-WIKI-008 | catalog | |
| REQ-DDB-WIKI-041 | measured | test_an_unmeasured_file_is_walked_statically_never_folded_as_not_run → derive_flow |
| REQ-DDB-WIKI-047 | catalog |
Source · 17 lines
def test_an_unmeasured_file_is_walked_statically_never_folded_as_not_run(
indexed: tuple[Path, Path],
) -> None:
"""ABSENCE IS NOT EMPTINESS: lib/store.py is not in the coverage at all, so its calls were not
MEASURED — never reported as not run. They are emitted as the static flow would.
@brief A file outside the coverage keeps its static steps.
@return None.
"""
from clew.wiki.flow import derive_flow
db, repo = indexed
flow = derive_flow(db, repo, "main", depth=1, executed={"app/main.py": {5}})
got = [(s.caller, s.callee, s.not_run) for s in flow.steps]
assert got == [("main", "load", 0), ("load", "parse", 0), ("main", "", 1)], got
Activity · 5 steps
test_block_lanes_are_the_maps_blocks
None test_wiki_flow.test_block_lanes_are_the_maps_blocks(tuple[Path, Path] indexed)
P5.6: `blocks` lanes.
Checks
assert [lane.id for lane in flow.lanes] == ["Front door", "Storage"]assert flow.steps[0].from_lane == "Front door" and flow.steps[0].to_lane == "Storage"assert [lane.id for lane in partial.lanes] == ["Front door", "lib/store.py"]
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-PIPE-003 | measured | |
| REQ-DDB-PIPE-011 | measured | |
| REQ-DDB-QUERY-001 | measured | test_block_lanes_are_the_maps_blocks → derive_flow → connect |
| REQ-DDB-QUERY-003 | measured | test_block_lanes_are_the_maps_blocks → derive_flow → qualified_name_of |
| REQ-DDB-QUERY-010 | measured | test_block_lanes_are_the_maps_blocks → derive_flow → _entry_rowids → function_candidates |
| REQ-DDB-QUERY-015 | measured | |
| REQ-DDB-WIKI-001 | measured | test_block_lanes_are_the_maps_blocks → derive_flow |
| REQ-DDB-WIKI-008 | catalog | |
| REQ-DDB-WIKI-041 | measured | test_block_lanes_are_the_maps_blocks → derive_flow |
| REQ-DDB-WIKI-047 | catalog |
Source · 20 lines
def test_block_lanes_are_the_maps_blocks(indexed: tuple[Path, Path]) -> None:
"""OWNER (round 5): sequence diagrams have BLOCK lanes — the same blocks the map and the
Architecture tab draw (the build graph's `file_block`), not a path prefix. A file no block
holds keeps its own path, said rather than dropped.
@brief P5.6: `blocks` lanes.
"""
from clew.wiki.flow import derive_flow
db, repo = indexed
blocks = {"app/main.py": "Front door", "lib/store.py": "Storage"}
flow = derive_flow(db, repo, "main", depth=3, lanes="blocks", blocks=blocks)
assert [lane.id for lane in flow.lanes] == ["Front door", "Storage"]
assert flow.steps[0].from_lane == "Front door" and flow.steps[0].to_lane == "Storage"
partial = derive_flow(
db, repo, "main", depth=3, lanes="blocks", blocks={"app/main.py": "Front door"}
)
assert [lane.id for lane in partial.lanes] == ["Front door", "lib/store.py"]
Activity · 8 steps
test_depth_bounds_the_walk_and_stop_at_ends_a_branch
None test_wiki_flow.test_depth_bounds_the_walk_and_stop_at_ends_a_branch(tuple[Path, Path] indexed)
depth=1 shows only the entry's own calls; stop_at keeps a callee but not its calls.
Checks
assert [s.callee for s in shallow.steps] == ["load", "save"]assert [s.callee for s in stopped.steps] == ["load", "save"]
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-PIPE-003 | measured | |
| REQ-DDB-PIPE-011 | measured | |
| REQ-DDB-QUERY-001 | measured | test_depth_bounds_the_walk_and_stop_at_ends_a_branch → derive_flow → connect |
| REQ-DDB-QUERY-003 | measured | test_depth_bounds_the_walk_and_stop_at_ends_a_branch → derive_flow → qualified_name_of |
| REQ-DDB-QUERY-010 | measured | test_depth_bounds_the_walk_and_stop_at_ends_a_branch → derive_flow → _entry_rowids → function_candidates |
| REQ-DDB-QUERY-015 | measured | |
| REQ-DDB-WIKI-001 | measured | test_depth_bounds_the_walk_and_stop_at_ends_a_branch → derive_flow |
| REQ-DDB-WIKI-008 | catalog | |
| REQ-DDB-WIKI-041 | measured | test_depth_bounds_the_walk_and_stop_at_ends_a_branch → derive_flow |
| REQ-DDB-WIKI-047 | catalog |
Source · 14 lines
def test_depth_bounds_the_walk_and_stop_at_ends_a_branch(indexed: tuple[Path, Path]) -> None:
"""@brief depth=1 shows only the entry's own calls; stop_at keeps a callee but not its calls.
@return None.
@version 1
"""
from clew.wiki.flow import derive_flow
db, repo = indexed
shallow = derive_flow(db, repo, "main", depth=1, lanes="files")
assert [s.callee for s in shallow.steps] == ["load", "save"]
stopped = derive_flow(db, repo, "main", depth=3, lanes="files", stop_at=("load",))
assert [s.callee for s in stopped.steps] == ["load", "save"]
Activity · 6 steps
test_repeated_calls_fold_into_one_loop_frame
None test_wiki_flow.test_repeated_calls_fold_into_one_loop_frame()
Consecutive identical leaf calls draw once, framed `loop ×5`.
Checks
assert re.findall(r'data-step="(\d+)"', animated) == ["0", "5"]assert 'data-steps="0 1 2 3 4"' in animatedassert ">loop ×5<" in animated and ">cap ×5<" in animatedassert delays == [0.0, STEP_SECONDS]assert ">6<" in animated # the call after the fold keeps its own number
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-WIKI-001 | catalog | |
| REQ-DDB-WIKI-008 | catalog | |
| REQ-DDB-WIKI-047 | catalog |
Source · 22 lines
def test_repeated_calls_fold_into_one_loop_frame() -> None:
"""OWNER 2026-11-17 (round 5): repeated calls fold into a `loop ×N` frame. Five consecutive
calls to the same function draw ONE arrow labelled ×5 inside a loop frame; the group still
names every step it stands for (`data-steps`), so the step table, the step pop-ups and a
replayed trace keep all five. The animation plays drawn arrows, so a fold leaves no gap.
@brief Consecutive identical leaf calls draw once, framed `loop ×5`.
@return None.
"""
import re
from clew.wiki.svg import STEP_SECONDS, flow_svg
animated = flow_svg(_repeated(), animate=True)
assert re.findall(r'data-step="(\d+)"', animated) == ["0", "5"]
assert 'data-steps="0 1 2 3 4"' in animated
assert ">loop ×5<" in animated and ">cap ×5<" in animated
delays = [float(d) for d in re.findall(r"animation-delay:([\d.]+)s", animated)]
assert delays == [0.0, STEP_SECONDS]
assert ">6<" in animated # the call after the fold keeps its own number
Activity · 9 steps
test_the_actor_arrow_is_styled_to_be_seen
None test_wiki_flow.test_the_actor_arrow_is_styled_to_be_seen()
P5.6: the actor arrow is visible.
Checks
assert ".enter line{stroke:" in _STYLE
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-WIKI-001 | catalog | |
| REQ-DDB-WIKI-008 | catalog | |
| REQ-DDB-WIKI-047 | catalog |
Source · 11 lines
def test_the_actor_arrow_is_styled_to_be_seen() -> None:
"""FOUND BY LOOKING: the `enter` arrow drew its label and no line, since an SVG line has no
stroke unless one is given. The diagram's own stylesheet strokes it.
@brief P5.6: the actor arrow is visible.
"""
from clew.wiki.svg import _STYLE
assert ".enter line{stroke:" in _STYLE
Activity · 2 steps
test_the_actor_lane_is_drawn_first_with_an_arrow_into_the_entry
None test_wiki_flow.test_the_actor_lane_is_drawn_first_with_an_arrow_into_the_entry(tuple[Path, Path] indexed)
P5.6: the actor's head leads the lanes and an `enter` arrow names the entry.
Checks
assert heads[0] == "command-line user", headsassert 'class="enter"' in svg and ">main</text>" in svgassert 'class="enter"' not in plain and "command-line user" not in plain
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-PIPE-003 | measured | |
| REQ-DDB-PIPE-011 | measured | |
| REQ-DDB-QUERY-001 | measured | test_the_actor_lane_is_drawn_first_with_an_arrow_into_the_entry → derive_flow → connect |
| REQ-DDB-QUERY-003 | measured | test_the_actor_lane_is_drawn_first_with_an_arrow_into_the_entry → derive_flow → qualified_name_of |
| REQ-DDB-QUERY-010 | measured | test_the_actor_lane_is_drawn_first_with_an_arrow_into_the_entry → derive_flow → _entry_rowids → function_candidates |
| REQ-DDB-QUERY-015 | measured | |
| REQ-DDB-WIKI-001 | measured | test_the_actor_lane_is_drawn_first_with_an_arrow_into_the_entry → derive_flow |
| REQ-DDB-WIKI-008 | catalog | |
| REQ-DDB-WIKI-041 | measured | test_the_actor_lane_is_drawn_first_with_an_arrow_into_the_entry → derive_flow |
| REQ-DDB-WIKI-047 | catalog |
Source · 16 lines
def test_the_actor_lane_is_drawn_first_with_an_arrow_into_the_entry(
indexed: tuple[Path, Path],
) -> None:
"""@brief P5.6: the actor's head leads the lanes and an `enter` arrow names the entry."""
from clew.wiki.flow import derive_flow
from clew.wiki.svg import flow_svg
db, repo = indexed
svg = flow_svg(derive_flow(db, repo, "main", depth=1, lanes="files", actor="command-line user"))
heads = re.findall(r'class="head-t"[^>]*>([^<]+)<', svg)
assert heads[0] == "command-line user", heads
assert 'class="enter"' in svg and ">main</text>" in svg
plain = flow_svg(derive_flow(db, repo, "main", depth=1, lanes="files"))
assert 'class="enter"' not in plain and "command-line user" not in plain
Activity · 9 steps
test_the_cli_prints_the_flow_as_json
None test_wiki_flow.test_the_cli_prints_the_flow_as_json(tuple[Path, Path] indexed, pytest.CaptureFixture[str] capsys)
`clew wiki flow ENTRY --index DB --repo-root DIR` prints flow JSON with a version.
Checks
assert code == 0 and data["flow_version"] == 1 and data["entry"] == "main"assert [s["callee"] for s in data["steps"]][:2] == ["load", "parse"]
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-CLI-001 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → report_stats |
| REQ-DDB-CLI-002 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → _doxygen_or_partial → _doxygen_stage → _run_doxygen_from_args → run_doxygen → doxygen_supports_sqlite3 |
| REQ-DDB-CONFIG-001 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _apply_declared_document → stated_document_meta |
| REQ-DDB-CONFIG-003 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_requirements_yaml → _is_flat_req_list |
| REQ-DDB-CONFIG-004 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → resolve_preprocessor |
| REQ-DDB-CONFIG-005 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → import_kconfig |
| REQ-DDB-CONFIG-006 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _recorded_entry_patterns → recorded_explicit |
| REQ-DDB-CONFIG-007 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → write_build_signature |
| REQ-DDB-CONFIG-009 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _apply_toolchain_exclusions → load_toolchain_config |
| REQ-DDB-GUARD-012 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → _trace → load_wiki_config → _requirements_section → read_requirements_section |
| REQ-DDB-GUARD-019 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → enrich_python_docstrings → summarize → parse_doxygen_tags |
| REQ-DDB-GUARD-024 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → enrich_python_docstrings → summarize → apply_autobrief |
| REQ-DDB-GUARD-027 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → _site → check_wiki → trace_problems → catalog_requirements → read_catalog_at |
| REQ-DDB-INDEX-001 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _verify_extra_input_is_read → effective_file_patterns |
| REQ-DDB-INDEX-002 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → refresh_main → _run_pipeline → build_lock |
| REQ-DDB-INDEX-003 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → report_index_coverage |
| REQ-DDB-INDEX-004 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → recover_ast_symbols |
| REQ-DDB-INDEX-005 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → stamp_external_provenance |
| REQ-DDB-INDEX-006 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → refresh_main |
| REQ-DDB-INDEX-007 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → record_owners |
| REQ-DDB-INDEX-008 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_file_licenses |
| REQ-DDB-INDEX-009 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_kerneldoc |
| REQ-DDB-INDEX-010 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → import_ast_includes |
| REQ-DDB-INDEX-011 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → import_property_keys |
| REQ-DDB-MCP-001 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → refresh_main → target_for |
| REQ-DDB-PIPE-001 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → enrich_database |
| REQ-DDB-PIPE-003 | measured | test_the_cli_prints_the_flow_as_json → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → build_call_edges |
| REQ-DDB-PIPE-004 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → python_entry_seeds |
| REQ-DDB-PIPE-005 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → write_build_signature |
| REQ-DDB-PIPE-006 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → run_rustdoc → _require_nightly_rustdoc → clean_subprocess_env |
| REQ-DDB-PIPE-007 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → import_kconfig_gates |
| REQ-DDB-PIPE-008 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_file_docs |
| REQ-DDB-PIPE-009 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → prune_dominated_fuzzy_call_edges |
| REQ-DDB-PIPE-010 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → import_shared_key_edges_inferred → _build_inferred_edges |
| REQ-DDB-PIPE-011 | measured | test_the_cli_prints_the_flow_as_json → wiki_main → refresh_main → try_fast_refresh → _fast_refresh_locked → _plan → _line_anchors → _harvest_one_file → _parseable_file |
| REQ-DDB-PIPE-012 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → build_harvest_plan → js_symbol_harvester |
| REQ-DDB-PIPE-013 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → enrich_python_docstrings |
| REQ-DDB-PIPE-014 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_kerneldoc → within_repo |
| REQ-DDB-PIPE-015 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → import_config_defaults |
| REQ-DDB-QUERY-001 | measured | test_the_cli_prints_the_flow_as_json → wiki_main → _trace → requirement_evidence → connect |
| REQ-DDB-QUERY-003 | measured | test_the_cli_prints_the_flow_as_json → wiki_main → _flow → _flow_object → derive_flow → qualified_name_of |
| REQ-DDB-QUERY-004 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → _site → build_wiki → _build_site → symbol_pages → _owners_by_file → file_owners |
| REQ-DDB-QUERY-010 | measured | test_the_cli_prints_the_flow_as_json → wiki_main → _site → check_wiki → _flow_problems → identity_rowids |
| REQ-DDB-QUERY-011 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → extract_threads → _ensure_threads_tables |
| REQ-DDB-QUERY-015 | measured | |
| REQ-DDB-SCHEMA-001 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → extract_threads |
| REQ-DDB-SCHEMA-002 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → import_shared_key_edges_inferred → _writer_dispatch_map |
| REQ-DDB-SCHEMA-003 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → import_callback_registration_edges → _ensure_external_boundaries_table |
| REQ-DDB-SCHEMA-004 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → load_dispatch_manifest |
| REQ-DDB-SCHEMA-005 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → resolve_key_alias_prefixes |
| REQ-DDB-SCHEMA-006 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_requirements_yaml |
| REQ-DDB-SCHEMA-007 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → import_callback_registration_edges → _ensure_external_boundaries_table |
| REQ-DDB-SCHEMA-009 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → import_event_edges |
| REQ-DDB-SCHEMA-011 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → extract_context_conflicts |
| REQ-DDB-SCHEMA-012 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → load_dispatch_manifest → declaration_origin |
| REQ-DDB-SCHEMA-013 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → import_data_model_keys |
| REQ-DDB-SCHEMA-014 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_file_docs → ensure_file_docs_table |
| REQ-DDB-SCHEMA-015 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_requirements_yaml |
| REQ-DDB-WIKI-001 | measured | test_the_cli_prints_the_flow_as_json → wiki_main |
| REQ-DDB-WIKI-002 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → _trace → requirement_evidence |
| REQ-DDB-WIKI-003 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → _site → build_wiki |
| REQ-DDB-WIKI-004 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → _site → build_wiki → _build_site → nodes_page |
| REQ-DDB-WIKI-005 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → _site → build_wiki → report_limit |
| REQ-DDB-WIKI-006 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → _site → check_wiki → trace_problems → _mutation_problems → parse_mutations |
| REQ-DDB-WIKI-007 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → _diff → diff_versions |
| REQ-DDB-WIKI-008 | catalog | |
| REQ-DDB-WIKI-010 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → _site → build_wiki → _build_site → parse_features |
| REQ-DDB-WIKI-011 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → _site → build_wiki → _build_site → _render → sphinx_settings |
| REQ-DDB-WIKI-012 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → _site → build_wiki → _build_site → requirements_page |
| REQ-DDB-WIKI-013 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → _site → build_wiki → _build_site → _burndown → burndown |
| REQ-DDB-WIKI-014 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → _site → build_wiki → _build_site → flow_page |
| REQ-DDB-WIKI-015 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → _site → build_wiki → _build_site → _prose → impact_path |
| REQ-DDB-WIKI-016 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → _site → build_wiki → _build_site → _coverage → parse_contexts |
| REQ-DDB-WIKI-018 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → _site → build_wiki → _build_site → _all_flows → entry_point_flows |
| REQ-DDB-WIKI-019 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → _site → build_wiki → _build_site → build_graph |
| REQ-DDB-WIKI-020 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → _site → build_wiki → _build_site → write_quick_views → modal |
| REQ-DDB-WIKI-021 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → _site → build_wiki → _build_site → minimap_html |
| REQ-DDB-WIKI-022 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → _site → build_wiki → _build_site → requirements_page → requirement_pages |
| REQ-DDB-WIKI-023 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → _site → build_wiki → _build_site → flows_index |
| REQ-DDB-WIKI-024 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → _site → build_wiki → _build_site → impact_page |
| REQ-DDB-WIKI-025 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → _site → build_wiki → _build_site → commit_published |
| REQ-DDB-WIKI-026 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → _site → build_wiki → _build_site → gather |
| REQ-DDB-WIKI-027 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → _site → build_wiki → _build_site → _test_flows |
| REQ-DDB-WIKI-028 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → _site → build_wiki → _build_site → _fetch_issues → provider_for |
| REQ-DDB-WIKI-029 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → _site → build_wiki → _build_site → write_exports |
| REQ-DDB-WIKI-031 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → _site → build_wiki → _build_site → find_decisions |
| REQ-DDB-WIKI-035 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → _trace_run |
| REQ-DDB-WIKI-036 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → _site → build_wiki → _build_site → root_name |
| REQ-DDB-WIKI-037 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → open_main |
| REQ-DDB-WIKI-038 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → _site → _markdown |
| REQ-DDB-WIKI-040 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → _site → check_wiki → trace_problems → composite_problems |
| REQ-DDB-WIKI-041 | measured | test_the_cli_prints_the_flow_as_json → wiki_main → _flow → _flow_object → derive_flow |
| REQ-DDB-WIKI-042 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → _site → _ears_notes |
| REQ-DDB-WIKI-043 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → _propose_modes |
| REQ-DDB-WIKI-045 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → _site → build_wiki → _build_site → symbol_pages → _section → _activity |
| REQ-DDB-WIKI-046 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → _site → build_wiki → _build_site → architecture_page |
| REQ-DDB-WIKI-047 | catalog | test_the_cli_prints_the_flow_as_json → wiki_main → _site → build_wiki → _build_site → _actor_of |
| REQ-DDB-WIKI-048 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → _site → build_wiki → _build_site → write_quick_views |
| REQ-DDB-WIKI-049 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → _trace_run → overlay → _step_values |
| REQ-DDB-WIKI-050 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → _site → build_wiki → _build_site → flow_page |
| REQ-DDB-WIKI-051 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → _site → build_wiki → _build_site → sbom_page |
| REQ-DDB-WIKI-052 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → _site → build_wiki → _build_site → tests_index |
| REQ-DDB-WIKI-053 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → _site → build_wiki → _build_site → api_pages |
| REQ-DDB-WIKI-054 | inferred | test_the_cli_prints_the_flow_as_json → wiki_main → _trace → requirement_evidence → _tier → all |
Source · 21 lines
def test_the_cli_prints_the_flow_as_json(
indexed: tuple[Path, Path], capsys: pytest.CaptureFixture[str]
) -> None:
"""@brief `clew wiki flow ENTRY --index DB --repo-root DIR` prints flow JSON with a version.
@return None.
@version 1
"""
from clew.wiki.command import wiki_main
db, repo = indexed
code = wiki_main(
["flow", "main", "--index", str(db), "--repo-root", str(repo), "--lanes", "files"]
)
data = json.loads(capsys.readouterr().out)
assert code == 0 and data["flow_version"] == 1 and data["entry"] == "main"
assert [s["callee"] for s in data["steps"]][:2] == ["load", "parse"]
# --- W12: animated sequence diagrams --------------------------------------------------------------
Activity · 6 steps
test_the_default_lane_strategy_is_blocks
None test_wiki_flow.test_the_default_lane_strategy_is_blocks()
P5.6: blocks by default.
Checks
assert FlowSpec(entry="main").lanes == "blocks"
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-WIKI-001 | catalog | |
| REQ-DDB-WIKI-008 | catalog | |
| REQ-DDB-WIKI-047 | catalog |
Source · 11 lines
def test_the_default_lane_strategy_is_blocks() -> None:
"""OWNER (round 5) RULING, which replaces the `files` default: a flow spec that names no lane
strategy gets block lanes.
@brief P5.6: blocks by default.
"""
from clew.wiki.config import FlowSpec
assert FlowSpec(entry="main").lanes == "blocks"
Activity · 2 steps
test_the_flow_verb_prints_svg
None test_wiki_flow.test_the_flow_verb_prints_svg(tmp_path, capsys, monkeypatch)
`clew wiki flow ENTRY --svg --animate` prints the animated diagram itself.
Checks
assert command.wiki_main(["flow", "a", "--index", str(db), "--svg", "--animate"]) == 0assert out.startswith("<svg") and "animation-delay" in out
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-CLI-001 | inferred | test_the_flow_verb_prints_svg → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → report_stats |
| REQ-DDB-CLI-002 | inferred | test_the_flow_verb_prints_svg → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → _doxygen_or_partial → _doxygen_stage → _run_doxygen_from_args → run_doxygen → doxygen_supports_sqlite3 |
| REQ-DDB-CONFIG-001 | inferred | test_the_flow_verb_prints_svg → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _apply_declared_document → stated_document_meta |
| REQ-DDB-CONFIG-003 | inferred | test_the_flow_verb_prints_svg → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_requirements_yaml → _is_flat_req_list |
| REQ-DDB-CONFIG-004 | inferred | test_the_flow_verb_prints_svg → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → resolve_preprocessor |
| REQ-DDB-CONFIG-005 | inferred | test_the_flow_verb_prints_svg → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → import_kconfig |
| REQ-DDB-CONFIG-006 | inferred | test_the_flow_verb_prints_svg → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _recorded_entry_patterns → recorded_explicit |
| REQ-DDB-CONFIG-007 | inferred | test_the_flow_verb_prints_svg → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → write_build_signature |
| REQ-DDB-CONFIG-009 | inferred | test_the_flow_verb_prints_svg → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _apply_toolchain_exclusions → load_toolchain_config |
| REQ-DDB-GUARD-012 | inferred | test_the_flow_verb_prints_svg → wiki_main → _trace → load_wiki_config → _requirements_section → read_requirements_section |
| REQ-DDB-GUARD-019 | inferred | test_the_flow_verb_prints_svg → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → enrich_python_docstrings → summarize → parse_doxygen_tags |
| REQ-DDB-GUARD-024 | inferred | test_the_flow_verb_prints_svg → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → enrich_python_docstrings → summarize → apply_autobrief |
| REQ-DDB-GUARD-027 | inferred | test_the_flow_verb_prints_svg → wiki_main → _site → check_wiki → trace_problems → catalog_requirements → read_catalog_at |
| REQ-DDB-INDEX-001 | inferred | test_the_flow_verb_prints_svg → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _verify_extra_input_is_read → effective_file_patterns |
| REQ-DDB-INDEX-002 | inferred | test_the_flow_verb_prints_svg → wiki_main → refresh_main → _run_pipeline → build_lock |
| REQ-DDB-INDEX-003 | inferred | test_the_flow_verb_prints_svg → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → report_index_coverage |
| REQ-DDB-INDEX-004 | inferred | test_the_flow_verb_prints_svg → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → recover_ast_symbols |
| REQ-DDB-INDEX-005 | inferred | test_the_flow_verb_prints_svg → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → stamp_external_provenance |
| REQ-DDB-INDEX-006 | inferred | test_the_flow_verb_prints_svg → wiki_main → refresh_main |
| REQ-DDB-INDEX-007 | inferred | test_the_flow_verb_prints_svg → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → record_owners |
| REQ-DDB-INDEX-008 | inferred | test_the_flow_verb_prints_svg → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_file_licenses |
| REQ-DDB-INDEX-009 | inferred | test_the_flow_verb_prints_svg → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_kerneldoc |
| REQ-DDB-INDEX-010 | inferred | test_the_flow_verb_prints_svg → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → import_ast_includes |
| REQ-DDB-INDEX-011 | inferred | test_the_flow_verb_prints_svg → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → import_property_keys |
| REQ-DDB-MCP-001 | inferred | test_the_flow_verb_prints_svg → wiki_main → refresh_main → target_for |
| REQ-DDB-PIPE-001 | inferred | test_the_flow_verb_prints_svg → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → enrich_database |
| REQ-DDB-PIPE-003 | inferred | test_the_flow_verb_prints_svg → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → build_call_edges |
| REQ-DDB-PIPE-004 | inferred | test_the_flow_verb_prints_svg → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → python_entry_seeds |
| REQ-DDB-PIPE-005 | inferred | test_the_flow_verb_prints_svg → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → write_build_signature |
| REQ-DDB-PIPE-006 | inferred | test_the_flow_verb_prints_svg → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → run_rustdoc → _require_nightly_rustdoc → clean_subprocess_env |
| REQ-DDB-PIPE-007 | inferred | test_the_flow_verb_prints_svg → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → import_kconfig_gates |
| REQ-DDB-PIPE-008 | inferred | test_the_flow_verb_prints_svg → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_file_docs |
| REQ-DDB-PIPE-009 | inferred | test_the_flow_verb_prints_svg → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → prune_dominated_fuzzy_call_edges |
| REQ-DDB-PIPE-010 | inferred | test_the_flow_verb_prints_svg → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → import_shared_key_edges_inferred → _build_inferred_edges |
| REQ-DDB-PIPE-011 | inferred | test_the_flow_verb_prints_svg → wiki_main → refresh_main → try_fast_refresh → _fast_refresh_locked → _plan → _line_anchors → _harvest_one_file → _parseable_file |
| REQ-DDB-PIPE-012 | inferred | test_the_flow_verb_prints_svg → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → build_harvest_plan → js_symbol_harvester |
| REQ-DDB-PIPE-013 | inferred | test_the_flow_verb_prints_svg → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → enrich_python_docstrings |
| REQ-DDB-PIPE-014 | inferred | test_the_flow_verb_prints_svg → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_kerneldoc → within_repo |
| REQ-DDB-PIPE-015 | inferred | test_the_flow_verb_prints_svg → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → import_config_defaults |
| REQ-DDB-QUERY-001 | inferred | test_the_flow_verb_prints_svg → wiki_main → _trace → requirement_evidence → connect |
| REQ-DDB-QUERY-003 | inferred | test_the_flow_verb_prints_svg → wiki_main → _flow → _flow_object → derive_flow → qualified_name_of |
| REQ-DDB-QUERY-004 | inferred | test_the_flow_verb_prints_svg → wiki_main → _site → build_wiki → _build_site → symbol_pages → _owners_by_file → file_owners |
| REQ-DDB-QUERY-010 | inferred | test_the_flow_verb_prints_svg → wiki_main → _site → check_wiki → _flow_problems → identity_rowids |
| REQ-DDB-QUERY-011 | inferred | test_the_flow_verb_prints_svg → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → extract_threads → _ensure_threads_tables |
| REQ-DDB-SCHEMA-001 | inferred | test_the_flow_verb_prints_svg → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → extract_threads |
| REQ-DDB-SCHEMA-002 | inferred | test_the_flow_verb_prints_svg → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → import_shared_key_edges_inferred → _writer_dispatch_map |
| REQ-DDB-SCHEMA-003 | inferred | test_the_flow_verb_prints_svg → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → import_callback_registration_edges → _ensure_external_boundaries_table |
| REQ-DDB-SCHEMA-004 | inferred | test_the_flow_verb_prints_svg → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → load_dispatch_manifest |
| REQ-DDB-SCHEMA-005 | inferred | test_the_flow_verb_prints_svg → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → resolve_key_alias_prefixes |
| REQ-DDB-SCHEMA-006 | inferred | test_the_flow_verb_prints_svg → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_requirements_yaml |
| REQ-DDB-SCHEMA-007 | inferred | test_the_flow_verb_prints_svg → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → import_callback_registration_edges → _ensure_external_boundaries_table |
| REQ-DDB-SCHEMA-009 | inferred | test_the_flow_verb_prints_svg → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → import_event_edges |
| REQ-DDB-SCHEMA-011 | inferred | test_the_flow_verb_prints_svg → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → extract_context_conflicts |
| REQ-DDB-SCHEMA-012 | inferred | test_the_flow_verb_prints_svg → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → load_dispatch_manifest → declaration_origin |
| REQ-DDB-SCHEMA-013 | inferred | test_the_flow_verb_prints_svg → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → import_data_model_keys |
| REQ-DDB-SCHEMA-014 | inferred | test_the_flow_verb_prints_svg → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_file_docs → ensure_file_docs_table |
| REQ-DDB-SCHEMA-015 | inferred | test_the_flow_verb_prints_svg → wiki_main → refresh_main → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_requirements_yaml |
| REQ-DDB-WIKI-001 | measured | test_the_flow_verb_prints_svg → wiki_main |
| REQ-DDB-WIKI-002 | inferred | test_the_flow_verb_prints_svg → wiki_main → _trace → requirement_evidence |
| REQ-DDB-WIKI-003 | inferred | test_the_flow_verb_prints_svg → wiki_main → _site → build_wiki |
| REQ-DDB-WIKI-004 | inferred | test_the_flow_verb_prints_svg → wiki_main → _site → build_wiki → _build_site → nodes_page |
| REQ-DDB-WIKI-005 | inferred | test_the_flow_verb_prints_svg → wiki_main → _site → build_wiki → report_limit |
| REQ-DDB-WIKI-006 | inferred | test_the_flow_verb_prints_svg → wiki_main → _site → check_wiki → trace_problems → _mutation_problems → parse_mutations |
| REQ-DDB-WIKI-007 | inferred | test_the_flow_verb_prints_svg → wiki_main → _diff → diff_versions |
| REQ-DDB-WIKI-008 | catalog | |
| REQ-DDB-WIKI-010 | inferred | test_the_flow_verb_prints_svg → wiki_main → _site → build_wiki → _build_site → parse_features |
| REQ-DDB-WIKI-011 | inferred | test_the_flow_verb_prints_svg → wiki_main → _site → build_wiki → _build_site → _render → sphinx_settings |
| REQ-DDB-WIKI-012 | inferred | test_the_flow_verb_prints_svg → wiki_main → _site → build_wiki → _build_site → requirements_page |
| REQ-DDB-WIKI-013 | inferred | test_the_flow_verb_prints_svg → wiki_main → _site → build_wiki → _build_site → _burndown → burndown |
| REQ-DDB-WIKI-014 | inferred | test_the_flow_verb_prints_svg → wiki_main → _site → build_wiki → _build_site → flow_page |
| REQ-DDB-WIKI-015 | inferred | test_the_flow_verb_prints_svg → wiki_main → _site → build_wiki → _build_site → _prose → impact_path |
| REQ-DDB-WIKI-016 | inferred | test_the_flow_verb_prints_svg → wiki_main → _site → build_wiki → _build_site → _coverage → parse_contexts |
| REQ-DDB-WIKI-018 | inferred | test_the_flow_verb_prints_svg → wiki_main → _site → build_wiki → _build_site → _all_flows → entry_point_flows |
| REQ-DDB-WIKI-019 | inferred | test_the_flow_verb_prints_svg → wiki_main → _site → build_wiki → _build_site → build_graph |
| REQ-DDB-WIKI-020 | inferred | test_the_flow_verb_prints_svg → wiki_main → _site → build_wiki → _build_site → write_quick_views → modal |
| REQ-DDB-WIKI-021 | inferred | test_the_flow_verb_prints_svg → wiki_main → _site → build_wiki → _build_site → minimap_html |
| REQ-DDB-WIKI-022 | inferred | test_the_flow_verb_prints_svg → wiki_main → _site → build_wiki → _build_site → requirements_page → requirement_pages |
| REQ-DDB-WIKI-023 | inferred | test_the_flow_verb_prints_svg → wiki_main → _site → build_wiki → _build_site → flows_index |
| REQ-DDB-WIKI-024 | inferred | test_the_flow_verb_prints_svg → wiki_main → _site → build_wiki → _build_site → impact_page |
| REQ-DDB-WIKI-025 | inferred | test_the_flow_verb_prints_svg → wiki_main → _site → build_wiki → _build_site → commit_published |
| REQ-DDB-WIKI-026 | inferred | test_the_flow_verb_prints_svg → wiki_main → _site → build_wiki → _build_site → gather |
| REQ-DDB-WIKI-027 | inferred | test_the_flow_verb_prints_svg → wiki_main → _site → build_wiki → _build_site → _test_flows |
| REQ-DDB-WIKI-028 | inferred | test_the_flow_verb_prints_svg → wiki_main → _site → build_wiki → _build_site → _fetch_issues → provider_for |
| REQ-DDB-WIKI-029 | inferred | test_the_flow_verb_prints_svg → wiki_main → _site → build_wiki → _build_site → write_exports |
| REQ-DDB-WIKI-031 | inferred | test_the_flow_verb_prints_svg → wiki_main → _site → build_wiki → _build_site → find_decisions |
| REQ-DDB-WIKI-035 | inferred | test_the_flow_verb_prints_svg → wiki_main → _trace_run |
| REQ-DDB-WIKI-036 | inferred | test_the_flow_verb_prints_svg → wiki_main → _site → build_wiki → _build_site → root_name |
| REQ-DDB-WIKI-037 | inferred | test_the_flow_verb_prints_svg → wiki_main → open_main |
| REQ-DDB-WIKI-038 | inferred | test_the_flow_verb_prints_svg → wiki_main → _site → _markdown |
| REQ-DDB-WIKI-040 | inferred | test_the_flow_verb_prints_svg → wiki_main → _site → check_wiki → trace_problems → composite_problems |
| REQ-DDB-WIKI-041 | inferred | test_the_flow_verb_prints_svg → wiki_main → _flow → _flow_object → derive_flow |
| REQ-DDB-WIKI-042 | inferred | test_the_flow_verb_prints_svg → wiki_main → _site → _ears_notes |
| REQ-DDB-WIKI-043 | inferred | test_the_flow_verb_prints_svg → wiki_main → _propose_modes |
| REQ-DDB-WIKI-045 | inferred | test_the_flow_verb_prints_svg → wiki_main → _site → build_wiki → _build_site → symbol_pages → _section → _activity |
| REQ-DDB-WIKI-046 | inferred | test_the_flow_verb_prints_svg → wiki_main → _site → build_wiki → _build_site → architecture_page |
| REQ-DDB-WIKI-047 | catalog | test_the_flow_verb_prints_svg → wiki_main → _site → build_wiki → _build_site → _actor_of |
| REQ-DDB-WIKI-048 | inferred | test_the_flow_verb_prints_svg → wiki_main → _site → build_wiki → _build_site → write_quick_views |
| REQ-DDB-WIKI-049 | inferred | test_the_flow_verb_prints_svg → wiki_main → _trace_run → overlay → _step_values |
| REQ-DDB-WIKI-050 | inferred | test_the_flow_verb_prints_svg → wiki_main → _site → build_wiki → _build_site → flow_page |
| REQ-DDB-WIKI-051 | inferred | test_the_flow_verb_prints_svg → wiki_main → _site → build_wiki → _build_site → sbom_page |
| REQ-DDB-WIKI-052 | inferred | test_the_flow_verb_prints_svg → wiki_main → _site → build_wiki → _build_site → tests_index |
| REQ-DDB-WIKI-053 | inferred | test_the_flow_verb_prints_svg → wiki_main → _site → build_wiki → _build_site → api_pages |
| REQ-DDB-WIKI-054 | inferred | test_the_flow_verb_prints_svg → wiki_main → _trace → requirement_evidence → _tier → all |
Source · 14 lines
def test_the_flow_verb_prints_svg(tmp_path, capsys, monkeypatch) -> None:
"""@brief `clew wiki flow ENTRY --svg --animate` prints the animated diagram itself.
@return None.
"""
from clew.wiki import command
monkeypatch.setattr(command, "_flow_object", lambda args, db, repo: _three_steps())
db = tmp_path / "clew.db"
db.write_bytes(b"")
assert command.wiki_main(["flow", "a", "--index", str(db), "--svg", "--animate"]) == 0
out = capsys.readouterr().out
assert out.startswith("<svg") and "animation-delay" in out