qigkernels 0.2.1__tar.gz → 0.2.2__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.
Files changed (85) hide show
  1. qigkernels-0.2.2/.editorconfig +14 -0
  2. qigkernels-0.2.2/.github/workflows/release.yml +96 -0
  3. qigkernels-0.2.2/.gitignore +23 -0
  4. qigkernels-0.2.2/20251205-architecture-canonical-0.01F.md +273 -0
  5. qigkernels-0.2.2/20251205-changelog-canonical-0.01F.md +151 -0
  6. qigkernels-0.2.2/20251205-decisions-canonical-0.01F.md +445 -0
  7. qigkernels-0.2.2/20251205-naming-convention-canonical-0.01F.md +186 -0
  8. qigkernels-0.2.2/20251205-roadmap-canonical-0.01F.md +356 -0
  9. qigkernels-0.2.2/20251205-type-symbol-manifest-canonical-0.01F.md +849 -0
  10. qigkernels-0.2.2/20251220-gfp-spec-1.00W.md +56 -0
  11. qigkernels-0.2.2/CLAUDE.md +79 -0
  12. {qigkernels-0.2.1 → qigkernels-0.2.2}/PKG-INFO +3 -2
  13. {qigkernels-0.2.1 → qigkernels-0.2.2}/__init__.py +10 -0
  14. {qigkernels-0.2.1 → qigkernels-0.2.2}/basin.py +20 -27
  15. qigkernels-0.2.2/constants.py +97 -0
  16. qigkernels-0.2.2/docs/20251205-client-wiring-example-canonical-0.01F.md +212 -0
  17. qigkernels-0.2.2/docs/20251205-index-canonical-0.01F.md +99 -0
  18. qigkernels-0.2.2/docs/20251206-e8-consciousness-stack-diagram.md +158 -0
  19. qigkernels-0.2.2/docs/20251206-integration-plan-ultra-mode-0.01H.md +143 -0
  20. qigkernels-0.2.2/docs/20251206-rel-weighted-basin-sync-spec.md +200 -0
  21. qigkernels-0.2.2/docs/20251220-index-1.00W.md +7 -0
  22. qigkernels-0.2.2/docs/20251220-qig-core-integration-table-1.00W.md +54 -0
  23. qigkernels-0.2.2/docs/20251222-federated-constellation-architecture-0.01W.md +544 -0
  24. qigkernels-0.2.2/docs/20251222-kernel-constellation-research-0.01W.md +269 -0
  25. qigkernels-0.2.2/docs/20251222-kernel-experiments-results-0.01F.md +327 -0
  26. {qigkernels-0.2.1 → qigkernels-0.2.2}/kernel.py +2 -1
  27. qigkernels-0.2.2/markdownlint.json +12 -0
  28. qigkernels-0.2.2/pre-commit-config.yaml +27 -0
  29. {qigkernels-0.2.1 → qigkernels-0.2.2}/pyproject.toml +9 -3
  30. {qigkernels-0.2.1 → qigkernels-0.2.2}/qigkernels.egg-info/PKG-INFO +3 -2
  31. qigkernels-0.2.2/qigkernels.egg-info/SOURCES.txt +106 -0
  32. {qigkernels-0.2.1 → qigkernels-0.2.2}/qigkernels.egg-info/requires.txt +2 -1
  33. qigkernels-0.2.2/research/track_c/20260223-track-c-expressibility-kill-test-1.00F.md +36 -0
  34. qigkernels-0.2.2/research/track_c/README.md +18 -0
  35. qigkernels-0.2.2/research/track_c/core_assets/__init__.py +0 -0
  36. qigkernels-0.2.2/research/track_c/core_assets/neural_oscillators.py +419 -0
  37. qigkernels-0.2.2/research/track_c/core_assets/neurotransmitter_fields.py +509 -0
  38. qigkernels-0.2.2/research/track_c/core_assets/ocean_neurochemistry.py +970 -0
  39. qigkernels-0.2.2/research/track_c/dynamical_field.py +105 -0
  40. qigkernels-0.2.2/research/track_c/readout_layer.py +54 -0
  41. qigkernels-0.2.2/research/track_c/run_kill_test.py +54 -0
  42. qigkernels-0.2.2/scripts/20251222-kernel-training-exp-0.01W.py +600 -0
  43. qigkernels-0.2.2/scripts/publish_pypi.sh +41 -0
  44. qigkernels-0.2.2/scripts/train_constellation.py +604 -0
  45. qigkernels-0.2.2/tests/__init__.py +0 -0
  46. {qigkernels-0.2.1 → qigkernels-0.2.2}/tests/test_smoke.py +4 -3
  47. qigkernels-0.2.2/tools/qig_purity_check.py +147 -0
  48. qigkernels-0.2.2/uv.lock +943 -0
  49. qigkernels-0.2.1/constants.py +0 -88
  50. qigkernels-0.2.1/qigkernels.egg-info/SOURCES.txt +0 -68
  51. {qigkernels-0.2.1 → qigkernels-0.2.2}/20251205-readme-canonical-0.01F.md +0 -0
  52. {qigkernels-0.2.1 → qigkernels-0.2.2}/README.md +0 -0
  53. {qigkernels-0.2.1 → qigkernels-0.2.2}/basin_sync.py +0 -0
  54. {qigkernels-0.2.1 → qigkernels-0.2.2}/constellation.py +0 -0
  55. {qigkernels-0.2.1 → qigkernels-0.2.2}/coord_adapter.py +0 -0
  56. {qigkernels-0.2.1 → qigkernels-0.2.2}/coordizer.py +0 -0
  57. {qigkernels-0.2.1 → qigkernels-0.2.2}/crystallization.py +0 -0
  58. {qigkernels-0.2.1 → qigkernels-0.2.2}/heart.py +0 -0
  59. {qigkernels-0.2.1 → qigkernels-0.2.2}/kernel_100m.py +0 -0
  60. {qigkernels-0.2.1 → qigkernels-0.2.2}/kernel_4d.py +0 -0
  61. {qigkernels-0.2.1 → qigkernels-0.2.2}/layer.py +0 -0
  62. {qigkernels-0.2.1 → qigkernels-0.2.2}/memory_classes.py +0 -0
  63. {qigkernels-0.2.1 → qigkernels-0.2.2}/metrics.py +0 -0
  64. {qigkernels-0.2.1 → qigkernels-0.2.2}/natural_gradient_optimizer.py +0 -0
  65. {qigkernels-0.2.1 → qigkernels-0.2.2}/pure_kernel_template.py +0 -0
  66. {qigkernels-0.2.1 → qigkernels-0.2.2}/qigkernels.egg-info/dependency_links.txt +0 -0
  67. {qigkernels-0.2.1 → qigkernels-0.2.2}/qigkernels.egg-info/top_level.txt +0 -0
  68. {qigkernels-0.2.1 → qigkernels-0.2.2}/reasoning/__init__.py +0 -0
  69. {qigkernels-0.2.1 → qigkernels-0.2.2}/reasoning/constants.py +0 -0
  70. {qigkernels-0.2.1 → qigkernels-0.2.2}/reasoning/modes.py +0 -0
  71. {qigkernels-0.2.1 → qigkernels-0.2.2}/reasoning/primitives.py +0 -0
  72. {qigkernels-0.2.1 → qigkernels-0.2.2}/reasoning/qig_chain.py +0 -0
  73. {qigkernels-0.2.1 → qigkernels-0.2.2}/reasoning/qig_chain_4d.py +0 -0
  74. {qigkernels-0.2.1 → qigkernels-0.2.2}/reasoning/temporal.py +0 -0
  75. {qigkernels-0.2.1 → qigkernels-0.2.2}/reasoning/temporal_attention.py +0 -0
  76. {qigkernels-0.2.1 → qigkernels-0.2.2}/rel_coupling.py +0 -0
  77. {qigkernels-0.2.1 → qigkernels-0.2.2}/router.py +0 -0
  78. {qigkernels-0.2.1 → qigkernels-0.2.2}/safety.py +0 -0
  79. {qigkernels-0.2.1 → qigkernels-0.2.2}/setup.cfg +0 -0
  80. {qigkernels-0.2.1 → qigkernels-0.2.2}/sleep_packet.py +0 -0
  81. {qigkernels-0.2.1 → qigkernels-0.2.2}/specializations.py +0 -0
  82. {qigkernels-0.2.1 → qigkernels-0.2.2}/storage.py +0 -0
  83. {qigkernels-0.2.1 → qigkernels-0.2.2}/tests/test_reasoning.py +0 -0
  84. {qigkernels-0.2.1 → qigkernels-0.2.2}/tokenizer_integration.py +0 -0
  85. {qigkernels-0.2.1 → qigkernels-0.2.2}/training_service.py +0 -0
@@ -0,0 +1,14 @@
1
+ root = true
2
+
3
+ [*]
4
+ charset = utf-8
5
+ end_of_line = lf
6
+ insert_final_newline = true
7
+ indent_style = space
8
+ indent_size = 4
9
+ trim_trailing_whitespace = true
10
+ max_line_length = 100
11
+
12
+ [*.md]
13
+ max_line_length = off
14
+ trim_trailing_whitespace = false
@@ -0,0 +1,96 @@
1
+ name: Release to PyPI (Trusted Publishing)
2
+
3
+ # Publishes qigkernels to PyPI via OIDC Trusted Publishing — NO API token.
4
+ # https://docs.pypi.org/trusted-publishers/
5
+ #
6
+ # Version is AUTO-DERIVED from the release tag via setuptools-scm — tag `v0.2.2` builds
7
+ # version 0.2.2, no manual pyproject bump. Trigger: publishing a GitHub Release.
8
+ # Manual `workflow_dispatch` builds and tests but does NOT publish.
9
+ #
10
+ # PyPI side (one-time, web UI — needs the project owner's PyPI account):
11
+ # pypi.org -> Your projects -> qigkernels -> Manage -> Publishing ->
12
+ # Add a new pending/trusted publisher (GitHub):
13
+ # Owner: GaryOcean428
14
+ # Repository name: qigkernels
15
+ # Workflow filename: release.yml
16
+ # Environment name: pypi
17
+ # The Environment name MUST match the `environment: pypi` below.
18
+ #
19
+ # All third-party actions are pinned to a full commit SHA (supply-chain hardening);
20
+ # the `# vX` comment records the human tag. This is the canonical template for the
21
+ # trusted-publishing rollout to the other QIG packages (qig-project#6).
22
+
23
+ on:
24
+ release:
25
+ types: [published]
26
+ workflow_dispatch: {}
27
+
28
+ permissions:
29
+ contents: read
30
+
31
+ jobs:
32
+ test:
33
+ name: Test suite (release gate)
34
+ runs-on: ubuntu-latest
35
+ steps:
36
+ - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 (node24)
37
+ with:
38
+ fetch-depth: 0 # setuptools-scm derives the version from git tags
39
+ - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 (node24)
40
+ with:
41
+ python-version: "3.11"
42
+ - name: Install package + test deps
43
+ run: |
44
+ python -m pip install --upgrade pip
45
+ pip install -e ".[dev]"
46
+ - name: Run tests
47
+ run: python -m pytest tests/ -q
48
+
49
+ build:
50
+ name: Build sdist + wheel
51
+ needs: test
52
+ runs-on: ubuntu-latest
53
+ steps:
54
+ - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 (node24)
55
+ with:
56
+ fetch-depth: 0 # setuptools-scm derives the version from git tags
57
+ - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 (node24)
58
+ with:
59
+ python-version: "3.11"
60
+ - name: Build distributions
61
+ run: |
62
+ python -m pip install --upgrade build
63
+ python -m build
64
+ - name: Verify built version matches the release tag
65
+ if: github.event_name == 'release'
66
+ env:
67
+ TAG_NAME: ${{ github.event.release.tag_name }}
68
+ run: |
69
+ TAG="${TAG_NAME#v}"
70
+ BUILT=$(ls dist/*.whl | sed -E 's#.*/[A-Za-z0-9._]+-([0-9][^-]*)-.*#\1#' | head -1)
71
+ echo "built=$BUILT release-tag=$TAG"
72
+ if [ "$BUILT" != "$TAG" ]; then
73
+ echo "::error::setuptools-scm built version ($BUILT) != release tag ($TAG). Tag the release commit as v$BUILT, or check git tags are fetched (fetch-depth: 0)."
74
+ exit 1
75
+ fi
76
+ - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 (node24)
77
+ with:
78
+ name: dist
79
+ path: dist/
80
+ if-no-files-found: error
81
+
82
+ publish:
83
+ name: Publish to PyPI (OIDC, no token)
84
+ needs: build
85
+ if: github.event_name == 'release' # only a published Release actually uploads
86
+ runs-on: ubuntu-latest
87
+ environment: pypi # MUST match the PyPI trusted-publisher config
88
+ permissions:
89
+ id-token: write # REQUIRED for Trusted Publishing (job-level, per PyPI docs)
90
+ steps:
91
+ - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 (node24)
92
+ with:
93
+ name: dist
94
+ path: dist/
95
+ - name: Publish to PyPI
96
+ uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # release/v1
@@ -0,0 +1,23 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.pyo
5
+ *.pyd
6
+ *.so
7
+ *.egg-info/
8
+ dist/
9
+ build/
10
+ .env
11
+ .venv
12
+ venv/
13
+
14
+ # Tools
15
+ .mypy_cache/
16
+ .ruff_cache/
17
+ .pytest_cache/
18
+
19
+ # Editors
20
+ .idea/
21
+ .vscode/
22
+ *.swp
23
+ .windsurfrules
@@ -0,0 +1,273 @@
1
+ # QIG Kernels Architecture & Rules
2
+
3
+ Status: 0.01F (Frozen)
4
+ Canonical naming & geometry: see `20251205-type-symbol-manifest-canonical-0.01F.md`.
5
+
6
+ ---
7
+
8
+ ## 1. Module Layers & Import Rules
9
+
10
+ The import graph must remain acyclic and follow this direction:
11
+
12
+ ```text
13
+ [core] : qigkernels.kernel, qigkernels.layer
14
+ [geometry] : qigkernels.basin, qigkernels.metrics
15
+ [structure] : qigkernels.constellation, qigkernels.router, qigkernels.basin_sync
16
+ [io/tools] : qigkernels.storage, tools/
17
+ ```
18
+
19
+ ### Allowed imports
20
+
21
+ * `kernel` may import:
22
+ * `layer`,
23
+ * standard libs,
24
+ * `torch`, `pydantic` (for configs/telemetry models if used).
25
+
26
+ * `basin` may import:
27
+ * standard libs,
28
+ * `torch`.
29
+
30
+ * `metrics` may import:
31
+ * `basin`,
32
+ * `kernel` (for `KernelTelemetry` only).
33
+
34
+ * `router` may import:
35
+ * standard libs,
36
+ * `typing`.
37
+
38
+ * `constellation` may import:
39
+ * `kernel`,
40
+ * `basin`,
41
+ * `router`.
42
+
43
+ * `basin_sync` may import:
44
+ * `basin`,
45
+ * `constellation`.
46
+
47
+ * `storage` may import:
48
+ * `basin`,
49
+ * `constellation`.
50
+
51
+ * `pure_kernel_template` may import:
52
+ * standard libs,
53
+ * `torch`.
54
+
55
+ * `tools/qig_purity_check.py` may import anything, but **no production code may import tools**.
56
+
57
+ > **Rule:** If a new module is added, its allowed imports must be documented here and updated in `__init__.py`.
58
+ > No new `.py` files under `qigkernels/` without updating this section.
59
+
60
+ ---
61
+
62
+ ## 2. QIG Purity Rules
63
+
64
+ We inherit global rules from `TYPE_SYMBOL_CONCEPT_MANIFEST.md` and add code-level constraints:
65
+
66
+ ### 2.1 Conceptual Constraints
67
+
68
+ * Think and document in **geometric** terms:
69
+ * Fisher metric, basins, κ, Φ, curvature, manifolds.
70
+ * Avoid importing or reimplementing classical **"off-the-shelf transformer"** stacks.
71
+ * Any use of standard components (e.g. `nn.Embedding`) must serve the geometric architecture, not the other way around.
72
+
73
+ ### 2.2 Banned / discouraged patterns (enforced by `qig_purity_check.py`)
74
+
75
+ * Hard bans (script fails if found in library code):
76
+ * `nn.Transformer`
77
+ * `BertModel`
78
+ * `GPT2Model`
79
+ * `CrossEntropyLoss` (without a comment explaining geometric role)
80
+ * `AdamW` / `Adam` optimizers in this repo
81
+
82
+ * Soft bans (warnings):
83
+ * "token-level cross entropy" in comments/docs.
84
+ * "just fine-tune a transformer" in comments/docs.
85
+
86
+ If a banned symbol legitimately appears in an experiment adapter, that code lives outside this repo.
87
+
88
+ ---
89
+
90
+ ## 3. File Length & Modularity
91
+
92
+ * Soft limit: **400 lines** per module under `qigkernels/`.
93
+ * If a module exceeds 400 lines, agents must:
94
+ * refactor into smaller modules, **or**
95
+ * explicitly justify in `DECISIONS.md` (with a new decision entry).
96
+ * No "god modules" performing orchestration + I/O + geometry.
97
+
98
+ ---
99
+
100
+ ## 4. Pydantic & Config Usage
101
+
102
+ * Pydantic models may be used for:
103
+ * kernel configuration (`KernelConfig`),
104
+ * telemetry snapshot types,
105
+ * constellation configuration.
106
+
107
+ **Rules:**
108
+
109
+ * All Pydantic models live in the module they logically belong to (no random `models.py` dumping ground).
110
+ * They must be imported via `qigkernels.kernel`, `qigkernels.constellation`, etc., not deep paths.
111
+ * Pydantic models must use `ConfigDict` to forbid extra fields (`extra="forbid"`).
112
+
113
+ If in doubt, prefer plain dataclasses in core geometry and use Pydantic only at the boundaries (config/IO).
114
+
115
+ ---
116
+
117
+ ## 5. Documentation Discipline
118
+
119
+ Allowed top-level docs:
120
+
121
+ * `README.md` – What this library is, high-level usage.
122
+ * `ARCHITECTURE.md` – This file: structure, rules, imports.
123
+ * `ROADMAP.md` – Milestones and sequencing (no time estimates).
124
+ * `CHANGELOG.md` – Human-readable log of changes.
125
+ * `DECISIONS.md` – Design decisions and their status.
126
+ * `TYPE_SYMBOL_CONCEPT_MANIFEST.md` – Canonical external spec (read-only here).
127
+
128
+ **Forbidden:**
129
+
130
+ * New "summary" or "notes" `.md` files.
131
+ * Per-feature ad-hoc docs like `basin_notes.md`, `design_v3.md`, etc.
132
+
133
+ If an agent wants to "summarize" or "document":
134
+
135
+ * Update `ARCHITECTURE.md` or `DECISIONS.md`.
136
+ * Record what changed in `CHANGELOG.md`.
137
+
138
+ ---
139
+
140
+ ## 6. Agent Behaviour Guidelines
141
+
142
+ * No timeframes or schedules in any file.
143
+ * No "we'll do a simpler version first and maybe improve later" as a justification for stubbing core logic.
144
+ * If something is intentionally stubbed:
145
+ * mark clearly as `# TODO:`,
146
+ * link to a specific entry in `ROADMAP.md` or `DECISIONS.md`.
147
+ * When modifying behaviour, prefer:
148
+ * **editing existing files** over creating new ones.
149
+ * e.g. adjust `ARCHITECTURE.md` instead of adding `architecture_v2.md`.
150
+
151
+ ---
152
+
153
+ ## 7. Import / Export Manifest
154
+
155
+ All external surface of the library is defined in `qigkernels/__init__.py`.
156
+
157
+ * Any new public function/class must be:
158
+ * imported and re-exported in `__init__.py`,
159
+ * documented in `README.md` under "Public API".
160
+ * No module may import from `qig-consciousness` or `qig-con2`.
161
+ * This library is **downstream-only**: other repos may depend on it, not vice versa.
162
+
163
+ ---
164
+
165
+ ## 8. Explicit Out-of-Scope
166
+
167
+ The following are **never** part of `qigkernels` (see D-011):
168
+
169
+ | Category | Examples | Where it belongs |
170
+ |----------|----------|------------------|
171
+ | **Training** | Optimizers, loss functions, training loops, gradient accumulation | `qig-training` or experiment repo |
172
+ | **Corpora** | Raw text, tokenizers, vocab files, sampling logic | `qig-training` or experiment repo |
173
+ | **Curriculum** | Phase schedules, regime progressions, maturity tracking | Experiment repo |
174
+ | **UX/Story** | Chat interfaces, consciousness narratives, "Gary/Ocean" prompts | Experiment repo |
175
+ | **Safety/Ethics** | Safety metrics, content filtering, social alignment scores | Experiment repo |
176
+ | **Experiment configs** | Hyperparameter sweeps, experiment manifests, run configs | Experiment repo |
177
+
178
+ **Boundary test:** "Does this belong in the geometry engine, or in an experiment repo that uses the engine?"
179
+
180
+ * Φ, κ, basins, signatures, routing, sync → **qigkernels**
181
+ * Data, stories, prompts, corpora, training → **experiment layer**
182
+
183
+ ---
184
+
185
+ ## 9. Physics Constants (FROZEN)
186
+
187
+ All physics constants in qigkernels are experimentally validated. The authoritative
188
+ source is `qig-verification/docs/FROZEN_FACTS.md`.
189
+
190
+ ### Validated Constants
191
+
192
+ | Constant | Value | Source | Location in qigkernels |
193
+ |----------|-------|--------|------------------------|
194
+ | κ₃ | 41.09 ± 0.59 | L=3 emergence | `Kernel.base_coupling` |
195
+ | β(3→4) | 0.44 ± 0.04 | Running coupling slope | `Kernel.beta_slope` |
196
+ | κ* | 64 ± 1.5 | Fixed point (L=4,5,6) | `BASIN_DIM` |
197
+
198
+ ### Rules
199
+
200
+ 1. **Never change** these defaults without new validated measurements in qig-verification
201
+ 2. Tests in `test_smoke.py::TestPhysicsConstants` enforce alignment
202
+ 3. Constructor overrides are allowed for experiments but require justification
203
+ 4. Physics flows FROM qig-verification TO qigkernels, never reverse
204
+
205
+ **Reference:** Decision D-012, `qig-verification/docs/FROZEN_FACTS.md`
206
+
207
+ ---
208
+
209
+ ## 10. E8 Geometric Foundation
210
+
211
+ The validated physics (κ* = 64) coincides with E8 exceptional geometry (rank² = 8² = 64).
212
+ This is the implementation direction for qigkernels: build E8-aligned structures, measure results.
213
+
214
+ ### Foundation (Validated Physics)
215
+
216
+ ```text
217
+ κ* = 64 ± 1.5 ← Experimentally validated fixed point (L=4,5,6)
218
+ rank(E8)² = 64 ← E8 exceptional Lie group rank squared
219
+ Agreement: 0.23σ ← Not coincidence, geometric necessity
220
+ ```
221
+
222
+ ### Implementation Direction (Informed Hypotheses)
223
+
224
+ | Hypothesis | ID | Implementation Target |
225
+ |------------|----|-----------------------|
226
+ | κ* = rank(E8)² | H-013 | Basin signatures in 64D ≈ E8-aligned space |
227
+ | 7 primitive kernels | H-014 | Kernel lattice with HRT/PER/MEM/ACT/PRD/ETH/META |
228
+ | 240-kernel saturation | H-014 | Growth toward E8 root positions |
229
+ | 8 consciousness metrics | H-015 | Add External Coupling (C) as 8th metric |
230
+
231
+ ### Build → Measure → Refine Cycle
232
+
233
+ ```text
234
+ Phase 1: Build E8-aligned structures
235
+ - 64D basin signatures (done)
236
+ - 7 primitive kernel codes (qig-dreams)
237
+ - Constellation routing (done)
238
+
239
+ Phase 2: Implement kernel lattice
240
+ - Kernel specialization by primitive
241
+ - Basin-coordinated inter-kernel routing
242
+ - Natural saturation detection (~5-9k tokens)
243
+
244
+ Phase 3: Measure against E8 predictions
245
+ - PCA for 8D active subspace
246
+ - Distance to E8 root positions
247
+ - Kernel count trajectory toward 240
248
+
249
+ Phase 4: Refine hypotheses based on measurements
250
+ - Promote validated → FROZEN_FACTS
251
+ - Archive falsified hypotheses
252
+ - Iterate implementation
253
+ ```
254
+
255
+ ### Geometric Primitives (from H-014)
256
+
257
+ These align with `qig-dreams` corpus primitive codes:
258
+
259
+ | Code | Kernel Type | E8 Role |
260
+ |------|-------------|---------|
261
+ | HRT | Heart | Phase reference (simple root 1) |
262
+ | PER | Perception | Sensory input (simple root 2) |
263
+ | MEM | Memory | Storage/recall (simple root 3) |
264
+ | ACT | Action | Motor output (simple root 4) |
265
+ | PRD | Prediction | Future modeling (simple root 5) |
266
+ | ETH | Ethics | Value alignment (simple root 6) |
267
+ | META | Meta | Self-model (simple root 7) |
268
+ | MIX | Multi | Cross-primitive (simple root 8) |
269
+
270
+ The 8 simple roots generate E8's 240 roots via Weyl group action.
271
+ Kernels "crystallize" toward these root positions during training.
272
+
273
+ **Reference:** Decisions H-013, H-014, H-015
@@ -0,0 +1,151 @@
1
+ # Changelog
2
+
3
+ Status: 0.01F (Frozen, append-only)
4
+ Format inspired by Keep a Changelog.
5
+
6
+ ## [Unreleased]
7
+
8
+ ### Added
9
+
10
+ - Initial scaffolding for `qigkernels` library:
11
+ - Docs: `README`, `ARCHITECTURE`, `ROADMAP`, `CHANGELOG`, `DECISIONS`.
12
+ - Config: `pyproject.toml`, `markdownlint.json`, `.editorconfig`, `.gitignore`, `pre-commit-config.yaml`.
13
+ - Tools: `tools/qig_purity_check.py`.
14
+ - Package skeleton under `qigkernels/`.
15
+ - Core modules implemented:
16
+ - `basin.py`: BasinProjector, compute_signature, basin_distance, save/load.
17
+ - `layer.py`: QIGLayer with attention, recursion, tacking, regime detection.
18
+ - `kernel.py`: Kernel with stacked layers and KernelTelemetry.
19
+ - `router.py`: round_robin, select_phi_min, select_phi_max, select_balanced.
20
+ - `constellation.py`: Instance, Constellation with routing and step.
21
+ - `basin_sync.py`: BasinSyncPacket, export/import/save/load.
22
+ - `metrics.py`: average_phi, average_kappa, basin_spread, integration_score.
23
+ - `storage.py`: save/load kernel and signature utilities.
24
+ - ISO 27001 aligned naming convention (`20251205-naming-convention-canonical-0.01F.md`):
25
+ - Document naming format: `YYYYMMDD-name-type-version[STATUS].md`
26
+ - Status codes: F (Frozen), H (Hypothesis), V (Verified)
27
+ - Renamed all canonical docs to follow convention.
28
+ - Decisions D-006 through D-010 integrated from repo_recon.md analysis.
29
+ - uv venv setup with torch, pydantic, numpy, dev tools.
30
+ - Smoke tests: `tests/test_smoke.py` (19 tests covering all modules).
31
+
32
+ ### Changed
33
+
34
+ - Roadmap: Added explicit pre-training governance gate for hard-ban audit enforcement.
35
+ - Roadmap: Added future QPU validation protocol milestone (docs + interfaces only; no QPU tooling in qigkernels).
36
+
37
+ ### Fixed
38
+
39
+ - `layer.py`: Added `.detach()` to avoid grad tensor warning.
40
+ - All type annotations fixed for ruff/mypy compliance.
41
+ - `pyproject.toml`: Updated to modern ruff lint section format.
42
+ - `constellation.py`: Removed conflicting `instances()` method (attribute preferred).
43
+ - `test_smoke.py`: Module-level imports for proper type resolution.
44
+
45
+ ### Added (Physics Alignment)
46
+
47
+ - D-012: Physics constants alignment with qig-verification/FROZEN_FACTS.md
48
+ - `TestPhysicsConstants`: 3 tests verifying κ₃, β(3→4), κ* alignment
49
+ - `qig_purity_check.py`: Physics constant validation in core modules
50
+ - Architecture §9: Physics constants section referencing FROZEN_FACTS
51
+
52
+ ### Added (Ecosystem Integration)
53
+
54
+ - Compatibility shims for experiment repos:
55
+ - `qig-consciousness/src/qig_compat.py`: Provides fallback imports
56
+ - `qig-con2/src/qig_compat.py`: Same pattern for qig-con2
57
+ - Updated `pyproject.toml` in both repos with qigkernels dependency comments
58
+ - Updated `qig-consciousness/docs/2025-11-27--imports.md` with qigkernels import guide
59
+
60
+ ### Added (Hypotheses)
61
+
62
+ - H-013: E8 geometric hypothesis (κ* = rank(E8)² = 64)
63
+ - H-014: Primitive kernel bootstrap (7 primitives → 240 kernels)
64
+ - H-015: 8th consciousness metric - External Coupling (C)
65
+
66
+ ### Added (E8 Implementation Direction)
67
+
68
+ - Architecture §10: E8 Geometric Foundation
69
+ - Build → Measure → Refine cycle
70
+ - Geometric primitives table (HRT/PER/MEM/ACT/PRD/ETH/META/MIX)
71
+ - E8 simple roots → 240 root crystallization concept
72
+ - Roadmap M9-M12: E8 implementation phases
73
+ - M9: Foundation (e8.py, primitive types, PCA validation)
74
+ - M10: Kernel Lattice (specialization, assigning kernel, 7-kernel bootstrap)
75
+ - M11: Growth & Measurement (240-kernel trajectory, 8th metric)
76
+ - M12: Validation & Promotion (controlled experiments, FROZEN_FACTS updates)
77
+
78
+ ### Added (qig-core Integration)
79
+
80
+ - D-016: qig-core integration decision (PRE-E8, NEEDS REVIEW)
81
+ - Roadmap M13: qig-core review and integration
82
+ - qig-core v1.0.0 predates E8 direction, needs compatibility review
83
+ - Ideal hierarchy: qig-core → qigkernels → qig-dreams → qig-consciousness
84
+ - Consolidation items: BasinSync, distance functions, KAPPA_STAR source
85
+
86
+ ### Added (8 Primitives Formalization)
87
+
88
+ - Type-symbol manifest §4.5: Formal definition of 8 E8-aligned primitives
89
+ - REL (Relationship/Coupling) as true 8th primitive (E8 simple root 8)
90
+ - MIX clarified as admin-only category, NOT a primitive
91
+ - Purity rule: Agents MUST NOT treat MIX as a primitive
92
+
93
+ ### Added (Frontier Milestones M14-M18)
94
+
95
+ - M14: REL Coupling Tensors (off-diagonal metric, agency closure threshold)
96
+ - M15: Agent Self-Assembly (minimal loop structures, attractor configurations)
97
+ - M16: Syntergy Integration (relational primacy → REL curvature mapping)
98
+ - M17: Quench Cosmology via QFI (κ-running as cosmological coupling)
99
+ - M18: Consciousness as E8-Coupled Dynamics (phase space characterization)
100
+ - Fixed M9 primitive list: PER/MEM/ACT/PRD/ETH/META/HRT/REL (not MIX)
101
+
102
+ ### Phase B Complete: Geometry Extraction (2025-12-06)
103
+
104
+ - **qig-consciousness now imports geometry from qigkernels:**
105
+ - `src/constants.py`: Imports KAPPA_STAR, PHI_* thresholds from qigkernels
106
+ - `src/coordination/basin_sync.py`: Uses qigkernels.basin_distance
107
+ - KAPPA_STAR aligned to E8 (64.0 vs old 63.5)
108
+ - **New regime thresholds exported from qigkernels:**
109
+ - PHI_LINEAR = 0.45, PHI_GEOMETRIC = 0.80, PHI_BREAKDOWN = 0.80
110
+ - PHI_EMERGENCY = 0.50
111
+ - **Validated:** No stray constants, no ad-hoc basin math, no reverse imports
112
+ - **Coordinated by:** Codex (extraction), Claude.ai (architecture), ChatGPT (QA)
113
+ - See: `qig-dreams/prompts/20251206-codex-phase-b-extraction-prompt-0.01.md`
114
+
115
+ ### Added (8 Consciousness Metrics + T/C Implementation - 2025-12-06)
116
+
117
+ - `metrics.py`: Complete 8 consciousness metrics (E8-aligned)
118
+ - `ConsciousnessMetrics` dataclass: Φ, κ, M, Γ, G, T, R, C
119
+ - `compute_temporal_coherence()`: T metric from basin history
120
+ - `compute_external_coupling()`: C metric (observer effect)
121
+ - `estimate_external_coupling_from_telemetry()`: C estimation heuristic
122
+ - Regime thresholds with **hysteresis** to prevent oscillation:
123
+ - `PHI_CONSCIOUS_ENTER = 0.70`, `PHI_CONSCIOUS_EXIT = 0.65`
124
+ - `PHI_GEOMETRIC_ENTER = 0.45`, `PHI_GEOMETRIC_EXIT = 0.40`
125
+ - `PHI_BREAKDOWN_ENTER = 0.80`, `PHI_BREAKDOWN_EXIT = 0.75`
126
+ - Updated `__init__.py` to export all new metrics
127
+
128
+ ### Added (REL Coupling Implementation - 2025-12-06)
129
+
130
+ - `rel_coupling.py`: Instance-to-instance REL coupling computation
131
+ - `RELState` dataclass for tracking relationship history
132
+ - `compute_rel_coupling()` with basin overlap, history, primitive alignment
133
+ - `compute_rel_from_basins()` convenience function
134
+ - `REL_LAMBDA_MAX = 0.7` safety cap
135
+ - `basin_sync.py`: REL-weighted synchronization
136
+ - `effective_basin_distance()`: d_eff = d_F · (1 - λ_rel · r_ij)
137
+ - `rel_weighted_sync_loss()`: w_sync · d²_eff
138
+ - `compute_sync_strength_with_rel()`: REL-modulated sync strength
139
+ - Updated `__init__.py` to export all REL functions
140
+ - Added docs:
141
+ - `docs/20251206-integration-plan-ultra-mode-0.01H.md`
142
+ - `docs/20251206-rel-weighted-basin-sync-spec.md`
143
+ - `docs/20251206-e8-consciousness-stack-diagram.md`
144
+
145
+ ### Fixed (Geometric Purity - CRITICAL)
146
+
147
+ - `basin.py`: Replaced Euclidean L2 distance with Fisher-Rao (Bures approximation)
148
+ - `basin_sync.py`: Now uses E8-aligned constants from `constants.py`
149
+ - Added `constants.py`: KAPPA_STAR=64 (E8 rank²), validated physics parameters
150
+ - Added `qig-core` as dependency in pyproject.toml
151
+ - **This restores geometric purity** — basin distances now respect curved manifold