idc-wrapper 0.2.0__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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Micaël Lanoix
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,261 @@
1
+ Metadata-Version: 2.4
2
+ Name: idc-wrapper
3
+ Version: 0.2.0
4
+ Summary: IDC — Effondrement Décisionnel Irréversible : ressource finie, journal append-only, règle d'arrêt pour agents LLM.
5
+ Author: Micaël Lanoix
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/lanoixdesign/idc-wrapper
8
+ Project-URL: Repository, https://github.com/lanoixdesign/idc-wrapper
9
+ Project-URL: Issues, https://github.com/lanoixdesign/idc-wrapper/issues
10
+ Project-URL: Changelog, https://github.com/lanoixdesign/idc-wrapper/blob/main/CHANGELOG.md
11
+ Project-URL: Documentation, https://github.com/lanoixdesign/idc-wrapper#readme
12
+ Keywords: idc,agents,llm,finitude,stop-rule,agi,langgraph
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
21
+ Classifier: Intended Audience :: Developers
22
+ Requires-Python: >=3.10
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE
25
+ Provides-Extra: dev
26
+ Provides-Extra: langgraph
27
+ Requires-Dist: langgraph>=0.2; extra == "langgraph"
28
+ Dynamic: license-file
29
+
30
+ # IDC Wrapper
31
+
32
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE)
33
+ [![Release](https://img.shields.io/github/v/release/lanoixdesign/idc-wrapper?display_name=tag&sort=semver)](https://github.com/lanoixdesign/idc-wrapper/releases/tag/v0.2.0)
34
+ [![CI](https://github.com/lanoixdesign/idc-wrapper/actions/workflows/ci.yml/badge.svg)](https://github.com/lanoixdesign/idc-wrapper/actions/workflows/ci.yml)
35
+ [![Python](https://img.shields.io/badge/python-3.10%2B-blue.svg)](./python/)
36
+ [![Rust](https://img.shields.io/badge/rust-2021-orange.svg)](./Cargo.toml)
37
+
38
+ **Couche d’enveloppe IDC — Effondrement Décisionnel Irréversible**
39
+ Open source, pensée pour **tous les runtimes d’agents** (Cursor, Claude Code, LangGraph, OpenAI Agents, boucles custom…).
40
+
41
+ > **English** — Finite deliberation budget `R`, append-only journal, optimal stop rule.
42
+ > Hallucination should cost more than admitting ignorance. Mock benches are real
43
+ > numbers on a fake LLM; theory remains hypothesis — see [PERFORMANCE.md](./PERFORMANCE.md).
44
+
45
+ ## Pourquoi l’IDC (vision, sans claims inventés)
46
+
47
+ Une IA sans **finitude** peut réfléchir sans fin, hésiter, et inventer : inventer
48
+ ne coûte souvent pas plus cher qu’avouer « je ne sais pas ». L’IDC propose
49
+ d’envelopper le modèle avec :
50
+
51
+ 1. une **ressource finie** `R` qui décroît avec le calcul,
52
+ 2. un **journal append-only** (engagements irréversibles),
53
+ 3. une **règle d’arrêt** (s’effondrer quand la valeur marginale de réfléchir
54
+ ne justifie plus le coût).
55
+
56
+ C’est un **modèle + protocole de test**, pas une preuve empirique déjà validée
57
+ sur les LLM de frontier. Les chiffres de ce dépôt viennent d’un **mock**
58
+ reproductible — voir [PERFORMANCE.md](./PERFORMANCE.md).
59
+
60
+ ## Livre / concept
61
+
62
+ - Livre (Amazon FR) : [Effondrement Décisionnel Irréversible](https://www.amazon.fr/dp/B0HMX1CY6R)
63
+ - Citation machine-readable : [`CITATION.cff`](./CITATION.cff)
64
+
65
+ ## Table des matières
66
+
67
+ - [Pour les agents](#pour-les-agents)
68
+ - [Quickstart Python](#quickstart-python)
69
+ - [Quickstart Rust](#quickstart-rust)
70
+ - [Exemples](#exemples)
71
+ - [Adaptateur LangGraph](#adaptateur-langgraph)
72
+ - [Packs agents](#packs-agents)
73
+ - [Performance (mock)](#performance-mock)
74
+ - [Structure](#structure)
75
+ - [Paramètres](#paramètres)
76
+ - [Roadmap](#roadmap)
77
+ - [Communauté](#communauté)
78
+ - [Licence & auteur](#licence--auteur)
79
+
80
+ ## Pour les agents
81
+
82
+ Lis d’abord **[AGENTS.md](./AGENTS.md)**.
83
+
84
+ | Fichier | Rôle |
85
+ |---------|------|
86
+ | [`agents/skills/idc/SKILL.md`](./agents/skills/idc/SKILL.md) | Skill / recipe portable |
87
+ | [`schema/idc-protocol.json`](./schema/idc-protocol.json) | Contrat machine-readable |
88
+ | [`python/idc/`](./python/idc/) | Package référence (journal, agent, mock) |
89
+ | [`python/idc/langgraph_adapter.py`](./python/idc/langgraph_adapter.py) | Adaptateur LangGraph-shaped (optionnel) |
90
+ | [`python/idc_agent.py`](./python/idc_agent.py) | CLI (OpenAI-compatible ou `--mock`) |
91
+ | [`src/lib.rs`](./src/lib.rs) | Bibliothèque Rust (`IdcAgent`, journal) |
92
+ | [`src/main.rs`](./src/main.rs) | Binaire CLI mince |
93
+ | [`examples/`](./examples/) | Cas Sans IDC / Avec IDC |
94
+ | [`packs/`](./packs/) | Snippets Cursor / Claude / OpenAI Agents |
95
+ | [`PERFORMANCE.md`](./PERFORMANCE.md) | Mesures mock + hypothèses vs démontré |
96
+
97
+ ## Quickstart Python
98
+
99
+ ```bash
100
+ # Démo sans clé API (recommandé pour découvrir)
101
+ PYTHONPATH=python python3 python/idc_agent.py --mock support_client \
102
+ "Client : où est mon colis ?"
103
+
104
+ # Comparer baseline (pas de VOI) vs IDC
105
+ PYTHONPATH=python python3 python/idc_agent.py --mock verbose --baseline "long"
106
+ PYTHONPATH=python python3 python/idc_agent.py --mock verbose "long"
107
+
108
+ # Avec API compatible OpenAI
109
+ export OPENAI_API_KEY=sk-...
110
+ # optionnel : OPENAI_BASE_URL=http://localhost:11434/v1 OPENAI_MODEL=llama3.2
111
+ PYTHONPATH=python python3 python/idc_agent.py "Explique l’IDC en 5 points"
112
+ ```
113
+
114
+ Installation package (editable locale ; PyPI public prévu — voir [PUBLISHING.md](./PUBLISHING.md)) :
115
+
116
+ ```bash
117
+ pip install -e .
118
+ # ou plus tard : pip install idc-wrapper
119
+ ```
120
+
121
+ Tests / bench (aucune clé) :
122
+
123
+ ```bash
124
+ PYTHONPATH=python python3 -m unittest discover -s python/idc -v
125
+ PYTHONPATH=python python3 benchmarks/bench_mock.py
126
+ ```
127
+
128
+ ## Quickstart Rust
129
+
130
+ ```bash
131
+ cargo build --release
132
+ export OPENAI_API_KEY=sk-...
133
+ ./target/release/idc-wrapper
134
+ ```
135
+
136
+ La logique vit dans la **crate lib** `idc_wrapper` (`src/lib.rs`) ; le binaire
137
+ `src/main.rs` l’appelle seulement. Par défaut : `https://api.openai.com/v1/chat/completions`,
138
+ modèle `gpt-4o-mini`.
139
+
140
+ > **Note toolchain** : `cargo check` / `cargo build` nécessitent un Rust stable
141
+ > récent (CI utilise `dtolnay/rust-toolchain@stable`). Si ton `rustc` local est
142
+ > trop ancien pour les dépendances (`reqwest` / `tokio`), la structure lib+bin
143
+ > reste valide — mets à jour le toolchain ou peaufine en CI.
144
+
145
+ ## Exemples
146
+
147
+ Cas concrets avec narration **Sans IDC / Avec IDC / Bénéfice** et scripts mock :
148
+
149
+ | # | Dossier | Idée |
150
+ |---|---------|------|
151
+ | 01 | [`examples/01_support_client`](./examples/01_support_client/) | Support livraison |
152
+ | 02 | [`examples/02_code_assistant`](./examples/02_code_assistant/) | Fix bug + stop avant API fantôme |
153
+ | 03 | [`examples/03_research_synth`](./examples/03_research_synth/) | Synthèse bornée, pas de citation inventée |
154
+ | 04 | [`examples/04_langgraph`](./examples/04_langgraph/) | Boucle nœud/état style LangGraph + arrêt IDC |
155
+
156
+ Voir [`examples/README.md`](./examples/README.md). Flux ASCII/Mermaid : [`docs/demo.md`](./docs/demo.md).
157
+
158
+ ## Adaptateur LangGraph
159
+
160
+ Boucle **nœud / état** compatible LangGraph, **sans dépendance obligatoire** :
161
+
162
+ ```bash
163
+ # démo mock (stdlib)
164
+ PYTHONPATH=python python3 examples/04_langgraph/run_mock.py
165
+
166
+ # optionnel : vrai StateGraph
167
+ pip install 'idc-wrapper[langgraph]' # ou : pip install langgraph
168
+ ```
169
+
170
+ ```python
171
+ from idc.langgraph_adapter import IdcGraphRunner, compile_langgraph
172
+ # IdcGraphRunner : toujours disponible
173
+ # compile_langgraph(...) : ImportError clair si langgraph absent
174
+ ```
175
+
176
+ Détails : [`examples/04_langgraph/README.md`](./examples/04_langgraph/README.md).
177
+
178
+ ## Packs agents
179
+
180
+ Snippets copy-paste prêts :
181
+
182
+ | Runtime | Pack |
183
+ |---------|------|
184
+ | Cursor | [`packs/cursor/RULE.md`](./packs/cursor/RULE.md) + [`packs/cursor/idc.mdc`](./packs/cursor/idc.mdc) |
185
+ | Claude Code | [`packs/claude/CLAUDE.md`](./packs/claude/CLAUDE.md) |
186
+ | OpenAI Agents SDK | [`packs/openai-agents/README.md`](./packs/openai-agents/README.md) (interface + stub) |
187
+
188
+ ## Performance (mock)
189
+
190
+ Micro-benchmark **Baseline (N fixes) vs IDC (règle d’arrêt)** sur réponses mock.
191
+ Dernière agrégation typique (régénérer localement pour confirmer) :
192
+
193
+ | Agrégat | Baseline | IDC |
194
+ |---------|----------|-----|
195
+ | Étapes moyennes | 8.0 | ~3.4 |
196
+ | Tokens≈ moyens | ~44.8 | ~26.6 |
197
+ | R finale moyenne | ~64.2 | ~78.7 |
198
+
199
+ Détail, caveats, et distinction **hypothèse livre vs démontré par le code** :
200
+ **[PERFORMANCE.md](./PERFORMANCE.md)**. Aucun claim de perf LLM réel ici.
201
+
202
+ ## Structure
203
+
204
+ ```
205
+ idc-wrapper/
206
+ ├── AGENTS.md # contrat pour runtimes agents
207
+ ├── PERFORMANCE.md # mesures mock honnêtes
208
+ ├── ROADMAP.md # v0.3 / v0.4
209
+ ├── PUBLISHING.md # PyPI trusted publisher
210
+ ├── python/idc/ # package (journal, agent, mock, langgraph_adapter)
211
+ ├── python/idc_agent.py # CLI
212
+ ├── src/lib.rs # crate Rust publique
213
+ ├── src/main.rs # binaire mince
214
+ ├── schema/idc-protocol.json
215
+ ├── agents/skills/idc/SKILL.md
216
+ ├── packs/ # Cursor / Claude / OpenAI Agents
217
+ ├── examples/ # 4 cas + README (dont LangGraph)
218
+ ├── docs/demo.md # flux IDC (ASCII / Mermaid)
219
+ ├── benchmarks/ # bench_mock.py + results/
220
+ ├── community/ # good-first-issues prêts à coller
221
+ └── .github/ # CI, publish-pypi, templates
222
+ ```
223
+
224
+ ## Paramètres
225
+
226
+ | Paramètre | Défaut | Rôle |
227
+ |-----------|--------|------|
228
+ | `resource` | 100.0 | Budget initial |
229
+ | `critical_threshold` | 15.0 | Force l’arrêt |
230
+ | `cost_per_token` | 0.8 | Coût approx. par token |
231
+ | `max_steps` | 8 | Garde-fou |
232
+
233
+ Heuristique VOI simple : `estimated_gain > cost_per_token * 50 * risk`.
234
+
235
+ ## Roadmap
236
+
237
+ Priorités v0.3 / v0.4 (PyPI live, crates.io, bench LLM réel, plus d’adapters) :
238
+ **[ROADMAP.md](./ROADMAP.md)**.
239
+
240
+ ## Communauté
241
+
242
+ - Contribuer : [CONTRIBUTING.md](./CONTRIBUTING.md) (FR + EN) — active aussi **Discussions** (Settings → Features)
243
+ - Conduite : [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md)
244
+ - Sécurité : [SECURITY.md](./SECURITY.md)
245
+ - Changelog : [CHANGELOG.md](./CHANGELOG.md)
246
+ - Good first issues : [community/GOOD_FIRST_ISSUES.md](./community/GOOD_FIRST_ISSUES.md)
247
+ - Issues / PR : templates dans `.github/`
248
+ - Publication PyPI : [PUBLISHING.md](./PUBLISHING.md)
249
+
250
+ Idées bienvenues : VOI plus fine, persistance disque du journal, publish crates.io,
251
+ adapter Agents SDK réel, calibrage dynamique du seuil — **avec mesures
252
+ reproductibles**, pas de chiffres inventés. (Adaptateur LangGraph-shaped : v0.2.0.)
253
+
254
+ ## Licence & auteur
255
+
256
+ [MIT](./LICENSE) — Copyright (c) 2026 Micaël Lanoix
257
+
258
+ **Micaël Lanoix** — continuité des travaux sur l’ADN numérique des images
259
+ (PNGIA / Pixel 4D) et l’Effondrement Décisionnel Irréversible.
260
+
261
+ Citation : voir [`CITATION.cff`](./CITATION.cff). Livre : [Amazon FR](https://www.amazon.fr/dp/B0HMX1CY6R).
@@ -0,0 +1,232 @@
1
+ # IDC Wrapper
2
+
3
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE)
4
+ [![Release](https://img.shields.io/github/v/release/lanoixdesign/idc-wrapper?display_name=tag&sort=semver)](https://github.com/lanoixdesign/idc-wrapper/releases/tag/v0.2.0)
5
+ [![CI](https://github.com/lanoixdesign/idc-wrapper/actions/workflows/ci.yml/badge.svg)](https://github.com/lanoixdesign/idc-wrapper/actions/workflows/ci.yml)
6
+ [![Python](https://img.shields.io/badge/python-3.10%2B-blue.svg)](./python/)
7
+ [![Rust](https://img.shields.io/badge/rust-2021-orange.svg)](./Cargo.toml)
8
+
9
+ **Couche d’enveloppe IDC — Effondrement Décisionnel Irréversible**
10
+ Open source, pensée pour **tous les runtimes d’agents** (Cursor, Claude Code, LangGraph, OpenAI Agents, boucles custom…).
11
+
12
+ > **English** — Finite deliberation budget `R`, append-only journal, optimal stop rule.
13
+ > Hallucination should cost more than admitting ignorance. Mock benches are real
14
+ > numbers on a fake LLM; theory remains hypothesis — see [PERFORMANCE.md](./PERFORMANCE.md).
15
+
16
+ ## Pourquoi l’IDC (vision, sans claims inventés)
17
+
18
+ Une IA sans **finitude** peut réfléchir sans fin, hésiter, et inventer : inventer
19
+ ne coûte souvent pas plus cher qu’avouer « je ne sais pas ». L’IDC propose
20
+ d’envelopper le modèle avec :
21
+
22
+ 1. une **ressource finie** `R` qui décroît avec le calcul,
23
+ 2. un **journal append-only** (engagements irréversibles),
24
+ 3. une **règle d’arrêt** (s’effondrer quand la valeur marginale de réfléchir
25
+ ne justifie plus le coût).
26
+
27
+ C’est un **modèle + protocole de test**, pas une preuve empirique déjà validée
28
+ sur les LLM de frontier. Les chiffres de ce dépôt viennent d’un **mock**
29
+ reproductible — voir [PERFORMANCE.md](./PERFORMANCE.md).
30
+
31
+ ## Livre / concept
32
+
33
+ - Livre (Amazon FR) : [Effondrement Décisionnel Irréversible](https://www.amazon.fr/dp/B0HMX1CY6R)
34
+ - Citation machine-readable : [`CITATION.cff`](./CITATION.cff)
35
+
36
+ ## Table des matières
37
+
38
+ - [Pour les agents](#pour-les-agents)
39
+ - [Quickstart Python](#quickstart-python)
40
+ - [Quickstart Rust](#quickstart-rust)
41
+ - [Exemples](#exemples)
42
+ - [Adaptateur LangGraph](#adaptateur-langgraph)
43
+ - [Packs agents](#packs-agents)
44
+ - [Performance (mock)](#performance-mock)
45
+ - [Structure](#structure)
46
+ - [Paramètres](#paramètres)
47
+ - [Roadmap](#roadmap)
48
+ - [Communauté](#communauté)
49
+ - [Licence & auteur](#licence--auteur)
50
+
51
+ ## Pour les agents
52
+
53
+ Lis d’abord **[AGENTS.md](./AGENTS.md)**.
54
+
55
+ | Fichier | Rôle |
56
+ |---------|------|
57
+ | [`agents/skills/idc/SKILL.md`](./agents/skills/idc/SKILL.md) | Skill / recipe portable |
58
+ | [`schema/idc-protocol.json`](./schema/idc-protocol.json) | Contrat machine-readable |
59
+ | [`python/idc/`](./python/idc/) | Package référence (journal, agent, mock) |
60
+ | [`python/idc/langgraph_adapter.py`](./python/idc/langgraph_adapter.py) | Adaptateur LangGraph-shaped (optionnel) |
61
+ | [`python/idc_agent.py`](./python/idc_agent.py) | CLI (OpenAI-compatible ou `--mock`) |
62
+ | [`src/lib.rs`](./src/lib.rs) | Bibliothèque Rust (`IdcAgent`, journal) |
63
+ | [`src/main.rs`](./src/main.rs) | Binaire CLI mince |
64
+ | [`examples/`](./examples/) | Cas Sans IDC / Avec IDC |
65
+ | [`packs/`](./packs/) | Snippets Cursor / Claude / OpenAI Agents |
66
+ | [`PERFORMANCE.md`](./PERFORMANCE.md) | Mesures mock + hypothèses vs démontré |
67
+
68
+ ## Quickstart Python
69
+
70
+ ```bash
71
+ # Démo sans clé API (recommandé pour découvrir)
72
+ PYTHONPATH=python python3 python/idc_agent.py --mock support_client \
73
+ "Client : où est mon colis ?"
74
+
75
+ # Comparer baseline (pas de VOI) vs IDC
76
+ PYTHONPATH=python python3 python/idc_agent.py --mock verbose --baseline "long"
77
+ PYTHONPATH=python python3 python/idc_agent.py --mock verbose "long"
78
+
79
+ # Avec API compatible OpenAI
80
+ export OPENAI_API_KEY=sk-...
81
+ # optionnel : OPENAI_BASE_URL=http://localhost:11434/v1 OPENAI_MODEL=llama3.2
82
+ PYTHONPATH=python python3 python/idc_agent.py "Explique l’IDC en 5 points"
83
+ ```
84
+
85
+ Installation package (editable locale ; PyPI public prévu — voir [PUBLISHING.md](./PUBLISHING.md)) :
86
+
87
+ ```bash
88
+ pip install -e .
89
+ # ou plus tard : pip install idc-wrapper
90
+ ```
91
+
92
+ Tests / bench (aucune clé) :
93
+
94
+ ```bash
95
+ PYTHONPATH=python python3 -m unittest discover -s python/idc -v
96
+ PYTHONPATH=python python3 benchmarks/bench_mock.py
97
+ ```
98
+
99
+ ## Quickstart Rust
100
+
101
+ ```bash
102
+ cargo build --release
103
+ export OPENAI_API_KEY=sk-...
104
+ ./target/release/idc-wrapper
105
+ ```
106
+
107
+ La logique vit dans la **crate lib** `idc_wrapper` (`src/lib.rs`) ; le binaire
108
+ `src/main.rs` l’appelle seulement. Par défaut : `https://api.openai.com/v1/chat/completions`,
109
+ modèle `gpt-4o-mini`.
110
+
111
+ > **Note toolchain** : `cargo check` / `cargo build` nécessitent un Rust stable
112
+ > récent (CI utilise `dtolnay/rust-toolchain@stable`). Si ton `rustc` local est
113
+ > trop ancien pour les dépendances (`reqwest` / `tokio`), la structure lib+bin
114
+ > reste valide — mets à jour le toolchain ou peaufine en CI.
115
+
116
+ ## Exemples
117
+
118
+ Cas concrets avec narration **Sans IDC / Avec IDC / Bénéfice** et scripts mock :
119
+
120
+ | # | Dossier | Idée |
121
+ |---|---------|------|
122
+ | 01 | [`examples/01_support_client`](./examples/01_support_client/) | Support livraison |
123
+ | 02 | [`examples/02_code_assistant`](./examples/02_code_assistant/) | Fix bug + stop avant API fantôme |
124
+ | 03 | [`examples/03_research_synth`](./examples/03_research_synth/) | Synthèse bornée, pas de citation inventée |
125
+ | 04 | [`examples/04_langgraph`](./examples/04_langgraph/) | Boucle nœud/état style LangGraph + arrêt IDC |
126
+
127
+ Voir [`examples/README.md`](./examples/README.md). Flux ASCII/Mermaid : [`docs/demo.md`](./docs/demo.md).
128
+
129
+ ## Adaptateur LangGraph
130
+
131
+ Boucle **nœud / état** compatible LangGraph, **sans dépendance obligatoire** :
132
+
133
+ ```bash
134
+ # démo mock (stdlib)
135
+ PYTHONPATH=python python3 examples/04_langgraph/run_mock.py
136
+
137
+ # optionnel : vrai StateGraph
138
+ pip install 'idc-wrapper[langgraph]' # ou : pip install langgraph
139
+ ```
140
+
141
+ ```python
142
+ from idc.langgraph_adapter import IdcGraphRunner, compile_langgraph
143
+ # IdcGraphRunner : toujours disponible
144
+ # compile_langgraph(...) : ImportError clair si langgraph absent
145
+ ```
146
+
147
+ Détails : [`examples/04_langgraph/README.md`](./examples/04_langgraph/README.md).
148
+
149
+ ## Packs agents
150
+
151
+ Snippets copy-paste prêts :
152
+
153
+ | Runtime | Pack |
154
+ |---------|------|
155
+ | Cursor | [`packs/cursor/RULE.md`](./packs/cursor/RULE.md) + [`packs/cursor/idc.mdc`](./packs/cursor/idc.mdc) |
156
+ | Claude Code | [`packs/claude/CLAUDE.md`](./packs/claude/CLAUDE.md) |
157
+ | OpenAI Agents SDK | [`packs/openai-agents/README.md`](./packs/openai-agents/README.md) (interface + stub) |
158
+
159
+ ## Performance (mock)
160
+
161
+ Micro-benchmark **Baseline (N fixes) vs IDC (règle d’arrêt)** sur réponses mock.
162
+ Dernière agrégation typique (régénérer localement pour confirmer) :
163
+
164
+ | Agrégat | Baseline | IDC |
165
+ |---------|----------|-----|
166
+ | Étapes moyennes | 8.0 | ~3.4 |
167
+ | Tokens≈ moyens | ~44.8 | ~26.6 |
168
+ | R finale moyenne | ~64.2 | ~78.7 |
169
+
170
+ Détail, caveats, et distinction **hypothèse livre vs démontré par le code** :
171
+ **[PERFORMANCE.md](./PERFORMANCE.md)**. Aucun claim de perf LLM réel ici.
172
+
173
+ ## Structure
174
+
175
+ ```
176
+ idc-wrapper/
177
+ ├── AGENTS.md # contrat pour runtimes agents
178
+ ├── PERFORMANCE.md # mesures mock honnêtes
179
+ ├── ROADMAP.md # v0.3 / v0.4
180
+ ├── PUBLISHING.md # PyPI trusted publisher
181
+ ├── python/idc/ # package (journal, agent, mock, langgraph_adapter)
182
+ ├── python/idc_agent.py # CLI
183
+ ├── src/lib.rs # crate Rust publique
184
+ ├── src/main.rs # binaire mince
185
+ ├── schema/idc-protocol.json
186
+ ├── agents/skills/idc/SKILL.md
187
+ ├── packs/ # Cursor / Claude / OpenAI Agents
188
+ ├── examples/ # 4 cas + README (dont LangGraph)
189
+ ├── docs/demo.md # flux IDC (ASCII / Mermaid)
190
+ ├── benchmarks/ # bench_mock.py + results/
191
+ ├── community/ # good-first-issues prêts à coller
192
+ └── .github/ # CI, publish-pypi, templates
193
+ ```
194
+
195
+ ## Paramètres
196
+
197
+ | Paramètre | Défaut | Rôle |
198
+ |-----------|--------|------|
199
+ | `resource` | 100.0 | Budget initial |
200
+ | `critical_threshold` | 15.0 | Force l’arrêt |
201
+ | `cost_per_token` | 0.8 | Coût approx. par token |
202
+ | `max_steps` | 8 | Garde-fou |
203
+
204
+ Heuristique VOI simple : `estimated_gain > cost_per_token * 50 * risk`.
205
+
206
+ ## Roadmap
207
+
208
+ Priorités v0.3 / v0.4 (PyPI live, crates.io, bench LLM réel, plus d’adapters) :
209
+ **[ROADMAP.md](./ROADMAP.md)**.
210
+
211
+ ## Communauté
212
+
213
+ - Contribuer : [CONTRIBUTING.md](./CONTRIBUTING.md) (FR + EN) — active aussi **Discussions** (Settings → Features)
214
+ - Conduite : [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md)
215
+ - Sécurité : [SECURITY.md](./SECURITY.md)
216
+ - Changelog : [CHANGELOG.md](./CHANGELOG.md)
217
+ - Good first issues : [community/GOOD_FIRST_ISSUES.md](./community/GOOD_FIRST_ISSUES.md)
218
+ - Issues / PR : templates dans `.github/`
219
+ - Publication PyPI : [PUBLISHING.md](./PUBLISHING.md)
220
+
221
+ Idées bienvenues : VOI plus fine, persistance disque du journal, publish crates.io,
222
+ adapter Agents SDK réel, calibrage dynamique du seuil — **avec mesures
223
+ reproductibles**, pas de chiffres inventés. (Adaptateur LangGraph-shaped : v0.2.0.)
224
+
225
+ ## Licence & auteur
226
+
227
+ [MIT](./LICENSE) — Copyright (c) 2026 Micaël Lanoix
228
+
229
+ **Micaël Lanoix** — continuité des travaux sur l’ADN numérique des images
230
+ (PNGIA / Pixel 4D) et l’Effondrement Décisionnel Irréversible.
231
+
232
+ Citation : voir [`CITATION.cff`](./CITATION.cff). Livre : [Amazon FR](https://www.amazon.fr/dp/B0HMX1CY6R).
@@ -0,0 +1,49 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "idc-wrapper"
7
+ version = "0.2.0"
8
+ description = "IDC — Effondrement Décisionnel Irréversible : ressource finie, journal append-only, règle d'arrêt pour agents LLM."
9
+ readme = "README.md"
10
+ license = { text = "MIT" }
11
+ authors = [{ name = "Micaël Lanoix" }]
12
+ requires-python = ">=3.10"
13
+ keywords = ["idc", "agents", "llm", "finitude", "stop-rule", "agi", "langgraph"]
14
+ classifiers = [
15
+ "Development Status :: 4 - Beta",
16
+ "License :: OSI Approved :: MIT License",
17
+ "Programming Language :: Python :: 3",
18
+ "Programming Language :: Python :: 3.10",
19
+ "Programming Language :: Python :: 3.11",
20
+ "Programming Language :: Python :: 3.12",
21
+ "Programming Language :: Python :: 3.13",
22
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
23
+ "Intended Audience :: Developers",
24
+ ]
25
+ # stdlib only for the agent runtime
26
+ dependencies = []
27
+
28
+ [project.urls]
29
+ Homepage = "https://github.com/lanoixdesign/idc-wrapper"
30
+ Repository = "https://github.com/lanoixdesign/idc-wrapper"
31
+ Issues = "https://github.com/lanoixdesign/idc-wrapper/issues"
32
+ Changelog = "https://github.com/lanoixdesign/idc-wrapper/blob/main/CHANGELOG.md"
33
+ Documentation = "https://github.com/lanoixdesign/idc-wrapper#readme"
34
+
35
+ [project.optional-dependencies]
36
+ dev = []
37
+ # LangGraph réel pour compile_langgraph() ; IdcGraphRunner n'en a pas besoin.
38
+ langgraph = ["langgraph>=0.2"]
39
+
40
+ [project.scripts]
41
+ idc-agent = "idc_agent:main"
42
+
43
+ [tool.setuptools.packages.find]
44
+ where = ["python"]
45
+ include = ["idc*"]
46
+
47
+ [tool.setuptools]
48
+ py-modules = ["idc_agent"]
49
+ package-dir = { "" = "python" }
@@ -0,0 +1,25 @@
1
+ """IDC — Effondrement Décisionnel Irréversible (Irreversible Decision Collapse).
2
+
3
+ Package portable (stdlib) pour envelopper un LLM avec ressource finie,
4
+ journal append-only et règle d'arrêt.
5
+
6
+ L'adaptateur LangGraph-shaped vit dans `idc.langgraph_adapter` (pas d'import
7
+ lourd ici) : `IdcGraphRunner` fonctionne sans langgraph ;
8
+ `compile_langgraph` requiert l'extra optionnel `[langgraph]`.
9
+ """
10
+
11
+ from .journal import AppendOnlyJournal, JournalEntry
12
+ from .agent import IdcAgent, IdcRunResult, Backend
13
+ from .mock_backend import MockBackend, MockScenario
14
+
15
+ __all__ = [
16
+ "AppendOnlyJournal",
17
+ "JournalEntry",
18
+ "IdcAgent",
19
+ "IdcRunResult",
20
+ "Backend",
21
+ "MockBackend",
22
+ "MockScenario",
23
+ ]
24
+
25
+ __version__ = "0.2.0"