scientific-computing-system 2.2.0 → 2.2.1

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 (4) hide show
  1. package/CHANGELOG.md +187 -106
  2. package/README.md +86 -28
  3. package/SECURITY.md +32 -6
  4. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -7,69 +7,107 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
- ### Re-enabled: npm publishing
11
-
12
- This reverses two earlier decisions. Both were deliberate at the time and are
13
- recorded here so the history is not silently erased.
14
-
15
- - **Reverted: the decision in `52717c5` ("docs: make this the front door and stop
16
- npm publishing") to disable npm publishing.** That commit replaced the real
17
- publish step with
18
- `run: echo "npm publishing is disabled; PyPI is the install path" && exit 0`.
19
- npm publishing is now real again, by explicit user decision to publish all six
20
- repositories to npm.
21
- - **Reverted: `"private": true` in `package.json`**, added by the hardening work in
22
- `#140` while publishing was disabled. `private: true` makes `npm publish`
23
- refuse to run at all, so the flag had to go before the workflow could work. The
24
- `files` allowlist is retained: it is what keeps the repository (tests, CI
25
- workflows, 10k+ statements of Python, promo media) out of the published tarball.
26
-
27
- Authentication is **OIDC trusted publishing** (`id-token: write`,
28
- `npm publish --provenance`). No long-lived registry token is used on the primary
29
- path. A token fallback exists for bootstrapping only: dispatching with
30
- `use_token_fallback=true` sets `NODE_AUTH_TOKEN` from the `NPM_TOKEN` secret. It
31
- is off by default and never runs automatically, so a broken OIDC configuration
32
- fails loudly instead of silently reverting to the long-lived credential.
33
-
34
- npm 2.2.0 is a **new version for npm**: the registry currently holds only 1.0.0,
35
- which shipped an unparseable launcher. The PyPI release of 2.2.0 already
36
- happened, so npm 2.2.0 is published by manual dispatch of `npm-publish.yml`
37
- rather than by the tag push that future releases will use.
10
+ ## [v2.2.1] - 2026-10-04
38
11
 
39
- ### Fixed
12
+ Documentation and release-surface corrections. **No library behaviour change**:
13
+ nothing under `src/cds/` was modified except the `__version__` constant, so no
14
+ numerical kernel, public API signature or CLI subcommand differs from 2.2.0.
40
15
 
41
- - **The publish path is now guarded rather than merely enabled.**
42
- `tests/test_codemeta_version_lockstep.py`-style machine checks were extended to
43
- npm: the launcher contract test previously asserted that publishing stayed
44
- disabled, which would have silently passed against a disabled workflow. It now
45
- asserts a real `npm publish --provenance` invocation, `id-token: write`, the
46
- absence of `private: true`, the absence of the disabled stub, and the presence
47
- of every gate that makes a publish safe: the registry version-existence check,
48
- the `npm pack --dry-run` tarball allowlist, and the npm/Python version lockstep.
49
- - **The package description states the Python prerequisite.** This npm package
50
- is a launcher shim: it ships no Python and execs `python -m cds`. A user who
51
- installs it without `pip install scientific-computing-system` gets a launcher
52
- that cannot work, so the description (the only text npm renders on the package
53
- page) now says so, and a test asserts it.
54
-
55
- ### Known gap
56
-
57
- - `README.md` line 41 still states "npm is no longer published". That file is
58
- owned elsewhere and is shipped verbatim in the npm tarball, so the published
59
- package page and the README will contradict each other until its owner
60
- updates it.
61
- - npm reports `"bin[scs]" script name bin/scs.js was invalid and removed` during
62
- publish. **This is harmless, and the earlier note here claiming otherwise was
63
- wrong.** npm normalises the redundant `./` prefix and ships the bin entry
64
- regardless. Verified: this repo's packed tarball contains
65
- `bin: { scs: "./bin/scs.js" }` together with `bin/scs.js`; installing that
66
- tarball into a scratch prefix created `scs`, `scs.cmd` and `scs.ps1`, and
67
- `scs --version` exited 0. `axiomize@1.12.4`, published from the identical
68
- shape, ships the same and is not deprecated. No change to `bin` is required;
69
- the shape is now pinned by tests so it cannot regress silently.
16
+ The reason this patch release exists: `README.md` is the `long_description`, and
17
+ PyPI only re-reads it when a new release is uploaded. 2.2.0 shipped the README as
18
+ it stood before the truthfulness work below, so the PyPI project page for 2.2.0
19
+ still advertises claims the repository has since retracted. Publishing 2.2.1 is
20
+ what makes the corrected README the one PyPI renders.
70
21
 
71
22
  ### Fixed
72
23
 
24
+ - **README performance claim corrected to the committed artifact.** The "catch"
25
+ paragraph asserted "~0.05 s versus ~0.0001 s ... roughly 580x slower" and
26
+ described it as "this machine's benchmark run", while pointing readers at
27
+ `docs/benchmarks.md` for "the hardware they came from". `benchmarks/results.json`
28
+ actually records 0.0696 s versus 0.000060 s (**1154.8x**) at commit `7213425`,
29
+ and that same file records Platform / CPU / Python / NumPy as "not recorded"
30
+ with an explicit "treat the absolute timings as unverified" warning. The line
31
+ added by the earlier truthfulness commit therefore contradicted the warnings it
32
+ shipped alongside. Both the README and `docs/why-pure-python.md` now quote the
33
+ artifact's own numbers and state that the environment was not recorded.
34
+
35
+ - **npm launcher prerequisite stated correctly.** README and `SECURITY.md` said
36
+ the `scs` shim works once `cds` is "on your PATH". `index.js` resolves an
37
+ interpreter (`python`/`python3`/`py`) and runs `python -m cds`; it never looks
38
+ for a console script on `PATH`. Corrected to "requires the Python distribution
39
+ installed so that `python -m cds` resolves".
40
+
41
+ - **Stale version references left behind by the 2.2.1 bump.** The README's pasted
42
+ `cds --version` transcript still read `System version 2.2.0` after the version
43
+ moved, and `SECURITY.md` still recommended pinning `==2.2.0`. Since the README
44
+ is the `long_description`, that line would have shipped verbatim to the PyPI
45
+ project page. Both were re-derived from live commands at 2.2.1.
46
+
47
+ Every other pasted transcript was re-checked against the installed 2.2.1 wheel
48
+ and found current: the quickstart output (SVD singular values, damped-oscillator
49
+ final state, regression fit), `cds modules` printing 26 rows and omitting exactly
50
+ the nine documented modules, the structural claims (34 subpackages, 35 public
51
+ feature modules, 505 names / 342 functions / 163 classes), the benchmark ratio
52
+ against `benchmarks/results.json`, and all five documented extras.
53
+
54
+ Two further `SECURITY.md` claims were false and are corrected: `scs` was
55
+ documented as needing a `cds` console script on `PATH` when the launcher
56
+ resolves an interpreter and runs `python -m cds` (verified: the shim prints
57
+ `System version 2.2.1` with no `cds` on `PATH`), and the PyPI attestation cell
58
+ claimed a PEP 740 bundle for the published 2.2.0 when PyPI serves none.
59
+
60
+ The pin example is now version-agnostic by construction, so it cannot rot at
61
+ the next bump.
62
+
63
+ - **Module-surface claims are now accurate.** "34 subpackages" silently omitted
64
+ the two top-level public modules (`causal.py`, `sensitivity.py`), and
65
+ "`cds modules` for the live list" was wrong twice over: that command prints a
66
+ curated 26-entry subset and omits `bayes`, `causal`, `core`, `fractals`,
67
+ `genetics`, `infotheory`, `interpolate`, `pde`, and `wavelets`. README,
68
+ `docs/api.md` and `docs/index.md` now state the real counts and flag
69
+ `cds modules` as a subset. The unsupported "46 public functions / 534 exports"
70
+ hero claim does not exist in the repository or in any reachable commit; the
71
+ README instead carries counts derived from the package itself (505 exports:
72
+ 342 functions, 163 classes across 35 feature modules).
73
+
74
+ - **Documentation no longer claims npm is unpublished.** npm 2.2.0 is live and
75
+ npm is a supported channel, but `README.md` line 41 still said "npm is no
76
+ longer published". Because `README.md` is listed in the npm `files` allowlist,
77
+ that sentence shipped **verbatim inside the published 2.2.0 tarball**, so the
78
+ npm package page contradicted its own README. `README.md`, `SECURITY.md` and
79
+ `docs/related.md` now describe both channels accurately; the npm version badge
80
+ is restored now that the registry and PyPI agree.
81
+
82
+ - **A successful publish is no longer reported as a failure while npm is still
83
+ propagating it.** `npm publish` returns as soon as the registry accepts the
84
+ upload, but the version becomes readable on the read path asynchronously. The
85
+ post-publish check read once, immediately, and on run `37136131220` got
86
+ `npm error 404 No match found for version 2.2.0` — while 2.2.0 was in fact
87
+ published and recorded by the registry ninety seconds later. A maintainer
88
+ reading that run had every reason to believe the release had broken. Three
89
+ sibling repositories hit the same false failure.
90
+
91
+ The check now polls the registry with backoff over a budget of several minutes,
92
+ succeeds on the first match, and still fails closed if the version genuinely
93
+ never appears, emitting a `::warning::` first so a slow-but-successful publish
94
+ is never read as a hard failure.
95
+
96
+ It queries the registry's JSON API instead of `npm view`, which was a poor fit:
97
+ it reports "absent" and "denied" with the same `E404`, and it resolves against
98
+ the userconfig the job created for *writing*, so a read-only confirmation had no
99
+ reason to touch publish credentials at all. Both directions are exercised
100
+ against a stub registry, and the retry budget itself is asserted, since
101
+ shortening it to make a test fast is what caused the bug.
102
+
103
+ - **The publish path is now guarded rather than merely enabled.** The launcher
104
+ contract test previously asserted that publishing stayed disabled, which would
105
+ have silently passed against a disabled workflow. It now asserts a real
106
+ `npm publish --provenance` invocation, `id-token: write`, the absence of
107
+ `private: true`, the absence of the disabled stub, and the presence of every
108
+ gate that makes a publish safe: the registry version-existence check, the
109
+ `npm pack --dry-run` tarball allowlist, and the npm/Python version lockstep.
110
+
73
111
  - **The npm toolchain version floor rejected a compliant toolchain.** The first
74
112
  real publish run failed on this gate:
75
113
 
@@ -84,63 +122,81 @@ rather than by the tag push that future releases will use.
84
122
  dotted version without enumerating every minor, which is exactly the mistake
85
123
  that shipped. The gate now parses the version, strips any leading `v` and
86
124
  prerelease suffix, and compares major/minor/patch as integers against 11.5.1.
87
- - **The Node half of the same gate ignored the patch component.** It compared
88
- only major and minor, so `22.9.0` was accepted even though the documented
89
- floor is 22.14.0. Both halves now use the same integer comparison.
90
-
91
- ### Fixed
92
-
93
- - **The `bin` map is now pinned by tests, so a broken launcher command cannot
94
- ship silently.** The `npm warn publish "bin[scs]" script name bin/scs.js was
95
- invalid and removed` message had been reported as a defect that would leave
96
- the published package with no working `scs` command. **That report was wrong.**
97
- npm normalises the redundant `./` prefix and ships the entry either way; the
98
- packed tarball keeps `bin: { scs: "./bin/scs.js" }` alongside `bin/scs.js`, and
99
- installing it creates `scs`, `scs.cmd` and `scs.ps1` and `scs --version`
100
- succeeds. `axiomize@1.12.4`, published from the identical shape, ships the
101
- same and is not deprecated. No `package.json` change is required.
102
-
103
- What *is* a real hazard is the opposite: npm ships a `bin` pointing at a
104
- missing file, or one excluded by `files`, with **no warning at all** --
105
- confirmed by packing and installing such a package into a scratch prefix,
106
- where no command was created and nothing was printed. Five tests now assert
107
- the bin map is a valid command-name to path mapping, that every target exists
108
- and is covered by `files`, that the shim carries a `node` shebang, and that
109
- the real tarball (`npm pack --dry-run --json`) still contains both the shim
110
- and the bin entry. One further test documents that the `./` prefix is
111
- intentional so the cosmetic warning is not "fixed" by a future maintainer.
125
+ The Node half of the same gate ignored the patch component: it compared only
126
+ major and minor, so `22.9.0` was accepted even though the documented floor is
127
+ 22.14.0. Both halves now use the same integer comparison.
112
128
 
113
129
  - **Token-mode npm publish failed with `ENEEDAUTH` while holding a valid
114
130
  secret.** The run reached `npm publish` with `NODE_AUTH_TOKEN` populated and
115
131
  still got:
132
+
116
133
  ```
117
134
  npm error code ENEEDAUTH
118
135
  npm error need auth This command requires you to be logged in to
119
136
  https://registry.npmjs.org/
120
137
  ```
138
+
121
139
  Root cause: `actions/setup-node` was configured without `registry-url`, so it
122
- wrote no npm userconfig at all. `NODE_AUTH_TOKEN` on its own is inert -- npm
123
- only substitutes it into a credential when some userconfig maps
140
+ wrote no npm userconfig at all. `NODE_AUTH_TOKEN` on its own is inert — npm only
141
+ substitutes it into a credential when some userconfig maps
124
142
  `//registry.npmjs.org/` to `${NODE_AUTH_TOKEN}`. With no such entry npm never
125
143
  attempts authentication, which is why the failure was `ENEEDAUTH` (no
126
144
  authentication attempted) rather than `E401` (attempted and rejected) even
127
- though the secret was present and correct. The fix is `registry-url:
128
- "https://registry.npmjs.org"` on `setup-node`, which is what the working
129
- `axiomize` publish workflow sets.
130
-
131
- Verified locally against a deliberately fake token: with `NODE_AUTH_TOKEN`
132
- exported but no registry auth entry, npm stops at `ENEEDAUTH`; with the
133
- `//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}` entry present, npm
134
- reaches the registry and fails `E401` instead -- i.e. it now actually
135
- authenticates.
136
- - **The credential check could print an error and continue into npm.** It lived
137
- inline inside the publish step, so its failure text appeared in the log while
138
- `npm publish` was invoked anyway. The check is now its own step ahead of both
139
- publish steps, so a non-zero exit ends the job before npm can run, and it
140
- covers the OIDC mode too (verifying the runner actually granted
141
- `id-token: write`, which the previous version never checked).
145
+ though the secret was present and correct. The fix is
146
+ `registry-url: "https://registry.npmjs.org"` on `setup-node`.
142
147
 
143
- ### Changed
148
+ Separately, the credential check lived inline inside the publish step, so its
149
+ failure text appeared in the log while `npm publish` was invoked anyway. It is
150
+ now its own step ahead of both publish steps, so a non-zero exit ends the job
151
+ before npm can run, and it covers the OIDC mode too (verifying the runner
152
+ actually granted `id-token: write`, which the previous version never checked).
153
+
154
+ - **The `bin` map is now pinned by tests, so a broken launcher command cannot
155
+ ship silently.** The `npm warn publish "bin[scs]" script name bin/scs.js was
156
+ invalid and removed` message had been reported as a defect that would leave
157
+ the published package with no working `scs` command. **That report was wrong.**
158
+ npm normalises the redundant `./` prefix and ships the entry either way; the
159
+ packed tarball keeps `bin: { scs: "./bin/scs.js" }` alongside `bin/scs.js`, and
160
+ installing it creates `scs`, `scs.cmd` and `scs.ps1` and `scs --version`
161
+ succeeds. `axiomize@1.12.4`, published from the identical shape, ships the same
162
+ and is not deprecated. No `package.json` change is required.
163
+
164
+ What *is* a real hazard is the opposite: npm ships a `bin` pointing at a
165
+ missing file, or one excluded by `files`, with **no warning at all**. Five
166
+ tests now assert the bin map is a valid command-name to path mapping, that
167
+ every target exists and is covered by `files`, that the shim carries a `node`
168
+ shebang, and that the real tarball (`npm pack --dry-run --json`) still contains
169
+ both the shim and the bin entry. One further test documents that the `./`
170
+ prefix is intentional so the cosmetic warning is not "fixed" by a future
171
+ maintainer.
172
+
173
+ ### Added
174
+
175
+ - **`tests/test_readme_surface.py`** derives the README's structural claims from
176
+ `src/cds/` and from the installed package: subpackage count, presence of both
177
+ top-level public modules, the export total, per-module table coverage, the
178
+ benchmark ratio against `benchmarks/results.json`, and a guard against
179
+ describing `cds modules` as exhaustive. This drift was previously invisible to
180
+ CI, which is how it survived several releases. Verified by mutation: five
181
+ separate re-introductions of the audited defects each turn the suite red.
182
+
183
+ - **`codemeta.json` is now a locked version surface.** It was left out of the
184
+ original five surfaces and drifted: it still declared `2.1.0` after the package
185
+ reached 2.2.0, while every other surface had moved. CodeMeta is a
186
+ machine-readable publication record, so a stale `version` there advertises the
187
+ previous release to every automated consumer while the installed package
188
+ reports a different one. `scripts/check_version_lockstep.py` now reads it and
189
+ `tests/test_codemeta_version_lockstep.py` fails CI on drift. It is also added
190
+ to the sdist allowlist, without which that suite failed with `FileNotFoundError`
191
+ when run from an unpacked sdist.
192
+
193
+ - README coverage: `cds.core` and `cds.graph` rows, `examples/` (35 runnable
194
+ files) and `dashboard/app.py` entries, all 13 CLI subcommands, the `[pandas]`
195
+ extra, `paper.md`/`paper.bib` (JOSS) and `codemeta.json`, and a Contributing
196
+ section with the `pip install -e ".[dev]"` / `pytest` / `mkdocs serve` loop and
197
+ the 100% blended-coverage gate. Duplicated prose was removed (the supply-chain
198
+ section now defers to `SECURITY.md` instead of restating it, and the generic
199
+ "Common use cases" filler is gone).
144
200
 
145
201
  - **Two supported npm publish modes**, selected by the `use_token_fallback`
146
202
  dispatch input (boolean, default `false`):
@@ -154,12 +210,37 @@ rather than by the tag push that future releases will use.
154
210
  Sigstore attestation: a token cannot mint one, and npm rejects the
155
211
  combination. The token mode prints a NOTICE that the release carries no
156
212
  provenance rather than passing a flag that cannot work or implying an
157
- attestation exists.
213
+ attestation exists. Both modes are fail-closed: a requested mode with no usable
214
+ credential exits non-zero with an actionable message, and token mode never runs
215
+ automatically, so a broken OIDC configuration cannot silently downgrade to the
216
+ long-lived credential.
217
+
218
+ ### Changed
158
219
 
159
- Both modes are fail-closed. A requested mode with no usable credential exits
160
- non-zero with an actionable message, and token mode never runs automatically,
161
- so a broken OIDC configuration cannot silently downgrade to the long-lived
162
- credential.
220
+ - **npm publishing is real again.** This reverses two earlier decisions, both
221
+ deliberate at the time and recorded here so the history is not silently erased:
222
+ the decision in `52717c5` to disable npm publishing (which replaced the publish
223
+ step with `run: echo "npm publishing is disabled; PyPI is the install path" &&
224
+ exit 0`), and `"private": true` in `package.json`, added by `#140` while
225
+ publishing was disabled. `private: true` makes `npm publish` refuse to run at
226
+ all, so the flag had to go before the workflow could work. The `files` allowlist
227
+ is retained: it is what keeps the repository (tests, CI workflows, 10k+
228
+ statements of Python, promo media) out of the published tarball. The npm
229
+ channel is on OIDC trusted publishing (`id-token: write`,
230
+ `npm publish --provenance`); no long-lived registry token is used on the
231
+ primary path.
232
+
233
+ - README shortened with **higher** coverage: the supply-chain section dropped from
234
+ 209 lines to a 3-line summary plus a link, and "The catch" reduced to a short
235
+ paragraph.
236
+
237
+ - **This release carries a PyPI attestation; 2.2.0 does not.** PyPI's JSON API
238
+ reports zero PEP 740 attestation bundles for 2.2.0, which went out in token
239
+ mode — a token cannot mint a Sigstore attestation. 2.2.1 is published by
240
+ `release.yml` through `pypa/gh-action-pypi-publish` with Trusted Publishing
241
+ (OIDC), so it will carry one, as long as the `pypi` environment's trusted
242
+ publisher is configured — a misconfiguration fails the publish loudly rather
243
+ than degrading silently.
163
244
 
164
245
  ## [v2.2.0]
165
246
 
package/README.md CHANGED
@@ -8,6 +8,7 @@
8
8
 
9
9
  <p align="center">
10
10
  <a href="https://pypi.org/project/scientific-computing-system/"><img src="https://img.shields.io/pypi/v/scientific-computing-system.svg" alt="PyPI version"></a>
11
+ <a href="https://www.npmjs.com/package/scientific-computing-system"><img src="https://img.shields.io/npm/v/scientific-computing-system.svg" alt="npm version"></a>
11
12
  <a href="https://www.python.org/downloads/"><img src="https://img.shields.io/badge/python-3.10+-green.svg" alt="Python 3.10+"></a>
12
13
  <a href="https://codecov.io/gh/Furox-Art/scientific-computing-system"><img src="https://codecov.io/gh/Furox-Art/scientific-computing-system/branch/main/graph/badge.svg" alt="codecov"></a>
13
14
  <a href="https://github.com/Furox-Art/scientific-computing-system/actions/workflows/tests.yml"><img src="https://github.com/Furox-Art/scientific-computing-system/actions/workflows/tests.yml/badge.svg" alt="CI"></a>
@@ -28,41 +29,58 @@
28
29
  <a href="https://github.com/Furox-Art/scientific-computing-system/blob/main/SECURITY.md">Security</a> ·
29
30
  <a href="https://github.com/Furox-Art/scientific-computing-system/blob/main/CODE_OF_CONDUCT.md">Code of Conduct</a> ·
30
31
  <a href="https://github.com/Furox-Art/scientific-computing-system/blob/main/CITATION.cff">Citation</a> ·
32
+ <a href="https://github.com/Furox-Art/scientific-computing-system/blob/main/paper.md">Paper (JOSS)</a> ·
31
33
  <a href="https://github.com/Furox-Art/scientific-computing-system/discussions">Discussions</a> ·
32
34
  <a href="https://github.com/Furox-Art/scientific-computing-system/issues">Issues</a>
33
35
  </p>
34
36
 
35
- Download counts: [PyPI stats](https://pypi.org/project/scientific-computing-system/)
36
-
37
37
  I wrote this because NumPy and SciPy are incredible, but they're also 20 years old and carry two decades of design decisions that don't always make sense anymore.
38
38
 
39
+ Download counts: [PyPI stats](https://pypi.org/project/scientific-computing-system/)
40
+
39
41
  This is a from-scratch rethinking of what scientific computing in Python could look like if we started today. No C extensions, no Fortran legacy, no dependency hell. Just Python, type hints, and algorithms that are actually readable.
40
42
 
41
- This repository is the front door. The NumPy build is [scientific-computing-system-2.0](https://github.com/Furox-Art/scientific-computing-system-2.0), not a second project. Beside it: [axiomize](https://github.com/Furox-Art/axiomize) for units and Model IR, [quantum-reasoning-skill](https://github.com/Furox-Art/quantum-reasoning-skill) for the reasoning skill, and [plan-auditor](https://github.com/Furox-Art/plan-auditor) for a fail-closed agent check. Install this package from PyPI. npm is no longer published.
43
+ The import name is **`cds`** (the distribution is `scientific-computing-system`). The zero-dependency core needs nothing but the standard library. The sibling NumPy build of this work is [`scientific-computing-system-2.0`](https://github.com/Furox-Art/scientific-computing-system-2.0); related projects are listed in [docs/related.md](docs/related.md).
42
44
 
43
- The import name is **`cds`** (the distribution is `scientific-computing-system`). The zero-dependency core needs nothing but the standard library.
45
+ ## Install
46
+
47
+ | Channel | Command | What you get |
48
+ |---|---|---|
49
+ | **PyPI** (the library) | `pip install scientific-computing-system` | The actual Python package. Zero runtime dependencies. This is what you want. |
50
+ | **npm** (a launcher shim) | `npm i -g scientific-computing-system` | A thin Node wrapper that runs `python -m cds`. It ships no Python and needs the Python distribution installed so that `python -m cds` resolves. |
51
+
52
+ Both channels are published at the same version. They are **not** equally
53
+ verifiable: the PyPI release carries a PEP 740 provenance attestation, while the
54
+ currently published npm release does not. Prefer PyPI for anything
55
+ security-sensitive — [SECURITY.md](SECURITY.md#distribution-channels-and-provenance)
56
+ has the per-channel comparison.
44
57
 
45
58
  ## What's inside
46
59
 
47
- 34 subpackages under `src/cds/`. Run `cds modules` for the live list.
60
+ `src/cds/` holds **34 subpackages plus `causal.py` and `sensitivity.py`**. That is
61
+ 35 public feature modules — the `cds` CLI entry point is the 36th subpackage —
62
+ exporting **505 names** (342 functions, 163 classes), all pure standard library.
63
+ `tests/test_readme_surface.py` derives these numbers from the package, so they
64
+ cannot drift silently.
48
65
 
49
66
  | Area | Modules | What you get |
50
67
  |---|---|---|
68
+ | Core models | `cds.core` | Shared `Domain`, `Hypothesis`, `HypothesisStatus` types |
51
69
  | Linear algebra & calculus | `cds.math_utils`, `cds.interpolate` | SVD, QR, Cholesky, LU, power iteration, derivatives, integrals |
52
70
  | ODE / PDE | `cds.diffeq`, `cds.pde` | Euler, RK4, adaptive RK45, implicit stiff methods, symplectic integrators; 1-D heat & wave equations |
53
71
  | Quadrature | `cds.numerical_integration` | Trapezoid, Simpson 1/3 & 3/8, Romberg, Gauss-Legendre, adaptive Simpson, 2-D tensor rules |
54
- | Optimization | `cds.optimization` | Gradient descent, Newton, Adam, Nelder-Mead, simulated annealing, constrained search |
55
- | Statistics | `cds.stats`, `cds.probability` | Descriptive stats, regression, t/chi-square/ANOVA, effect sizes, nonparametric ranks, time series (ACF/PACF, KPSS, Ljung-Box, decomposition), multiple testing |
56
- | Bayesian | `cds.bayes` | Conjugate updates, credible intervals, Bayes factors |
72
+ | Optimization | `cds.optimization` | Gradient descent, Newton, Adam, Nelder-Mead, annealing, constrained search |
73
+ | Statistics | `cds.stats`, `cds.probability`, `cds.bayes` | Descriptive stats, regression, t/chi-square/ANOVA, effect sizes, nonparametric ranks, time series, multiple testing, Bayesian conjugate updates |
57
74
  | Monte Carlo | `cds.montecarlo` | π estimation, Monte-Carlo integration, random walks |
58
- | Machine learning | `cds.ml` | MLP, k-NN, k-means, CART trees, random forest, boosting, PCA, scalers (educational, not production) |
75
+ | Machine learning | `cds.ml` | MLP, k-NN, k-means, CART, random forest, boosting, PCA (educational, not production) |
59
76
  | Signal processing | `cds.signals`, `cds.wavelets` | DFT/FFT/IFFT, convolution, Butterworth design, STFT, Haar DWT |
60
77
  | Quantum | `cds.quantum` | Single & multi-qubit state-vector circuits, Bell/GHZ states, entanglement |
61
- | Scientific domains | `cds.scientific`, `cds.genetics`, `cds.fractals`, `cds.infotheory` | Physical constants & formulas, DNA analysis, fractals, entropy/divergence |
78
+ | Graphs | `cds.graph` | BFS, DFS, Dijkstra shortest paths, Kruskal MST, topological sort, cycle detection |
79
+ | Scientific domains | `cds.scientific`, `cds.genetics`, `cds.fractals`, `cds.infotheory` | Physical constants & formulas, DNA analysis & alignment, fractal sets, entropy/divergence/mutual information |
62
80
  | Symbolic modeling | `cds.modeling` | Expression trees, symbolic differentiation, LaTeX export, `MathModel` systems, root finding, fitting |
63
81
  | Uncertainty & sensitivity | `cds.uncertainty`, `cds.sensitivity` | Analytic + correlated Monte-Carlo propagation, local & variance-based global sensitivity, identifiability |
64
82
  | Validation & causality | `cds.validation`, `cds.causal` | Cross-method checks, drift/OOD reports, assumption-gated causal estimators |
65
- | Units & dimensional analysis | `cds.units` | SI quantities, conversions, dimension compatibility checks |
83
+ | Units | `cds.units` | SI quantities, conversions, dimensional compatibility checks |
66
84
  | Workflow & provenance | `cds.workflow`, `cds.provenance` | Approval-gated orchestration, run manifests, hashes, checkpoints |
67
85
  | Data | `cds.data_analysis`, `cds.data_io` | CSV/tabular analysis, streaming I/O, optional HDF5/NetCDF |
68
86
  | Knowledge & hypothesis | `cds.knowledge`, `cds.hypothesis` | Concept graphs, research notes, structured hypothesis generation & evaluation |
@@ -70,6 +88,22 @@ The import name is **`cds`** (the distribution is `scientific-computing-system`)
70
88
  | Plotting | `cds.plot` | Optional matplotlib helpers (`[plot]` extra) |
71
89
  | Backend adapters | `cds.tools` | Lazy discovery for NumPy/SciPy/statsmodels/scikit-learn/SymPy/Z3 |
72
90
 
91
+ The authoritative per-module list is the [API reference](https://furox-art.github.io/scientific-computing-system/api/).
92
+
93
+ !!! note "`cds modules` is a curated subset"
94
+ `cds modules` prints 26 entries. It is **not** the full catalog: it omits
95
+ `bayes`, `causal`, `core`, `fractals`, `genetics`, `infotheory`, `interpolate`,
96
+ `pde`, and `wavelets`. Use the [API reference](https://furox-art.github.io/scientific-computing-system/api/)
97
+ or `src/cds/` for the complete set.
98
+
99
+ ### Runnable examples and the dashboard
100
+
101
+ - **[`examples/`](examples/)** — 35 runnable scripts and notebooks (33 `.py`, 2
102
+ `.ipynb`), each self-contained and dependency-free unless noted. Every tutorial
103
+ page in the docs has a matching example.
104
+ - **[`dashboard/app.py`](dashboard/app.py)** — a Streamlit dashboard:
105
+ `cds dashboard`, or `pip install "scientific-computing-system[dashboard]"`.
106
+
73
107
  ## Quick Start
74
108
 
75
109
  ```bash
@@ -107,17 +141,32 @@ final t = 50.0 | final y = [0.07638443, 0.0264785]
107
141
  slope = 1.9900 | intercept = 0.0500 | r^2 = 0.9973
108
142
  ```
109
143
 
110
- A CLI ships with the package:
144
+ ## CLI
145
+
146
+ The package installs a `cds` command with 13 subcommands:
147
+
148
+ | Command | Purpose |
149
+ |---|---|
150
+ | `cds --help` | Full command list |
151
+ | `cds modules` | Curated module catalog (see the caveat above) |
152
+ | `cds info` | Version, module status, health summary |
153
+ | `cds constants` | Table of physical constants |
154
+ | `cds calc <formula>` | Quick physics calculation (`ke`, `gravity`, `wave`, `gas`) |
155
+ | `cds stats <numbers>` | Descriptive statistics for a comma-separated list |
156
+ | `cds sample <dist>` | Draw samples from a probability distribution |
157
+ | `cds integrate <fn>` | Integrate a built-in function over `[a, b]` |
158
+ | `cds hypothesis <q>` | Generate scientific hypotheses for a question |
159
+ | `cds prompt` | Prompt text for a custom hypothesis generator |
160
+ | `cds benchmark` | Run the built-in benchmarks |
161
+ | `cds plot <numbers>` | ASCII plot, or PNG with `--file` when `[plot]` is installed |
162
+ | `cds dashboard` | Launch the Streamlit dashboard (needs `[dashboard]`) |
111
163
 
112
164
  ```console
113
165
  $ cds --version
114
- System version 2.2.0
115
- $ cds modules # live module catalog
166
+ System version 2.2.1
116
167
  $ cds constants # physical constants table
117
168
  ```
118
169
 
119
- Full docs: [furox-art.github.io/scientific-computing-system](https://furox-art.github.io/scientific-computing-system/).
120
-
121
170
  ## Optional extras
122
171
 
123
172
  The core is zero-dependency. Everything below is opt-in:
@@ -126,27 +175,36 @@ The core is zero-dependency. Everything below is opt-in:
126
175
  pip install "scientific-computing-system[scientific]" # NumPy, SciPy, statsmodels, scikit-learn, SymPy, Z3
127
176
  pip install "scientific-computing-system[io]" # HDF5 + NetCDF
128
177
  pip install "scientific-computing-system[plot]" # matplotlib
178
+ pip install "scientific-computing-system[pandas]" # DataFrame bridge: cds.data_analysis.pandas_io
129
179
  pip install "scientific-computing-system[dashboard]" # Streamlit dashboard
130
180
  ```
131
181
 
132
- ## Common use cases
133
-
134
- - Learn and inspect **numerical methods in pure Python** without compiled extensions.
135
- - Prototype **scientific computing** workflows with transparent implementations.
136
- - Explore **ODE/PDE solvers**, numerical integration, optimization, Monte Carlo, signal processing, and linear algebra.
137
- - Run **statistics, uncertainty quantification, sensitivity analysis, dimensional analysis, and reproducible research** workflows.
138
- - Teach or audit algorithms where readable source code matters more than raw NumPy/SciPy performance.
139
-
140
182
  ## The catch
141
183
 
142
- Pure Python is slower than NumPy on dense numerics. On this machine's benchmark run, 100×100 matrix multiplication took ~0.05 s versus ~0.0001 s for NumPy — roughly **580× slower**. That is the price of readable source. See [docs/benchmarks.md](https://github.com/Furox-Art/scientific-computing-system/blob/main/docs/benchmarks.md) for the full measurements, their provenance, and the hardware they came from.
184
+ Pure Python is slower than NumPy on dense numerics: the committed benchmark
185
+ artifact records 100×100 matrix multiplication at 0.0696 s against NumPy's
186
+ 0.000060 s, about **1155× slower**. Those numbers are from one CI run whose
187
+ platform, CPU, and library versions were not recorded, so treat them as
188
+ order-of-magnitude only — [docs/benchmarks.md](docs/benchmarks.md) states exactly
189
+ what that artifact does and does not support, and
190
+ [docs/why-pure-python.md](docs/why-pure-python.md) covers when to reach for
191
+ NumPy or the 2.0 build instead.
192
+
193
+ ## Contributing
143
194
 
144
- The trade-off buys you something real: you can read every algorithm, follow every step, and change anything without compiling C.
195
+ ```bash
196
+ pip install -e ".[dev]"
197
+ pytest # CI also enforces 100% blended coverage (statement + branch)
198
+ mkdocs serve # docs at http://127.0.0.1:8000/
199
+ ```
145
200
 
146
- I use it for prototyping, for teaching, and for cases where I need to know exactly what the computer is doing. For production number crunching, I still reach for NumPy — or the companion project [`scientific-computing-system-2.0`](https://github.com/Furox-Art/scientific-computing-system-2.0), which takes the opposite trade-off on NumPy/SciPy.
201
+ Issues and PRs welcome; see [CONTRIBUTING.md](CONTRIBUTING.md) and
202
+ [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md).
147
203
 
148
204
  ## License
149
205
 
150
206
  MIT — see [LICENSE](LICENSE).
151
207
 
152
- If you use this in published work, please cite it via [`CITATION.cff`](CITATION.cff).
208
+ Cite via [`CITATION.cff`](CITATION.cff). [`codemeta.json`](codemeta.json) carries
209
+ the same metadata in codemeta form, and [`paper.md`](paper.md) /
210
+ [`paper.bib`](paper.bib) are the JOSS manuscript.
package/SECURITY.md CHANGED
@@ -4,8 +4,8 @@
4
4
 
5
5
  | Version | Supported | Notes |
6
6
  |---|---|---|
7
- | 2.0.x | Yes | Current stable release line |
8
- | < 2.0 | No | Superseded by the 2.0 release line unless a specific security advisory states otherwise |
7
+ | 2.2.x | Yes | Current stable release line |
8
+ | < 2.2 | No | Superseded by the 2.2 release line unless a specific security advisory states otherwise |
9
9
 
10
10
  Security fixes target the current stable release line. Older release lines should not be assumed to receive backports unless an advisory explicitly says so.
11
11
 
@@ -23,18 +23,44 @@ You may also contact the maintainer directly. Reports should include the affecte
23
23
 
24
24
  `scientific-computing-system` is a local-first, pure-Python scientific-computing library distributed through PyPI. The core package has no required runtime dependencies. Optional scientific backends are loaded only when explicitly requested.
25
25
 
26
+ It is also published to npm as `scientific-computing-system`, but that package is a **Node launcher shim only** — it contains no Python, resolves an interpreter (`python`/`python3`/`py`), and runs `python -m cds`. npm users must install the Python distribution so that `python -m cds` resolves; the launcher never looks for a `cds` console script on `PATH`. The two registries carry **different provenance guarantees**; see [Distribution channels and provenance](#distribution-channels-and-provenance).
27
+
26
28
  ### In Scope
27
29
 
28
30
  | Threat | Mitigation |
29
31
  |---|---|
30
- | **Supply chain: malicious or substituted release artifact** | The release workflow is the sole PyPI publish authority. It builds wheel + sdist on a GitHub-hosted runner, verifies package metadata/version, installs the built wheel, smoke-tests the installed CLI, generates GitHub artifact attestation for those exact runner-local files, and publishes through PyPI Trusted Publishing (OIDC). |
31
- | **Registry drift** | Public PyPI is treated as the distribution registry. The release integrity check requires exactly one wheel and one sdist on PyPI and requires the matching GitHub Release to contain no wheel/sdist assets. A registry-policy workflow rechecks the public PyPI package and removes accidental distribution assets from GitHub Releases. |
32
+ | **Supply chain: malicious or substituted PyPI artifact** | The release workflow is the sole PyPI publish authority. It builds wheel + sdist on a GitHub-hosted runner, verifies package metadata/version, installs the built wheel, smoke-tests the installed CLI, generates GitHub artifact attestation for those exact runner-local files, and publishes through PyPI Trusted Publishing (OIDC). PyPI serves a PEP 740 provenance bundle for both artifacts. |
33
+ | **Supply chain: malicious or substituted npm artifact** | The npm workflow is the sole npm publish authority and gates on the registry version-existence check, a `npm pack --dry-run` tarball allowlist, and npm/Python version lockstep. **Provenance depends on the publish mode:** the OIDC path publishes with `--provenance` and yields a Sigstore attestation; the token fallback path cannot mint one and deliberately publishes without it. See below for the status of the currently published npm release. |
34
+ | **Registry drift** | Public PyPI is treated as the distribution registry for the library. The release integrity check requires exactly one wheel and one sdist on PyPI and requires the matching GitHub Release to contain no wheel/sdist assets. A registry-policy workflow rechecks the public PyPI package and removes accidental distribution assets from GitHub Releases. |
32
35
  | **Dependency vulnerabilities** | The core has no required runtime dependencies. Development/test/docs lock files are audited in CI with `pip-audit`; optional backends are isolated behind extras and lazy loading. |
33
36
  | **Code execution from package install** | The build backend is `hatchling`; there is no `setup.py` execution and package versioning is static in `pyproject.toml` plus `src/cds/_version.py`. |
34
37
  | **Unexpected scientific-tool loading** | Optional tools are selected through an explicit registry/capability layer and are not imported into the zero-dependency core unless requested. |
35
38
  | **Untrusted CLI input** | The CLI uses `argparse`-based typed/explicit parsing and does not evaluate arbitrary Python expressions. |
36
39
  | **Scientific workflow overclaiming** | The research orchestrator is fail-closed: blocked methods, missing tools, denied approvals, incomplete execution, validation failures, and unresolved method suitability prevent an unqualified final conclusion. |
37
40
 
41
+ ### Distribution channels and provenance
42
+
43
+ | | PyPI `scientific-computing-system` | npm `scientific-computing-system` |
44
+ |---|---|---|
45
+ | Contents | the library (wheel + sdist) | `index.js`, `bin/scs.js`, `LICENSE`, `README.md`, `CHANGELOG.md`, `SECURITY.md` — **no Python** |
46
+ | Requires the other channel | no | yes; `scs` needs the Python distribution installed so that `python -m cds` resolves — it does **not** look for a `cds` console script on `PATH` |
47
+ | Publish authentication | Trusted Publishing (OIDC) | OIDC trusted publishing is implemented and is the default; a token fallback exists |
48
+ | Attestation on the currently published release | **not on 2.2.0** — that release predates Trusted Publishing on this path and PyPI serves zero PEP 740 bundles for it; **yes from 2.2.1**, published via Trusted Publishing | **no** — the published 2.2.0 went out in token mode, which cannot produce a Sigstore attestation |
49
+
50
+ The npm release published as 2.2.0 was produced by a manual dispatch with
51
+ `use_token_fallback=true`. A long-lived registry token has no build identity to
52
+ attest, so npm's `--provenance` flag cannot be honoured on that path; the
53
+ workflow omits the flag and prints a notice instead of publishing something that
54
+ looks attested and is not. `npm view <pkg>` reports a legacy `dist.signatures`
55
+ value for it, which is npm's own transport signing and **not** a build
56
+ provenance attestation; the npm attestations endpoint returns 404 for this
57
+ package at this version.
58
+
59
+ **Practical consequence:** for anything security-sensitive, install from PyPI
60
+ and verify the PEP 740 provenance bundle against the SHA-256 digests PyPI
61
+ publishes. Do not rely on the npm channel for supply-chain assurance until a
62
+ release is published through the OIDC path.
63
+
38
64
  ### Optional Backend Boundary
39
65
 
40
66
  Optional backends such as SciPy, statsmodels, scikit-learn, SymPy, Z3, h5py, and netCDF4 have their own parser, file-format, numerical, and security behavior. CDS does not make those libraries safe for adversarial input.
@@ -59,9 +85,9 @@ In particular, `sympy_verify_identity()` passes caller-provided symbolic strings
59
85
 
60
86
  ## Security Best Practices for Users
61
87
 
62
- 1. **Pin the package version** in reproducible environments, for example `scientific-computing-system==2.0.0` rather than an unconstrained range.
88
+ 1. **Pin the package version** in reproducible environments, for example `pip install "scientific-computing-system==X.Y.Z"` with the exact release you have evaluated, rather than an unconstrained range. Deliberately no concrete version is written here: a pinned example goes stale at the next release and readers copy it regardless, so take the number from the [release notes](https://github.com/Furox-Art/scientific-computing-system/releases) for the release you are deploying, and record it in your own lockfile or constraints file.
63
89
  2. **Install only the optional extras you need.** Fewer third-party packages reduce supply-chain and compatibility surface.
64
- 3. **Verify provenance for high-assurance use.** Compare the PyPI wheel/sdist SHA-256 digests with the subjects recorded by the GitHub release workflow's artifact attestation.
90
+ 3. **Verify provenance for high-assurance use.** Compare the PyPI wheel/sdist SHA-256 digests with the subjects recorded by the GitHub release workflow's artifact attestation, or fetch the PEP 740 provenance bundle from PyPI. There is currently **no** equivalent attestation for the npm package — see [Distribution channels and provenance](#distribution-channels-and-provenance).
65
91
  4. **Treat optional backend inputs as backend inputs.** Do not pass hostile symbolic expressions or untrusted scientific files without the validation/sandboxing appropriate to SymPy, HDF5, NetCDF, or the relevant backend.
66
92
  5. **Keep the environment current.** Review dependency updates and run vulnerability auditing against the exact environment deployed.
67
93
  6. **Do not use the library as the sole validation layer for safety-critical conclusions.** Independent domain validation remains necessary.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scientific-computing-system",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
4
4
  "description": "Scientific Computing System launcher - a thin Node wrapper that forwards to the pure-Python `cds` CLI. This npm package ships NO Python code: it requires the Python distribution to be installed (`pip install scientific-computing-system`), otherwise `scs` exits non-zero with an actionable message.",
5
5
  "main": "index.js",
6
6
  "bin": {