embtrace-check 0.1.0__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 (46) hide show
  1. embtrace_check-0.1.0/.github/release-notes/v0.1.0.md +34 -0
  2. embtrace_check-0.1.0/.github/workflows/publish-placeholder.yml +17 -0
  3. embtrace_check-0.1.0/.github/workflows/publish.yml +33 -0
  4. embtrace_check-0.1.0/.github/workflows/tests.yml +16 -0
  5. embtrace_check-0.1.0/.gitignore +9 -0
  6. embtrace_check-0.1.0/LICENSE +21 -0
  7. embtrace_check-0.1.0/PKG-INFO +123 -0
  8. embtrace_check-0.1.0/README.md +73 -0
  9. embtrace_check-0.1.0/SECURITY.md +11 -0
  10. embtrace_check-0.1.0/embtrace-check.spec +56 -0
  11. embtrace_check-0.1.0/pyproject.toml +64 -0
  12. embtrace_check-0.1.0/src/embtrace_check/__init__.py +3 -0
  13. embtrace_check-0.1.0/src/embtrace_check/analyzer/__init__.py +1 -0
  14. embtrace_check-0.1.0/src/embtrace_check/analyzer/models.py +148 -0
  15. embtrace_check-0.1.0/src/embtrace_check/analyzer/normalize.py +118 -0
  16. embtrace_check-0.1.0/src/embtrace_check/analyzer/parsers/__init__.py +40 -0
  17. embtrace_check-0.1.0/src/embtrace_check/analyzer/parsers/autotools.py +101 -0
  18. embtrace_check-0.1.0/src/embtrace_check/analyzer/parsers/cargo.py +102 -0
  19. embtrace_check-0.1.0/src/embtrace_check/analyzer/parsers/cmake.py +242 -0
  20. embtrace_check-0.1.0/src/embtrace_check/analyzer/parsers/configure.py +139 -0
  21. embtrace_check-0.1.0/src/embtrace_check/analyzer/parsers/gomod.py +54 -0
  22. embtrace_check-0.1.0/src/embtrace_check/analyzer/parsers/gradle.py +97 -0
  23. embtrace_check-0.1.0/src/embtrace_check/analyzer/parsers/makefile.py +86 -0
  24. embtrace_check-0.1.0/src/embtrace_check/analyzer/parsers/maven.py +81 -0
  25. embtrace_check-0.1.0/src/embtrace_check/analyzer/parsers/meson.py +125 -0
  26. embtrace_check-0.1.0/src/embtrace_check/analyzer/parsers/npm.py +32 -0
  27. embtrace_check-0.1.0/src/embtrace_check/analyzer/parsers/python.py +252 -0
  28. embtrace_check-0.1.0/src/embtrace_check/analyzer/pipeline/__init__.py +162 -0
  29. embtrace_check-0.1.0/src/embtrace_check/analyzer/pipeline/base.py +55 -0
  30. embtrace_check-0.1.0/src/embtrace_check/analyzer/pipeline/merge.py +107 -0
  31. embtrace_check-0.1.0/src/embtrace_check/analyzer/pipeline/tier1_cli.py +749 -0
  32. embtrace_check-0.1.0/src/embtrace_check/analyzer/pipeline/tier2_structured.py +717 -0
  33. embtrace_check-0.1.0/src/embtrace_check/analyzer/pipeline/tier4_regex.py +231 -0
  34. embtrace_check-0.1.0/src/embtrace_check/analyzer/scanner.py +215 -0
  35. embtrace_check-0.1.0/src/embtrace_check/cli.py +198 -0
  36. embtrace_check-0.1.0/src/embtrace_check/collector.py +100 -0
  37. embtrace_check-0.1.0/src/embtrace_check/core/__init__.py +1 -0
  38. embtrace_check-0.1.0/src/embtrace_check/core/exceptions.py +228 -0
  39. embtrace_check-0.1.0/src/embtrace_check/core/log.py +72 -0
  40. embtrace_check-0.1.0/src/embtrace_check/payload.py +99 -0
  41. embtrace_check-0.1.0/src/embtrace_check/sbom/__init__.py +1 -0
  42. embtrace_check-0.1.0/src/embtrace_check/sbom/scanner.py +984 -0
  43. embtrace_check-0.1.0/src/embtrace_check/upload.py +86 -0
  44. embtrace_check-0.1.0/tests/test_cli.py +131 -0
  45. embtrace_check-0.1.0/tests/test_collector.py +60 -0
  46. embtrace_check-0.1.0/tests/test_payload.py +80 -0
@@ -0,0 +1,34 @@
1
+ First public release of the CRA Readiness Check collector.
2
+
3
+ **What it does**
4
+
5
+ Run one command in your project folder — within 24 hours you receive a
6
+ report showing where your product stands with the EU Cyber Resilience Act:
7
+ traffic-light readiness status, your full component inventory, and known
8
+ vulnerabilities with severity.
9
+
10
+ ```bash
11
+ pipx install embtrace-check
12
+ embtrace-check . --code CHK-XXXX-YYYY
13
+ ```
14
+
15
+ Get your free one-time code at https://embtrace.dev/check.
16
+
17
+ **What leaves your machine — and what never does**
18
+
19
+ Transmitted: dependency names, versions and ecosystems (from lockfiles and
20
+ build files), the project folder name (hash it with `--anonymize`), scan
21
+ statistics. **Never:** source code, file paths, file contents, credentials.
22
+ Verify it yourself: `embtrace-check . --dry-run` prints the exact payload
23
+ and uploads nothing — that is why this collector is open source.
24
+
25
+ **Supported build systems**
26
+
27
+ Conan, vcpkg, CMake (FetchContent/find_package), Cargo, npm/yarn/pnpm,
28
+ Python (pip/Poetry/pyproject), Go, Maven, Gradle, Meson and more —
29
+ deterministic parsers, no AI, no network access during the scan.
30
+
31
+ **Assets**
32
+
33
+ `embtrace-check-0.1.0-linux-x86_64` — standalone binary (no Python
34
+ required, built on Ubuntu 22.04 for broad glibc compatibility) + SHA-256.
@@ -0,0 +1,17 @@
1
+ name: publish-placeholder
2
+ on:
3
+ push:
4
+ tags: ["embtrace-placeholder-v*"]
5
+ workflow_dispatch:
6
+ jobs:
7
+ pypi:
8
+ runs-on: ubuntu-latest
9
+ environment: pypi
10
+ permissions: { id-token: write } # PyPI Trusted Publishing
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ - uses: actions/setup-python@v5
14
+ with: { python-version: "3.12" }
15
+ - run: pip install build && python -m build placeholder
16
+ - uses: pypa/gh-action-pypi-publish@release/v1
17
+ with: { packages-dir: placeholder/dist }
@@ -0,0 +1,33 @@
1
+ name: publish
2
+ on:
3
+ push:
4
+ tags: ["v*"]
5
+ jobs:
6
+ pypi:
7
+ runs-on: ubuntu-latest
8
+ environment: pypi
9
+ permissions: { id-token: write } # PyPI Trusted Publishing
10
+ steps:
11
+ - uses: actions/checkout@v4
12
+ - uses: actions/setup-python@v5
13
+ with: { python-version: "3.12" }
14
+ - run: pip install build && python -m build
15
+ - uses: pypa/gh-action-pypi-publish@release/v1
16
+ binary:
17
+ runs-on: ubuntu-22.04 # aeltere glibc = laeuft auf mehr Zielsystemen
18
+ permissions: { contents: write }
19
+ steps:
20
+ - uses: actions/checkout@v4
21
+ - uses: actions/setup-python@v5
22
+ with: { python-version: "3.12" }
23
+ - run: pip install . pyinstaller
24
+ - run: pyinstaller embtrace-check.spec --clean --noconfirm
25
+ - run: |
26
+ BIN=embtrace-check-${GITHUB_REF_NAME#v}-linux-x86_64
27
+ mv dist/embtrace-check "dist/$BIN"
28
+ ( cd dist && sha256sum "$BIN" > "$BIN.sha256" )
29
+ - uses: softprops/action-gh-release@v2
30
+ with:
31
+ name: embtrace-check ${{ github.ref_name }}
32
+ body_path: .github/release-notes/${{ github.ref_name }}.md
33
+ files: "dist/embtrace-check-*"
@@ -0,0 +1,16 @@
1
+ name: tests
2
+ on:
3
+ push: { branches: [main] }
4
+ pull_request:
5
+ jobs:
6
+ test:
7
+ runs-on: ubuntu-latest
8
+ strategy:
9
+ matrix: { python-version: ["3.11", "3.12"] }
10
+ steps:
11
+ - uses: actions/checkout@v4
12
+ - uses: actions/setup-python@v5
13
+ with: { python-version: "${{ matrix.python-version }}" }
14
+ - run: pip install -e ".[dev]"
15
+ - run: ruff check src tests
16
+ - run: pytest -q
@@ -0,0 +1,9 @@
1
+ __pycache__/
2
+ *.pyc
3
+ *.egg-info/
4
+ dist/
5
+ build/
6
+ .venv/
7
+ .pytest_cache/
8
+ .mypy_cache/
9
+ .ruff_cache/
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Innomatica GmbH
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,123 @@
1
+ Metadata-Version: 2.4
2
+ Name: embtrace-check
3
+ Version: 0.1.0
4
+ Summary: CRA Readiness Check collector — scans your project's lockfiles and uploads dependency metadata only (never code, never paths). Open source so you can verify exactly what leaves your machine.
5
+ Project-URL: Homepage, https://embtrace.dev/check
6
+ Project-URL: Source, https://github.com/Innomatica-GmbH/embtrace-check
7
+ Project-URL: Privacy, https://embtrace.dev/check-privacy
8
+ Author-email: Innomatica GmbH <office@innomatica.de>
9
+ License: MIT License
10
+
11
+ Copyright (c) 2026 Innomatica GmbH
12
+
13
+ Permission is hereby granted, free of charge, to any person obtaining a copy
14
+ of this software and associated documentation files (the "Software"), to deal
15
+ in the Software without restriction, including without limitation the rights
16
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17
+ copies of the Software, and to permit persons to whom the Software is
18
+ furnished to do so, subject to the following conditions:
19
+
20
+ The above copyright notice and this permission notice shall be included in all
21
+ copies or substantial portions of the Software.
22
+
23
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29
+ SOFTWARE.
30
+ License-File: LICENSE
31
+ Keywords: compliance,cra,cyber-resilience-act,dependencies,embedded,sbom
32
+ Classifier: Development Status :: 4 - Beta
33
+ Classifier: Intended Audience :: Developers
34
+ Classifier: License :: OSI Approved :: MIT License
35
+ Classifier: Operating System :: POSIX :: Linux
36
+ Classifier: Programming Language :: Python :: 3.11
37
+ Classifier: Programming Language :: Python :: 3.12
38
+ Classifier: Topic :: Security
39
+ Classifier: Topic :: Software Development :: Quality Assurance
40
+ Requires-Python: >=3.11
41
+ Requires-Dist: click>=8.1
42
+ Requires-Dist: pydantic>=2.0
43
+ Requires-Dist: pyyaml>=6.0
44
+ Requires-Dist: rich>=13.0
45
+ Provides-Extra: dev
46
+ Requires-Dist: mypy>=1.10; extra == 'dev'
47
+ Requires-Dist: pytest>=8.0; extra == 'dev'
48
+ Requires-Dist: ruff<0.17,>=0.16; extra == 'dev'
49
+ Description-Content-Type: text/markdown
50
+
51
+ # embtrace-check
52
+
53
+ **Free CRA Readiness Check collector** — one command in your project folder,
54
+ and within 24 hours you receive a report showing where your product stands
55
+ with the [EU Cyber Resilience Act](https://embtrace.dev/en/cra-nis2-guide.html):
56
+ traffic-light readiness status, your full component inventory, and known
57
+ vulnerabilities with severity.
58
+
59
+ This collector is **open source for one reason: so you can verify exactly
60
+ what leaves your machine.**
61
+
62
+ ## What it transmits — and what it never does
63
+
64
+ Transmitted (JSON, ~a few kB):
65
+
66
+ - names, versions and package ecosystems of your dependencies
67
+ (from lockfiles and build files: Conan, vcpkg, CMake, Cargo, npm/yarn/pnpm,
68
+ Python, Go, Maven/Gradle, Meson, and more),
69
+ - the project folder name (hash it with `--anonymize`),
70
+ - scan statistics (number of build files, tool version).
71
+
72
+ **Never transmitted:** source code, file paths, file contents, configuration,
73
+ credentials. See for yourself before sending anything:
74
+
75
+ ```bash
76
+ embtrace-check . --dry-run # prints the exact payload, uploads nothing
77
+ ```
78
+
79
+ ## Usage
80
+
81
+ 1. Get your free one-time code at **<https://embtrace.dev/check>**
82
+ (the report goes to the e-mail address you register there).
83
+ 2. Run the collector in your project folder:
84
+
85
+ ```bash
86
+ pipx install embtrace-check # or: pip install embtrace-check,
87
+ # or download the standalone binary
88
+ embtrace-check . --code CHK-XXXX-YYYY
89
+ ```
90
+
91
+ 3. Your report arrives within 24 hours. The code is valid for one check.
92
+
93
+ More options: `embtrace-check --help` — including `--output payload.json`
94
+ for air-gapped environments (send the file by mail) and `--with-tools` to
95
+ additionally use native package-manager CLIs for higher-fidelity results.
96
+
97
+ ## Exit codes
98
+
99
+ | Code | Meaning |
100
+ |------|---------|
101
+ | 0 | success |
102
+ | 1 | error (network, invalid code, …) |
103
+ | 2 | no components found — declare dependencies manually in `embtrace-deps.yaml` |
104
+
105
+ ## Privacy
106
+
107
+ Data is processed exclusively on Innomatica's own servers in Germany and is
108
+ never shared or sold. Full notes: <https://embtrace.dev/check-privacy>.
109
+
110
+ ## About
111
+
112
+ `embtrace-check` is the free entry point to
113
+ [embtrace](https://embtrace.dev) — the CRA/NIS2 compliance toolchain for
114
+ embedded software teams by [Innomatica GmbH](https://embtrace.dev/impressum.html).
115
+ The server side (enrichment, vulnerability monitoring, reports) is a
116
+ commercial product; this repository contains the complete client.
117
+
118
+ Maintained by Innomatica; the roadmap follows the product. Issues and PRs are
119
+ welcome — please report security topics per [SECURITY.md](SECURITY.md).
120
+
121
+ ## License
122
+
123
+ [MIT](LICENSE) © 2026 Innomatica GmbH
@@ -0,0 +1,73 @@
1
+ # embtrace-check
2
+
3
+ **Free CRA Readiness Check collector** — one command in your project folder,
4
+ and within 24 hours you receive a report showing where your product stands
5
+ with the [EU Cyber Resilience Act](https://embtrace.dev/en/cra-nis2-guide.html):
6
+ traffic-light readiness status, your full component inventory, and known
7
+ vulnerabilities with severity.
8
+
9
+ This collector is **open source for one reason: so you can verify exactly
10
+ what leaves your machine.**
11
+
12
+ ## What it transmits — and what it never does
13
+
14
+ Transmitted (JSON, ~a few kB):
15
+
16
+ - names, versions and package ecosystems of your dependencies
17
+ (from lockfiles and build files: Conan, vcpkg, CMake, Cargo, npm/yarn/pnpm,
18
+ Python, Go, Maven/Gradle, Meson, and more),
19
+ - the project folder name (hash it with `--anonymize`),
20
+ - scan statistics (number of build files, tool version).
21
+
22
+ **Never transmitted:** source code, file paths, file contents, configuration,
23
+ credentials. See for yourself before sending anything:
24
+
25
+ ```bash
26
+ embtrace-check . --dry-run # prints the exact payload, uploads nothing
27
+ ```
28
+
29
+ ## Usage
30
+
31
+ 1. Get your free one-time code at **<https://embtrace.dev/check>**
32
+ (the report goes to the e-mail address you register there).
33
+ 2. Run the collector in your project folder:
34
+
35
+ ```bash
36
+ pipx install embtrace-check # or: pip install embtrace-check,
37
+ # or download the standalone binary
38
+ embtrace-check . --code CHK-XXXX-YYYY
39
+ ```
40
+
41
+ 3. Your report arrives within 24 hours. The code is valid for one check.
42
+
43
+ More options: `embtrace-check --help` — including `--output payload.json`
44
+ for air-gapped environments (send the file by mail) and `--with-tools` to
45
+ additionally use native package-manager CLIs for higher-fidelity results.
46
+
47
+ ## Exit codes
48
+
49
+ | Code | Meaning |
50
+ |------|---------|
51
+ | 0 | success |
52
+ | 1 | error (network, invalid code, …) |
53
+ | 2 | no components found — declare dependencies manually in `embtrace-deps.yaml` |
54
+
55
+ ## Privacy
56
+
57
+ Data is processed exclusively on Innomatica's own servers in Germany and is
58
+ never shared or sold. Full notes: <https://embtrace.dev/check-privacy>.
59
+
60
+ ## About
61
+
62
+ `embtrace-check` is the free entry point to
63
+ [embtrace](https://embtrace.dev) — the CRA/NIS2 compliance toolchain for
64
+ embedded software teams by [Innomatica GmbH](https://embtrace.dev/impressum.html).
65
+ The server side (enrichment, vulnerability monitoring, reports) is a
66
+ commercial product; this repository contains the complete client.
67
+
68
+ Maintained by Innomatica; the roadmap follows the product. Issues and PRs are
69
+ welcome — please report security topics per [SECURITY.md](SECURITY.md).
70
+
71
+ ## License
72
+
73
+ [MIT](LICENSE) © 2026 Innomatica GmbH
@@ -0,0 +1,11 @@
1
+ # Security Policy
2
+
3
+ `embtrace-check` is designed around data minimization: it transmits only
4
+ component names, versions and package ecosystems — never source code, file
5
+ paths or file contents. Verify it yourself with `--dry-run`.
6
+
7
+ ## Reporting a vulnerability
8
+
9
+ Please report security issues privately to **office@innomatica.de**
10
+ (subject: `SECURITY embtrace-check`). We aim to respond within 48 hours.
11
+ Please do not open public issues for security reports.
@@ -0,0 +1,56 @@
1
+ # -*- mode: python ; coding: utf-8 -*-
2
+ """PyInstaller spec for the standalone embtrace-check binary.
3
+
4
+ Build with:
5
+ pyinstaller embtrace-check.spec --clean
6
+ """
7
+
8
+ from PyInstaller.utils.hooks import collect_submodules
9
+
10
+ a = Analysis(
11
+ ["src/embtrace_check/cli.py"],
12
+ pathex=["src"],
13
+ binaries=[],
14
+ datas=[],
15
+ hiddenimports=[
16
+ "embtrace_check.payload",
17
+ "embtrace_check.collector",
18
+ "embtrace_check.upload",
19
+ "embtrace_check.analyzer.pipeline.tier1_cli",
20
+ "embtrace_check.analyzer.pipeline.tier2_structured",
21
+ "embtrace_check.analyzer.pipeline.tier4_regex",
22
+ "embtrace_check.analyzer.pipeline.merge",
23
+ "embtrace_check.analyzer.scanner",
24
+ "embtrace_check.analyzer.normalize",
25
+ "embtrace_check.sbom.scanner",
26
+ "embtrace_check.core.exceptions",
27
+ *collect_submodules("embtrace_check.analyzer.parsers"),
28
+ "yaml",
29
+ "pydantic",
30
+ "click",
31
+ "rich",
32
+ ],
33
+ hookspath=[],
34
+ hooksconfig={},
35
+ runtime_hooks=[],
36
+ excludes=["pytest", "mypy", "ruff"],
37
+ noarchive=False,
38
+ )
39
+
40
+ pyz = PYZ(a.pure, a.zipped_data)
41
+
42
+ exe = EXE(
43
+ pyz,
44
+ a.scripts,
45
+ a.binaries,
46
+ a.datas,
47
+ [],
48
+ name="embtrace-check",
49
+ debug=False,
50
+ bootloader_ignore_signals=False,
51
+ strip=False,
52
+ upx=True,
53
+ upx_exclude=[],
54
+ runtime_tmpdir=None,
55
+ console=True,
56
+ )
@@ -0,0 +1,64 @@
1
+ [project]
2
+ name = "embtrace-check"
3
+ version = "0.1.0"
4
+ description = "CRA Readiness Check collector — scans your project's lockfiles and uploads dependency metadata only (never code, never paths). Open source so you can verify exactly what leaves your machine."
5
+ readme = "README.md"
6
+ license = { file = "LICENSE" }
7
+ requires-python = ">=3.11"
8
+ authors = [{ name = "Innomatica GmbH", email = "office@innomatica.de" }]
9
+ keywords = ["cra", "cyber-resilience-act", "sbom", "compliance", "embedded", "dependencies"]
10
+ classifiers = [
11
+ "Development Status :: 4 - Beta",
12
+ "Intended Audience :: Developers",
13
+ "License :: OSI Approved :: MIT License",
14
+ "Operating System :: POSIX :: Linux",
15
+ "Programming Language :: Python :: 3.11",
16
+ "Programming Language :: Python :: 3.12",
17
+ "Topic :: Security",
18
+ "Topic :: Software Development :: Quality Assurance",
19
+ ]
20
+ dependencies = [
21
+ "click>=8.1",
22
+ "pydantic>=2.0",
23
+ "pyyaml>=6.0",
24
+ "rich>=13.0",
25
+ ]
26
+
27
+ [project.optional-dependencies]
28
+ dev = [
29
+ "pytest>=8.0",
30
+ "ruff>=0.16,<0.17",
31
+ "mypy>=1.10",
32
+ ]
33
+
34
+ [project.urls]
35
+ Homepage = "https://embtrace.dev/check"
36
+ Source = "https://github.com/Innomatica-GmbH/embtrace-check"
37
+ Privacy = "https://embtrace.dev/check-privacy"
38
+
39
+ [project.scripts]
40
+ embtrace-check = "embtrace_check.cli:main"
41
+
42
+ [build-system]
43
+ requires = ["hatchling"]
44
+ build-backend = "hatchling.build"
45
+
46
+ [tool.hatch.build.targets.wheel]
47
+ packages = ["src/embtrace_check"]
48
+
49
+ [tool.hatch.build.targets.sdist]
50
+ exclude = ["placeholder/"]
51
+
52
+ [tool.ruff]
53
+ target-version = "py311"
54
+ line-length = 100
55
+ src = ["src"]
56
+
57
+ [tool.ruff.lint]
58
+ # Same rule set as the embtrace main repo — the vendored analyzer/sbom
59
+ # modules must stay lint-clean under identical rules in both repos.
60
+ select = ["E", "F", "I", "N", "W", "UP", "B", "A", "SIM", "TC"]
61
+ ignore = ["TC003"]
62
+
63
+ [tool.pytest.ini_options]
64
+ testpaths = ["tests"]
@@ -0,0 +1,3 @@
1
+ """embtrace-check — standalone collector for the embtrace CRA Readiness Check."""
2
+
3
+ __version__ = "0.1.0"
@@ -0,0 +1 @@
1
+ """Vendored subset of the embtrace analyzer (deterministic tiers only)."""
@@ -0,0 +1,148 @@
1
+ """Pydantic models for AI project analyzer.
2
+
3
+ Covers LLM analysis output, reconciliation results, and the decisions.yaml
4
+ persistence format.
5
+ """
6
+
7
+ from __future__ import annotations
8
+
9
+ from pydantic import BaseModel
10
+
11
+ # ---------------------------------------------------------------------------
12
+ # LLM output models
13
+ # ---------------------------------------------------------------------------
14
+
15
+ class BuildFileDependency(BaseModel):
16
+ """A dependency detected by LLM analysis of build files."""
17
+
18
+ name: str
19
+ version: str = ""
20
+ ecosystem: str = ""
21
+ source_file: str = ""
22
+ source_line: int = 0
23
+ context: str = "" # LLM context, e.g. "inside if(USE_LIBRESSL)"
24
+ confidence: float = 1.0
25
+ tier: int = 0 # 0=LLM, 1-5=Pipeline tier
26
+ detection_method: str = "" # e.g. "cargo-metadata", "regex-cmake", "treesitter-meson"
27
+
28
+
29
+ class BuildFileArtifact(BaseModel):
30
+ """An artifact (binary, library, etc.) detected in build files."""
31
+
32
+ path: str
33
+ artifact_type: str = "binary" # binary | library | config | script
34
+ source_file: str = ""
35
+ source_line: int = 0
36
+
37
+
38
+ class BuildFileInternalDep(BaseModel):
39
+ """An internal project dependency detected in build files."""
40
+
41
+ project: str
42
+ source_file: str = ""
43
+ source_line: int = 0
44
+ context: str = ""
45
+
46
+
47
+ class LLMAnalysisResult(BaseModel):
48
+ """Result of analyzing a single build file with the LLM."""
49
+
50
+ file_path: str
51
+ dependencies: list[BuildFileDependency] = []
52
+ artifacts: list[BuildFileArtifact] = []
53
+ internal_deps: list[BuildFileInternalDep] = []
54
+
55
+
56
+ # ---------------------------------------------------------------------------
57
+ # Reconciliation result models
58
+ # ---------------------------------------------------------------------------
59
+
60
+ class ConfirmedEntry(BaseModel):
61
+ """Both lockfile scanner and build-file analysis agree on this dependency."""
62
+
63
+ name: str
64
+ version: str
65
+ ecosystem: str = ""
66
+ source_file: str = ""
67
+
68
+
69
+ class LockfileOnlyEntry(BaseModel):
70
+ """Dependency found only in the lockfile scanner output."""
71
+
72
+ name: str
73
+ version: str
74
+ ecosystem: str = ""
75
+ accept: bool | None = None
76
+
77
+
78
+ class BuildFileOnlyEntry(BaseModel):
79
+ """Dependency found only in LLM build-file analysis."""
80
+
81
+ name: str
82
+ version: str = ""
83
+ ecosystem: str = ""
84
+ source_file: str = ""
85
+ confidence: float = 1.0
86
+ context: str = ""
87
+ accept: bool | None = None
88
+
89
+
90
+ class ConflictEntry(BaseModel):
91
+ """Version mismatch between lockfile and build-file analysis."""
92
+
93
+ name: str
94
+ lockfile_version: str
95
+ build_file_version: str
96
+ ecosystem: str = ""
97
+ source_file: str = ""
98
+ accept: bool | None = None
99
+ use_version: str = ""
100
+
101
+
102
+ class ArtifactEntry(BaseModel):
103
+ """A produced artifact detected in build files."""
104
+
105
+ path: str
106
+ artifact_type: str = "binary"
107
+ source_file: str = ""
108
+
109
+
110
+ class InternalDepEntry(BaseModel):
111
+ """An internal dependency detected in build files."""
112
+
113
+ project: str
114
+ source_file: str = ""
115
+ context: str = ""
116
+ accept: bool | None = None
117
+
118
+
119
+ # ---------------------------------------------------------------------------
120
+ # decisions.yaml root model
121
+ # ---------------------------------------------------------------------------
122
+
123
+ class DecisionsFile(BaseModel):
124
+ """Root model for .embtrace/proposal/decisions.yaml."""
125
+
126
+ scan_date: str
127
+ model: str = ""
128
+ confirmed: list[ConfirmedEntry] = []
129
+ lockfile_only: list[LockfileOnlyEntry] = []
130
+ build_file_only: list[BuildFileOnlyEntry] = []
131
+ conflicts: list[ConflictEntry] = []
132
+ artifacts: list[ArtifactEntry] = []
133
+ internal_dependencies: list[InternalDepEntry] = []
134
+
135
+
136
+ # ---------------------------------------------------------------------------
137
+ # Reconciliation container
138
+ # ---------------------------------------------------------------------------
139
+
140
+ class ReconciliationResult(BaseModel):
141
+ """Container for reconciliation output — input to proposal generation."""
142
+
143
+ confirmed: list[ConfirmedEntry] = []
144
+ lockfile_only: list[LockfileOnlyEntry] = []
145
+ build_file_only: list[BuildFileOnlyEntry] = []
146
+ conflicts: list[ConflictEntry] = []
147
+ artifacts: list[ArtifactEntry] = []
148
+ internal_dependencies: list[InternalDepEntry] = []