Repository navigation
feat: name the plugins and advisory files a result was produced with - #150
Merged
Merged
Conversation
A directory check lists each plugin it loaded and each advisory file it read, with the SHA-256 digest of its content, and every report format shows them: JSON tool.components, SARIF tool.extensions, the SBOM tools and the VEX tooling. Every finding about an advisory names the plugin or file it comes from in advisory_source. The cache key takes each plugin's identity from the same digest the reports show.
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.
Closes #149.
Until now, reports named only the engine. The advisories that decide the dependency findings and the VEX statements come from plugins and advisory files, which change on their own schedule. A result could therefore not be traced to its data, nor reproduced. CoreTrace-Entreprise/coretrace-python-analyzer-plugins#2 needs this before its advisory data gets versioned.
What changes
ProjectAnalysis.componentslists what a directory check was produced with, besides the engine and the sources:Each component carries a
sha256:digest of its content. For a plugin it is the directory digest the cache already computes, bytecode and hidden files excluded; for a file, its bytes. The new type iscoretrace_python.findings.Component, next toCoverage, because the dependency layer (VEX, SBOM) and the reporters must both import it.Each format shows them:
tool.components;tool.extensions, with kind and digest inproperties;metadata.tools.components, a plugin asapplication, a file asdata, each with its SHA-256;tooling(coretrace-python-analyzer 0.10.0; curated-advisories 2026.09.25 (sha256:…)). As a result, the document@idchanges when the advisory data changes.A single-file check lists no components.
advisory_sourceon every finding about an advisory:name@versionfor a plugin, the path for a file. When several sources define the same advisory, it is the one whose definition wins the merge._merge_advisoriesnow keeps each advisory's contributor, in the same order as before, sorepr(advisories)and the cache key do not change. The source is added after cached modules are read, so findings served from the cache carry it too, and the cache format is unchanged.Cache key. It now reads each plugin's identity from the same components the report shows, instead of computing the digest separately.
Tests
tests/test_provenance.py, 9 tests:advisory_sourcefrom a plugin, from a file that redefines the advisory, and from the cache;@idchanging with the data;