Repository navigation
Conversation
…ry model) Per Steve's review on CycloneDX#1067: adopt a registry model for pre-defined perspectives, referenced by identity plus version. - Add a required sibling 'predefinedVersion' (integer, minimum 1) on the reference form. It selects the published revision of the perspective and is the 'version' of the catalog document that defines it; like other CycloneDX version fields it increments by 1 per revision. Pinning it keeps a reference stable as the catalog perspective evolves. - The reference form now requires both predefined and predefinedVersion (and still forbids all inline content but bom-ref); the inline form forbids both. - The 'predefined' enum stays ids-only, hand-maintained inline (the registry is this id list plus the versioned catalog files) -- no separate data file or generator, unlike the crypto family registry, since the set is small and curated and version is not schema-enumerated per id (mirroring how crypto validates the family but not the parameter set). Fixtures: valid reference form gains the version; the unknown-id, annotated and mixed invalid cases gain it so each isolates its intended violation; new invalid fixture covers a reference missing the required version.
…d references, standalone registry * feat(perspective): namespace pre-defined perspective identities under cdx:perspectives: Per review on CycloneDX#1067: prefix the pre-defined perspective enum values with the reserved cdx: namespace and a cdx:perspectives: path, so 'model-card' becomes 'cdx:perspectives:model-card' and 'pqc-readiness' becomes 'cdx:perspectives:pqc-readiness'. This aligns the identities with the reserved CycloneDX property taxonomy and keeps them collision-free with author-chosen names. Updates the enum, its meta:enum keys, the field description, and the valid/invalid test fixtures accordingly. * feat(perspective): version pre-defined perspective references (registry model) Per Steve's review on CycloneDX#1067: adopt a registry model for pre-defined perspectives, referenced by identity plus version. - Add a required sibling 'predefinedVersion' (integer, minimum 1) on the reference form. It selects the published revision of the perspective and is the 'version' of the catalog document that defines it; like other CycloneDX version fields it increments by 1 per revision. Pinning it keeps a reference stable as the catalog perspective evolves. - The reference form now requires both predefined and predefinedVersion (and still forbids all inline content but bom-ref); the inline form forbids both. - The 'predefined' enum stays ids-only, hand-maintained inline (the registry is this id list plus the versioned catalog files) -- no separate data file or generator, unlike the crypto family registry, since the set is small and curated and version is not schema-enumerated per id (mirroring how crypto validates the family but not the parameter set). Fixtures: valid reference form gains the version; the unknown-id, annotated and mixed invalid cases gain it so each isolates its intended violation; new invalid fixture covers a reference missing the required version. * feat(perspective): move pre-defined perspective registry into a standalone defs file Decouples the pre-defined perspective lifecycle from the specification release cycle, the same way the cryptography algorithm registry is handled: perspectives can be added or revised, and new catalog document versions published, by editing the registry alone -- no change to the versioned specification schemas. - New schema/perspectives-defs.schema.json: a single registry file holding the reserved identity enum (definitions.preDefinedPerspectivesEnum) and the identity-to-catalog-document map (definitions.catalog, id -> document path under perspectives/). Kept to one file, no separate data file or generator (the set is small and curated, unlike the ~100-entry crypto family registry that justifies generation). - cyclonedx-perspective-2.0.schema.json: 'predefined' now the external enum (../../perspectives-defs.schema.json#/definitions/ preDefinedPerspectivesEnum) instead of an inline enum; the inline preDefinedPerspective def is removed. - bundler: perspectives-defs.schema.json added to the external ref exceptions so it stays external in the bundle (like cryptography-defs). - schema-v2 validate + functional harnesses: load and register the new external schema so refs resolve. The registry data is expressed with schema keywords (const-valued map entries) so the single file remains a valid JSON Schema under the harness's ajv strict mode. Bundled schemas left to the post-merge workflow. * refactor(perspective): split pre-defined registry into data file + governing schema Follows the crypto registry's file split so the registry data has a real, checkable contract (the previous single file invented an unvalidated const-map convention). - schema/perspectives-defs.json: the registry DATA, hand-edited (no generator). Each entry is a proper object: predefined (the reserved identity, matching the CycloneDX perspective 'predefined' field), file (catalog document path), and description. Declares its governing schema via $schema. - schema/perspectives-defs.schema.json: now a governing meta-schema that defines the data file's shape (perspectives[] of {predefined, file, description}, predefined constrained to preDefinedPerspectivesEnum) and still exposes preDefinedPerspectivesEnum for the specification schema to $ref. Identities are entry values, not object keys. Data edits stay manual, matching how the crypto data file is maintained; the enum in the governing schema is kept in sync by hand (the set is small and curated). Verified the data file validates against the governing schema, and the schema-v2 suite passes. * test(perspective): enforce the pre-defined perspectives registry contract in CI The registry data file is hand-maintained (no generator), so until now nothing asserted that it actually conforms to its governing schema or that the hand-kept enum stays in step with the entries. Add a registry test to the schema-v2 suite (picked up by `npm test` via the `test:*` glob, so the existing JavaScript CI workflow runs it on every pull request): - schema/perspectives-defs.json validates against schema/perspectives-defs.schema.json (strict ajv, draft-07 meta-schema, formats enabled). - preDefinedPerspectivesEnum and the entries' `predefined` values are the same set, with no duplicates on either side; the message names which file to fix. - every entry's `file` points under perspectives/. A missing document only warns, so an identity can be reserved ahead of its catalog document (pqc-readiness, CycloneDX#960). An existing document must be JSON, declare an integer `version` >= 1 (the value a reference's `predefinedVersion` selects), define at least one perspective, and define it inline (no `predefined`/`predefinedVersion`), since catalog entries are the published definitions, not references. The test is not versioned (`-v`) because the registry lives at the schema root and is shared across specification versions. Verified: suite green; each check fails on a tampered input (unknown identity/missing file in data, enum drift, catalog document in reference form, catalog document without version). * test(perspective): register the perspectives registry schema in the Java 2.x harness The Java schema-v2 verification harness resolves external schema URIs through an explicit classpath mapping and disallows anything else, so the perspective schema's $ref to perspectives-defs.schema.json failed to load ("Schema from 'https://cyclonedx.org/schema/perspectives-defs.schema.json' is not allowed to be loaded"), erroring the five perspective fixtures. Map the http/https URIs of perspectives-defs.schema.json to the classpath copy (schema/ is already a test resource root), alongside the existing cryptography-defs and behavior-taxonomy mappings. Verified: `mvn clean test -Pschema-v2-tests` green locally (229 tests, 0 errors). * feat(perspective): generate the pre-defined perspectives registry and enforce immutable published versions The registry data (schema/perspectives-defs.json) is now GENERATED, in the spirit of the crypto registry's generator, and published perspective versions become immutable: - Naming convention replaces any mapping: the catalog document defining `cdx:perspectives:<name>` is `perspectives/<name>-perspective.json`. Identities are lowercase-kebab-case. The identity enum in the governing schema stays hand-maintained (now with meta:enum descriptions, so a reserved identity without a document still has one). - Registry entries are objects {predefined, file, name, description, versions[]}; each version record is {version, sha256, commit, date}: sha256 of the catalog document's canonical JSON (keys sorted, no whitespace, so formatting-only edits do not count as changes), the last commit touching the document, and that commit's UTC date. `name` and `description` are copied from the document at the latest version. lastUpdated is the newest registered date (deterministic). - tools/src/main/js/perspectives-registry/: shared module (convention, canonical hash, structural checks, version-state assessment) used by both the generator and the test, plus generate-perspectives-registry.js. The generator only appends unregistered versions (a new perspective at version 1, or registered latest + 1); it refuses content changed at a registered version, regressed or skipped versions, removed registered documents, documents not defining exactly one inline perspective, and identities violating the convention. Idempotent when nothing changed. - .github/workflows/generate_perspectives_registry.yml: on push to master/main/2.0-dev touching perspectives/**, the governing schema, or the generator, runs the generator and commits the registry directly (with a skip-ci marker), mirroring bundle_2.0_schemas.yml. A failing generator (change without bump merged over a red check) fails the workflow. - The schema-v2 registry test now shares that logic and checks every identity in the enum: reserved, new, unchanged and pending (latest + 1) pass; modified, regressed, skipped and removed fail. It also checks registered entries follow the convention and list contiguous versions from 1, and that every registered identity is in the enum. - Governing schema rewritten for the generated shape (patterns for file, sha256, commit; date-time dates; versions minItems 1). - Perspective schema: `predefined` description now states the naming convention instead of a mapping. Initial registry generated from this branch: model-card version 1 at ebb5184 (the commit is fork-side provenance; the hash is the check key). Verified: JS schema-v2 suite green; Java schema-v2 suite green (229 tests); bundler unchanged (registry ref stays external); no new lint findings on the perspective schema. Test and generator both reject each tampered input: content change at a registered version, skipped/regressed version, removed document, non-contiguous registry versions, non-convention identity, document with two perspectives; a version bump registers cleanly and formatting-only edits are accepted. * feat: create generate_perspectives_registry.yml to generate perspectives defs PR Signed-off-by: Pavel Shukhman <taleodor@users.noreply.github.com> * fix: switch generate_perspectives_registry.yml to perspectives code Signed-off-by: Pavel Shukhman <taleodor@users.noreply.github.com> --------- Co-authored-by: Claude Code (ReARM Agent) <rearm-agent-claude@reliza.io> Co-authored-by: Pavel Shukhman <taleodor@users.noreply.github.com> Signed-off-by: Pavel Shukhman <taleodor@users.noreply.github.com>
…ocedure in the model card Follow-up to @mrutkows's review of the catalog entry on CycloneDX#1067 (identifiers; datasets as the EU AI Act focus; usage of data relative to training stages). Three changes to perspectives/model-card-perspective.json, still version 1 (draft-stage exception; registry entry regenerated in the next commit): - Model Identifiers (recommended): the model's `identifiers`, that is identity claims grouped by asserting party, each a scheme such as purl or cpe plus a value. Name and version alone are ambiguous across hubs and forks. Schemes are listed uniformly; ranking them is a component model question, not a catalog one. - Datasets split into four mappings, all reached from the scoped model through the same `via.refs` step over `modelProperties.training.datasets`: Dataset Identity and Licensing (required; name, version, identifiers, licenses), Dataset Description and Contents, Dataset Classification and Sensitive Data, Dataset Governance (recommended). Completeness can now report which aspect of a dataset is missing instead of "dataset present". - Training Procedure (recommended): `via.refs` over `modelProperties.training.formula` into `$.formulation[*]`, selecting the formula whose workflows and tasks describe the training stages and the data each consumed. Not mappable today and left out: provenance labels such as crawled or synthetic, and data subsets with rationale; the 2.0 data model has no fields for them. Verified: the catalog document validates against the 2.0 schema; JS 2.0 group green after the registry regeneration in the next commit.
…in mappings (via)
* feat(perspective): scope perspectives to parts of the document and follow references in mappings
Perspectives applied to a whole document, with each mapping carrying the
same subject filter; a document with several models got one blended view
and tooling could not evaluate completeness per subject. Two additions:
- `scopes` on the perspective (reference and inline forms): an array of
scope objects {bom-ref, name, description, expressions[], targets[]},
at least one of expressions/targets. Each scope is an independent
application of the perspective (one view, one completeness evaluation).
Scope resolution is specified as a numbered algorithm in the
description: expressions from the document root, targets by bom-ref,
one-hop closure through same-document reference entries (`ref`
properties, as introduced by the inventory refactor), union of subtrees;
containment by JSONPath normalized-path prefix; BOM-Links to other
documents not followed. A published pre-defined perspective declares no
scopes; the document decides where it applies, so `scopes` is the one
field besides bom-ref permitted on the reference form.
- `via` on a mapping: ordered traversal steps applied before the
expression, so a mapping can select data related to the scope rather
than contained in it. A step either resolves reference values found at
a root-absolute path restricted to the current set (`refs`), or walks
the dependency graph from the referenceable nodes of the current set
(`dependencies`: depends-on, provides, dependents, provided-by;
optional `transitive`). The expression is then restricted to the
subtrees of the nodes the last step produced. Mapping expressions stay
root-absolute: selection is the intersection of scope (or traversal
result) and expression.
Catalog perspectives/model-card-perspective.json rewritten in place at
version 1 (the upstream PR is a draft, so the immutability rule is set
aside this once): models located by descendant search
(`$..[?(@.type=='machine-learning-model')]`) so the entry works whether
models sit at the root, in inventories, or in definitions; Datasets and
Use Case Definitions reached via `refs` from the model's
`modelProperties.training.datasets` / `modelProperties.useCases`; risk
mappings stay document-level with a rationale note, since risks reference
components in the reverse direction.
Fixtures: valid scoped reference (targets and expressions) plus a scoped
inline perspective with a chained dependency traversal and a `refs`
step; invalid: scope without expressions or targets, traversal step
mixing refs and dependencies, unknown dependency direction.
Verified: JS schema-v2 2.0 group green except the registry check (the
catalog entry is regenerated in the next commit); Java 2.0 suite green
(245 tests); bundler unchanged; no new lint findings on the schema.
* chore(perspective): re-register model-card version 1 for the in-place rewrite
The catalog document changed at version 1 (draft-stage exception to the
immutability rule), so its registered hash no longer matched. Dropped the
entry and regenerated it with the generator, recording the new content
hash and the commit that rewrote the document.
* feat(perspective): reusable perspective definitions applied by reference; examples on the inventory layout
Written as if CycloneDX#1075 (inventory refactor and
definitions registry) were merged:
- definitions.perspectives (cyclonedx-definition-2.0.schema.json,
appended): reusable inline perspectives, each with a required bom-ref.
Typed as perspectiveDefinition, a mixin over the perspective schema
that forbids predefined/predefinedVersion/ref/scopes, since scopes
belong to each application (same rule as for published pre-defined
perspectives).
- Third form of a perspective: `ref` (bom-ref or BOM-Link element to a
definition), with only bom-ref and scopes permitted alongside, so the
definition remains the single source of truth while the document
decides where it applies. `predefined` and `ref` are mutually exclusive
with each other and with the inline form (oneOf, all directions).
- Examples (mapping expression, scope expressions) rewritten on the
inventory layout: `$.inventories[*].components[...]`,
`$.definitions.components[...]`, `$.inventories[?(@['bom-ref']=='inv-vision')]`,
matching the edits CycloneDX#1075 makes to this file so the eventual merge is
trivial. The catalog document is untouched (descendant search already
covers both layouts) so its registry entry stays valid.
Fixtures: the valid scoped fixture gains a definitions.perspectives entry
applied at two scopes by reference; invalid: ref plus inline mappings,
ref plus predefined, definition declaring scopes, definition without
bom-ref. Each checked to fail for that reason. Fixtures keep the root
`components` layout because the base branch does not carry CycloneDX#1075 yet.
Verified: JS 2.0 group green; Java 2.0 suite green (249 tests); bundler
unchanged; no new lint findings on either schema (the definition mixin
carries the linter's mixin marker instead of additionalProperties).
* feat(perspective): model identifiers, dataset detail, and training procedure in the model card
Follow-up to @mrutkows's review of the catalog entry on
CycloneDX#1067 (identifiers; datasets as the EU AI Act
focus; usage of data relative to training stages). Three changes to
perspectives/model-card-perspective.json, still version 1 (draft-stage
exception; registry entry regenerated in the next commit):
- Model Identifiers (recommended): the model's `identifiers`, that is
identity claims grouped by asserting party, each a scheme such as purl
or cpe plus a value. Name and version alone are ambiguous across hubs
and forks. Schemes are listed uniformly; ranking them is a component
model question, not a catalog one.
- Datasets split into four mappings, all reached from the scoped model
through the same `via.refs` step over
`modelProperties.training.datasets`: Dataset Identity and Licensing
(required; name, version, identifiers, licenses), Dataset Description
and Contents, Dataset Classification and Sensitive Data, Dataset
Governance (recommended). Completeness can now report which aspect of
a dataset is missing instead of "dataset present".
- Training Procedure (recommended): `via.refs` over
`modelProperties.training.formula` into `$.formulation[*]`, selecting
the formula whose workflows and tasks describe the training stages
and the data each consumed.
Not mappable today and left out: provenance labels such as crawled or
synthetic, and data subsets with rationale; the 2.0 data model has no
fields for them.
Verified: the catalog document validates against the 2.0 schema; JS 2.0
group green after the registry regeneration in the next commit.
* chore(perspective): re-register model-card version 1 after the review follow-up rewrite
Same draft-stage exception as before: the catalog document changed at
version 1, so the entry was dropped and regenerated with the new content
hash and commit.
---------
Co-authored-by: Claude Code (ReARM Agent) <rearm-agent-claude@reliza.io>
Signed-off-by: Pavel Shukhman <taleodor@users.noreply.github.com>
…affect the scoped model (#5) * feat(perspective): referrers traversal step; model-card risk mappings select risks that affect the scoped model Follows @JunHwan-Kwon's review on CycloneDX#1067: the catalog's Ethical Considerations and Fairness Assessments mappings promised a narrowing by `affects` that the schema text did not allow. Mappings select only within the scope or within traversal-step output, and `refs` follows references forward only, while on 2.0-dev the only model-to-risk link is `risk.affects`, which points from the risk to the model. A card scoped to one model therefore selected no risks at all, and Ethical Considerations is required. - New traversal step `referrers`: a root-absolute JSONPath to reference-valued positions; the step produces the objects holding a value that identifies a node in the current set (the object owning the property, or the object holding the array). Inverse of `refs`. When the current set is the whole document the step is the identity, so an unscoped perspective is not narrowed. Exclusive with `refs` and `dependencies` in the same step. - Catalog (still version 1, draft-stage exception): both risk mappings gain `via: [{ "referrers": "$.risks.risks[*].affects[*]" }]`, and the rationale states the rule instead of deferring it to tooling. - Fixtures: valid document with two models and two risks, a model-card scoped to model-a and an inline perspective scoped to model-b using the step (JunHwan-Kwon's minimal case); invalid document with a step mixing referrers and refs. Registry entry for model-card regenerated in the next commit. Signed-off-by: Claude Code (ReARM Agent) <rearm-agent-claude@reliza.io> * chore(perspective): re-register model-card version 1 after the referrers rewrite Same draft-stage exception as before: the entry was dropped and regenerated with the new content hash and commit. Signed-off-by: Claude Code (ReARM Agent) <rearm-agent-claude@reliza.io> --------- Signed-off-by: Claude Code (ReARM Agent) <rearm-agent-claude@reliza.io> Co-authored-by: Claude Code (ReARM Agent) <rearm-agent-claude@reliza.io>
|
Thanks for incorporating the wording in One separate, non-blocking question about completeness tooling. My executable probe reproduces the replacement of The PR already includes a multi-subject scope: For the required License mapping,
These results compare possible policies; they are not conformance verdicts. Both cases evaluate the initial model subjects directly and do not test attribution after For a If both points are intentionally left to consumer policy, that would also resolve the question. I am not requesting a scoring implementation in this PR; a short clarification or linked follow-up would be sufficient. Reproduction evidence: pinned inputs, F1 before/after trace, candidate-policy matrix, and schema validation. |
|
Thank you, On the F1 trace. That transition is specified behaviour rather than a regression. On (b) is not well-defined in this model once traversal is in play. After a On empty collections. Presence is node selection: I will make this explicit in the text rather than leave it implied, along these lines:
|
…mance rule (#6) * Select fairness risks by domain; state that relevance is not a conformance rule Two clarifications raised in review of CycloneDX#1067. Fairness Assessments selected risks whose impact categories included `fairness` or `bias`. The AI/ML risk model proposed in CycloneDX#990 removes `bias` from the predefined impact categories and reintroduces it as a weakness kind, associated with a risk through `relatedWeaknesses`. Against that model the `bias` branch cannot match: a predefined category no longer carries the value, and a custom category is an object rather than the bare string the comparison tests. The mapping now selects the `fairness` risk domain instead, mirroring how Ethical Considerations selects the `ethical` domain, so it no longer depends on how a methodology categorizes impact. The rationale records where bias now lives, and why selecting those weaknesses would need a mapping of its own: a traversal step replaces the set of nodes the expression is evaluated against, so it cannot be combined with the existing referrers step over `affects`. Relevance said only that a data type is important to a perspective, while the perspective and scope descriptions promise a completeness evaluation, leaving what satisfies a `required` mapping unstated. Two readings were possible: any match within the scope, or presence for every subject the scope selected. The second is not definable once traversal is involved, because after a step the initial subjects are no longer in the evaluation set. Relevance now states that it and weight rank importance rather than define conformance, that a mapping is satisfied when it selects at least one node within the scope, that a verdict per subject comes from declaring one scope per subject, and that an empty collection is left to consumer policy. Signed-off-by: Claude Code (ReARM Agent) <rearm-agent-claude@reliza.io> * Re-register model-card version 1 after the fairness mapping change Generated by tools/src/main/js/perspectives-registry. Version 1 is not published outside this pull request, so the registration is refreshed in place rather than bumped to version 2, which would leave a registered version whose content never shipped and which the scopes fixture, pinned to predefinedVersion 1, would not describe. This follows the same handling as the referrers change. Signed-off-by: Pavel Shukhman <taleodor@users.noreply.github.com>
|
@taleodor Thank you. This resolves my completeness question. I reran the bounded License probes at I will retain F2 and F5 as non-normative policy comparisons, with the intended interpretation now recorded, and consider this question resolved. Updated evidence: pinned inputs and required-policy replay. |
mrutkows
left a comment
There was a problem hiding this comment.
Looks good and thanks for your work; it is very, very important.
Could you help me see the previous "ask" where I wanted a means to request that any appearance of "bom-ref" (by default or within specified objects) would cause those referenced objects to be pulled into the perspective output document.
| }, | ||
| { | ||
| "expression": "$..[?(@.type=='machine-learning-model')].parties[?(@.roles[?(@.role=='supplier')])]", | ||
| "nativeName": "Developed By", |
There was a problem hiding this comment.
Assume we can have a "Published At" as a means to express the model repo. (e.g., Hugging Face, Ollama, LM Studio, etc.)
There was a problem hiding this comment.
We can add a separate mapping, or modify this one, lmk how you want it + can discuss more on call.
| } | ||
| ], | ||
| "nativeName": "Training Procedure", | ||
| "nativeDescription": "The formula describing how the model was trained: its workflows and tasks, such as pre-training, fine-tuning, and alignment stages, and the data each consumed.", |
There was a problem hiding this comment.
We can use CycloneDX semantics for "native" names. Although I was not a fan of "formula" I would like CDX perspective to name things according to our 2.0 element/object names (e.g., "Training formula", "Fine-tuning formula", etc.)
There was a problem hiding this comment.
Again, can be renamed or split to different mappings. We can discuss.
1. Scope: referenced objects are pulled in automaticallyA scope selects the part of the document the perspective applies to, and it can be declared by reference or by path: "scopes": [
{ // by ref — bom-ref / bom-link
"bom-ref": "scope-vision",
"name": "Vision model",
"targets": [ "model-vision" ]
},
{ // by path — RFC 9535 JSONPath from the document root
"bom-ref": "scope-text",
"name": "Text models",
"description": "Both text models, evaluated as one card.",
"expressions": [
"$.components[?(@.type=='machine-learning-model' && @.group=='text')]"
]
}
]2. Mappings:
|
Adds pre-defined perspectives in the reserved cdx:perspectives: namespace, applied by identity at a pinned version, with a standalone registry (perspectives-defs) and the model-card catalog entry. Perspectives can be scoped to parts of the document, and mappings can follow references (refs, referrers, dependencies) to related data. Signed-off-by: Pavel Shukhman <pavel@reliza.io>
10c459b to
565b1d1
Compare
|
Note: squashed to fix DCO issue. |
JunHwan-Kwon
left a comment
There was a problem hiding this comment.
Following the current #990 structure, I have reduced this integration check to three directly applicable suggestions covering four mappings at 565b1d1.
Reproduction, exact patch, and results are pinned to #1067 565b1d1 and #990 f3d8521. Both official #990 fixtures and the original/proposed #1067 catalogs pass their respective complete modular schemas. On the risk-integration fixture, the proposed selections are 3 performance records, 1 intended-use reference collection, 1 referenced use-case definition, and 2 energy records; the current catalog selects none of these. The plain model fixture correctly continues to select no use case because it declares none.
The measurement suggestions follow #990's inline examples. The use-case suggestion is one explicit implements-only catalog policy, offered for acceptance or rejection; it is not claimed to be an already agreed rule. Fourteen additional checks cover all ten assertion types, model-specific reference selection, and an empty reference collection. The empty collection remains a selected node, so this does not add a new non-empty completeness rule.
These suggestions are limited to the four mappings. The previously closed Required/Fairness questions remain closed, and no scope, closure, or completeness-processing change is proposed. The tests are bounded selection checks, not a full perspective-conformance result.
Co-authored-by: JunHwanKwon <kjh0442@yuhs.ac> Signed-off-by: Pavel Shukhman <taleodor@users.noreply.github.com>
Co-authored-by: JunHwanKwon <kjh0442@yuhs.ac> Signed-off-by: Pavel Shukhman <taleodor@users.noreply.github.com>
Co-authored-by: JunHwanKwon <kjh0442@yuhs.ac> Signed-off-by: Pavel Shukhman <taleodor@users.noreply.github.com>
… card v1 Signed-off-by: Pavel Shukhman <pavel@reliza.io>
Signed-off-by: Pavel Shukhman <pavel@reliza.io>
Signed-off-by: Pavel Shukhman <taleodor@users.noreply.github.com>
2.0-dev moved the schema modules from schema/2.0/model/ to
schema/2.0/modules/. The only conflict was the perspective module's
title and comment, resolved to the 2.0-dev text ("Perspective Module").
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Claude Code (ReARM Agent) <rearm-agent-claude@reliza.io>
|
Latest 2.0-dev was merged / conflicts resolved. |
|
@taleodor Congrats. This has passed community review. However, please address the implementation issues that Jan raised so that we can merge this in this week. |
Signed-off-by: Pavel Shukhman <pavel@reliza.io>
Signed-off-by: Pavel Shukhman <pavel@reliza.io>
… lockfile, readme Signed-off-by: Pavel Shukhman <pavel@reliza.io>
Signed-off-by: Pavel Shukhman <pavel@reliza.io>
…ve commits from hashes Signed-off-by: Pavel Shukhman <pavel@reliza.io>
Thank you, I believe issues are addressed now. @jkowalleck please lmk if you still have concerns. |
What this adds
1. Schema: three forms of a perspective, and
scopes(cyclonedx-perspective-2.0.schema.json)A perspective is one of three mutually exclusive forms (oneOf, enforced in all directions):
predefined+predefinedVersion): incorporates a published perspective from the CycloneDX perspectives catalog by identity, giving tooling stable spec-backed identity instead of free-text name matching. Identities live under the reservedcdx:namespace with acdx:perspectives:path (per @mrutkows), so they cannot collide with author-chosen names and can be declared in the reserved cyclonedx-property-taxonomy.predefinedVersionpins the published revision: it is theversionof the catalog document defining the perspective (integer, incremented by 1 per revision, like other CycloneDX version fields). Initial identities:cdx:perspectives:model-cardandcdx:perspectives:pqc-readiness(the latter reserved for the entry proposed in Add sample PQC readiness perspective for CBOM #960).ref): applies a reusable inline perspective declared underdefinitions.perspectives(see 1b), by bom-ref or BOM-Link element.name+mappings): fully defined in the document.In the two reference forms only
bom-refandscopesmay accompany the reference, so the referenced definition stays the single source of truth while the document decides where it applies.Why a field rather than the choice pattern. A field on the perspective object keeps a pre-defined perspective addressable. A bare enum string cannot carry a bom-ref, so it could never be the target of a BOM-Link or any intra-document reference. With the field form,
{ "bom-ref": "…", "predefined": "cdx:perspectives:model-card", "predefinedVersion": 1 }remains a first-class, referenceable node, and the oneOf enforces the same exclusivity the choice pattern would have.scopes: applying a perspective to parts of the document. Without scopes a perspective applies to the whole document. With scopes, each entry is an independent application: one view, one completeness evaluation.expressions[]: JSONPath (RFC 9535) from the document root;targets[]: bom-ref or BOM-Link (elementLink, the type compositions use). At least one of the two; within a scope they union.scopes, written as a numbered algorithm so implementations converge): (1) evaluate expressions from the root; (2) resolve targets by bom-ref; (3) one-hop closure: every same-document reference entry (an object with arefproperty, as the inventory refactor introduces) inside the selected subtrees also selects the referenced node; (4) the scope is the union of the selected subtrees. Containment is by JSONPath Normalized Path prefix (RFC 9535 §2.7). BOM-Links to other documents are not followed.viaon a mapping: following references. JSONPath cannot join, so data related to a scoped subject (the datasets a model trained on, the risks that affect it, the algorithms a library provides) needed a way to be reached.viais an ordered list of traversal steps applied before the expression; each step is exactly one of:{ "refs": "<root-absolute JSONPath>" }: restricted to the current node set, collect reference values and resolve them to objects in this document. Forward references, e.g. a model'straining.datasets.{ "referrers": "<root-absolute JSONPath>" }: the inverse. The path selects reference values anywhere in the document; the step produces the objects that hold a value identifying a node in the current set (the object owning the property, or, when the value sits in an array, the object holding the array). For relationships that point towards the scoped nodes, e.g. a risk'saffects. The step replaces the current set with the matching referring objects; when the current set is the whole document it produces the whole document, so an unscoped perspective is not narrowed.{ "dependencies": "depends-on" | "provides" | "dependents" | "provided-by", "transitive": bool }: walk the dependency graph from the referenceable nodes within the current set.The first step starts from the scope (or the whole document when unscoped); the expression is then intersected with the subtrees of what the last step produced. Steps chain:
{ "expression": "$.definitions.components[?(@.type=='cryptographic-asset')]", "via": [ { "dependencies": "depends-on", "transitive": true }, { "dependencies": "provides" } ] }Worked example for
referrers(from @JunHwan-Kwon's review): two models,risk-awith"affects": ["model-a"],risk-bwith"affects": ["model-b"]. A model card scoped tomodel-aevaluates a risk mapping as: current set{model-a}→referrers: $.risks.risks[*].affects[*]yields{risk-a}→ expression intersected with that subtree →risk-a. Unscoped, both risks are selected. Selection is automatic; authors do not add risks to the scope.1a. Registry:
schema/perspectives-defs.schema.json+schema/perspectives-defs.jsonThe identity enum does not live in the versioned perspective schema. It lives in a standalone registry at the schema root, which the perspective schema
$refs (../../perspectives-defs.schema.json#/definitions/preDefinedPerspectivesEnum), following thecryptography-defspattern, so perspectives can be added or revised without a specification release.perspectives-defs.schema.jsonis hand-maintained: the identity enum (withmeta:enumdescriptions) plus the governing schema for the registry data. No mapping is declared; by naming convention the catalog document definingcdx:perspectives:<name>isperspectives/<name>-perspective.json.perspectives-defs.jsonis generated. Per identity it records every published version with the sha256 of the catalog document's canonical JSON and the commit that introduced it. Once registered, a version's content is immutable; changing a catalog document requires bumping itsversionby 1. Identities without a catalog document yet (pqc-readiness) are reserved and absent until their document lands.generate_algorithm_families.yml.1b. Reusable definitions:
definitions.perspectives(cyclonedx-definition-2.0.schema.json)Reusable inline perspectives, each with a required bom-ref, typed as
perspectiveDefinition, a mixin over the perspective schema that forbidspredefined,predefinedVersion,refandscopes. The same definition can be applied at several places with different scopes without repeating its mappings. Follows the definitions-registry direction of #1075.2. Catalog: perspectives/model-card-perspective.json
Second entry in the perspectives/ catalog introduced by #960, following its delivery shape (a complete, minimal, valid 2.0 document containing only the perspective). This is the definition incorporated when a document declares
"predefined": "cdx:perspectives:model-card". 23 mappings, eight reached throughvia:modelProperties: tasks, learning types, architecture, inputs/outputs, size and quantization, evaluation, limitations, environmental considerations. Models are located by descendant search ($..[?(@.type=='machine-learning-model')]) so the entry applies whether models are declared at the document root, in inventories, or in definitions.via.refsovermodelProperties.training.formulainto$.formulation[*](workflows and tasks as the training stages and the data each consumed).via.refsovermodelProperties.training.datasets, in four mappings so completeness can report which aspect is missing: identity and licensing (required), description and contents, classification and sensitive data, governance (parties accountable as owner, steward, custodian).via.refs; intended users via party roles.via.referrersover$.risks.risks[*].affects[*]: for a scoped model, exactly the risks that name it inaffects; unscoped, every matching risk.Not mappable today: provenance labels such as crawled or synthetic, and data subsets with rationale; the 2.0 data model has no fields for them.
3. Tests
targets,expressions, adefinitions.perspectivesentry applied at two scopes byref, a chained dependency traversal and arefsstep; the two-models/two-risks document with a model card scoped tomodel-aand an inline perspective usingreferrers. Invalid: unknown identity (correct namespace, not in the enum); reference missingpredefinedVersion; identity plus inline mappings; identity plus name and domains; scope with neither expressions nor targets; traversal step mixingrefsanddependencies; traversal step mixingreferrersandrefs; unknown dependency direction;refplus inline mappings;refpluspredefined; a definition declaring scopes; a definition without bom-ref.test:v2.0:t4-perspectives-registry, runs in the JavaScript CI workflow on every PR): validatesperspectives-defs.jsonagainst its governing schema, checks registered identities are in the enum with contiguous versions from 1 and conventional file paths, and assesses each identity's catalog document against the registry.perspectives-defs.schema.jsonregistered as an external schema in both JS ajv harnesses, the Java 2.x harness's classpath mapping, and the bundler's ref-exception list, mirroringcryptography-defs.schema.json.Not included
refs,referrers,dependencies) and mapping expressions against a document's data remains tooling territory, as for perspectives generally. The fixtures pin the intended node selections in prose; a semantic evaluator would be a separate contribution.Dependencies
modelProperties,training.datasets,training.formulaanduseCases. The schema change and fixtures stand alone; only the catalog entry's JSONPath expressions assume Clean check-in of AI/ML. Supersedes #948. #990's shape. Happy to adjust if that lands differently.definitions.perspectivesfollows its definitions registry, and the catalog's descendant search covers both the current and the inventory layout. Fixtures keep the rootcomponentslayout until Inventory refactor and definitions registry #1075 lands.cdx:perspectives:pqc-readinessfor its entry; to be registered automatically, that document needs to live atperspectives/pqc-readiness-perspective.jsonatversion1.