Repository navigation
Conversation
GenAI-Security-Project#76) The field_registry jsonpath for external_references and the snake/camel fallback were corrected by GenAI-Security-Project#85, but stale singular `$.component.` / `$.metadata.component.` externalReferences paths remained: - external_references and downloadLocation aibom_generation.location - paper jsonpath (pointed at metadata.component, which never carries externalReferences, so paper only scored via the fallback) Point them at $.components[0].externalReferences to match the emitted CycloneDX structure, and add regression tests: registry path consistency, jsonpath detection, full component_basic points when externalReferences is populated, partial points when absent, and a test that a component produced by AIBOMService scores the field present. Fixes GenAI-Security-Project#76 Signed-off-by: Raghuvar Karthik Durga <177662415+drk-ram@users.noreply.github.com>
This was referenced Nov 1, 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.
Summary
Fixes #76.
The two root causes described in #76 were already addressed on
mainby #85 (external_referencesjsonpath now$.components[0].externalReferences, plus theexternalReferencesalias incheck_field_in_aibom), but the issue is still open and a few related stale paths remain. This PR finishes the job and adds the missing regression coverage for the scoring outcome.Changes
field_registry.json: replace the remaining singular$.component.externalReferenceslocations (external_references,downloadLocation) with$.components[0].externalReferences.field_registry.json: thepaperjsonpath pointed at$.metadata.component.externalReferences[...], which never carries external references in the emitted BOM, sopaperwas only ever detected through the fallback. It now uses$.components[0].externalReferences[?(@.type=='documentation')].url, consistent withvcs/website.Tests (
tests/test_scoring.py)externalReferencespath (jsonpath and generation location) uses thecomponents[0]rootcomponents[0].externalReferencespaperjsonpath detects/does not detect adocumentationreferencecomponent_basicfields populated scores the fullcomponent_basicpoints, andexternal_referencesis checked off and not listed as missingexternalReferencesloses exactly one field fromcomponent_basicAIBOMService._create_component_sectionscoresexternal_referencesas presentThe registry-path and
papertests fail against the previous registry.Validation
pytest --no-cov(Python 3.11): 188 passedpytest tests/test_scoring.py --no-cov: all passed; the two registry-path tests fail when the oldfield_registry.jsonis restored