spar-framework 0.1.1__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.
- spar_framework-0.1.1/LICENSE +9 -0
- spar_framework-0.1.1/PKG-INFO +323 -0
- spar_framework-0.1.1/README.md +299 -0
- spar_framework-0.1.1/pyproject.toml +43 -0
- spar_framework-0.1.1/setup.cfg +4 -0
- spar_framework-0.1.1/src/spar_domain_physics/__init__.py +35 -0
- spar_framework-0.1.1/src/spar_domain_physics/architecture_gaps.py +15 -0
- spar_framework-0.1.1/src/spar_domain_physics/ground_truth.py +15 -0
- spar_framework-0.1.1/src/spar_domain_physics/ground_truth_table.py +104 -0
- spar_framework-0.1.1/src/spar_domain_physics/layer_a.py +34 -0
- spar_framework-0.1.1/src/spar_domain_physics/layer_a_beta_checks.py +157 -0
- spar_framework-0.1.1/src/spar_domain_physics/layer_a_runtime_checks.py +45 -0
- spar_framework-0.1.1/src/spar_domain_physics/layer_b.py +24 -0
- spar_framework-0.1.1/src/spar_domain_physics/layer_b_admissibility.py +67 -0
- spar_framework-0.1.1/src/spar_domain_physics/layer_b_report_checks.py +40 -0
- spar_framework-0.1.1/src/spar_domain_physics/layer_c.py +22 -0
- spar_framework-0.1.1/src/spar_domain_physics/layer_c_advanced.py +47 -0
- spar_framework-0.1.1/src/spar_domain_physics/layer_c_foundation_helpers.py +85 -0
- spar_framework-0.1.1/src/spar_domain_physics/layer_c_foundations.py +70 -0
- spar_framework-0.1.1/src/spar_domain_physics/matcher.py +46 -0
- spar_framework-0.1.1/src/spar_domain_physics/registry_seed.py +77 -0
- spar_framework-0.1.1/src/spar_domain_physics/runtime.py +31 -0
- spar_framework-0.1.1/src/spar_domain_physics/slop_rules.py +28 -0
- spar_framework-0.1.1/src/spar_framework/__init__.py +32 -0
- spar_framework-0.1.1/src/spar_framework/engine.py +68 -0
- spar_framework-0.1.1/src/spar_framework/interfaces.py +48 -0
- spar_framework-0.1.1/src/spar_framework/registry.py +79 -0
- spar_framework-0.1.1/src/spar_framework/result_types.py +56 -0
- spar_framework-0.1.1/src/spar_framework/runtime_context.py +37 -0
- spar_framework-0.1.1/src/spar_framework/scoring.py +77 -0
- spar_framework-0.1.1/src/spar_framework.egg-info/PKG-INFO +323 -0
- spar_framework-0.1.1/src/spar_framework.egg-info/SOURCES.txt +34 -0
- spar_framework-0.1.1/src/spar_framework.egg-info/dependency_links.txt +1 -0
- spar_framework-0.1.1/src/spar_framework.egg-info/requires.txt +4 -0
- spar_framework-0.1.1/src/spar_framework.egg-info/top_level.txt +2 -0
- spar_framework-0.1.1/tests/test_registry.py +209 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
Flamehaven Sovereign License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Flamehaven.
|
|
4
|
+
|
|
5
|
+
This repository is distributed under the Flamehaven Sovereign License.
|
|
6
|
+
No rights are granted except as explicitly provided by the project owner.
|
|
7
|
+
|
|
8
|
+
For redistribution, commercial use, sublicensing, or derivative licensing,
|
|
9
|
+
obtain explicit written permission from Flamehaven.
|
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: spar-framework
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: Standalone deterministic admissibility-review framework
|
|
5
|
+
Author: Flamehaven
|
|
6
|
+
License-Expression: LicenseRef-Flamehaven-Sovereign
|
|
7
|
+
Project-URL: Homepage, https://github.com/flamehaven01/SPAR-Framework#readme
|
|
8
|
+
Project-URL: Repository, https://github.com/flamehaven01/SPAR-Framework
|
|
9
|
+
Project-URL: Issues, https://github.com/flamehaven01/SPAR-Framework/issues
|
|
10
|
+
Keywords: verification,governance,admissibility,review,physics
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Classifier: Topic :: Scientific/Engineering
|
|
16
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
17
|
+
Requires-Python: >=3.10
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
License-File: LICENSE
|
|
20
|
+
Provides-Extra: dev
|
|
21
|
+
Requires-Dist: pytest>=8.0; extra == "dev"
|
|
22
|
+
Requires-Dist: build>=1.2.0; extra == "dev"
|
|
23
|
+
Dynamic: license-file
|
|
24
|
+
|
|
25
|
+
# spar-framework
|
|
26
|
+
|
|
27
|
+
[](https://www.python.org/downloads/)
|
|
28
|
+
[](https://github.com/flamehaven01/SPAR-Framework/actions/workflows/ci.yml)
|
|
29
|
+
[](https://github.com/flamehaven01/SPAR-Framework/releases)
|
|
30
|
+
[](https://github.com/flamehaven01/SPAR-Framework/tree/main/src/spar_domain_physics)
|
|
31
|
+
|
|
32
|
+
Claim-aware review for systems whose outputs can pass while their claims drift.
|
|
33
|
+
|
|
34
|
+
SPAR is the framework behind that review. It checks whether an output deserves
|
|
35
|
+
the claim attached to it, not just whether the system still produces a stable
|
|
36
|
+
result.
|
|
37
|
+
|
|
38
|
+
**SPAR is not a physics-only framework. Physics is where we proved it.**
|
|
39
|
+
|
|
40
|
+
The broader product is claim-aware review:
|
|
41
|
+
|
|
42
|
+
- outputs can stay green while implementation state changes underneath
|
|
43
|
+
- approximations can be reported as closure
|
|
44
|
+
- governance labels can drift out of sync with computation
|
|
45
|
+
- stable scores can carry unjustified confidence
|
|
46
|
+
|
|
47
|
+
SPAR does not promise truth. It prevents unjustified confidence.
|
|
48
|
+
|
|
49
|
+
Built in physics. Applicable anywhere outputs can pass while claims drift.
|
|
50
|
+
|
|
51
|
+
| Catch claim drift | Emit maturity state | Adopt in layers |
|
|
52
|
+
|---|---|---|
|
|
53
|
+
| Detect when green outputs and attached claims no longer match. | Keep `exact`, `approximate`, `partial`, `heuristic`, and `environment_conditional` visible at review time. | Start with lightweight claim checks, then grow into full Layer A/B/C review. |
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
**Navigation:**
|
|
58
|
+
[Why This Matters](#why-this-matters) •
|
|
59
|
+
[Workflow](#workflow) •
|
|
60
|
+
[Why Teams Use It](#why-teams-use-it) •
|
|
61
|
+
[Where It Fits](#where-it-fits) •
|
|
62
|
+
[Adoption Path](#adoption-path) •
|
|
63
|
+
[What SPAR Provides](#what-spar-provides) •
|
|
64
|
+
[Quick Start](#quick-start) •
|
|
65
|
+
[Architecture](#architecture) •
|
|
66
|
+
[Repository Layout](#repository-layout) •
|
|
67
|
+
[Development](#development) •
|
|
68
|
+
[Changelog](CHANGELOG.md)
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Why This Matters
|
|
73
|
+
|
|
74
|
+
Most review systems stop at output correctness.
|
|
75
|
+
|
|
76
|
+
They ask:
|
|
77
|
+
|
|
78
|
+
- did the code run
|
|
79
|
+
- did the test pass
|
|
80
|
+
- did the score stay within bounds
|
|
81
|
+
|
|
82
|
+
SPAR asks a harder question:
|
|
83
|
+
|
|
84
|
+
- does the claim still deserve to stand
|
|
85
|
+
|
|
86
|
+
That distinction matters in real systems:
|
|
87
|
+
|
|
88
|
+
- a patch can pass tests while overstating completeness
|
|
89
|
+
- an analytics dashboard can stay green while the interpretation becomes stale
|
|
90
|
+
- a model score can remain reproducible while its maturity state changes
|
|
91
|
+
- a scientific result can stay numerically stable while the justification weakens
|
|
92
|
+
|
|
93
|
+
This is the gap SPAR is built to review.
|
|
94
|
+
|
|
95
|
+
## Workflow
|
|
96
|
+
|
|
97
|
+
```mermaid
|
|
98
|
+
flowchart LR
|
|
99
|
+
A[System Output] --> B[Claim Attached to Output]
|
|
100
|
+
B --> C[Ordinary Review<br/>Tests · Regression · Score Bounds]
|
|
101
|
+
C --> D[Green Result]
|
|
102
|
+
B --> E[SPAR Review<br/>Claim-Aware Review]
|
|
103
|
+
E --> F[Layer A<br/>Anchor Consistency]
|
|
104
|
+
E --> G[Layer B<br/>Interpretation Validity]
|
|
105
|
+
E --> H[Layer C<br/>Existence and Maturity]
|
|
106
|
+
F --> I[Registry-Backed Review Surface]
|
|
107
|
+
G --> I
|
|
108
|
+
H --> I
|
|
109
|
+
I --> J{Verdict}
|
|
110
|
+
J --> K[Accept]
|
|
111
|
+
J --> L[Warn]
|
|
112
|
+
J --> M[Reclassify]
|
|
113
|
+
J --> N[Reject]
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Ordinary review asks whether the system still passes. SPAR asks whether the
|
|
117
|
+
claim deserves to survive that pass.
|
|
118
|
+
|
|
119
|
+
## Why Teams Use It
|
|
120
|
+
|
|
121
|
+
**Keep green outputs honest**
|
|
122
|
+
When CI stays green but implementation and claim drift apart, SPAR gives teams
|
|
123
|
+
a review layer that can force a warning, downgrade, or reclassification before
|
|
124
|
+
false confidence becomes policy or product language.
|
|
125
|
+
|
|
126
|
+
**Attach maturity to results**
|
|
127
|
+
SPAR keeps exact, approximate, partial, heuristic, and environment-conditional
|
|
128
|
+
states visible at review time. That matters for model governance, regulated
|
|
129
|
+
pipelines, scientific systems, and any workflow where reproducibility is not
|
|
130
|
+
enough.
|
|
131
|
+
|
|
132
|
+
**Adopt it in layers**
|
|
133
|
+
Teams do not need the full framework on day one. A lightweight claim check, a
|
|
134
|
+
small maturity registry, and a full Layer A/B/C review path can be introduced
|
|
135
|
+
as separate maturity levels.
|
|
136
|
+
|
|
137
|
+
## Where It Fits
|
|
138
|
+
|
|
139
|
+
SPAR is not a generic linter, not a theorem prover, and not an LLM judge.
|
|
140
|
+
|
|
141
|
+
It is a deterministic review framework for one specific problem:
|
|
142
|
+
|
|
143
|
+
**checking whether outputs deserve the claims attached to them.**
|
|
144
|
+
|
|
145
|
+
That makes it useful above ordinary regression and below broad governance prose.
|
|
146
|
+
It gives teams a structured way to ask what a result is claiming, what
|
|
147
|
+
implementation state produced it, and what maturity state must travel with it.
|
|
148
|
+
|
|
149
|
+
## Adoption Path
|
|
150
|
+
|
|
151
|
+
Do not start with the full framework unless you already need it.
|
|
152
|
+
|
|
153
|
+
### Level 1 — Claim Check
|
|
154
|
+
|
|
155
|
+
Add three explicit review questions to an existing workflow:
|
|
156
|
+
|
|
157
|
+
- What is the output actually claiming?
|
|
158
|
+
- Does that claim match the implementation state?
|
|
159
|
+
- Is this result exact, approximate, partial, or heuristic?
|
|
160
|
+
|
|
161
|
+
This is the lightest entry point. Most teams can do this immediately.
|
|
162
|
+
|
|
163
|
+
### Level 2 — Maturity Labels
|
|
164
|
+
|
|
165
|
+
Add a simple registry and attach state labels to results:
|
|
166
|
+
|
|
167
|
+
- `heuristic`
|
|
168
|
+
- `partial`
|
|
169
|
+
- `closed`
|
|
170
|
+
- `environment_conditional`
|
|
171
|
+
|
|
172
|
+
This is already a meaningful step beyond ordinary review.
|
|
173
|
+
|
|
174
|
+
### Level 3 — Full SPAR
|
|
175
|
+
|
|
176
|
+
Use the full framework:
|
|
177
|
+
|
|
178
|
+
- Layer A — anchor consistency
|
|
179
|
+
- Layer B — interpretation validity
|
|
180
|
+
- Layer C — existence and maturity probes
|
|
181
|
+
- registry-backed snapshots
|
|
182
|
+
- explicit score and verdict policy
|
|
183
|
+
|
|
184
|
+
This repository currently exposes that full path for the first physics adapter.
|
|
185
|
+
|
|
186
|
+
## What SPAR Provides
|
|
187
|
+
|
|
188
|
+
**Generic review kernel**
|
|
189
|
+
Explicit score and verdict policy for deterministic claim-aware review.
|
|
190
|
+
|
|
191
|
+
**Registry-backed runtime surface**
|
|
192
|
+
Maturity and gap snapshots travel with the review result instead of living only
|
|
193
|
+
in prose.
|
|
194
|
+
|
|
195
|
+
**Adapter boundary for real domains**
|
|
196
|
+
Layer A / B / C logic stays domain-owned. This repository already includes a
|
|
197
|
+
working physics adapter as the first proof case.
|
|
198
|
+
|
|
199
|
+
## What SPAR Does Not Provide
|
|
200
|
+
|
|
201
|
+
- a universal truth engine
|
|
202
|
+
- free-form LLM judging in the core
|
|
203
|
+
- TOE API/router integration inside the framework package
|
|
204
|
+
- domain contracts inside the generic kernel
|
|
205
|
+
|
|
206
|
+
## Quick Start
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
pip install -e .[dev]
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
```python
|
|
213
|
+
from spar_framework.engine import run_review
|
|
214
|
+
from spar_domain_physics.runtime import get_review_runtime
|
|
215
|
+
|
|
216
|
+
runtime = get_review_runtime()
|
|
217
|
+
|
|
218
|
+
result = run_review(
|
|
219
|
+
runtime=runtime,
|
|
220
|
+
subject={
|
|
221
|
+
"beta_G_norm": 0.0,
|
|
222
|
+
"beta_B_norm": 0.0,
|
|
223
|
+
"beta_Phi_norm": 0.0,
|
|
224
|
+
"sidrce_omega": 1.0,
|
|
225
|
+
"eft_m_kk_gev": 1.0e16,
|
|
226
|
+
"ricci_norm": 0.02,
|
|
227
|
+
},
|
|
228
|
+
source="flat minkowski",
|
|
229
|
+
gate="PASS",
|
|
230
|
+
report_text="Bounded report text.",
|
|
231
|
+
)
|
|
232
|
+
|
|
233
|
+
print(result.verdict)
|
|
234
|
+
print(result.score)
|
|
235
|
+
print(result.model_registry_snapshot["total_models"])
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
## Architecture
|
|
239
|
+
|
|
240
|
+
SPAR separates claim-aware review into three layers.
|
|
241
|
+
|
|
242
|
+
### Layer A — Anchor Consistency
|
|
243
|
+
|
|
244
|
+
Checks whether output agrees with a declared analytical or contractual anchor.
|
|
245
|
+
|
|
246
|
+
### Layer B — Interpretation Validity
|
|
247
|
+
|
|
248
|
+
Checks whether report language and declared scope stay within what the
|
|
249
|
+
implementation state justifies.
|
|
250
|
+
|
|
251
|
+
### Layer C — Existence and Maturity Probes
|
|
252
|
+
|
|
253
|
+
Checks what kind of implementation produced the result:
|
|
254
|
+
|
|
255
|
+
- genuine
|
|
256
|
+
- approximate
|
|
257
|
+
- gapped
|
|
258
|
+
- environment-conditional
|
|
259
|
+
- research-only
|
|
260
|
+
|
|
261
|
+
The core package stays domain-agnostic. Domain adapters provide anchors,
|
|
262
|
+
contracts, and maturity logic.
|
|
263
|
+
|
|
264
|
+
## Why Physics Comes First
|
|
265
|
+
|
|
266
|
+
Physics is the first adapter because it gives the framework a hard proof case.
|
|
267
|
+
|
|
268
|
+
It is where the distinction between:
|
|
269
|
+
|
|
270
|
+
- stable output
|
|
271
|
+
- justified claim
|
|
272
|
+
- declared maturity
|
|
273
|
+
|
|
274
|
+
can be made explicit enough to test rigorously.
|
|
275
|
+
|
|
276
|
+
That does **not** make SPAR physics-only.
|
|
277
|
+
|
|
278
|
+
It means the framework first proved itself in a domain where claim drift is
|
|
279
|
+
visible and costly.
|
|
280
|
+
|
|
281
|
+
## Repository Layout
|
|
282
|
+
|
|
283
|
+
- `src/spar_framework/`
|
|
284
|
+
- generic review kernel
|
|
285
|
+
- result types
|
|
286
|
+
- scoring policy
|
|
287
|
+
- registry model
|
|
288
|
+
- `src/spar_domain_physics/`
|
|
289
|
+
- first domain adapter
|
|
290
|
+
- registry seeds
|
|
291
|
+
- analytical anchors
|
|
292
|
+
- Layer A / B / C implementations
|
|
293
|
+
- `tests/`
|
|
294
|
+
- `docs/`
|
|
295
|
+
- `mica.yaml`
|
|
296
|
+
- `memory/`
|
|
297
|
+
|
|
298
|
+
## Start Here
|
|
299
|
+
|
|
300
|
+
1. `docs/ARCHITECTURE.md`
|
|
301
|
+
2. `docs/EXTRACTION_MAP.md`
|
|
302
|
+
3. `src/spar_framework/engine.py`
|
|
303
|
+
4. `src/spar_domain_physics/runtime.py`
|
|
304
|
+
5. `memory/spar-framework-playbook.v1.0.0.md`
|
|
305
|
+
|
|
306
|
+
## Development
|
|
307
|
+
|
|
308
|
+
```bash
|
|
309
|
+
python -m pytest -q
|
|
310
|
+
python -m build
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
## Status
|
|
314
|
+
|
|
315
|
+
Current state:
|
|
316
|
+
|
|
317
|
+
- standalone package scaffold complete
|
|
318
|
+
- generic kernel extracted
|
|
319
|
+
- first physics adapter extracted
|
|
320
|
+
- TOE integration already consuming the framework runtime
|
|
321
|
+
|
|
322
|
+
This means the project is no longer only an extraction target. It is already a
|
|
323
|
+
working standalone framework with one concrete domain adapter.
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
# spar-framework
|
|
2
|
+
|
|
3
|
+
[](https://www.python.org/downloads/)
|
|
4
|
+
[](https://github.com/flamehaven01/SPAR-Framework/actions/workflows/ci.yml)
|
|
5
|
+
[](https://github.com/flamehaven01/SPAR-Framework/releases)
|
|
6
|
+
[](https://github.com/flamehaven01/SPAR-Framework/tree/main/src/spar_domain_physics)
|
|
7
|
+
|
|
8
|
+
Claim-aware review for systems whose outputs can pass while their claims drift.
|
|
9
|
+
|
|
10
|
+
SPAR is the framework behind that review. It checks whether an output deserves
|
|
11
|
+
the claim attached to it, not just whether the system still produces a stable
|
|
12
|
+
result.
|
|
13
|
+
|
|
14
|
+
**SPAR is not a physics-only framework. Physics is where we proved it.**
|
|
15
|
+
|
|
16
|
+
The broader product is claim-aware review:
|
|
17
|
+
|
|
18
|
+
- outputs can stay green while implementation state changes underneath
|
|
19
|
+
- approximations can be reported as closure
|
|
20
|
+
- governance labels can drift out of sync with computation
|
|
21
|
+
- stable scores can carry unjustified confidence
|
|
22
|
+
|
|
23
|
+
SPAR does not promise truth. It prevents unjustified confidence.
|
|
24
|
+
|
|
25
|
+
Built in physics. Applicable anywhere outputs can pass while claims drift.
|
|
26
|
+
|
|
27
|
+
| Catch claim drift | Emit maturity state | Adopt in layers |
|
|
28
|
+
|---|---|---|
|
|
29
|
+
| Detect when green outputs and attached claims no longer match. | Keep `exact`, `approximate`, `partial`, `heuristic`, and `environment_conditional` visible at review time. | Start with lightweight claim checks, then grow into full Layer A/B/C review. |
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
**Navigation:**
|
|
34
|
+
[Why This Matters](#why-this-matters) •
|
|
35
|
+
[Workflow](#workflow) •
|
|
36
|
+
[Why Teams Use It](#why-teams-use-it) •
|
|
37
|
+
[Where It Fits](#where-it-fits) •
|
|
38
|
+
[Adoption Path](#adoption-path) •
|
|
39
|
+
[What SPAR Provides](#what-spar-provides) •
|
|
40
|
+
[Quick Start](#quick-start) •
|
|
41
|
+
[Architecture](#architecture) •
|
|
42
|
+
[Repository Layout](#repository-layout) •
|
|
43
|
+
[Development](#development) •
|
|
44
|
+
[Changelog](CHANGELOG.md)
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Why This Matters
|
|
49
|
+
|
|
50
|
+
Most review systems stop at output correctness.
|
|
51
|
+
|
|
52
|
+
They ask:
|
|
53
|
+
|
|
54
|
+
- did the code run
|
|
55
|
+
- did the test pass
|
|
56
|
+
- did the score stay within bounds
|
|
57
|
+
|
|
58
|
+
SPAR asks a harder question:
|
|
59
|
+
|
|
60
|
+
- does the claim still deserve to stand
|
|
61
|
+
|
|
62
|
+
That distinction matters in real systems:
|
|
63
|
+
|
|
64
|
+
- a patch can pass tests while overstating completeness
|
|
65
|
+
- an analytics dashboard can stay green while the interpretation becomes stale
|
|
66
|
+
- a model score can remain reproducible while its maturity state changes
|
|
67
|
+
- a scientific result can stay numerically stable while the justification weakens
|
|
68
|
+
|
|
69
|
+
This is the gap SPAR is built to review.
|
|
70
|
+
|
|
71
|
+
## Workflow
|
|
72
|
+
|
|
73
|
+
```mermaid
|
|
74
|
+
flowchart LR
|
|
75
|
+
A[System Output] --> B[Claim Attached to Output]
|
|
76
|
+
B --> C[Ordinary Review<br/>Tests · Regression · Score Bounds]
|
|
77
|
+
C --> D[Green Result]
|
|
78
|
+
B --> E[SPAR Review<br/>Claim-Aware Review]
|
|
79
|
+
E --> F[Layer A<br/>Anchor Consistency]
|
|
80
|
+
E --> G[Layer B<br/>Interpretation Validity]
|
|
81
|
+
E --> H[Layer C<br/>Existence and Maturity]
|
|
82
|
+
F --> I[Registry-Backed Review Surface]
|
|
83
|
+
G --> I
|
|
84
|
+
H --> I
|
|
85
|
+
I --> J{Verdict}
|
|
86
|
+
J --> K[Accept]
|
|
87
|
+
J --> L[Warn]
|
|
88
|
+
J --> M[Reclassify]
|
|
89
|
+
J --> N[Reject]
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Ordinary review asks whether the system still passes. SPAR asks whether the
|
|
93
|
+
claim deserves to survive that pass.
|
|
94
|
+
|
|
95
|
+
## Why Teams Use It
|
|
96
|
+
|
|
97
|
+
**Keep green outputs honest**
|
|
98
|
+
When CI stays green but implementation and claim drift apart, SPAR gives teams
|
|
99
|
+
a review layer that can force a warning, downgrade, or reclassification before
|
|
100
|
+
false confidence becomes policy or product language.
|
|
101
|
+
|
|
102
|
+
**Attach maturity to results**
|
|
103
|
+
SPAR keeps exact, approximate, partial, heuristic, and environment-conditional
|
|
104
|
+
states visible at review time. That matters for model governance, regulated
|
|
105
|
+
pipelines, scientific systems, and any workflow where reproducibility is not
|
|
106
|
+
enough.
|
|
107
|
+
|
|
108
|
+
**Adopt it in layers**
|
|
109
|
+
Teams do not need the full framework on day one. A lightweight claim check, a
|
|
110
|
+
small maturity registry, and a full Layer A/B/C review path can be introduced
|
|
111
|
+
as separate maturity levels.
|
|
112
|
+
|
|
113
|
+
## Where It Fits
|
|
114
|
+
|
|
115
|
+
SPAR is not a generic linter, not a theorem prover, and not an LLM judge.
|
|
116
|
+
|
|
117
|
+
It is a deterministic review framework for one specific problem:
|
|
118
|
+
|
|
119
|
+
**checking whether outputs deserve the claims attached to them.**
|
|
120
|
+
|
|
121
|
+
That makes it useful above ordinary regression and below broad governance prose.
|
|
122
|
+
It gives teams a structured way to ask what a result is claiming, what
|
|
123
|
+
implementation state produced it, and what maturity state must travel with it.
|
|
124
|
+
|
|
125
|
+
## Adoption Path
|
|
126
|
+
|
|
127
|
+
Do not start with the full framework unless you already need it.
|
|
128
|
+
|
|
129
|
+
### Level 1 — Claim Check
|
|
130
|
+
|
|
131
|
+
Add three explicit review questions to an existing workflow:
|
|
132
|
+
|
|
133
|
+
- What is the output actually claiming?
|
|
134
|
+
- Does that claim match the implementation state?
|
|
135
|
+
- Is this result exact, approximate, partial, or heuristic?
|
|
136
|
+
|
|
137
|
+
This is the lightest entry point. Most teams can do this immediately.
|
|
138
|
+
|
|
139
|
+
### Level 2 — Maturity Labels
|
|
140
|
+
|
|
141
|
+
Add a simple registry and attach state labels to results:
|
|
142
|
+
|
|
143
|
+
- `heuristic`
|
|
144
|
+
- `partial`
|
|
145
|
+
- `closed`
|
|
146
|
+
- `environment_conditional`
|
|
147
|
+
|
|
148
|
+
This is already a meaningful step beyond ordinary review.
|
|
149
|
+
|
|
150
|
+
### Level 3 — Full SPAR
|
|
151
|
+
|
|
152
|
+
Use the full framework:
|
|
153
|
+
|
|
154
|
+
- Layer A — anchor consistency
|
|
155
|
+
- Layer B — interpretation validity
|
|
156
|
+
- Layer C — existence and maturity probes
|
|
157
|
+
- registry-backed snapshots
|
|
158
|
+
- explicit score and verdict policy
|
|
159
|
+
|
|
160
|
+
This repository currently exposes that full path for the first physics adapter.
|
|
161
|
+
|
|
162
|
+
## What SPAR Provides
|
|
163
|
+
|
|
164
|
+
**Generic review kernel**
|
|
165
|
+
Explicit score and verdict policy for deterministic claim-aware review.
|
|
166
|
+
|
|
167
|
+
**Registry-backed runtime surface**
|
|
168
|
+
Maturity and gap snapshots travel with the review result instead of living only
|
|
169
|
+
in prose.
|
|
170
|
+
|
|
171
|
+
**Adapter boundary for real domains**
|
|
172
|
+
Layer A / B / C logic stays domain-owned. This repository already includes a
|
|
173
|
+
working physics adapter as the first proof case.
|
|
174
|
+
|
|
175
|
+
## What SPAR Does Not Provide
|
|
176
|
+
|
|
177
|
+
- a universal truth engine
|
|
178
|
+
- free-form LLM judging in the core
|
|
179
|
+
- TOE API/router integration inside the framework package
|
|
180
|
+
- domain contracts inside the generic kernel
|
|
181
|
+
|
|
182
|
+
## Quick Start
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
pip install -e .[dev]
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
```python
|
|
189
|
+
from spar_framework.engine import run_review
|
|
190
|
+
from spar_domain_physics.runtime import get_review_runtime
|
|
191
|
+
|
|
192
|
+
runtime = get_review_runtime()
|
|
193
|
+
|
|
194
|
+
result = run_review(
|
|
195
|
+
runtime=runtime,
|
|
196
|
+
subject={
|
|
197
|
+
"beta_G_norm": 0.0,
|
|
198
|
+
"beta_B_norm": 0.0,
|
|
199
|
+
"beta_Phi_norm": 0.0,
|
|
200
|
+
"sidrce_omega": 1.0,
|
|
201
|
+
"eft_m_kk_gev": 1.0e16,
|
|
202
|
+
"ricci_norm": 0.02,
|
|
203
|
+
},
|
|
204
|
+
source="flat minkowski",
|
|
205
|
+
gate="PASS",
|
|
206
|
+
report_text="Bounded report text.",
|
|
207
|
+
)
|
|
208
|
+
|
|
209
|
+
print(result.verdict)
|
|
210
|
+
print(result.score)
|
|
211
|
+
print(result.model_registry_snapshot["total_models"])
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
## Architecture
|
|
215
|
+
|
|
216
|
+
SPAR separates claim-aware review into three layers.
|
|
217
|
+
|
|
218
|
+
### Layer A — Anchor Consistency
|
|
219
|
+
|
|
220
|
+
Checks whether output agrees with a declared analytical or contractual anchor.
|
|
221
|
+
|
|
222
|
+
### Layer B — Interpretation Validity
|
|
223
|
+
|
|
224
|
+
Checks whether report language and declared scope stay within what the
|
|
225
|
+
implementation state justifies.
|
|
226
|
+
|
|
227
|
+
### Layer C — Existence and Maturity Probes
|
|
228
|
+
|
|
229
|
+
Checks what kind of implementation produced the result:
|
|
230
|
+
|
|
231
|
+
- genuine
|
|
232
|
+
- approximate
|
|
233
|
+
- gapped
|
|
234
|
+
- environment-conditional
|
|
235
|
+
- research-only
|
|
236
|
+
|
|
237
|
+
The core package stays domain-agnostic. Domain adapters provide anchors,
|
|
238
|
+
contracts, and maturity logic.
|
|
239
|
+
|
|
240
|
+
## Why Physics Comes First
|
|
241
|
+
|
|
242
|
+
Physics is the first adapter because it gives the framework a hard proof case.
|
|
243
|
+
|
|
244
|
+
It is where the distinction between:
|
|
245
|
+
|
|
246
|
+
- stable output
|
|
247
|
+
- justified claim
|
|
248
|
+
- declared maturity
|
|
249
|
+
|
|
250
|
+
can be made explicit enough to test rigorously.
|
|
251
|
+
|
|
252
|
+
That does **not** make SPAR physics-only.
|
|
253
|
+
|
|
254
|
+
It means the framework first proved itself in a domain where claim drift is
|
|
255
|
+
visible and costly.
|
|
256
|
+
|
|
257
|
+
## Repository Layout
|
|
258
|
+
|
|
259
|
+
- `src/spar_framework/`
|
|
260
|
+
- generic review kernel
|
|
261
|
+
- result types
|
|
262
|
+
- scoring policy
|
|
263
|
+
- registry model
|
|
264
|
+
- `src/spar_domain_physics/`
|
|
265
|
+
- first domain adapter
|
|
266
|
+
- registry seeds
|
|
267
|
+
- analytical anchors
|
|
268
|
+
- Layer A / B / C implementations
|
|
269
|
+
- `tests/`
|
|
270
|
+
- `docs/`
|
|
271
|
+
- `mica.yaml`
|
|
272
|
+
- `memory/`
|
|
273
|
+
|
|
274
|
+
## Start Here
|
|
275
|
+
|
|
276
|
+
1. `docs/ARCHITECTURE.md`
|
|
277
|
+
2. `docs/EXTRACTION_MAP.md`
|
|
278
|
+
3. `src/spar_framework/engine.py`
|
|
279
|
+
4. `src/spar_domain_physics/runtime.py`
|
|
280
|
+
5. `memory/spar-framework-playbook.v1.0.0.md`
|
|
281
|
+
|
|
282
|
+
## Development
|
|
283
|
+
|
|
284
|
+
```bash
|
|
285
|
+
python -m pytest -q
|
|
286
|
+
python -m build
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
## Status
|
|
290
|
+
|
|
291
|
+
Current state:
|
|
292
|
+
|
|
293
|
+
- standalone package scaffold complete
|
|
294
|
+
- generic kernel extracted
|
|
295
|
+
- first physics adapter extracted
|
|
296
|
+
- TOE integration already consuming the framework runtime
|
|
297
|
+
|
|
298
|
+
This means the project is no longer only an extraction target. It is already a
|
|
299
|
+
working standalone framework with one concrete domain adapter.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68.0", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "spar-framework"
|
|
7
|
+
version = "0.1.1"
|
|
8
|
+
description = "Standalone deterministic admissibility-review framework"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = "LicenseRef-Flamehaven-Sovereign"
|
|
12
|
+
license-files = ["LICENSE"]
|
|
13
|
+
authors = [
|
|
14
|
+
{name = "Flamehaven"},
|
|
15
|
+
]
|
|
16
|
+
keywords = ["verification", "governance", "admissibility", "review", "physics"]
|
|
17
|
+
classifiers = [
|
|
18
|
+
"Programming Language :: Python :: 3",
|
|
19
|
+
"Programming Language :: Python :: 3.10",
|
|
20
|
+
"Programming Language :: Python :: 3.11",
|
|
21
|
+
"Operating System :: OS Independent",
|
|
22
|
+
"Topic :: Scientific/Engineering",
|
|
23
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
24
|
+
]
|
|
25
|
+
dependencies = []
|
|
26
|
+
|
|
27
|
+
[project.urls]
|
|
28
|
+
Homepage = "https://github.com/flamehaven01/SPAR-Framework#readme"
|
|
29
|
+
Repository = "https://github.com/flamehaven01/SPAR-Framework"
|
|
30
|
+
Issues = "https://github.com/flamehaven01/SPAR-Framework/issues"
|
|
31
|
+
|
|
32
|
+
[project.optional-dependencies]
|
|
33
|
+
dev = [
|
|
34
|
+
"pytest>=8.0",
|
|
35
|
+
"build>=1.2.0",
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
[tool.pytest.ini_options]
|
|
39
|
+
testpaths = ["tests"]
|
|
40
|
+
pythonpath = ["src"]
|
|
41
|
+
|
|
42
|
+
[tool.setuptools.packages.find]
|
|
43
|
+
where = ["src"]
|