test_a_requirement_name_cannot_forge_table_rows¶
Tests › tests/guard/test_guard_impact.py
What this test is for
Why it exists
The names come from the TARGET'S requirements catalog, and the rendered table is written to `docs/generated/impact/impact.md`, `git add`ed, and printed to stderr — where it lands in the agent's context. A name carrying `|` forges columns; one carrying a newline forges ROWS, so a catalog can write arbitrary content into a file the developer is about to commit and into the transcript of whatever is watching the commit.
Given
entry = ImpactEntry( req_id="REQ-001", req_name="Name | with pipes\n| FORGED | ROW | here |\nand more", functions=[ ChangedFunction( name="fn\n| SECOND | FORGED | ROW |", file_path="a.c", new_version="1.0" ) ], )
When
report = format_markdown([entry])rows = [line for line in report.splitlines() if line.startswith("|")]
Then
- ✓ len(rows) equals 3
- ✓ report contains "FORGED"
- ✓ report does not contain "\n| FORGED"
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.
`main` (clew/guard/main.py) · 7 of 357 steps
… 280 earlier steps
… 66 later steps
tests/guard/test_guard_impact.py:593 · its file's page
What it checks (3)
assert len(rows) == 3, f"repo text forged table rows: {rows}"not attributedassert "FORGED" in report, ( "the text must still be REPORTED — this is escaping, not filtering" )observesformat_markdownviareportassert "\n| FORGED" not in reportobservesformat_markdownviareport
Where the product reaches it
main→_run→run_precommit→format_markdown(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 1 requirement
Its run touches their code; that is reach, not proof.
- REQ-DDB-GUARD-010 measured