phaseprobe 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- phaseprobe-0.2.0/.github/ISSUE_TEMPLATE/bug_report.yml +35 -0
- phaseprobe-0.2.0/.github/ISSUE_TEMPLATE/config.yml +5 -0
- phaseprobe-0.2.0/.github/ISSUE_TEMPLATE/feature_request.yml +23 -0
- phaseprobe-0.2.0/.github/ISSUE_TEMPLATE/good_first_accessibility.yml +17 -0
- phaseprobe-0.2.0/.github/ISSUE_TEMPLATE/good_first_pendulum.yml +17 -0
- phaseprobe-0.2.0/.github/ISSUE_TEMPLATE/good_first_schema.yml +17 -0
- phaseprobe-0.2.0/.github/PULL_REQUEST_TEMPLATE.md +23 -0
- phaseprobe-0.2.0/.github/workflows/ci.yml +82 -0
- phaseprobe-0.2.0/.github/workflows/release.yml +35 -0
- phaseprobe-0.2.0/.gitignore +15 -0
- phaseprobe-0.2.0/AGENTS.md +11 -0
- phaseprobe-0.2.0/ARCHITECTURE.md +83 -0
- phaseprobe-0.2.0/CHANGELOG.md +30 -0
- phaseprobe-0.2.0/CITATION.cff +17 -0
- phaseprobe-0.2.0/CODE_OF_CONDUCT.md +9 -0
- phaseprobe-0.2.0/CONTRIBUTING.md +47 -0
- phaseprobe-0.2.0/LICENSE +201 -0
- phaseprobe-0.2.0/LIMITATIONS.md +35 -0
- phaseprobe-0.2.0/PKG-INFO +275 -0
- phaseprobe-0.2.0/PRIOR_ART.md +36 -0
- phaseprobe-0.2.0/README.md +237 -0
- phaseprobe-0.2.0/ROADMAP.md +20 -0
- phaseprobe-0.2.0/SCIENTIFIC_METHODS.md +80 -0
- phaseprobe-0.2.0/SECURITY.md +31 -0
- phaseprobe-0.2.0/assets/demo-session.txt +35 -0
- phaseprobe-0.2.0/assets/demo-static.png +0 -0
- phaseprobe-0.2.0/assets/demo.gif +0 -0
- phaseprobe-0.2.0/assets/scipy-demo-session.txt +46 -0
- phaseprobe-0.2.0/assets/scipy-demo-static.png +0 -0
- phaseprobe-0.2.0/assets/scipy-demo.gif +0 -0
- phaseprobe-0.2.0/assets/social-preview.jpg +0 -0
- phaseprobe-0.2.0/docs/SCIPY_SOLVE_IVP_AUDIT.md +92 -0
- phaseprobe-0.2.0/docs/upstream/SCIPY_INTEGRATION_PROPOSAL.md +109 -0
- phaseprobe-0.2.0/examples/README.md +68 -0
- phaseprobe-0.2.0/examples/configs/logistic-negative.json +27 -0
- phaseprobe-0.2.0/examples/configs/logistic-scan.json +27 -0
- phaseprobe-0.2.0/examples/configs/lorenz-negative.json +30 -0
- phaseprobe-0.2.0/examples/configs/lorenz-perturb.json +30 -0
- phaseprobe-0.2.0/examples/configs/predator-prey-check.json +25 -0
- phaseprobe-0.2.0/examples/configs/predator-prey-negative.json +25 -0
- phaseprobe-0.2.0/examples/configs/toggle-negative.json +30 -0
- phaseprobe-0.2.0/examples/configs/toggle-perturb.json +31 -0
- phaseprobe-0.2.0/examples/scipy/lorenz-negative.json +54 -0
- phaseprobe-0.2.0/examples/scipy/lorenz.json +54 -0
- phaseprobe-0.2.0/examples/scipy/predator-prey-coarse.json +45 -0
- phaseprobe-0.2.0/examples/scipy/predator-prey.json +45 -0
- phaseprobe-0.2.0/examples/scipy/report.html +116 -0
- phaseprobe-0.2.0/pyproject.toml +124 -0
- phaseprobe-0.2.0/scripts/audit_package.py +92 -0
- phaseprobe-0.2.0/scripts/check_links.py +58 -0
- phaseprobe-0.2.0/scripts/generate_demo.py +180 -0
- phaseprobe-0.2.0/scripts/generate_scipy_demo.py +206 -0
- phaseprobe-0.2.0/scripts/hygiene.py +144 -0
- phaseprobe-0.2.0/src/phaseprobe/__init__.py +30 -0
- phaseprobe-0.2.0/src/phaseprobe/__main__.py +5 -0
- phaseprobe-0.2.0/src/phaseprobe/adapters/__init__.py +4 -0
- phaseprobe-0.2.0/src/phaseprobe/adapters/loader.py +51 -0
- phaseprobe-0.2.0/src/phaseprobe/adapters/scipy.py +539 -0
- phaseprobe-0.2.0/src/phaseprobe/api.py +64 -0
- phaseprobe-0.2.0/src/phaseprobe/artifacts.py +124 -0
- phaseprobe-0.2.0/src/phaseprobe/cli.py +242 -0
- phaseprobe-0.2.0/src/phaseprobe/config.py +132 -0
- phaseprobe-0.2.0/src/phaseprobe/data/__init__.py +1 -0
- phaseprobe-0.2.0/src/phaseprobe/data/examples/__init__.py +1 -0
- phaseprobe-0.2.0/src/phaseprobe/data/examples/logistic-negative.json +27 -0
- phaseprobe-0.2.0/src/phaseprobe/data/examples/logistic-scan.json +27 -0
- phaseprobe-0.2.0/src/phaseprobe/data/examples/lorenz-negative.json +30 -0
- phaseprobe-0.2.0/src/phaseprobe/data/examples/lorenz-perturb.json +30 -0
- phaseprobe-0.2.0/src/phaseprobe/data/examples/predator-prey-check.json +25 -0
- phaseprobe-0.2.0/src/phaseprobe/data/examples/predator-prey-negative.json +25 -0
- phaseprobe-0.2.0/src/phaseprobe/data/examples/toggle-negative.json +30 -0
- phaseprobe-0.2.0/src/phaseprobe/data/examples/toggle-perturb.json +31 -0
- phaseprobe-0.2.0/src/phaseprobe/engine.py +810 -0
- phaseprobe-0.2.0/src/phaseprobe/errors.py +31 -0
- phaseprobe-0.2.0/src/phaseprobe/examples/__init__.py +1 -0
- phaseprobe-0.2.0/src/phaseprobe/examples/scipy_models.py +151 -0
- phaseprobe-0.2.0/src/phaseprobe/generate.py +72 -0
- phaseprobe-0.2.0/src/phaseprobe/models/__init__.py +36 -0
- phaseprobe-0.2.0/src/phaseprobe/models/_common.py +56 -0
- phaseprobe-0.2.0/src/phaseprobe/models/logistic.py +63 -0
- phaseprobe-0.2.0/src/phaseprobe/models/lorenz.py +64 -0
- phaseprobe-0.2.0/src/phaseprobe/models/predator_prey.py +86 -0
- phaseprobe-0.2.0/src/phaseprobe/models/toggle.py +73 -0
- phaseprobe-0.2.0/src/phaseprobe/replay.py +496 -0
- phaseprobe-0.2.0/src/phaseprobe/reporting.py +173 -0
- phaseprobe-0.2.0/src/phaseprobe/types.py +131 -0
- phaseprobe-0.2.0/tests/conftest.py +15 -0
- phaseprobe-0.2.0/tests/generated/fixtures/logistic_map-replay.json +100 -0
- phaseprobe-0.2.0/tests/generated/fixtures/lorenz_scipy-replay.json +30407 -0
- phaseprobe-0.2.0/tests/generated/fixtures/predator_prey_scipy-replay.json +15849 -0
- phaseprobe-0.2.0/tests/generated/test_logistic_map_transition.py +13 -0
- phaseprobe-0.2.0/tests/generated/test_lorenz_scipy_transition.py +19 -0
- phaseprobe-0.2.0/tests/generated/test_predator_prey_scipy_transition.py +19 -0
- phaseprobe-0.2.0/tests/test_artifacts_replay.py +86 -0
- phaseprobe-0.2.0/tests/test_cli.py +165 -0
- phaseprobe-0.2.0/tests/test_config.py +69 -0
- phaseprobe-0.2.0/tests/test_engine.py +124 -0
- phaseprobe-0.2.0/tests/test_optional_dependency.py +167 -0
- phaseprobe-0.2.0/tests/test_scipy_adapter.py +502 -0
- phaseprobe-0.2.0/uv.lock +871 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
name: Bug report
|
|
2
|
+
description: Report a reproducible PhaseProbe defect.
|
|
3
|
+
title: "[Bug]: "
|
|
4
|
+
labels: ["bug"]
|
|
5
|
+
body:
|
|
6
|
+
- type: textarea
|
|
7
|
+
attributes:
|
|
8
|
+
label: Result first
|
|
9
|
+
description: What happened, and what should have happened?
|
|
10
|
+
validations:
|
|
11
|
+
required: true
|
|
12
|
+
- type: textarea
|
|
13
|
+
attributes:
|
|
14
|
+
label: Minimal reproduction
|
|
15
|
+
description: Include the command and a minimal non-sensitive configuration.
|
|
16
|
+
validations:
|
|
17
|
+
required: true
|
|
18
|
+
- type: input
|
|
19
|
+
attributes:
|
|
20
|
+
label: PhaseProbe and Python versions
|
|
21
|
+
placeholder: "phaseprobe 0.1.0; Python 3.12.13"
|
|
22
|
+
validations:
|
|
23
|
+
required: true
|
|
24
|
+
- type: dropdown
|
|
25
|
+
attributes:
|
|
26
|
+
label: Operating system
|
|
27
|
+
options: [Windows, Linux, Other]
|
|
28
|
+
validations:
|
|
29
|
+
required: true
|
|
30
|
+
- type: checkboxes
|
|
31
|
+
attributes:
|
|
32
|
+
label: Safety
|
|
33
|
+
options:
|
|
34
|
+
- label: I removed credentials, private model data, and personal information.
|
|
35
|
+
required: true
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
name: Feature request
|
|
2
|
+
description: Propose a focused simulation-testing improvement.
|
|
3
|
+
title: "[Feature]: "
|
|
4
|
+
labels: ["enhancement"]
|
|
5
|
+
body:
|
|
6
|
+
- type: textarea
|
|
7
|
+
attributes:
|
|
8
|
+
label: Testing job
|
|
9
|
+
description: Which transition, replay, evidence, or regression-testing job is missing?
|
|
10
|
+
validations:
|
|
11
|
+
required: true
|
|
12
|
+
- type: textarea
|
|
13
|
+
attributes:
|
|
14
|
+
label: Proposed evidence
|
|
15
|
+
description: Describe positive cases, negative controls, scientific terminology, and validation.
|
|
16
|
+
validations:
|
|
17
|
+
required: true
|
|
18
|
+
- type: textarea
|
|
19
|
+
attributes:
|
|
20
|
+
label: Alternatives and prior art
|
|
21
|
+
description: Link relevant tools or primary papers and explain the remaining gap.
|
|
22
|
+
validations:
|
|
23
|
+
required: true
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
name: "Good first issue: report accessibility"
|
|
2
|
+
description: Improve keyboard, contrast, and semantic HTML evidence without external assets.
|
|
3
|
+
title: "[Good first issue] Improve offline report accessibility"
|
|
4
|
+
labels: ["good first issue", "documentation"]
|
|
5
|
+
body:
|
|
6
|
+
- type: markdown
|
|
7
|
+
attributes:
|
|
8
|
+
value: |
|
|
9
|
+
Audit the self-contained HTML report for semantic headings, table captions, contrast, print layout, and screen-reader labels. Add tests and before/after screenshots. Keep the report script-free, offline, and free of CDN resources.
|
|
10
|
+
- type: checkboxes
|
|
11
|
+
attributes:
|
|
12
|
+
label: Contributor checklist
|
|
13
|
+
options:
|
|
14
|
+
- label: I will document the audit method and measured changes.
|
|
15
|
+
required: true
|
|
16
|
+
- label: I will preserve HTML escaping and offline operation.
|
|
17
|
+
required: true
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
name: "Good first issue: damped pendulum adapter"
|
|
2
|
+
description: Add a small deterministic adapter with positive/negative controls.
|
|
3
|
+
title: "[Good first issue] Add a damped-pendulum adapter"
|
|
4
|
+
labels: ["good first issue", "example"]
|
|
5
|
+
body:
|
|
6
|
+
- type: markdown
|
|
7
|
+
attributes:
|
|
8
|
+
value: |
|
|
9
|
+
Implement a typed damped-pendulum adapter, an energy-decay invariant, a positive transition/check, a negative control, a primary citation, deterministic tests, replay coverage, and documentation. Do not label numerical damping as physical evidence without a solver-refinement comparison.
|
|
10
|
+
- type: checkboxes
|
|
11
|
+
attributes:
|
|
12
|
+
label: Contributor checklist
|
|
13
|
+
options:
|
|
14
|
+
- label: I will add configuration, tolerances, invalid-state policy, and bounded trace retention.
|
|
15
|
+
required: true
|
|
16
|
+
- label: I will add positive, negative-control, replay, and generated-test coverage.
|
|
17
|
+
required: true
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
name: "Good first issue: JSON Schema fixtures"
|
|
2
|
+
description: Publish schema documents and compatibility fixtures for config/replay/report JSON.
|
|
3
|
+
title: "[Good first issue] Add JSON Schema validation fixtures"
|
|
4
|
+
labels: ["good first issue", "tooling"]
|
|
5
|
+
body:
|
|
6
|
+
- type: markdown
|
|
7
|
+
attributes:
|
|
8
|
+
value: |
|
|
9
|
+
Add repository-owned JSON Schema documents for configuration, replay, and report version 1.0. Include valid and invalid fixtures, cross-platform tests, migration notes, and no new runtime dependency.
|
|
10
|
+
- type: checkboxes
|
|
11
|
+
attributes:
|
|
12
|
+
label: Contributor checklist
|
|
13
|
+
options:
|
|
14
|
+
- label: I will preserve existing version and integrity semantics.
|
|
15
|
+
required: true
|
|
16
|
+
- label: I will add actionable failure diagnostics and tests.
|
|
17
|
+
required: true
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
## Outcome
|
|
2
|
+
|
|
3
|
+
Describe the user-visible testing outcome first.
|
|
4
|
+
|
|
5
|
+
## Scientific interpretation
|
|
6
|
+
|
|
7
|
+
- What does the evidence establish?
|
|
8
|
+
- What does it not establish?
|
|
9
|
+
- Which primary sources support model or algorithm claims?
|
|
10
|
+
|
|
11
|
+
## Validation
|
|
12
|
+
|
|
13
|
+
- [ ] `python -m ruff format --check .`
|
|
14
|
+
- [ ] `python -m ruff check .`
|
|
15
|
+
- [ ] `python -m mypy src tests`
|
|
16
|
+
- [ ] `python -m pytest --cov=phaseprobe`
|
|
17
|
+
- [ ] Positive case and negative control
|
|
18
|
+
- [ ] Replay and generated pytest execution
|
|
19
|
+
- [ ] Package build and clean packed-install smoke
|
|
20
|
+
- [ ] `python scripts/check_links.py`
|
|
21
|
+
- [ ] `python scripts/hygiene.py`
|
|
22
|
+
|
|
23
|
+
List exact commands and measured results. Do not include private paths, credentials, PDFs, or fabricated evidence.
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main, "release/**"]
|
|
6
|
+
pull_request:
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
core-only:
|
|
14
|
+
name: core / ${{ matrix.os }} / Python ${{ matrix.python }}
|
|
15
|
+
runs-on: ${{ matrix.os }}
|
|
16
|
+
strategy:
|
|
17
|
+
fail-fast: false
|
|
18
|
+
matrix:
|
|
19
|
+
os: [ubuntu-latest, windows-latest]
|
|
20
|
+
python: ["3.10", "3.12", "3.14"]
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@v4
|
|
23
|
+
- uses: actions/setup-python@v5
|
|
24
|
+
with:
|
|
25
|
+
python-version: ${{ matrix.python }}
|
|
26
|
+
cache: pip
|
|
27
|
+
- run: python -m pip install --upgrade pip
|
|
28
|
+
- run: python -m pip install -e ".[dev]"
|
|
29
|
+
- run: python -m pytest -m "not scipy"
|
|
30
|
+
- run: python -m phaseprobe --version
|
|
31
|
+
- run: python -m phaseprobe scan --example logistic-negative
|
|
32
|
+
|
|
33
|
+
scipy-extra:
|
|
34
|
+
name: scipy / ${{ matrix.os }} / Python ${{ matrix.python }}
|
|
35
|
+
runs-on: ${{ matrix.os }}
|
|
36
|
+
strategy:
|
|
37
|
+
fail-fast: false
|
|
38
|
+
matrix:
|
|
39
|
+
os: [ubuntu-latest, windows-latest]
|
|
40
|
+
python: ["3.10", "3.12", "3.14"]
|
|
41
|
+
steps:
|
|
42
|
+
- uses: actions/checkout@v4
|
|
43
|
+
- uses: actions/setup-python@v5
|
|
44
|
+
with:
|
|
45
|
+
python-version: ${{ matrix.python }}
|
|
46
|
+
cache: pip
|
|
47
|
+
- run: python -m pip install --upgrade pip
|
|
48
|
+
- run: python -m pip install -e ".[dev,scipy]"
|
|
49
|
+
- run: python -m ruff format --check .
|
|
50
|
+
- run: python -m ruff check .
|
|
51
|
+
- run: python -m mypy src tests
|
|
52
|
+
- run: python -m pytest --cov=phaseprobe --cov-report=term
|
|
53
|
+
- run: python -m phaseprobe perturb --config examples/scipy/lorenz-negative.json
|
|
54
|
+
- run: python -m phaseprobe check --config examples/scipy/predator-prey.json
|
|
55
|
+
|
|
56
|
+
package-and-hygiene:
|
|
57
|
+
runs-on: ubuntu-latest
|
|
58
|
+
steps:
|
|
59
|
+
- uses: actions/checkout@v4
|
|
60
|
+
- uses: actions/setup-python@v5
|
|
61
|
+
with:
|
|
62
|
+
python-version: "3.12"
|
|
63
|
+
cache: pip
|
|
64
|
+
- run: python -m pip install --upgrade pip build twine
|
|
65
|
+
- run: python -m build
|
|
66
|
+
- run: python -m twine check dist/*
|
|
67
|
+
- run: python scripts/audit_package.py
|
|
68
|
+
- run: python -m venv .cache/packed-smoke
|
|
69
|
+
- run: .cache/packed-smoke/bin/python -m pip install dist/*.whl
|
|
70
|
+
- run: .cache/packed-smoke/bin/python -m phaseprobe --version
|
|
71
|
+
- run: .cache/packed-smoke/bin/python -m phaseprobe scan --example logistic-negative
|
|
72
|
+
- run: .cache/packed-smoke/bin/python -c "import importlib.util; assert importlib.util.find_spec('numpy') is None; assert importlib.util.find_spec('scipy') is None"
|
|
73
|
+
- run: python -m venv .cache/scipy-smoke
|
|
74
|
+
- run: .cache/scipy-smoke/bin/python -m pip install "$(find dist -name '*.whl')[scipy]"
|
|
75
|
+
- run: .cache/scipy-smoke/bin/python -m phaseprobe check --config examples/scipy/predator-prey.json
|
|
76
|
+
- run: python scripts/check_links.py
|
|
77
|
+
- run: python scripts/hygiene.py
|
|
78
|
+
- uses: actions/upload-artifact@v4
|
|
79
|
+
with:
|
|
80
|
+
name: phaseprobe-packages
|
|
81
|
+
path: dist/*
|
|
82
|
+
if-no-files-found: error
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
name: Tagged release validation
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags: ["v*"]
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: read
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
validate-tagged-package:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
|
+
- uses: actions/setup-python@v5
|
|
16
|
+
with:
|
|
17
|
+
python-version: "3.12"
|
|
18
|
+
cache: pip
|
|
19
|
+
- run: python -m pip install --upgrade pip build twine
|
|
20
|
+
- run: python -m build
|
|
21
|
+
- run: python -m twine check dist/*
|
|
22
|
+
- run: python scripts/audit_package.py
|
|
23
|
+
- run: python -m venv .cache/tag-core-smoke
|
|
24
|
+
- run: .cache/tag-core-smoke/bin/python -m pip install dist/*.whl
|
|
25
|
+
- run: .cache/tag-core-smoke/bin/python -m phaseprobe --version
|
|
26
|
+
- run: .cache/tag-core-smoke/bin/python -m phaseprobe scan --example logistic
|
|
27
|
+
- run: python -m venv .cache/tag-scipy-smoke
|
|
28
|
+
- run: .cache/tag-scipy-smoke/bin/python -m pip install "$(find dist -name '*.whl')[scipy]"
|
|
29
|
+
- run: .cache/tag-scipy-smoke/bin/python -m phaseprobe check --config examples/scipy/predator-prey.json
|
|
30
|
+
- run: python scripts/hygiene.py
|
|
31
|
+
- uses: actions/upload-artifact@v4
|
|
32
|
+
with:
|
|
33
|
+
name: phaseprobe-${{ github.ref_name }}
|
|
34
|
+
path: dist/*
|
|
35
|
+
if-no-files-found: error
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# PhaseProbe contributor instructions
|
|
2
|
+
|
|
3
|
+
- Work exclusively inside the PhaseProbe repository root; never inspect or modify neighboring projects or workspaces.
|
|
4
|
+
- Use the public author identity `Ali` only: no surname, personal email, workstation paths, credentials, or provider configuration in tracked files.
|
|
5
|
+
- Keep scientific language precise: distinguish finite-time trajectory divergence, sensitive dependence, numerical instability, invariant violation, qualitative regime change, bifurcation evidence, stochastic variation, invalid integration, and solver failure. Never claim exact or formal results beyond the implemented evidence.
|
|
6
|
+
- Support Windows and Linux on Python 3.10+ with no runtime LLM, API key, GPU, Docker, account, telemetry, or hosted service.
|
|
7
|
+
- Keep copyrighted books, PDFs, extracted text, research notes, caches, environments, tools, build output, and run output out of Git.
|
|
8
|
+
- Required validation: `python -m ruff format --check .`, `python -m ruff check .`, `python -m mypy src tests`, `python -m pytest`, `python -m build`, packed-install smoke test, quick start, examples, replay, generated-test execution, privacy/secret/large-file scans, and clean Git status.
|
|
9
|
+
- Do not fabricate tests, performance, scientific evidence, benchmark results, users, or adoption claims.
|
|
10
|
+
- Do not publish to PyPI without separate authorization.
|
|
11
|
+
- Release only after all local gates pass; then use the authenticated `aliengineering-byte` GitHub account, pass CI, create the intended new annotated semantic-version tag and release, and verify a fresh unauthenticated clone. Never rewrite a published tag.
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Architecture
|
|
2
|
+
|
|
3
|
+
PhaseProbe separates simulation semantics from search, evidence, and test materialization.
|
|
4
|
+
|
|
5
|
+
```text
|
|
6
|
+
JSON config / built-in example
|
|
7
|
+
|
|
|
8
|
+
v
|
|
9
|
+
typed adapter ----> fixed step OR whole trajectory
|
|
10
|
+
| |
|
|
11
|
+
v v
|
|
12
|
+
bounded engine ----> finite validation ----> capped trace + SHA-256 integrity
|
|
13
|
+
| |
|
|
14
|
+
| +---- scan / perturb / check policy
|
|
15
|
+
v
|
|
16
|
+
outcome ----> run artifacts ----> replay verification ----> fixed pytest template
|
|
17
|
+
|
|
|
18
|
+
+---- terminal / JSON / self-contained HTML
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Modules
|
|
22
|
+
|
|
23
|
+
- `config.py` emits schema `2.0`, keeps schema `1.0` readable, validates explicit Python adapter
|
|
24
|
+
references without importing them, loads packaged examples, and emits canonical JSON.
|
|
25
|
+
- `types.py` defines the step-level `ModelAdapter`, trajectory-level `TrajectoryAdapter`, state
|
|
26
|
+
shape, trace point/trace, replay mode, and invariant result.
|
|
27
|
+
- `models/` contains four independent reference adapters. They are examples, not engine special cases.
|
|
28
|
+
- `adapters/scipy.py` optionally imports NumPy/SciPy and wraps only public `solve_ivp` behavior.
|
|
29
|
+
- `adapters/loader.py` imports a user-selected dotted module and calls its named factory only at
|
|
30
|
+
execution time.
|
|
31
|
+
- `engine.py` dispatches step versus trajectory execution and owns shared NaN/Inf/hard-limit
|
|
32
|
+
checks, bounded retention, scanning, perturbation, bracket refinement, repeatability
|
|
33
|
+
confirmation, and CI policy evaluation.
|
|
34
|
+
- `artifacts.py` creates one finite run directory and hashes each evidence file.
|
|
35
|
+
- `replay.py` reads v1 exact fixtures and emits v2 fixtures with explicit `exact` or `tolerance`
|
|
36
|
+
comparison, always after SHA-256 integrity validation.
|
|
37
|
+
- `generate.py` uses a fixed code template and sanitized names. It never evaluates configuration text.
|
|
38
|
+
- `reporting.py` renders terminal, JSON, and offline HTML with explicit limitations.
|
|
39
|
+
- `cli.py` maps the six public commands to stable exit codes.
|
|
40
|
+
|
|
41
|
+
## Adapter design and dispatch
|
|
42
|
+
|
|
43
|
+
The engine deliberately does not require NumPy. A state is a tuple of finite floats; this keeps
|
|
44
|
+
serialization and perturbation explicit. Existing adapters implement `ModelAdapter.step`, and
|
|
45
|
+
their behavior is unchanged. Whole-trajectory solvers implement `TrajectoryAdapter.simulate` and
|
|
46
|
+
return `SimulationTrace`; the engine never manufactures a fake fixed-step loop around them.
|
|
47
|
+
Observations are scalar mappings and cannot carry arbitrary executable objects.
|
|
48
|
+
|
|
49
|
+
Resolution order is explicit: a Python API caller may supply an adapter instance; otherwise a
|
|
50
|
+
built-in model name resolves from the immutable registry; otherwise a schema-v2 `adapter` section
|
|
51
|
+
may name an absolute dotted module and factory. Loading that factory executes trusted user code.
|
|
52
|
+
Configuration validation alone checks syntax and does not import the module.
|
|
53
|
+
|
|
54
|
+
An adapter supplies scientific judgment: initial conditions, state advance, observables, qualitative classification, and invariants. The engine supplies operational judgment: search bounds, retention, failure containment, hashes, artifacts, and policy exits.
|
|
55
|
+
|
|
56
|
+
## Determinism and replay boundary
|
|
57
|
+
|
|
58
|
+
PhaseProbe controls seeds, canonical configuration serialization, fixed command order, search
|
|
59
|
+
grids, state perturbations, trace retention, and artifact hashing. An external adapter remains
|
|
60
|
+
responsible for solver settings, thread behavior, native library versions, and hardware-sensitive
|
|
61
|
+
arithmetic.
|
|
62
|
+
|
|
63
|
+
Step adapters default to exact classification/model-identity/trace-hash replay. Adaptive SciPy
|
|
64
|
+
adapters require tolerance replay: the fixture carries declared state/observable/invariant/grid/
|
|
65
|
+
endpoint/event tolerances and expected solver success. The original trace hash remains as artifact
|
|
66
|
+
integrity evidence but is not required to match numerically across environments.
|
|
67
|
+
|
|
68
|
+
## Artifact safety
|
|
69
|
+
|
|
70
|
+
Trace points are capped per series. Run IDs combine UTC time and an evidence digest. Replay fixtures carry a schema version and SHA-256 over every unsigned field. Generated tests copy a validated fixture into `tests/generated/fixtures/` and contain only a sanitized identifier plus a fixed relative path.
|
|
71
|
+
|
|
72
|
+
## Extension checklist
|
|
73
|
+
|
|
74
|
+
1. Give the adapter a stable explicit `identity` version and serialize configuration separately
|
|
75
|
+
from callable code.
|
|
76
|
+
2. Make `initial_state` deterministic for the declared seed.
|
|
77
|
+
3. Return the same state dimension after every step.
|
|
78
|
+
4. Define classifier thresholds in configuration tolerances.
|
|
79
|
+
5. Distinguish mathematical invariants from diagnostic bounds in invariant details.
|
|
80
|
+
6. Select `exact` only where byte-identical retained values are justified; otherwise declare a
|
|
81
|
+
complete tolerance policy.
|
|
82
|
+
7. Add positive, negative-control, invalid-state, repeatability, and replay tests.
|
|
83
|
+
8. Cite a primary technical source for the model and document solver limitations.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes are documented here. PhaseProbe follows semantic versioning.
|
|
4
|
+
|
|
5
|
+
## 0.2.0 — 2026-08-02
|
|
6
|
+
|
|
7
|
+
- Added the backward-compatible `TrajectoryAdapter` protocol and shared engine dispatch; all v0.1
|
|
8
|
+
step adapters and examples continue unchanged.
|
|
9
|
+
- Added optional `phaseprobe[scipy]` support with a typed public `SolveIVPAdapter`, controlled
|
|
10
|
+
evaluation grids, scalar/vector tolerances, methods, maximum step, named events, observables,
|
|
11
|
+
classifiers, invariants, invalid-value checks, bounded retention, and solver/environment evidence.
|
|
12
|
+
- Added schema-v2 `exact` and `tolerance` replay while keeping schema-v1 exact fixtures readable.
|
|
13
|
+
Tolerance fixtures preserve state, observable, classifier, invariant threshold, grid, endpoint,
|
|
14
|
+
event, solver-success, version, and platform evidence without claiming byte-identical replay.
|
|
15
|
+
- Added genuine SciPy Lorenz finite-time divergence and predator–prey first-integral examples,
|
|
16
|
+
negative controls, refinement evidence, HTML evidence, and generated pytest fixtures.
|
|
17
|
+
- Added explicit safe-shape Python module/factory loading, core-without-SciPy tests, optional import
|
|
18
|
+
diagnostics, a Windows/Linux core/SciPy CI matrix, current SciPy audit, security/limitations docs,
|
|
19
|
+
demo assets, and an unposted upstream visibility proposal.
|
|
20
|
+
- Base installation remains dependency-free. NumPy and SciPy are optional; no PyPI publication was
|
|
21
|
+
performed.
|
|
22
|
+
|
|
23
|
+
## 0.1.0 — 2026-08-01
|
|
24
|
+
|
|
25
|
+
- Added `scan`, `perturb`, `check`, `replay`, `generate-test`, and `report` commands.
|
|
26
|
+
- Added typed adapters for logistic map, Lorenz, Lotka–Volterra predator–prey, and a mutually repressing genetic toggle.
|
|
27
|
+
- Added deterministic seeds, canonical configuration, fixed-step execution, invalid-integration diagnostics, capped trace retention, and exact trace hashes.
|
|
28
|
+
- Added transition brackets, bounded initial-state search, repeatability confirmation, replay fixtures with integrity hashes, and fixed-template pytest generation.
|
|
29
|
+
- Added terminal, versioned JSON, and self-contained offline HTML evidence.
|
|
30
|
+
- Added Windows/Linux CI, packaging and packed-install checks, documentation/hygiene gates, and repository-native demo assets.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
cff-version: 1.2.0
|
|
2
|
+
message: "If you use PhaseProbe, cite the software release."
|
|
3
|
+
title: "PhaseProbe"
|
|
4
|
+
type: software
|
|
5
|
+
authors:
|
|
6
|
+
- name: "Ali"
|
|
7
|
+
version: 0.2.0
|
|
8
|
+
date-released: 2026-08-02
|
|
9
|
+
url: "https://github.com/aliengineering-byte/phaseprobe"
|
|
10
|
+
repository-code: "https://github.com/aliengineering-byte/phaseprobe"
|
|
11
|
+
license: Apache-2.0
|
|
12
|
+
abstract: "PhaseProbe finds bounded qualitative simulation transitions and turns reproducible evidence into replay fixtures and pytest regressions."
|
|
13
|
+
keywords:
|
|
14
|
+
- simulation testing
|
|
15
|
+
- reproducibility
|
|
16
|
+
- dynamical systems
|
|
17
|
+
- regression testing
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Code of conduct
|
|
2
|
+
|
|
3
|
+
PhaseProbe contributors must make technical collaboration safe, respectful, and evidence-led.
|
|
4
|
+
|
|
5
|
+
Welcome people regardless of background or identity. Discuss ideas and code rather than personal characteristics. Give reproducible evidence, acknowledge uncertainty, accept correction, and avoid harassment, threats, sexualized conduct, discrimination, doxxing, or sustained disruption.
|
|
6
|
+
|
|
7
|
+
Maintainers may edit or remove contributions and restrict participation when behavior harms the community. Report conduct concerns privately through the repository’s security/contact path; do not include sensitive personal information in a public issue. Reports will be reviewed fairly and with as much confidentiality as practical.
|
|
8
|
+
|
|
9
|
+
Good-faith disagreement about scientific methods is welcome. Fabricated evidence, misrepresentation of certainty, or retaliation against someone raising a reproducibility concern is not.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Contributions are welcome when they preserve PhaseProbe’s narrow testing job and scientific language.
|
|
4
|
+
|
|
5
|
+
## Setup
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
python -m venv .venv
|
|
9
|
+
# Windows: .venv\Scripts\python -m pip install -e ".[dev]"
|
|
10
|
+
# Linux: .venv/bin/python -m pip install -e ".[dev]"
|
|
11
|
+
python -m ruff format --check .
|
|
12
|
+
python -m ruff check .
|
|
13
|
+
python -m mypy src tests
|
|
14
|
+
python -m pytest --cov=phaseprobe
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Install `.[dev,scipy]` to run the optional trajectory-adapter suite. Core-only jobs intentionally
|
|
18
|
+
install `.[dev]` and run tests marked `not scipy`; SciPy jobs run the full suite. The committed
|
|
19
|
+
`uv.lock` resolves the supported Python-dependent SciPy lines reproducibly.
|
|
20
|
+
|
|
21
|
+
Before a pull request, also run `python -m build`, `python -m twine check dist/*`,
|
|
22
|
+
`python scripts/audit_package.py`, install the base wheel and SciPy extra into separate clean
|
|
23
|
+
environments, execute both quick starts, run `python scripts/check_links.py`, and run
|
|
24
|
+
`python scripts/hygiene.py`.
|
|
25
|
+
|
|
26
|
+
## Scientific changes
|
|
27
|
+
|
|
28
|
+
New adapters or classifiers must include:
|
|
29
|
+
|
|
30
|
+
- equation or model definition and a primary technical citation;
|
|
31
|
+
- deterministic positive case and negative control;
|
|
32
|
+
- seed, solver/iteration settings, tolerances, burn-in, observation window, and invalid-state policy;
|
|
33
|
+
- an explanation of what the classifier establishes and what it does not;
|
|
34
|
+
- replay and generated-test coverage;
|
|
35
|
+
- solver-refinement or convergence evidence where numerical integration matters.
|
|
36
|
+
|
|
37
|
+
Trajectory adapters must serialize explicit configuration without callable source, select an
|
|
38
|
+
honest exact/tolerance replay mode, and test solver failure, invalid values, retention, and any
|
|
39
|
+
supported event behavior.
|
|
40
|
+
|
|
41
|
+
Do not call finite-time divergence a Lyapunov exponent, a numerical bracket an exact bifurcation point, or a bounded search result globally minimal.
|
|
42
|
+
|
|
43
|
+
## Pull requests
|
|
44
|
+
|
|
45
|
+
Keep changes focused, update documentation and `CHANGELOG.md`, and report exact validation commands. Never add copyrighted books, PDFs, extracted private text, credentials, personal email addresses, telemetry, runtime API/LLM/GPU/Docker requirements, or unsupported performance/adoption claims.
|
|
46
|
+
|
|
47
|
+
At least three starter tasks are available as structured good-first-issue templates: add a damped-pendulum adapter, add JSON Schema validation fixtures, and improve HTML-report accessibility.
|