test_qualified_subject.py

tests/test_qualified_subject.py

clew SERVED THE SPELLING, THEN REFUSED IT (C7).

test_a_file_path_is_not_mistaken_for_a_qualified_name

None test_qualified_subject.test_a_file_path_is_not_mistaken_for_a_qualified_name(Path tmp_path)

A file path is tried as a file before being split as a qualified name.

tests/test_qualified_subject.py:193

Show on the map →

Called by none

Calls dossier

Checks

  • assert built is not None
  • assert built.kind == "file", f"a path must resolve as a file, not be split: {built.kind}"

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-INDEX-004inferredtest_a_file_path_is_not_mistaken_for_a_qualified_name → dossier → _chain_for → chain_trace → candidate_rows → symbol_provenance
REQ-DDB-QUERY-001measuredtest_a_file_path_is_not_mistaken_for_a_qualified_name → dossier → connect
REQ-DDB-QUERY-002inferredtest_a_file_path_is_not_mistaken_for_a_qualified_name → dossier → _chain_for → chain_trace
REQ-DDB-QUERY-003measuredtest_a_file_path_is_not_mistaken_for_a_qualified_name → dossier → identity_rowids
REQ-DDB-QUERY-004measured
REQ-DDB-QUERY-005inferredtest_a_file_path_is_not_mistaken_for_a_qualified_name → dossier → _chain_for → chain_trace → _make_node
REQ-DDB-QUERY-010measuredtest_a_file_path_is_not_mistaken_for_a_qualified_name → dossier → identity_rowids
REQ-DDB-QUERY-012measured
REQ-DDB-QUERY-013measuredtest_a_file_path_is_not_mistaken_for_a_qualified_name → dossier → _qualified_reread → _split_qualified → bare_tail
REQ-DDB-WIKI-054inferredtest_a_file_path_is_not_mistaken_for_a_qualified_name → dossier → _rank_enum_over_mirror → _class_side_is_only_enum_mirrors → all
Source · 21 lines
def test_a_file_path_is_not_mistaken_for_a_qualified_name(tmp_path: Path) -> None:
    """ORDER OF RESOLUTION, PINNED. `src/app.ts` contains a `.`, so a split-first implementation
    would read it as owner `src/app` and member `ts`. C1 made a path a subject in its own right,
    and the two features have to compose: the path resolves as a FILE, and the split never sees
    it.
    """
    db = tmp_path / "clew.db"
    conn = sqlite3.connect(str(db))
    conn.execute("CREATE TABLE path (rowid INTEGER PRIMARY KEY, name TEXT, type INTEGER)")
    conn.execute("INSERT INTO path (name, type) VALUES ('src/app.ts', 1)")
    conn.commit()
    conn.close()

    built = q.dossier(db, "src/app.ts")
    assert built is not None
    assert built.kind == "file", f"a path must resolve as a file, not be split: {built.kind}"


# ─── the spelling the model actually produced: partial qualification ─────────

Activity · 9 steps
lines 199–199db = tmp_path / "clew.db"lines 200–200conn = sqlite3.connect(str(db))lines 201–201conn.execute("CREATE TABLE path (rowid INTEGER PRIMARY KEY, name TEXT, type INTEGER)")lines 202–202conn.execute("INSERT INTO path (name, type) VALUES ('src/app.ts', 1)")lines 203–203conn.commit()lines 204–204conn.close()lines 206–206built = q.dossier(db, "src/app.ts")lines 207–207assert built is not Nonelines 208–208assert built.kind == "file", f"a path must resolve as a file, not be split: {built.kind}"

test_a_free_functions_signature_resolves

None test_qualified_subject.test_a_free_functions_signature_resolves(Path owned)

A free function's signature resolves to the free function.

tests/test_qualified_subject.py:367

Show on the map →

Called by none

Calls dossier

Checks

  • assert built is not None
  • assert built.function.brief == "the health loop"

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-INDEX-004measuredtest_a_free_functions_signature_resolves → dossier → _chain_for → chain_trace → candidate_rows → symbol_provenance
REQ-DDB-QUERY-001measuredtest_a_free_functions_signature_resolves → dossier → connect
REQ-DDB-QUERY-002measuredtest_a_free_functions_signature_resolves → dossier → _chain_for → chain_trace
REQ-DDB-QUERY-003measuredtest_a_free_functions_signature_resolves → dossier → identity_rowids
REQ-DDB-QUERY-004measured
REQ-DDB-QUERY-005inferredtest_a_free_functions_signature_resolves → dossier → _chain_for → chain_trace → _make_node
REQ-DDB-QUERY-006measured
REQ-DDB-QUERY-009measured
REQ-DDB-QUERY-010measuredtest_a_free_functions_signature_resolves → dossier → identity_rowids
REQ-DDB-QUERY-012measured
REQ-DDB-QUERY-013inferredtest_a_free_functions_signature_resolves → dossier → _qualified_reread → _split_qualified → bare_tail
REQ-DDB-SCHEMA-011measured
REQ-DDB-WIKI-054inferredtest_a_free_functions_signature_resolves → dossier → _rank_enum_over_mirror → _class_side_is_only_enum_mirrors → all
Source · 10 lines
def test_a_free_functions_signature_resolves(owned: Path) -> None:
    """`void mbedtls_strerror(int ret, char *buf, size_t buflen)` is one of the twelve, and it
    names no owner — so recovery yields the bare name, there is nothing to disambiguate, and the
    right answer is the function rather than a refusal.
    """
    built = q.dossier(owned, "monitor_loop", qualified="void HealthMonitor::monitor_loop(void)")
    assert built is not None
    assert built.function.brief == "the health loop"

Activity · 3 steps
lines 372–372built = q.dossier(owned, "monitor_loop", qualified="void HealthMonitor::monitor_loop(void)")lines 373–373assert built is not Nonelines 374–374assert built.function.brief == "the health loop"

test_a_partially_qualified_spelling_resolves

None test_qualified_subject.test_a_partially_qualified_spelling_resolves(Path namespaced)

A partially qualified spelling resolves when it is unambiguous.

tests/test_qualified_subject.py:284

Show on the map →

Called by none

Calls dossier

Checks

  • assert built is not None, "the spelling clew serves under threads[].name must be a subject"
  • assert built.function.brief == "the health loop", built.function.brief
  • assert other is not None
  • assert other.function.brief == "the watchdog loop", other.function.brief

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-INDEX-004measuredtest_a_partially_qualified_spelling_resolves → dossier → _chain_for → chain_trace → candidate_rows → symbol_provenance
REQ-DDB-QUERY-001measuredtest_a_partially_qualified_spelling_resolves → dossier → connect
REQ-DDB-QUERY-002measuredtest_a_partially_qualified_spelling_resolves → dossier → _chain_for → chain_trace
REQ-DDB-QUERY-003measuredtest_a_partially_qualified_spelling_resolves → dossier → identity_rowids
REQ-DDB-QUERY-004measured
REQ-DDB-QUERY-005inferredtest_a_partially_qualified_spelling_resolves → dossier → _chain_for → chain_trace → _make_node
REQ-DDB-QUERY-006measured
REQ-DDB-QUERY-009measured
REQ-DDB-QUERY-010measuredtest_a_partially_qualified_spelling_resolves → dossier → identity_rowids
REQ-DDB-QUERY-012measured
REQ-DDB-QUERY-013measuredtest_a_partially_qualified_spelling_resolves → dossier → _qualified_reread → _split_qualified → bare_tail
REQ-DDB-SCHEMA-011measured
REQ-DDB-WIKI-054inferredtest_a_partially_qualified_spelling_resolves → dossier → _rank_enum_over_mirror → _class_side_is_only_enum_mirrors → all
Source · 15 lines
def test_a_partially_qualified_spelling_resolves(namespaced: Path) -> None:
    """THE SPELLING 9 OF 12 MEASURED MISSES ACTUALLY USED. `HealthMonitor::monitor_loop` is what
    `search(corpus="threads")` serves and what a reader writes; the index holds
    `entropic::HealthMonitor::monitor_loop`. An exact comparison refuses it, which is the refusal
    this whole finding is about.
    """
    built = q.dossier(namespaced, "HealthMonitor::monitor_loop")
    assert built is not None, "the spelling clew serves under threads[].name must be a subject"
    assert built.function.brief == "the health loop", built.function.brief

    other = q.dossier(namespaced, "Watchdog::monitor_loop")
    assert other is not None
    assert other.function.brief == "the watchdog loop", other.function.brief

Activity · 6 steps
lines 290–290built = q.dossier(namespaced, "HealthMonitor::monitor_loop")lines 291–291assert built is not None, "the spelling clew serves under threads[].name must be a subject"lines 292–292assert built.function.brief == "the health loop", built.function.brieflines 294–294other = q.dossier(namespaced, "Watchdog::monitor_loop")lines 295–295assert other is not Nonelines 296–296assert other.function.brief == "the watchdog loop", other.function.brief

test_a_qualified_spelling_for_an_absent_owner_still_misses

None test_qualified_subject.test_a_qualified_spelling_for_an_absent_owner_still_misses(Path owned)

A qualified spelling naming nothing is still a definitive negative.

tests/test_qualified_subject.py:155

Show on the map →

Called by none

Calls dossier

Checks

  • assert q.dossier(owned, "Nonexistent::monitor_loop") is None

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-INDEX-004inferredtest_a_qualified_spelling_for_an_absent_owner_still_misses → dossier → _chain_for → chain_trace → candidate_rows → symbol_provenance
REQ-DDB-QUERY-001measuredtest_a_qualified_spelling_for_an_absent_owner_still_misses → dossier → connect
REQ-DDB-QUERY-002inferredtest_a_qualified_spelling_for_an_absent_owner_still_misses → dossier → _chain_for → chain_trace
REQ-DDB-QUERY-003measuredtest_a_qualified_spelling_for_an_absent_owner_still_misses → dossier → identity_rowids
REQ-DDB-QUERY-004measured
REQ-DDB-QUERY-005inferredtest_a_qualified_spelling_for_an_absent_owner_still_misses → dossier → _chain_for → chain_trace → _make_node
REQ-DDB-QUERY-010measuredtest_a_qualified_spelling_for_an_absent_owner_still_misses → dossier → identity_rowids
REQ-DDB-QUERY-012measured
REQ-DDB-QUERY-013measuredtest_a_qualified_spelling_for_an_absent_owner_still_misses → dossier → _qualified_reread → _split_qualified → bare_tail
REQ-DDB-WIKI-054inferredtest_a_qualified_spelling_for_an_absent_owner_still_misses → dossier → _rank_enum_over_mirror → _class_side_is_only_enum_mirrors → all
Source · 13 lines
def test_a_qualified_spelling_for_an_absent_owner_still_misses(owned: Path) -> None:
    """THE SPLIT MUST NOT INVENT A HIT. `Nonexistent::monitor_loop` has an indexed TAIL, which is
    precisely the shape that would resolve if the implementation split the string and then ignored
    the owner. Answering it would describe one of the two real methods under a name that is not
    theirs.

    This is the `absence is not emptiness` half of the fix: a spelling the index does not hold
    must still come back as a miss, and the recovery hint — which already tells the caller to
    split — remains the right reply for it.
    """
    assert q.dossier(owned, "Nonexistent::monitor_loop") is None

Activity · 1 steps
lines 165–165assert q.dossier(owned, "Nonexistent::monitor_loop") is None

test_a_qualified_subject_resolves_to_that_identity

None test_qualified_subject.test_a_qualified_subject_resolves_to_that_identity(Path owned)

A qualified subject resolves to the identity it names.

tests/test_qualified_subject.py:102

Show on the map →

Called by none

Calls dossier

Checks

  • assert built is not None, "a qualified spelling clew serves must be a usable subject"
  • assert built.kind == "function"
  • assert built.function.brief == "the health loop", (f"resolved the wrong owner's method: {built.function.brief!r}" )

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-INDEX-004measuredtest_a_qualified_subject_resolves_to_that_identity → dossier → _chain_for → chain_trace → candidate_rows → symbol_provenance
REQ-DDB-QUERY-001measuredtest_a_qualified_subject_resolves_to_that_identity → dossier → connect
REQ-DDB-QUERY-002measuredtest_a_qualified_subject_resolves_to_that_identity → dossier → _chain_for → chain_trace
REQ-DDB-QUERY-003measuredtest_a_qualified_subject_resolves_to_that_identity → dossier → identity_rowids
REQ-DDB-QUERY-004measured
REQ-DDB-QUERY-005inferredtest_a_qualified_subject_resolves_to_that_identity → dossier → _chain_for → chain_trace → _make_node
REQ-DDB-QUERY-006measured
REQ-DDB-QUERY-009measured
REQ-DDB-QUERY-010measuredtest_a_qualified_subject_resolves_to_that_identity → dossier → identity_rowids
REQ-DDB-QUERY-012measured
REQ-DDB-QUERY-013measuredtest_a_qualified_subject_resolves_to_that_identity → dossier → _qualified_reread → _split_qualified → bare_tail
REQ-DDB-SCHEMA-011measured
REQ-DDB-WIKI-054inferredtest_a_qualified_subject_resolves_to_that_identity → dossier → _rank_enum_over_mirror → _class_side_is_only_enum_mirrors → all
Source · 17 lines
def test_a_qualified_subject_resolves_to_that_identity(owned: Path) -> None:
    """RED BEFORE THE FIX: `resolve_subject` probes `memberdef.name`, which holds `monitor_loop`,
    so the qualified spelling matches nothing and the reply is a definitive negative about a
    symbol the index describes fully.

    Asserted on WHICH identity came back, not merely that something did. Returning the other
    owner's method would be worse than the refusal it replaces — a confident answer about the
    wrong function is the failure this repository keeps paying for.
    """
    built = q.dossier(owned, "HealthMonitor::monitor_loop")
    assert built is not None, "a qualified spelling clew serves must be a usable subject"
    assert built.kind == "function"
    assert built.function.brief == "the health loop", (
        f"resolved the wrong owner's method: {built.function.brief!r}"
    )

Activity · 4 steps
lines 111–111built = q.dossier(owned, "HealthMonitor::monitor_loop")lines 112–112assert built is not None, "a qualified spelling clew serves must be a usable subject"lines 113–113assert built.kind == "function"lines 114–116assert built.function.brief == "the health loop", ( f"resolved the wrong owner's method: {built.function.brief!r}" )

test_a_signature_for_an_absent_owner_is_still_refused

None test_qualified_subject.test_a_signature_for_an_absent_owner_is_still_refused(Path namespaced)

A signature naming an owner the index lacks is still refused.

tests/test_qualified_subject.py:379

Show on the map →

Called by none

Calls dossier

Checks

  • assert q.dossier(namespaced, "monitor_loop", qualified="void Absent::monitor_loop(int)") is None

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-INDEX-004inferredtest_a_signature_for_an_absent_owner_is_still_refused → dossier → _chain_for → chain_trace → candidate_rows → symbol_provenance
REQ-DDB-QUERY-001measuredtest_a_signature_for_an_absent_owner_is_still_refused → dossier → connect
REQ-DDB-QUERY-002inferredtest_a_signature_for_an_absent_owner_is_still_refused → dossier → _chain_for → chain_trace
REQ-DDB-QUERY-003measuredtest_a_signature_for_an_absent_owner_is_still_refused → dossier → identity_rowids
REQ-DDB-QUERY-004measured
REQ-DDB-QUERY-005inferredtest_a_signature_for_an_absent_owner_is_still_refused → dossier → _chain_for → chain_trace → _make_node
REQ-DDB-QUERY-010measuredtest_a_signature_for_an_absent_owner_is_still_refused → dossier → identity_rowids
REQ-DDB-QUERY-012measured
REQ-DDB-QUERY-013inferredtest_a_signature_for_an_absent_owner_is_still_refused → dossier → _qualified_reread → _split_qualified → bare_tail
REQ-DDB-WIKI-054inferredtest_a_signature_for_an_absent_owner_is_still_refused → dossier → _rank_enum_over_mirror → _class_side_is_only_enum_mirrors → all
Source · 7 lines
def test_a_signature_for_an_absent_owner_is_still_refused(namespaced: Path) -> None:
    """THE BOUND. Recovery must not degrade into "ignore the selector and answer the bare name" —
    that would hand back `HealthMonitor::monitor_loop` to a caller who asked for `Absent`'s, under
    the name they asked for, which is the confidently-wrong-symbol failure this repository keeps
    paying for.
    """
    assert q.dossier(namespaced, "monitor_loop", qualified="void Absent::monitor_loop(int)") is None

1 more lines, not shown

Activity · 1 steps
lines 385–385assert q.dossier(namespaced, "monitor_loop", qualified="void Absent::monitor_loop(int)") is None

test_a_signature_passed_as_the_selector_still_selects

None test_qualified_subject.test_a_signature_passed_as_the_selector_still_selects(Path namespaced, str selector)

A signature passed as qualified selects the identity it names.

tests/test_qualified_subject.py:343

Show on the map →

Called by none

Calls dossier

Checks

  • assert built is not None, f"a signature selector resolved to nothing: {selector!r}"
  • assert built.function.brief == "the health loop", built.function.brief

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-INDEX-004measuredtest_a_signature_passed_as_the_selector_still_selects → dossier → _chain_for → chain_trace → candidate_rows → symbol_provenance
REQ-DDB-QUERY-001measuredtest_a_signature_passed_as_the_selector_still_selects → dossier → connect
REQ-DDB-QUERY-002measuredtest_a_signature_passed_as_the_selector_still_selects → dossier → _chain_for → chain_trace
REQ-DDB-QUERY-003measuredtest_a_signature_passed_as_the_selector_still_selects → dossier → identity_rowids
REQ-DDB-QUERY-004measured
REQ-DDB-QUERY-005inferredtest_a_signature_passed_as_the_selector_still_selects → dossier → _chain_for → chain_trace → _make_node
REQ-DDB-QUERY-006measured
REQ-DDB-QUERY-009measured
REQ-DDB-QUERY-010measuredtest_a_signature_passed_as_the_selector_still_selects → dossier → identity_rowids
REQ-DDB-QUERY-012measured
REQ-DDB-QUERY-013inferredtest_a_signature_passed_as_the_selector_still_selects → dossier → _qualified_reread → _split_qualified → bare_tail
REQ-DDB-SCHEMA-011measured
REQ-DDB-WIKI-054inferredtest_a_signature_passed_as_the_selector_still_selects → dossier → _rank_enum_over_mirror → _class_side_is_only_enum_mirrors → all
Source · 22 lines
def test_a_signature_passed_as_the_selector_still_selects(namespaced: Path, selector: str) -> None:
    """EVERY `qualified` VALUE THE 1.1.0 AGENTS PASSED WAS A SIGNATURE. Twelve distinct
    (subject, qualified) pairs across the frozen grid, and all twelve carried a return type —
    `std::vector< int32_t > entropic::LlamaCppTokenizer::tokenize(const std::string &text, bool
    add_special) const override` is one of them verbatim. Every one resolved to nothing.

    THEY WERE OBEYING THE SERVED TEXT, which said at the time: *"The exact signature from a
    previous reply's `candidates`."* 655952c corrected that sentence, so a 1.2.0 agent should pass
    the right thing — but the thirteen wasted calls are already measured, the correction cannot
    reach a model that learned the old wording, and a selector that rejects the string this
    surface spent a release advertising is a trap left armed for no benefit.

    RECOVERED WITH `qualified_name_of`, THE SAME RULE THE SELECTOR ACCEPTS, after stripping the
    argument list — not a second signature parser. That function already scans tokens from the
    right for one whose tail is `name` at a `::` boundary; it returns the bare name when an
    argument list is present, which is why the strip comes first.
    """
    built = q.dossier(namespaced, "monitor_loop", qualified=selector)
    assert built is not None, f"a signature selector resolved to nothing: {selector!r}"
    assert built.function.brief == "the health loop", built.function.brief

Activity · 3 steps
lines 360–360built = q.dossier(namespaced, "monitor_loop", qualified=selector)lines 361–361assert built is not None, f"a signature selector resolved to nothing: {selector!r}"lines 362–362assert built.function.brief == "the health loop", built.function.brief

test_an_ambiguous_suffix_does_not_resolve_to_an_arbitrary_owner

None test_qualified_subject.test_an_ambiguous_suffix_does_not_resolve_to_an_arbitrary_owner(Path namespaced)

An ambiguous suffix refuses rather than picking.

tests/test_qualified_subject.py:301

Checks

  • assert _split_qualified(namespaced, "::monitor_loop") is None, ("a suffix matching both identities must not resolve to whichever sorted first" )

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-QUERY-001measuredtest_an_ambiguous_suffix_does_not_resolve_to_an_arbitrary_owner → _split_qualified → connect
REQ-DDB-QUERY-003measuredtest_an_ambiguous_suffix_does_not_resolve_to_an_arbitrary_owner → _split_qualified → identity_rowids
REQ-DDB-QUERY-010measuredtest_an_ambiguous_suffix_does_not_resolve_to_an_arbitrary_owner → _split_qualified → identity_rowids
REQ-DDB-QUERY-013measuredtest_an_ambiguous_suffix_does_not_resolve_to_an_arbitrary_owner → _split_qualified → bare_tail
Source · 15 lines
def test_an_ambiguous_suffix_does_not_resolve_to_an_arbitrary_owner(namespaced: Path) -> None:
    """THE BOUND ON THE MATCH, and the reason it is a suffix match and not a substring one. A
    suffix shared by two identities names neither, and answering it would be the arbitrary pick
    reported as the answer that this module's `also` field exists to prevent.

    `monitor_loop` bare is NOT this case — it resolves normally and discloses both through
    `candidates`. This is about a PARTIAL qualification that still fails to single one out.
    """
    from clew.query.subject import _split_qualified

    assert _split_qualified(namespaced, "::monitor_loop") is None, (
        "a suffix matching both identities must not resolve to whichever sorted first"
    )

Activity · 2 steps
lines 309–309from clew.query.subject import _split_qualifiedlines 311–313assert _split_qualified(namespaced, "::monitor_loop") is None, ( "a suffix matching both identities must not resolve to whichever sorted first" )

test_an_explicit_selector_is_not_overridden_by_the_split

None test_qualified_subject.test_an_explicit_selector_is_not_overridden_by_the_split(Path owned)

An explicit qualified argument still wins over a qualified subject.

tests/test_qualified_subject.py:170

Show on the map →

Called by none

Calls dossier

Checks

  • assert built is not None
  • assert built.function.brief == "the watchdog loop"
  • assert conflicting is None or conflicting.function.brief == "the watchdog loop", ("an explicit selector must not be overridden by a qualified subject" )

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-INDEX-004measuredtest_an_explicit_selector_is_not_overridden_by_the_split → dossier → _chain_for → chain_trace → candidate_rows → symbol_provenance
REQ-DDB-QUERY-001measuredtest_an_explicit_selector_is_not_overridden_by_the_split → dossier → connect
REQ-DDB-QUERY-002measuredtest_an_explicit_selector_is_not_overridden_by_the_split → dossier → _chain_for → chain_trace
REQ-DDB-QUERY-003measuredtest_an_explicit_selector_is_not_overridden_by_the_split → dossier → identity_rowids
REQ-DDB-QUERY-004measured
REQ-DDB-QUERY-005inferredtest_an_explicit_selector_is_not_overridden_by_the_split → dossier → _chain_for → chain_trace → _make_node
REQ-DDB-QUERY-006measured
REQ-DDB-QUERY-009measured
REQ-DDB-QUERY-010measuredtest_an_explicit_selector_is_not_overridden_by_the_split → dossier → identity_rowids
REQ-DDB-QUERY-012measured
REQ-DDB-QUERY-013inferredtest_an_explicit_selector_is_not_overridden_by_the_split → dossier → _qualified_reread → _split_qualified → bare_tail
REQ-DDB-SCHEMA-011measured
REQ-DDB-WIKI-054inferredtest_an_explicit_selector_is_not_overridden_by_the_split → dossier → _rank_enum_over_mirror → _class_side_is_only_enum_mirrors → all
Source · 21 lines
def test_an_explicit_selector_is_not_overridden_by_the_split(owned: Path) -> None:
    """A caller that passed BOTH has disambiguated deliberately, and the documented rule is that
    `subject` stays bare when `qualified` is supplied. The split must not reinterpret the subject
    out from under an explicit selector — and a contradictory pair must refuse rather than pick,
    for the same reason an explicit `kind` is a filter and never an override.
    """
    built = q.dossier(owned, "monitor_loop", qualified="Watchdog::monitor_loop")
    assert built is not None
    assert built.function.brief == "the watchdog loop"

    ## Subject and selector naming different identities: the selector is what the caller
    ## disambiguated with, so it decides, and the contradiction cannot silently resolve to the
    ## subject's own owner.
    conflicting = q.dossier(
        owned, "HealthMonitor::monitor_loop", qualified="Watchdog::monitor_loop"
    )
    assert conflicting is None or conflicting.function.brief == "the watchdog loop", (
        "an explicit selector must not be overridden by a qualified subject"
    )

Activity · 5 steps
lines 176–176built = q.dossier(owned, "monitor_loop", qualified="Watchdog::monitor_loop")lines 177–177assert built is not Nonelines 178–178assert built.function.brief == "the watchdog loop"lines 183–185conflicting = q.dossier( owned, "HealthMonitor::monitor_loop", qualified="Watchdog::monitor_loop" )lines 186–188assert conflicting is None or conflicting.function.brief == "the watchdog loop", ( "an explicit selector must not be overridden by a qualified subject" )

test_each_owner_is_reachable_by_its_own_spelling

None test_qualified_subject.test_each_owner_is_reachable_by_its_own_spelling(Path owned)

Both owners are separately reachable by their own qualified spelling.

tests/test_qualified_subject.py:121

Show on the map →

Called by none

Calls dossier

Checks

  • assert briefs == {

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-INDEX-004measuredtest_each_owner_is_reachable_by_its_own_spelling → dossier → _chain_for → chain_trace → candidate_rows → symbol_provenance
REQ-DDB-QUERY-001measuredtest_each_owner_is_reachable_by_its_own_spelling → dossier → connect
REQ-DDB-QUERY-002measuredtest_each_owner_is_reachable_by_its_own_spelling → dossier → _chain_for → chain_trace
REQ-DDB-QUERY-003measuredtest_each_owner_is_reachable_by_its_own_spelling → dossier → identity_rowids
REQ-DDB-QUERY-004measured
REQ-DDB-QUERY-005inferredtest_each_owner_is_reachable_by_its_own_spelling → dossier → _chain_for → chain_trace → _make_node
REQ-DDB-QUERY-006measured
REQ-DDB-QUERY-009measured
REQ-DDB-QUERY-010measuredtest_each_owner_is_reachable_by_its_own_spelling → dossier → identity_rowids
REQ-DDB-QUERY-012measured
REQ-DDB-QUERY-013measuredtest_each_owner_is_reachable_by_its_own_spelling → dossier → _qualified_reread → _split_qualified → bare_tail
REQ-DDB-SCHEMA-011measured
REQ-DDB-WIKI-054inferredtest_each_owner_is_reachable_by_its_own_spelling → dossier → _rank_enum_over_mirror → _class_side_is_only_enum_mirrors → all
Source · 16 lines
def test_each_owner_is_reachable_by_its_own_spelling(owned: Path) -> None:
    """THE PROPERTY THAT MAKES IT A SELECTOR RATHER THAN A FALLBACK. If the split resolved to
    whichever row sorted first, one of these two would be unreachable and the reply would be
    labelled with the name of the function the caller asked for — which is the `_classify` failure
    this repo records: an arbitrary pick reported as the answer.
    """
    briefs = {
        name: q.dossier(owned, name).function.brief
        for name in ("HealthMonitor::monitor_loop", "Watchdog::monitor_loop")
    }
    assert briefs == {
        "HealthMonitor::monitor_loop": "the health loop",
        "Watchdog::monitor_loop": "the watchdog loop",
    }, briefs

Activity · 2 steps
lines 127–130briefs = { name: q.dossier(owned, name).function.brief for name in ("HealthMonitor::monitor_loop", "Watchdog::monitor_loop") }lines 131–134assert briefs == { "HealthMonitor::monitor_loop": "the health loop", "Watchdog::monitor_loop": "the watchdog loop", }, briefs

test_the_bare_name_is_unchanged

None test_qualified_subject.test_the_bare_name_is_unchanged(Path owned)

The bare name keeps resolving exactly as it did.

tests/test_qualified_subject.py:139

Show on the map →

Called by none

Calls dossier

Checks

  • assert built is not None
  • assert built.kind == "function"
  • assert len(built.function.candidates) == 2, ("a bare name with two identities must still report both — the split is a last resort, " "never a replacement for disclosing ambiguity" )

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-INDEX-004measuredtest_the_bare_name_is_unchanged → dossier → _chain_for → chain_trace → candidate_rows → symbol_provenance
REQ-DDB-QUERY-001measuredtest_the_bare_name_is_unchanged → dossier → connect
REQ-DDB-QUERY-002measuredtest_the_bare_name_is_unchanged → dossier → _chain_for → chain_trace
REQ-DDB-QUERY-003measuredtest_the_bare_name_is_unchanged → dossier → identity_rowids
REQ-DDB-QUERY-004measured
REQ-DDB-QUERY-005inferredtest_the_bare_name_is_unchanged → dossier → _chain_for → chain_trace → _make_node
REQ-DDB-QUERY-006measured
REQ-DDB-QUERY-009measured
REQ-DDB-QUERY-010measuredtest_the_bare_name_is_unchanged → dossier → identity_rowids
REQ-DDB-QUERY-012measured
REQ-DDB-QUERY-013inferredtest_the_bare_name_is_unchanged → dossier → _qualified_reread → _split_qualified → bare_tail
REQ-DDB-SCHEMA-011measured
REQ-DDB-WIKI-054inferredtest_the_bare_name_is_unchanged → dossier → _rank_enum_over_mirror → _class_side_is_only_enum_mirrors → all
Source · 14 lines
def test_the_bare_name_is_unchanged(owned: Path) -> None:
    """THE SAFETY ASSERTION. The split must fire only after ordinary resolution has failed, so a
    bare name must still resolve, still be ambiguous between the two owners, and still disclose
    the ambiguity through `candidates` rather than being silently split.
    """
    built = q.dossier(owned, "monitor_loop")
    assert built is not None
    assert built.kind == "function"
    assert len(built.function.candidates) == 2, (
        "a bare name with two identities must still report both — the split is a last resort, "
        "never a replacement for disclosing ambiguity"
    )

Activity · 4 steps
lines 144–144built = q.dossier(owned, "monitor_loop")lines 145–145assert built is not Nonelines 146–146assert built.kind == "function"lines 147–150assert len(built.function.candidates) == 2, ( "a bare name with two identities must still report both — the split is a last resort, " "never a replacement for disclosing ambiguity" )

test_the_suffix_must_align_to_a_separator

None test_qualified_subject.test_the_suffix_must_align_to_a_separator(Path namespaced)

The suffix must match at a separator boundary, not mid-identifier.

tests/test_qualified_subject.py:318

Show on the map →

Called by none

Calls dossier

Checks

  • assert q.dossier(namespaced, "Monitor::monitor_loop") is None, ("a mid-identifier suffix is not a qualification and must not resolve" )

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-INDEX-004inferredtest_the_suffix_must_align_to_a_separator → dossier → _chain_for → chain_trace → candidate_rows → symbol_provenance
REQ-DDB-QUERY-001measuredtest_the_suffix_must_align_to_a_separator → dossier → connect
REQ-DDB-QUERY-002inferredtest_the_suffix_must_align_to_a_separator → dossier → _chain_for → chain_trace
REQ-DDB-QUERY-003measuredtest_the_suffix_must_align_to_a_separator → dossier → identity_rowids
REQ-DDB-QUERY-004measured
REQ-DDB-QUERY-005inferredtest_the_suffix_must_align_to_a_separator → dossier → _chain_for → chain_trace → _make_node
REQ-DDB-QUERY-010measuredtest_the_suffix_must_align_to_a_separator → dossier → identity_rowids
REQ-DDB-QUERY-012measured
REQ-DDB-QUERY-013measuredtest_the_suffix_must_align_to_a_separator → dossier → _qualified_reread → _split_qualified → bare_tail
REQ-DDB-WIKI-054inferredtest_the_suffix_must_align_to_a_separator → dossier → _rank_enum_over_mirror → _class_side_is_only_enum_mirrors → all
Source · 14 lines
def test_the_suffix_must_align_to_a_separator(namespaced: Path) -> None:
    """`Monitor::monitor_loop` is a suffix of `entropic::HealthMonitor::monitor_loop` as a plain
    string — `HealthMonitor` ends with `Monitor` — and it names no owner in this index. Matching
    it would answer about `HealthMonitor` under a class name that does not exist, which is the
    confidently-wrong-symbol failure in its most literal form.
    """
    assert q.dossier(namespaced, "Monitor::monitor_loop") is None, (
        "a mid-identifier suffix is not a qualification and must not resolve"
    )


# ─── the SELECTOR given a signature, which is what the agents actually passed ──

Activity · 1 steps
lines 324–326assert q.dossier(namespaced, "Monitor::monitor_loop") is None, ( "a mid-identifier suffix is not a qualification and must not resolve" )