scientific-computing-system 2.2.0 → 2.2.2
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.
- package/CHANGELOG.md +415 -105
- package/README.md +96 -28
- package/SECURITY.md +126 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,69 +7,336 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
-
###
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
10
|
+
### Distribution status of 2.2.2 — read this before assuming npm has it
|
|
11
|
+
|
|
12
|
+
The two registries are **not** in the same state for 2.2.2.
|
|
13
|
+
|
|
14
|
+
| Registry | `2.2.2` | Build attestation |
|
|
15
|
+
|---|---|---|
|
|
16
|
+
| **PyPI** `scientific-computing-system` | **published** | **PEP 740 provenance present** |
|
|
17
|
+
| **npm** `scientific-computing-system` | **NOT published** | none — the version does not exist on npm |
|
|
18
|
+
|
|
19
|
+
PyPI 2.2.2 is live and carries a PEP 740 attestation. Verified against the live
|
|
20
|
+
registries on 2026-10-05: the PEP 740 per-file provenance endpoint returns
|
|
21
|
+
**HTTP 200** for both files.
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
curl -sS -o /dev/null -w '%{http_code}\n' \
|
|
25
|
+
https://pypi.org/integrity/scientific-computing-system/2.2.2/scientific_computing_system-2.2.2-py3-none-any.whl/provenance # 200
|
|
26
|
+
curl -sS -o /dev/null -w '%{http_code}\n' \
|
|
27
|
+
https://pypi.org/integrity/scientific-computing-system/2.2.2/scientific_computing_system-2.2.2.tar.gz/provenance # 200
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
npm 2.2.2 does not exist. The published npm versions remain `1.0.0`, `2.2.0` and
|
|
31
|
+
`2.2.1`. Nothing about the npm launcher is broken — the publish is blocked on a
|
|
32
|
+
one-time npmjs.com registration, described next.
|
|
33
|
+
|
|
34
|
+
### Pending: register the npm trusted publisher (one-time, maintainer, in a browser)
|
|
35
|
+
|
|
36
|
+
npmjs.com has **no trusted publisher** configured for the package
|
|
37
|
+
`scientific-computing-system`. Until one exists, the OIDC path cannot complete a
|
|
38
|
+
publish, and npm publishes no provenance for this package.
|
|
39
|
+
|
|
40
|
+
The coordinates to enter on npmjs.com → package `scientific-computing-system` →
|
|
41
|
+
**Settings → Trusted Publisher → GitHub Actions**:
|
|
42
|
+
|
|
43
|
+
| Field | Value |
|
|
44
|
+
|---|---|
|
|
45
|
+
| Organization or user | `Furox-Art` |
|
|
46
|
+
| Package | `scientific-computing-system` |
|
|
47
|
+
| Workflow filename | `npm-publish.yml` |
|
|
48
|
+
| Environment name | `npm` |
|
|
49
|
+
| Allowed actions | **`npm publish`** — must be enabled, see the warning below |
|
|
50
|
+
|
|
51
|
+
**The allowed-actions field is not optional in practice.** npm's current UI grants
|
|
52
|
+
`npm stage publish` by default on newly created configurations and makes direct
|
|
53
|
+
`npm publish` **opt-in**. This repository's workflow calls `npm publish` directly,
|
|
54
|
+
so registering the publisher *without* also allowing `npm publish` will leave the
|
|
55
|
+
publish failing — with a permission error this time rather than a 404.
|
|
56
|
+
|
|
57
|
+
The same registration from the CLI, using the maintainer's own npm login and 2FA:
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
npm trust github --file npm-publish.yml \
|
|
61
|
+
--repo Furox-Art/scientific-computing-system --env npm --allow-publish
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### The publish mode default is unchanged, and was never set to token
|
|
65
|
+
|
|
66
|
+
The mode is the `workflow_dispatch` input `use_token_fallback`, whose default is
|
|
67
|
+
`false` — that is **OIDC**. There is no `npm_publish_mode` variable; the repository
|
|
68
|
+
has **no Actions variables at all** (none at repository or organization scope), and
|
|
69
|
+
`npm_publish_mode` appears nowhere in the tree. Nothing needs to be switched back:
|
|
70
|
+
OIDC is already the default, and token mode remains an explicit per-run opt-in.
|
|
71
|
+
|
|
72
|
+
`NPM_TOKEN` does still exist as a repository secret. It is what token mode would
|
|
73
|
+
use, and it should be deleted once the trusted publisher is registered and the
|
|
74
|
+
first OIDC publish has succeeded.
|
|
75
|
+
|
|
76
|
+
### Fixed: a 404 from npm no longer reads as "already published"
|
|
77
|
+
|
|
78
|
+
`npm publish` answered
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
npm error 404 The requested resource 'scientific-computing-system@2.2.2' could not
|
|
82
|
+
be found or you do not have permission to access it.
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
on runs 37268729425 and 37269325567, and that single line cannot distinguish the
|
|
86
|
+
two real causes. npm deliberately does not tell an unauthenticated caller whether a
|
|
87
|
+
package exists, so **an unregistered trusted publisher is reported as 404, not as
|
|
88
|
+
401 or 403.**
|
|
89
|
+
|
|
90
|
+
Two failure surfaces were making that expensive to diagnose, and both now say so
|
|
91
|
+
out loud. Neither changes what the workflow does; both only change what it prints.
|
|
92
|
+
|
|
93
|
+
- **The publish step** now names the real cause when npm returns 404, states that
|
|
94
|
+
the package exists and the version is absent, prints the npmjs.com fields above,
|
|
95
|
+
and calls out the `npm publish` allowed-action requirement. A rejected or absent
|
|
96
|
+
token looks different (401, or `ENEEDAUTH`), and the step says that too.
|
|
97
|
+
- **The version-existence gate** now warns, at the point where it would otherwise
|
|
98
|
+
tell someone to bump the version, that a 404 also means "unauthorized". Bumping
|
|
99
|
+
to escape a 404 consumes a release number on both registries and still will not
|
|
100
|
+
publish while the publisher is unregistered.
|
|
101
|
+
|
|
102
|
+
Worth recording precisely: in **both** runs the version gate **passed**. The
|
|
103
|
+
tarball built, provenance was signed and submitted to the Sigstore transparency
|
|
104
|
+
log, and only the `PUT` failed. So both runs did prove the authentication failure,
|
|
105
|
+
and the fix is the registration above — not a version bump.
|
|
106
|
+
|
|
107
|
+
## [v2.2.2] - 2026-10-05
|
|
108
|
+
|
|
109
|
+
Clears the last 17 open CodeQL alerts in this repository. None of them was a
|
|
110
|
+
security vulnerability, and **none was a logic defect** — no discarded result, no
|
|
111
|
+
missing `return`. Nothing is suppressed: there is no `# nosec`, no path exclusion
|
|
112
|
+
and no `codeql.config` entry.
|
|
113
|
+
|
|
114
|
+
### Behaviour change
|
|
115
|
+
|
|
116
|
+
**One, and it is a removal:** the private path `cds.cli._parser._build_parser` no
|
|
117
|
+
longer resolves.
|
|
118
|
+
|
|
119
|
+
`_build_parser` was an alias for `build_parser`, kept for backwards
|
|
120
|
+
compatibility. It was defined in `cds.cli._parser` but imported and re-exported by
|
|
121
|
+
`cds.cli.__init__`, so within its own module it was genuinely unreferenced —
|
|
122
|
+
which is exactly what `py/unused-global-variable` reported. The assignment has
|
|
123
|
+
moved to `cds.cli.__init__`, beside its only consumer and inside the `__all__`
|
|
124
|
+
that already exports it.
|
|
125
|
+
|
|
126
|
+
- `cds.cli._build_parser` is unchanged: still present, still in `__all__`, still
|
|
127
|
+
the same object as `cds.cli.build_parser`. This is the documented
|
|
128
|
+
backwards-compatibility surface and it keeps working.
|
|
129
|
+
- `cds.cli._parser._build_parser` is gone. Nothing in this repository referenced
|
|
130
|
+
it and the name is underscore-private, but a downstream script that reached
|
|
131
|
+
into the private submodule would break.
|
|
132
|
+
|
|
133
|
+
There is now a test pinning the alias, because the original defect was that
|
|
134
|
+
nothing asserted it existed.
|
|
135
|
+
|
|
136
|
+
### Fixed
|
|
137
|
+
|
|
138
|
+
- **Protocol placeholders are docstrings, not bare `...`.** Nine
|
|
139
|
+
`py/ineffectual-statement` alerts across `src/cds/ml/model_selection.py`,
|
|
140
|
+
`src/cds/ml/voting.py` and `src/cds/tools/adapters.py` were the conventional
|
|
141
|
+
`...` terminating a `typing.Protocol` method. These are false positives in the
|
|
142
|
+
strict sense: `...` is the documented placeholder for a structurally-typed
|
|
143
|
+
method whose implementation lives in the real backend module, and no code path
|
|
144
|
+
executes it. `SoftVotingModel` is the only `@runtime_checkable` one, and
|
|
145
|
+
`isinstance` against a runtime protocol inspects attribute *presence* without
|
|
146
|
+
calling the body.
|
|
147
|
+
|
|
148
|
+
They became docstrings rather than `pass` because coverage.py excludes an
|
|
149
|
+
ellipsis-only body but counts `pass`; measured, swapping it in drops those
|
|
150
|
+
lines from 100% to 75% and breaks the coverage gate. `raise NotImplementedError`
|
|
151
|
+
has the same coverage problem and would additionally change behaviour if the
|
|
152
|
+
body were ever reached. `src/cds` already contained nine docstring-only bodies
|
|
153
|
+
with no alert on any of them.
|
|
154
|
+
|
|
155
|
+
- **`src/cds/tools/registry.py` imports `importlib` one way.** Three spellings
|
|
156
|
+
were mixed: `import importlib`, `import importlib.util` and
|
|
157
|
+
`from importlib import metadata`. The first was fully subsumed by the second.
|
|
158
|
+
Now `import importlib.metadata` and `import importlib.util`, with call sites
|
|
159
|
+
fully qualified. Four monkeypatch targets in `tests/` were retargeted to match.
|
|
160
|
+
|
|
161
|
+
- **Four `py/unnecessary-lambda` alerts in the test suite.** `lambda x: max(x)`
|
|
162
|
+
and `lambda values: sum(values)` are plain wrappers around a callable; the
|
|
163
|
+
callables are now passed directly.
|
|
164
|
+
|
|
165
|
+
- **`tests/test_fitting_bootstrap.py` imports `cds.modeling.fitting` one way.**
|
|
166
|
+
A module-level `from ... import` coexisted with function-local
|
|
167
|
+
`import ... as fitting`. The single `import ... as fitting` form is used now and
|
|
168
|
+
the module-level names are qualified through it.
|
|
169
|
+
|
|
170
|
+
### Added
|
|
171
|
+
|
|
172
|
+
- **`tests/test_protocol_placeholders.py`** pins the protocol bodies on the AST,
|
|
173
|
+
because a docstring-only body and a docstring followed by `pass` compile to
|
|
174
|
+
almost identical instructions and only the syntax tree tells them apart. It also
|
|
175
|
+
asserts the placeholder semantics (`None` when called unbound), that
|
|
176
|
+
`SoftVotingModel` is still a working structural contract, and that every
|
|
177
|
+
declared signature and annotation still resolves. Negative-controlled against
|
|
178
|
+
four mutations, all caught: docstring-plus-`pass`, `...` reinstated, body
|
|
179
|
+
replaced by a real statement, and a statement appended after the docstring.
|
|
180
|
+
|
|
181
|
+
### Changed
|
|
182
|
+
|
|
183
|
+
- README's pasted `cds --version` transcript now reads `System version 2.2.2`.
|
|
184
|
+
Every provenance and attestation statement in `README.md` and `SECURITY.md`
|
|
185
|
+
still refers to **2.2.1** deliberately: those describe the published release,
|
|
186
|
+
including its digests, and remain true until a newer one ships.
|
|
187
|
+
|
|
38
188
|
|
|
39
189
|
### Fixed
|
|
40
190
|
|
|
41
|
-
- **
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
191
|
+
- **Provenance claims are now scoped, measured, and guarded.** A follow-up report
|
|
192
|
+
asserted that PyPI had no PEP 740 attestation either. Re-measured directly, that
|
|
193
|
+
is **not** the case, so the previous text was left standing and made precise
|
|
194
|
+
rather than weakened:
|
|
195
|
+
|
|
196
|
+
- PyPI **2.2.1** serves a PEP 740 provenance bundle for **both** the wheel and
|
|
197
|
+
the sdist (HTTP 200 on the per-file `/integrity/.../provenance` endpoint),
|
|
198
|
+
and each bundle's `subject` digest equals the `sha256` PyPI publishes for
|
|
199
|
+
that file. The 404 in the report came from requesting
|
|
200
|
+
`https://pypi.org/integrity/scientific-computing-system/2.2.1/`, which is a
|
|
201
|
+
directory, not the per-file endpoint.
|
|
202
|
+
- npm **2.2.1** has **no** attestation: the attestations endpoint returns 404.
|
|
203
|
+
This part of the report was correct.
|
|
204
|
+
|
|
205
|
+
The security posture is therefore unchanged and more precisely stated. What
|
|
206
|
+
changed: `SECURITY.md` now separates the three things that were being conflated
|
|
207
|
+
— a **PEP 740 attestation** (Sigstore-signed, attests *who built this*),
|
|
208
|
+
**npm `dist.signatures`** (registry transport signing, attests nothing about
|
|
209
|
+
the build), and a **content digest** (`sha256` on PyPI, `dist.integrity` on
|
|
210
|
+
npm; pins *which bytes*, not *where they came from*). It lists the published
|
|
211
|
+
digests to pin, gives the commands that verify them, and states the exact
|
|
212
|
+
trusted-publisher coordinates still to be registered for npm.
|
|
213
|
+
|
|
214
|
+
- **Reproducible-build claim scoped to what was actually measured.** Two
|
|
215
|
+
consecutive builds of the same commit with the same pinned backend produced
|
|
216
|
+
byte-identical wheel and sdist. Those digests do **not** match the published
|
|
217
|
+
ones (the release runs a hash-locked Linux toolchain; the check ran elsewhere),
|
|
218
|
+
so the documentation now claims determinism for a fixed toolchain and
|
|
219
|
+
explicitly declines to claim the published artifacts are bit-for-bit
|
|
220
|
+
reproducible from source.
|
|
221
|
+
|
|
222
|
+
- **npm launcher prerequisite re-verified.** With `cds` absent from `PATH`, the
|
|
223
|
+
shim proceeds straight to interpreter resolution (`python`/`python3`/`py`) and
|
|
224
|
+
runs `python -m cds`; it never looks for a `cds` console script. README,
|
|
225
|
+
`SECURITY.md` and the docs already agreed on this wording, and it is now
|
|
226
|
+
backed by an explicit check rather than by reading the source.
|
|
227
|
+
|
|
228
|
+
### Added
|
|
229
|
+
|
|
230
|
+
- `docs/checks/verify_provenance_claims.py` — a guard that parses the attestation
|
|
231
|
+
claims out of `README.md` and `SECURITY.md` and compares them against the live
|
|
232
|
+
registries, failing if the prose asserts something the registries contradict.
|
|
233
|
+
It also rejects prose that overstates `dist.integrity` as provenance or allows
|
|
234
|
+
the attested subject to differ from the published digest. Negative-controlled:
|
|
235
|
+
three false claims (PyPI not attested, npm attested, digest mismatch acceptable)
|
|
236
|
+
each turn it red. Wiring it into CI is left to the workflow owner; this change
|
|
237
|
+
is docs-only by scope.
|
|
238
|
+
|
|
239
|
+
## [v2.2.1] - 2026-10-04
|
|
240
|
+
|
|
241
|
+
Documentation and release-surface corrections. **No library behaviour change**:
|
|
242
|
+
nothing under `src/cds/` was modified except the `__version__` constant, so no
|
|
243
|
+
numerical kernel, public API signature or CLI subcommand differs from 2.2.0.
|
|
244
|
+
|
|
245
|
+
The reason this patch release exists: `README.md` is the `long_description`, and
|
|
246
|
+
PyPI only re-reads it when a new release is uploaded. 2.2.0 shipped the README as
|
|
247
|
+
it stood before the truthfulness work below, so the PyPI project page for 2.2.0
|
|
248
|
+
still advertises claims the repository has since retracted. Publishing 2.2.1 is
|
|
249
|
+
what makes the corrected README the one PyPI renders.
|
|
70
250
|
|
|
71
251
|
### Fixed
|
|
72
252
|
|
|
253
|
+
- **README performance claim corrected to the committed artifact.** The "catch"
|
|
254
|
+
paragraph asserted "~0.05 s versus ~0.0001 s ... roughly 580x slower" and
|
|
255
|
+
described it as "this machine's benchmark run", while pointing readers at
|
|
256
|
+
`docs/benchmarks.md` for "the hardware they came from". `benchmarks/results.json`
|
|
257
|
+
actually records 0.0696 s versus 0.000060 s (**1154.8x**) at commit `7213425`,
|
|
258
|
+
and that same file records Platform / CPU / Python / NumPy as "not recorded"
|
|
259
|
+
with an explicit "treat the absolute timings as unverified" warning. The line
|
|
260
|
+
added by the earlier truthfulness commit therefore contradicted the warnings it
|
|
261
|
+
shipped alongside. Both the README and `docs/why-pure-python.md` now quote the
|
|
262
|
+
artifact's own numbers and state that the environment was not recorded.
|
|
263
|
+
|
|
264
|
+
- **npm launcher prerequisite stated correctly.** README and `SECURITY.md` said
|
|
265
|
+
the `scs` shim works once `cds` is "on your PATH". `index.js` resolves an
|
|
266
|
+
interpreter (`python`/`python3`/`py`) and runs `python -m cds`; it never looks
|
|
267
|
+
for a console script on `PATH`. Corrected to "requires the Python distribution
|
|
268
|
+
installed so that `python -m cds` resolves".
|
|
269
|
+
|
|
270
|
+
- **Stale version references left behind by the 2.2.1 bump.** The README's pasted
|
|
271
|
+
`cds --version` transcript still read `System version 2.2.0` after the version
|
|
272
|
+
moved, and `SECURITY.md` still recommended pinning `==2.2.0`. Since the README
|
|
273
|
+
is the `long_description`, that line would have shipped verbatim to the PyPI
|
|
274
|
+
project page. Both were re-derived from live commands at 2.2.1.
|
|
275
|
+
|
|
276
|
+
Every other pasted transcript was re-checked against the installed 2.2.1 wheel
|
|
277
|
+
and found current: the quickstart output (SVD singular values, damped-oscillator
|
|
278
|
+
final state, regression fit), `cds modules` printing 26 rows and omitting exactly
|
|
279
|
+
the nine documented modules, the structural claims (34 subpackages, 35 public
|
|
280
|
+
feature modules, 505 names / 342 functions / 163 classes), the benchmark ratio
|
|
281
|
+
against `benchmarks/results.json`, and all five documented extras.
|
|
282
|
+
|
|
283
|
+
Two further `SECURITY.md` claims were false and are corrected: `scs` was
|
|
284
|
+
documented as needing a `cds` console script on `PATH` when the launcher
|
|
285
|
+
resolves an interpreter and runs `python -m cds` (verified: the shim prints
|
|
286
|
+
`System version 2.2.1` with no `cds` on `PATH`), and the PyPI attestation cell
|
|
287
|
+
claimed a PEP 740 bundle for the published 2.2.0 when PyPI serves none.
|
|
288
|
+
|
|
289
|
+
The pin example is now version-agnostic by construction, so it cannot rot at
|
|
290
|
+
the next bump.
|
|
291
|
+
|
|
292
|
+
- **Module-surface claims are now accurate.** "34 subpackages" silently omitted
|
|
293
|
+
the two top-level public modules (`causal.py`, `sensitivity.py`), and
|
|
294
|
+
"`cds modules` for the live list" was wrong twice over: that command prints a
|
|
295
|
+
curated 26-entry subset and omits `bayes`, `causal`, `core`, `fractals`,
|
|
296
|
+
`genetics`, `infotheory`, `interpolate`, `pde`, and `wavelets`. README,
|
|
297
|
+
`docs/api.md` and `docs/index.md` now state the real counts and flag
|
|
298
|
+
`cds modules` as a subset. The unsupported "46 public functions / 534 exports"
|
|
299
|
+
hero claim does not exist in the repository or in any reachable commit; the
|
|
300
|
+
README instead carries counts derived from the package itself (505 exports:
|
|
301
|
+
342 functions, 163 classes across 35 feature modules).
|
|
302
|
+
|
|
303
|
+
- **Documentation no longer claims npm is unpublished.** npm 2.2.0 is live and
|
|
304
|
+
npm is a supported channel, but `README.md` line 41 still said "npm is no
|
|
305
|
+
longer published". Because `README.md` is listed in the npm `files` allowlist,
|
|
306
|
+
that sentence shipped **verbatim inside the published 2.2.0 tarball**, so the
|
|
307
|
+
npm package page contradicted its own README. `README.md`, `SECURITY.md` and
|
|
308
|
+
`docs/related.md` now describe both channels accurately; the npm version badge
|
|
309
|
+
is restored now that the registry and PyPI agree.
|
|
310
|
+
|
|
311
|
+
- **A successful publish is no longer reported as a failure while npm is still
|
|
312
|
+
propagating it.** `npm publish` returns as soon as the registry accepts the
|
|
313
|
+
upload, but the version becomes readable on the read path asynchronously. The
|
|
314
|
+
post-publish check read once, immediately, and on run `37136131220` got
|
|
315
|
+
`npm error 404 No match found for version 2.2.0` — while 2.2.0 was in fact
|
|
316
|
+
published and recorded by the registry ninety seconds later. A maintainer
|
|
317
|
+
reading that run had every reason to believe the release had broken. Three
|
|
318
|
+
sibling repositories hit the same false failure.
|
|
319
|
+
|
|
320
|
+
The check now polls the registry with backoff over a budget of several minutes,
|
|
321
|
+
succeeds on the first match, and still fails closed if the version genuinely
|
|
322
|
+
never appears, emitting a `::warning::` first so a slow-but-successful publish
|
|
323
|
+
is never read as a hard failure.
|
|
324
|
+
|
|
325
|
+
It queries the registry's JSON API instead of `npm view`, which was a poor fit:
|
|
326
|
+
it reports "absent" and "denied" with the same `E404`, and it resolves against
|
|
327
|
+
the userconfig the job created for *writing*, so a read-only confirmation had no
|
|
328
|
+
reason to touch publish credentials at all. Both directions are exercised
|
|
329
|
+
against a stub registry, and the retry budget itself is asserted, since
|
|
330
|
+
shortening it to make a test fast is what caused the bug.
|
|
331
|
+
|
|
332
|
+
- **The publish path is now guarded rather than merely enabled.** The launcher
|
|
333
|
+
contract test previously asserted that publishing stayed disabled, which would
|
|
334
|
+
have silently passed against a disabled workflow. It now asserts a real
|
|
335
|
+
`npm publish --provenance` invocation, `id-token: write`, the absence of
|
|
336
|
+
`private: true`, the absence of the disabled stub, and the presence of every
|
|
337
|
+
gate that makes a publish safe: the registry version-existence check, the
|
|
338
|
+
`npm pack --dry-run` tarball allowlist, and the npm/Python version lockstep.
|
|
339
|
+
|
|
73
340
|
- **The npm toolchain version floor rejected a compliant toolchain.** The first
|
|
74
341
|
real publish run failed on this gate:
|
|
75
342
|
|
|
@@ -84,63 +351,81 @@ rather than by the tag push that future releases will use.
|
|
|
84
351
|
dotted version without enumerating every minor, which is exactly the mistake
|
|
85
352
|
that shipped. The gate now parses the version, strips any leading `v` and
|
|
86
353
|
prerelease suffix, and compares major/minor/patch as integers against 11.5.1.
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
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.
|
|
354
|
+
The Node half of the same gate ignored the patch component: it compared only
|
|
355
|
+
major and minor, so `22.9.0` was accepted even though the documented floor is
|
|
356
|
+
22.14.0. Both halves now use the same integer comparison.
|
|
112
357
|
|
|
113
358
|
- **Token-mode npm publish failed with `ENEEDAUTH` while holding a valid
|
|
114
359
|
secret.** The run reached `npm publish` with `NODE_AUTH_TOKEN` populated and
|
|
115
360
|
still got:
|
|
361
|
+
|
|
116
362
|
```
|
|
117
363
|
npm error code ENEEDAUTH
|
|
118
364
|
npm error need auth This command requires you to be logged in to
|
|
119
365
|
https://registry.npmjs.org/
|
|
120
366
|
```
|
|
367
|
+
|
|
121
368
|
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
|
|
123
|
-
|
|
369
|
+
wrote no npm userconfig at all. `NODE_AUTH_TOKEN` on its own is inert — npm only
|
|
370
|
+
substitutes it into a credential when some userconfig maps
|
|
124
371
|
`//registry.npmjs.org/` to `${NODE_AUTH_TOKEN}`. With no such entry npm never
|
|
125
372
|
attempts authentication, which is why the failure was `ENEEDAUTH` (no
|
|
126
373
|
authentication attempted) rather than `E401` (attempted and rejected) even
|
|
127
|
-
though the secret was present and correct. The fix is
|
|
128
|
-
"https://registry.npmjs.org"` on `setup-node
|
|
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).
|
|
374
|
+
though the secret was present and correct. The fix is
|
|
375
|
+
`registry-url: "https://registry.npmjs.org"` on `setup-node`.
|
|
142
376
|
|
|
143
|
-
|
|
377
|
+
Separately, the credential check lived inline inside the publish step, so its
|
|
378
|
+
failure text appeared in the log while `npm publish` was invoked anyway. It is
|
|
379
|
+
now its own step ahead of both publish steps, so a non-zero exit ends the job
|
|
380
|
+
before npm can run, and it covers the OIDC mode too (verifying the runner
|
|
381
|
+
actually granted `id-token: write`, which the previous version never checked).
|
|
382
|
+
|
|
383
|
+
- **The `bin` map is now pinned by tests, so a broken launcher command cannot
|
|
384
|
+
ship silently.** The `npm warn publish "bin[scs]" script name bin/scs.js was
|
|
385
|
+
invalid and removed` message had been reported as a defect that would leave
|
|
386
|
+
the published package with no working `scs` command. **That report was wrong.**
|
|
387
|
+
npm normalises the redundant `./` prefix and ships the entry either way; the
|
|
388
|
+
packed tarball keeps `bin: { scs: "./bin/scs.js" }` alongside `bin/scs.js`, and
|
|
389
|
+
installing it creates `scs`, `scs.cmd` and `scs.ps1` and `scs --version`
|
|
390
|
+
succeeds. `axiomize@1.12.4`, published from the identical shape, ships the same
|
|
391
|
+
and is not deprecated. No `package.json` change is required.
|
|
392
|
+
|
|
393
|
+
What *is* a real hazard is the opposite: npm ships a `bin` pointing at a
|
|
394
|
+
missing file, or one excluded by `files`, with **no warning at all**. Five
|
|
395
|
+
tests now assert the bin map is a valid command-name to path mapping, that
|
|
396
|
+
every target exists and is covered by `files`, that the shim carries a `node`
|
|
397
|
+
shebang, and that the real tarball (`npm pack --dry-run --json`) still contains
|
|
398
|
+
both the shim and the bin entry. One further test documents that the `./`
|
|
399
|
+
prefix is intentional so the cosmetic warning is not "fixed" by a future
|
|
400
|
+
maintainer.
|
|
401
|
+
|
|
402
|
+
### Added
|
|
403
|
+
|
|
404
|
+
- **`tests/test_readme_surface.py`** derives the README's structural claims from
|
|
405
|
+
`src/cds/` and from the installed package: subpackage count, presence of both
|
|
406
|
+
top-level public modules, the export total, per-module table coverage, the
|
|
407
|
+
benchmark ratio against `benchmarks/results.json`, and a guard against
|
|
408
|
+
describing `cds modules` as exhaustive. This drift was previously invisible to
|
|
409
|
+
CI, which is how it survived several releases. Verified by mutation: five
|
|
410
|
+
separate re-introductions of the audited defects each turn the suite red.
|
|
411
|
+
|
|
412
|
+
- **`codemeta.json` is now a locked version surface.** It was left out of the
|
|
413
|
+
original five surfaces and drifted: it still declared `2.1.0` after the package
|
|
414
|
+
reached 2.2.0, while every other surface had moved. CodeMeta is a
|
|
415
|
+
machine-readable publication record, so a stale `version` there advertises the
|
|
416
|
+
previous release to every automated consumer while the installed package
|
|
417
|
+
reports a different one. `scripts/check_version_lockstep.py` now reads it and
|
|
418
|
+
`tests/test_codemeta_version_lockstep.py` fails CI on drift. It is also added
|
|
419
|
+
to the sdist allowlist, without which that suite failed with `FileNotFoundError`
|
|
420
|
+
when run from an unpacked sdist.
|
|
421
|
+
|
|
422
|
+
- README coverage: `cds.core` and `cds.graph` rows, `examples/` (35 runnable
|
|
423
|
+
files) and `dashboard/app.py` entries, all 13 CLI subcommands, the `[pandas]`
|
|
424
|
+
extra, `paper.md`/`paper.bib` (JOSS) and `codemeta.json`, and a Contributing
|
|
425
|
+
section with the `pip install -e ".[dev]"` / `pytest` / `mkdocs serve` loop and
|
|
426
|
+
the 100% blended-coverage gate. Duplicated prose was removed (the supply-chain
|
|
427
|
+
section now defers to `SECURITY.md` instead of restating it, and the generic
|
|
428
|
+
"Common use cases" filler is gone).
|
|
144
429
|
|
|
145
430
|
- **Two supported npm publish modes**, selected by the `use_token_fallback`
|
|
146
431
|
dispatch input (boolean, default `false`):
|
|
@@ -154,12 +439,37 @@ rather than by the tag push that future releases will use.
|
|
|
154
439
|
Sigstore attestation: a token cannot mint one, and npm rejects the
|
|
155
440
|
combination. The token mode prints a NOTICE that the release carries no
|
|
156
441
|
provenance rather than passing a flag that cannot work or implying an
|
|
157
|
-
attestation exists.
|
|
442
|
+
attestation exists. Both modes are fail-closed: a requested mode with no usable
|
|
443
|
+
credential exits non-zero with an actionable message, and token mode never runs
|
|
444
|
+
automatically, so a broken OIDC configuration cannot silently downgrade to the
|
|
445
|
+
long-lived credential.
|
|
446
|
+
|
|
447
|
+
### Changed
|
|
158
448
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
449
|
+
- **npm publishing is real again.** This reverses two earlier decisions, both
|
|
450
|
+
deliberate at the time and recorded here so the history is not silently erased:
|
|
451
|
+
the decision in `52717c5` to disable npm publishing (which replaced the publish
|
|
452
|
+
step with `run: echo "npm publishing is disabled; PyPI is the install path" &&
|
|
453
|
+
exit 0`), and `"private": true` in `package.json`, added by `#140` while
|
|
454
|
+
publishing was disabled. `private: true` makes `npm publish` refuse to run at
|
|
455
|
+
all, so the flag had to go before the workflow could work. The `files` allowlist
|
|
456
|
+
is retained: it is what keeps the repository (tests, CI workflows, 10k+
|
|
457
|
+
statements of Python, promo media) out of the published tarball. The npm
|
|
458
|
+
channel is on OIDC trusted publishing (`id-token: write`,
|
|
459
|
+
`npm publish --provenance`); no long-lived registry token is used on the
|
|
460
|
+
primary path.
|
|
461
|
+
|
|
462
|
+
- README shortened with **higher** coverage: the supply-chain section dropped from
|
|
463
|
+
209 lines to a 3-line summary plus a link, and "The catch" reduced to a short
|
|
464
|
+
paragraph.
|
|
465
|
+
|
|
466
|
+
- **This release carries a PyPI attestation; 2.2.0 does not.** PyPI's JSON API
|
|
467
|
+
reports zero PEP 740 attestation bundles for 2.2.0, which went out in token
|
|
468
|
+
mode — a token cannot mint a Sigstore attestation. 2.2.1 is published by
|
|
469
|
+
`release.yml` through `pypa/gh-action-pypi-publish` with Trusted Publishing
|
|
470
|
+
(OIDC), so it will carry one, as long as the `pypi` environment's trusted
|
|
471
|
+
publisher is configured — a misconfiguration fails the publish loudly rather
|
|
472
|
+
than degrading silently.
|
|
163
473
|
|
|
164
474
|
## [v2.2.0]
|
|
165
475
|
|
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,68 @@
|
|
|
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
|
-
|
|
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).
|
|
44
|
+
|
|
45
|
+
## Install
|
|
42
46
|
|
|
43
|
-
|
|
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:
|
|
54
|
+
|
|
55
|
+
- **PyPI** — carries a **PEP 740 provenance attestation** (Sigstore-signed,
|
|
56
|
+
binding the file digest to the publishing workflow). Verified on 2.2.1.
|
|
57
|
+
- **npm** — carries **no** attestation; the npmjs.com trusted publisher is not
|
|
58
|
+
registered yet, so its publish path cannot mint one. npm does expose
|
|
59
|
+
`dist.integrity` (sha512), which is a content pin, not proof of origin, and
|
|
60
|
+
`dist.signatures`, which is npm's registry transport signature, not build
|
|
61
|
+
provenance.
|
|
62
|
+
|
|
63
|
+
Prefer PyPI for anything security-sensitive.
|
|
64
|
+
[SECURITY.md](SECURITY.md#distribution-channels-and-provenance) has the
|
|
65
|
+
per-channel table, the published digests to pin, the commands to verify them,
|
|
66
|
+
and what to register to close the npm gap.
|
|
44
67
|
|
|
45
68
|
## What's inside
|
|
46
69
|
|
|
47
|
-
|
|
70
|
+
`src/cds/` holds **34 subpackages plus `causal.py` and `sensitivity.py`**. That is
|
|
71
|
+
35 public feature modules — the `cds` CLI entry point is the 36th subpackage —
|
|
72
|
+
exporting **505 names** (342 functions, 163 classes), all pure standard library.
|
|
73
|
+
`tests/test_readme_surface.py` derives these numbers from the package, so they
|
|
74
|
+
cannot drift silently.
|
|
48
75
|
|
|
49
76
|
| Area | Modules | What you get |
|
|
50
77
|
|---|---|---|
|
|
78
|
+
| Core models | `cds.core` | Shared `Domain`, `Hypothesis`, `HypothesisStatus` types |
|
|
51
79
|
| Linear algebra & calculus | `cds.math_utils`, `cds.interpolate` | SVD, QR, Cholesky, LU, power iteration, derivatives, integrals |
|
|
52
80
|
| ODE / PDE | `cds.diffeq`, `cds.pde` | Euler, RK4, adaptive RK45, implicit stiff methods, symplectic integrators; 1-D heat & wave equations |
|
|
53
81
|
| 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,
|
|
55
|
-
| Statistics | `cds.stats`, `cds.probability` | Descriptive stats, regression, t/chi-square/ANOVA, effect sizes, nonparametric ranks, time series
|
|
56
|
-
| Bayesian | `cds.bayes` | Conjugate updates, credible intervals, Bayes factors |
|
|
82
|
+
| Optimization | `cds.optimization` | Gradient descent, Newton, Adam, Nelder-Mead, annealing, constrained search |
|
|
83
|
+
| 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
84
|
| Monte Carlo | `cds.montecarlo` | π estimation, Monte-Carlo integration, random walks |
|
|
58
|
-
| Machine learning | `cds.ml` | MLP, k-NN, k-means, CART
|
|
85
|
+
| Machine learning | `cds.ml` | MLP, k-NN, k-means, CART, random forest, boosting, PCA (educational, not production) |
|
|
59
86
|
| Signal processing | `cds.signals`, `cds.wavelets` | DFT/FFT/IFFT, convolution, Butterworth design, STFT, Haar DWT |
|
|
60
87
|
| Quantum | `cds.quantum` | Single & multi-qubit state-vector circuits, Bell/GHZ states, entanglement |
|
|
61
|
-
|
|
|
88
|
+
| Graphs | `cds.graph` | BFS, DFS, Dijkstra shortest paths, Kruskal MST, topological sort, cycle detection |
|
|
89
|
+
| Scientific domains | `cds.scientific`, `cds.genetics`, `cds.fractals`, `cds.infotheory` | Physical constants & formulas, DNA analysis & alignment, fractal sets, entropy/divergence/mutual information |
|
|
62
90
|
| Symbolic modeling | `cds.modeling` | Expression trees, symbolic differentiation, LaTeX export, `MathModel` systems, root finding, fitting |
|
|
63
91
|
| Uncertainty & sensitivity | `cds.uncertainty`, `cds.sensitivity` | Analytic + correlated Monte-Carlo propagation, local & variance-based global sensitivity, identifiability |
|
|
64
92
|
| Validation & causality | `cds.validation`, `cds.causal` | Cross-method checks, drift/OOD reports, assumption-gated causal estimators |
|
|
65
|
-
| Units
|
|
93
|
+
| Units | `cds.units` | SI quantities, conversions, dimensional compatibility checks |
|
|
66
94
|
| Workflow & provenance | `cds.workflow`, `cds.provenance` | Approval-gated orchestration, run manifests, hashes, checkpoints |
|
|
67
95
|
| Data | `cds.data_analysis`, `cds.data_io` | CSV/tabular analysis, streaming I/O, optional HDF5/NetCDF |
|
|
68
96
|
| Knowledge & hypothesis | `cds.knowledge`, `cds.hypothesis` | Concept graphs, research notes, structured hypothesis generation & evaluation |
|
|
@@ -70,6 +98,22 @@ The import name is **`cds`** (the distribution is `scientific-computing-system`)
|
|
|
70
98
|
| Plotting | `cds.plot` | Optional matplotlib helpers (`[plot]` extra) |
|
|
71
99
|
| Backend adapters | `cds.tools` | Lazy discovery for NumPy/SciPy/statsmodels/scikit-learn/SymPy/Z3 |
|
|
72
100
|
|
|
101
|
+
The authoritative per-module list is the [API reference](https://furox-art.github.io/scientific-computing-system/api/).
|
|
102
|
+
|
|
103
|
+
!!! note "`cds modules` is a curated subset"
|
|
104
|
+
`cds modules` prints 26 entries. It is **not** the full catalog: it omits
|
|
105
|
+
`bayes`, `causal`, `core`, `fractals`, `genetics`, `infotheory`, `interpolate`,
|
|
106
|
+
`pde`, and `wavelets`. Use the [API reference](https://furox-art.github.io/scientific-computing-system/api/)
|
|
107
|
+
or `src/cds/` for the complete set.
|
|
108
|
+
|
|
109
|
+
### Runnable examples and the dashboard
|
|
110
|
+
|
|
111
|
+
- **[`examples/`](examples/)** — 35 runnable scripts and notebooks (33 `.py`, 2
|
|
112
|
+
`.ipynb`), each self-contained and dependency-free unless noted. Every tutorial
|
|
113
|
+
page in the docs has a matching example.
|
|
114
|
+
- **[`dashboard/app.py`](dashboard/app.py)** — a Streamlit dashboard:
|
|
115
|
+
`cds dashboard`, or `pip install "scientific-computing-system[dashboard]"`.
|
|
116
|
+
|
|
73
117
|
## Quick Start
|
|
74
118
|
|
|
75
119
|
```bash
|
|
@@ -107,17 +151,32 @@ final t = 50.0 | final y = [0.07638443, 0.0264785]
|
|
|
107
151
|
slope = 1.9900 | intercept = 0.0500 | r^2 = 0.9973
|
|
108
152
|
```
|
|
109
153
|
|
|
110
|
-
|
|
154
|
+
## CLI
|
|
155
|
+
|
|
156
|
+
The package installs a `cds` command with 13 subcommands:
|
|
157
|
+
|
|
158
|
+
| Command | Purpose |
|
|
159
|
+
|---|---|
|
|
160
|
+
| `cds --help` | Full command list |
|
|
161
|
+
| `cds modules` | Curated module catalog (see the caveat above) |
|
|
162
|
+
| `cds info` | Version, module status, health summary |
|
|
163
|
+
| `cds constants` | Table of physical constants |
|
|
164
|
+
| `cds calc <formula>` | Quick physics calculation (`ke`, `gravity`, `wave`, `gas`) |
|
|
165
|
+
| `cds stats <numbers>` | Descriptive statistics for a comma-separated list |
|
|
166
|
+
| `cds sample <dist>` | Draw samples from a probability distribution |
|
|
167
|
+
| `cds integrate <fn>` | Integrate a built-in function over `[a, b]` |
|
|
168
|
+
| `cds hypothesis <q>` | Generate scientific hypotheses for a question |
|
|
169
|
+
| `cds prompt` | Prompt text for a custom hypothesis generator |
|
|
170
|
+
| `cds benchmark` | Run the built-in benchmarks |
|
|
171
|
+
| `cds plot <numbers>` | ASCII plot, or PNG with `--file` when `[plot]` is installed |
|
|
172
|
+
| `cds dashboard` | Launch the Streamlit dashboard (needs `[dashboard]`) |
|
|
111
173
|
|
|
112
174
|
```console
|
|
113
175
|
$ cds --version
|
|
114
|
-
System version 2.2.
|
|
115
|
-
$ cds modules # live module catalog
|
|
176
|
+
System version 2.2.2
|
|
116
177
|
$ cds constants # physical constants table
|
|
117
178
|
```
|
|
118
179
|
|
|
119
|
-
Full docs: [furox-art.github.io/scientific-computing-system](https://furox-art.github.io/scientific-computing-system/).
|
|
120
|
-
|
|
121
180
|
## Optional extras
|
|
122
181
|
|
|
123
182
|
The core is zero-dependency. Everything below is opt-in:
|
|
@@ -126,27 +185,36 @@ The core is zero-dependency. Everything below is opt-in:
|
|
|
126
185
|
pip install "scientific-computing-system[scientific]" # NumPy, SciPy, statsmodels, scikit-learn, SymPy, Z3
|
|
127
186
|
pip install "scientific-computing-system[io]" # HDF5 + NetCDF
|
|
128
187
|
pip install "scientific-computing-system[plot]" # matplotlib
|
|
188
|
+
pip install "scientific-computing-system[pandas]" # DataFrame bridge: cds.data_analysis.pandas_io
|
|
129
189
|
pip install "scientific-computing-system[dashboard]" # Streamlit dashboard
|
|
130
190
|
```
|
|
131
191
|
|
|
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
192
|
## The catch
|
|
141
193
|
|
|
142
|
-
Pure Python is slower than NumPy on dense numerics
|
|
194
|
+
Pure Python is slower than NumPy on dense numerics: the committed benchmark
|
|
195
|
+
artifact records 100×100 matrix multiplication at 0.0696 s against NumPy's
|
|
196
|
+
0.000060 s, about **1155× slower**. Those numbers are from one CI run whose
|
|
197
|
+
platform, CPU, and library versions were not recorded, so treat them as
|
|
198
|
+
order-of-magnitude only — [docs/benchmarks.md](docs/benchmarks.md) states exactly
|
|
199
|
+
what that artifact does and does not support, and
|
|
200
|
+
[docs/why-pure-python.md](docs/why-pure-python.md) covers when to reach for
|
|
201
|
+
NumPy or the 2.0 build instead.
|
|
202
|
+
|
|
203
|
+
## Contributing
|
|
143
204
|
|
|
144
|
-
|
|
205
|
+
```bash
|
|
206
|
+
pip install -e ".[dev]"
|
|
207
|
+
pytest # CI also enforces 100% blended coverage (statement + branch)
|
|
208
|
+
mkdocs serve # docs at http://127.0.0.1:8000/
|
|
209
|
+
```
|
|
145
210
|
|
|
146
|
-
|
|
211
|
+
Issues and PRs welcome; see [CONTRIBUTING.md](CONTRIBUTING.md) and
|
|
212
|
+
[CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md).
|
|
147
213
|
|
|
148
214
|
## License
|
|
149
215
|
|
|
150
216
|
MIT — see [LICENSE](LICENSE).
|
|
151
217
|
|
|
152
|
-
|
|
218
|
+
Cite via [`CITATION.cff`](CITATION.cff). [`codemeta.json`](codemeta.json) carries
|
|
219
|
+
the same metadata in codemeta form, and [`paper.md`](paper.md) /
|
|
220
|
+
[`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.
|
|
8
|
-
| < 2.
|
|
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,138 @@ 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
|
|
31
|
-
| **
|
|
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 from a hash-pinned toolchain, verifies package metadata/version, installs the built wheel, smoke-tests the installed CLI, and publishes through PyPI Trusted Publishing (OIDC). PyPI serves a PEP 740 provenance bundle for 2.2.1 whose subject digest matches the published `sha256`. |
|
|
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. **No attestation is possible yet:** the npmjs.com trusted publisher is not registered, so the token fallback is the working mode and npm's `--provenance` cannot be honoured. Consumers can only pin `dist.integrity` until that is registered. See below. |
|
|
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
|
+
The two channels carry **different** artifacts and **different** verification
|
|
44
|
+
properties. This section states exactly what is verifiable today. It is
|
|
45
|
+
version-specific; re-check it rather than trusting it indefinitely.
|
|
46
|
+
|
|
47
|
+
| | PyPI `scientific-computing-system` | npm `scientific-computing-system` |
|
|
48
|
+
|---|---|---|
|
|
49
|
+
| Contents | the library (wheel + sdist) | `index.js`, `bin/scs.js`, `LICENSE`, `README.md`, `CHANGELOG.md`, `SECURITY.md` — **no Python** |
|
|
50
|
+
| Requires the other channel | no | yes; `scs` runs `python -m cds`, so the Python distribution must be installed. It resolves `python`/`python3`/`py` and does **not** look for a `cds` console script on `PATH` |
|
|
51
|
+
| Publish authentication | Trusted Publishing (OIDC) | OIDC trusted publishing implemented and default; token fallback exists |
|
|
52
|
+
| **PEP 740 provenance attestation** | **yes on 2.2.1** (verified; see below) | **none** — attestations endpoint returns 404 |
|
|
53
|
+
| **npm `dist.signatures`** | n/a | present — registry transport signature, **not** build provenance |
|
|
54
|
+
| **Content digest a consumer can pin** | `sha256` per file on the PyPI file page | `dist.integrity` (sha512) and `dist.shasum` (sha1) |
|
|
55
|
+
|
|
56
|
+
#### Three things that are easy to confuse
|
|
57
|
+
|
|
58
|
+
1. **A PEP 740 provenance attestation** is a Sigstore-signed statement binding a
|
|
59
|
+
file digest to the identity and workflow that published it. PyPI serves it
|
|
60
|
+
from `/integrity/<project>/<version>/<filename>/provenance`. It is the only
|
|
61
|
+
one of the three that attests *who built this*.
|
|
62
|
+
2. **npm's `dist.signatures`** is npm signing its own registry metadata for
|
|
63
|
+
transport integrity. It proves the metadata came from npm's key. It says
|
|
64
|
+
nothing about who built the tarball, and it is not a provenance attestation.
|
|
65
|
+
3. **A content digest** (`sha256` on PyPI, `dist.integrity`/`dist.shasum` on npm)
|
|
66
|
+
pins *which bytes* you get. Useful for integrity and for detecting a
|
|
67
|
+
substituted file; on its own it proves nothing about origin, because anyone
|
|
68
|
+
who substitutes a file also substitutes its digest.
|
|
69
|
+
|
|
70
|
+
#### What is published today, and how to check it
|
|
71
|
+
|
|
72
|
+
Verified against the live registries for **PyPI 2.2.1**:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
# PEP 740 attestation exists (HTTP 200). Note the per-FILE path; a bare
|
|
76
|
+
# /integrity/<project>/<version>/ directory is not an endpoint and 404s.
|
|
77
|
+
curl -sS -H "Accept: application/vnd.pypi.integrity.v1+json" \
|
|
78
|
+
https://pypi.org/integrity/scientific-computing-system/2.2.1/scientific_computing_system-2.2.1-py3-none-any.whl/provenance
|
|
79
|
+
|
|
80
|
+
# The digest PyPI publishes for that file, to compare against the attestation
|
|
81
|
+
# subject (predicateType https://docs.pypi.org/attestations/publish/v1):
|
|
82
|
+
curl -sS https://pypi.org/pypi/scientific-computing-system/2.2.1/json | python -c \
|
|
83
|
+
"import json,sys; [print(f['filename'], f['digests']['sha256']) for f in json.load(sys.stdin)['urls']]"
|
|
84
|
+
|
|
85
|
+
# npm: no attestation; there IS a transport signature and an integrity digest.
|
|
86
|
+
curl -sS -o /dev/null -w '%{http_code}\n' \
|
|
87
|
+
https://registry.npmjs.org/-/npm/v1/attestations/scientific-computing-system@2.2.1 # -> 404
|
|
88
|
+
npm view scientific-computing-system@2.2.1 dist.integrity dist.shasum
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
The published PyPI 2.2.1 digests, useful for pinning:
|
|
92
|
+
|
|
93
|
+
| File | sha256 |
|
|
94
|
+
|---|---|
|
|
95
|
+
| `scientific_computing_system-2.2.1-py3-none-any.whl` | `b14b89478fdc8b11482ffd556bb6eb59c6b21887f2a09418edec7029d4569bb9` |
|
|
96
|
+
| `scientific_computing_system-2.2.1.tar.gz` | `6ba4ad4c2ebb6bef86356bcbcd251e12978737945e58d9e75b9c68860efa77f6` |
|
|
97
|
+
|
|
98
|
+
Both were confirmed to equal the `subject` digest inside their attestation
|
|
99
|
+
bundles, so the attested bytes and the published bytes are the same bytes.
|
|
100
|
+
|
|
101
|
+
#### Reproducible builds: what is and is not claimed
|
|
102
|
+
|
|
103
|
+
The build toolchain is hash-pinned (`requirements-build.lock`, installed with
|
|
104
|
+
`--require-hashes --only-binary=:all:`) and the release workflow runs
|
|
105
|
+
`python -m build --no-isolation` on that lock.
|
|
106
|
+
|
|
107
|
+
Two consecutive builds of the same commit with the same pinned backend produced
|
|
108
|
+
**byte-identical** wheel and sdist (sha256 `c7734fb5…` and `daa7dca2…`).
|
|
109
|
+
|
|
110
|
+
Those digests **do not** match the published ones, because that check ran on a
|
|
111
|
+
different platform with a locally installed backend rather than the release's
|
|
112
|
+
hash-locked Linux toolchain. So the honest statement is: *the build is
|
|
113
|
+
deterministic for a fixed toolchain, and this repository does not currently
|
|
114
|
+
claim that the published artifacts are bit-for-bit reproducible from source.*
|
|
115
|
+
Treat the published digests above as the pin to use, not a rebuild target.
|
|
116
|
+
|
|
117
|
+
#### When provenance will appear
|
|
118
|
+
|
|
119
|
+
The OIDC plumbing is implemented on both sides; the registries-side trusted
|
|
120
|
+
publisher records are **not yet in place**, so an npm release cannot carry an
|
|
121
|
+
attestation yet:
|
|
122
|
+
|
|
123
|
+
- **PyPI** — Trusted Publisher: owner `Furox-Art`, repository
|
|
124
|
+
`scientific-computing-system`, workflow `release.yml`, environment `pypi`.
|
|
125
|
+
Already exercised: 2.2.1 was published through it and is attested.
|
|
126
|
+
- **npm** — Trusted Publisher: owner `Furox-Art`, repository
|
|
127
|
+
`scientific-computing-system`, workflow `npm-publish.yml`, environment `npm`.
|
|
128
|
+
**Pending registration.** Until it exists, the default OIDC path cannot
|
|
129
|
+
complete a publish, and the token fallback — which cannot mint a Sigstore
|
|
130
|
+
identity — is the only working mode. That is why the published npm artifacts
|
|
131
|
+
have no attestation.
|
|
132
|
+
|
|
133
|
+
Register it under **Settings → Trusted Publisher → GitHub Actions** and enable
|
|
134
|
+
the **`npm publish`** allowed action. That last field is not optional here: npm's
|
|
135
|
+
current UI allows `npm stage publish` by default on new configurations and makes
|
|
136
|
+
direct `npm publish` opt-in, while this repository's workflow publishes
|
|
137
|
+
directly. A publisher registered without it still fails, with a permission error
|
|
138
|
+
rather than a 404.
|
|
139
|
+
|
|
140
|
+
**A missing registration looks like a missing version.** npm will not disclose
|
|
141
|
+
whether a package exists to an unauthenticated caller, so an unrecognised
|
|
142
|
+
trusted publisher produces the same `E404` as an unpublished version:
|
|
143
|
+
|
|
144
|
+
```
|
|
145
|
+
npm error 404 The requested resource 'scientific-computing-system@2.2.2' could
|
|
146
|
+
not be found or you do not have permission to access it.
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Do not bump the version in response to that line. A bad or missing *token* fails
|
|
150
|
+
differently — `401`, or `ENEEDAUTH` — so `E404` on a PUT for a package that is
|
|
151
|
+
known to exist means the registration, not the version.
|
|
152
|
+
|
|
153
|
+
**Practical consequence:** for anything security-sensitive, install from PyPI and
|
|
154
|
+
check the PEP 740 bundle against the digests PyPI publishes. Do not rely on the
|
|
155
|
+
npm channel for supply-chain assurance today; treat its `dist.integrity` as an
|
|
156
|
+
integrity pin only.
|
|
157
|
+
|
|
38
158
|
### Optional Backend Boundary
|
|
39
159
|
|
|
40
160
|
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 +179,9 @@ In particular, `sympy_verify_identity()` passes caller-provided symbolic strings
|
|
|
59
179
|
|
|
60
180
|
## Security Best Practices for Users
|
|
61
181
|
|
|
62
|
-
1. **Pin the package version** in reproducible environments, for example `scientific-computing-system==
|
|
182
|
+
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
183
|
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.**
|
|
184
|
+
3. **Verify provenance for high-assurance use.** For PyPI, fetch the PEP 740 bundle from `/integrity/<project>/<version>/<filename>/provenance` and confirm its `subject` digest equals the `sha256` PyPI publishes for that file. There is currently **no** attestation for the npm package; its `dist.integrity` is an integrity pin, not provenance. See [Distribution channels and provenance](#distribution-channels-and-provenance).
|
|
65
185
|
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
186
|
5. **Keep the environment current.** Review dependency updates and run vulnerability auditing against the exact environment deployed.
|
|
67
187
|
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.
|
|
3
|
+
"version": "2.2.2",
|
|
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": {
|