Skip to content

Commit 239d99a

Browse files
committed
chore(release): compute grammar count in SBOM, complete non-MIT license summary
The SBOM hardcoded '158-grammars' for the tree-sitter-grammars aggregate; the true count is now 159 (Mojo + InterSystems ObjectScript vendored, nim dropped since the literal was last set), so the shipped SBOM under-counted. Compute the count from the vendored grammar directories so it cannot drift again. Also correct the non-MIT summary, which named only clojure CC0-1.0 + jinja2/just Apache-2.0 while omitting fennel (CC0), the other eight Apache grammars, fish (Unlicense) and pine/templ (ISC); it now lists the full non-MIT family set and is explicitly non-exhaustive, deferring to MANIFEST.md as authoritative. Data-only change to generated sbom.json; no build or gating behavior changes. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
1 parent 610531a commit 239d99a

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ jobs:
107107
- name: Generate SBOM
108108
run: |
109109
python3 -c "
110-
import json
110+
import json, glob, os
111+
n_grammars = len([d for d in glob.glob('internal/cbm/vendored/grammars/*') if os.path.isdir(d)])
111112
sbom = {
112113
'spdxVersion': 'SPDX-2.3',
113114
'dataLicense': 'CC0-1.0',
@@ -131,7 +132,7 @@ jobs:
131132
{'SPDXID': 'SPDXRef-Package-verstable', 'name': 'verstable', 'versionInfo': '2.2.1', 'licenseDeclared': 'MIT', 'downloadLocation': 'https://github.com/JacksonAllan/Verstable', 'filesAnalyzed': False},
132133
{'SPDXID': 'SPDXRef-Package-wyhash', 'name': 'wyhash', 'versionInfo': 'final-4.3', 'licenseDeclared': 'Unlicense', 'downloadLocation': 'https://github.com/wangyi-fudan/wyhash', 'filesAnalyzed': False},
133134
{'SPDXID': 'SPDXRef-Package-nomic-embed-code', 'name': 'nomic-embed-code-token-embeddings', 'versionInfo': '1.0', 'licenseDeclared': 'Apache-2.0', 'downloadLocation': 'https://huggingface.co/nomic-ai/nomic-embed-code', 'filesAnalyzed': False, 'comment': 'Derived int8 token embeddings; see vendored/nomic/NOTICE'},
134-
{'SPDXID': 'SPDXRef-Package-tree-sitter-grammars', 'name': 'tree-sitter-grammars-aggregate', 'versionInfo': '158-grammars', 'licenseDeclared': 'MIT', 'downloadLocation': 'NOASSERTION', 'filesAnalyzed': False, 'comment': 'Aggregate of 158 vendored tree-sitter grammars. Predominantly MIT; exceptions: clojure CC0-1.0, jinja2 + just Apache-2.0, first-party grammars (c) DeusData MIT. Per-grammar provenance: internal/cbm/vendored/grammars/MANIFEST.md; full texts ship in THIRD_PARTY_NOTICES.md inside each archive.'}
135+
{'SPDXID': 'SPDXRef-Package-tree-sitter-grammars', 'name': 'tree-sitter-grammars-aggregate', 'versionInfo': f'{n_grammars}-grammars', 'licenseDeclared': 'MIT', 'downloadLocation': 'NOASSERTION', 'filesAnalyzed': False, 'comment': f'Aggregate of {n_grammars} vendored tree-sitter grammars, compiled statically. Predominantly MIT; non-MIT families present include CC0-1.0 (clojure, fennel), Apache-2.0 (elixir, erlang, gleam, hcl, ini, jinja2, just, pkl, sway, wit), ISC (pine, templ), Unlicense (fish); first-party grammars (c) DeusData, MIT. This summary is non-exhaustive; the authoritative complete per-grammar license list is internal/cbm/vendored/grammars/MANIFEST.md, and full license texts ship in THIRD_PARTY_NOTICES.md inside each archive.'}
135136
]
136137
}
137138
json.dump(sbom, open('sbom.json', 'w'), indent=2)

0 commit comments

Comments
 (0)