ai-bom-generator 0.1.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. ai_bom_generator-0.1.2/LICENSE +153 -0
  2. ai_bom_generator-0.1.2/PKG-INFO +204 -0
  3. ai_bom_generator-0.1.2/README.md +177 -0
  4. ai_bom_generator-0.1.2/pyproject.toml +67 -0
  5. ai_bom_generator-0.1.2/setup.cfg +4 -0
  6. ai_bom_generator-0.1.2/src/ai_bom_generator/__init__.py +3 -0
  7. ai_bom_generator-0.1.2/src/ai_bom_generator/__main__.py +5 -0
  8. ai_bom_generator-0.1.2/src/ai_bom_generator/app.py +147 -0
  9. ai_bom_generator-0.1.2/src/ai_bom_generator/cli.py +75 -0
  10. ai_bom_generator-0.1.2/src/ai_bom_generator/collectors/__init__.py +3 -0
  11. ai_bom_generator-0.1.2/src/ai_bom_generator/collectors/pipeline.py +588 -0
  12. ai_bom_generator-0.1.2/src/ai_bom_generator/config/__init__.py +3 -0
  13. ai_bom_generator-0.1.2/src/ai_bom_generator/config/loader.py +81 -0
  14. ai_bom_generator-0.1.2/src/ai_bom_generator/config/schema/__init__.py +1 -0
  15. ai_bom_generator-0.1.2/src/ai_bom_generator/config/schema/aibom-config-v1.schema.json +66 -0
  16. ai_bom_generator-0.1.2/src/ai_bom_generator/domain/__init__.py +4 -0
  17. ai_bom_generator-0.1.2/src/ai_bom_generator/domain/artifact.py +25 -0
  18. ai_bom_generator-0.1.2/src/ai_bom_generator/domain/evidence.py +33 -0
  19. ai_bom_generator-0.1.2/src/ai_bom_generator/domain/reference.py +21 -0
  20. ai_bom_generator-0.1.2/src/ai_bom_generator/domain/source_location.py +18 -0
  21. ai_bom_generator-0.1.2/src/ai_bom_generator/domain/warning.py +30 -0
  22. ai_bom_generator-0.1.2/src/ai_bom_generator/errors.py +40 -0
  23. ai_bom_generator-0.1.2/src/ai_bom_generator/exporters/__init__.py +3 -0
  24. ai_bom_generator-0.1.2/src/ai_bom_generator/exporters/cyclonedx_json/__init__.py +3 -0
  25. ai_bom_generator-0.1.2/src/ai_bom_generator/exporters/cyclonedx_json/mapper.py +91 -0
  26. ai_bom_generator-0.1.2/src/ai_bom_generator/exporters/cyclonedx_json/schema/LICENSE +201 -0
  27. ai_bom_generator-0.1.2/src/ai_bom_generator/exporters/cyclonedx_json/schema/__init__.py +1 -0
  28. ai_bom_generator-0.1.2/src/ai_bom_generator/exporters/cyclonedx_json/schema/bom-1.7.schema.json +6700 -0
  29. ai_bom_generator-0.1.2/src/ai_bom_generator/exporters/cyclonedx_schema.py +17 -0
  30. ai_bom_generator-0.1.2/src/ai_bom_generator/hashing/__init__.py +3 -0
  31. ai_bom_generator-0.1.2/src/ai_bom_generator/hashing/sha256.py +23 -0
  32. ai_bom_generator-0.1.2/src/ai_bom_generator/reporting/__init__.py +15 -0
  33. ai_bom_generator-0.1.2/src/ai_bom_generator/reporting/json_writer.py +132 -0
  34. ai_bom_generator-0.1.2/src/ai_bom_generator/reporting/summary.py +44 -0
  35. ai_bom_generator-0.1.2/src/ai_bom_generator/reporting/warning_report.py +17 -0
  36. ai_bom_generator-0.1.2/src/ai_bom_generator/security/__init__.py +4 -0
  37. ai_bom_generator-0.1.2/src/ai_bom_generator/security/path_policy.py +75 -0
  38. ai_bom_generator-0.1.2/src/ai_bom_generator/security/redaction.py +50 -0
  39. ai_bom_generator-0.1.2/src/ai_bom_generator/validation/__init__.py +3 -0
  40. ai_bom_generator-0.1.2/src/ai_bom_generator/validation/json_schema.py +43 -0
  41. ai_bom_generator-0.1.2/src/ai_bom_generator.egg-info/PKG-INFO +204 -0
  42. ai_bom_generator-0.1.2/src/ai_bom_generator.egg-info/SOURCES.txt +48 -0
  43. ai_bom_generator-0.1.2/src/ai_bom_generator.egg-info/dependency_links.txt +1 -0
  44. ai_bom_generator-0.1.2/src/ai_bom_generator.egg-info/entry_points.txt +2 -0
  45. ai_bom_generator-0.1.2/src/ai_bom_generator.egg-info/requires.txt +1 -0
  46. ai_bom_generator-0.1.2/src/ai_bom_generator.egg-info/top_level.txt +1 -0
  47. ai_bom_generator-0.1.2/tests/test_cli.py +2201 -0
  48. ai_bom_generator-0.1.2/tests/test_contract_schemas.py +85 -0
  49. ai_bom_generator-0.1.2/tests/test_examples.py +44 -0
  50. ai_bom_generator-0.1.2/tests/test_hashing.py +56 -0
@@ -0,0 +1,153 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ https://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction, and
10
+ distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by the copyright
13
+ owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all other entities
16
+ that control, are controlled by, or are under common control with that entity.
17
+ For the purposes of this definition, "control" means (i) the power, direct or
18
+ indirect, to cause the direction or management of such entity, whether by
19
+ contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
20
+ outstanding shares, or (iii) beneficial ownership of such entity.
21
+
22
+ "You" (or "Your") shall mean an individual or Legal Entity exercising
23
+ permissions granted by this License.
24
+
25
+ "Source" form shall mean the preferred form for making modifications, including
26
+ but not limited to software source code, documentation source, and configuration
27
+ files.
28
+
29
+ "Object" form shall mean any form resulting from mechanical transformation or
30
+ translation of a Source form, including but not limited to compiled object code,
31
+ generated documentation, and conversions to other media types.
32
+
33
+ "Work" shall mean the work of authorship, whether in Source or Object form, made
34
+ available under the License, as indicated by a copyright notice that is included
35
+ in or attached to the work.
36
+
37
+ "Derivative Works" shall mean any work, whether in Source or Object form, that
38
+ is based on or derived from the Work and for which the editorial revisions,
39
+ annotations, elaborations, or other modifications represent, as a whole, an
40
+ original work of authorship. For the purposes of this License, Derivative Works
41
+ shall not include works that remain separable from, or merely link (or bind by
42
+ name) to the interfaces of, the Work and Derivative Works thereof.
43
+
44
+ "Contribution" shall mean any work of authorship, including the original version
45
+ of the Work and any modifications or additions to that Work or Derivative Works
46
+ thereof, that is intentionally submitted to Licensor for inclusion in the Work by
47
+ the copyright owner or by an individual or Legal Entity authorized to submit on
48
+ behalf of the copyright owner. For the purposes of this definition, "submitted"
49
+ means any form of electronic, verbal, or written communication sent to the
50
+ Licensor or its representatives, including but not limited to communication on
51
+ electronic mailing lists, source code control systems, and issue tracking systems
52
+ that are managed by, or on behalf of, the Licensor for the purpose of discussing
53
+ and improving the Work, but excluding communication that is conspicuously marked
54
+ or otherwise designated in writing by the copyright owner as "Not a
55
+ Contribution."
56
+
57
+ "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of
58
+ whom a Contribution has been received by Licensor and subsequently incorporated
59
+ within the Work.
60
+
61
+ 2. Grant of Copyright License. Subject to the terms and conditions of this
62
+ License, each Contributor hereby grants to You a perpetual, worldwide,
63
+ non-exclusive, no-charge, royalty-free, irrevocable copyright license to
64
+ reproduce, prepare Derivative Works of, publicly display, publicly perform,
65
+ sublicense, and distribute the Work and such Derivative Works in Source or Object
66
+ form.
67
+
68
+ 3. Grant of Patent License. Subject to the terms and conditions of this License,
69
+ each Contributor hereby grants to You a perpetual, worldwide, non-exclusive,
70
+ no-charge, royalty-free, irrevocable patent license to make, have made, use,
71
+ offer to sell, sell, import, and otherwise transfer the Work, where such license
72
+ applies only to those patent claims licensable by such Contributor that are
73
+ necessarily infringed by their Contribution alone or by combination of their
74
+ Contribution with the Work to which such Contribution was submitted. If You
75
+ institute patent litigation against any entity alleging that the Work or a
76
+ Contribution incorporated within the Work constitutes direct or contributory
77
+ patent infringement, then any patent licenses granted to You under this License
78
+ for that Work shall terminate as of the date such litigation is filed.
79
+
80
+ 4. Redistribution. You may reproduce and distribute copies of the Work or
81
+ Derivative Works thereof in any medium, with or without modifications, and in
82
+ Source or Object form, provided that You meet the following conditions:
83
+
84
+ (a) You must give any other recipients of the Work or Derivative Works a copy of
85
+ this License; and
86
+
87
+ (b) You must cause any modified files to carry prominent notices stating that You
88
+ changed the files; and
89
+
90
+ (c) You must retain, in the Source form of any Derivative Works that You
91
+ distribute, all copyright, patent, trademark, and attribution notices from the
92
+ Source form of the Work, excluding those notices that do not pertain to any part
93
+ of the Derivative Works; and
94
+
95
+ (d) If the Work includes a "NOTICE" text file as part of its distribution, then
96
+ any Derivative Works that You distribute must include a readable copy of the
97
+ attribution notices contained within such NOTICE file, excluding those notices
98
+ that do not pertain to any part of the Derivative Works, in at least one of the
99
+ following places: within a NOTICE text file distributed as part of the Derivative
100
+ Works; within the Source form or documentation, if provided along with the
101
+ Derivative Works; or within a display generated by the Derivative Works, if and
102
+ wherever such third-party notices normally appear. The contents of the NOTICE
103
+ file are for informational purposes only and do not modify the License. You may
104
+ add Your own attribution notices within Derivative Works that You distribute,
105
+ alongside or as an addendum to the NOTICE text from the Work, provided that such
106
+ additional attribution notices cannot be construed as modifying the License.
107
+
108
+ You may add Your own copyright statement to Your modifications and may provide
109
+ additional or different license terms and conditions for use, reproduction, or
110
+ distribution of Your modifications, or for any such Derivative Works as a whole,
111
+ provided Your use, reproduction, and distribution of the Work otherwise complies
112
+ with the conditions stated in this License.
113
+
114
+ 5. Submission of Contributions. Unless You explicitly state otherwise, any
115
+ Contribution intentionally submitted for inclusion in the Work by You to the
116
+ Licensor shall be under the terms and conditions of this License, without any
117
+ additional terms or conditions. Notwithstanding the above, nothing herein shall
118
+ supersede or modify the terms of any separate license agreement you may have
119
+ executed with Licensor regarding such Contributions.
120
+
121
+ 6. Trademarks. This License does not grant permission to use the trade names,
122
+ trademarks, service marks, or product names of the Licensor, except as required
123
+ for reasonable and customary use in describing the origin of the Work and
124
+ reproducing the content of the NOTICE file.
125
+
126
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in
127
+ writing, Licensor provides the Work on an "AS IS" BASIS, WITHOUT WARRANTIES OR
128
+ CONDITIONS OF ANY KIND, either express or implied, including, without limitation,
129
+ any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or
130
+ FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the
131
+ appropriateness of using or redistributing the Work and assume any risks
132
+ associated with Your exercise of permissions under this License.
133
+
134
+ 8. Limitation of Liability. In no event and under no legal theory, whether in
135
+ tort (including negligence), contract, or otherwise, unless required by
136
+ applicable law (such as deliberate and grossly negligent acts) or agreed to in
137
+ writing, shall any Contributor be liable to You for damages, including any
138
+ direct, indirect, special, incidental, or consequential damages of any character
139
+ arising as a result of this License or out of the use or inability to use the
140
+ Work, even if such Contributor has been advised of the possibility of such
141
+ damages.
142
+
143
+ 9. Accepting Warranty or Additional Liability. While redistributing the Work or
144
+ Derivative Works thereof, You may choose to offer, and charge a fee for,
145
+ acceptance of support, warranty, indemnity, or other liability obligations and/or
146
+ rights consistent with this License. However, in accepting such obligations, You
147
+ may act only on Your own behalf and on Your sole responsibility, not on behalf of
148
+ any other Contributor, and only if You agree to indemnify, defend, and hold each
149
+ Contributor harmless for any liability incurred by, or claims asserted against,
150
+ such Contributor by reason of your accepting any such warranty or additional
151
+ liability.
152
+
153
+ END OF TERMS AND CONDITIONS
@@ -0,0 +1,204 @@
1
+ Metadata-Version: 2.4
2
+ Name: ai-bom-generator
3
+ Version: 0.1.2
4
+ Summary: Local AI/ML bill-of-materials generator
5
+ Author: 0disoft
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/0disoft/ai-bom-generator
8
+ Project-URL: Repository, https://github.com/0disoft/ai-bom-generator
9
+ Project-URL: Issues, https://github.com/0disoft/ai-bom-generator/issues
10
+ Project-URL: Changelog, https://github.com/0disoft/ai-bom-generator/blob/main/CHANGELOG.md
11
+ Project-URL: Releases, https://github.com/0disoft/ai-bom-generator/releases
12
+ Keywords: ai,ai-bom,bill-of-materials,bom,cyclonedx,machine-learning,ml-bom,supply-chain
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: Environment :: Console
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
20
+ Classifier: Topic :: Security
21
+ Classifier: Topic :: Software Development :: Build Tools
22
+ Requires-Python: >=3.12
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE
25
+ Requires-Dist: jsonschema<5,>=4.25
26
+ Dynamic: license-file
27
+
28
+ # AI-BOM Generator
29
+
30
+ Status: Draft
31
+ Scope: data
32
+ Repository Type: cli-tool
33
+ Addons: github-action
34
+
35
+ AI-BOM Generator is a small CLI and optional GitHub Action for producing an AI
36
+ bill of materials from a model project directory.
37
+
38
+ The tool records declared model metadata, discovered `MODEL_CARD.md` paths,
39
+ model or checkpoint digests, training-code references, dependency lockfiles,
40
+ dataset references, prompt templates, and eval artifact references, then exports
41
+ them to CycloneDX JSON 1.7.
42
+
43
+ It is a generator and evidence reporter. It is not a model registry, scanner,
44
+ legal compliance engine, dataset auditor, or AI governance platform.
45
+
46
+ ## Source Files
47
+
48
+ - AGENTS.md: agent working rules
49
+ - CHECKLIST.md: checklist router
50
+ - VALIDATION.md: validation names and reporting requirements
51
+ - .agents/context-map.md: agent route map
52
+ - docs/product/02-spec.md: product source of truth
53
+ - docs/cli/command-contract.md: CLI contract source
54
+ - docs/github-action/action-contract.md: GitHub Action contract source
55
+ - docs/data/pipeline-contract.md: artifact collection and export contract
56
+ - docs/: design, operations, architecture, and engineering standards
57
+
58
+ ## Repository Shape Notes
59
+
60
+ - cli-tool: This repository type owns command behavior, arguments, flags, config loading, exit codes, terminal output, JSON output, runtime compatibility, and shell integration contracts.
61
+ - github-action: This repository type owns action inputs, outputs, permissions, token handling, and runner compatibility.
62
+
63
+ ## MVP Direction
64
+
65
+ - accept one model directory as input;
66
+ - discover in-root `MODEL_CARD.md` paths without copying model-card contents;
67
+ - compute SHA-256 digests for model artifacts and checkpoints;
68
+ - collect dependency and training-code references from known lockfile or config locations;
69
+ - read dataset, prompt, and eval references from explicit config;
70
+ - export one initial standards-backed BOM format;
71
+ - report missing metadata as warnings without pretending the BOM is complete.
72
+
73
+ ## Quickstart
74
+
75
+ The current public patch release is `v0.1.2`. It is distributed as a GitHub
76
+ repository, GitHub Action, and Python package.
77
+
78
+ Install the released package from PyPI:
79
+
80
+ ```powershell
81
+ python -m pip install ai-bom-generator
82
+ ai-bom --help
83
+ ```
84
+
85
+ Try the bundled minimal project from a checkout:
86
+
87
+ ```powershell
88
+ uv sync --locked
89
+ $out = Join-Path ([System.IO.Path]::GetTempPath()) ("ai-bom-example-" + [System.Guid]::NewGuid().ToString("N"))
90
+ New-Item -ItemType Directory -Path $out | Out-Null
91
+ uv run --python 3.12 ai-bom generate examples/minimal-model-project --config examples/minimal-model-project/aibom.toml --format cyclonedx-json-1.7 --output (Join-Path $out "bom.cdx.json") --warning-report (Join-Path $out "warnings.json") --summary (Join-Path $out "summary.json")
92
+ Get-ChildItem -LiteralPath $out
93
+ ```
94
+
95
+ The same command shape works for your own model project as long as generated
96
+ output paths resolve outside the target model directory.
97
+
98
+ Example `aibom.toml` from `examples/minimal-model-project`:
99
+
100
+ ```toml
101
+ schema_version = "1"
102
+
103
+ [output]
104
+ format = "cyclonedx-json-1.7"
105
+
106
+ [model]
107
+ name = "example-model"
108
+ version = "0.1.0"
109
+ model_card = "MODEL_CARD.md"
110
+ license_declared = "NOASSERTION"
111
+
112
+ [artifacts]
113
+ include = ["models/*.safetensors"]
114
+
115
+ [[dependencies]]
116
+ path = "requirements.lock"
117
+ type = "pip"
118
+
119
+ [[datasets]]
120
+ name = "example-dataset"
121
+ license_declared = "NOASSERTION"
122
+ ```
123
+
124
+ The CLI writes a BOM, a warning report, a JSON summary, and a generation
125
+ manifest. The manifest is the commit marker for the output set and records path,
126
+ size, and SHA-256 entries for the generated JSON files. Missing optional
127
+ metadata is reported as machine-readable warnings. Unreadable required files,
128
+ invalid config, unsupported exporters, unsafe paths, and invalid generated BOM
129
+ output fail with non-zero exit codes. Generated output paths must resolve
130
+ outside the target model project directory.
131
+
132
+ ## Current CLI Smoke
133
+
134
+ ```text
135
+ ai-bom generate <model-directory> --config <path> --format cyclonedx-json-1.7 --output <bom.json> --warning-report <warnings.json> --summary <summary.json> [--manifest <manifest.json>]
136
+ ```
137
+
138
+ ## Current GitHub Action Smoke
139
+
140
+ ```yaml
141
+ - uses: actions/checkout@v7
142
+
143
+ - uses: actions/setup-python@v6
144
+ with:
145
+ python-version: "3.12"
146
+
147
+ - uses: astral-sh/setup-uv@v8.3.1
148
+
149
+ - id: ai-bom
150
+ uses: 0disoft/ai-bom-generator@v0.1.2
151
+ with:
152
+ model-directory: .
153
+ config: aibom.toml
154
+ warnings: allow
155
+
156
+ - name: Verify AI-BOM outputs
157
+ shell: bash
158
+ run: |
159
+ set -euo pipefail
160
+ test -s "${{ steps.ai-bom.outputs.bom-path }}"
161
+ test -s "${{ steps.ai-bom.outputs.warning-report-path }}"
162
+ test -s "${{ steps.ai-bom.outputs.summary-path }}"
163
+ test "${{ steps.ai-bom.outputs.status }}" = "success"
164
+ ```
165
+
166
+ The action invokes the packaged CLI with `uv run --project`, so consuming
167
+ workflows must make Python 3.12 and `uv` available before this action runs. When
168
+ `format` or `warnings` inputs are omitted, the action lets the CLI use the
169
+ explicit config values and CLI defaults. Generated files are written to explicit
170
+ paths when provided, or to a run-unique directory under `RUNNER_TEMP`.
171
+ Summary-derived action outputs are published only when the generation manifest
172
+ matches the BOM, warning report, and summary files from the current run.
173
+
174
+ The current implementation validates explicit `aibom.toml` config files against
175
+ AI-BOM config schema v1, validates generated CycloneDX JSON 1.7 output against
176
+ the vendored official schema, and validates AI-BOM summary/warning contracts in
177
+ tests.
178
+
179
+ ## Non-Goals
180
+
181
+ - no automatic legal license judgment;
182
+ - no training-data audit guarantee;
183
+ - no vulnerability scanner;
184
+ - no model serving runtime;
185
+ - no hosted registry;
186
+ - no broad "all ML frameworks" promise until fixtures prove it.
187
+
188
+ ## Repository Hygiene
189
+
190
+ .editorconfig, .gitattributes, and .gitignore are generated to keep line endings,
191
+ binary diffs, local files, build outputs, caches, and secret files under control.
192
+
193
+ ## Scope Notes
194
+
195
+ Runtime floor is Python 3.12, the initial CLI adapter is `argparse`, package
196
+ metadata lives in `pyproject.toml`, JSON Schema validation uses `jsonschema`,
197
+ the project lockfile is `uv.lock`, explicit config files use `aibom.toml`, the
198
+ first exporter is CycloneDX JSON 1.7, strict redaction is the default, and the
199
+ repository license is Apache-2.0. The first public MVP release uses immutable
200
+ GitHub tags, with `v0.1.2` as the current smoke-tested patch tag and first PyPI
201
+ package release. Mutable major action tags, GitHub Marketplace registration,
202
+ second exporter priority, automatic config discovery, and model artifact
203
+ discovery defaults remain deferred until the repository owner records them in
204
+ the source-of-truth documents.
@@ -0,0 +1,177 @@
1
+ # AI-BOM Generator
2
+
3
+ Status: Draft
4
+ Scope: data
5
+ Repository Type: cli-tool
6
+ Addons: github-action
7
+
8
+ AI-BOM Generator is a small CLI and optional GitHub Action for producing an AI
9
+ bill of materials from a model project directory.
10
+
11
+ The tool records declared model metadata, discovered `MODEL_CARD.md` paths,
12
+ model or checkpoint digests, training-code references, dependency lockfiles,
13
+ dataset references, prompt templates, and eval artifact references, then exports
14
+ them to CycloneDX JSON 1.7.
15
+
16
+ It is a generator and evidence reporter. It is not a model registry, scanner,
17
+ legal compliance engine, dataset auditor, or AI governance platform.
18
+
19
+ ## Source Files
20
+
21
+ - AGENTS.md: agent working rules
22
+ - CHECKLIST.md: checklist router
23
+ - VALIDATION.md: validation names and reporting requirements
24
+ - .agents/context-map.md: agent route map
25
+ - docs/product/02-spec.md: product source of truth
26
+ - docs/cli/command-contract.md: CLI contract source
27
+ - docs/github-action/action-contract.md: GitHub Action contract source
28
+ - docs/data/pipeline-contract.md: artifact collection and export contract
29
+ - docs/: design, operations, architecture, and engineering standards
30
+
31
+ ## Repository Shape Notes
32
+
33
+ - cli-tool: This repository type owns command behavior, arguments, flags, config loading, exit codes, terminal output, JSON output, runtime compatibility, and shell integration contracts.
34
+ - github-action: This repository type owns action inputs, outputs, permissions, token handling, and runner compatibility.
35
+
36
+ ## MVP Direction
37
+
38
+ - accept one model directory as input;
39
+ - discover in-root `MODEL_CARD.md` paths without copying model-card contents;
40
+ - compute SHA-256 digests for model artifacts and checkpoints;
41
+ - collect dependency and training-code references from known lockfile or config locations;
42
+ - read dataset, prompt, and eval references from explicit config;
43
+ - export one initial standards-backed BOM format;
44
+ - report missing metadata as warnings without pretending the BOM is complete.
45
+
46
+ ## Quickstart
47
+
48
+ The current public patch release is `v0.1.2`. It is distributed as a GitHub
49
+ repository, GitHub Action, and Python package.
50
+
51
+ Install the released package from PyPI:
52
+
53
+ ```powershell
54
+ python -m pip install ai-bom-generator
55
+ ai-bom --help
56
+ ```
57
+
58
+ Try the bundled minimal project from a checkout:
59
+
60
+ ```powershell
61
+ uv sync --locked
62
+ $out = Join-Path ([System.IO.Path]::GetTempPath()) ("ai-bom-example-" + [System.Guid]::NewGuid().ToString("N"))
63
+ New-Item -ItemType Directory -Path $out | Out-Null
64
+ uv run --python 3.12 ai-bom generate examples/minimal-model-project --config examples/minimal-model-project/aibom.toml --format cyclonedx-json-1.7 --output (Join-Path $out "bom.cdx.json") --warning-report (Join-Path $out "warnings.json") --summary (Join-Path $out "summary.json")
65
+ Get-ChildItem -LiteralPath $out
66
+ ```
67
+
68
+ The same command shape works for your own model project as long as generated
69
+ output paths resolve outside the target model directory.
70
+
71
+ Example `aibom.toml` from `examples/minimal-model-project`:
72
+
73
+ ```toml
74
+ schema_version = "1"
75
+
76
+ [output]
77
+ format = "cyclonedx-json-1.7"
78
+
79
+ [model]
80
+ name = "example-model"
81
+ version = "0.1.0"
82
+ model_card = "MODEL_CARD.md"
83
+ license_declared = "NOASSERTION"
84
+
85
+ [artifacts]
86
+ include = ["models/*.safetensors"]
87
+
88
+ [[dependencies]]
89
+ path = "requirements.lock"
90
+ type = "pip"
91
+
92
+ [[datasets]]
93
+ name = "example-dataset"
94
+ license_declared = "NOASSERTION"
95
+ ```
96
+
97
+ The CLI writes a BOM, a warning report, a JSON summary, and a generation
98
+ manifest. The manifest is the commit marker for the output set and records path,
99
+ size, and SHA-256 entries for the generated JSON files. Missing optional
100
+ metadata is reported as machine-readable warnings. Unreadable required files,
101
+ invalid config, unsupported exporters, unsafe paths, and invalid generated BOM
102
+ output fail with non-zero exit codes. Generated output paths must resolve
103
+ outside the target model project directory.
104
+
105
+ ## Current CLI Smoke
106
+
107
+ ```text
108
+ ai-bom generate <model-directory> --config <path> --format cyclonedx-json-1.7 --output <bom.json> --warning-report <warnings.json> --summary <summary.json> [--manifest <manifest.json>]
109
+ ```
110
+
111
+ ## Current GitHub Action Smoke
112
+
113
+ ```yaml
114
+ - uses: actions/checkout@v7
115
+
116
+ - uses: actions/setup-python@v6
117
+ with:
118
+ python-version: "3.12"
119
+
120
+ - uses: astral-sh/setup-uv@v8.3.1
121
+
122
+ - id: ai-bom
123
+ uses: 0disoft/ai-bom-generator@v0.1.2
124
+ with:
125
+ model-directory: .
126
+ config: aibom.toml
127
+ warnings: allow
128
+
129
+ - name: Verify AI-BOM outputs
130
+ shell: bash
131
+ run: |
132
+ set -euo pipefail
133
+ test -s "${{ steps.ai-bom.outputs.bom-path }}"
134
+ test -s "${{ steps.ai-bom.outputs.warning-report-path }}"
135
+ test -s "${{ steps.ai-bom.outputs.summary-path }}"
136
+ test "${{ steps.ai-bom.outputs.status }}" = "success"
137
+ ```
138
+
139
+ The action invokes the packaged CLI with `uv run --project`, so consuming
140
+ workflows must make Python 3.12 and `uv` available before this action runs. When
141
+ `format` or `warnings` inputs are omitted, the action lets the CLI use the
142
+ explicit config values and CLI defaults. Generated files are written to explicit
143
+ paths when provided, or to a run-unique directory under `RUNNER_TEMP`.
144
+ Summary-derived action outputs are published only when the generation manifest
145
+ matches the BOM, warning report, and summary files from the current run.
146
+
147
+ The current implementation validates explicit `aibom.toml` config files against
148
+ AI-BOM config schema v1, validates generated CycloneDX JSON 1.7 output against
149
+ the vendored official schema, and validates AI-BOM summary/warning contracts in
150
+ tests.
151
+
152
+ ## Non-Goals
153
+
154
+ - no automatic legal license judgment;
155
+ - no training-data audit guarantee;
156
+ - no vulnerability scanner;
157
+ - no model serving runtime;
158
+ - no hosted registry;
159
+ - no broad "all ML frameworks" promise until fixtures prove it.
160
+
161
+ ## Repository Hygiene
162
+
163
+ .editorconfig, .gitattributes, and .gitignore are generated to keep line endings,
164
+ binary diffs, local files, build outputs, caches, and secret files under control.
165
+
166
+ ## Scope Notes
167
+
168
+ Runtime floor is Python 3.12, the initial CLI adapter is `argparse`, package
169
+ metadata lives in `pyproject.toml`, JSON Schema validation uses `jsonschema`,
170
+ the project lockfile is `uv.lock`, explicit config files use `aibom.toml`, the
171
+ first exporter is CycloneDX JSON 1.7, strict redaction is the default, and the
172
+ repository license is Apache-2.0. The first public MVP release uses immutable
173
+ GitHub tags, with `v0.1.2` as the current smoke-tested patch tag and first PyPI
174
+ package release. Mutable major action tags, GitHub Marketplace registration,
175
+ second exporter priority, automatic config discovery, and model artifact
176
+ discovery defaults remain deferred until the repository owner records them in
177
+ the source-of-truth documents.
@@ -0,0 +1,67 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "ai-bom-generator"
7
+ version = "0.1.2"
8
+ description = "Local AI/ML bill-of-materials generator"
9
+ readme = "README.md"
10
+ requires-python = ">=3.12"
11
+ license = "Apache-2.0"
12
+ authors = [
13
+ { name = "0disoft" }
14
+ ]
15
+ keywords = [
16
+ "ai",
17
+ "ai-bom",
18
+ "bill-of-materials",
19
+ "bom",
20
+ "cyclonedx",
21
+ "machine-learning",
22
+ "ml-bom",
23
+ "supply-chain"
24
+ ]
25
+ classifiers = [
26
+ "Development Status :: 3 - Alpha",
27
+ "Environment :: Console",
28
+ "Intended Audience :: Developers",
29
+ "Operating System :: OS Independent",
30
+ "Programming Language :: Python :: 3",
31
+ "Programming Language :: Python :: 3.12",
32
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
33
+ "Topic :: Security",
34
+ "Topic :: Software Development :: Build Tools"
35
+ ]
36
+ dependencies = [
37
+ "jsonschema>=4.25,<5"
38
+ ]
39
+
40
+ [project.urls]
41
+ Homepage = "https://github.com/0disoft/ai-bom-generator"
42
+ Repository = "https://github.com/0disoft/ai-bom-generator"
43
+ Issues = "https://github.com/0disoft/ai-bom-generator/issues"
44
+ Changelog = "https://github.com/0disoft/ai-bom-generator/blob/main/CHANGELOG.md"
45
+ Releases = "https://github.com/0disoft/ai-bom-generator/releases"
46
+
47
+ [project.scripts]
48
+ ai-bom = "ai_bom_generator.cli:main"
49
+
50
+ [tool.setuptools.packages.find]
51
+ where = ["src"]
52
+
53
+ [tool.setuptools.package-data]
54
+ ai_bom_generator = [
55
+ "config/schema/*.json",
56
+ "exporters/cyclonedx_json/schema/*.json",
57
+ "exporters/cyclonedx_json/schema/LICENSE"
58
+ ]
59
+
60
+ [tool.ruff]
61
+ target-version = "py312"
62
+ src = ["src", "tests", "scripts"]
63
+
64
+ [dependency-groups]
65
+ dev = [
66
+ "ruff>=0.15.20",
67
+ ]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,3 @@
1
+ """AI-BOM Generator package."""
2
+
3
+ __version__ = "0.1.2"
@@ -0,0 +1,5 @@
1
+ from ai_bom_generator.cli import main
2
+
3
+
4
+ if __name__ == "__main__":
5
+ raise SystemExit(main())