devtorch-core 3.0.1__py3-none-any.whl

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 (193) hide show
  1. devtorch_core/__init__.py +158 -0
  2. devtorch_core/aggphi_textual.py +275 -0
  3. devtorch_core/alerts/__init__.py +23 -0
  4. devtorch_core/alerts/base.py +46 -0
  5. devtorch_core/alerts/config.py +60 -0
  6. devtorch_core/alerts/dispatcher.py +110 -0
  7. devtorch_core/alerts/jira.py +96 -0
  8. devtorch_core/alerts/linear.py +72 -0
  9. devtorch_core/alerts/pagerduty.py +66 -0
  10. devtorch_core/alerts/slack.py +81 -0
  11. devtorch_core/alerts/teams.py +70 -0
  12. devtorch_core/audit/__init__.py +43 -0
  13. devtorch_core/audit/exporter.py +297 -0
  14. devtorch_core/audit/privacy.py +101 -0
  15. devtorch_core/audit/scrubber.py +149 -0
  16. devtorch_core/audit/service.py +67 -0
  17. devtorch_core/audit/signing.py +127 -0
  18. devtorch_core/broadcast/__init__.py +4 -0
  19. devtorch_core/broadcast/broadcaster.py +100 -0
  20. devtorch_core/broadcast/watcher.py +71 -0
  21. devtorch_core/capability.py +639 -0
  22. devtorch_core/cloud/__init__.py +1 -0
  23. devtorch_core/cloud/client_config.py +472 -0
  24. devtorch_core/cloud/client_configs/.claude-opencode-fallback.json +8 -0
  25. devtorch_core/cloud/client_configs/.claude-stdio.json +13 -0
  26. devtorch_core/cloud/client_configs/.cursor-mcp.json +13 -0
  27. devtorch_core/cloud/client_configs/.opencode-bridge.json +13 -0
  28. devtorch_core/cloud/client_configs/.opencode.json +15 -0
  29. devtorch_core/cloud/client_configs/.vscode-mcp.json +13 -0
  30. devtorch_core/cloud/devtorch-mcp-bridge.js +357 -0
  31. devtorch_core/cloud/mcp_client.py +229 -0
  32. devtorch_core/cloud/setup.py +144 -0
  33. devtorch_core/cloud/sync.py +143 -0
  34. devtorch_core/cloud/sync_bundle.py +603 -0
  35. devtorch_core/cloud/sync_conflicts.py +159 -0
  36. devtorch_core/cloud/sync_state.py +159 -0
  37. devtorch_core/cloud/team_sync.py +283 -0
  38. devtorch_core/codex/__init__.py +9 -0
  39. devtorch_core/codex/__main__.py +97 -0
  40. devtorch_core/codex/capture.py +208 -0
  41. devtorch_core/codex/proxy.py +412 -0
  42. devtorch_core/concept_catalog.py +209 -0
  43. devtorch_core/consolidation/__init__.py +3 -0
  44. devtorch_core/consolidation/synthesizer.py +87 -0
  45. devtorch_core/consolidation/workflow.py +175 -0
  46. devtorch_core/daemon/__init__.py +27 -0
  47. devtorch_core/daemon/supervisor.py +293 -0
  48. devtorch_core/daemon/watcher.py +244 -0
  49. devtorch_core/dashboard_api.py +2012 -0
  50. devtorch_core/deltaf.py +97 -0
  51. devtorch_core/disclosure.py +50 -0
  52. devtorch_core/divergence/__init__.py +3 -0
  53. devtorch_core/divergence/detector.py +166 -0
  54. devtorch_core/gateway/__init__.py +32 -0
  55. devtorch_core/gateway/key_manager.py +124 -0
  56. devtorch_core/gateway/metrics_webhook.py +252 -0
  57. devtorch_core/gateway/policy.py +262 -0
  58. devtorch_core/gateway/server.py +727 -0
  59. devtorch_core/gateway/sso.py +233 -0
  60. devtorch_core/gcc.py +1246 -0
  61. devtorch_core/github/__init__.py +35 -0
  62. devtorch_core/github/app.py +240 -0
  63. devtorch_core/github/comment_builder.py +113 -0
  64. devtorch_core/github/pat.py +76 -0
  65. devtorch_core/github/pr_parser.py +82 -0
  66. devtorch_core/github/pr_reporter.py +555 -0
  67. devtorch_core/gitlab/__init__.py +177 -0
  68. devtorch_core/hitl/__init__.py +4 -0
  69. devtorch_core/hitl/channels.py +129 -0
  70. devtorch_core/hitl/orchestrator.py +95 -0
  71. devtorch_core/hooks/__init__.py +17 -0
  72. devtorch_core/hooks/claude_code.py +228 -0
  73. devtorch_core/hooks/git_capture.py +341 -0
  74. devtorch_core/hooks/git_commit.py +182 -0
  75. devtorch_core/hooks/installer.py +733 -0
  76. devtorch_core/hooks/pre_commit.py +157 -0
  77. devtorch_core/hooks/runner.py +344 -0
  78. devtorch_core/identity/__init__.py +4 -0
  79. devtorch_core/identity/agent.py +86 -0
  80. devtorch_core/identity/providers.py +85 -0
  81. devtorch_core/invariants.py +182 -0
  82. devtorch_core/mcp/__init__.py +10 -0
  83. devtorch_core/mcp/auth.py +177 -0
  84. devtorch_core/mcp/server.py +1049 -0
  85. devtorch_core/metrics/__init__.py +35 -0
  86. devtorch_core/metrics/aggregate.py +215 -0
  87. devtorch_core/metrics/calibrate.py +198 -0
  88. devtorch_core/metrics/calibration.py +125 -0
  89. devtorch_core/metrics/credibility.py +288 -0
  90. devtorch_core/metrics/delivery_time.py +70 -0
  91. devtorch_core/metrics/dhs.py +126 -0
  92. devtorch_core/metrics/mcs.py +96 -0
  93. devtorch_core/metrics/roi.py +88 -0
  94. devtorch_core/metrics/session_writer.py +81 -0
  95. devtorch_core/metrics/shadow_ai.py +117 -0
  96. devtorch_core/metrics/sprint_writer.py +243 -0
  97. devtorch_core/observability/__init__.py +78 -0
  98. devtorch_core/observability/datadog.py +157 -0
  99. devtorch_core/observability/formatter.py +119 -0
  100. devtorch_core/observability/report.py +264 -0
  101. devtorch_core/observability/servicenow.py +147 -0
  102. devtorch_core/observability/splunk.py +218 -0
  103. devtorch_core/observability/webhook.py +227 -0
  104. devtorch_core/parser/__init__.py +30 -0
  105. devtorch_core/parser/blocks.py +216 -0
  106. devtorch_core/parser/inference.py +159 -0
  107. devtorch_core/parser/thinking.py +112 -0
  108. devtorch_core/projects.py +169 -0
  109. devtorch_core/prompt_artifact.py +76 -0
  110. devtorch_core/proxy/__init__.py +9 -0
  111. devtorch_core/proxy/routes/__init__.py +1 -0
  112. devtorch_core/proxy/routes/anthropic.py +264 -0
  113. devtorch_core/proxy/routes/azure_openai.py +336 -0
  114. devtorch_core/proxy/routes/gemini.py +331 -0
  115. devtorch_core/proxy/routes/groq.py +284 -0
  116. devtorch_core/proxy/routes/ollama.py +279 -0
  117. devtorch_core/proxy/routes/openai.py +287 -0
  118. devtorch_core/proxy/server.py +356 -0
  119. devtorch_core/query/__init__.py +15 -0
  120. devtorch_core/query/grep.py +181 -0
  121. devtorch_core/query/hybrid.py +86 -0
  122. devtorch_core/query/semantic.py +157 -0
  123. devtorch_core/rdp.py +105 -0
  124. devtorch_core/reasoning/__init__.py +4 -0
  125. devtorch_core/reasoning/entry.py +31 -0
  126. devtorch_core/reasoning/store.py +122 -0
  127. devtorch_core/reasoning_plus/__init__.py +70 -0
  128. devtorch_core/reasoning_plus/augmenter.py +326 -0
  129. devtorch_core/reasoning_plus/capture.py +51 -0
  130. devtorch_core/reasoning_plus/config.py +256 -0
  131. devtorch_core/reasoning_plus/context.py +262 -0
  132. devtorch_core/reasoning_plus/learning/__init__.py +72 -0
  133. devtorch_core/reasoning_plus/learning/analytics.py +141 -0
  134. devtorch_core/reasoning_plus/learning/api.py +313 -0
  135. devtorch_core/reasoning_plus/learning/chain.py +285 -0
  136. devtorch_core/reasoning_plus/learning/composer.py +74 -0
  137. devtorch_core/reasoning_plus/learning/cross_project.py +234 -0
  138. devtorch_core/reasoning_plus/learning/embeddings.py +209 -0
  139. devtorch_core/reasoning_plus/learning/extractor.py +207 -0
  140. devtorch_core/reasoning_plus/learning/models.py +116 -0
  141. devtorch_core/reasoning_plus/learning/provenance.py +126 -0
  142. devtorch_core/reasoning_plus/learning/recorder.py +81 -0
  143. devtorch_core/reasoning_plus/learning/relevance.py +122 -0
  144. devtorch_core/reasoning_plus/learning/state.py +86 -0
  145. devtorch_core/reasoning_plus/learning/store.py +160 -0
  146. devtorch_core/reasoning_plus/learning/theta_learning_bridge.py +94 -0
  147. devtorch_core/reasoning_plus/prompt.py +90 -0
  148. devtorch_core/rep.py +134 -0
  149. devtorch_core/rep_network/__init__.py +25 -0
  150. devtorch_core/rep_network/merge.py +70 -0
  151. devtorch_core/rep_network/node.py +137 -0
  152. devtorch_core/rep_network/server.py +140 -0
  153. devtorch_core/rep_network/sync.py +207 -0
  154. devtorch_core/sensitivity.py +182 -0
  155. devtorch_core/serve.py +258 -0
  156. devtorch_core/session/__init__.py +39 -0
  157. devtorch_core/session/disagreement.py +188 -0
  158. devtorch_core/session/models.py +114 -0
  159. devtorch_core/session/orchestrator.py +182 -0
  160. devtorch_core/session/planner.py +169 -0
  161. devtorch_core/session/simulator.py +132 -0
  162. devtorch_core/signing.py +290 -0
  163. devtorch_core/sis.py +197 -0
  164. devtorch_core/storage.py +308 -0
  165. devtorch_core/templates/__init__.py +6 -0
  166. devtorch_core/templates/engine.py +122 -0
  167. devtorch_core/templates/go.py +18 -0
  168. devtorch_core/templates/infra.py +19 -0
  169. devtorch_core/templates/library/__init__.py +18 -0
  170. devtorch_core/templates/library/api_design.md +27 -0
  171. devtorch_core/templates/library/bug_fix.md +27 -0
  172. devtorch_core/templates/library/decision_record.md +27 -0
  173. devtorch_core/templates/library/engine.py +228 -0
  174. devtorch_core/templates/library/security_review.md +30 -0
  175. devtorch_core/templates/python.py +19 -0
  176. devtorch_core/templates/react.py +18 -0
  177. devtorch_core/templates/typescript.py +18 -0
  178. devtorch_core/theta.py +221 -0
  179. devtorch_core/theta_synthesis.py +268 -0
  180. devtorch_core/topics.py +320 -0
  181. devtorch_core/variance.py +219 -0
  182. devtorch_core/wrapper/__init__.py +52 -0
  183. devtorch_core/wrapper/anthropic.py +487 -0
  184. devtorch_core/wrapper/base.py +562 -0
  185. devtorch_core/wrapper/bedrock.py +342 -0
  186. devtorch_core/wrapper/gemini.py +422 -0
  187. devtorch_core/wrapper/ollama.py +527 -0
  188. devtorch_core/wrapper/openai.py +461 -0
  189. devtorch_core-3.0.1.dist-info/METADATA +867 -0
  190. devtorch_core-3.0.1.dist-info/RECORD +193 -0
  191. devtorch_core-3.0.1.dist-info/WHEEL +5 -0
  192. devtorch_core-3.0.1.dist-info/entry_points.txt +2 -0
  193. devtorch_core-3.0.1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,867 @@
1
+ Metadata-Version: 2.4
2
+ Name: devtorch-core
3
+ Version: 3.0.1
4
+ Summary: DevTorch — AI reasoning capture, audit trail, and governance for agent-assisted development (core library)
5
+ Author-email: Hemant Joshi <hemant@flotorch.ai>
6
+ License: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/hemantcgi/DevTorch
8
+ Project-URL: Repository, https://github.com/hemantcgi/DevTorch
9
+ Project-URL: Documentation, https://github.com/hemantcgi/DevTorch/blob/main/Implementation/README.md
10
+ Keywords: ai,agents,governance,audit,llm,reasoning,devtorch
11
+ Classifier: Development Status :: 5 - Production/Stable
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: Apache Software License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
19
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
20
+ Requires-Python: >=3.10
21
+ Description-Content-Type: text/markdown
22
+ Provides-Extra: dev
23
+ Requires-Dist: pytest>=8.0.0; extra == "dev"
24
+ Requires-Dist: boto3>=1.34.0; extra == "dev"
25
+ Requires-Dist: pyyaml>=6.0; extra == "dev"
26
+ Provides-Extra: wrapper
27
+ Requires-Dist: anthropic>=0.40.0; extra == "wrapper"
28
+ Requires-Dist: openai>=1.50.0; extra == "wrapper"
29
+ Requires-Dist: google-generativeai>=0.8.0; extra == "wrapper"
30
+ Requires-Dist: boto3>=1.35.0; extra == "wrapper"
31
+ Requires-Dist: tiktoken>=0.7.0; extra == "wrapper"
32
+ Provides-Extra: proxy
33
+ Requires-Dist: fastapi>=0.115.0; extra == "proxy"
34
+ Requires-Dist: uvicorn[standard]>=0.32.0; extra == "proxy"
35
+ Requires-Dist: httpx>=0.27.0; extra == "proxy"
36
+ Requires-Dist: pydantic>=2.9.0; extra == "proxy"
37
+ Provides-Extra: embeddings
38
+ Requires-Dist: sentence-transformers>=3.0.0; extra == "embeddings"
39
+ Provides-Extra: mcp
40
+ Requires-Dist: mcp>=1.0.0; extra == "mcp"
41
+ Provides-Extra: audit
42
+ Requires-Dist: cryptography>=42.0.0; extra == "audit"
43
+ Requires-Dist: reportlab>=4.0.0; extra == "audit"
44
+ Requires-Dist: presidio-analyzer>=2.2.0; extra == "audit"
45
+ Provides-Extra: cloud
46
+ Requires-Dist: fastapi>=0.111.0; extra == "cloud"
47
+ Requires-Dist: uvicorn[standard]>=0.29.0; extra == "cloud"
48
+ Requires-Dist: boto3>=1.34.0; extra == "cloud"
49
+ Requires-Dist: PyJWT>=2.8.0; extra == "cloud"
50
+ Requires-Dist: cryptography>=42.0.0; extra == "cloud"
51
+ Requires-Dist: PyNaCl>=1.5.0; extra == "cloud"
52
+ Requires-Dist: azure-storage-blob>=12.19.0; extra == "cloud"
53
+ Provides-Extra: broadcast
54
+ Requires-Dist: watchdog>=3.0.0; extra == "broadcast"
55
+ Provides-Extra: all
56
+ Requires-Dist: devtorch-core[audit,cloud,embeddings,mcp,proxy,wrapper]; extra == "all"
57
+
58
+ # DevTorch
59
+
60
+ **Local-first AI agent governance.** DevTorch gives multi-agent systems a shared on-disk audit trail, coordination vector, privacy controls, and LLM integration layer — all without a remote service.
61
+
62
+ > **Latest release:** `devtorch-core` and `devtorch-cli` **3.0.1** — Local-first AI governance split into a core SDK (`devtorch-core`) and a CLI (`devtorch-cli`). Install or upgrade with `pip install -U devtorch-cli`.
63
+
64
+ ```bash
65
+ pip install -U devtorch-cli>=3.0.1
66
+ devtorch init
67
+ devtorch setup # connects to Claude Code, Cursor, or Antigravity
68
+ devtorch debug timeline
69
+ ```
70
+
71
+ ---
72
+
73
+ ## What it does
74
+
75
+ | Concern | DevTorch feature |
76
+ |---------|-----------------|
77
+ | Reasoning audit trail | Append-only `.GCC/events.log.jsonl` with SHA-256 hash chain |
78
+ | Multi-agent coordination | Coordination vector Θ — shared sensitivity map across agents |
79
+ | Privacy compliance | RDP ε-budget tracking; `[PRIVATE]` span suppression; SIS-TC quarantine |
80
+ | LLM integration | SDK wrappers, HTTP proxy, Claude Code MCP server + hooks |
81
+ | Cloud MCP server | Multi-tenant SSE endpoint; AWS S3, Azure Blob, Cloudflare R2 storage; API key + GitHub OAuth + SSO/JWKS auth |
82
+ | Governance observability | Structured reports, browser dashboard, VS Code extension (Antigravity-compatible) |
83
+ | Alerting | Slack, Jira, PagerDuty outbound webhooks |
84
+ | Metrics | MCS, DHS, ROI — all traceable to citations or explicit design choices |
85
+
86
+ ### Reasoning Plus
87
+
88
+ Reasoning Plus is DevTorch’s default augmentation mode: before every LLM call, it gathers smart context from your workspace, asks the model to produce inline `<thinking>` reasoning, and learns from previous calls by re-injecting relevant reasoning into subsequent prompts. The reasoning is captured to `.GCC/` automatically and stripped from the response your tool sees.
89
+
90
+ ```bash
91
+ devtorch reasoning-plus status # show current settings
92
+ devtorch reasoning-plus enable # turn on per project
93
+ devtorch reasoning-plus disable # turn off per project
94
+ devtorch reasoning-plus config --smart-top-n 3 --smart-max-lines 150 --learning-top-n 3
95
+ ```
96
+
97
+ Set `DEVTORCH_REASONING_PLUS=0` to disable it for a single session. See [REASONING_PLUS.md](REASONING_PLUS.md) for details.
98
+
99
+ Everything lives in `.GCC/` — a local directory in your project. No database, no network service, no telemetry.
100
+
101
+ ---
102
+
103
+ ## Install
104
+
105
+ ```bash
106
+ pip install devtorch-cli
107
+ ```
108
+
109
+ **Requirements:** Python 3.10+
110
+
111
+ One-liner installer (Linux/macOS/WSL):
112
+
113
+ ```bash
114
+ curl -fsSL https://raw.githubusercontent.com/hemantcgi/DevTorch/main/Implementation/scripts/install.sh | bash
115
+ ```
116
+
117
+ This installs `devtorch-cli` into an isolated virtual environment at `~/.devtorch-venv` and links `devtorch` onto PATH. It also supports `pip install` if you prefer to manage your own environment.
118
+
119
+ For optional extras:
120
+
121
+ ```bash
122
+ pip install devtorch-cli[wrapper] # SDK wrappers (Anthropic, OpenAI, Gemini, Bedrock, Ollama)
123
+ pip install devtorch-cli[proxy] # HTTP proxy + dashboard API (FastAPI)
124
+ pip install devtorch-cli[all] # everything
125
+ ```
126
+
127
+ > PyPI packages are `devtorch-core` (library/SDK) and `devtorch-cli` (CLI). The CLI command and import paths remain `devtorch` / `devtorch_core`.
128
+
129
+ ---
130
+
131
+ ## Upgrade from an older version
132
+
133
+ DevTorch preserves your `.GCC/` store across upgrades. Newer releases add IDE configs, hooks, or governance instructions, so you should re-run `devtorch setup` after upgrading.
134
+
135
+ **Upgrade any time:**
136
+
137
+ ```bash
138
+ pip install -U devtorch-cli>=3.0.1
139
+ cd /path/to/your/project
140
+ devtorch setup # or: devtorch setup --target <ide>
141
+ devtorch doctor
142
+ ```
143
+
144
+ `devtorch setup` is idempotent:
145
+ - It rewrites `CLAUDE.md` / `AGENTS.md` with the latest governance instructions.
146
+ - It regenerates IDE-specific config files (`.claude/settings.json`, `.cursor/mcp.json`, `opencode.json`, etc.).
147
+ - It leaves existing `.GCC/` data untouched.
148
+
149
+ **If you use the cloud MCP server**, re-run the client config installer after upgrade to get the latest bridge and fallback settings:
150
+
151
+ ```bash
152
+ export DEVTORCH_MCP_DOMAIN=devtorch-mcp.your-domain.com
153
+ devtorch cloud client-config <ide> --org <org> --repo <repo> --api-key <api-key>
154
+ ```
155
+
156
+ Supported `<ide>` values: `opencode`, `claude`, `cursor`, `vscode`, `stdio`.
157
+
158
+ ---
159
+
160
+ ## Getting Started
161
+
162
+ DevTorch takes **5 minutes to set up**. Pick your AI coding tool below.
163
+
164
+ > **Prerequisites:** Python 3.10+, pip, and the AI tool you plan to use.
165
+
166
+ ---
167
+
168
+ ### Claude Code
169
+
170
+ Claude Code is the highest-fidelity integration — hooks fire on every file write, MCP tools give Claude native governance commands, and `CLAUDE.md` carries persistent instructions across sessions.
171
+
172
+ **Step 1 — Install DevTorch**
173
+ ```bash
174
+ pip install devtorch-cli
175
+ ```
176
+
177
+ **Step 2 — Go to your project and run setup**
178
+ ```bash
179
+ cd /path/to/your/project
180
+ devtorch setup
181
+ ```
182
+
183
+ This single command:
184
+ - Initialises `.GCC/` (the local governance store)
185
+ - Writes `.claude/hooks.json` so hooks fire on every Write, Edit, Bash, and Stop event
186
+ - Adds the DevTorch MCP server to `.claude/settings.json`
187
+ - Writes governance instructions into `CLAUDE.md`
188
+
189
+ **Step 3 — Verify**
190
+ ```bash
191
+ devtorch doctor
192
+ ```
193
+
194
+ Expected output: all checks green. If any check fails, the doctor output tells you exactly what to fix.
195
+
196
+ **Step 4 — Start using Claude Code**
197
+
198
+ Open Claude Code in your project. On the first task Claude will call `devtorch_context` to load prior reasoning, and `devtorch_commit` before any file edit. The `.GCC/` store captures everything automatically.
199
+
200
+ **What you get:** Full RACP integration — reasoning commits, sensitivity events, coordination vector Θ, divergence detection, HITL conflict resolution.
201
+
202
+ > **Updating from an older version:** `pip install -U devtorch-cli>=3.0.1 && devtorch setup` will rewrite `.claude/hooks.json`, `.claude/settings.json`, and `CLAUDE.md` with the latest versions.
203
+
204
+ ---
205
+
206
+ ### Cursor
207
+
208
+ Cursor is a VS Code fork with native MCP support. DevTorch integrates via MCP tools and the VS Code sidebar extension.
209
+
210
+ **Step 1 — Install DevTorch**
211
+ ```bash
212
+ pip install devtorch-cli
213
+ ```
214
+
215
+ **Step 2 — Run setup**
216
+ ```bash
217
+ cd /path/to/your/project
218
+ devtorch setup --target cursor
219
+ ```
220
+
221
+ This creates `.cursor/mcp.json` wiring the DevTorch MCP server into Cursor, initialises `.GCC/`, and writes `CLAUDE.md` with governance instructions.
222
+
223
+ **Step 3 — Add Cursor rules**
224
+
225
+ Create `.cursor/rules/devtorch.mdc`:
226
+ ```
227
+ ---
228
+ alwaysApply: true
229
+ ---
230
+ Before any file edit, call devtorch_commit with your reasoning and the concepts you are touching.
231
+ Call devtorch_context at the start of each task to load prior decisions.
232
+ Call devtorch_sensitivity_add when touching auth, payments, schema, secrets, or PII.
233
+ ```
234
+
235
+ **Step 4 — Install the VS Code extension (optional but recommended)**
236
+
237
+ In Cursor: `Cmd+Shift+P` → "Extensions: Install from VSIX" → select `extensions/vscode/devtorch-0.1.0.vsix` from the DevTorch source directory. This adds a live sidebar panel showing `.GCC/` state, Θ hot zones, and the event feed.
238
+
239
+ **Step 5 — Verify**
240
+ ```bash
241
+ devtorch doctor
242
+ ```
243
+
244
+ **What you get:** MCP tools, VS Code sidebar, optional HTTP proxy for passive capture of all LLM calls (`devtorch proxy start`).
245
+
246
+ > **Updating from an older version:** `pip install -U devtorch-cli>=3.0.1 && devtorch setup --target cursor` will regenerate `.cursor/mcp.json` and update `CLAUDE.md`.
247
+
248
+ ---
249
+
250
+ ### Google Antigravity
251
+
252
+ Google Antigravity is a VS Code fork with a multi-agent orchestration layer. It reads `AGENTS.md` for persistent AI instructions and supports MCP servers.
253
+
254
+ **Step 1 — Install DevTorch**
255
+ ```bash
256
+ pip install devtorch-cli
257
+ ```
258
+
259
+ **Step 2 — Run setup**
260
+ ```bash
261
+ cd /path/to/your/project
262
+ devtorch setup --target antigravity
263
+ ```
264
+
265
+ This initialises `.GCC/`, writes the DevTorch MCP server config for Antigravity, and writes governance instructions into `AGENTS.md`.
266
+
267
+ **Step 3 — Install the VS Code extension**
268
+
269
+ In Antigravity: `Cmd+Shift+P` → "Extensions: Install from VSIX" → select `extensions/vscode/devtorch-0.1.0.vsix`.
270
+
271
+ **Step 4 — Verify**
272
+ ```bash
273
+ devtorch doctor
274
+ ```
275
+
276
+ **What you get:** Full RACP integration. The multi-agent nature of Antigravity makes Θ accumulation especially valuable — multiple agents share the same reasoning state through `devtorch_context`.
277
+
278
+ > **Updating from an older version:** `pip install -U devtorch-cli>=3.0.1 && devtorch setup --target antigravity` will regenerate the MCP config and update `AGENTS.md`.
279
+
280
+ ---
281
+
282
+ ### OpenCode
283
+
284
+ OpenCode connects to DevTorch through the local stdio ↔ SSE bridge. The bridge talks to the cloud MCP server first, and if the cloud is unreachable or slow it automatically falls back to the local `devtorch` CLI so your `.GCC/` audit trail is never lost.
285
+
286
+ **Step 1 — Install DevTorch**
287
+ ```bash
288
+ pip install devtorch-cli
289
+ ```
290
+
291
+ **Step 2 — Create an API key and install the client config**
292
+
293
+ Run from the project you want to govern:
294
+
295
+ ```bash
296
+ devtorch cloud key create --org myorg --repo myrepo
297
+ # Copy the printed API key — it will not be shown again.
298
+
299
+ export DEVTORCH_MCP_DOMAIN=devtorch-mcp.your-domain.com
300
+ devtorch cloud client-config opencode --org myorg --repo myrepo --api-key <api-key>
301
+ ```
302
+
303
+ This creates:
304
+ - `opencode.json` — the OpenCode MCP server config (uses the local bridge)
305
+ - `AGENTS.md` — DevTorch governance instructions for the model
306
+
307
+ **Step 3 — Verify**
308
+ ```bash
309
+ devtorch doctor
310
+ ```
311
+
312
+ Open the project in OpenCode. The DevTorch MCP tools will be listed, and the model will be instructed to call `devtorch_context` at the start of each task and `devtorch_commit` before every file edit.
313
+
314
+ **What you get:** Cloud-hosted MCP server integration with automatic local fallback, automatic reasoning commits via `AGENTS.md` instructions, and a shared Θ state across sessions.
315
+
316
+ > **Updating from an older version:** `pip install -U devtorch-cli>=3.0.1 && devtorch cloud client-config opencode --org <org> --repo <repo> --api-key <api-key>` will regenerate `opencode.json` with the latest bridge and fallback settings. **Restart OpenCode** after updating the config.
317
+
318
+ ---
319
+
320
+ ### VS Code (with GitHub Copilot)
321
+
322
+ VS Code + Copilot has **partial integration only**. Copilot's API is closed — DevTorch cannot intercept completions or inject RACP context. What works: the sidebar panel showing `.GCC/` state, and git-commit-level capture via the git hook.
323
+
324
+ **Step 1 — Install DevTorch**
325
+ ```bash
326
+ pip install devtorch-cli
327
+ cd /path/to/your/project
328
+ devtorch init
329
+ devtorch hooks install
330
+ ```
331
+
332
+ **Step 2 — Install the VS Code extension**
333
+
334
+ `Cmd+Shift+P` → "Extensions: Install from VSIX" → select `extensions/vscode/devtorch-0.1.0.vsix`.
335
+
336
+ The sidebar shows your branch, last commit, Θ hot zones, and the live event feed from `.GCC/`.
337
+
338
+ **Step 3 — Record reasoning manually**
339
+
340
+ Since Copilot's internal reasoning cannot be captured automatically, record your own reasoning commits:
341
+ ```bash
342
+ devtorch commit -m "Chose JWT over sessions — stateless service, no session store needed"
343
+ devtorch sensitivity add --source you --concept auth --confidence 0.9 --disclosure PROTECTED -m "Token expiry logic is security-critical"
344
+ ```
345
+
346
+ **What you get:** Sidebar panel (read-only), git-commit-level event capture, manual reasoning commits. Full capture requires switching to Claude Code, Cursor, Kiro, or Antigravity.
347
+
348
+ > **Updating from an older version:** `pip install -U devtorch-cli>=3.0.1 && devtorch setup` will reinstall the git hook and update the governance instructions.
349
+
350
+ ---
351
+
352
+ ### AWS Kiro
353
+
354
+ Kiro is Amazon's AI IDE. It uses steering documents and hooks — analogous to `CLAUDE.md` and `hooks.json`. Full DevTorch integration is available via manual configuration.
355
+
356
+ **Step 1 — Install DevTorch**
357
+ ```bash
358
+ pip install devtorch-cli
359
+ cd /path/to/your/project
360
+ devtorch init
361
+ ```
362
+
363
+ **Step 2 — Add the MCP server**
364
+
365
+ Create `.kiro/settings/mcp.json`:
366
+ ```json
367
+ {
368
+ "mcpServers": {
369
+ "devtorch": {
370
+ "command": "/absolute/path/to/.venv/bin/devtorch",
371
+ "args": ["mcp-server"],
372
+ "env": {}
373
+ }
374
+ }
375
+ }
376
+ ```
377
+
378
+ Replace `/absolute/path/to/.venv/bin/devtorch` with the output of `which devtorch`.
379
+
380
+ **Step 3 — Add steering document**
381
+
382
+ Create `.kiro/steering/devtorch.md` with `inclusion: always`:
383
+ ```markdown
384
+ ---
385
+ inclusion: always
386
+ ---
387
+
388
+ # DevTorch Governance
389
+
390
+ Before any file edit, call `devtorch_commit` with your reasoning and the concepts you are touching.
391
+ Call `devtorch_context` at the start of each task to load prior decisions.
392
+ Call `devtorch_sensitivity_add` when touching auth, payments, schema, secrets, or PII.
393
+ ```
394
+
395
+ **Step 4 — Add agent hook**
396
+
397
+ Create `.kiro/hooks/devtorch-capture.md`:
398
+ ```markdown
399
+ ---
400
+ name: devtorch-capture
401
+ trigger: after-file-write
402
+ ---
403
+ Run: devtorch hooks run post-tool-use
404
+ ```
405
+
406
+ **Step 5 — Verify**
407
+ ```bash
408
+ devtorch doctor
409
+ ```
410
+
411
+ **What you get:** Full RACP integration equivalent to Claude Code — MCP tools, steering-document governance, agent action hooks.
412
+
413
+ > **Updating from an older version:** `pip install -U devtorch-cli>=3.0.1`, then re-run the manual steps above and refresh your steering document with the latest `AGENTS.md` text.
414
+
415
+ ---
416
+
417
+ ### AWS Bedrock (Python SDK)
418
+
419
+ DevTorch integrates at the `boto3` call level with a one-line change.
420
+
421
+ **Step 1 — Install**
422
+ ```bash
423
+ pip install devtorch-cli[wrapper] boto3
424
+ cd /path/to/your/project
425
+ devtorch init
426
+ ```
427
+
428
+ **Step 2 — Wrap your Bedrock client**
429
+ ```python
430
+ # Before
431
+ import boto3
432
+ client = boto3.client("bedrock-runtime", region_name="us-east-1")
433
+
434
+ # After — one import change, same API
435
+ from devtorch_core.wrapper.bedrock import DevTorchBedrock
436
+ client = DevTorchBedrock(region_name="us-east-1")
437
+ ```
438
+
439
+ All `invoke_model()` and `converse()` calls are identical. DevTorch injects the RACP system prefix and captures responses automatically.
440
+
441
+ **Step 3 — Verify**
442
+ ```bash
443
+ devtorch doctor
444
+ ```
445
+
446
+ > **Updating from an older version:** `pip install -U devtorch-cli[wrapper]>=3.0.1`.
447
+
448
+ ---
449
+
450
+ ### Azure AI Foundry (Python SDK)
451
+
452
+ **Step 1 — Install**
453
+ ```bash
454
+ pip install devtorch-cli[wrapper] openai
455
+ cd /path/to/your/project
456
+ devtorch init
457
+ ```
458
+
459
+ **Step 2 — Wrap your Azure OpenAI client**
460
+ ```python
461
+ # Before
462
+ from openai import AzureOpenAI
463
+
464
+ # After — one import change, all kwargs pass through unchanged
465
+ from devtorch_core.wrapper.openai import DevTorchOpenAI as AzureOpenAI
466
+
467
+ client = AzureOpenAI(
468
+ azure_endpoint="https://my-resource.openai.azure.com/",
469
+ api_version="2024-02-01",
470
+ api_key=os.environ["AZURE_OPENAI_KEY"],
471
+ )
472
+ # All chat.completions.create() calls are identical
473
+ ```
474
+
475
+ **Step 3 — Verify**
476
+ ```bash
477
+ devtorch doctor
478
+ ```
479
+
480
+ > **Updating from an older version:** `pip install -U devtorch-cli[wrapper]>=3.0.1`.
481
+
482
+ ---
483
+
484
+ ### OpenAI Codex CLI
485
+
486
+ **Step 1 — Install**
487
+ ```bash
488
+ pip install devtorch-cli
489
+ cd /path/to/your/project
490
+ devtorch init
491
+ ```
492
+
493
+ **Step 2 — Start the proxy**
494
+ ```bash
495
+ devtorch proxy start # runs on localhost:8765
496
+ ```
497
+
498
+ **Step 3 — Point Codex at the proxy**
499
+ ```bash
500
+ export OPENAI_BASE_URL=http://localhost:8765/v1
501
+ codex "Add error handling to the payment service"
502
+ ```
503
+
504
+ All Codex calls are intercepted by the proxy, which injects the RACP prefix and captures responses into `.GCC/`.
505
+
506
+ > **Updating from an older version:** `pip install -U devtorch-cli>=3.0.1`.
507
+
508
+ ---
509
+
510
+ ### Ollama (local models)
511
+
512
+ **Step 1 — Install Ollama and pull a model**
513
+ ```bash
514
+ # Install Ollama from https://ollama.com
515
+ ollama pull llama3.2
516
+ ```
517
+
518
+ **Step 2 — Install DevTorch**
519
+ ```bash
520
+ pip install devtorch-cli[wrapper]
521
+ cd /path/to/your/project
522
+ devtorch init
523
+ ```
524
+
525
+ **Step 3 — Wrap your Ollama client**
526
+ ```python
527
+ from devtorch_core.wrapper.ollama import DevTorchOllama
528
+
529
+ client = DevTorchOllama(model="llama3.2") # any model in `ollama list`
530
+ response = client.chat(messages=[{"role": "user", "content": "Explain this function"}])
531
+ ```
532
+
533
+ **Step 4 — Verify**
534
+ ```bash
535
+ devtorch doctor
536
+ ```
537
+
538
+ No API key required. Fully local — RACP context and captures stay on-device.
539
+
540
+ > **Updating from an older version:** `pip install -U devtorch-cli[wrapper]>=3.0.1`.
541
+
542
+ ---
543
+
544
+ ### Cloud MCP server (team-wide shared governance)
545
+
546
+ For teams that want a single shared reasoning backend across all projects and machines, DevTorch provides a Cloudflare Worker MCP server. It stores `.GCC/` in Cloudflare R2 and exposes an HTTPS SSE endpoint that every IDE can connect to.
547
+
548
+ **Deploy once, use everywhere:**
549
+
550
+ ```bash
551
+ cd /path/to/DevTorch/Implementation/deploy/cloudflare-worker
552
+ cp .env.example .env
553
+ # Fill in R2_ACCOUNT_ID, R2_BUCKET, R2_ACCESS_KEY_ID, R2_SECRET_ACCESS_KEY
554
+ # Optionally set OPENAI_API_KEY for the DRPL openai embedding backend
555
+ source .env
556
+ ./setup-mcp-server.sh
557
+ ```
558
+
559
+ The script will:
560
+
561
+ 1. Ensure the R2 bucket exists.
562
+ 2. Deploy the Cloudflare Worker.
563
+ 3. Create an org/repo-scoped API key.
564
+ 4. Install the MCP client config for your IDE.
565
+ 5. Run a health check.
566
+
567
+ For CI/CD, the same script runs non-interactively:
568
+
569
+ ```bash
570
+ ./setup-mcp-server.sh --non-interactive \
571
+ --org myorg \
572
+ --repo myproject \
573
+ --ide opencode \
574
+ --openai-key "$OPENAI_API_KEY"
575
+ ```
576
+
577
+ The repository also includes `.github/workflows/deploy-cloudflare-worker.yml`, which runs on every `v*` tag and deploys the Worker (skipping key creation and client config).
578
+
579
+ **Live URL:**
580
+
581
+ ```text
582
+ https://devtorch-mcp.YOUR_ACCOUNT.workers.dev
583
+ ```
584
+
585
+ **Create a per-project API key:**
586
+
587
+ ```bash
588
+ export DEVTORCH_STORAGE=r2
589
+ export R2_ACCOUNT_ID=... R2_BUCKET=... R2_ACCESS_KEY_ID=... R2_SECRET_ACCESS_KEY=...
590
+ devtorch cloud key create --org myorg --repo myproject
591
+ ```
592
+
593
+ **Wire any IDE in one command:**
594
+
595
+ ```bash
596
+ export DEVTORCH_MCP_DOMAIN=devtorch-mcp.YOUR_ACCOUNT.workers.dev
597
+ devtorch cloud client-config <ide> --org myorg --repo myproject --api-key <api-key>
598
+ ```
599
+
600
+ Supported `<ide>` values: `opencode`, `claude`, `cursor`, `vscode`, `stdio`.
601
+
602
+ **Full walkthrough:** `deploy/cloudflare-worker/README.md` has manual setup details and the full tool list. `IDE_SETUP.md` has step-by-step setup for OpenCode, Claude Code, Cursor, VS Code, Kiro, Antigravity, JetBrains, and generic MCP clients.
603
+
604
+ > **Updating from an older version:** You do **not** need to redeploy the Cloudflare Worker for client-side changes. Just regenerate the IDE config on each machine after upgrading `devtorch-cli`:
605
+ > ```bash
606
+ > > pip install -U devtorch-cli>=3.0.1
607
+ > > export DEVTORCH_MCP_DOMAIN=devtorch-mcp.YOUR_ACCOUNT.workers.dev
608
+ > > devtorch cloud client-config <ide> --org <org> --repo <repo> --api-key <api-key>
609
+ > > ```
610
+
611
+ ---
612
+
613
+ ### Platform comparison
614
+
615
+ | Platform | Setup command | MCP tools | Auto-capture | Sidebar | Notes |
616
+ |---|---|---|---|---|---|
617
+ | Claude Code | `devtorch setup` | ✅ | ✅ hooks | ✅ | Highest fidelity |
618
+ | Cursor | `devtorch setup --target cursor` | ✅ | ✅ proxy | ✅ | Near-full |
619
+ | Google Antigravity | `devtorch setup --target antigravity` | ✅ | ✅ | ✅ | Full |
620
+ | AWS Kiro | Manual (5 steps) | ✅ | ✅ hooks | ✅ | Full — not yet automated |
621
+ | VS Code + Copilot | `devtorch init` + extension | ❌ | ❌ git only | ✅ | Partial — Copilot API closed |
622
+ | AWS Bedrock | SDK wrapper | — | ✅ SDK | — | Python SDK only |
623
+ | Azure AI Foundry | SDK wrapper or proxy | — | ✅ SDK | — | Python SDK only |
624
+ | OpenAI Codex CLI | HTTP proxy | — | ✅ proxy | — | |
625
+ | Ollama | SDK wrapper | — | ✅ SDK | — | Fully local |
626
+
627
+ ---
628
+
629
+ ## LLM integration
630
+
631
+ ### Option 1 — SDK wrapper (you own the code)
632
+
633
+ ```python
634
+ # One-line change — same API, governance captured automatically
635
+ from devtorch_core.wrapper.anthropic import DevTorchAnthropic
636
+ client = DevTorchAnthropic() # replaces anthropic.Anthropic()
637
+
638
+ # OpenAI
639
+ from devtorch_core.wrapper.openai import DevTorchOpenAI
640
+ client = DevTorchOpenAI()
641
+
642
+ # Local models via Ollama (no API key required)
643
+ from devtorch_core.wrapper.ollama import DevTorchOllama
644
+ client = DevTorchOllama(model="llama3.2") # any model in `ollama list`
645
+
646
+ # Google Gemini
647
+ from devtorch_core.wrapper.gemini import DevTorchGemini
648
+ client = DevTorchGemini(model_name="gemini-1.5-pro")
649
+
650
+ # AWS Bedrock
651
+ from devtorch_core.wrapper.bedrock import DevTorchBedrock
652
+ client = DevTorchBedrock(region_name="us-east-1")
653
+ ```
654
+
655
+ See `OLLAMA_SETUP.md` for the full Ollama guide.
656
+
657
+ ### Option 2 — HTTP proxy (Cursor, JetBrains, closed-source IDEs)
658
+
659
+ ```bash
660
+ devtorch proxy install # installs as macOS LaunchAgent or Linux systemd service
661
+ devtorch proxy start # runs on localhost:8765
662
+ ```
663
+
664
+ Configure your IDE to use `http://localhost:8765/anthropic` (or `/openai`, `/gemini`). The proxy injects RACP context and captures responses with zero latency penalty.
665
+
666
+ ### Option 3 — MCP server + hooks (Claude Code, Cursor, Kiro, Antigravity)
667
+
668
+ ```bash
669
+ devtorch setup # one command: init + hooks + MCP config + CLAUDE.md + AGENTS.md
670
+ ```
671
+
672
+ Claude Code / Cursor / Kiro / Antigravity then call `devtorch_commit`, `devtorch_sensitivity_add`, `devtorch_context`, and `devtorch_theta_read` as native MCP tools. See `IDE_SETUP.md` for per-IDE instructions.
673
+
674
+ ### Option 4 — OpenAI Codex CLI proxy
675
+
676
+ ```bash
677
+ # Start the Codex-specific proxy on localhost:8766
678
+ python -m devtorch_core.codex start
679
+
680
+ # Point Codex CLI at it
681
+ export OPENAI_BASE_URL=http://localhost:8766/v1
682
+ codex "Add error handling to the payment service"
683
+ ```
684
+
685
+ See `CODEX_SETUP.md` for the full guide.
686
+
687
+ ### Option 5 — Org gateway (enterprise, multi-developer)
688
+
689
+ ```bash
690
+ cd deploy/
691
+ cp .env.example .env # set ANTHROPIC_API_KEY and/or OPENAI_API_KEY
692
+ docker compose up # gateway on :8080, dashboard on :3000
693
+ ```
694
+
695
+ Developers point their IDE proxy URL to the gateway instead of api.openai.com. The gateway handles central API key management, SSO attribution, governance policy enforcement, and metrics aggregation. See `deploy/README.md` for Helm and Docker Compose instructions.
696
+
697
+ ---
698
+
699
+ ## Cloud Deployment
700
+
701
+ The DevTorch cloud MCP server is a multi-tenant SSE endpoint that hosts the full governance toolkit in your own cloud account. Multiple agents and developers connect simultaneously; storage is backed by AWS S3, Azure Blob, or Cloudflare R2.
702
+
703
+ **AWS ECS Fargate + S3:**
704
+ ```bash
705
+ export AWS_REGION=us-east-1 AWS_ACCOUNT_ID=123456789012
706
+ export DEVTORCH_ORG_ID=myorg AWS_S3_BUCKET=devtorch-myorg
707
+ export VPC_SUBNET_IDS=subnet-xxx VPC_SECURITY_GROUP_IDS=sg-xxx
708
+ ./deploy/aws/deploy.sh
709
+ ```
710
+
711
+ **Azure Container Apps + Blob:**
712
+ ```bash
713
+ export AZURE_RESOURCE_GROUP=devtorch-rg AZURE_LOCATION=eastus
714
+ export DEVTORCH_ORG_ID=myorg DEVTORCH_AZURE_CONTAINER=devtorch
715
+ export AZURE_STORAGE_CONNECTION_STRING="DefaultEndpointsProtocol=..."
716
+ ./deploy/azure/deploy.sh
717
+ ```
718
+
719
+ See `deploy/README.md` for full instructions, API key setup, GitHub repository connection, and environment variable reference.
720
+
721
+ ---
722
+
723
+ ## Architecture
724
+
725
+ ```
726
+ devtorch_core/ Pure library — all business logic
727
+ gcc.py GCCRepository: .GCC/ layout, event log, commits, branches
728
+ sensitivity.py Sensitivity events + SensitivityStore
729
+ theta.py Coordination vector Θ + AggPhi
730
+ capability.py OmegaCapability (A1), Lipschitz bound, PST runner
731
+ invariants.py I1 (commit-backed), I3 (semantic grounding)
732
+ variance.py f_max formula, rolling monitor, VARIANCE_ALERT
733
+ rep.py REP ledger — append-only local transport
734
+ sis.py SIS-TC corpus evaluation + quarantine
735
+ rdp.py RDP ε-budget tracking
736
+ disclosure.py [PRIVATE] span suppression
737
+ prompt_artifact.py RACP system prompt artifact store
738
+ deltaf.py Δf estimation
739
+ parser/ XML block extractor, thinking tokens, inference
740
+ wrapper/ SDK drop-in wrappers (Anthropic, OpenAI, Gemini, Bedrock)
741
+ proxy/ HTTP reverse proxy (localhost:8765)
742
+ mcp/ MCP/JSON-RPC server
743
+ hooks/ Claude Code hooks + git commit-msg hook
744
+ metrics/ MCS, DHS, ROI, calibration, citation registry
745
+ observability/ Structured reports + enterprise metrics webhook
746
+ alerts/ Slack, Jira, PagerDuty outbound alerting
747
+ rep_network/ Multi-node REP ledger sync
748
+ github/ GitHub App webhook + PR comment builder
749
+ dashboard_api.py REST API for browser dashboard
750
+
751
+ devtorch_cli/
752
+ main.py Thin argparse wrapper over devtorch_core
753
+
754
+ extensions/vscode/ VS Code extension (read-only sidebar; installs in Antigravity via .vsix)
755
+ dashboard/ React browser dashboard (Developer/Lead/CISO views)
756
+ tests/ 637 tests across all sprints (S0–S18)
757
+ examples/ end-to-end scenario examples
758
+ ```
759
+
760
+ ---
761
+
762
+ ## On-disk layout (`.GCC/`)
763
+
764
+ ```
765
+ .GCC/
766
+ VERSION # format version
767
+ events.log.jsonl # append-only audit stream (hash chain)
768
+ main.md / log.md # reasoning roadmap + chronological log
769
+ refs/HEAD # current branch
770
+ refs/branches/<name> # branch tip commit ID
771
+ commits/<id>.json # commit objects
772
+ sensitivities/events.jsonl # raw sensitivity events
773
+ theta.json # coordination vector Θ
774
+ capabilities/omega.json # A1 capability state
775
+ variance/ # calibration_report.json, live_state.json
776
+ rep/rep_ledger.jsonl # REP transport ledger
777
+ rep/peers.json # peer list for multi-node sync
778
+ sis/ # SIS-TC corpus, reports, quarantine events
779
+ rdp/rdp_state.json # RDP ε-budget
780
+ concepts/<name>.json # I3 concept definitions
781
+ prompts/ # RACP system prompt artifact
782
+ deltaf/ # Δf report
783
+ calibration.json # team-specific metric calibration
784
+ context_bundles/ # MECW-bounded context snapshots
785
+ NODE_STATE # node state machine
786
+ ```
787
+
788
+ ---
789
+
790
+ ## Key safety properties
791
+
792
+ | Property | Mechanism |
793
+ |----------|-----------|
794
+ | Commit-backed decisions (I1) | Merge/unlock blocked unless branch tips exist in commits/ and events log |
795
+ | Semantic grounding (I3) | Operations using concepts_used require matching definitions in concepts/ |
796
+ | Capability gate (A1) | Textual mode requires valid OmegaCapability + passing PST |
797
+ | Variance control (A2) | f_max=0 forces deterministic mode; A1 gate blocks textual_mode |
798
+ | Privacy budget (RDP) | epsilon exhaustion flips read_only=true in rdp_state.json |
799
+ | Proxy trust boundary | Proxy binds to 127.0.0.1 only; API keys pass through, never stored |
800
+
801
+ ---
802
+
803
+ ## Run the tests
804
+
805
+ ```bash
806
+ python3 -m venv .venv && source .venv/bin/activate
807
+ pip install -e .[dev,proxy]
808
+ pytest tests/ # 637 tests
809
+ ```
810
+
811
+ ---
812
+
813
+ ## Configuration reference
814
+
815
+ | Env var | Purpose |
816
+ |---------|---------|
817
+ | `DEVTORCH_DISABLE=1` | Disable all injection and capture (wrapper/proxy become transparent) |
818
+ | `DEVTORCH_SLACK_WEBHOOK_URL` | Slack alert delivery |
819
+ | `DEVTORCH_JIRA_URL` / `_PROJECT_KEY` / `_API_TOKEN` / `_EMAIL` | Jira issue creation |
820
+ | `DEVTORCH_PAGERDUTY_ROUTING_KEY` | PagerDuty event trigger |
821
+ | `DEVTORCH_ALERT_MIN_SEVERITY` | Minimum severity to alert on (`info`/`warning`/`critical`) |
822
+ | `DEVTORCH_METRICS_WEBHOOK_URL` | Enterprise metrics webhook endpoint |
823
+ | `DEVTORCH_ORG_ID` | Org identifier in metrics payloads |
824
+ | `DEVTORCH_METRICS_API_KEY` | Auth for metrics webhook |
825
+ | `DEVTORCH_GITHUB_WEBHOOK_SECRET` | HMAC secret for GitHub App webhook |
826
+
827
+ ---
828
+
829
+ ## Documentation
830
+
831
+ | File | Contents |
832
+ |------|----------|
833
+ | `DOCS.md` | Architecture deep-dive, Sprint 4–6 feature reference, conformance matrix |
834
+ | `OBSERVABILITY.md` | Observability pillars, daily-recall pattern, shell audit script template |
835
+ | `CONTRIBUTING.md` | Dev environment, test commands, sprint structure, PR checklist |
836
+ | `THREAT_MODEL.md` | Trust model, hash chain integrity, proxy trust boundary, known limitations |
837
+ | `DESIGN_THOUGHTS.md` | Design decisions Q1–Q14 with full citation validation |
838
+ | `IDE_SETUP.md` | VS Code, Cursor, Kiro, and Antigravity setup instructions |
839
+ | `ANTIGRAVITY_SETUP.md` | Google Antigravity step-by-step onboarding |
840
+ | `CLAUDE_CODE_QUICKSTART.md` | Claude Code step-by-step onboarding |
841
+ | `OLLAMA_SETUP.md` | Local model setup with Ollama (Llama, Mistral, Gemma, Phi, Qwen) |
842
+ | `CODEX_SETUP.md` | OpenAI Codex CLI proxy setup |
843
+ | `AGENTS.md` | Persistent AI instructions for Antigravity/Kiro |
844
+ | `deploy/README.md` | Enterprise org gateway — Docker Compose and Helm deployment |
845
+ | `devtorch_core/metrics/README.md` | MCS/DHS/ROI formulas and calibration guide |
846
+ | `devtorch_core/proxy/README.md` | HTTP proxy deployment options |
847
+ | `devtorch_core/wrapper/README.md` | SDK wrapper quick-start for all providers |
848
+ | `dashboard/README.md` | Browser dashboard setup and API reference |
849
+
850
+ ---
851
+
852
+ ## Metrics credibility
853
+
854
+ DevTorch is explicit about what every number is based on:
855
+
856
+ - **15 min context switch** — Parnin & Rugaber (2011), *Software Quality Journal*. DOI: [10.1007/s11219-010-9104-9](https://doi.org/10.1007/s11219-010-9104-9). Measured for programming tasks only.
857
+ - **Auditor rate** — BLS SOC 13-2011 (2023): $39–40/hr employed staff. External rates ($75–400/hr) not used as defaults.
858
+ - **MCS/DHS weights** — Design choices. No external benchmark. Calibrate with your team's data.
859
+ - **Developer hourly rate** — No default. You must set it: `devtorch calibrate --set developer_hourly_rate=<value>`
860
+
861
+ See `devtorch_core/metrics/credibility.py` for the full citation registry.
862
+
863
+ ---
864
+
865
+ ## License
866
+
867
+ Apache 2.0