phi-complexity 0.1.9__tar.gz → 0.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. {phi_complexity-0.1.9 → phi_complexity-0.2.1}/PKG-INFO +257 -195
  2. {phi_complexity-0.1.9 → phi_complexity-0.2.1}/README.md +225 -169
  3. {phi_complexity-0.1.9 → phi_complexity-0.2.1}/phi_complexity/__init__.py +100 -86
  4. {phi_complexity-0.1.9 → phi_complexity-0.2.1}/phi_complexity/__main__.py +5 -3
  5. {phi_complexity-0.1.9 → phi_complexity-0.2.1}/phi_complexity/akasha.py +166 -158
  6. {phi_complexity-0.1.9 → phi_complexity-0.2.1}/phi_complexity/analyseur.py +479 -343
  7. phi_complexity-0.2.1/phi_complexity/audit_slo.py +493 -0
  8. {phi_complexity-0.1.9 → phi_complexity-0.2.1}/phi_complexity/autosuture.py +79 -76
  9. phi_complexity-0.2.1/phi_complexity/backends/__init__.py +14 -0
  10. phi_complexity-0.2.1/phi_complexity/backends/asm_light.py +321 -0
  11. {phi_complexity-0.1.9 → phi_complexity-0.2.1}/phi_complexity/backends/base.py +21 -20
  12. phi_complexity-0.2.1/phi_complexity/backends/c_rust_light.py +239 -0
  13. phi_complexity-0.2.1/phi_complexity/backends/elf_light.py +728 -0
  14. {phi_complexity-0.1.9 → phi_complexity-0.2.1}/phi_complexity/backends/python.py +20 -18
  15. {phi_complexity-0.1.9 → phi_complexity-0.2.1}/phi_complexity/backup.py +62 -61
  16. phi_complexity-0.2.1/phi_complexity/bmad.py +144 -0
  17. phi_complexity-0.2.1/phi_complexity/canvas.py +174 -0
  18. phi_complexity-0.2.1/phi_complexity/cli.py +1092 -0
  19. phi_complexity-0.2.1/phi_complexity/commit_risk.py +512 -0
  20. phi_complexity-0.2.1/phi_complexity/consensus.py +491 -0
  21. {phi_complexity-0.1.9 → phi_complexity-0.2.1}/phi_complexity/core.py +176 -90
  22. phi_complexity-0.2.1/phi_complexity/coverage_reporting.py +181 -0
  23. phi_complexity-0.2.1/phi_complexity/fingerprint.py +290 -0
  24. {phi_complexity-0.1.9 → phi_complexity-0.2.1}/phi_complexity/gnose.py +84 -83
  25. phi_complexity-0.2.1/phi_complexity/harvest.py +239 -0
  26. {phi_complexity-0.1.9 → phi_complexity-0.2.1}/phi_complexity/impossible.py +85 -84
  27. phi_complexity-0.2.1/phi_complexity/log_parser.py +343 -0
  28. phi_complexity-0.2.1/phi_complexity/metadata_ops.py +237 -0
  29. phi_complexity-0.2.1/phi_complexity/metriques.py +498 -0
  30. phi_complexity-0.2.1/phi_complexity/notebook_helpers.py +839 -0
  31. phi_complexity-0.2.1/phi_complexity/oracle.py +133 -0
  32. {phi_complexity-0.1.9 → phi_complexity-0.2.1}/phi_complexity/rapport.py +232 -164
  33. phi_complexity-0.2.1/phi_complexity/remediation.py +241 -0
  34. phi_complexity-0.2.1/phi_complexity/search.py +245 -0
  35. phi_complexity-0.2.1/phi_complexity/securite.py +1132 -0
  36. phi_complexity-0.2.1/phi_complexity/sentinel/__init__.py +42 -0
  37. phi_complexity-0.2.1/phi_complexity/sentinel/bayesian.py +314 -0
  38. phi_complexity-0.2.1/phi_complexity/sentinel/behavior.py +315 -0
  39. phi_complexity-0.2.1/phi_complexity/sentinel/host.py +310 -0
  40. phi_complexity-0.2.1/phi_complexity/sentinel/response.py +374 -0
  41. phi_complexity-0.2.1/phi_complexity/sentinel/telemetry.py +343 -0
  42. {phi_complexity-0.1.9 → phi_complexity-0.2.1}/phi_complexity/suture.py +118 -116
  43. phi_complexity-0.2.1/phi_complexity/vault.py +304 -0
  44. {phi_complexity-0.1.9 → phi_complexity-0.2.1}/phi_complexity.egg-info/PKG-INFO +257 -195
  45. phi_complexity-0.2.1/phi_complexity.egg-info/SOURCES.txt +85 -0
  46. phi_complexity-0.2.1/phi_complexity.egg-info/requires.txt +5 -0
  47. {phi_complexity-0.1.9 → phi_complexity-0.2.1}/pyproject.toml +83 -59
  48. {phi_complexity-0.1.9 → phi_complexity-0.2.1}/setup.cfg +4 -4
  49. phi_complexity-0.2.1/tests/test_akasha.py +167 -0
  50. phi_complexity-0.2.1/tests/test_analyseur.py +603 -0
  51. phi_complexity-0.2.1/tests/test_asm_backend.py +382 -0
  52. phi_complexity-0.2.1/tests/test_audit_slo.py +573 -0
  53. phi_complexity-0.2.1/tests/test_autosuture.py +331 -0
  54. phi_complexity-0.2.1/tests/test_backends.py +417 -0
  55. phi_complexity-0.2.1/tests/test_backup.py +137 -0
  56. phi_complexity-0.2.1/tests/test_bmad.py +70 -0
  57. phi_complexity-0.2.1/tests/test_canvas.py +147 -0
  58. phi_complexity-0.2.1/tests/test_cli.py +778 -0
  59. phi_complexity-0.2.1/tests/test_commit_risk.py +637 -0
  60. phi_complexity-0.2.1/tests/test_consensus.py +484 -0
  61. {phi_complexity-0.1.9 → phi_complexity-0.2.1}/tests/test_core.py +143 -91
  62. phi_complexity-0.2.1/tests/test_coverage_reporting.py +94 -0
  63. phi_complexity-0.2.1/tests/test_elf_backend.py +574 -0
  64. phi_complexity-0.2.1/tests/test_engine.py +305 -0
  65. phi_complexity-0.2.1/tests/test_fingerprint.py +298 -0
  66. phi_complexity-0.2.1/tests/test_gnose.py +116 -0
  67. phi_complexity-0.2.1/tests/test_harvest.py +263 -0
  68. phi_complexity-0.2.1/tests/test_impossible.py +103 -0
  69. phi_complexity-0.2.1/tests/test_log_parser.py +244 -0
  70. phi_complexity-0.2.1/tests/test_main.py +21 -0
  71. phi_complexity-0.2.1/tests/test_metadata_ops.py +230 -0
  72. phi_complexity-0.2.1/tests/test_metriques.py +431 -0
  73. phi_complexity-0.2.1/tests/test_notebook_helpers.py +689 -0
  74. phi_complexity-0.2.1/tests/test_oracle.py +160 -0
  75. phi_complexity-0.2.1/tests/test_public_api_contract.py +29 -0
  76. {phi_complexity-0.1.9 → phi_complexity-0.2.1}/tests/test_rapport.py +162 -147
  77. phi_complexity-0.2.1/tests/test_remediation.py +219 -0
  78. phi_complexity-0.2.1/tests/test_scan_cli.py +332 -0
  79. phi_complexity-0.2.1/tests/test_search.py +306 -0
  80. phi_complexity-0.2.1/tests/test_securite.py +1203 -0
  81. phi_complexity-0.2.1/tests/test_sentinel.py +804 -0
  82. phi_complexity-0.2.1/tests/test_suture.py +138 -0
  83. phi_complexity-0.2.1/tests/test_vault.py +221 -0
  84. phi_complexity-0.1.9/phi_complexity/backends/__init__.py +0 -6
  85. phi_complexity-0.1.9/phi_complexity/backends/c_rust_light.py +0 -87
  86. phi_complexity-0.1.9/phi_complexity/bmad.py +0 -73
  87. phi_complexity-0.1.9/phi_complexity/cli.py +0 -356
  88. phi_complexity-0.1.9/phi_complexity/metriques.py +0 -218
  89. phi_complexity-0.1.9/phi_complexity.egg-info/SOURCES.txt +0 -30
  90. phi_complexity-0.1.9/tests/test_analyseur.py +0 -202
  91. phi_complexity-0.1.9/tests/test_cli.py +0 -163
  92. {phi_complexity-0.1.9 → phi_complexity-0.2.1}/LICENSE +0 -0
  93. {phi_complexity-0.1.9 → phi_complexity-0.2.1}/phi_complexity.egg-info/dependency_links.txt +0 -0
  94. {phi_complexity-0.1.9 → phi_complexity-0.2.1}/phi_complexity.egg-info/entry_points.txt +0 -0
  95. {phi_complexity-0.1.9 → phi_complexity-0.2.1}/phi_complexity.egg-info/top_level.txt +0 -0
@@ -1,195 +1,257 @@
1
- Metadata-Version: 2.4
2
- Name: phi-complexity
3
- Version: 0.1.9
4
- Summary: Code quality metrics based on Golden Ratio (φ) mathematical invariants
5
- Author-email: Tomy Verreault <contact@phidelia.dev>
6
- License: MIT
7
- Project-URL: Homepage, https://github.com/spockoo/phi-complexity
8
- Project-URL: Repository, https://github.com/spockoo/phi-complexity
9
- Project-URL: Documentation, https://github.com/spockoo/phi-complexity/blob/main/docs/GUIDE.md
10
- Project-URL: Bug Tracker, https://github.com/spockoo/phi-complexity/issues
11
- Keywords: code-quality,complexity,golden-ratio,fibonacci,static-analysis,ast,phi,metrics,entropy
12
- Classifier: Development Status :: 3 - Alpha
13
- Classifier: Intended Audience :: Developers
14
- Classifier: License :: OSI Approved :: MIT License
15
- Classifier: Programming Language :: Python :: 3
16
- Classifier: Programming Language :: Python :: 3.9
17
- Classifier: Programming Language :: Python :: 3.10
18
- Classifier: Programming Language :: Python :: 3.11
19
- Classifier: Programming Language :: Python :: 3.12
20
- Classifier: Topic :: Software Development :: Quality Assurance
21
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
- Requires-Python: >=3.9
23
- Description-Content-Type: text/markdown
24
- License-File: LICENSE
25
- Dynamic: license-file
26
-
27
- # phi-complexity
28
-
29
- > *Code quality metrics based on Golden Ratio (φ) mathematical invariants*
30
-
31
- [![PyPI version](https://img.shields.io/pypi/v/phi-complexity.svg)](https://pypi.org/project/phi-complexity/)
32
- [![Python 3.9+](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/)
33
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/spockoo/phi-complexity/blob/main/LICENSE)
34
- [![Tests](https://img.shields.io/badge/tests-26%20passed-brightgreen)](https://github.com/spockoo/phi-complexity/tree/main/tests)
35
-
36
- `phi-complexity` is the **first code quality library** that measures the health of your Python code using **universal mathematical invariants** derived from the Golden Ratio (φ = 1.618...).
37
-
38
- Unlike `pylint` (cultural rules) or `radon` (McCabe metrics), `phi-complexity` answers:
39
-
40
- > *"Is this code in resonance with the natural laws of order, or is it collapsing under its own entropy?"*
41
-
42
- ---
43
-
44
- ## ⚡ Quick Start
45
-
46
- ```bash
47
- pip install phi-complexity
48
- ```
49
-
50
- ```bash
51
- # Audit a file
52
- phi check my_script.py
53
-
54
- # Audit a folder
55
- phi check ./src/
56
-
57
- # Generate a Markdown report
58
- phi report my_script.py --output report.md
59
-
60
- # CI/CD strict mode (exit 1 if radiance < 75)
61
- phi check ./src/ --min-radiance 75
62
- ```
63
-
64
- ### Python API
65
-
66
- ```python
67
- from phi_complexity import auditer, rapport_console, rapport_markdown
68
-
69
- # Get metrics as a dict
70
- metrics = auditer("my_script.py")
71
- print(metrics["radiance"]) # → 82.4
72
- print(metrics["statut_gnostique"]) # → "EN ÉVEIL ◈"
73
- print(metrics["oudjat"]) # → {"nom": "process_data", "ligne": 42, ...}
74
-
75
- # Print console report
76
- print(rapport_console("my_script.py"))
77
-
78
- # Save Markdown report
79
- rapport_markdown("my_script.py", sortie="report.md")
80
- ```
81
-
82
- ---
83
-
84
- ## 📊 Metrics
85
-
86
- | Metric | Description | Mathematical basis |
87
- |---|---|---|
88
- | **Radiance Score** | Global quality score (0–100) | `100 - f(Lilith) - g(H) - h(Anomalies) - i(Fib)` |
89
- | **Variance de Lilith** | Structural instability | Population variance of function complexities |
90
- | **Shannon Entropy** | Information density | `H = -Σ p·log₂(p)` |
91
- | **φ-Ratio** | Dominant function ratio | `max_complexity / mean` → should tend toward φ |
92
- | **Fibonacci Distance** | Natural size alignment | `Σ|n_i - Fib_k| / φ` |
93
- | **Zeta-Score** | Global resonance | `ζ_meta(functions, φ)` converging series |
94
-
95
- ### Gnostic Status Levels
96
-
97
- | Score | Status | Meaning |
98
- |---|---|---|
99
- | ≥ 85 | **HERMÉTIQUE ✦** | Stable, harmonious, production-ready |
100
- | 60–84 | **EN ÉVEIL ◈** | Potential exists, some entropy zones |
101
- | < 60 | **DORMANT ░** | Deep restructuring recommended |
102
-
103
- ---
104
-
105
- ## 🔍 Sample Output
106
-
107
- ```
108
- ╔══════════════════════════════════════════════════╗
109
- ║ PHI-COMPLEXITY — AUDIT DE RADIANCE ║
110
- ╚══════════════════════════════════════════════════╝
111
-
112
- 📄 Fichier : my_script.py
113
- 📅 Date : 2026-04-08 17:11
114
-
115
- ☼ RADIANCE : ██████████████░░░░░░ 72.6 / 100
116
- ⚖ LILITH : 11221.9 (Structural variance)
117
- 🌊 ENTROPIE : 2.48 bits (Shannon)
118
- ◈ PHI-RATIO : 3.43 (ideal: φ = 1.618, Δ=1.81)
119
- ζ ZETA-SCORE : 0.3656 (Global resonance)
120
-
121
- STATUT : EN ÉVEIL ◈
122
-
123
- 🔎 OUDJAT : 'process_data' (Line 42, Complexity: 376)
124
-
125
- ⚠ SUTURES IDENTIFIED (2):
126
- 🟡 Line 18 [LILITH] : Nested loop (depth 2). Consider a helper function.
127
- >> for j in range(b):
128
- 🔵 Line 67 [SOUVERAINETE] : 'load_data' receives 6 arguments. Encapsulate in an object.
129
- >> def load_data(path, sep, enc, cols, dtype, na):
130
- ```
131
-
132
- ---
133
-
134
- ## 🧮 Mathematical Foundations
135
-
136
- The **Radiance Formula** is derived from:
137
-
138
- - **φ-Meta Framework** (Tomy Verreault, 2026) — Axioms AX-A0 through AX-A58
139
- - **Law of Antifragility** (EQ-AFR-BMAD): `φ_{t+1} = P_φ(φ_t + k·Var(E_t)·E_t)`
140
- - **Cybernetics** (Korchounov, Mir, 1975) — Feedback and variance as control metrics
141
- - **Shannon Information Theory** — Code as an information channel
142
-
143
- The **Sovereign Coding Rules** are derived from:
144
- - **The C Book** (Banahan, Brady, Doran) — Scope hermeticity, resource lifecycle
145
- - **JaCaMo / Multi-Agent Programming** — Agent independence and encapsulation
146
-
147
- Full mathematical proof: [docs/MATHEMATIQUES.md](https://github.com/spockoo/phi-complexity/blob/main/docs/MATHEMATIQUES.md)
148
-
149
- ---
150
-
151
- ## 🏗 Sovereign Architecture
152
-
153
- ```
154
- Zero external dependencies.
155
- Pure Python standard library (ast, math, json).
156
- ```
157
-
158
- ```
159
- phi_complexity/
160
- ├── core.py ← Golden constants (PHI, TAXE_SUTURE, ETA_GOLDEN...)
161
- ├── analyseur.py ← AST fractal dissection
162
- ├── metriques.py ← Radiance Index calculation
163
- ├── rapport.py ← Console / Markdown / JSON rendering
164
- └── cli.py ← phi check / phi report
165
- ```
166
-
167
- ---
168
-
169
- ## 🔗 Integration
170
-
171
- ### Pre-commit Hook
172
- ```yaml
173
- repos:
174
- - repo: https://github.com/spockoo/phi-complexity
175
- rev: v0.1.0
176
- hooks:
177
- - id: phi-check
178
- args: [--min-radiance, "70"]
179
- ```
180
-
181
- ### GitHub Action
182
- ```yaml
183
- - name: Phi-Complexity Audit
184
- run: |
185
- pip install phi-complexity
186
- phi check ./src/ --min-radiance 75
187
- ```
188
-
189
- ---
190
-
191
- ## 📜 License
192
-
193
- MIT — Tomy Verreault, 2026
194
-
195
- *Anchored in the Bibliothèque Céleste — Morphic Phi Framework (φ-Meta)*
1
+ Metadata-Version: 2.4
2
+ Name: phi-complexity
3
+ Version: 0.2.1
4
+ Summary: Code quality metrics based on Golden Ratio (φ) mathematical invariants
5
+ Author-email: Tomy Verreault <Tiloup777@outlook.fr>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/spockoo/phi-complexity
8
+ Project-URL: Repository, https://github.com/spockoo/phi-complexity
9
+ Project-URL: Documentation, https://github.com/spockoo/phi-complexity/blob/main/docs/GUIDE.md
10
+ Project-URL: Bug Tracker, https://github.com/spockoo/phi-complexity/issues
11
+ Keywords: code-quality,complexity,golden-ratio,fibonacci,static-analysis,ast,phi,metrics,entropy
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.9
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Programming Language :: Python :: 3.14
22
+ Classifier: Topic :: Software Development :: Quality Assurance
23
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
24
+ Requires-Python: >=3.9
25
+ Description-Content-Type: text/markdown
26
+ License-File: LICENSE
27
+ Provides-Extra: notebooks
28
+ Requires-Dist: jupyter; extra == "notebooks"
29
+ Requires-Dist: matplotlib; extra == "notebooks"
30
+ Requires-Dist: numpy; extra == "notebooks"
31
+ Dynamic: license-file
32
+
33
+ # phi-complexity
34
+
35
+ > *Code quality metrics based on Golden Ratio (φ) mathematical invariants*
36
+
37
+ [![PyPI version](https://img.shields.io/pypi/v/phi-complexity.svg)](https://pypi.org/project/phi-complexity/)
38
+ [![Python 3.9+](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/)
39
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/spockoo/phi-complexity/blob/main/LICENSE)
40
+ [![Tests](https://img.shields.io/badge/tests-26%20passed-brightgreen)](https://github.com/spockoo/phi-complexity/tree/main/tests)
41
+
42
+ `phi-complexity` is the **first code quality library** that measures the health of your Python code using **universal mathematical invariants** derived from the Golden Ratio (φ = 1.618...).
43
+
44
+ Unlike `pylint` (cultural rules) or `radon` (McCabe metrics), `phi-complexity` answers:
45
+
46
+ > *"Is this code in resonance with the natural laws of order, or is it collapsing under its own entropy?"*
47
+
48
+ ---
49
+
50
+ ## ⚡ Quick Start
51
+
52
+ ```bash
53
+ pip install phi-complexity
54
+ ```
55
+
56
+ ```bash
57
+ # Audit a file
58
+ phi check my_script.py
59
+
60
+ # Audit a folder
61
+ phi check ./src/
62
+
63
+ # Generate a Markdown report
64
+ phi report my_script.py --output report.md
65
+
66
+ # CI/CD strict mode (exit 1 if radiance < 75)
67
+ phi check ./src/ --min-radiance 75
68
+ ```
69
+
70
+ ### Python API
71
+
72
+ ```python
73
+ from phi_complexity import auditer, rapport_console, rapport_markdown
74
+
75
+ # Get metrics as a dict
76
+ metrics = auditer("my_script.py")
77
+ print(metrics["radiance"]) # → 82.4
78
+ print(metrics["statut_gnostique"]) # → "EN ÉVEIL ◈"
79
+ print(metrics["oudjat"]) # → {"nom": "process_data", "ligne": 42, ...}
80
+
81
+ # Print console report
82
+ print(rapport_console("my_script.py"))
83
+
84
+ # Save Markdown report
85
+ rapport_markdown("my_script.py", sortie="report.md")
86
+ ```
87
+
88
+ ---
89
+
90
+ ## 📊 Metrics
91
+
92
+ | Metric | Description | Mathematical basis |
93
+ |---|---|---|
94
+ | **Radiance Score** | Global quality score (0–100) | `100 - f(Lilith) - g(H) - h(Anomalies) - i(Fib)` |
95
+ | **Variance de Lilith** | Structural instability | Population variance of function complexities |
96
+ | **Shannon Entropy** | Information density | `H = -Σ p·log₂(p)` |
97
+ | **φ-Ratio** | Dominant function ratio | `max_complexity / mean` → should tend toward φ |
98
+ | **Fibonacci Distance** | Natural size alignment | `Σ|n_i - Fib_k| / φ` |
99
+ | **Zeta-Score** | Global resonance | `ζ_meta(functions, φ)` converging series |
100
+
101
+ ### Gnostic Status Levels
102
+
103
+ | Score | Status | Meaning |
104
+ |---|---|---|
105
+ | ≥ 85 | **HERMÉTIQUE ✦** | Stable, harmonious, production-ready |
106
+ | 60–84 | **EN ÉVEIL ◈** | Potential exists, some entropy zones |
107
+ | < 60 | **DORMANT ░** | Deep restructuring recommended |
108
+
109
+ ---
110
+
111
+ ## 🧭 Command Stability Matrix
112
+
113
+ | Command | Stability | Purpose | Output / Side-effects |
114
+ |---|---|---|---|
115
+ | `phi check` | **Stable** | Audit radiance for files/folders | Console or JSON (no writes) |
116
+ | `phi report` | **Stable** | Markdown report | Writes `report.md` if `--output` |
117
+ | `phi oracle` | **Stable** | Release gate (radiance + tests) | Console; exits 1 on failure |
118
+ | `phi harvest` | Experimental | AST vectors collection | Writes `.phi/harvest.jsonl` |
119
+ | `phi metadata` | Experimental | Metadata summary & purge (harvest/vault) | Summaries; sanitized JSONL |
120
+ | `phi vault` / `phi graph` / `phi canvas` | Experimental | Vault storage + graph export + Obsidian canvas | Writes under `.phi/` (JSON, DOT/ASCII, `.canvas`) |
121
+ | `phi search` | Experimental | Query the vault | Console/JSON; reads `.phi/vault.jsonl` |
122
+ | `phi seal` / `phi heal` | Experimental | Seal + auto-suture via LLM | May call local LLM (`--url`); writes seal metadata in `.phi/` |
123
+ | `phi spiral` | Experimental | Radiance spiral visualization | Console ASCII only |
124
+
125
+ **Tip:** keep `phi check`/`phi report`/`phi oracle` in CI. Use experimental commands locally first and pin outputs under `.phi/` in `.gitignore` if not needed in VCS.
126
+
127
+ ---
128
+
129
+ ## 🔍 Sample Output
130
+
131
+ ```
132
+ ╔══════════════════════════════════════════════════╗
133
+ ║ PHI-COMPLEXITY — AUDIT DE RADIANCE ║
134
+ ╚══════════════════════════════════════════════════╝
135
+
136
+ 📄 Fichier : my_script.py
137
+ 📅 Date : 2026-04-08 17:11
138
+
139
+ ☼ RADIANCE : ██████████████░░░░░░ 72.6 / 100
140
+ ⚖ LILITH : 11221.9 (Structural variance)
141
+ 🌊 ENTROPIE : 2.48 bits (Shannon)
142
+ ◈ PHI-RATIO : 3.43 (ideal: φ = 1.618, Δ=1.81)
143
+ ζ ZETA-SCORE : 0.3656 (Global resonance)
144
+
145
+ STATUT : EN ÉVEIL ◈
146
+
147
+ 🔎 OUDJAT : 'process_data' (Line 42, Complexity: 376)
148
+
149
+ ⚠ SUTURES IDENTIFIED (2):
150
+ 🟡 Line 18 [LILITH] : Nested loop (depth 2). Consider a helper function.
151
+ >> for j in range(b):
152
+ 🔵 Line 67 [SOUVERAINETE] : 'load_data' receives 6 arguments. Encapsulate in an object.
153
+ >> def load_data(path, sep, enc, cols, dtype, na):
154
+ ```
155
+
156
+ ---
157
+
158
+ ## 🚀 CI Innovation Suite (Open Source)
159
+
160
+ `phi-complexity` embarque maintenant une suite orientée productivité/dev/ops :
161
+
162
+ - **AI AutoFix Studio** : règles de mutation déterministes pour appliquer rapidement des corrections CI.
163
+ - **Flow Intelligence** : classification dédiée des annulations liées à la concurrence (`WORKFLOW_CONCURRENCY_CANCELLED`).
164
+ - **Runner Sentinel** : détection explicite des blocages de queue runner (`RUNNER_QUEUE_STALL`).
165
+ - **Ops & Engineering Control Plane** : snapshot exportable JSON/Markdown (succès/échecs/cancelled, MTTR, causes racines, tendances).
166
+ - **Dev Productivity Environment** : `.devcontainer` + `Makefile` + commande `make ci-local` pour reproduire le pipeline localement.
167
+
168
+ ```bash
169
+ make setup
170
+ make ci-local
171
+ ```
172
+
173
+ ---
174
+
175
+ ## 🧮 Mathematical Foundations
176
+
177
+ The **Radiance Formula** is derived from:
178
+
179
+ - **φ-Meta Framework** (Tomy Verreault, 2026) — Axioms AX-A0 through AX-A58
180
+ - **Law of Antifragility** (EQ-AFR-BMAD): `φ_{t+1} = P_φ(φ_t + k·Var(E_t)·E_t)`
181
+ - **Cybernetics** (Korchounov, Mir, 1975) — Feedback and variance as control metrics
182
+ - **Shannon Information Theory** — Code as an information channel
183
+
184
+ The **Sovereign Coding Rules** are derived from:
185
+ - **The C Book** (Banahan, Brady, Doran) — Scope hermeticity, resource lifecycle
186
+ - **JaCaMo / Multi-Agent Programming** — Agent independence and encapsulation
187
+
188
+ Full mathematical proof: [docs/MATHEMATIQUES.md](https://github.com/spockoo/phi-complexity/blob/main/docs/MATHEMATIQUES.md)
189
+
190
+ ---
191
+
192
+ ## 🏗 Sovereign Architecture
193
+
194
+ ```
195
+ Zero external dependencies.
196
+ Pure Python standard library (ast, math, json).
197
+ ```
198
+
199
+ ```
200
+ phi_complexity/
201
+ ├── core.py ← Golden constants (PHI, TAXE_SUTURE, ETA_GOLDEN...)
202
+ ├── analyseur.py ← AST fractal dissection
203
+ ├── metriques.py ← Radiance Index calculation
204
+ ├── rapport.py ← Console / Markdown / JSON rendering
205
+ └── cli.py ← phi check / phi report
206
+ ```
207
+
208
+ ---
209
+
210
+ ## 🔗 Integration
211
+
212
+ ### Pre-commit Hook
213
+ ```yaml
214
+ repos:
215
+ - repo: https://github.com/spockoo/phi-complexity
216
+ rev: v0.1.0
217
+ hooks:
218
+ - id: phi-check
219
+ args: [--min-radiance, "70"]
220
+ ```
221
+
222
+ ### GitHub Action
223
+ ```yaml
224
+ - name: Phi-Complexity Audit
225
+ run: |
226
+ pip install phi-complexity
227
+ phi check ./src/ --min-radiance 75
228
+ ```
229
+
230
+ ### Secrets (`ADMIN_TOKEN`)
231
+
232
+ - Never commit `ADMIN_TOKEN` in tracked files.
233
+ - Store it in environment variables or GitHub Actions Secrets.
234
+ - Use `.env.example` as a template only:
235
+
236
+ ```dotenv
237
+ ADMIN_TOKEN=
238
+ ```
239
+
240
+ ---
241
+
242
+ ## 📜 License
243
+
244
+ MIT — Tomy Verreault, 2026
245
+
246
+ *Anchored in the Bibliothèque Céleste — Morphic Phi Framework (φ-Meta)*
247
+
248
+ ## 🔒 Sécurité : Activation du contrôle phi-check
249
+
250
+ Ce projet utilise un contrôle automatique (pré-commit) qui bloque tout ajout de code contenant certains mots ou outils réservés (par exemple des scripts ou outils reconnus de piratage).
251
+
252
+ **Pour installer et activer le contrôle localement :**
253
+ ```sh
254
+ pip install pre-commit
255
+ pre-commit install
256
+ ```
257
+ Le contrôle `phi-check` se lance alors automatiquement à chaque commit.