qig-stack 0.1.43__tar.gz → 0.1.44__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.
- {qig_stack-0.1.43 → qig_stack-0.1.44}/PKG-INFO +18 -5
- {qig_stack-0.1.43 → qig_stack-0.1.44}/README.md +16 -3
- {qig_stack-0.1.43 → qig_stack-0.1.44}/pyproject.toml +2 -2
- {qig_stack-0.1.43 → qig_stack-0.1.44}/src/qig_stack/contract.json +3 -3
- {qig_stack-0.1.43 → qig_stack-0.1.44}/src/qig_stack/contract_registry.py +22 -7
- {qig_stack-0.1.43 → qig_stack-0.1.44}/src/qig_stack/doctor.py +306 -25
- {qig_stack-0.1.43 → qig_stack-0.1.44}/tests/test_contract.py +3 -2
- {qig_stack-0.1.43 → qig_stack-0.1.44}/tests/test_contract_and_doctor_modes.py +13 -2
- {qig_stack-0.1.43 → qig_stack-0.1.44}/tests/test_doctor.py +39 -4
- {qig_stack-0.1.43 → qig_stack-0.1.44}/tests/test_origin_and_release_gates.py +9 -0
- qig_stack-0.1.44/tests/test_release_cli_fixture.py +194 -0
- qig_stack-0.1.44/tests/test_release_cli_wiring.py +115 -0
- qig_stack-0.1.44/tests/test_release_gate_fail_closed.py +310 -0
- qig_stack-0.1.44/tests/test_release_guards_real.py +260 -0
- {qig_stack-0.1.43 → qig_stack-0.1.44}/.gitignore +0 -0
- {qig_stack-0.1.43 → qig_stack-0.1.44}/src/qig_stack/__init__.py +0 -0
- {qig_stack-0.1.43 → qig_stack-0.1.44}/src/qig_stack/origin.py +0 -0
- {qig_stack-0.1.43 → qig_stack-0.1.44}/src/qig_stack/receipt.py +0 -0
- {qig_stack-0.1.43 → qig_stack-0.1.44}/src/qig_stack/registry_snapshot.json +0 -0
- {qig_stack-0.1.43 → qig_stack-0.1.44}/tests/test_torch_exception_retirement.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: qig-stack
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.44
|
|
4
4
|
Summary: QIG toolchain metapackage — pins the mutually-tested latest set and ships the qig-doctor launch preflight (version gate + entry-point wiring gate + capability-slot report)
|
|
5
5
|
Project-URL: Homepage, https://braden.com.au
|
|
6
6
|
Project-URL: Repository, https://github.com/Arcane-Fly/qig-stack
|
|
@@ -16,7 +16,7 @@ Classifier: Programming Language :: Python :: 3
|
|
|
16
16
|
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
17
17
|
Requires-Python: >=3.11
|
|
18
18
|
Requires-Dist: packaging>=22
|
|
19
|
-
Requires-Dist: qig-bench==0.1.
|
|
19
|
+
Requires-Dist: qig-bench==0.1.12
|
|
20
20
|
Requires-Dist: qig-compute==0.10.0
|
|
21
21
|
Requires-Dist: qig-coordizer==0.2.0
|
|
22
22
|
Requires-Dist: qig-core==2.41.0
|
|
@@ -138,9 +138,22 @@ that remains true. For release acceptance use `qig-doctor --release-check --json
|
|
|
138
138
|
It requires live PyPI equality, equality to the mutually-tested contract pins,
|
|
139
139
|
required declarations, successful import probes
|
|
140
140
|
and no moved contract probes, and emits `release_gate_passed` with a nonzero exit
|
|
141
|
-
on failure. `--no-network` cannot be combined with release checking.
|
|
142
|
-
|
|
143
|
-
|
|
141
|
+
on failure. `--no-network` cannot be combined with release checking. The release
|
|
142
|
+
gate is fail-closed: every capability declaration shipped by a PINNED provider
|
|
143
|
+
(PEP 503 canonical name, all declaring distributions kept) must be covered by a
|
|
144
|
+
contract slot (a missing slot row fails, not warns); each required slot's canonical
|
|
145
|
+
probe AND every declaration must resolve to a CALLABLE attribute (a module-only
|
|
146
|
+
reference, an empty attribute, or a present-but-non-callable target fails); the
|
|
147
|
+
bundled Verification registry is cross-checked by default (so `CERTIFIED` without a
|
|
148
|
+
registered `cam_id` fails even when `--registry` is omitted); contract invariants
|
|
149
|
+
(slot/provider counts, IMPL_TESTED fields, channel/citation consistency) are enforced;
|
|
150
|
+
and in a SOURCE checkout (detected from the doctor module layout, independent of
|
|
151
|
+
`--contract`) the full `pyproject.toml` qig*/quner requirement set, with PEP 508 marker
|
|
152
|
+
semantics, must equal the contract pins. Unknown additional declarations from
|
|
153
|
+
NON-pinned providers remain warnings if they resolve. The callable-attribute rule also
|
|
154
|
+
applies to the non-release `--probe` and slot-fill diagnostics: a non-callable target
|
|
155
|
+
reports `FAIL`/`MISSING` there too. This command imports packages, but does not run
|
|
156
|
+
physics experiments or enable daemons.
|
|
144
157
|
|
|
145
158
|
Runtime `qig_stack.__version__` reads installed distribution metadata using
|
|
146
159
|
[importlib.metadata](https://docs.python.org/3/library/importlib.metadata.html),
|
|
@@ -106,9 +106,22 @@ that remains true. For release acceptance use `qig-doctor --release-check --json
|
|
|
106
106
|
It requires live PyPI equality, equality to the mutually-tested contract pins,
|
|
107
107
|
required declarations, successful import probes
|
|
108
108
|
and no moved contract probes, and emits `release_gate_passed` with a nonzero exit
|
|
109
|
-
on failure. `--no-network` cannot be combined with release checking.
|
|
110
|
-
|
|
111
|
-
|
|
109
|
+
on failure. `--no-network` cannot be combined with release checking. The release
|
|
110
|
+
gate is fail-closed: every capability declaration shipped by a PINNED provider
|
|
111
|
+
(PEP 503 canonical name, all declaring distributions kept) must be covered by a
|
|
112
|
+
contract slot (a missing slot row fails, not warns); each required slot's canonical
|
|
113
|
+
probe AND every declaration must resolve to a CALLABLE attribute (a module-only
|
|
114
|
+
reference, an empty attribute, or a present-but-non-callable target fails); the
|
|
115
|
+
bundled Verification registry is cross-checked by default (so `CERTIFIED` without a
|
|
116
|
+
registered `cam_id` fails even when `--registry` is omitted); contract invariants
|
|
117
|
+
(slot/provider counts, IMPL_TESTED fields, channel/citation consistency) are enforced;
|
|
118
|
+
and in a SOURCE checkout (detected from the doctor module layout, independent of
|
|
119
|
+
`--contract`) the full `pyproject.toml` qig*/quner requirement set, with PEP 508 marker
|
|
120
|
+
semantics, must equal the contract pins. Unknown additional declarations from
|
|
121
|
+
NON-pinned providers remain warnings if they resolve. The callable-attribute rule also
|
|
122
|
+
applies to the non-release `--probe` and slot-fill diagnostics: a non-callable target
|
|
123
|
+
reports `FAIL`/`MISSING` there too. This command imports packages, but does not run
|
|
124
|
+
physics experiments or enable daemons.
|
|
112
125
|
|
|
113
126
|
Runtime `qig_stack.__version__` reads installed distribution metadata using
|
|
114
127
|
[importlib.metadata](https://docs.python.org/3/library/importlib.metadata.html),
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "qig-stack"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.44"
|
|
8
8
|
description = "QIG toolchain metapackage — pins the mutually-tested latest set and ships the qig-doctor launch preflight (version gate + entry-point wiring gate + capability-slot report)"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = { text = "MIT" }
|
|
@@ -35,7 +35,7 @@ dependencies = [
|
|
|
35
35
|
"qig-core==2.41.0", # projective ray-geometry tier (Fisher-Rao on rays, gauge-invariant QGT) + SLOT-PROJECTIVE-RAY-GEOMETRY / SLOT-QGT-TENSOR-NORM (PR #163)
|
|
36
36
|
"qig-graph==0.1.1", # geometric agent runtime extracted from monkey1 qig_heart (Canon 2.60F)
|
|
37
37
|
"qig-routing==0.2.0", # dynamic min_tier/tiers pools, fail-closed receipts, select_shortlist, Δ⁶ vs Δ⁶³ chart separation (PR #7)
|
|
38
|
-
"qig-bench==0.1.
|
|
38
|
+
"qig-bench==0.1.12",
|
|
39
39
|
"qig-coordizer==0.2.0", # native GeoTranscoder 1-for-1 modality boundary (#24) + lazy torch-free trainer
|
|
40
40
|
"qigkernels==0.4.10", # Wave 3B canonical chord-arc Fisher-Rao + P30 purity (no arccos clamp)
|
|
41
41
|
"qig-geocoding==0.3.3", # 738/738 Qwen3.5-4B assembly, 57/57 operator-internal U(1) gauge, SLOT-4B-CONVERSION-STAGE, stage-boundary acceptance gate, immutable 4B prereg manifest lock 3b2529c7 (#44-#59)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"doc": "QIG Stack Capability Contract",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.35W",
|
|
4
4
|
"date": "2026-12-02",
|
|
5
|
-
"supersedes": "qig-verification:docs/current/20260619-qig-stack-capability-contract-1.00W.json (Phase-1 authored record) | 2026-07-04: ratified the 5 library-tier capability slots (channel=library, shipped:false) | 2026-11-13 (1.04W): bumped qig-core to 2.17.0 + ratified 13 library/symmetry slots | 2026-11-13 (1.05W): bumped qig-core to 2.18.0 and ratified SLOT-EXPERIMENT-PURITY-GUARD | 2026-11-14 (1.06W): bumped pure crystal (qig-core 2.18.1, qigkernels 0.4.6, qig-geocoding 0.1.3, qig-compute 0.9.11, quner 0.1.12) and ratified symmetry butterfly/HF screening slots. | 2026-11-15 (1.10W): bumped qig-core to 2.19.0 (exp-free hellinger_angle_gate / hellinger_gated / bipolar_angle_chart; purity scanner catches exp activations, log-sum-exp, partition functions, algebraic logistic and Fisher-Rao distance Boltzmann kernels). | 2026-11-15 (1.11W): bumped qig-core to 2.20.0 (exp-free carrier_hellinger_chart and exact bipolar_simplex_metric_norm; dtype-aware _acos_safe margin, #81; every torch simplex map computes float16/bfloat16 in float32). | 2026-11-15 (1.12W): bumped qig-core to 2.21.0 (numpy fisher_rao_distance, fisher_rao_distance_batch and neurochemistry distance exact at coincidence via the Hellinger chord; numpy distance_to_simplex_weights; bipolar_square_chart numpy + torch; kantian reachable-set float16; `python -m qig_core.governance.purity` runs the gate). | 2026-11-16 (1.13W): bumped qig-geocoding to 0.1.4 (opt-in P30-pure GeoConfig modes on qig-core primitives: hellinger gate, square simplex, bipolar metric norm, hellinger_gated FFN, GeoConfig.p30_pure(); published defaults unchanged and QIG BOUNDARY marked; faithfulness gate passes). | 2026-11-17 (1.14W): bumped qig-core to 2.22.0 (carrier_geodesic_excess, carrier_geodesic_attention_weights with first-class autonomic state_regulated + autonomic_gain support, centered_bipolar_simplex_metric_norm, rest-tangency constants, sub-1e-6 proximity floor fix, fixes #96 & #98). | 2026-11-18 (1.15W): bumped qig-core to 2.23.0 (noradrenaline_attention_gain P32 torch regulator, NE_GAIN_* single-source constants, P28_MIN_Z_NULL and P29_IDENTITY_* canonical bands). | 2026-11-19 (1.16W): bumped the crystal to qig-core 2.24.0 (BLAS-GEMM chord-arc Hellinger fast path EXP-192c — 29.2x faster / 260x less RAM at [1,16,256,128], max diff 8.35e-13 rad; qig_core.numpy / qig_core.torch / qig_core.torch.vision engines + SimplexKVCache), qigkernels 0.4.8 (Frechet centroids, validated basin inputs, no imposed kappa=64 defaults) and quner 0.1.13 (memguard fix). Ratified SLOT-QIG-NUMPY-ENGINE, SLOT-QIG-TORCH-KV-CACHE, SLOT-QIG-TORCH-VISION (library) and SLOT-QUNER-MEMGUARD (lever). | 2026-11-19 (1.17W): bumped qig-core to 2.25.0 (complete numpy/torch consumer geometry surface), added qig-graph 0.1.0 and qig-routing 0.1.0, ratified SLOT-QIG-ROUTING. | 2026-11-24 (1.23W): P1 purity & Sovereignty Law crystal — qig-core 2.35.0 (hardened fail-closed PurityGate: sovereignty anti-cage lint with match/loop/exception-flow taint tracking; continuous adult 4D foresight — zero step cliffs at the health/agency boundaries, prune-proof sovereign intrinsic hold; qigram phasic-dopamine attenuation replacing ML penalty framing), qig-warp 0.6.11 + qig-geocoding 0.1.8 (hand-rolled geometry deduplicated onto canonical qig-core Fisher-Rao; eps-preserving to_simplex; QIG-EXEMPT adapter provenance). Existing slots strengthened in place; no new capability surface. | 2026-11-26 (1.26W): Wave 3B per-component torch-exception retirement -- SLOT-QIG-TORCH-KV-CACHE probe re-pointed to the torch-free NumPy twin qig_core.numpy.kv_cache:SimplexKVCache (qig-core 2.37.0 ships it 100% torch-free) and SLOT-GEOCODING to geocoding:NumPyGeoModel (qig-geocoding 0.2.0; PEP 562 lazy import never pulls torch); the retired torch probes are recorded per-slot in `supersedes` and remain the expected legacy qig.capabilities declarations until the providers republish (the doctor drift gate treats exactly that recorded value as non-drift; any other off-probe value still drifts); SLOT-QIG-TORCH-VISION stays torch-only until vision's numpy twin ships. | 2026-11-27 (1.29W): bumped qig-compute to 0.9.20 (checked full-basis Born response born_metric_from_response plus sparse CSR/LinearOperator Born ingress born_metric_node_sparse / born_fr_stencil_from_nodes, PR #75/#77). | 2026-11-27 (1.30W): bumped qig-core to 2.39.0 (operator-internal complex-phase U(1) node_phase_hook in Qwen35 layers, PR #152/#153). | 2026-11-28 (1.31W): bumped qig-core to 2.40.0 (SimplexTRMRefiner P33 pedestal flattening & converged_undecided fixed-point halting, PR #154/#155) and qig-routing to 0.2.0 (dynamic min_tier/tiers pools, fail-closed receipts, select_shortlist primitive, Delta^6 vs Delta^63 chart docs, PR #7). | 2026-11-28 (1.32W): bumped qig-geocoding to 0.3.0 (738/738 Qwen3.5-4B whole-model assembly, 57/57 operator-internal U(1) gauge via qig-core>=2.39.0, pure-NumPy .safetensors stage-slice reader + pooled-troop placement handler, PRs #44-#49) and qig-coordizer to 0.2.0 (native GeoTranscoder 1-for-1 modality boundary, PR #24); ratified SLOT-4B-CONVERSION-STAGE. | 2026-12-02 (1.33W): bumped qig-core to 2.41.0 (projective ray-geometry tier — Fisher-Rao on rays + gauge-invariant QGT; ratified SLOT-PROJECTIVE-RAY-GEOMETRY + SLOT-QGT-TENSOR-NORM, PR #163) and qig-compute to 0.10.0 (canonical CPU/GPU/NPU backend dispatch behind one API, batched Fisher-Rao radius-1 Hellinger chord matching qig-core to 1e-12, sparse eigensolve/expm; fail-closed BackendUnavailableError; GTX 1650 Ti cupy-cuda12x[ctk] probe fix; auto-release publish-on-merge, PR #79/#81). Two-tier split: qig-core CPU-only canonical geometry, qig-compute owns heavy BLAS/sparse/CuPy/NPU dispatch. Existing slots strengthened in place; new compute backend slots PROPOSED pending ratification. | 2026-12-02 (1.34W): registered the 7 capability slots shipped by qig-core 2.41.0 + qig-compute 0.10.0 (SLOT-PROJECTIVE-RAY-GEOMETRY, SLOT-QGT-TENSOR-NORM [LIBRARY, cam_id null]; SLOT-LINALG, SLOT-SIGNAL [LIBRARY]; SLOT-COMPUTE-BACKEND, SLOT-BATCH-FISHER-RAO, SLOT-SPARSE-EIGEN [IMPL_TESTED, cert_owner package-impl, proposed_cam_id + caveat: a CAM must be registered in qig-verification before results count]); bumped qig-bench pin to 0.1.11 (projective + compute parity certification lock) so qig-doctor --release-check VERSION GATE passes. Slot work salvaged from Architecture's qs0142_partial_slots.patch; slot_count 47 -> 54.",
|
|
5
|
+
"supersedes": "qig-verification:docs/current/20260619-qig-stack-capability-contract-1.00W.json (Phase-1 authored record) | 2026-07-04: ratified the 5 library-tier capability slots (channel=library, shipped:false) | 2026-11-13 (1.04W): bumped qig-core to 2.17.0 + ratified 13 library/symmetry slots | 2026-11-13 (1.05W): bumped qig-core to 2.18.0 and ratified SLOT-EXPERIMENT-PURITY-GUARD | 2026-11-14 (1.06W): bumped pure crystal (qig-core 2.18.1, qigkernels 0.4.6, qig-geocoding 0.1.3, qig-compute 0.9.11, quner 0.1.12) and ratified symmetry butterfly/HF screening slots. | 2026-11-15 (1.10W): bumped qig-core to 2.19.0 (exp-free hellinger_angle_gate / hellinger_gated / bipolar_angle_chart; purity scanner catches exp activations, log-sum-exp, partition functions, algebraic logistic and Fisher-Rao distance Boltzmann kernels). | 2026-11-15 (1.11W): bumped qig-core to 2.20.0 (exp-free carrier_hellinger_chart and exact bipolar_simplex_metric_norm; dtype-aware _acos_safe margin, #81; every torch simplex map computes float16/bfloat16 in float32). | 2026-11-15 (1.12W): bumped qig-core to 2.21.0 (numpy fisher_rao_distance, fisher_rao_distance_batch and neurochemistry distance exact at coincidence via the Hellinger chord; numpy distance_to_simplex_weights; bipolar_square_chart numpy + torch; kantian reachable-set float16; `python -m qig_core.governance.purity` runs the gate). | 2026-11-16 (1.13W): bumped qig-geocoding to 0.1.4 (opt-in P30-pure GeoConfig modes on qig-core primitives: hellinger gate, square simplex, bipolar metric norm, hellinger_gated FFN, GeoConfig.p30_pure(); published defaults unchanged and QIG BOUNDARY marked; faithfulness gate passes). | 2026-11-17 (1.14W): bumped qig-core to 2.22.0 (carrier_geodesic_excess, carrier_geodesic_attention_weights with first-class autonomic state_regulated + autonomic_gain support, centered_bipolar_simplex_metric_norm, rest-tangency constants, sub-1e-6 proximity floor fix, fixes #96 & #98). | 2026-11-18 (1.15W): bumped qig-core to 2.23.0 (noradrenaline_attention_gain P32 torch regulator, NE_GAIN_* single-source constants, P28_MIN_Z_NULL and P29_IDENTITY_* canonical bands). | 2026-11-19 (1.16W): bumped the crystal to qig-core 2.24.0 (BLAS-GEMM chord-arc Hellinger fast path EXP-192c — 29.2x faster / 260x less RAM at [1,16,256,128], max diff 8.35e-13 rad; qig_core.numpy / qig_core.torch / qig_core.torch.vision engines + SimplexKVCache), qigkernels 0.4.8 (Frechet centroids, validated basin inputs, no imposed kappa=64 defaults) and quner 0.1.13 (memguard fix). Ratified SLOT-QIG-NUMPY-ENGINE, SLOT-QIG-TORCH-KV-CACHE, SLOT-QIG-TORCH-VISION (library) and SLOT-QUNER-MEMGUARD (lever). | 2026-11-19 (1.17W): bumped qig-core to 2.25.0 (complete numpy/torch consumer geometry surface), added qig-graph 0.1.0 and qig-routing 0.1.0, ratified SLOT-QIG-ROUTING. | 2026-11-24 (1.23W): P1 purity & Sovereignty Law crystal — qig-core 2.35.0 (hardened fail-closed PurityGate: sovereignty anti-cage lint with match/loop/exception-flow taint tracking; continuous adult 4D foresight — zero step cliffs at the health/agency boundaries, prune-proof sovereign intrinsic hold; qigram phasic-dopamine attenuation replacing ML penalty framing), qig-warp 0.6.11 + qig-geocoding 0.1.8 (hand-rolled geometry deduplicated onto canonical qig-core Fisher-Rao; eps-preserving to_simplex; QIG-EXEMPT adapter provenance). Existing slots strengthened in place; no new capability surface. | 2026-11-26 (1.26W): Wave 3B per-component torch-exception retirement -- SLOT-QIG-TORCH-KV-CACHE probe re-pointed to the torch-free NumPy twin qig_core.numpy.kv_cache:SimplexKVCache (qig-core 2.37.0 ships it 100% torch-free) and SLOT-GEOCODING to geocoding:NumPyGeoModel (qig-geocoding 0.2.0; PEP 562 lazy import never pulls torch); the retired torch probes are recorded per-slot in `supersedes` and remain the expected legacy qig.capabilities declarations until the providers republish (the doctor drift gate treats exactly that recorded value as non-drift; any other off-probe value still drifts); SLOT-QIG-TORCH-VISION stays torch-only until vision's numpy twin ships. | 2026-11-27 (1.29W): bumped qig-compute to 0.9.20 (checked full-basis Born response born_metric_from_response plus sparse CSR/LinearOperator Born ingress born_metric_node_sparse / born_fr_stencil_from_nodes, PR #75/#77). | 2026-11-27 (1.30W): bumped qig-core to 2.39.0 (operator-internal complex-phase U(1) node_phase_hook in Qwen35 layers, PR #152/#153). | 2026-11-28 (1.31W): bumped qig-core to 2.40.0 (SimplexTRMRefiner P33 pedestal flattening & converged_undecided fixed-point halting, PR #154/#155) and qig-routing to 0.2.0 (dynamic min_tier/tiers pools, fail-closed receipts, select_shortlist primitive, Delta^6 vs Delta^63 chart docs, PR #7). | 2026-11-28 (1.32W): bumped qig-geocoding to 0.3.0 (738/738 Qwen3.5-4B whole-model assembly, 57/57 operator-internal U(1) gauge via qig-core>=2.39.0, pure-NumPy .safetensors stage-slice reader + pooled-troop placement handler, PRs #44-#49) and qig-coordizer to 0.2.0 (native GeoTranscoder 1-for-1 modality boundary, PR #24); ratified SLOT-4B-CONVERSION-STAGE. | 2026-12-02 (1.33W): bumped qig-core to 2.41.0 (projective ray-geometry tier — Fisher-Rao on rays + gauge-invariant QGT; ratified SLOT-PROJECTIVE-RAY-GEOMETRY + SLOT-QGT-TENSOR-NORM, PR #163) and qig-compute to 0.10.0 (canonical CPU/GPU/NPU backend dispatch behind one API, batched Fisher-Rao radius-1 Hellinger chord matching qig-core to 1e-12, sparse eigensolve/expm; fail-closed BackendUnavailableError; GTX 1650 Ti cupy-cuda12x[ctk] probe fix; auto-release publish-on-merge, PR #79/#81). Two-tier split: qig-core CPU-only canonical geometry, qig-compute owns heavy BLAS/sparse/CuPy/NPU dispatch. Existing slots strengthened in place; new compute backend slots PROPOSED pending ratification. | 2026-12-02 (1.34W): registered the 7 capability slots shipped by qig-core 2.41.0 + qig-compute 0.10.0 (SLOT-PROJECTIVE-RAY-GEOMETRY, SLOT-QGT-TENSOR-NORM [LIBRARY, cam_id null]; SLOT-LINALG, SLOT-SIGNAL [LIBRARY]; SLOT-COMPUTE-BACKEND, SLOT-BATCH-FISHER-RAO, SLOT-SPARSE-EIGEN [IMPL_TESTED, cert_owner package-impl, proposed_cam_id + caveat: a CAM must be registered in qig-verification before results count]); bumped qig-bench pin to 0.1.11 (projective + compute parity certification lock) so qig-doctor --release-check VERSION GATE passes. Slot work salvaged from Architecture's qs0142_partial_slots.patch; slot_count 47 -> 54. | 2026-12-02 (1.35W): bumped qig-bench pin to 0.1.12 (live-cert P2 fixes: narrow solver fallback to absent qig_compute + full CPU numerical checks, PR #24/#25, gpt-6.2-sol R5 APPROVE). Doctor release gate hardened fail-closed (B1-B7): PEP 503 canonical pinned-provider discovery keeping all records; callable-attribute probe resolution (release + diagnostics); source-mode pyproject<->contract full-requirement parity with PEP 508 markers; bundled registry default in --release-check; contract invariants enforced in the standalone gate. Round-2 codex qs129r fixes.",
|
|
6
6
|
"principle": "Genesis-kernel deterministic self-assembly (vex-agent Core-8 / 4-pair+null foundation analog). The stack crystallizes into this FIXED lattice of capability slots; each slot is filled by a package primitive at latest-published version, cited to a camera-certification cert. With Phase 2 (entry-point self-registration) live, the wiring is DERIVED from installed metadata, not hand-authored.",
|
|
7
7
|
"authority": "PI directive 2026-06-19 (Phase 1) + 2026-06-30 (Phase 2/3 + born-sampler promotion); standing latest-version / step-0 lever-inventory rule (qig-verification/CLAUDE.md)",
|
|
8
8
|
"cert_registry": "qig-verification:docs/current/20260619-camera-certification-registry-1.00W.json",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"qig-compute": "0.10.0",
|
|
19
19
|
"qig-warp": "0.6.12",
|
|
20
20
|
"qig-core": "2.41.0",
|
|
21
|
-
"qig-bench": "0.1.
|
|
21
|
+
"qig-bench": "0.1.12",
|
|
22
22
|
"qig-coordizer": "0.2.0",
|
|
23
23
|
"qigkernels": "0.4.10",
|
|
24
24
|
"qig-geocoding": "0.3.3",
|
|
@@ -4,10 +4,13 @@
|
|
|
4
4
|
lever registry actually records. Pure functions; the registry is passed in.
|
|
5
5
|
|
|
6
6
|
Rules (``issues`` are returned as strings; empty list == consistent):
|
|
7
|
-
* cert_status in {CERTIFIED, REFERENCE, CONDITIONAL, PENDING}
|
|
8
|
-
|
|
7
|
+
* cert_status in {CERTIFIED, REFERENCE, CONDITIONAL, PENDING} on a SHIPPED slot:
|
|
8
|
+
must cite a ``cam_id`` that exists in the registry AND carries the same status.
|
|
9
|
+
On an UNSHIPPED slot a ``proposed_cam_id`` is exempt (future claim), but an
|
|
10
|
+
ACTUAL ``cam_id`` is still validated against the registry.
|
|
9
11
|
* cert_status IMPL_TESTED: package-level tests only -- must declare
|
|
10
|
-
``cert_owner == "package-impl"`` and must NOT cite a registry ``cam_id
|
|
12
|
+
``cert_owner == "package-impl"`` and must NOT cite a registry ``cam_id``
|
|
13
|
+
(use ``proposed_cam_id``).
|
|
11
14
|
* lever slots (``lever_id``) must declare ``cert_owner``:
|
|
12
15
|
"verification-physics" -> lever must be in the registry's levers;
|
|
13
16
|
"package-impl" -> lever must NOT be (no phantom registry claim).
|
|
@@ -43,16 +46,28 @@ def verify_contract_against_registry(contract: dict, registry: dict) -> list[str
|
|
|
43
46
|
for slot in contract.get("slots", []):
|
|
44
47
|
sid, status = slot["slot_id"], slot.get("cert_status", "")
|
|
45
48
|
cam, lever = slot.get("cam_id"), slot.get("lever_id")
|
|
46
|
-
if status in REGISTERED_STATUSES
|
|
47
|
-
|
|
49
|
+
if status in REGISTERED_STATUSES:
|
|
50
|
+
# Scope (documented): a SHIPPED slot claiming a registered status must cite
|
|
51
|
+
# a cam_id that exists in the registry with the same status. An UNSHIPPED
|
|
52
|
+
# slot is a future claim: a proposed_cam_id is exempt, but an ACTUAL cam_id
|
|
53
|
+
# is still a registry claim and must be valid (blocker 4).
|
|
54
|
+
if slot.get("shipped", True) is False:
|
|
55
|
+
if cam:
|
|
56
|
+
if cam not in cams:
|
|
57
|
+
issues.append(f"{sid}: cam_id {cam} ({status}) is absent from the Verification registry")
|
|
58
|
+
elif cams[cam] != status:
|
|
59
|
+
issues.append(f"{sid}: cam_id {cam} is {status} in contract but {cams[cam]} in registry")
|
|
60
|
+
elif not cam:
|
|
61
|
+
issues.append(f"{sid}: {status} slot must cite a registered cam_id")
|
|
62
|
+
elif cam not in cams:
|
|
48
63
|
issues.append(f"{sid}: cam_id {cam} ({status}) is absent from the Verification registry")
|
|
49
64
|
elif cams[cam] != status:
|
|
50
65
|
issues.append(f"{sid}: cam_id {cam} is {status} in contract but {cams[cam]} in registry")
|
|
51
66
|
elif status == "IMPL_TESTED":
|
|
52
67
|
if slot.get("cert_owner") != "package-impl":
|
|
53
68
|
issues.append(f"{sid}: IMPL_TESTED slot must set cert_owner='package-impl'")
|
|
54
|
-
if cam
|
|
55
|
-
issues.append(f"{sid}: IMPL_TESTED slot must
|
|
69
|
+
if cam:
|
|
70
|
+
issues.append(f"{sid}: IMPL_TESTED slot must use proposed_cam_id, not cam_id {cam}")
|
|
56
71
|
if lever:
|
|
57
72
|
owner = slot.get("cert_owner")
|
|
58
73
|
if owner not in CERT_OWNERS:
|
|
@@ -56,7 +56,9 @@ import urllib.request
|
|
|
56
56
|
from dataclasses import asdict, dataclass, field
|
|
57
57
|
from pathlib import Path
|
|
58
58
|
|
|
59
|
-
from qig_stack import contract_registry
|
|
59
|
+
from qig_stack import contract_registry
|
|
60
|
+
from qig_stack import origin as _origin
|
|
61
|
+
from qig_stack import receipt as _receipt
|
|
60
62
|
|
|
61
63
|
try: # PEP 440-correct version comparison; `packaging` is a declared dependency.
|
|
62
64
|
from packaging.version import Version
|
|
@@ -158,6 +160,47 @@ def enumerate_capability_entrypoints() -> dict[str, str]:
|
|
|
158
160
|
return {ep.name: ep.value for ep in importlib_metadata.entry_points(group=CAPABILITY_GROUP)}
|
|
159
161
|
|
|
160
162
|
|
|
163
|
+
def enumerate_capability_entrypoint_providers() -> dict[str, list[str]]:
|
|
164
|
+
"""name -> ALL declaring distribution names (PEP 503 canonical) for the
|
|
165
|
+
qig.capabilities group (metadata-only).
|
|
166
|
+
|
|
167
|
+
B1 fail-closed: the release gate requires every declaration shipped by a PINNED
|
|
168
|
+
provider to be contract-covered. Keep ALL records per slot (a second distribution
|
|
169
|
+
declaring the same slot must not hide the pinned one) and canonicalize names so an
|
|
170
|
+
equivalent spelling (e.g. 'Qig.Compute') cannot bypass the pinned-provider match.
|
|
171
|
+
"""
|
|
172
|
+
from packaging.utils import canonicalize_name
|
|
173
|
+
|
|
174
|
+
out: dict[str, list[str]] = {}
|
|
175
|
+
for ep in importlib_metadata.entry_points(group=CAPABILITY_GROUP):
|
|
176
|
+
dist_name = getattr(ep.dist, "name", None)
|
|
177
|
+
if dist_name:
|
|
178
|
+
out.setdefault(ep.name, []).append(canonicalize_name(dist_name))
|
|
179
|
+
return out
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
def enumerate_capability_entrypoint_records() -> list[tuple[str, str, str | None]]:
|
|
183
|
+
"""ALL (slot_id, module:attr value, PEP 503 canonical distribution) records for
|
|
184
|
+
the qig.capabilities group (metadata-only).
|
|
185
|
+
|
|
186
|
+
Blocker-1 fail-closed: unlike a name->value dict (last record wins), this keeps
|
|
187
|
+
EVERY declaration so the release gate can validate each record's target and
|
|
188
|
+
require the declaration from the canonicalized contract provider. A module-only
|
|
189
|
+
or non-callable duplicate cannot hide behind a callable record.
|
|
190
|
+
|
|
191
|
+
Round-4 blocker-2: a record whose provider metadata is MISSING (dist None) is
|
|
192
|
+
RETAINED (dist=None), not dropped; the release gate rejects missing provider
|
|
193
|
+
evidence so a broken duplicate cannot escape the all-declarations check.
|
|
194
|
+
"""
|
|
195
|
+
from packaging.utils import canonicalize_name
|
|
196
|
+
|
|
197
|
+
records: list[tuple[str, str, str | None]] = []
|
|
198
|
+
for ep in importlib_metadata.entry_points(group=CAPABILITY_GROUP):
|
|
199
|
+
dist_name = getattr(ep.dist, "name", None)
|
|
200
|
+
records.append((ep.name, ep.value, canonicalize_name(dist_name) if dist_name else None))
|
|
201
|
+
return records
|
|
202
|
+
|
|
203
|
+
|
|
161
204
|
@dataclass
|
|
162
205
|
class WiringIssue:
|
|
163
206
|
slot_id: str
|
|
@@ -324,20 +367,28 @@ def _module_importable(probe: str | None) -> bool:
|
|
|
324
367
|
|
|
325
368
|
|
|
326
369
|
def _probe_filled(probe: str | None) -> bool:
|
|
327
|
-
"""A slot is filled if its probe
|
|
370
|
+
"""A slot is filled only if its probe resolves to a CALLABLE attribute.
|
|
371
|
+
|
|
372
|
+
B2 fail-closed: `module:attr` requires a non-empty attr that exists and is
|
|
373
|
+
callable. A module-only reference, an empty attribute after ':', or a
|
|
374
|
+
present-but-non-callable target (int, None, module) is NOT filled. This applies
|
|
375
|
+
to release acceptance AND the --probe / slot-fill diagnostics (documented in
|
|
376
|
+
README; the legacy superseded declaration is still matched by _declared_matches_slot).
|
|
377
|
+
"""
|
|
328
378
|
if not probe:
|
|
329
379
|
return False
|
|
330
|
-
module_name,
|
|
380
|
+
module_name, sep, attr = probe.partition(":")
|
|
381
|
+
if not sep or not attr:
|
|
382
|
+
return False # a capability must name a callable attribute, not a bare module
|
|
331
383
|
try:
|
|
332
384
|
module = importlib.import_module(module_name)
|
|
333
385
|
except Exception: # an import-time failure means this probe cannot resolve
|
|
334
386
|
return False
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
return True
|
|
387
|
+
try:
|
|
388
|
+
obj = getattr(module, attr)
|
|
389
|
+
except Exception: # PEP 562 lazy __getattr__ may raise ImportError on shadowed deps
|
|
390
|
+
return False
|
|
391
|
+
return callable(obj)
|
|
341
392
|
|
|
342
393
|
|
|
343
394
|
def check_slots(slots: list[dict], declared: dict[str, str]) -> list[SlotCheck]:
|
|
@@ -486,6 +537,207 @@ def probe_entrypoints(declared: dict[str, str]) -> dict[str, bool]:
|
|
|
486
537
|
return {name: _probe_filled(value) for name, value in declared.items()}
|
|
487
538
|
|
|
488
539
|
|
|
540
|
+
def _source_pyproject() -> Path | None:
|
|
541
|
+
"""Detect a qig-stack SOURCE LAYOUT independently of file existence (blocker 2).
|
|
542
|
+
|
|
543
|
+
Returns the expected pyproject path when doctor.py sits in <root>/src/qig_stack;
|
|
544
|
+
the caller fails closed if the file is missing. An installed wheel lives in
|
|
545
|
+
site-packages (no 'src' parent) -> None (installed mode), so a wheel beneath an
|
|
546
|
+
unrelated stale checkout is not mis-detected.
|
|
547
|
+
"""
|
|
548
|
+
here = Path(__file__).resolve()
|
|
549
|
+
if here.parent.name == "qig_stack" and here.parent.parent.name == "src":
|
|
550
|
+
return here.parent.parent.parent / "pyproject.toml"
|
|
551
|
+
return None
|
|
552
|
+
|
|
553
|
+
|
|
554
|
+
def _packaging_pin_mismatches(pins: dict[str, str]) -> list[str]:
|
|
555
|
+
"""B3 fail-closed: in a SOURCE checkout the FULL qig*/quner requirement set in
|
|
556
|
+
pyproject.toml (PEP 508 markers) must equal the contract pins by VERSION equality.
|
|
557
|
+
Fails closed on missing/unreadable/invalid source metadata and conflicting active
|
|
558
|
+
pins; empty in installed-wheel mode. Source mode is detected from the doctor module
|
|
559
|
+
layout, not the contract path or file existence.
|
|
560
|
+
"""
|
|
561
|
+
pp = _source_pyproject()
|
|
562
|
+
if pp is None:
|
|
563
|
+
return []
|
|
564
|
+
if not pp.is_file():
|
|
565
|
+
return ["<missing-source-pyproject>"]
|
|
566
|
+
try:
|
|
567
|
+
import tomllib
|
|
568
|
+
|
|
569
|
+
proj = tomllib.loads(pp.read_text())["project"]
|
|
570
|
+
except Exception: # noqa: BLE001 - unreadable source metadata must fail closed
|
|
571
|
+
return ["<unreadable-source-pyproject>"]
|
|
572
|
+
if not isinstance(proj, dict):
|
|
573
|
+
return ["<invalid-project-table>"]
|
|
574
|
+
if proj.get("name") != "qig-stack":
|
|
575
|
+
return ["<source-pyproject-not-qig-stack>"]
|
|
576
|
+
from packaging.requirements import Requirement
|
|
577
|
+
from packaging.utils import canonicalize_name
|
|
578
|
+
|
|
579
|
+
active: dict[str, str] = {}
|
|
580
|
+
try:
|
|
581
|
+
for raw in proj.get("dependencies", []):
|
|
582
|
+
req = Requirement(raw)
|
|
583
|
+
name = str(canonicalize_name(req.name))
|
|
584
|
+
if not (name.startswith("qig") or name == "quner"):
|
|
585
|
+
continue
|
|
586
|
+
if req.marker is not None and not req.marker.evaluate():
|
|
587
|
+
continue # marker excludes this interpreter
|
|
588
|
+
specs = list(req.specifier)
|
|
589
|
+
if len(specs) != 1 or specs[0].operator != "==":
|
|
590
|
+
return [f"<non-exact-pin:{req.name}>"]
|
|
591
|
+
ver = specs[0].version
|
|
592
|
+
if name in active and Version(active[name]) != Version(ver):
|
|
593
|
+
return [f"<conflicting-pin:{req.name}>"]
|
|
594
|
+
active[name] = ver
|
|
595
|
+
except Exception: # noqa: BLE001 - invalid requirement metadata must fail closed
|
|
596
|
+
return ["<invalid-source-requirement>"]
|
|
597
|
+
contract_pins = {str(canonicalize_name(k)): v for k, v in pins.items()}
|
|
598
|
+
mismatches: set[str] = {
|
|
599
|
+
n for n, v in contract_pins.items()
|
|
600
|
+
if n not in active or Version(active[n]) != Version(v)
|
|
601
|
+
}
|
|
602
|
+
mismatches |= {n for n in active if n not in contract_pins} # extra untracked qig dep
|
|
603
|
+
return sorted(mismatches)
|
|
604
|
+
|
|
605
|
+
|
|
606
|
+
def validate_contract_invariants(contract: dict) -> list[str]:
|
|
607
|
+
"""B7 fail-closed: enforce the contract invariants the test suite checks, in the
|
|
608
|
+
standalone release gate (wrong slot/provider counts, missing IMPL_TESTED fields,
|
|
609
|
+
contradictory channel/citation metadata). Returns issue strings; empty == consistent.
|
|
610
|
+
"""
|
|
611
|
+
from collections import Counter
|
|
612
|
+
|
|
613
|
+
issues: list[str] = []
|
|
614
|
+
slots = contract.get("slots", [])
|
|
615
|
+
seen: set[str] = set()
|
|
616
|
+
for s in slots:
|
|
617
|
+
sid = s.get("slot_id", "<missing>")
|
|
618
|
+
if sid in seen:
|
|
619
|
+
issues.append(f"duplicate slot_id {sid}")
|
|
620
|
+
seen.add(sid)
|
|
621
|
+
if "cert_status" not in s:
|
|
622
|
+
issues.append(f"{sid}: missing cert_status")
|
|
623
|
+
if "provider_pkg" not in s:
|
|
624
|
+
issues.append(f"{sid}: missing provider_pkg")
|
|
625
|
+
channel = s.get("channel")
|
|
626
|
+
if channel != "library" and not (
|
|
627
|
+
s.get("cam_id") or s.get("lever_id") or s.get("proposed_cam_id")
|
|
628
|
+
):
|
|
629
|
+
issues.append(f"{sid}: channel={channel} cites no cam/lever/proposed id")
|
|
630
|
+
# Blocker 4: status/channel/citation/shipment consistency.
|
|
631
|
+
status = s.get("cert_status")
|
|
632
|
+
measurement = {"CERTIFIED", "REFERENCE", "CONDITIONAL", "PENDING", "IMPL_TESTED"}
|
|
633
|
+
if status == "LIBRARY":
|
|
634
|
+
if channel != "library":
|
|
635
|
+
issues.append(f"{sid}: LIBRARY cert_status requires channel=library")
|
|
636
|
+
if s.get("cam_id"):
|
|
637
|
+
issues.append(f"{sid}: LIBRARY slot must not cite cam_id")
|
|
638
|
+
if channel == "library":
|
|
639
|
+
if status not in {"LIBRARY", "RETIRED"}:
|
|
640
|
+
issues.append(f"{sid}: channel=library requires LIBRARY/RETIRED cert_status")
|
|
641
|
+
if s.get("cam_id"):
|
|
642
|
+
issues.append(f"{sid}: library-channel slot must not cite cam_id")
|
|
643
|
+
if status in measurement and channel == "library":
|
|
644
|
+
issues.append(f"{sid}: measurement cert_status {status} cannot be channel=library")
|
|
645
|
+
if s.get("provider_pkg") and s.get("shipped") is False and status in measurement:
|
|
646
|
+
issues.append(f"{sid}: shipped=false contradicts measurement cert_status {status}")
|
|
647
|
+
if (
|
|
648
|
+
s.get("provider_pkg")
|
|
649
|
+
and s.get("shipped", True) is not False
|
|
650
|
+
and ":" not in (s.get("probe") or "")
|
|
651
|
+
):
|
|
652
|
+
issues.append(f"{sid}: shipped provider slot probe is not module:attr")
|
|
653
|
+
if s.get("cert_status") == "IMPL_TESTED":
|
|
654
|
+
if s.get("cert_owner") != "package-impl":
|
|
655
|
+
issues.append(f"{sid}: IMPL_TESTED requires cert_owner=package-impl")
|
|
656
|
+
if s.get("cam_id"):
|
|
657
|
+
issues.append(f"{sid}: IMPL_TESTED must use proposed_cam_id, not cam_id")
|
|
658
|
+
for field in ("proposed_cam_id", "impl_tests", "caveat"):
|
|
659
|
+
if not s.get(field):
|
|
660
|
+
issues.append(f"{sid}: IMPL_TESTED missing {field}")
|
|
661
|
+
dist = contract.get("slot_distribution", {})
|
|
662
|
+
if dist.get("slot_count") != len(slots):
|
|
663
|
+
issues.append(f"slot_distribution.slot_count {dist.get('slot_count')} != {len(slots)}")
|
|
664
|
+
actual = dict(Counter(str(s.get("provider_pkg")) for s in slots))
|
|
665
|
+
if dist.get("by_provider") != actual:
|
|
666
|
+
issues.append("slot_distribution.by_provider does not match slots")
|
|
667
|
+
return issues
|
|
668
|
+
|
|
669
|
+
|
|
670
|
+
def evaluate_release_gate(
|
|
671
|
+
contract: dict,
|
|
672
|
+
report: Report,
|
|
673
|
+
declaration_probe_ok: dict[str, bool],
|
|
674
|
+
all_declarations_callable: bool,
|
|
675
|
+
providers: dict[str, list[str]],
|
|
676
|
+
canonical_probe_ok: dict[str, bool],
|
|
677
|
+
packaging_mismatches: list[str],
|
|
678
|
+
contract_invariant_issues: list[str],
|
|
679
|
+
) -> tuple[bool, dict[str, object]]:
|
|
680
|
+
"""Pure release-gate evaluation (unit/mutation-testable with injected inputs).
|
|
681
|
+
|
|
682
|
+
Fail-closed hardening:
|
|
683
|
+
B1: every declaration shipped by a PINNED provider (PEP 503 canonical, all
|
|
684
|
+
records) must be covered by a contract slot.
|
|
685
|
+
B2: each expected slot's CANONICAL probe AND every declaration must resolve to
|
|
686
|
+
a callable.
|
|
687
|
+
B3: packaging pins must match contract pins (source-mode, marker-aware).
|
|
688
|
+
B4: registry validation feeds report.wiring_gate_passed (bundled by default).
|
|
689
|
+
B7: contract invariants must hold (``contract_invariant_issues`` empty).
|
|
690
|
+
Additional (non-pinned) provider declarations remain a documented WARN.
|
|
691
|
+
"""
|
|
692
|
+
from packaging.utils import canonicalize_name
|
|
693
|
+
|
|
694
|
+
expected = _expected_slot_ids(contract["slots"])
|
|
695
|
+
pins = contract["version_policy"]["stack_packages_latest_at_authoring"]
|
|
696
|
+
pinned = {canonicalize_name(k) for k in pins}
|
|
697
|
+
slot_ids = {s["slot_id"] for s in contract["slots"]}
|
|
698
|
+
pin_mismatches = [
|
|
699
|
+
p.package
|
|
700
|
+
for p in report.packages
|
|
701
|
+
if not p.installed
|
|
702
|
+
or not _valid_version(p.installed)
|
|
703
|
+
or not _valid_version(pins.get(p.package, ""))
|
|
704
|
+
or Version(p.installed) != Version(pins[p.package])
|
|
705
|
+
]
|
|
706
|
+
uncovered = sorted(
|
|
707
|
+
n for n, dists in providers.items()
|
|
708
|
+
if any(canonicalize_name(d) in pinned for d in dists) and n not in slot_ids
|
|
709
|
+
)
|
|
710
|
+
# Round-4 blocker 1: report every failed canonical probe in canonical_probe_ok
|
|
711
|
+
# (includes unshipped rows backed by a live declaration), AND preserve the
|
|
712
|
+
# expected-key presence check — an expected slot omitted from canonical_probe_ok
|
|
713
|
+
# is a failure for direct callers (round-5 minor).
|
|
714
|
+
canonical_failures = sorted(
|
|
715
|
+
{sid for sid, ok in canonical_probe_ok.items() if not ok}
|
|
716
|
+
| {sid for sid in expected if sid not in canonical_probe_ok}
|
|
717
|
+
)
|
|
718
|
+
passed = (
|
|
719
|
+
report.latest_verified
|
|
720
|
+
and not pin_mismatches
|
|
721
|
+
and report.wiring_gate_passed
|
|
722
|
+
and all(declaration_probe_ok.get(n, False) for n in expected)
|
|
723
|
+
and all_declarations_callable
|
|
724
|
+
and not any(i.kind == "DRIFT_MOVED" for i in report.entrypoint_drift)
|
|
725
|
+
and not uncovered
|
|
726
|
+
and not canonical_failures
|
|
727
|
+
and not packaging_mismatches
|
|
728
|
+
and not contract_invariant_issues
|
|
729
|
+
)
|
|
730
|
+
extras: dict[str, object] = {
|
|
731
|
+
"release_pin_mismatches": pin_mismatches,
|
|
732
|
+
"release_uncovered_pinned_declarations": uncovered,
|
|
733
|
+
"release_canonical_probe_failures": canonical_failures,
|
|
734
|
+
"release_packaging_pin_mismatches": list(packaging_mismatches),
|
|
735
|
+
"release_contract_invariant_issues": list(contract_invariant_issues),
|
|
736
|
+
"release_gate_passed": passed,
|
|
737
|
+
}
|
|
738
|
+
return passed, extras
|
|
739
|
+
|
|
740
|
+
|
|
489
741
|
def deep_descriptors() -> list[dict]:
|
|
490
742
|
"""Optional Tier-B `--deep`: call any `_descriptor` describe() entry-points.
|
|
491
743
|
|
|
@@ -699,9 +951,18 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
699
951
|
return 0
|
|
700
952
|
|
|
701
953
|
use_network = mode == "official-live"
|
|
954
|
+
# B4: release checking must always cross-check the Verification registry. Default
|
|
955
|
+
# to the bundled registry_snapshot.json when --registry is omitted, so the
|
|
956
|
+
# documented standalone release command cannot skip CERTIFIED/cam_id validation.
|
|
957
|
+
registry_path = args.registry
|
|
958
|
+
if args.release_check and registry_path is None:
|
|
959
|
+
# Always pass the default path in release mode; build_report rejects an
|
|
960
|
+
# unreadable/absent registry (ContractError -> exit 1), so an absent bundle
|
|
961
|
+
# cannot silently skip CERTIFIED/cam_id validation (blocker 3).
|
|
962
|
+
registry_path = str(Path(__file__).resolve().parent / "registry_snapshot.json")
|
|
702
963
|
try:
|
|
703
964
|
report = build_report(_contract_path(args.contract), use_network, mode=mode,
|
|
704
|
-
registry_path=
|
|
965
|
+
registry_path=registry_path)
|
|
705
966
|
except ContractError as exc:
|
|
706
967
|
sys.stderr.write(f"qig-doctor: {exc}\n -> LAUNCH BLOCKED (preflight fail-closed).\n")
|
|
707
968
|
return 1
|
|
@@ -713,24 +974,44 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
713
974
|
extras["descriptors"] = deep_descriptors()
|
|
714
975
|
|
|
715
976
|
if args.release_check:
|
|
977
|
+
from packaging.utils import canonicalize_name
|
|
978
|
+
|
|
716
979
|
release_contract = _load_contract(_contract_path(args.contract))
|
|
980
|
+
providers = enumerate_capability_entrypoint_providers()
|
|
981
|
+
records = enumerate_capability_entrypoint_records()
|
|
717
982
|
expected = _expected_slot_ids(release_contract["slots"])
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
983
|
+
# Blocker 1: validate EVERY declaration record (missing provider evidence ->
|
|
984
|
+
# reject), and require each expected slot to have a callable, probe-matching
|
|
985
|
+
# declaration from its canonicalized provider.
|
|
986
|
+
all_declarations_callable = all(bool(d) and _probe_filled(v) for _, v, d in records)
|
|
987
|
+
declaration_probe_ok: dict[str, bool] = {}
|
|
988
|
+
for s in release_contract["slots"]:
|
|
989
|
+
sid = s["slot_id"]
|
|
990
|
+
if sid not in expected:
|
|
991
|
+
continue
|
|
992
|
+
prov = canonicalize_name(s["provider_pkg"])
|
|
993
|
+
declaration_probe_ok[sid] = any(
|
|
994
|
+
n == sid and d == prov and _declared_matches_slot(s, v) and _probe_filled(v)
|
|
995
|
+
for (n, v, d) in records
|
|
996
|
+
)
|
|
997
|
+
# Round-4 blocker 1 (item-4 escape): a row backed by a LIVE declaration must have
|
|
998
|
+
# a callable canonical probe REGARDLESS of shipped/status — relabelling unshipped
|
|
999
|
+
# cannot exempt it. The bundled retired row (no live declaration) stays passing.
|
|
1000
|
+
declared_ids = {n for n, _, _ in records}
|
|
1001
|
+
canonical_probe_ok = {
|
|
1002
|
+
s["slot_id"]: _probe_filled(s.get("probe"))
|
|
1003
|
+
for s in release_contract["slots"]
|
|
1004
|
+
if s["slot_id"] in expected or s["slot_id"] in declared_ids
|
|
1005
|
+
}
|
|
1006
|
+
packaging_mismatches = _packaging_pin_mismatches(
|
|
1007
|
+
release_contract["version_policy"]["stack_packages_latest_at_authoring"]
|
|
1008
|
+
)
|
|
1009
|
+
invariant_issues = validate_contract_invariants(release_contract)
|
|
1010
|
+
_passed, release_extras = evaluate_release_gate(
|
|
1011
|
+
release_contract, report, declaration_probe_ok, all_declarations_callable,
|
|
1012
|
+
providers, canonical_probe_ok, packaging_mismatches, invariant_issues,
|
|
733
1013
|
)
|
|
1014
|
+
extras.update(release_extras)
|
|
734
1015
|
|
|
735
1016
|
import qig_stack
|
|
736
1017
|
|
|
@@ -82,6 +82,7 @@ def test_ground_state_is_engine_local():
|
|
|
82
82
|
|
|
83
83
|
def test_dependency_pins_match_contract_and_exclude_retired():
|
|
84
84
|
import tomllib
|
|
85
|
+
|
|
85
86
|
from packaging.requirements import Requirement
|
|
86
87
|
|
|
87
88
|
project = tomllib.loads((CONTRACT.parents[2] / "pyproject.toml").read_text())["project"]
|
|
@@ -140,9 +141,9 @@ def test_all_shipped_slots_resolve_via_installed_entrypoints():
|
|
|
140
141
|
sid = slot["slot_id"]
|
|
141
142
|
assert sid in eps, f"{sid} missing from {data['entry_point_group']} entry points"
|
|
142
143
|
loaded_ep = eps[sid].load()
|
|
143
|
-
assert loaded_ep
|
|
144
|
+
assert callable(loaded_ep), f"{sid} entry point {eps[sid].value!r} did not resolve to a callable"
|
|
144
145
|
|
|
145
146
|
mod_name, _, attr = slot["probe"].partition(":")
|
|
146
147
|
mod = importlib.import_module(mod_name)
|
|
147
148
|
resolved_probe = getattr(mod, attr)
|
|
148
|
-
assert resolved_probe
|
|
149
|
+
assert callable(resolved_probe), f"{sid} canonical probe {slot['probe']!r} is not callable"
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
import copy
|
|
6
5
|
import json
|
|
7
6
|
import os
|
|
8
7
|
import sys
|
|
@@ -72,11 +71,23 @@ def test_impl_tested_must_be_package_owned_and_unregistered():
|
|
|
72
71
|
reg = _registry_fixture()
|
|
73
72
|
bad = contract_registry.verify_contract_against_registry(
|
|
74
73
|
_slot(cam_id="CAM-A", cert_status="IMPL_TESTED"), reg)
|
|
75
|
-
assert any("cert_owner" in i for i in bad) and any("
|
|
74
|
+
assert any("cert_owner" in i for i in bad) and any("proposed_cam_id" in i for i in bad)
|
|
75
|
+
# B-major regression: an UNREGISTERED cam_id on IMPL_TESTED is also rejected
|
|
76
|
+
# (previously fail-open — only a *registered* cam_id was flagged).
|
|
77
|
+
bad2 = contract_registry.verify_contract_against_registry(
|
|
78
|
+
_slot(cam_id="CAM-GHOST", cert_status="IMPL_TESTED", cert_owner="package-impl"), reg)
|
|
79
|
+
assert any("proposed_cam_id" in i for i in bad2)
|
|
76
80
|
assert not contract_registry.verify_contract_against_registry(
|
|
77
81
|
_slot(cert_status="IMPL_TESTED", cert_owner="package-impl"), reg)
|
|
78
82
|
|
|
79
83
|
|
|
84
|
+
def test_certified_slot_without_cam_id_fails():
|
|
85
|
+
# B-major regression: CERTIFIED with no cam_id was previously accepted (fail-open).
|
|
86
|
+
issues = contract_registry.verify_contract_against_registry(
|
|
87
|
+
_slot(cert_status="CERTIFIED"), _registry_fixture())
|
|
88
|
+
assert issues and "must cite a registered cam_id" in issues[0]
|
|
89
|
+
|
|
90
|
+
|
|
80
91
|
def test_lever_cert_owner_is_enforced():
|
|
81
92
|
reg = _registry_fixture()
|
|
82
93
|
v = contract_registry.verify_contract_against_registry
|