qig-stack 0.1.31__tar.gz → 0.1.32__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: qig-stack
3
- Version: 0.1.31
3
+ Version: 0.1.32
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
@@ -19,7 +19,7 @@ Requires-Dist: packaging>=22
19
19
  Requires-Dist: qig-bench==0.1.10
20
20
  Requires-Dist: qig-compute==0.9.17
21
21
  Requires-Dist: qig-coordizer==0.1.6
22
- Requires-Dist: qig-core==2.37.0
22
+ Requires-Dist: qig-core==2.38.0
23
23
  Requires-Dist: qig-geocoding==0.2.0
24
24
  Requires-Dist: qig-graph==0.1.1
25
25
  Requires-Dist: qig-routing==0.1.1
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "qig-stack"
7
- version = "0.1.31"
7
+ version = "0.1.32"
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" }
@@ -32,7 +32,7 @@ dependencies = [
32
32
  "packaging>=22", # PEP 440-correct version comparison in the version gate
33
33
  "qig-compute==0.9.17", # qig.capabilities entry-points + pure Hilbert norms
34
34
  "qig-warp==0.6.12", # P1 dedup: canonical qig-core Fisher-Rao delegation, eps-preserving to_simplex, strict find_spec fallback
35
- "qig-core==2.37.0", # PI P0 QIG-pure export_state()/restore_state() + NeedsHospitalRevivalError (PR #144)
35
+ "qig-core==2.38.0", # PI P0 QIG-pure export_state()/restore_state() + NeedsHospitalRevivalError (PR #144)
36
36
  "qig-graph==0.1.1", # geometric agent runtime extracted from monkey1 qig_heart (Canon 2.60F)
37
37
  "qig-routing==0.1.1", # P30 exp-free Fisher-Rao model dispatch & iterative simplex refinement
38
38
  "qig-bench==0.1.10",
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "doc": "QIG Stack Capability Contract",
3
- "version": "1.25W",
4
- "date": "2026-11-25",
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 \u2014 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 \u2014 qig-core 2.35.0 (hardened fail-closed PurityGate: sovereignty anti-cage lint with match/loop/exception-flow taint tracking; continuous adult 4D foresight \u2014 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.",
3
+ "version": "1.26W",
4
+ "date": "2026-11-26",
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 \u2014 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 \u2014 qig-core 2.35.0 (hardened fail-closed PurityGate: sovereignty anti-cage lint with match/loop/exception-flow taint tracking; continuous adult 4D foresight \u2014 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.",
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",
@@ -17,7 +17,7 @@
17
17
  "stack_packages_latest_at_authoring": {
18
18
  "qig-compute": "0.9.17",
19
19
  "qig-warp": "0.6.12",
20
- "qig-core": "2.37.0",
20
+ "qig-core": "2.38.0",
21
21
  "qig-bench": "0.1.10",
22
22
  "qig-coordizer": "0.1.6",
23
23
  "qigkernels": "0.4.10",
@@ -43,7 +43,7 @@
43
43
  },
44
44
  "entry_point_gates": {
45
45
  "under_fill": "FAIL (non-zero exit): a slot with provider_pkg set and shipped != false but no installed qig.capabilities entry-point (stale / mis-built / un-republished package).",
46
- "drift": "WARN (non-fatal): an installed entry-point whose slot_id is not in the contract, or whose module:attr value differs from the slot probe.",
46
+ "drift": "WARN (non-fatal): an installed entry-point whose slot_id is not in the contract, or whose module:attr value differs from the slot probe (a value equal to the slot's recorded `supersedes` probe is the expected legacy declaration during a coordinated retirement window, not drift; any other off-probe value still drifts).",
47
47
  "exempt": "Slots with provider_pkg: null (engine-local, e.g. SLOT-GROUND-STATE/TeNPy) or shipped: false are exempt from under_fill.",
48
48
  "require_activation": true
49
49
  },
@@ -442,16 +442,17 @@
442
442
  },
443
443
  {
444
444
  "slot_id": "SLOT-QIG-TORCH-KV-CACHE",
445
- "role": "simplex-native KV cache for multi-turn inference (carry state across turns, no re-prefill)",
445
+ "role": "simplex-native KV cache for multi-turn inference (carry state across turns, no re-prefill); Wave 3B per-component torch-exception retirement: the probe resolves the torch-free NumPy twin and the torch twin (qig-core[torch]) is optional",
446
446
  "channel": "library",
447
447
  "provided_by": "qig-core",
448
448
  "provider_pkg": "qig-core",
449
449
  "primitive": "SimplexKVCache",
450
- "probe": "qig_core.torch.kv_cache:SimplexKVCache",
450
+ "probe": "qig_core.numpy.kv_cache:SimplexKVCache",
451
451
  "cam_id": null,
452
452
  "cert_status": "LIBRARY",
453
453
  "shipped": true,
454
- "feasible_at": "always (library import; requires qig-core[torch])"
454
+ "supersedes": "qig_core.torch.kv_cache:SimplexKVCache",
455
+ "feasible_at": "always (library import; numpy-only, zero torch required; torch twin optional)"
455
456
  },
456
457
  {
457
458
  "slot_id": "SLOT-QIG-TORCH-VISION",
@@ -599,16 +600,17 @@
599
600
  },
600
601
  {
601
602
  "slot_id": "SLOT-GEOCODING",
602
- "role": "Fisher-Rao geometric transformer framework (GeoModel, GeoConfig.p30_pure(), simplex attention, unbounded Fourier features, recursive Phi-integration, UniversalFacultyHook internal-basin wiring)",
603
+ "role": "Fisher-Rao geometric transformer framework (NumPyGeoModel, GeoConfig.p30_pure(), simplex attention, unbounded Fourier features, recursive Phi-integration, UniversalFacultyHook internal-basin wiring); Wave 3B per-component torch-exception retirement: the probe resolves the torch-free NumPyGeoModel twin and the torch GeoModel is optional for training",
603
604
  "channel": "library",
604
605
  "provided_by": "qig-geocoding",
605
606
  "provider_pkg": "qig-geocoding",
606
- "primitive": "GeoModel",
607
- "probe": "geocoding:GeoModel",
607
+ "primitive": "NumPyGeoModel",
608
+ "probe": "geocoding:NumPyGeoModel",
608
609
  "cam_id": null,
609
610
  "cert_status": "LIBRARY",
610
611
  "shipped": true,
611
- "feasible_at": "always (library import; torch + qig-core)"
612
+ "supersedes": "geocoding:GeoModel",
613
+ "feasible_at": "always (library import; numpy-only, zero torch required; torch GeoModel optional for training)"
612
614
  },
613
615
  {
614
616
  "slot_id": "SLOT-UNIVERSAL-FACULTY-HOOK",
@@ -165,6 +165,18 @@ class WiringIssue:
165
165
  detail: str
166
166
 
167
167
 
168
+ def _declared_matches_slot(slot: dict, value: str) -> bool:
169
+ """True when an entry-point value matches the slot's canonical probe OR its
170
+ recorded ``supersedes`` legacy probe during a coordinated retirement window."""
171
+ probe = slot.get("probe")
172
+ if not probe:
173
+ return True
174
+ if value == probe:
175
+ return True
176
+ sup = slot.get("supersedes")
177
+ return isinstance(sup, str) and bool(sup) and value == sup
178
+
179
+
168
180
  def check_entrypoint_wiring(
169
181
  slots: list[dict], declared: dict[str, str], *, require_activation: bool = False
170
182
  ) -> tuple[list[WiringIssue], list[WiringIssue]]:
@@ -206,7 +218,7 @@ def check_entrypoint_wiring(
206
218
  drift.append(
207
219
  WiringIssue(name, "DRIFT_UNKNOWN", f"entry-point '{name}={value}' is not a contract slot_id")
208
220
  )
209
- elif slot.get("probe") and value != slot["probe"]:
221
+ elif not _declared_matches_slot(slot, value):
210
222
  drift.append(
211
223
  WiringIssue(
212
224
  name,
@@ -354,7 +366,7 @@ def check_slots(slots: list[dict], declared: dict[str, str]) -> list[SlotCheck]:
354
366
  elif shipped is False:
355
367
  entrypoint = "UNSHIPPED"
356
368
  elif slot["slot_id"] in declared:
357
- entrypoint = "DRIFT" if (probe and declared[slot["slot_id"]] != probe) else "DECLARED"
369
+ entrypoint = "DECLARED" if _declared_matches_slot(slot, declared[slot["slot_id"]]) else "DRIFT"
358
370
  elif group_active:
359
371
  entrypoint = "ABSENT"
360
372
  else:
@@ -0,0 +1,88 @@
1
+ """Regression tests for Wave 3B per-component torch-exception retirement
2
+ (SLOT-QIG-TORCH-KV-CACHE -> qig_core.numpy.kv_cache:SimplexKVCache and
3
+ SLOT-GEOCODING -> geocoding:NumPyGeoModel).
4
+ """
5
+
6
+ from __future__ import annotations
7
+
8
+ import json
9
+ import subprocess
10
+ import sys
11
+ from pathlib import Path
12
+
13
+ import pytest
14
+
15
+ from qig_stack.doctor import check_entrypoint_wiring, check_slots
16
+
17
+ CONTRACT_PATH = Path(__file__).resolve().parents[1] / "src" / "qig_stack" / "contract.json"
18
+
19
+
20
+ def _slots_by_id() -> dict[str, dict]:
21
+ data = json.loads(CONTRACT_PATH.read_text(encoding="utf-8"))
22
+ return {s["slot_id"]: s for s in data["slots"]}
23
+
24
+
25
+ def test_contract_retires_kv_cache_and_geomodel_torch_exceptions_only() -> None:
26
+ slots = _slots_by_id()
27
+ kv = slots["SLOT-QIG-TORCH-KV-CACHE"]
28
+ assert kv["probe"] == "qig_core.numpy.kv_cache:SimplexKVCache"
29
+ assert kv["supersedes"] == "qig_core.torch.kv_cache:SimplexKVCache"
30
+ assert "zero torch required" in kv["feasible_at"]
31
+
32
+ geo = slots["SLOT-GEOCODING"]
33
+ assert geo["primitive"] == "NumPyGeoModel"
34
+ assert geo["probe"] == "geocoding:NumPyGeoModel"
35
+ assert geo["supersedes"] == "geocoding:GeoModel"
36
+ assert "zero torch required" in geo["feasible_at"]
37
+
38
+ # Vision stays honestly torch-gated until its NumPy twin ships.
39
+ vis = slots["SLOT-QIG-TORCH-VISION"]
40
+ assert vis["probe"] == "qig_core.torch.vision:image_patches_to_simplex"
41
+ assert "qig-core[torch]" in vis["feasible_at"]
42
+
43
+
44
+ def test_supersedes_legacy_probe_is_accepted_while_unknown_probe_still_drifts() -> None:
45
+ slots = list(_slots_by_id().values())
46
+ declared = {
47
+ s["slot_id"]: s["probe"]
48
+ for s in slots
49
+ if s.get("provider_pkg") is not None and s.get("shipped", True) is not False and s.get("probe")
50
+ }
51
+ # Simulate installed provider wheels still declaring legacy torch probes.
52
+ declared["SLOT-QIG-TORCH-KV-CACHE"] = "qig_core.torch.kv_cache:SimplexKVCache"
53
+ declared["SLOT-GEOCODING"] = "geocoding:GeoModel"
54
+
55
+ underfill, drift = check_entrypoint_wiring(slots, declared, require_activation=True)
56
+ assert underfill == []
57
+ assert drift == []
58
+
59
+ slot_checks = {sc.slot_id: sc for sc in check_slots(slots, declared)}
60
+ assert slot_checks["SLOT-QIG-TORCH-KV-CACHE"].entrypoint == "DECLARED"
61
+ assert slot_checks["SLOT-GEOCODING"].entrypoint == "DECLARED"
62
+
63
+ # Any off-probe value other than canonical or supersedes MUST still DRIFT_MOVED.
64
+ bad = dict(declared)
65
+ bad["SLOT-GEOCODING"] = "geocoding:SomeOtherSymbol"
66
+ _, bad_drift = check_entrypoint_wiring(slots, bad, require_activation=True)
67
+ assert any(i.slot_id == "SLOT-GEOCODING" and i.kind == "DRIFT_MOVED" for i in bad_drift)
68
+
69
+
70
+ def test_retired_slots_resolve_torch_free_in_fresh_subprocess() -> None:
71
+ pytest.importorskip("qig_core.numpy.kv_cache")
72
+ pytest.importorskip("geocoding.numpy_model")
73
+ code = (
74
+ "import importlib, json, sys\n"
75
+ f"data = json.loads(open({str(CONTRACT_PATH)!r}, encoding='utf-8').read())\n"
76
+ "by_id = {s['slot_id']: s for s in data['slots']}\n"
77
+ "assert 'torch' not in sys.modules\n"
78
+ "for sid in ('SLOT-QIG-TORCH-KV-CACHE', 'SLOT-GEOCODING'):\n"
79
+ " mod_name, attr = by_id[sid]['probe'].split(':')\n"
80
+ " mod = importlib.import_module(mod_name)\n"
81
+ " obj = getattr(mod, attr)\n"
82
+ " assert obj is not None\n"
83
+ "assert 'torch' not in sys.modules, f'torch leaked via retired slot: {sys.modules.get(\"torch\")}'\n"
84
+ "print('TORCH_FREE_RETIREMENT_OK')\n"
85
+ )
86
+ proc = subprocess.run([sys.executable, "-c", code], capture_output=True, text=True, check=False)
87
+ assert proc.returncode == 0, f"subprocess failed: stdout={proc.stdout!r} stderr={proc.stderr!r}"
88
+ assert "TORCH_FREE_RETIREMENT_OK" in proc.stdout
File without changes
File without changes