Repository navigation
Conversation
…entation (GenAI-Security-Project#58) UI (Human-Friendly View): - "Type" -> "Component type (CycloneDX)" - "Architecture" -> "Model family (HF model_type)" - add "Model implementation (HF architectures)" when config.json architectures[] is present Registry: several jsonpath/location values used a singular `$.component.` root that never exists in the emitted BOM (primaryPurpose, suppliedBy, intendedUse, ethicalConsiderations, technicalLimitations, datasets) and `paper` used `$.metadata.component.externalReferences`. Because the fallback checker does not know these fields, primaryPurpose, suppliedBy and intendedUse were scored as missing even when emitted, and the Field Checklist displayed a location that did not match the JSON. Point every path at `$.components[0]...` (ethicalConsiderations leaf is `name`, the key actually emitted). Do not emit `model_type`/`architectures` component properties with a "None"/empty value when config.json lacks them. The emitted AIBOM structure is unchanged: components[].type, modelCard.modelParameters.modelArchitecture (model_type) and the `architectures` component property keep their names and values. Fixes GenAI-Security-Project#58 Signed-off-by: Raghuvar Karthik Durga <177662415+drk-ram@users.noreply.github.com>
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 #58 (goals A and the "registry JSONPath / checklist location match emitted JSON" acceptance criteria). The optional per-field provenance view (B) is not included.
UI terminology (
result.html, Human-Friendly View)components[0].typemodelCard.modelParameters.modelArchitecturearchitecturescomponent propertyFor the Nanbeige4.1-3B example:
machine-learning-model/llama/LlamaForCausalLM.The emitted AIBOM is unchanged, so this is backward compatible:
components[].type,modelArchitecture(frommodel_type) and thearchitecturescomponent property keep their names and values.Registry JSONPath vs. emitted JSON
Auditing every
field_registry.jsonjsonpath against a generated BOM showed several paths using a singular$.component.root that does not exist in the output (primaryPurpose,suppliedBy,intendedUse,ethicalConsiderations,technicalLimitations,datasets), pluspaperpointing at$.metadata.component.externalReferences. Same class of bug as #76. Effects onmain:primaryPurpose,suppliedBy(both critical) andintendedUsewere scored missing even when present, because the fallback checker does not know those namescomponent.modelCard...) that does not match the JSONAll paths now use
$.components[0]...(theethicalConsiderationsleaf isname, the key actually emitted). Scoring note: BOMs that emit those three fields will now correctly gain their points.The two
externalReferenceslocation edits and thepaperpath are identical to those in #120, so the PRs merge cleanly in either order.Small cleanup
model_type/architecturescomponent properties are no longer emitted with a"None"or empty value whenconfig.jsonlacks them (the UI row is skipped in that case).Not changed / follow-up
modelArchitecturestill falls back to<name>Modelwhenmodel_typeis unknown; changing that affects scoring and is left for a separate discussion. Mappingarchitectures[]into a CycloneDX field (e.g.architectureFamily) is also left out to keep the output stable.Tests
tests/test_model_type_semantics.py(new):$.component.roottype/modelArchitecture/architecturesstay distinct and backward compatiblemodel_type/architecturesThe registry and UI tests fail against the previous
src/.Validation
pytest --no-cov(Python 3.11): 191 passed