Repository navigation
feat: export CitationCheck and check_citations from the package root - #437
Merged
imran-siddique merged 1 commit intoSep 30, 2026
Merged
Conversation
verify_record() returns one VerificationResult carrying both a RevocationCheck and a mapping of CitationCheck, so the two are the same kind of thing to a caller reading a result. They were not reachable the same way: agentrust_trace.RevocationCheck resolved and agentrust_trace.CitationCheck raised AttributeError, leaving the citation half to be reached by module path. The description of the change that added citations said the export was a follow-up kept out of that diff; this is it. The two names sit beside their revocation counterparts in __all__, classes before functions, as the rest of the list is ordered. Nothing else changes. agentrust_trace.citation was already reachable, because revocation.py imports CitationCheck at module level, so no import behaviour moves and no signature, outcome or default is touched. The test asserts the revocation names beside the citation ones rather than the citation half alone, so it fails if either side moves. Run against the tree with the export removed it reports CitationCheck is not in __all__, and five mutants over __all__ and the import block, including one that binds the exported name to RevocationCheck, are each caught. Refs agentrust-io#190. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: opento-suggestions <opentosuggestionsofficial@gmail.com>
opento-suggestions
requested review from
a team,
lywinged and
rajnisht7
as code owners
September 30, 2026 16:33
3 of 9 tasks
opento-suggestions
marked this pull request as draft
September 30, 2026 16:57
opento-suggestions
marked this pull request as ready for review
September 30, 2026 17:07
imran-siddique
approved these changes
Sep 30, 2026
This was referenced Sep 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
verify_record()returns oneVerificationResultcarrying both aRevocationCheckand a mapping ofCitationCheck, so to a caller reading a result the two are the same kind of thing. They were not reachable the same way:agentrust_trace.RevocationCheckresolves andagentrust_trace.CitationCheckraisesAttributeError, leaving the citation half to be reached by module path.CitationCheckandcheck_citationsnow joinRevocationCheckandcheck_bundlein__all__. That list is grouped by the module each name is imported from, and the citation pair joins the group the revocation pair already forms. Nothing else moves.agentrust_trace.citationwas already reachable as a module, becauserevocation.pyimportsCitationCheckat module level, so no import behaviour changes and no signature, outcome, default or error is touched; the same objects stay reachable by their old module paths.check_citationsis exported for the reasoncheck_bundleis. Neither is called anywhere outside its own module,sign.verify_recordand the tests, so neither earns its place at the root by call count; both are the documented entry point of the module whose result type sits beside it, and exporting one type without its entry point splits a surface a caller uses together.SURFACESis deliberately not exported:agentrust_trace.citation.SURFACESis the path theVerificationResult.citationsdocstring already names, and a bareSURFACESat the package root would say less than the qualified name does.The test asserts the two revocation names beside the two citation ones rather than pinning the citation half alone, so it fails if either side moves. Run against the tree with the export removed it reports
CitationCheck is not in __all__. Mutants over__all__and the import block are each caught, including one that binds the exported name toRevocationCheck, so a name that resolves to the wrong object fails rather than passing.Stated limitations. This adds two existing public names to a namespace; it changes no behaviour and adds no argument, so there is no type-confusion surface to test. It is not quite a no-op for every caller:
from agentrust_trace import *now binds two more names and could shadow a caller's ownCitationCheck. No documentation page states the import path this corrects, so none is updated;docs/verification.mdexplains thecitationsresult and names no type, which this change does not alter.On the two numbers in this description: #190 is the tracking issue for the citation work and is what the
CHANGELOG.mdentry for that change cites. #374 is the pull request that addedcitations, and its description is where the export was named as a small follow-up kept out of that diff. This is that follow-up.One collision to flag: #438, which corrects the digest algorithms named on
docs/schema.md, adds its ownCHANGELOG.mdbullet at the same anchor in## [Unreleased]. A trial merge conflicts inCHANGELOG.mdand in no other file, so whichever of the two lands second rebases one bullet. The branches are cut from the same commit and share no other path.Verification was run on Windows 10 with Python 3.13.5 (CI's 3.11 and 3.12 were not run), against
63f4d15: 5 failed, 2390 passed, 6 skipped at the untouched commit, and 5 failed, 2391 passed, 6 skipped after, the same five red in both. They are the known Windows generator failures, which reproduce on the untouched tree and come fromwrite_textgiving CRLF where the fixture comparison is byte-for-byte:ruff check src tests scriptspasses at 0.16.9, which is the pin inrequirements/dev.txt;mypy src/agentrust_traceis clean under strict;tools/check_dashes.pyis clean. No Linux run is claimed.Refs #190.
Type of change
No box fits and I would rather say so than tick the nearest. This is a change to the reference implementation's export list: two names already public by module path are added to
__all__. Nothing in the specification, the schema or the wire format is touched, so the three spec boxes would each overstate it, and it adds no example.Spec section
None. The types themselves are unchanged.
RevocationCheckcarries the outcomes section 3.2.3 requires a verifier to be able to report;CitationCheckanswers no reporting duty in the specification, since section 3.1.2's rules on cited objects are prohibitions on a verifier rather than requirements to report, and the citation outcome names are not accepted normative text. This PR changes where both are importable from and nothing about either.Checklist
git commit -s)CHANGELOG.mdupdated (for any normative change): updated, though there is no normative change<!-- CHANGED: #NNN: description -->in spec text: no spec text changesimport *note above is the compatibility statement for the packageTool-assisted: the build, the witness rounds and this description. I answer for all of it.