test_build_meta_records_the_stated_declaration

Tests › tests/test_declaration.py

passed Passed in the packaged run.

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

  1. db = tmp_path / "clew.db"
→

When

  1. write_build_signature(db, declaration={"stated_sha256": "ab" * 32, "stated_sections": "locks"})
  2. conn = sqlite3.connect(str(db))
  3. held = dict(conn.execute("SELECT key, value FROM build_meta"))
6 more
  1. conn.close()
  2. db2 = tmp_path / "plain.db"
  3. write_build_signature(db2)
  4. conn = sqlite3.connect(str(db2))
  5. held2 = dict(conn.execute("SELECT key, value FROM build_meta"))
  6. conn.close()
→

Then

  1. ✓ held["declaration.stated_sha256"] equals "ab" * 32
  2. ✓ held["declaration.stated_sections"] equals "locks"
  3. ✓ [k for k in held2 if k.startswith("declaration.")] is false

tests/test_declaration.py:347 · its file's page

What it checks (3)

  1. assert held["declaration.stated_sha256"] == "ab" * 32 not attributed
  2. assert held["declaration.stated_sections"] == "locks" not attributed
  3. assert 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

test_build_meta_records_the_stated_declaration→write_build_signature

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_build_meta_records_the_stated_declaration · 3 checkswrite_build_signatureREQ-DDB-CONFIG-006 · measuredwrite_build_signatureREQ-DDB-CONFIG-007 · measuredwrite_build_signatureREQ-DDB-PIPE-005 · measured

Requirements it verifies (1)

requirementlinked byimplementers exercised
REQ-DDB-CONFIG-001catalogunknown
Also reaches 3 requirements

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