test_inferred_invalid_dispatch_mode_fails_closed

Tests › tests/test_r1_richness.py

passed Passed in the packaged run.

What this test is for

Why it exists

An invalid declared dispatch_mode REFUSES the build with a DeclarationError naming the file, the token and the allowed set.

Verifies REQ-DDB-SCHEMA-001 REQ-DDB-SCHEMA-002 REQ-DDB-SCHEMA-003 REQ-DDB-SCHEMA-004 REQ-DDB-SCHEMA-007

Given

  1. src = tmp_path / "src"
  2. src.mkdir()
4 more
  1. (src / "foo.c").write_text( "void producer(void) { QUEUESEND(&q, m); }\n" "void consumer(void) { QUEUERECEIVE(&q, &m); }\n", )
  2. db = _make_db(tmp_path, [(1, "producer", 1, 1), (2, "consumer", 2, 2)])
  3. patterns = tmp_path / "patterns.yaml"
  4. patterns.write_text( "writers:\n" " - pattern: QUEUESEND\n" " key_arg_index: 0\n" " dispatch_mode: sync\n" # INVALID — not in the CHECK set "readers:\n" " - pattern: QUEUERECEIVE\n" " key_arg_index: 0\n", )
→

When

  1. import_shared_key_edges_inferred(db, tmp_path, patterns)
  2. message = str(exc.value)
→

Then

  1. ✓ raises DeclarationError
  2. ✓ message contains "patterns.yaml"
  3. ✓ message contains "'sync'"
  4. ✓ message contains "inline, queued, keyed, unknown"

tests/test_r1_richness.py:720 · its file's page

What it checks (3)

  1. assert "patterns.yaml" in message not attributed
  2. assert "'sync'" in message not attributed
  3. assert "inline, queued, keyed, unknown" in message 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_inferred_invalid_dispatch_mode_fails_closed→import_shared_key_edges_inferred

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_inferred_invalid_dispatch_mode_fails_closed · 3 checksimport_shared_key_edges_inferredshared_key_harvesterresolve_shared_key_patternsREQ-DDB-CONFIG-006 · measuredimport_shared_key_edges_inferred_log_undeclared_accessor_hintdetect_undeclared_accessor_familiesREQ-DDB-CONFIG-007 · inferredimport_shared_key_edges_inferred… 3 calls …hash_fileREQ-DDB-INDEX-002 · inferredimport_shared_key_edges_inferred_walk_all_files_for_shared_keysrun_harvestREQ-DDB-PIPE-003 · inferredimport_shared_key_edges_inferred_build_inferred_edgesREQ-DDB-PIPE-010 · inferredimport_shared_key_edges_inferred… 3 calls …_parseable_fileREQ-DDB-PIPE-011 · inferredimport_shared_key_edges_inferred… 5 calls …has_languageREQ-DDB-PIPE-012 · inferredimport_shared_key_edges_inferred_writer_dispatch_mapREQ-DDB-SCHEMA-002 · catalogimport_shared_key_edges_inferredREQ-DDB-SCHEMA-005 · measuredimport_shared_key_edges_inferred_ensure_shared_key_edges_tableREQ-DDB-SCHEMA-007 · catalogimport_shared_key_edges_inferred… 3 calls …declaration_originREQ-DDB-SCHEMA-012 · measured

Requirements it verifies (5)

requirementlinked byimplementers exercised
REQ-DDB-SCHEMA-001catalogunknown
REQ-DDB-SCHEMA-002catalog1 of 2: _writer_dispatch_map
REQ-DDB-SCHEMA-003catalogunknown
REQ-DDB-SCHEMA-004catalogunknown
REQ-DDB-SCHEMA-007catalog1 of 3: _ensure_shared_key_edges_table
Also reaches 9 requirements

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