devcouncil 0.1.1 → 0.2.1

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 (146) hide show
  1. package/README.md +218 -96
  2. package/bin/devcouncil.js +130 -32
  3. package/package.json +7 -11
  4. package/pyproject.toml +0 -34
  5. package/src/devcouncil/__init__.py +0 -0
  6. package/src/devcouncil/__main__.py +0 -4
  7. package/src/devcouncil/app/__init__.py +0 -28
  8. package/src/devcouncil/app/config.py +0 -158
  9. package/src/devcouncil/app/errors.py +0 -23
  10. package/src/devcouncil/app/events.py +0 -44
  11. package/src/devcouncil/app/orchestrator.py +0 -92
  12. package/src/devcouncil/app/project_status.py +0 -29
  13. package/src/devcouncil/app/run_context.py +0 -39
  14. package/src/devcouncil/app/state_machine.py +0 -108
  15. package/src/devcouncil/artifacts/__init__.py +0 -1
  16. package/src/devcouncil/artifacts/coverage.py +0 -96
  17. package/src/devcouncil/artifacts/graph.py +0 -143
  18. package/src/devcouncil/artifacts/migrations.py +0 -20
  19. package/src/devcouncil/artifacts/schemas.py +0 -23
  20. package/src/devcouncil/artifacts/serializer.py +0 -21
  21. package/src/devcouncil/artifacts/validators.py +0 -27
  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 +0 -51
  25. package/src/devcouncil/cli/commands/ast.py +0 -22
  26. package/src/devcouncil/cli/commands/baseline.py +0 -35
  27. package/src/devcouncil/cli/commands/config.py +0 -76
  28. package/src/devcouncil/cli/commands/dashboard.py +0 -26
  29. package/src/devcouncil/cli/commands/doctor.py +0 -140
  30. package/src/devcouncil/cli/commands/go.py +0 -237
  31. package/src/devcouncil/cli/commands/hook.py +0 -128
  32. package/src/devcouncil/cli/commands/init.py +0 -153
  33. package/src/devcouncil/cli/commands/integrate.py +0 -726
  34. package/src/devcouncil/cli/commands/lsp.py +0 -20
  35. package/src/devcouncil/cli/commands/map.py +0 -42
  36. package/src/devcouncil/cli/commands/mcp_server.py +0 -18
  37. package/src/devcouncil/cli/commands/plan.py +0 -327
  38. package/src/devcouncil/cli/commands/prompt.py +0 -50
  39. package/src/devcouncil/cli/commands/repair.py +0 -72
  40. package/src/devcouncil/cli/commands/report.py +0 -129
  41. package/src/devcouncil/cli/commands/reset_demo_state.py +0 -31
  42. package/src/devcouncil/cli/commands/rollback.py +0 -60
  43. package/src/devcouncil/cli/commands/run.py +0 -269
  44. package/src/devcouncil/cli/commands/setup.py +0 -223
  45. package/src/devcouncil/cli/commands/show.py +0 -76
  46. package/src/devcouncil/cli/commands/status.py +0 -117
  47. package/src/devcouncil/cli/commands/tasks.py +0 -55
  48. package/src/devcouncil/cli/commands/trace.py +0 -44
  49. package/src/devcouncil/cli/commands/verify.py +0 -193
  50. package/src/devcouncil/cli/commands/version.py +0 -20
  51. package/src/devcouncil/cli/commands/watch.py +0 -574
  52. package/src/devcouncil/cli/main.py +0 -88
  53. package/src/devcouncil/council/__init__.py +0 -0
  54. package/src/devcouncil/council/prompts/__init__.py +0 -0
  55. package/src/devcouncil/council/prompts/arbiter.md +0 -19
  56. package/src/devcouncil/council/prompts/critic_a.md +0 -10
  57. package/src/devcouncil/council/prompts/critic_b.md +0 -10
  58. package/src/devcouncil/council/prompts/implementation_reviewer.md +0 -16
  59. package/src/devcouncil/council/prompts/planner_a.md +0 -16
  60. package/src/devcouncil/council/prompts/planner_b.md +0 -16
  61. package/src/devcouncil/council/prompts/rebuttal.md +0 -10
  62. package/src/devcouncil/council/prompts/spec_writer.md +0 -12
  63. package/src/devcouncil/domain/__init__.py +0 -0
  64. package/src/devcouncil/domain/assumption.py +0 -17
  65. package/src/devcouncil/domain/critique.py +0 -32
  66. package/src/devcouncil/domain/evidence.py +0 -27
  67. package/src/devcouncil/domain/gap.py +0 -26
  68. package/src/devcouncil/domain/requirement.py +0 -22
  69. package/src/devcouncil/domain/task.py +0 -26
  70. package/src/devcouncil/execution/__init__.py +0 -1
  71. package/src/devcouncil/execution/context_builder.py +0 -60
  72. package/src/devcouncil/execution/executor.py +0 -15
  73. package/src/devcouncil/execution/hook_policy.py +0 -165
  74. package/src/devcouncil/execution/patch.py +0 -28
  75. package/src/devcouncil/execution/paths.py +0 -14
  76. package/src/devcouncil/execution/permissions.py +0 -92
  77. package/src/devcouncil/execution/prompt_builder.py +0 -59
  78. package/src/devcouncil/execution/task_runner.py +0 -166
  79. package/src/devcouncil/executors/__init__.py +0 -1
  80. package/src/devcouncil/executors/coding_cli.py +0 -112
  81. package/src/devcouncil/executors/mini_swe.py +0 -73
  82. package/src/devcouncil/executors/native/__init__.py +0 -0
  83. package/src/devcouncil/executors/native/agent.py +0 -107
  84. package/src/devcouncil/executors/openhands.py +0 -71
  85. package/src/devcouncil/gating/__init__.py +0 -1
  86. package/src/devcouncil/gating/checks/__init__.py +0 -0
  87. package/src/devcouncil/gating/checks/clean_git.py +0 -50
  88. package/src/devcouncil/gating/checks/planned_files_check.py +0 -32
  89. package/src/devcouncil/gating/checks/requirement_coverage.py +0 -26
  90. package/src/devcouncil/gating/checks/secret_scan_check.py +0 -34
  91. package/src/devcouncil/gating/policy.py +0 -190
  92. package/src/devcouncil/indexing/__init__.py +0 -1
  93. package/src/devcouncil/indexing/ast_matcher.py +0 -168
  94. package/src/devcouncil/indexing/graph_index.py +0 -48
  95. package/src/devcouncil/indexing/lsp.py +0 -120
  96. package/src/devcouncil/indexing/repo_mapper.py +0 -208
  97. package/src/devcouncil/indexing/symbol_index.py +0 -0
  98. package/src/devcouncil/integrations/code_review_graph.py +0 -163
  99. package/src/devcouncil/integrations/github.py +0 -39
  100. package/src/devcouncil/integrations/gitnexus.py +0 -27
  101. package/src/devcouncil/integrations/graphify.py +0 -34
  102. package/src/devcouncil/integrations/mcp/__init__.py +0 -0
  103. package/src/devcouncil/integrations/mcp/server.py +0 -599
  104. package/src/devcouncil/integrations/pr_comments.py +0 -62
  105. package/src/devcouncil/live/__init__.py +0 -2
  106. package/src/devcouncil/live/cards.py +0 -207
  107. package/src/devcouncil/live/models.py +0 -63
  108. package/src/devcouncil/live/repair_prompt.py +0 -83
  109. package/src/devcouncil/live/reviewer.py +0 -70
  110. package/src/devcouncil/live/signals.py +0 -135
  111. package/src/devcouncil/live/summary.py +0 -34
  112. package/src/devcouncil/live/tasks.py +0 -18
  113. package/src/devcouncil/live/transcripts.py +0 -138
  114. package/src/devcouncil/llm/__init__.py +0 -1
  115. package/src/devcouncil/llm/cache.py +0 -38
  116. package/src/devcouncil/llm/provider.py +0 -146
  117. package/src/devcouncil/llm/router.py +0 -125
  118. package/src/devcouncil/planning/__init__.py +0 -1
  119. package/src/devcouncil/planning/arbiter_service.py +0 -57
  120. package/src/devcouncil/planning/critique_service.py +0 -66
  121. package/src/devcouncil/planning/plan_service.py +0 -46
  122. package/src/devcouncil/planning/prompt_enhancer_service.py +0 -86
  123. package/src/devcouncil/planning/repair_service.py +0 -39
  124. package/src/devcouncil/planning/spec_service.py +0 -44
  125. package/src/devcouncil/repo/__init__.py +0 -0
  126. package/src/devcouncil/reporting/__init__.py +0 -0
  127. package/src/devcouncil/reporting/github_check.py +0 -32
  128. package/src/devcouncil/reporting/json_report.py +0 -20
  129. package/src/devcouncil/reporting/markdown_report.py +0 -68
  130. package/src/devcouncil/reporting/report_builder.py +0 -14
  131. package/src/devcouncil/storage/__init__.py +0 -0
  132. package/src/devcouncil/storage/db.py +0 -66
  133. package/src/devcouncil/storage/models.py +0 -83
  134. package/src/devcouncil/storage/repositories.py +0 -423
  135. package/src/devcouncil/telemetry/__init__.py +0 -0
  136. package/src/devcouncil/telemetry/cost.py +0 -34
  137. package/src/devcouncil/telemetry/traces.py +0 -91
  138. package/src/devcouncil/telemetry/tracker.py +0 -49
  139. package/src/devcouncil/ui/__init__.py +0 -1
  140. package/src/devcouncil/ui/dashboard.py +0 -122
  141. package/src/devcouncil/utils/__init__.py +0 -1
  142. package/src/devcouncil/utils/redaction.py +0 -141
  143. package/src/devcouncil/verification/__init__.py +0 -1
  144. package/src/devcouncil/verification/implementation_reviewer.py +0 -55
  145. package/src/devcouncil/verification/verifier.py +0 -530
  146. package/uv.lock +0 -1085
package/README.md CHANGED
@@ -1,162 +1,284 @@
1
- # DevCouncil: The Gated AI Orchestrator
1
+ # DevCouncil: Components and Modules for AI Development
2
2
 
3
+ [![Website](https://img.shields.io/badge/website-devcouncil.vbcr.dev-10B981?style=flat&logo=safari&logoColor=white)](https://devcouncil.vbcr.dev/)
4
+ [![CI](https://github.com/bharathvbcr/DevCouncil/actions/workflows/ci.yml/badge.svg)](https://github.com/bharathvbcr/DevCouncil/actions/workflows/ci.yml)
5
+ [![npm version](https://img.shields.io/npm/v/devcouncil)](https://www.npmjs.com/package/devcouncil)
3
6
  [![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
 
7
- **"DevCouncil should not merely generate code. It should make AI-generated work prove that it satisfied the original intent."**
8
+ <p align="center">
9
+ <a href="https://devcouncil.vbcr.dev/"><strong>Explore the Interactive Architecture &amp; Code Graph Showcase (devcouncil.vbcr.dev) &rarr;</strong></a>
10
+ </p>
8
11
 
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.
12
+ > **"DevCouncil should not merely generate code. It should make AI-generated work prove that it satisfied the original intent."**
13
+ > *Evidence, not model confidence, is the final authority.*
10
14
 
11
- DevCouncil does not 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.
15
+ DevCouncil is **components and modules** for AI-assisted software development. It ships independently installable binaries and libraries — code intelligence (`devmap`), task and lease state (`dcstore`), deterministic verification (`dcverify`), ignore-aware search (`dcgrep`), and a Go host (`devcouncil` / `dev`) so a harness or an app can take only the pieces it needs and update them one at a time.
12
16
 
13
- ## Documentation
17
+ See [repository input and verification boundaries](docs/SECURITY_BOUNDARIES.md)
18
+ for executable selection, filesystem protections, resource limits, and the
19
+ difference between unavailable evidence and a passing check.
20
+
21
+ **Manvi wraps these components** into a coding-agent harness (turn loop, providers, policy, TUI, `manvi serve`). **GitPulse** uses Manvi for policy, workbench, and agent hosting, and DevCouncil components for code intelligence and related analysis. DevCouncil does not replace coding agents; it sits beside Claude Code, Codex, Cursor, and others as selectable modules.
22
+
23
+ ---
24
+
25
+ ## Architecture & Components
26
+
27
+ DevCouncil's core runtime is a set of standalone, compiled native modules. Each binary is useful on its own, sits on `PATH`, and can be spawned or linked by a host that wants that one job:
28
+
29
+ | Binary | Language | Role & Ownership |
30
+ |--------|----------|------------------|
31
+ | `devcouncil` / `dev` | **Go** | Host orchestrator: Stdio MCP server (`mcp`), multi-host agent integration (`integrate`), engineering skills distribution (`skills`), task verification (`verify`), and devmap forwarding (`map`, `graph`, `ast`). |
32
+ | `devmap` | **Rust** | Code intelligence engine: 36+ tree-sitter language extractors, symbol resolution, blast-radius calculation, dead-code analysis, workspace guides (`AGENTS.md`), and DevMap MCP server (`devmap mcp`). |
33
+ | `dcstore` | **Rust** | State & lease store: SQLite-backed task repository, mutual-exclusion leases for concurrent agent building, evidence records, and gap tracking. |
34
+ | `dcverify` | **Rust** | Deterministic verification: Unified-diff parsing, planned file scope classification, anti-laziness/stub gates, test coverage evaluation, and typed `next_actions` repair signals. |
35
+ | `dcgrep` | **Rust** | Code search: Ripgrep-powered ignore-aware search engine with optional trigram indexing (`tgrep-core`). |
36
+
37
+ ### How hosts consume the modules
38
+
39
+ - **Manvi** wraps the components: it drives the agent loop, provider routing, policy ladder, and TUI, and reaches each binary over JSON on stdio. A host that wants a harness embeds Manvi rather than reimplementing it.
40
+ - **GitPulse** uses both for their respective jobs: Manvi (`manvi serve`) for policy, workbench, and agent hosting; selected DevCouncil crates and the `devmap` CLI for in-process code intelligence. It does not have to take every module.
41
+ - **Other apps** pick the same way — `devmap` alone, `dcverify` alone, the Go host MCP, or the full set. Updating one module does not require shipping the rest.
42
+
43
+ > [!NOTE]
44
+ > DevCouncil is built entirely as native compiled Go and Rust binaries; legacy Python orchestration has been retired (see [docs/PHASE7_LONG_TAIL.md](docs/PHASE7_LONG_TAIL.md)).
45
+
46
+ ---
47
+
48
+ ## Installation
14
49
 
15
- - [Quickstart](docs/quickstart.md): shortest install-to-first-task path.
16
- - [Daily workflow](docs/workflow.md): manual sidecar loop, verification, repair, and rollback.
17
- - [Coding CLI integration](docs/coding-cli-integration.md): Codex, Gemini, Claude Code, Cursor, Aider, MCP, hooks, and automated executors.
18
- - [CLI command reference](docs/cli-reference.md): available `dev` commands.
19
- - [Architecture](docs/architecture.md): components, artifact graph, state machine, and gated execution.
20
- - [Live review](docs/live-review.md): `dev watch` session review, cards, signals, and blocking behavior.
21
- - [Security model](docs/security.md): redaction, permissions, allowlists, and local state.
22
- - [Project status](docs/project-status.md): current maturity by subsystem.
23
- - [Roadmap](docs/roadmap.md): planned work.
50
+ DevCouncil supports macOS, Linux, and Windows. Requires a Go toolchain (`>=1.22`), Rust/`cargo`, and Git.
24
51
 
25
- ## Why DevCouncil Exists
52
+ ### 1. Build and Install Native Binaries
26
53
 
27
- Standard AI coding agents are good at producing the happy path, but they often fail in expensive ways when complexity grows:
54
+ From a clone of this repository:
28
55
 
29
- - **Requirement omission:** agents lose track of original product or PRD constraints across chat turns.
30
- - **Architecture drift:** agents add dependencies or change design patterns without explicit authorization.
31
- - **Unverified success:** agents claim tests passed without proving that the new logic was exercised.
32
- - **Hidden assumptions:** important decisions stay buried in transient chat history instead of durable project artifacts.
56
+ ```bash
57
+ # macOS & Linux: builds Go host and all Rust analysis binaries into ~/.local/bin
58
+ bash scripts/install.sh
59
+
60
+ # Standalone DevMap (no Go host)
61
+ bash scripts/install.sh --only=devmap
33
62
 
34
- **DevCouncil makes evidence, not model confidence, the final authority.**
63
+ # Analysis suite only (devmap dcstore dcverify dcgrep)
64
+ bash scripts/install.sh analysis
35
65
 
36
- 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.
66
+ # Windows (PowerShell):
67
+ .\scripts\install.ps1
68
+ .\scripts\install.ps1 -Components devmap
69
+ ```
37
70
 
38
- ## Quickstart
71
+ To build and install the analysis components (`devmap`, `dcstore`, `dcverify`, `dcgrep`):
39
72
 
40
- 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.
73
+ ```bash
74
+ # Build & install all analysis components to ~/.local/bin
75
+ bash scripts/install-components.sh
41
76
 
42
- Install `uv` first if it is missing:
77
+ # Or install specific components
78
+ bash scripts/install-components.sh devmap
79
+ bash scripts/install-components.sh dcstore dcverify dcgrep
43
80
 
44
- ```powershell
45
- powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
81
+ # Build the Go host binary
82
+ go -C backend/go_orchestrator build -o ~/.local/bin/devcouncil ./cmd/devcouncil
83
+ ln -sf devcouncil ~/.local/bin/dev
46
84
  ```
47
85
 
48
- On macOS or Linux:
86
+ Ensure `~/.local/bin` is in your `PATH`:
49
87
 
50
88
  ```bash
51
- curl -LsSf https://astral.sh/uv/install.sh | sh
89
+ export PATH="$HOME/.local/bin:$PATH"
52
90
  ```
53
91
 
54
- Install DevCouncil from npm:
92
+ ### 2. Optional Global npm Shim
93
+
94
+ If you prefer to dispatch through npm, install the lightweight Node.js wrapper (Node 18+). The npm package ships a shim that resolves and executes the native binaries:
55
95
 
56
96
  ```bash
57
97
  npm install -g devcouncil
58
- devcouncil --help
59
- dev --help
60
98
  ```
61
99
 
62
- Start the first gated workflow from your target repository:
100
+ ### 3. Verify Environment
63
101
 
64
102
  ```bash
65
- cd path/to/your/project
66
- dev setup
67
- dev plan "Describe the implementation goal"
68
- dev tasks
69
- dev run TASK-001 --executor manual
70
- dev prompt TASK-001
71
- dev verify TASK-001
103
+ devcouncil --help
104
+ dev --help
105
+ devmap --version
106
+ dcverify health
107
+ dcstore --db .devcouncil/state.sqlite health
108
+ dcgrep health
72
109
  ```
73
110
 
74
- On a fresh interactive setup, DevCouncil can configure supported coding CLI integrations immediately; pass `--skip-integrations` if you want to defer that step.
111
+ ---
112
+
113
+ ## Core Capabilities & Workflows
75
114
 
76
- 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.
115
+ ### 1. Coding Agent Integration (`devcouncil integrate`)
77
116
 
78
- For an automated end-to-end run with a supported coding CLI installed:
117
+ Connect DevCouncil's MCP server to Cursor or Claude Code. `--write-gate` has been removed: it named a pre-tool-use gate that only the retired lifecycle hooks installed, and nothing enforced it. Use `dev hook status` to inspect old registrations and `dev hook disable --dry-run` to preview cleanup.
79
118
 
80
119
  ```bash
81
- dev e2e "Describe the implementation goal" --executor codex
82
- dev go "Describe the implementation goal" --executor codex
120
+ devcouncil integrate cursor --apply
121
+ devcouncil integrate claude --apply
122
+
123
+ # Stub receipt only — not a working installer:
124
+ # devcouncil integrate antigravity --apply
125
+
126
+ # Verify existing integration configuration
127
+ devcouncil integrate cursor --check
83
128
  ```
84
129
 
85
- `dev e2e` is the explicit one-command integration target for coding agents. It initializes local DevCouncil state if needed, plans the goal, runs each approved task through the selected executor, verifies the resulting diff, and prints the final report. If `--executor` is omitted, DevCouncil uses `execution.default_executor` from `.devcouncil/config.yaml`. `dev go` is kept as a shorter alias for the same flow.
130
+ ### 2. Engineering Skills Delivery (`devcouncil skills`)
86
131
 
87
- For machine-readable agent handoff, write the final report to a stable file:
132
+ Deliver verified engineering practices and code-intelligence skills directly into agent skill folders (`.agents/skills`, `.claude/skills`, `.cursor/skills`):
88
133
 
89
134
  ```bash
90
- dev e2e "Describe the implementation goal" --agent
91
- dev e2e "Describe the implementation goal" --json --report-file .devcouncil/reports/latest.json
92
- ```
135
+ # List available skills embedded in the binary
136
+ devcouncil skills list
93
137
 
94
- `--agent` is the lowest-friction integration preset. It enables JSON output and writes `.devcouncil/reports/latest.json`.
138
+ # Scaffold all applicable skills into the repository
139
+ devcouncil skills scaffold
95
140
 
96
- See the full [quickstart](docs/quickstart.md) for installation variants, API-key setup, and first-run guidance.
141
+ # Scaffold a specific skill (e.g. core-engineering or devmap)
142
+ devcouncil skills scaffold --skill core-engineering
143
+ devcouncil skills scaffold --skill devmap
144
+ ```
97
145
 
98
- ## Core Flow
146
+ ### 3. Repository Mapping & Code Intelligence (`devmap` / `dev map`)
99
147
 
100
- DevCouncil's recommended default is **Manual Sidecar Mode**:
148
+ Build and query deep semantic relationships across your codebase without an LLM:
101
149
 
102
- 1. DevCouncil plans the work and creates a task graph.
103
- 2. You ask DevCouncil for one constrained task prompt.
104
- 3. You paste that prompt into your coding CLI or agent.
105
- 4. The agent edits the repository.
106
- 5. DevCouncil verifies the resulting diff against task constraints.
107
- 6. If verification fails, DevCouncil creates a focused repair loop.
150
+ ```bash
151
+ # Build the repository map (.devcouncil/repo_map.json) and code graph
152
+ devmap build --manifest
108
153
 
109
- The detailed task-by-task workflow lives in [docs/workflow.md](docs/workflow.md).
154
+ # Shorthand via the Go host:
155
+ dev map
110
156
 
111
- ## Install From Source
157
+ # Query symbol blast radius & reverse dependents before editing
158
+ devmap impact path/to/file.go
112
159
 
113
- For local development inside this checkout:
160
+ # Trace dependency paths between two symbols
161
+ devmap trace SymbolA SymbolB
114
162
 
115
- ```bash
116
- uv sync
117
- uv run dev --help
163
+ # Find dead code with confidence tiers (extracted | inferred | ambiguous)
164
+ devmap dead
165
+
166
+ # Launch the interactive HTML visualizer
167
+ devmap view
118
168
  ```
119
169
 
120
- For a global install from this repository:
170
+ ### 4. Task Leases & Gated Verification (`devcouncil verify`)
171
+
172
+ Prevent multi-agent file trampling and verify diff correctness against deterministic criteria:
121
173
 
122
174
  ```bash
123
- uv tool install --force .
124
- dev --help
125
- devcouncil --help
175
+ # Run deterministic verification against a task's diff
176
+ devcouncil verify TASK-001
177
+
178
+ # Machine-readable output for agent loops
179
+ devcouncil verify TASK-001 --json
180
+
181
+ # Sandbox flag is recorded only; docker/nix do not isolate (TASK-P7-2)
182
+ devcouncil verify TASK-001 --sandbox local
126
183
  ```
127
184
 
128
- ## Project Shape
185
+ Verification today (Go `verify.Run()`) enforces:
186
+ - **Planned file scope:** Rejects unauthorized edits outside declared task boundaries.
187
+ - **Orphan diffs / dependency-risk:** Flags files changed that were not planned.
188
+ - **Expected tests / allowed commands:** Runs the task's command list via `/bin/sh -c` in the project root.
189
+ - **Typed `next_actions`:** Structured repair instructions when those gates fail.
129
190
 
130
- DevCouncil implements a 7-phase software-team workflow:
191
+ Stub detection, secret scanning, and coverage intersection live in the **`dcverify`** binary. `devcouncil verify`, MCP `devcouncil_verify_task`, and **Manvi** `runRigor` all spawn it. When `dcverify` is not installed the report carries an empty `rigor_applied` **and** a `rigor_skipped_reason` naming what to install — never a silent clean pass. Diff↔coverage runs only when a profile is supplied (`devcouncil verify --coverage PATH`); otherwise `coverage_skipped_reason` says so.
131
192
 
132
- 1. Goal analysis and repository mapping.
133
- 2. Requirements drafting.
134
- 3. Council debate and task arbitration.
135
- 4. Gated execution with scoped files and commands.
136
- 5. Deterministic verification.
137
- 6. Repair-loop generation.
138
- 7. Evidence reporting.
193
+ ### 5. MCP Servers for AI Agents
139
194
 
140
- Read [docs/architecture.md](docs/architecture.md) for the artifact graph, gating state machine, and component layout.
195
+ DevCouncil provides two complementary Model Context Protocol (MCP) servers:
141
196
 
142
- ## Contributions
197
+ - **Host MCP Server (`devcouncil mcp`)**: Eight tools — checkout / renew / release / next_task / get_diff / verify_task / get_gaps / policy_check_write. `verify_task` runs Go `verify.Run()`, which spawns `dcverify` for the stub and secret gates; diff↔coverage needs a profile this tool has no field for, so use `devcouncil verify --coverage PATH`.
198
+ - **DevMap MCP Server (`devmap mcp`)**: Eleven query tools (status, search, dependencies, impact, trace, neighbors, dead_symbols, clones, preview, explore, affected_tests). Always pass `repo_path`.
143
199
 
144
- Project ideas and execution patterns come from the open-source ecosystem:
200
+ ---
145
201
 
146
- - [Sage](https://github.com/usetig/sage): peer-review-first model for planning and critique.
147
- - [karpathy/llm-council](https://github.com/karpathy/llm-council): for the multi-LLM peer-review pattern.
148
- - [GPT Pilot](https://github.com/Pythagora-io/gpt-pilot): for role-based software-team concept.
149
- - [astral-sh/uv](https://github.com/astral-sh/uv): for reproducible Python package/runtime workflows.
150
- - [OpenHands](https://github.com/All-Hands-AI/OpenHands): for workspace-aware agent execution patterns.
151
- - [mini-SWE-agent](https://github.com/SWE-agent/mini-swe-agent): for lightweight execution loop inspiration.
152
- - [SWE-agent](https://github.com/SWE-agent/SWE-agent): for full-spectrum autonomous SWE-style tasking patterns.
153
- - [GitNexus](https://github.com/abhigyanpatwari/GitNexus): for structural codebase awareness.
154
- - [graphify](https://github.com/safishamsi/graphify): for knowledge-graph-based coordination concepts.
202
+ ## Architecture Flow
203
+
204
+ ```mermaid
205
+ flowchart TD
206
+ subgraph Agents["Harnesses, hosts, and coding agents"]
207
+ Claude["Claude Code"]
208
+ Cursor["Cursor"]
209
+ Codex["Codex"]
210
+ AGY["Antigravity"]
211
+ Warp["Warp"]
212
+ Manvi["Manvi (wraps these components)"]
213
+ GitPulse["GitPulse (selects modules)"]
214
+ end
215
+
216
+ subgraph Host["Go Host Orchestrator (devcouncil / dev)"]
217
+ CLI["Host CLI\ncmd/devcouncil"]
218
+ MCP["Host MCP Server\ndevcouncil mcp"]
219
+ Integ["Integrator\ndevcouncil integrate"]
220
+ Skills["Skills Engine\ndevcouncil skills"]
221
+ VerifyCmd["Verify Command\ndevcouncil verify"]
222
+ end
223
+
224
+ subgraph RustAnalysis["Rust Analysis & State Suite"]
225
+ DevMap["devmap\nCode Graph & 36+ Language ASTs"]
226
+ DCStore["dcstore\nAtomic Task Leases & SQLite Store"]
227
+ DCVerify["dcverify\nUnified Diff Parser & Rigor Gates"]
228
+ DCGrep["dcgrep\nRipgrep Engine & Trigram Index"]
229
+ end
230
+
231
+ Agents <-->|MCP Protocol| MCP
232
+ Agents <-->|Direct / Tool Calls| CLI
233
+ Manvi -->|Wraps: imports Go, spawns binaries| Host
234
+ Manvi -->|Spawns selected modules| RustAnalysis
235
+ GitPulse -->|Vendors selected crates| DevMap
236
+ GitPulse -->|manvi serve| Manvi
237
+
238
+ CLI -->|Execs| DevMap
239
+ CLI -->|Integrates| Integ
240
+ CLI -->|Scaffolds| Skills
241
+ VerifyCmd -->|Scope, orphan, expected tests| DCStore
242
+ Manvi -->|Spawns dcverify rigor| DCVerify
243
+
244
+ MCP -->|Leases and tasks| DCStore
245
+ MCP -->|verify_task → Go Run| VerifyCmd
246
+ ```
155
247
 
156
- ## License
248
+ ---
157
249
 
158
- Licensed under the **Apache License, Version 2.0**. See [LICENSE](LICENSE) for details.
250
+ ## Repository Layout
251
+
252
+ ```
253
+ DevCouncil/
254
+ ├── backend/go_orchestrator/ # Go host orchestrator binary and packages
255
+ │ ├── cmd/devcouncil/ # Main entrypoint for devcouncil and dev
256
+ │ ├── devcouncil/ # MCP server, integrate, skills, verify implementations
257
+ │ ├── dc/store/ # Interop client for dcstore binary
258
+ │ └── policy/ # File-write containment & security policies
259
+ ├── rust/ # Analysis and verification engine crates (dcstore, dcverify, dcgrep, devmap)
260
+ ├── bin/ # Node.js npm shim (bin/devcouncil.js)
261
+ ├── scripts/ # Platform installers (install.sh, install-components.sh)
262
+ └── docs/ # Architecture, releases, and integration guides
263
+ ```
159
264
 
160
265
  ---
161
266
 
162
- **"Trust the model, but verify the graph."**
267
+ ## Documentation
268
+
269
+ - [Release Notes (v0.2.0)](docs/releases/v0.2.0.md): Native orchestration and analysis migration.
270
+ - [Native cutover follow-ups](docs/TODO.md): Open wiring and honesty work after Phase 7.
271
+ - [Architecture Decisions & Python Retirement](docs/PHASE7_LONG_TAIL.md): Background on the transition to native Go and Rust binaries.
272
+ - [Archived ledgers](docs/archive/README.md): Pre-cutover DevMap plans, audits, and qualification dumps.
273
+ - [Code Graph & DevMap Guide](docs/code-graph.md): Symbol resolution, dead code, and blast radius.
274
+ - [DevMap competitor benchmarks](docs/devmap/README.md#benchmark-comparison): Measured strengths, weaknesses, speed, memory, storage, and correctness against Graphify, Gortex, GitNexus, CodeGraph, codebase-memory-mcp, and ripgrep, with scope limits and raw evidence.
275
+ - [Hero Loop (MCP Closed Loop)](docs/hero-loop.md): Autonomous task loop with deterministic gates.
276
+ - [Coding CLI Integration](docs/coding-cli-integration.md): Configuring Claude, Codex, Cursor, Warp, and Antigravity.
277
+ - [Security Model](docs/security.md): Redaction, write isolation, and containment rules.
278
+ - [Project Status](docs/project-status.md): Subsystem maturity ledger.
279
+
280
+ ---
281
+
282
+ ## License
283
+
284
+ Licensed under the **Apache License, Version 2.0**. See [LICENSE](LICENSE) for details.
package/bin/devcouncil.js CHANGED
@@ -1,18 +1,129 @@
1
1
  #!/usr/bin/env node
2
2
 
3
+ /**
4
+ * npm `dev` / `devcouncil` shim.
5
+ *
6
+ * Live commands belong to the Go `devcouncil` binary, including `map` /
7
+ * `graph` / `ast` (which that binary execs `devmap` for). This file never
8
+ * invokes Python or uv, and it is not a second owner of any command.
9
+ */
10
+
3
11
  const { spawnSync } = require("node:child_process");
4
- const { existsSync } = require("node:fs");
12
+ const {
13
+ closeSync,
14
+ existsSync,
15
+ openSync,
16
+ readSync,
17
+ realpathSync,
18
+ statSync,
19
+ } = require("node:fs");
5
20
  const path = require("node:path");
6
21
 
7
- const packageRoot = path.resolve(__dirname, "..");
8
- const pyproject = path.join(packageRoot, "pyproject.toml");
22
+ const WIN32 = process.platform === "win32";
23
+
24
+ function localBinDir() {
25
+ const home = process.env.HOME || process.env.USERPROFILE || "";
26
+ return home ? path.join(home, ".local", "bin") : "";
27
+ }
28
+
29
+ function isSelf(file) {
30
+ try {
31
+ return realpathSync(file) === realpathSync(__filename);
32
+ } catch {
33
+ return path.resolve(file) === path.resolve(__filename);
34
+ }
35
+ }
36
+
37
+ function looksLikeNodeShim(file) {
38
+ const lower = file.toLowerCase();
39
+ if (
40
+ lower.endsWith(".js") ||
41
+ lower.endsWith(".cmd") ||
42
+ lower.endsWith(".bat") ||
43
+ lower.endsWith(".ps1")
44
+ ) {
45
+ return true;
46
+ }
47
+ let fd;
48
+ try {
49
+ fd = openSync(file, "r");
50
+ const buf = Buffer.alloc(160);
51
+ const n = readSync(fd, buf, 0, 160, 0);
52
+ const line = buf.slice(0, n).toString("utf8").split(/\r?\n/, 1)[0] || "";
53
+ if (line.startsWith("#!") && /\bnode\b/i.test(line)) {
54
+ return true;
55
+ }
56
+ } catch {
57
+ return false;
58
+ } finally {
59
+ if (fd !== undefined) {
60
+ closeSync(fd);
61
+ }
62
+ }
63
+ return false;
64
+ }
65
+
66
+ function isNativeBin(file) {
67
+ if (!file || !existsSync(file)) {
68
+ return false;
69
+ }
70
+ try {
71
+ if (statSync(file).isDirectory()) {
72
+ return false;
73
+ }
74
+ } catch {
75
+ return false;
76
+ }
77
+ if (isSelf(file) || looksLikeNodeShim(file)) {
78
+ return false;
79
+ }
80
+ return true;
81
+ }
82
+
83
+ function resolveBin(name, envKey) {
84
+ const override = process.env[envKey];
85
+ if (override) {
86
+ return override;
87
+ }
88
+ const dirs = (process.env.PATH || "").split(path.delimiter).filter(Boolean);
89
+ const local = localBinDir();
90
+ if (local) {
91
+ dirs.push(local);
92
+ }
93
+ const exts = WIN32 ? [".exe", ".com", ""] : [""];
94
+ for (const dir of dirs) {
95
+ for (const ext of exts) {
96
+ const candidate = path.join(dir, name + ext);
97
+ if (isNativeBin(candidate)) {
98
+ return candidate;
99
+ }
100
+ }
101
+ }
102
+ return null;
103
+ }
104
+
105
+ function spawnEnv() {
106
+ const env = { ...process.env };
107
+ const local = localBinDir();
108
+ if (local && existsSync(local)) {
109
+ const current = env.PATH || env.Path || "";
110
+ const parts = current.split(path.delimiter);
111
+ if (!parts.includes(local)) {
112
+ env.PATH = `${local}${path.delimiter}${current}`;
113
+ if (WIN32) {
114
+ env.Path = env.PATH;
115
+ }
116
+ }
117
+ }
118
+ return env;
119
+ }
9
120
 
10
121
  function run(command, args) {
11
122
  return spawnSync(command, args, {
12
123
  cwd: process.cwd(),
13
124
  stdio: "inherit",
14
- shell: process.platform === "win32",
15
- env: process.env,
125
+ shell: false,
126
+ env: spawnEnv(),
16
127
  });
17
128
  }
18
129
 
@@ -21,42 +132,29 @@ function fail(message) {
21
132
  process.exit(1);
22
133
  }
23
134
 
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
-
135
+ function missing(name, hint) {
34
136
  fail(
35
137
  [
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",
138
+ `DevCouncil requires the ${name} binary on PATH (or ~/.local/bin).`,
139
+ hint,
43
140
  ].join("\n")
44
141
  );
45
142
  }
46
143
 
47
- if (!existsSync(pyproject)) {
48
- fail(
49
- "DevCouncil npm package is missing pyproject.toml. Reinstall the package and try again."
144
+ const args = process.argv.slice(2);
145
+
146
+ const goBin = resolveBin("devcouncil", "DEVCOUNCIL_BIN");
147
+ if (!goBin) {
148
+ missing(
149
+ "devcouncil",
150
+ WIN32
151
+ ? "Build: go -C backend/go_orchestrator build -o %USERPROFILE%\\.local\\bin\\devcouncil.exe ./cmd/devcouncil\nAlso copy it to %USERPROFILE%\\.local\\bin\\dev.exe (scripts/install.ps1)."
152
+ : "Build: go -C backend/go_orchestrator build -o ~/.local/bin/devcouncil ./cmd/devcouncil\nAlso: ln -sf devcouncil ~/.local/bin/dev"
50
153
  );
51
154
  }
52
155
 
53
- ensureUv();
54
-
55
- const args = process.argv.slice(2);
56
- const result = run("uv", ["run", "--project", packageRoot, "devcouncil", ...args]);
57
-
156
+ const result = run(goBin, args);
58
157
  if (result.error) {
59
- fail(`Failed to start DevCouncil: ${result.error.message}`);
158
+ fail(`Failed to start devcouncil: ${result.error.message}`);
60
159
  }
61
-
62
160
  process.exit(result.status ?? 1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "devcouncil",
3
- "version": "0.1.1",
3
+ "version": "0.2.1",
4
4
  "description": "Gated orchestrator for AI-assisted software development",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/bharathvbcr/DevCouncil#readme",
@@ -25,21 +25,17 @@
25
25
  },
26
26
  "files": [
27
27
  "bin/",
28
- "src/**/*.py",
29
- "src/**/*.md",
30
- "pyproject.toml",
31
- "uv.lock",
32
28
  "README.md",
33
29
  "LICENSE"
34
30
  ],
35
31
  "scripts": {
36
- "install:dev": "uv tool install --force .",
37
- "install:editable": "uv pip install -e .",
38
- "dev": "uv run devcouncil",
39
32
  "pack:check": "npm pack --dry-run",
40
- "test": "uv run pytest",
41
- "lint": "uv run ruff check .",
42
- "check": "uv run ruff check . && uv run pytest"
33
+ "smoke:package": "node scripts/npm-runtime-smoke.mjs",
34
+ "smoke:registry": "node scripts/npm-registry-smoke.mjs",
35
+ "check:release": "node scripts/check-release.mjs",
36
+ "check:workflows": "node scripts/check-workflows.mjs",
37
+ "test:scripts": "node --test scripts/check-release.test.mjs scripts/check-workflows.test.mjs",
38
+ "ci:local": "node scripts/ci-local.mjs"
43
39
  },
44
40
  "engines": {
45
41
  "node": ">=18"
package/pyproject.toml DELETED
@@ -1,34 +0,0 @@
1
- [project]
2
- name = "devcouncil"
3
- version = "0.1.1"
4
- description = "Gated orchestrator for AI-assisted software development"
5
- readme = "README.md"
6
- requires-python = ">=3.12"
7
- dependencies = [
8
- "typer>=0.12.3",
9
- "rich>=13.7.1",
10
- "pydantic>=2.7.1",
11
- "pyyaml>=6.0.1",
12
- "sqlmodel>=0.0.19",
13
- "httpx>=0.27.0",
14
- "gitpython>=3.1.43",
15
- "mcp>=1.27.0",
16
- ]
17
-
18
- [project.scripts]
19
- dev = "devcouncil.cli.main:app"
20
- devcouncil = "devcouncil.cli.main:app"
21
-
22
- [dependency-groups]
23
- dev = [
24
- "pytest>=8.2.0",
25
- "ruff>=0.4.4",
26
- "mypy>=1.10.0",
27
- ]
28
-
29
- [tool.pytest.ini_options]
30
- testpaths = ["tests"]
31
-
32
- [build-system]
33
- requires = ["hatchling"]
34
- build-backend = "hatchling.build"
File without changes
@@ -1,4 +0,0 @@
1
- from devcouncil.cli.main import app
2
-
3
- if __name__ == "__main__":
4
- app()