sphinx-traceability-view 1.0.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 (77) hide show
  1. sphinx_traceability_view-1.0.0/.gitignore +28 -0
  2. sphinx_traceability_view-1.0.0/LICENSE +21 -0
  3. sphinx_traceability_view-1.0.0/PKG-INFO +13 -0
  4. sphinx_traceability_view-1.0.0/README.rst +279 -0
  5. sphinx_traceability_view-1.0.0/conftest.py +23 -0
  6. sphinx_traceability_view-1.0.0/frontend/build.js +42 -0
  7. sphinx_traceability_view-1.0.0/frontend/legal/Apache-2.0.txt +202 -0
  8. sphinx_traceability_view-1.0.0/frontend/legal/ELK-COMPILED-ATTRIBUTIONS.txt +2579 -0
  9. sphinx_traceability_view-1.0.0/frontend/legal/EPL-1.0.txt +73 -0
  10. sphinx_traceability_view-1.0.0/frontend/legal/GWT-COPYING.txt +176 -0
  11. sphinx_traceability_view-1.0.0/frontend/legal/babel-MIT.txt +22 -0
  12. sphinx_traceability_view-1.0.0/frontend/legal/browser-pack-MIT.txt +18 -0
  13. sphinx_traceability_view-1.0.0/frontend/legal/browserify-MIT.txt +63 -0
  14. sphinx_traceability_view-1.0.0/frontend/legal/elk-inventory.json +102 -0
  15. sphinx_traceability_view-1.0.0/frontend/legal/web-worker-license.txt +201 -0
  16. sphinx_traceability_view-1.0.0/frontend/package-lock.json +642 -0
  17. sphinx_traceability_view-1.0.0/frontend/package.json +22 -0
  18. sphinx_traceability_view-1.0.0/frontend/src/inspect/README.rst +22 -0
  19. sphinx_traceability_view-1.0.0/frontend/src/inspect/collection.js +16 -0
  20. sphinx_traceability_view-1.0.0/frontend/src/inspect/content.js +83 -0
  21. sphinx_traceability_view-1.0.0/frontend/src/inspect/inspect.js +36 -0
  22. sphinx_traceability_view-1.0.0/frontend/src/inspect/persistent.js +48 -0
  23. sphinx_traceability_view-1.0.0/frontend/src/inspect/tests/collection.test.js +21 -0
  24. sphinx_traceability_view-1.0.0/frontend/src/inspect/tests/inspect.test.js +47 -0
  25. sphinx_traceability_view-1.0.0/frontend/src/inspect/tests/urls.test.js +20 -0
  26. sphinx_traceability_view-1.0.0/frontend/src/inspect/urls.js +25 -0
  27. sphinx_traceability_view-1.0.0/frontend/src/layout/README.rst +25 -0
  28. sphinx_traceability_view-1.0.0/frontend/src/layout/layout.js +161 -0
  29. sphinx_traceability_view-1.0.0/frontend/src/layout/level.js +6 -0
  30. sphinx_traceability_view-1.0.0/frontend/src/layout/stability.js +57 -0
  31. sphinx_traceability_view-1.0.0/frontend/src/layout/tests/classified-rows.test.js +40 -0
  32. sphinx_traceability_view-1.0.0/frontend/src/layout/tests/layout.test.js +110 -0
  33. sphinx_traceability_view-1.0.0/frontend/src/layout/tests/stability.test.js +91 -0
  34. sphinx_traceability_view-1.0.0/frontend/src/render/README.rst +27 -0
  35. sphinx_traceability_view-1.0.0/frontend/src/render/edge-viewport.js +9 -0
  36. sphinx_traceability_view-1.0.0/frontend/src/render/groups.js +17 -0
  37. sphinx_traceability_view-1.0.0/frontend/src/render/index.js +11 -0
  38. sphinx_traceability_view-1.0.0/frontend/src/render/seeds.js +56 -0
  39. sphinx_traceability_view-1.0.0/frontend/src/render/stv.css +9 -0
  40. sphinx_traceability_view-1.0.0/frontend/src/render/tests/edge-viewport.test.js +20 -0
  41. sphinx_traceability_view-1.0.0/frontend/src/render/tests/groups.test.js +24 -0
  42. sphinx_traceability_view-1.0.0/frontend/src/render/tests/seeds.test.js +11 -0
  43. sphinx_traceability_view-1.0.0/frontend/src/render/view.js +152 -0
  44. sphinx_traceability_view-1.0.0/frontend/src/state/README.rst +18 -0
  45. sphinx_traceability_view-1.0.0/frontend/src/state/state.js +58 -0
  46. sphinx_traceability_view-1.0.0/frontend/src/state/tests/state.test.js +88 -0
  47. sphinx_traceability_view-1.0.0/hatch_build.py +14 -0
  48. sphinx_traceability_view-1.0.0/pyproject.toml +53 -0
  49. sphinx_traceability_view-1.0.0/requirements-docs.txt +9 -0
  50. sphinx_traceability_view-1.0.0/requirements-tooling.txt +4 -0
  51. sphinx_traceability_view-1.0.0/src/sphinx_traceability_view/__init__.py +3 -0
  52. sphinx_traceability_view-1.0.0/src/sphinx_traceability_view/_version.py +2 -0
  53. sphinx_traceability_view-1.0.0/src/sphinx_traceability_view/bundle/README.rst +18 -0
  54. sphinx_traceability_view-1.0.0/src/sphinx_traceability_view/bundle/__init__.py +39 -0
  55. sphinx_traceability_view-1.0.0/src/sphinx_traceability_view/bundle/tests/test_bundle.py +33 -0
  56. sphinx_traceability_view-1.0.0/src/sphinx_traceability_view/detail_build/README.rst +18 -0
  57. sphinx_traceability_view-1.0.0/src/sphinx_traceability_view/detail_build/__init__.py +148 -0
  58. sphinx_traceability_view-1.0.0/src/sphinx_traceability_view/detail_build/tests/test_details.py +74 -0
  59. sphinx_traceability_view-1.0.0/src/sphinx_traceability_view/directive/README.rst +20 -0
  60. sphinx_traceability_view-1.0.0/src/sphinx_traceability_view/directive/__init__.py +2 -0
  61. sphinx_traceability_view-1.0.0/src/sphinx_traceability_view/directive/directives.py +36 -0
  62. sphinx_traceability_view-1.0.0/src/sphinx_traceability_view/directive/lifecycle.py +112 -0
  63. sphinx_traceability_view-1.0.0/src/sphinx_traceability_view/directive/tests/test_lifecycle.py +30 -0
  64. sphinx_traceability_view-1.0.0/src/sphinx_traceability_view/graph/README.rst +22 -0
  65. sphinx_traceability_view-1.0.0/src/sphinx_traceability_view/graph/__init__.py +55 -0
  66. sphinx_traceability_view-1.0.0/src/sphinx_traceability_view/graph/placement.py +48 -0
  67. sphinx_traceability_view-1.0.0/src/sphinx_traceability_view/graph/tests/test_graph.py +114 -0
  68. sphinx_traceability_view-1.0.0/src/sphinx_traceability_view/model/README.rst +21 -0
  69. sphinx_traceability_view-1.0.0/src/sphinx_traceability_view/model/__init__.py +98 -0
  70. sphinx_traceability_view-1.0.0/src/sphinx_traceability_view/model/tests/test_model.py +91 -0
  71. sphinx_traceability_view-1.0.0/src/sphinx_traceability_view/static/LICENSE.txt +21 -0
  72. sphinx_traceability_view-1.0.0/src/sphinx_traceability_view/static/THIRD_PARTY_NOTICES.txt +4046 -0
  73. sphinx_traceability_view-1.0.0/src/sphinx_traceability_view/static/stv.css +9 -0
  74. sphinx_traceability_view-1.0.0/src/sphinx_traceability_view/static/stv.js +24 -0
  75. sphinx_traceability_view-1.0.0/src/sphinx_traceability_view/static/vendor/ELK-INVENTORY.json +102 -0
  76. sphinx_traceability_view-1.0.0/src/sphinx_traceability_view/static/vendor/ELK-SOURCE.txt +51 -0
  77. sphinx_traceability_view-1.0.0/src/sphinx_traceability_view/static/vendor/elk.bundled.js +6540 -0
@@ -0,0 +1,28 @@
1
+ docs/_build/
2
+ .venv/
3
+ __pycache__/
4
+ .venv-implementation/
5
+ frontend/node_modules/
6
+ .pytest_cache/
7
+ dist/
8
+ *.egg-info/
9
+ *.pptx
10
+
11
+ # Routine logs; release execution records retain their linked evidence.
12
+ *.log
13
+ !docs/test-execution/**/*.log
14
+
15
+ # Python build, coverage and local tool output.
16
+ /build/
17
+ *.py[cod]
18
+ .coverage
19
+ .coverage.*
20
+ /coverage.xml
21
+ /htmlcov/
22
+ .ruff_cache/
23
+ .mypy_cache/
24
+ .tox/
25
+ .nox/
26
+
27
+ # Keep local security audit reports out of publication.
28
+ /_security-audits/
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Henning Heikes
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,13 @@
1
+ Metadata-Version: 2.4
2
+ Name: sphinx-traceability-view
3
+ Version: 1.0.0
4
+ Summary: Offline interactive views of a Sphinx-Needs traceability graph
5
+ Author: Henning Heikes
6
+ License-Expression: MIT AND ISC AND BSD-3-Clause AND Apache-2.0 AND EPL-1.0 AND EPL-2.0
7
+ License-File: LICENSE
8
+ License-File: src/sphinx_traceability_view/static/THIRD_PARTY_NOTICES.txt
9
+ License-File: src/sphinx_traceability_view/static/vendor/ELK-SOURCE.txt
10
+ Requires-Python: >=3.10
11
+ Requires-Dist: beautifulsoup4==4.13.5
12
+ Requires-Dist: sphinx-needs==8.2.0
13
+ Requires-Dist: sphinx==8.1.3
@@ -0,0 +1,279 @@
1
+ Interactive traceability view
2
+ =============================
3
+
4
+ Sphinx-Needs extension providing offline interactive traceability exploration.
5
+ Requirements and architecture are indexed in ``docs/index.rst``.
6
+ Project maturity and review records are maintained in ``docs/maturity.rst``.
7
+
8
+ Build documentation
9
+ -------------------
10
+
11
+ Run the PowerShell script using the project's existing ``.venv`` (Python 3.11+ for documentation tooling).
12
+ On the first run, install the pinned documentation dependencies and build::
13
+
14
+ .\build-docs.ps1 -InstallDependencies
15
+
16
+ For subsequent builds::
17
+
18
+ .\build-docs.ps1
19
+
20
+ The script works independently of the current working directory, treats Sphinx
21
+ warnings as errors, and returns a nonzero exit code on failure. Successful output
22
+ is written to ``docs/_build/html/index.html``. Virtual environment activation is
23
+ not required.
24
+
25
+ Each build uses a fresh staging directory. After success, it replaces the HTML
26
+ tree and writes ``_stv-publication.json`` with file sizes and SHA-256 hashes.
27
+ A failed build preserves the previous HTML tree. Earlier output and diagnostic
28
+ staging are retained beside ``html`` under ``docs/_build/``; publish only the
29
+ ``html`` directory. Rebuilding into an existing output with a direct Sphinx
30
+ command does not provide this clean-publication guarantee.
31
+
32
+ The configuration imports the shared model, status-chart extension and styling
33
+ directly, and includes the live central method. It discovers the shared skill
34
+ under an ancestor's ``-agents/skills`` or ``~/.agents/skills``. To select another
35
+ location, set ``REQUIREMENTS_SKILL_DIR`` to the shared
36
+ ``reverse-engineer-requirements`` skill directory. Its repository-level
37
+ ``method.md`` must also be present.
38
+
39
+ After building, run the shared validator (replace ``<shared-skill>`` with the
40
+ selected reverse-engineer-requirements skill directory)::
41
+
42
+ .\.venv\Scripts\python.exe <shared-skill>/scripts/validate_traceability.py docs/_build/html/needs.json --version <major.minor> --repo-root . --require-test-coverage --csv docs/_build/traceability.csv --test-csv docs/_build/test-traceability.csv
43
+
44
+ The internal specification includes conventional and channeled derivation paths,
45
+ allocations and containment. Graph validation establishes structural checks;
46
+ it does not establish semantic correctness, internal design acceptance or
47
+ successful runtime verification.
48
+
49
+ Architecture diagrams
50
+ ---------------------
51
+
52
+ Keep each .drawio source and its same-named .svg export together in
53
+ ``docs/architecture/diagrams``. Edit the Draw.io source and export SVG only::
54
+
55
+ & <shared-skill>/scripts/export-architecture.ps1 -ProjectRoot .
56
+
57
+ Use the selected shared skill checkout directly. No project-local symbolic
58
+ links or administrator rights for link creation are required.
59
+
60
+ The export script uses Draw.io and restores portable links from each paired
61
+ Draw.io source. It accepts ``-ProjectRoot`` and ``-DiagramDirectory`` for other
62
+ project layouts. To validate the published targets after building::
63
+
64
+ .\.venv\Scripts\python.exe <shared-skill>/scripts/normalize-diagram-links.py --diagram-dir docs/architecture/diagrams --published-dir docs/_build/html
65
+
66
+ Sphinx embeds the linked SVGs as interactive objects.
67
+
68
+ Implementation handover
69
+ -----------------------
70
+
71
+ Start with ``docs/implementation-plan.rst`` for module contracts and delivery
72
+ steps, ``docs/technology-stack.rst`` for selected libraries/versions/licenses,
73
+ and ``docs/verification-plan.rst`` for completion gates. Exact npm manifests and
74
+ lock are in ``docs/architecture/implementation``; Python direct implementation
75
+ pins are alongside them. Runtime verification is tracked in ``docs/maturity.rst``.
76
+
77
+ Build and use the extension
78
+ ---------------------------
79
+
80
+ Maintainers build the checked-in browser assets and Python distribution::
81
+
82
+ cd frontend
83
+ npm.cmd ci
84
+ node build.js
85
+ cd ..
86
+ .\.venv-implementation\Scripts\python.exe -m build --no-isolation
87
+
88
+ Install the generated wheel from ``dist/`` in the host's
89
+ Python environment and add ``sphinx_traceability_view`` to ``extensions`` in
90
+ ``conf.py``. Node is needed only when rebuilding browser assets. Host types and
91
+ relationships remain authoritative; see ``docs/internal-interfaces.rst`` for
92
+ replacement model configuration. Embed a project root or explicit seeds::
93
+
94
+ .. traceability-view::
95
+
96
+ .. traceability-view:: NEED_A NEED_B
97
+
98
+ Build the host with Sphinx's HTML builder. Open the output directly from disk
99
+ or serve it through static HTTP. On Windows, keep the output root short enough
100
+ that content-addressed detail paths stay below Firefox's local file-path limit.
101
+ The project's documentation includes a live ``demo.html`` using its own Needs.
102
+
103
+ Use in another Sphinx project
104
+ -----------------------------
105
+
106
+ See `Getting Started <docs/getting-started.rst>`_ for installation, the live
107
+ demonstration and the minimal integration steps for an existing Sphinx project.
108
+ The following sections provide additional host-model and compatibility details.
109
+
110
+ Host model configuration
111
+ ~~~~~~~~~~~~~~~~~~~~~~~~
112
+
113
+ The default mapping expects exactly the five Need types ``shr``, ``sysr``,
114
+ ``syse``, ``swr`` and ``swe`` used by this project's requirements model.
115
+ For other schemas, set ``traceability_view_model`` in the host's ``conf.py``.
116
+ For example, a host defining types ``goal``, ``requirement`` and ``component``
117
+ can use::
118
+
119
+ traceability_view_model = {
120
+ "levels": ["goals", "requirements", "components"],
121
+ "types": {
122
+ "goal": {"level": "goals", "role": "stakeholder"},
123
+ "requirement": {"level": "requirements"},
124
+ "component": {"level": "components"},
125
+ },
126
+ "accepted_statuses": ["accepted"],
127
+ }
128
+
129
+ Map every configured host Need type, using its directive name as the key.
130
+ Project-root mode requires a type with the ``stakeholder`` role. Test types
131
+ use ``{"role": "test"}`` without a level. Adapt ``accepted_statuses`` to the
132
+ host's status vocabulary. Relationships come from the host's ``needs_links``
133
+ configuration and require both incoming and outgoing labels. See
134
+ ``docs/internal-interfaces.rst`` for the full interface contract.
135
+
136
+ Current compatibility and delivery limits
137
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
138
+
139
+ .. stv-compatibility-start
140
+
141
+ The current package requires Python 3.10 or newer and pins Sphinx 8.1.3,
142
+ Sphinx-Needs 8.2.0 and Beautiful Soup 4.13.5. Check compatibility with the host's
143
+ documentation dependencies before installation. Only the ``html`` builder is
144
+ supported when a traceability view is present. Each view supports up to 200
145
+ visible graph nodes. On Windows, use a short HTML output path when opening
146
+ files directly in Firefox.
147
+
148
+ .. stv-compatibility-end
149
+
150
+ STV-owned code and documentation are licensed under MIT; see Licensing below.
151
+
152
+ User issue handover
153
+ -------------------
154
+
155
+ Report issues in ``docs/problem-tickets/`` and keep screenshots/logs beside the report.
156
+ The folder index and ``report.rst.template`` describe the format; informal text
157
+ is also accepted for normalization by the problem solver. Reports use stable
158
+ ``problem_report`` Need IDs and ``new``, ``analyzed``, ``fixed`` states. Fixed
159
+ reports remain in place, with evidence and any pending owner/release review.
160
+
161
+ Development verification
162
+ ------------------------
163
+
164
+ ``scripts/normalize-diagram-links.py`` is a relative symbolic link to the
165
+ shared ``-agents`` diagram utility. Keep that repository alongside this
166
+ checkout. Make utility changes explicitly in the shared repository rather
167
+ than editing through this link. The documentation and release workflow also
168
+ depend on the shared method, model and tools as described above.
169
+
170
+ Verify development changes::
171
+
172
+ .\.venv-implementation\Scripts\python.exe -m pytest -m "not browser"
173
+ node --test frontend/src/*/tests/*.test.js
174
+ .\.venv-implementation\Scripts\python.exe scripts/check-coverage.py --strict
175
+
176
+ For Firefox verification set ``STV_GECKODRIVER`` to an explicitly provisioned
177
+ driver and run ``pytest docs/test-scripts/test_browser.py`` in the implementation environment.
178
+ The packaging test needs a built wheel and an offline runtime wheelhouse at
179
+ ``docs/_build/wheelhouse``. Source tests, release results and deferred criteria
180
+ are linked from the central maturity page.
181
+
182
+ The documentation's ``test-cases/index`` specifies canonical cases and their
183
+ requirement links. Per-case execution records retain actual attempts, while
184
+ ``last_result`` shows each case's latest recorded outcome. Planned
185
+ occurrence-mode cases remain unexecuted. Review acceptance and recorded test
186
+ results are independent.
187
+
188
+ For full qualification, select the shared skill explicitly (the release
189
+ runner's legacy fallback predates the directory rename)::
190
+
191
+ $env:REQUIREMENTS_SKILL_DIR = '<shared-skill>'
192
+ .\.venv-implementation\Scripts\python.exe scripts/verify-release.py --record <new-record-name> --driver <provisioned-geckodriver>
193
+ .\.venv-implementation\Scripts\python.exe docs/test-execution/import-case-results.py <new-record-name>
194
+
195
+ Replace the placeholders with the shared ``reverse-engineer-requirements``
196
+ directory, a unique execution name and the provisioned driver path. Retain failed
197
+ attempts. Import results only after the runner has finished; then rebuild and
198
+ validate the published requirement/test/execution graph. Inspect the generated
199
+ cleanup proposal and approve exact paths before deleting disposable output.
200
+
201
+ Retain the entire ``dist/`` directory during cleanup, including wheels and
202
+ source archives for current and older versions. The owner removes older
203
+ versions manually after uploading them to GitHub. Copies retained as test
204
+ evidence do not replace the distribution files in ``dist/``.
205
+
206
+
207
+ Architecture-to-code navigation
208
+ -------------------------------
209
+
210
+ Each software element owns a directory named after the lowercase suffix of
211
+ its canonical ``STV_SWE_*`` ID. Python build components live under
212
+ ``src/sphinx_traceability_view/``; browser components live under ``frontend/src/``.
213
+ Each component contains its unit tests in ``tests/`` and a ``README.rst``
214
+ explaining its boundary. ``docs/elements-software.rst`` identifies each element
215
+ through its component and test naming conventions. Run all Python tests with ``python -m pytest``
216
+ and browser-component unit tests with ``node --test frontend/src/*/tests/*.test.js``.
217
+ Host integration, browser and release checks remain in ``docs/test-scripts/``.
218
+ Component tests are excluded from the installed wheel.
219
+
220
+
221
+ Licensing
222
+ ---------
223
+
224
+ Copyright (c) 2026 Henning Heikes. STV-owned code and documentation are licensed
225
+ under the MIT License. The standard terms are in the repository-root ``LICENSE``
226
+ file and in the package license files. Credit to Henning Heikes and STV is
227
+ appreciated; this is a request, not an additional license condition.
228
+
229
+ Bundled third-party code retains its own licenses: Floating UI uses MIT,
230
+ D3 components use ISC/BSD-3-Clause, and ELK.js uses EPL-2.0. The distribution's
231
+ combined SPDX expression reflects these bundled components; it does not change
232
+ the MIT license of STV-owned code. See ``THIRD_PARTY_NOTICES.txt`` and
233
+ ``vendor/ELK-SOURCE.txt`` in the packaged static assets. Generated views copy
234
+ these notices and ``LICENSE.txt`` alongside their browser assets.
235
+
236
+ The Sphinx documentation includes a Licensing page with the MIT text,
237
+ third-party notices and upstream source-availability information. This license
238
+ selection does not assert employer approval or resolve employment-related IP
239
+ ownership; those questions remain separate from the repository license.
240
+
241
+ Version maintenance
242
+ -------------------
243
+
244
+ The sole maintained STV version is ``src/sphinx_traceability_view/_version.py``.
245
+ Hatch reads it for distributions; Sphinx configuration, extension metadata and
246
+ the release runner derive their versions from it. The private frontend build
247
+ is unversioned. Replace the validator example's ``<major.minor>`` with the
248
+ documentation version. Historical release/review records and dependency versions
249
+ are immutable evidence, not values to update during a version bump.
250
+
251
+ Historical distributions
252
+ ------------------------
253
+
254
+ Retained historical archives require the license supplement in
255
+ ``docs/licensing/historical/`` (project MIT license, full third-party notices,
256
+ source references and archive hashes). Keep those materials with any copy.
257
+ Historical artifacts remain evidence; their original bytes are unchanged and
258
+ current documentation no longer offers them as binary downloads.
259
+
260
+ Source archive contents
261
+ ------------------------
262
+
263
+ The source distribution uses an explicit file allowlist in ``pyproject.toml``.
264
+ It contains the Python implementation, prepared browser assets, editable browser
265
+ sources, audited legal inputs, frontend lock/build files and Python build inputs.
266
+ A wheel can be rebuilt from this archive without Node. Engineering documentation,
267
+ execution history and local build/tool environments remain in the repository;
268
+ they are not source-package inputs. Archive selection ignores VCS negations so
269
+ retaining execution logs in Git cannot accidentally publish them in a package.
270
+
271
+ Automated validation and provenance
272
+ -----------------------------------
273
+
274
+ GitHub workflows validate package/fixture changes with read-only tokens and
275
+ immutable action pins. A separate manual main-branch workflow prepares
276
+ checksummed candidate bytes and, for a public repository, build provenance.
277
+ Neither workflow publishes a release. ``docs/ci-and-provenance.rst`` describes
278
+ the check scope, verification commands and unapplied branch-protection proposal.
279
+ Hosted runs and protection activation remain separate owner steps.
@@ -0,0 +1,23 @@
1
+ """Collect stable executable identities and put requirement IDs in JUnit output."""
2
+ import json
3
+ from pathlib import Path
4
+
5
+
6
+ def pytest_addoption(parser):
7
+ parser.addoption('--requirement-map', default=None, help='Write collected requirement/test metadata as JSON')
8
+
9
+
10
+ def pytest_collection_finish(session):
11
+ target=session.config.getoption('--requirement-map')
12
+ if target:
13
+ cases=[]
14
+ for item in session.items:
15
+ ids=sorted({identity for marker in item.iter_markers('requirements') for identity in marker.args})
16
+ cases.append({'test':item.nodeid,'requirements':ids})
17
+ path=Path(target);path.parent.mkdir(parents=True,exist_ok=True)
18
+ path.write_text(json.dumps(cases,indent=2),encoding='utf-8')
19
+
20
+
21
+ def pytest_runtest_setup(item):
22
+ ids=sorted({identity for marker in item.iter_markers('requirements') for identity in marker.args})
23
+ item.user_properties.append(('requirement_ids',','.join(ids)))
@@ -0,0 +1,42 @@
1
+ import {build} from 'esbuild';
2
+ import {readFile,writeFile,mkdir,readdir} from 'node:fs/promises';
3
+ import path from 'node:path';
4
+ import {createHash} from 'node:crypto';
5
+ const output='../src/sphinx_traceability_view/static';
6
+ await mkdir(output,{recursive:true});
7
+ const audit=JSON.parse(await readFile('legal/elk-inventory.json','utf8'));
8
+ const elkBytes=await readFile('node_modules/elkjs/lib/elk.bundled.js');
9
+ const elkMeta=JSON.parse(await readFile('node_modules/elkjs/package.json','utf8'));
10
+ if(elkMeta.version!==audit.elkjs.version || createHash('sha256').update(elkBytes).digest('hex')!==audit.elkjs.sha256) throw Error('ELK dependency changed: renew the compiled-dependency audit before building');
11
+ for(const name of audit.notice_files) {
12
+ const data=await readFile(`legal/${name}`);
13
+ if(createHash('sha256').update(data).digest('hex')!==audit.notice_sha256[name]) throw Error(`Audited legal input changed: ${name}`);
14
+ }
15
+ const built=await build({metafile:true,entryPoints:['src/render/index.js'],bundle:true,format:'iife',platform:'browser',target:['firefox115'],outfile:`${output}/stv.js`,legalComments:'eof',minify:true});
16
+ await writeFile(`${output}/stv.css`,await readFile('src/render/stv.css'));
17
+ const notices=[];
18
+ // Derive npm attributions from the actual bundle inputs; do not maintain a
19
+ // second dependency allowlist that silently omits newly bundled packages.
20
+ const bundled=new Set(Object.keys(built.metafile.inputs).filter(p=>p.startsWith('node_modules/')).map(p=>{
21
+ const parts=p.split('/').slice(1);return parts[0].startsWith('@')?parts.slice(0,2).join('/'):parts[0];
22
+ }));
23
+ // esbuild also supplies generated runtime scaffolding.
24
+ bundled.add('esbuild');
25
+ for(const name of [...bundled].sort()) {
26
+ const base=`node_modules/${name}`;
27
+ const metadata=JSON.parse(await readFile(`${base}/package.json`,'utf8'));
28
+ notices.push(`${metadata.name} ${metadata.version} (${metadata.license})`);
29
+ const files=(await readdir(base)).filter(n=>/^(license|notice|copying)/i.test(n));
30
+ if(!files.length) throw Error(`No legal notice found for bundled dependency ${name}`);
31
+ for(const name of files) notices.push(await readFile(path.join(base,name),'utf8'));
32
+ }
33
+ notices.push('ELK compiled dependency inventory\n'+JSON.stringify(audit,null,2));
34
+ for(const name of audit.notice_files) notices.push(name+'\n'+await readFile(`legal/${name}`,'utf8'));
35
+ await writeFile(`${output}/THIRD_PARTY_NOTICES.txt`,notices.join('\n\n'));
36
+ await mkdir(`${output}/vendor`,{recursive:true});
37
+ await writeFile(`${output}/vendor/elk.bundled.js`,elkBytes);
38
+ await writeFile(`${output}/vendor/ELK-INVENTORY.json`,JSON.stringify(audit,null,2)+'\n');
39
+ // Legal inputs are maintained with the project, not regenerated as a source claim.
40
+ await writeFile(`${output}/LICENSE.txt`,await readFile('../LICENSE'));
41
+ const sourceNotice=await readFile(`${output}/vendor/ELK-SOURCE.txt`,'utf8');
42
+ await writeFile(`${output}/THIRD_PARTY_NOTICES.txt`,notices.join('\n\n')+'\n\n'+sourceNotice);
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.