test_build_meta_records_the_stated_declaration¶
Tests › tests/test_declaration.py
What this test is for
Why it exists
Both halves. A recorded document is what makes the harness gate possible; an ABSENT section is what makes "no document was stated" honestly readable, rather than presenting as a statement that was made and was blank.
Verifies REQ-DDB-CONFIG-001
Given
db = tmp_path / "clew.db"
When
write_build_signature(db, declaration={"stated_sha256": "ab" * 32, "stated_sections": "locks"})conn = sqlite3.connect(str(db))held = dict(conn.execute("SELECT key, value FROM build_meta"))
6 more
conn.close()db2 = tmp_path / "plain.db"write_build_signature(db2)conn = sqlite3.connect(str(db2))held2 = dict(conn.execute("SELECT key, value FROM build_meta"))conn.close()
Then
- ✓ held["declaration.stated_sha256"] equals "ab" * 32
- ✓ held["declaration.stated_sections"] equals "locks"
- ✓ [k for k in held2 if k.startswith("declaration.")] is false
tests/test_declaration.py:347 · its file's page
What it checks (3)
assert held["declaration.stated_sha256"] == "ab" * 32not attributedassert held["declaration.stated_sections"] == "locks"not attributedassert not [k for k in held2 if k.startswith("declaration.")], ( "a build with no stated document must write NO declaration row — the harness gate reads " "absence as 'not stated', so a placeholder row would certify a policy nobody stated" )not attributed
Where the product reaches it
No product flow reaches this code: no product entry point's flow calls any of the functions this test calls.
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.
Requirements it verifies (1)
| requirement | linked by | implementers exercised |
|---|---|---|
| REQ-DDB-CONFIG-001 | catalog | unknown |
Also reaches 3 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-CONFIG-006 measured
- REQ-DDB-CONFIG-007 measured
- REQ-DDB-PIPE-005 measured