Skip to content

test: cover tr_apr in the no-foreign-code self-consistency check - #103

Merged
imran-siddique merged 1 commit into
agentrust-io:mainfrom
harshnair75567-cloud:fix/tr-apr-self-consistency-coverage
Sep 11, 2026
Merged

test: cover tr_apr in the no-foreign-code self-consistency check#103
imran-siddique merged 1 commit into
agentrust-io:mainfrom
harshnair75567-cloud:fix/tr-apr-self-consistency-coverage

Conversation

@harshnair75567-cloud

Copy link
Copy Markdown
Contributor

tr_apr was the only checker module excluded from
test_no_finding_names_a_code_other_than_its_own, which exists specifically to catch findings that quote another module's error code in their message (as TR-SIG-005 once did with TR-SIG-003).

No live violation in tr_apr today, but it shares a duplicated _not_absolute_uri with tr_pol (held equal by a parity test per its own docstring), so a future refactor merging that logic is exactly the kind of change this test exists to catch -- and it would currently go unnoticed for this module.

tr_apr was the only checker module excluded from
test_no_finding_names_a_code_other_than_its_own, which exists
specifically to catch findings that quote another module's error
code in their message (as TR-SIG-005 once did with TR-SIG-003).

No live violation in tr_apr today, but it shares a duplicated
_not_absolute_uri with tr_pol (held equal by a parity test per
its own docstring), so a future refactor merging that logic is
exactly the kind of change this test exists to catch -- and it
would currently go unnoticed for this module.
@harshnair75567-cloud
harshnair75567-cloud requested a review from a team as a code owner September 11, 2026 04:10

@imran-siddique imran-siddique left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving. Checked all three claims against the tree rather than the description.

  • tr_apr was the only checker excluded. src/trace_tests/modules/ holds eight checkers plus unverified.py, and MODULES listed seven.
  • The duplication is real. _not_absolute_uri is defined in exactly two files, tr_apr.py and tr_pol.py, which is the refactor this test exists to catch and the one place it was not watching.
  • No live violation. The file passes with tr_apr added, 9 passed.

The reason this is more than a line in a dict is the assertion below the one you are feeding: assert examined fails if every record raised, on the grounds that the check "would have reported a pass either way". So adding tr_apr to MODULES asserts that it produces findings across the junk-record matrix, and the test enforces that rather than taking it. A module added to a parametrised check that silently examines nothing is the failure mode this file already guards against, and your addition inherits that guard.

One thing I did not manage to show, said plainly rather than left implied: I tried planting a foreign TR-SIG-003 into a tr_apr message to watch the guard fire, and my pattern matched no message literal in that module, so I have not demonstrated the catch for tr_apr specifically. The coverage argument stands on its own without it.

@imran-siddique
imran-siddique merged commit 3540918 into agentrust-io:main Sep 11, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants