devcouncil 0.1.0

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 (125) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +643 -0
  3. package/bin/devcouncil.js +62 -0
  4. package/package.json +47 -0
  5. package/pyproject.toml +31 -0
  6. package/src/devcouncil/__init__.py +0 -0
  7. package/src/devcouncil/__main__.py +4 -0
  8. package/src/devcouncil/app/__init__.py +28 -0
  9. package/src/devcouncil/app/config.py +131 -0
  10. package/src/devcouncil/app/errors.py +23 -0
  11. package/src/devcouncil/app/events.py +44 -0
  12. package/src/devcouncil/app/orchestrator.py +92 -0
  13. package/src/devcouncil/app/run_context.py +39 -0
  14. package/src/devcouncil/app/state_machine.py +108 -0
  15. package/src/devcouncil/artifacts/__init__.py +1 -0
  16. package/src/devcouncil/artifacts/coverage.py +96 -0
  17. package/src/devcouncil/artifacts/graph.py +143 -0
  18. package/src/devcouncil/artifacts/migrations.py +20 -0
  19. package/src/devcouncil/artifacts/schemas.py +23 -0
  20. package/src/devcouncil/artifacts/serializer.py +21 -0
  21. package/src/devcouncil/artifacts/validators.py +27 -0
  22. package/src/devcouncil/cli/__init__.py +0 -0
  23. package/src/devcouncil/cli/commands/__init__.py +0 -0
  24. package/src/devcouncil/cli/commands/artifacts.py +48 -0
  25. package/src/devcouncil/cli/commands/baseline.py +32 -0
  26. package/src/devcouncil/cli/commands/config.py +54 -0
  27. package/src/devcouncil/cli/commands/doctor.py +96 -0
  28. package/src/devcouncil/cli/commands/hook.py +61 -0
  29. package/src/devcouncil/cli/commands/init.py +142 -0
  30. package/src/devcouncil/cli/commands/integrate.py +420 -0
  31. package/src/devcouncil/cli/commands/map.py +38 -0
  32. package/src/devcouncil/cli/commands/mcp_server.py +18 -0
  33. package/src/devcouncil/cli/commands/plan.py +276 -0
  34. package/src/devcouncil/cli/commands/prompt.py +47 -0
  35. package/src/devcouncil/cli/commands/repair.py +69 -0
  36. package/src/devcouncil/cli/commands/report.py +71 -0
  37. package/src/devcouncil/cli/commands/reset_demo_state.py +28 -0
  38. package/src/devcouncil/cli/commands/rollback.py +58 -0
  39. package/src/devcouncil/cli/commands/run.py +224 -0
  40. package/src/devcouncil/cli/commands/setup.py +82 -0
  41. package/src/devcouncil/cli/commands/show.py +57 -0
  42. package/src/devcouncil/cli/commands/status.py +105 -0
  43. package/src/devcouncil/cli/commands/tasks.py +41 -0
  44. package/src/devcouncil/cli/commands/trace.py +43 -0
  45. package/src/devcouncil/cli/commands/verify.py +163 -0
  46. package/src/devcouncil/cli/commands/version.py +20 -0
  47. package/src/devcouncil/cli/main.py +70 -0
  48. package/src/devcouncil/council/__init__.py +0 -0
  49. package/src/devcouncil/council/prompts/__init__.py +0 -0
  50. package/src/devcouncil/council/prompts/arbiter.md +19 -0
  51. package/src/devcouncil/council/prompts/critic_a.md +10 -0
  52. package/src/devcouncil/council/prompts/critic_b.md +10 -0
  53. package/src/devcouncil/council/prompts/implementation_reviewer.md +16 -0
  54. package/src/devcouncil/council/prompts/planner_a.md +16 -0
  55. package/src/devcouncil/council/prompts/planner_b.md +16 -0
  56. package/src/devcouncil/council/prompts/rebuttal.md +10 -0
  57. package/src/devcouncil/council/prompts/spec_writer.md +12 -0
  58. package/src/devcouncil/domain/__init__.py +0 -0
  59. package/src/devcouncil/domain/assumption.py +17 -0
  60. package/src/devcouncil/domain/critique.py +32 -0
  61. package/src/devcouncil/domain/evidence.py +27 -0
  62. package/src/devcouncil/domain/gap.py +26 -0
  63. package/src/devcouncil/domain/requirement.py +22 -0
  64. package/src/devcouncil/domain/task.py +26 -0
  65. package/src/devcouncil/execution/__init__.py +1 -0
  66. package/src/devcouncil/execution/context_builder.py +60 -0
  67. package/src/devcouncil/execution/executor.py +15 -0
  68. package/src/devcouncil/execution/hook_policy.py +144 -0
  69. package/src/devcouncil/execution/patch.py +28 -0
  70. package/src/devcouncil/execution/paths.py +14 -0
  71. package/src/devcouncil/execution/permissions.py +92 -0
  72. package/src/devcouncil/execution/prompt_builder.py +59 -0
  73. package/src/devcouncil/execution/task_runner.py +166 -0
  74. package/src/devcouncil/executors/__init__.py +1 -0
  75. package/src/devcouncil/executors/mini_swe.py +73 -0
  76. package/src/devcouncil/executors/native/__init__.py +0 -0
  77. package/src/devcouncil/executors/native/agent.py +107 -0
  78. package/src/devcouncil/executors/openhands.py +71 -0
  79. package/src/devcouncil/gating/__init__.py +1 -0
  80. package/src/devcouncil/gating/checks/__init__.py +0 -0
  81. package/src/devcouncil/gating/checks/clean_git.py +45 -0
  82. package/src/devcouncil/gating/checks/planned_files_check.py +32 -0
  83. package/src/devcouncil/gating/checks/requirement_coverage.py +26 -0
  84. package/src/devcouncil/gating/checks/secret_scan_check.py +34 -0
  85. package/src/devcouncil/gating/policy.py +190 -0
  86. package/src/devcouncil/indexing/__init__.py +1 -0
  87. package/src/devcouncil/indexing/graph_index.py +48 -0
  88. package/src/devcouncil/indexing/repo_mapper.py +204 -0
  89. package/src/devcouncil/indexing/symbol_index.py +0 -0
  90. package/src/devcouncil/integrations/code_review_graph.py +163 -0
  91. package/src/devcouncil/integrations/github.py +39 -0
  92. package/src/devcouncil/integrations/gitnexus.py +27 -0
  93. package/src/devcouncil/integrations/graphify.py +34 -0
  94. package/src/devcouncil/integrations/mcp/__init__.py +0 -0
  95. package/src/devcouncil/integrations/mcp/server.py +146 -0
  96. package/src/devcouncil/llm/__init__.py +1 -0
  97. package/src/devcouncil/llm/cache.py +38 -0
  98. package/src/devcouncil/llm/provider.py +125 -0
  99. package/src/devcouncil/llm/router.py +125 -0
  100. package/src/devcouncil/planning/__init__.py +1 -0
  101. package/src/devcouncil/planning/arbiter_service.py +57 -0
  102. package/src/devcouncil/planning/critique_service.py +66 -0
  103. package/src/devcouncil/planning/plan_service.py +46 -0
  104. package/src/devcouncil/planning/repair_service.py +39 -0
  105. package/src/devcouncil/planning/spec_service.py +44 -0
  106. package/src/devcouncil/repo/__init__.py +0 -0
  107. package/src/devcouncil/reporting/__init__.py +0 -0
  108. package/src/devcouncil/reporting/github_check.py +32 -0
  109. package/src/devcouncil/reporting/json_report.py +17 -0
  110. package/src/devcouncil/reporting/markdown_report.py +46 -0
  111. package/src/devcouncil/reporting/report_builder.py +14 -0
  112. package/src/devcouncil/storage/__init__.py +0 -0
  113. package/src/devcouncil/storage/db.py +66 -0
  114. package/src/devcouncil/storage/models.py +83 -0
  115. package/src/devcouncil/storage/repositories.py +346 -0
  116. package/src/devcouncil/telemetry/__init__.py +0 -0
  117. package/src/devcouncil/telemetry/cost.py +34 -0
  118. package/src/devcouncil/telemetry/traces.py +91 -0
  119. package/src/devcouncil/telemetry/tracker.py +49 -0
  120. package/src/devcouncil/utils/__init__.py +1 -0
  121. package/src/devcouncil/utils/redaction.py +141 -0
  122. package/src/devcouncil/verification/__init__.py +1 -0
  123. package/src/devcouncil/verification/implementation_reviewer.py +55 -0
  124. package/src/devcouncil/verification/verifier.py +513 -0
  125. package/uv.lock +1085 -0
package/README.md ADDED
@@ -0,0 +1,643 @@
1
+ # DevCouncil: The Gated AI Orchestrator
2
+
3
+ [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)
4
+ [![Python 3.12+](https://img.shields.io/badge/python-3.12+-blue.svg)](https://www.python.org/downloads/)
5
+ [![uv](https://img.shields.io/badge/managed%20by-uv-purple.svg)](https://github.com/astral-sh/uv)
6
+
7
+ **"DevCouncil should not merely generate code. It should make AI-generated work prove that it satisfied the original intent."**
8
+
9
+ DevCouncil is a high-integrity command-line orchestration platform for AI-assisted software development. It turns AI implementation from a black-box generation task into a gated engineering workflow where every change is authorized, verified, and traceable back to a requirement.
10
+
11
+ DevCouncil is not trying to replace coding agents. It sits beside tools like Codex CLI, Gemini CLI, Claude Code, Cursor, and Aider, then owns the plan, task scope, verification loop, repair prompts, and evidence trail.
12
+
13
+ ---
14
+
15
+ ## Table Of Contents
16
+
17
+ - [Why DevCouncil Exists](#why-devcouncil-exists)
18
+ - [Quickstart](#quickstart)
19
+ - [Daily Workflow](#daily-workflow)
20
+ - [Coding CLI Integration](#coding-cli-integration)
21
+ - [Installation](#installation)
22
+ - [CLI Command Reference](#cli-command-reference)
23
+ - [Architecture](#architecture)
24
+ - [Project Status](#project-status)
25
+ - [Security Model](#security-model)
26
+ - [Acknowledgements](#acknowledgements)
27
+ - [License](#license)
28
+
29
+ ---
30
+
31
+ ## Why DevCouncil Exists
32
+
33
+ Standard AI coding agents are good at producing the happy path, but they often fail in expensive ways when complexity grows:
34
+
35
+ - **Requirement omission:** agents lose track of original product or PRD constraints across chat turns.
36
+ - **Architecture drift:** agents add dependencies or change design patterns without explicit authorization.
37
+ - **Unverified success:** agents claim tests passed without proving that the new logic was exercised.
38
+ - **Hidden assumptions:** important decisions stay buried in transient chat history instead of durable project artifacts.
39
+
40
+ **DevCouncil makes evidence, not model confidence, the final authority.**
41
+
42
+ It creates a persistent **Requirement -> Task -> Diff -> Evidence** graph, blocks completion when evidence is missing, detects unauthorized changes, and produces a final report that can be reviewed like an engineering artifact.
43
+
44
+ ---
45
+
46
+ ## Quickstart
47
+
48
+ Run DevCouncil commands in a normal terminal from the root of the repository you want DevCouncil to manage. Do not run these commands inside a coding CLI chat.
49
+
50
+ **Where to run what:**
51
+
52
+ - Terminal at repo root: `dev setup`, `dev plan`, `dev run`, `dev prompt`, `dev verify`.
53
+ - Coding CLI chat: paste only the generated output from `dev prompt TASK-ID`.
54
+ - Different repo path: use `dev setup --project-root path/to/project`.
55
+
56
+ If you are developing DevCouncil itself, install dependencies from this checkout:
57
+
58
+ ```bash
59
+ uv sync
60
+ uv run dev setup
61
+ ```
62
+
63
+ For normal use from a local checkout, install DevCouncil as a `uv` tool:
64
+
65
+ ```bash
66
+ uv tool install --force .
67
+ devcouncil --help
68
+ ```
69
+
70
+ If `uv` is missing, install it first:
71
+
72
+ ```powershell
73
+ powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
74
+ ```
75
+
76
+ On macOS or Linux:
77
+
78
+ ```bash
79
+ curl -LsSf https://astral.sh/uv/install.sh | sh
80
+ ```
81
+
82
+ After installing DevCouncil globally, initialize it in a target repository:
83
+
84
+ ```bash
85
+ cd path/to/your/project
86
+ dev setup
87
+ ```
88
+
89
+ `dev setup` creates `.devcouncil/` if needed, runs the environment doctor, and prints the next commands for planning, prompting, and verification.
90
+
91
+ Start the first gated workflow:
92
+
93
+ ```bash
94
+ dev plan "Describe the implementation goal"
95
+ dev tasks
96
+ dev run TASK-001 --executor manual
97
+ dev prompt TASK-001
98
+ dev verify TASK-001
99
+ ```
100
+
101
+ Paste only the output from `dev prompt TASK-001` into Codex, Gemini, Claude Code, Cursor, Aider, or another coding tool. Keep `dev setup`, `dev plan`, `dev run`, and `dev verify` in the terminal at the repository root.
102
+
103
+ For the shortest install-to-first-task guide, see [docs/quickstart.md](docs/quickstart.md).
104
+
105
+ ---
106
+
107
+ ## Daily Workflow
108
+
109
+ DevCouncil's recommended default is **Manual Sidecar Mode**:
110
+
111
+ 1. DevCouncil plans the work and creates a task graph.
112
+ 2. You ask DevCouncil for one constrained task prompt.
113
+ 3. You paste that prompt into your coding CLI or agent.
114
+ 4. The agent edits the repository.
115
+ 5. DevCouncil verifies the resulting diff against task constraints.
116
+ 6. If verification fails, DevCouncil creates a focused repair loop.
117
+
118
+ ### 1. Create The Implementation Plan
119
+
120
+ ```bash
121
+ dev plan "Add password reset with expiring single-use tokens"
122
+ ```
123
+
124
+ DevCouncil maps the repository, drafts requirements, runs planner and critic roles, and stores an approved task graph locally.
125
+
126
+ Inspect the plan:
127
+
128
+ ```bash
129
+ dev status
130
+ dev tasks
131
+ dev show TASK-001
132
+ ```
133
+
134
+ ### 2. Start One Task
135
+
136
+ ```bash
137
+ dev run TASK-001 --executor manual
138
+ ```
139
+
140
+ This creates a checkpoint and marks the task as running. DevCouncil expects the next repository diff to match this task's allowed files, acceptance criteria, and verification commands.
141
+
142
+ ### 3. Generate The Coding Prompt
143
+
144
+ ```bash
145
+ dev prompt TASK-001
146
+ ```
147
+
148
+ Paste the full output into your coding CLI. The generated prompt includes the task objective, allowed files, constraints, acceptance criteria, and evidence requirements.
149
+
150
+ ### 4. Verify The Result
151
+
152
+ After the coding CLI modifies the repository:
153
+
154
+ ```bash
155
+ dev verify TASK-001
156
+ ```
157
+
158
+ Verification records evidence and marks the task as either `verified` or `blocked`.
159
+
160
+ Inspect the result:
161
+
162
+ ```bash
163
+ dev status
164
+ dev report
165
+ dev report --json
166
+ ```
167
+
168
+ ### 5. Repair Gaps
169
+
170
+ If verification blocks the task, convert the gaps into focused repair work:
171
+
172
+ ```bash
173
+ dev repair
174
+ dev tasks
175
+ dev prompt REPAIR-001
176
+ ```
177
+
178
+ Paste the repair prompt into the same coding CLI, then verify again:
179
+
180
+ ```bash
181
+ dev verify REPAIR-001
182
+ dev verify TASK-001
183
+ ```
184
+
185
+ ### 6. Continue Task By Task
186
+
187
+ ```bash
188
+ dev tasks
189
+ dev show TASK-002
190
+ dev run TASK-002 --executor manual
191
+ dev prompt TASK-002
192
+ dev verify TASK-002
193
+ dev report
194
+ ```
195
+
196
+ Recommended working rules:
197
+
198
+ - Run DevCouncil and the coding CLI from the same repository root.
199
+ - Give the coding CLI one DevCouncil task prompt at a time.
200
+ - Do not ask the coding CLI to broaden scope beyond the generated prompt.
201
+ - Run `dev verify TASK-ID` before committing agent-generated changes.
202
+ - Use `dev repair` for follow-up fixes instead of free-form retry prompts.
203
+ - Use `dev rollback TASK-ID` if a task needs to be reverted from its checkpoint.
204
+ - Treat `.devcouncil/` as local project state and the audit trail for the gated run.
205
+
206
+ ---
207
+
208
+ ## Coding CLI Integration
209
+
210
+ DevCouncil works with any tool that can accept a prompt and edit files in the same repository.
211
+
212
+ ### Compatibility Matrix
213
+
214
+ | Tool | Manual sidecar prompts | Headless prompt handoff | DevCouncil MCP tools | Write-blocking hooks |
215
+ | :--- | :---: | :---: | :---: | :---: |
216
+ | **Codex CLI** | Supported | Supported via `codex exec` | Supported via `codex mcp` | Use DevCouncil verification gates |
217
+ | **Gemini CLI** | Supported | Supported via `gemini -p` or stdin | Supported via `gemini mcp` | Use DevCouncil verification gates |
218
+ | **Claude Code** | Supported | Tool-dependent | Manual MCP config only | Starter `dev hook` commands |
219
+ | **Cursor** | Supported | Tool-dependent | Manual MCP config only | Use DevCouncil verification gates |
220
+ | **Aider** | Supported | Prompt/stdin friendly | Not a primary path | Use DevCouncil verification gates |
221
+
222
+ ### Fast Integration Setup
223
+
224
+ Preview coding CLI integrations:
225
+
226
+ ```bash
227
+ dev setup --integrate
228
+ ```
229
+
230
+ Apply supported MCP integrations for installed clients:
231
+
232
+ ```bash
233
+ dev setup --integrate --apply
234
+ ```
235
+
236
+ Configure every coding CLI with first-party setup support:
237
+
238
+ ```bash
239
+ dev integrate all --apply
240
+ ```
241
+
242
+ Preview exact setup commands without changing client config:
243
+
244
+ ```bash
245
+ dev integrate all
246
+ ```
247
+
248
+ Verify that DevCouncil is ready to expose MCP tools:
249
+
250
+ ```bash
251
+ dev integrate check
252
+ ```
253
+
254
+ Set up one first-party integration at a time:
255
+
256
+ ```bash
257
+ dev integrate codex --apply
258
+ dev integrate gemini --apply
259
+ ```
260
+
261
+ If a configured MCP client launches tools from a different directory, point it at the target repository:
262
+
263
+ ```bash
264
+ dev integrate all --apply --project-root path/to/project
265
+ ```
266
+
267
+ ### Codex CLI
268
+
269
+ Manual sidecar flow:
270
+
271
+ ```bash
272
+ cd path/to/project
273
+ dev run TASK-001 --executor manual
274
+ dev prompt TASK-001
275
+ ```
276
+
277
+ Paste the generated prompt into Codex CLI. After Codex finishes:
278
+
279
+ ```bash
280
+ dev verify TASK-001
281
+ ```
282
+
283
+ Headless handoff:
284
+
285
+ ```bash
286
+ dev prompt TASK-001 | codex exec -
287
+ dev verify TASK-001
288
+ ```
289
+
290
+ MCP setup:
291
+
292
+ ```bash
293
+ dev integrate codex --apply
294
+ ```
295
+
296
+ If Codex launches MCP servers outside the target repository root, set `DEVCOUNCIL_PROJECT_ROOT` to the repository path in the MCP server environment.
297
+
298
+ ### Gemini CLI
299
+
300
+ Manual sidecar flow:
301
+
302
+ ```bash
303
+ cd path/to/project
304
+ dev run TASK-001 --executor manual
305
+ dev prompt TASK-001
306
+ ```
307
+
308
+ Paste the prompt into Gemini CLI, then verify:
309
+
310
+ ```bash
311
+ dev verify TASK-001
312
+ ```
313
+
314
+ Headless handoff:
315
+
316
+ ```bash
317
+ dev prompt TASK-001 | gemini
318
+ dev verify TASK-001
319
+ ```
320
+
321
+ Or:
322
+
323
+ ```bash
324
+ gemini -p "$(dev prompt TASK-001)"
325
+ ```
326
+
327
+ MCP setup:
328
+
329
+ ```bash
330
+ dev integrate gemini --apply
331
+ ```
332
+
333
+ If Gemini launches MCP servers outside the target repository root, configure the server with `DEVCOUNCIL_PROJECT_ROOT` pointing at the repository that contains `.devcouncil/`.
334
+
335
+ ### Claude Code
336
+
337
+ Start Claude Code in the same repository, then paste the generated task prompt:
338
+
339
+ ```bash
340
+ cd path/to/project
341
+ dev run TASK-001 --executor manual
342
+ dev prompt TASK-001
343
+ ```
344
+
345
+ After Claude Code finishes:
346
+
347
+ ```bash
348
+ dev verify TASK-001
349
+ ```
350
+
351
+ DevCouncil also includes an experimental hook command group:
352
+
353
+ ```bash
354
+ dev hook --help
355
+ ```
356
+
357
+ The intended hook integration is to call `dev hook pre-tool-use` before file-writing tools and block unauthorized writes with a non-zero exit. Treat this as experimental until your local Claude Code hook JSON shape matches what `dev hook pre-tool-use` expects.
358
+
359
+ ### Cursor
360
+
361
+ Use DevCouncil as the planning and verification shell around Cursor:
362
+
363
+ ```bash
364
+ dev run TASK-001 --executor manual
365
+ dev prompt TASK-001
366
+ ```
367
+
368
+ Paste the prompt into Cursor Chat or Agent mode and instruct Cursor to stay within the prompt's allowed files. When Cursor finishes:
369
+
370
+ ```bash
371
+ dev verify TASK-001
372
+ ```
373
+
374
+ If Cursor changes files outside the task scope, DevCouncil verification should flag the unauthorized diff.
375
+
376
+ DevCouncil does not currently ship a dedicated `dev integrate cursor` command. Use manual sidecar prompts, or configure Cursor's MCP client manually against `devcouncil mcp-server` with `DEVCOUNCIL_PROJECT_ROOT` set to the target repository.
377
+
378
+ ### Aider
379
+
380
+ Start Aider in the target repository:
381
+
382
+ ```bash
383
+ cd path/to/project
384
+ aider
385
+ ```
386
+
387
+ Paste the output from:
388
+
389
+ ```bash
390
+ dev prompt TASK-001
391
+ ```
392
+
393
+ After Aider commits or leaves a working-tree diff:
394
+
395
+ ```bash
396
+ dev verify TASK-001
397
+ ```
398
+
399
+ If you want DevCouncil to inspect the live working tree before committing, verify before creating the final commit.
400
+
401
+ ### Automated Executors
402
+
403
+ Manual sidecar mode is the recommended default because it works with any coding CLI and keeps the human in control of the agent session.
404
+
405
+ DevCouncil also has experimental executor adapters:
406
+
407
+ ```bash
408
+ dev run TASK-001 --executor mini
409
+ dev run TASK-001 --executor openhands
410
+ dev run TASK-001 --executor native
411
+ ```
412
+
413
+ Use these only when the target executor is installed and configured locally. Automated executor mode lets DevCouncil launch the implementation loop itself, capture the post-run diff, and verify the task automatically.
414
+
415
+ The live executor adapter values are `manual`, `mini`, `openhands`, and `native`.
416
+
417
+ ---
418
+
419
+ ## Installation
420
+
421
+ ### npm Wrapper
422
+
423
+ The npm wrapper is included for local testing and future registry publishing. Until the package is published to npm, install the wrapper from this checkout:
424
+
425
+ ```bash
426
+ npm install -g .
427
+ devcouncil --help
428
+ dev --help
429
+ ```
430
+
431
+ The npm wrapper delegates to the Python DevCouncil CLI through `uv`, so `uv` must be installed.
432
+
433
+ Check for `uv`:
434
+
435
+ ```bash
436
+ uv --version
437
+ ```
438
+
439
+ Install `uv` on Windows:
440
+
441
+ ```powershell
442
+ powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
443
+ ```
444
+
445
+ Install `uv` on macOS or Linux:
446
+
447
+ ```bash
448
+ curl -LsSf https://astral.sh/uv/install.sh | sh
449
+ ```
450
+
451
+ After publishing the package to npm, users can install the registry package:
452
+
453
+ ```bash
454
+ npm install -g devcouncil
455
+ devcouncil --help
456
+ ```
457
+
458
+ For maintainers publishing the npm wrapper:
459
+
460
+ ```bash
461
+ npm login
462
+ npm run pack:check
463
+ npm publish
464
+ ```
465
+
466
+ ### uv Global Install
467
+
468
+ From this repository:
469
+
470
+ ```bash
471
+ uv tool install --force .
472
+ ```
473
+
474
+ DevCouncil installs two command aliases:
475
+
476
+ ```bash
477
+ dev --help
478
+ devcouncil --help
479
+ ```
480
+
481
+ Use `devcouncil` when another tool already owns the `dev` command.
482
+
483
+ ### Source Development
484
+
485
+ ```bash
486
+ git clone https://github.com/bharathvbcr/DevCouncil.git
487
+ cd DevCouncil
488
+ uv sync
489
+ uv run dev --help
490
+ ```
491
+
492
+ ---
493
+
494
+ ## CLI Command Reference
495
+
496
+ ```bash
497
+ dev init # Initialize DevCouncil in a repo
498
+ dev setup # Initialize, run doctor, and print next steps
499
+ dev doctor # Check dependencies and environment
500
+ dev version # Display the installed DevCouncil version
501
+ dev map "goal" # Map repo context for a goal
502
+ dev plan "goal" # Run the full planning council debate
503
+ dev status # Show current project state and cost
504
+ dev tasks # List planned tasks and statuses
505
+ dev show TASK-001 # Show task details and constraints
506
+ dev prompt TASK-001 # Generate prompt for an external agent
507
+ dev run TASK-001 # Execute task via selected executor
508
+ dev verify TASK-001 # Verify diff, commands, and evidence
509
+ dev repair # Generate repair tasks from gaps
510
+ dev report # Generate final evidence report
511
+ dev rollback TASK-001 # Revert changes using task checkpoint
512
+ dev mcp-server # Start DevCouncil MCP server over stdio
513
+ dev hook --help # Show experimental Claude Code hook commands
514
+ dev integrate all --apply # Configure supported coding CLI integrations
515
+ dev integrate check # Verify coding CLI and MCP readiness
516
+ dev integrate doctor # Check optional integration tools
517
+ dev trace tail --follow # Tail local DevCouncil trace events
518
+ dev artifacts validate # Validate stored artifact integrity
519
+ dev config # Inspect or update configuration
520
+ ```
521
+
522
+ ---
523
+
524
+ ## Architecture
525
+
526
+ DevCouncil implements a 7-phase software-team workflow:
527
+
528
+ 1. **Goal analysis:** deterministic repository mapping and relevant context selection.
529
+ 2. **Requirements drafting:** extraction of functional requirements and acceptance criteria.
530
+ 3. **Council debate:** planner roles critique each other and an arbiter compiles a unified task graph.
531
+ 4. **Gated execution:** tasks are scoped with allowed files and authorized commands.
532
+ 5. **Deterministic verification:** the audit engine checks side effects, command evidence, and secret leaks.
533
+ 6. **Repair loop:** blocking gaps are converted into focused repair tasks.
534
+ 7. **Evidence reporting:** a final release-ready matrix proves requirement coverage.
535
+
536
+ ### Artifact Graph
537
+
538
+ ```mermaid
539
+ graph TD;
540
+ Requirement-->AcceptanceCriterion;
541
+ Requirement-->Task;
542
+ Task-->PlannedFile;
543
+ Task-->ChangedFile;
544
+ Task-->TestEvidence;
545
+ Task-->CommandResult;
546
+ Requirement-->Gap;
547
+ Task-->Gap;
548
+ ```
549
+
550
+ ### Gating State Machine
551
+
552
+ ```mermaid
553
+ stateDiagram-v2
554
+ [*] --> NEW
555
+ NEW --> REPO_MAPPED
556
+ REPO_MAPPED --> REQUIREMENTS_DRAFTED
557
+ REQUIREMENTS_DRAFTED --> PLANS_GENERATED
558
+ PLANS_GENERATED --> CRITIQUES_GENERATED
559
+ CRITIQUES_GENERATED --> ARBITRATED
560
+ ARBITRATED --> PLAN_APPROVED
561
+ PLAN_APPROVED --> TASK_READY
562
+
563
+ TASK_READY --> TASK_EXECUTING
564
+ TASK_EXECUTING --> TASK_VERIFYING
565
+
566
+ TASK_VERIFYING --> TASK_VERIFIED: Success
567
+ TASK_VERIFYING --> TASK_BLOCKED: Failure
568
+
569
+ TASK_BLOCKED --> TASK_READY: Repair
570
+
571
+ TASK_VERIFIED --> TASK_READY: Next Task
572
+ TASK_VERIFIED --> PROJECT_DONE: All Done
573
+
574
+ PROJECT_DONE --> [*]
575
+ ```
576
+
577
+ ### How DevCouncil Differs From Sage
578
+
579
+ **Sage** reviews an active coding-agent session and provides critique cards to help the developer course-correct.
580
+
581
+ **DevCouncil** focuses on gated execution:
582
+
583
+ - It creates a persistent requirement, task, diff, and evidence graph.
584
+ - It blocks task completion when required evidence is missing.
585
+ - It detects orphan diffs and unauthorized architectural changes.
586
+ - It produces a deterministic evidence report for the final implementation.
587
+
588
+ Sage asks: "Is this agent response good?" DevCouncil asks: "Can this task prove it satisfied the requirement?"
589
+
590
+ ---
591
+
592
+ ## Project Status
593
+
594
+ DevCouncil is early-stage and under active development.
595
+
596
+ | Area | Status |
597
+ | :--- | :--- |
598
+ | **CLI & Storage** | Working: SQLite + SQLModel |
599
+ | **Artifact Graph** | Working: coverage engine |
600
+ | **Council Debate** | Working: multi-agent planning |
601
+ | **Manual Executor** | Working: sidecar mode |
602
+ | **Security Scanning** | Working: secret redaction and detection |
603
+ | **Repair Loop** | Working: LLM-driven inference |
604
+ | **Native Executor** | Experimental |
605
+ | **MCP Server** | Experimental / starter |
606
+ | **Claude Code Hooks** | Experimental / starter |
607
+ | **GitHub PR Checks** | Starter: `dev report --github` |
608
+
609
+ ---
610
+
611
+ ## Security Model
612
+
613
+ DevCouncil is designed to minimize unsafe agent behavior:
614
+
615
+ - **Redaction:** strips secrets and API keys before sending context to LLMs.
616
+ - **Permission guard:** prevents agents from accessing `.git`, `.env`, or sensitive credentials.
617
+ - **Allowlist enforcement:** restricts writes to task-approved files and commands to a safe subset.
618
+ - **Local sovereignty:** stores project state, logs, and artifacts locally in `.devcouncil/`.
619
+
620
+ DevCouncil provides gates and evidence to make risky changes easier to detect. It does not replace human security review.
621
+
622
+ ---
623
+
624
+ ## Acknowledgements
625
+
626
+ DevCouncil is built on the collective wisdom of the open-source agentic community:
627
+
628
+ - [karpathy/llm-council](https://github.com/karpathy/llm-council): for the multi-LLM peer-review pattern.
629
+ - [GPT Pilot](https://github.com/Pythagora-io/gpt-pilot): for the software-team role-based concept.
630
+ - [OpenHands](https://github.com/All-Hands-AI/OpenHands): for robust agent workspace and tool-loop management.
631
+ - [mini-SWE-agent](https://github.com/SWE-agent/mini-swe-agent): for lightweight execution loop inspiration.
632
+ - [abhigyanpatwari/GitNexus](https://github.com/abhigyanpatwari/GitNexus): for structural codebase awareness.
633
+ - [safishamsi/graphify](https://github.com/safishamsi/graphify): for knowledge graph and multi-agent coordination.
634
+
635
+ ---
636
+
637
+ ## License
638
+
639
+ Licensed under the **Apache License, Version 2.0**. See [LICENSE](LICENSE) for details.
640
+
641
+ ---
642
+
643
+ **"Trust the model, but verify the graph."**
@@ -0,0 +1,62 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { spawnSync } = require("node:child_process");
4
+ const { existsSync } = require("node:fs");
5
+ const path = require("node:path");
6
+
7
+ const packageRoot = path.resolve(__dirname, "..");
8
+ const pyproject = path.join(packageRoot, "pyproject.toml");
9
+
10
+ function run(command, args) {
11
+ return spawnSync(command, args, {
12
+ cwd: process.cwd(),
13
+ stdio: "inherit",
14
+ shell: process.platform === "win32",
15
+ env: process.env,
16
+ });
17
+ }
18
+
19
+ function fail(message) {
20
+ console.error(message);
21
+ process.exit(1);
22
+ }
23
+
24
+ function ensureUv() {
25
+ const check = spawnSync("uv", ["--version"], {
26
+ stdio: "ignore",
27
+ shell: process.platform === "win32",
28
+ });
29
+
30
+ if (check.status === 0) {
31
+ return;
32
+ }
33
+
34
+ fail(
35
+ [
36
+ "DevCouncil requires uv to run from the npm package.",
37
+ "Install uv first:",
38
+ " macOS/Linux: curl -LsSf https://astral.sh/uv/install.sh | sh",
39
+ ' Windows: powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"',
40
+ "",
41
+ "Then rerun:",
42
+ " devcouncil --help",
43
+ ].join("\n")
44
+ );
45
+ }
46
+
47
+ if (!existsSync(pyproject)) {
48
+ fail(
49
+ "DevCouncil npm package is missing pyproject.toml. Reinstall the package and try again."
50
+ );
51
+ }
52
+
53
+ ensureUv();
54
+
55
+ const args = process.argv.slice(2);
56
+ const result = run("uv", ["run", "--project", packageRoot, "devcouncil", ...args]);
57
+
58
+ if (result.error) {
59
+ fail(`Failed to start DevCouncil: ${result.error.message}`);
60
+ }
61
+
62
+ process.exit(result.status ?? 1);