@praneeth_54/agentdoctor 2.0.0 → 2.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.
- package/CHANGELOG.md +141 -4
- package/README.md +329 -153
- package/dist/agent/approvals.d.ts +24 -0
- package/dist/agent/approvals.js +64 -0
- package/dist/agent/chat/index.d.ts +7 -0
- package/dist/agent/chat/index.js +5 -0
- package/dist/agent/chat/memory.d.ts +44 -0
- package/dist/agent/chat/memory.js +103 -0
- package/dist/agent/chat/project-summary.d.ts +16 -0
- package/dist/agent/chat/project-summary.js +70 -0
- package/dist/agent/chat/prompts.d.ts +6 -0
- package/dist/agent/chat/prompts.js +39 -0
- package/dist/agent/chat/response.d.ts +19 -0
- package/dist/agent/chat/response.js +109 -0
- package/dist/agent/chat/service.d.ts +42 -0
- package/dist/agent/chat/service.js +252 -0
- package/dist/agent/chat/types.d.ts +48 -0
- package/dist/agent/chat/types.js +1 -0
- package/dist/agent/context/retrieve.d.ts +21 -0
- package/dist/agent/context/retrieve.js +117 -0
- package/dist/agent/context/truth.d.ts +6 -0
- package/dist/agent/context/truth.js +19 -0
- package/dist/agent/context/types.d.ts +23 -0
- package/dist/agent/context/types.js +4 -0
- package/dist/agent/index.d.ts +26 -0
- package/dist/agent/index.js +14 -0
- package/dist/agent/loop.d.ts +51 -0
- package/dist/agent/loop.js +222 -0
- package/dist/agent/modes.d.ts +18 -0
- package/dist/agent/modes.js +102 -0
- package/dist/agent/plan.d.ts +30 -0
- package/dist/agent/plan.js +121 -0
- package/dist/agent/runtime.d.ts +67 -0
- package/dist/agent/runtime.js +180 -0
- package/dist/agent/state.d.ts +30 -0
- package/dist/agent/state.js +95 -0
- package/dist/agent/student.d.ts +56 -0
- package/dist/agent/student.js +230 -0
- package/dist/agent/tools/execute.d.ts +18 -0
- package/dist/agent/tools/execute.js +355 -0
- package/dist/agent/tools/index.d.ts +6 -0
- package/dist/agent/tools/index.js +5 -0
- package/dist/agent/tools/registry.d.ts +7 -0
- package/dist/agent/tools/registry.js +212 -0
- package/dist/agent/tools/run.d.ts +24 -0
- package/dist/agent/tools/run.js +44 -0
- package/dist/agent/tools/types.d.ts +32 -0
- package/dist/agent/tools/types.js +10 -0
- package/dist/agent/tools/write.d.ts +24 -0
- package/dist/agent/tools/write.js +121 -0
- package/dist/agent/verify.d.ts +29 -0
- package/dist/agent/verify.js +210 -0
- package/dist/ai/config.d.ts +22 -0
- package/dist/ai/config.js +68 -0
- package/dist/ai/index.d.ts +17 -0
- package/dist/ai/index.js +52 -0
- package/dist/ai/providers/mock.d.ts +20 -0
- package/dist/ai/providers/mock.js +84 -0
- package/dist/ai/providers/none.d.ts +6 -0
- package/dist/ai/providers/none.js +23 -0
- package/dist/ai/providers/openai-compatible.d.ts +21 -0
- package/dist/ai/providers/openai-compatible.js +151 -0
- package/dist/ai/redact.d.ts +8 -0
- package/dist/ai/redact.js +21 -0
- package/dist/ai/types.d.ts +71 -0
- package/dist/ai/types.js +6 -0
- package/dist/architecture/contract.d.ts +64 -0
- package/dist/architecture/contract.js +373 -0
- package/dist/assurance/change.d.ts +211 -0
- package/dist/assurance/change.js +624 -0
- package/dist/assurance/proof.d.ts +136 -0
- package/dist/assurance/proof.js +338 -0
- package/dist/auth/index.d.ts +81 -0
- package/dist/auth/index.js +130 -0
- package/dist/auth/rbac.d.ts +9 -0
- package/dist/auth/rbac.js +26 -0
- package/dist/cli/commands/agent.d.ts +27 -0
- package/dist/cli/commands/agent.js +153 -0
- package/dist/cli/commands/architecture.d.ts +6 -0
- package/dist/cli/commands/architecture.js +109 -0
- package/dist/cli/commands/assurance.d.ts +67 -0
- package/dist/cli/commands/assurance.js +210 -0
- package/dist/cli/commands/chat.d.ts +14 -0
- package/dist/cli/commands/chat.js +155 -0
- package/dist/cli/commands/complete.js +2 -2
- package/dist/cli/commands/learn.d.ts +12 -0
- package/dist/cli/commands/learn.js +107 -0
- package/dist/cli/commands/platform.d.ts +2 -0
- package/dist/cli/commands/platform.js +5 -1
- package/dist/cli/commands/policy-graph-run.d.ts +40 -0
- package/dist/cli/commands/policy-graph-run.js +200 -0
- package/dist/cli/commands/workspace.d.ts +9 -0
- package/dist/cli/commands/workspace.js +82 -0
- package/dist/cli/program.js +627 -17
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/contracts/index.d.ts +1 -1
- package/dist/contracts/index.js +2 -2
- package/dist/core/brain-product/init.js +5 -2
- package/dist/core/secrets/scan.d.ts +7 -1
- package/dist/core/secrets/scan.js +9 -9
- package/dist/coverage/cobertura.d.ts +6 -0
- package/dist/coverage/cobertura.js +52 -0
- package/dist/coverage/istanbul.d.ts +7 -0
- package/dist/coverage/istanbul.js +134 -0
- package/dist/coverage/lcov.d.ts +7 -0
- package/dist/coverage/lcov.js +59 -0
- package/dist/coverage/load.d.ts +9 -0
- package/dist/coverage/load.js +39 -0
- package/dist/coverage/types.d.ts +23 -0
- package/dist/coverage/types.js +5 -0
- package/dist/dashboard/server.d.ts +7 -1
- package/dist/dashboard/server.js +110 -6
- package/dist/enforcement/runner.d.ts +52 -3
- package/dist/enforcement/runner.js +467 -16
- package/dist/index.d.ts +36 -2
- package/dist/index.js +23 -2
- package/dist/intelligence/graph/build.d.ts +2 -0
- package/dist/intelligence/graph/build.js +49 -5
- package/dist/intelligence/graph/incremental.d.ts +68 -0
- package/dist/intelligence/graph/incremental.js +234 -0
- package/dist/intelligence/resolve/imports.d.ts +36 -0
- package/dist/intelligence/resolve/imports.js +245 -0
- package/dist/languages/go.d.ts +9 -0
- package/dist/languages/go.js +50 -0
- package/dist/languages/index.d.ts +11 -0
- package/dist/languages/index.js +76 -0
- package/dist/languages/php.d.ts +8 -0
- package/dist/languages/php.js +202 -0
- package/dist/languages/python.d.ts +11 -0
- package/dist/languages/python.js +180 -0
- package/dist/languages/types.d.ts +42 -0
- package/dist/languages/types.js +26 -0
- package/dist/languages/typescript.d.ts +3 -0
- package/dist/languages/typescript.js +95 -0
- package/dist/mcp/agent/registry.d.ts +13 -0
- package/dist/mcp/agent/registry.js +234 -0
- package/dist/mcp/agentdoctor/server.js +8 -1
- package/dist/mcp/intelligence/handlers.d.ts +5 -0
- package/dist/mcp/intelligence/handlers.js +229 -40
- package/dist/mcp/intelligence/path-safety.d.ts +2 -4
- package/dist/mcp/intelligence/path-safety.js +25 -44
- package/dist/mcp/intelligence/registry.d.ts +1 -1
- package/dist/mcp/intelligence/registry.js +69 -1
- package/dist/platform/firewall/evaluate.d.ts +6 -3
- package/dist/platform/firewall/evaluate.js +66 -15
- package/dist/platform/graph/build.js +19 -23
- package/dist/platform/health/analyze.js +23 -17
- package/dist/platform/index.js +2 -0
- package/dist/platform/test-impact/analyze.d.ts +21 -3
- package/dist/platform/test-impact/analyze.js +214 -28
- package/dist/platform/tokens/plan.js +39 -20
- package/dist/platform/types.d.ts +9 -0
- package/dist/policy/compose.d.ts +34 -0
- package/dist/policy/compose.js +118 -0
- package/dist/policy/packs.js +33 -1
- package/dist/security/paths.d.ts +21 -0
- package/dist/security/paths.js +133 -0
- package/dist/storage/postgres.d.ts +26 -0
- package/dist/storage/postgres.js +90 -0
- package/dist/storage/provider.d.ts +2 -7
- package/dist/storage/provider.js +22 -16
- package/dist/storage/sqlite.d.ts +33 -0
- package/dist/storage/sqlite.js +77 -0
- package/dist/team/auth.js +1 -1
- package/dist/workspace/index.d.ts +69 -0
- package/dist/workspace/index.js +220 -0
- package/package.json +9 -3
package/README.md
CHANGED
|
@@ -1,266 +1,442 @@
|
|
|
1
1
|
# AgentDoctor
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Engineering assurance for AI coding agents.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Understand your codebase, assess the impact of changes, govern engineering knowledge, enforce safety policies, and attach inspectable evidence to AI-driven changes.
|
|
6
6
|
|
|
7
7
|
[](https://www.npmjs.com/package/@praneeth_54/agentdoctor)
|
|
8
8
|
[](https://github.com/pranee54/AgentDoctor/actions/workflows/ci.yml)
|
|
9
9
|
[](https://nodejs.org)
|
|
10
10
|
[](LICENSE)
|
|
11
11
|
|
|
12
|
-
**Published
|
|
12
|
+
**Published:** [`@praneeth_54/agentdoctor@2.1.0`](https://www.npmjs.com/package/@praneeth_54/agentdoctor)
|
|
13
|
+
**Release notes:** [docs/RELEASE_2_1_0.md](docs/RELEASE_2_1_0.md) · Prior assurance cut: [docs/2.0.1/README.md](docs/2.0.1/README.md)
|
|
13
14
|
|
|
14
|
-
[
|
|
15
|
+
[Install](#install) · [Quickstart](#quickstart) · [Change assurance](#change-assurance) · [Project AI (2.1)](#project-ai-agent-21) · [Documentation](docs/2.0.1/README.md) · [MCP](#mcp) · [GitHub Action](#github-action) · [Architecture](#architecture)
|
|
15
16
|
|
|
16
17
|
---
|
|
17
18
|
|
|
18
|
-
## What AgentDoctor
|
|
19
|
+
## What AgentDoctor is
|
|
19
20
|
|
|
20
|
-
AgentDoctor
|
|
21
|
+
AgentDoctor sits between developers / AI coding agents and the repository’s engineering reality.
|
|
21
22
|
|
|
22
|
-
|
|
23
|
-
2. **Repository Brain** — evidence-backed claims, proposals, human review, and Project Brain MCP tools.
|
|
24
|
-
3. **Codebase intelligence** — TypeScript/JavaScript AST graphs, git hotspots, impact analysis, knowledge governance, evaluate-only policy, and a combined MCP server.
|
|
23
|
+
AI agents can write code quickly. The harder engineering problem is knowing whether a change is **correct, safe, compatible, explainable, and consistent** with the rest of the repository.
|
|
25
24
|
|
|
26
|
-
|
|
25
|
+
AgentDoctor collects repository signals — source structure, graphs, Git history, policies, knowledge, and verification evidence — so humans and agents can reason about changes with fewer unsupported assumptions.
|
|
27
26
|
|
|
28
|
-
|
|
27
|
+
**Who it is for**
|
|
29
28
|
|
|
30
|
-
|
|
29
|
+
| Audience | How AgentDoctor helps |
|
|
30
|
+
| ---------------------- | ----------------------------------------------------------------------------- |
|
|
31
|
+
| Manual developers | Scan / fix / verify, change impact, evidence, architecture and policy checks |
|
|
32
|
+
| Students | `learn` — explain project, viva, docs; **BUILD_WITH_ME** after approval |
|
|
33
|
+
| AI-assisted developers | Optional Project Chat (`ask` / `chat`) with evidence and truth labels |
|
|
34
|
+
| AI coding agents | MCP + controlled tools; AgentDoctor owns context, execution, and verification |
|
|
31
35
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
+
It is **not** a generic chatbot, IDE interceptor, or claim of full autonomy. Optional Project AI (2.1) is **opt-in** and still subject to approvals, path/runner controls, and verification. It does **not** guarantee correctness. It produces **evidence and controls** you can inspect.
|
|
37
|
+
|
|
38
|
+
**Architecture (when AI is enabled):**
|
|
39
|
+
|
|
40
|
+
```text
|
|
41
|
+
THE MODEL REASONS.
|
|
42
|
+
AGENTDOCTOR PROVIDES PROJECT CONTEXT.
|
|
43
|
+
AGENTDOCTOR CONTROLS TOOLS.
|
|
44
|
+
AGENTDOCTOR VERIFIES RESULTS.
|
|
36
45
|
```
|
|
37
46
|
|
|
38
|
-
|
|
47
|
+
**Short description:** Engineering assurance for AI coding agents — repository intelligence, change evidence, safety controls, MCP tools, and an optional Project AI Agent.
|
|
39
48
|
|
|
40
49
|
---
|
|
41
50
|
|
|
42
|
-
##
|
|
51
|
+
## Why AgentDoctor?
|
|
52
|
+
|
|
53
|
+
Modern AI coding agents can:
|
|
54
|
+
|
|
55
|
+
- read individual files
|
|
56
|
+
- generate and edit code
|
|
57
|
+
- run tests when asked
|
|
58
|
+
|
|
59
|
+
Repository-level context is usually fragmented across:
|
|
60
|
+
|
|
61
|
+
| Signal | Typical location |
|
|
62
|
+
| ------------------ | ------------------------------ |
|
|
63
|
+
| Source structure | AST / imports / modules |
|
|
64
|
+
| Dependencies | manifests / lockfiles |
|
|
65
|
+
| History | Git |
|
|
66
|
+
| Architecture | docs / conventions / inference |
|
|
67
|
+
| Tests | test trees / naming heuristics |
|
|
68
|
+
| Policy | CI rules / allowlists |
|
|
69
|
+
| Decisions | ADRs / RFCs / tribal knowledge |
|
|
70
|
+
| Secrets / exposure | config files / ignore rules |
|
|
71
|
+
|
|
72
|
+
AgentDoctor brings those signals into one local toolchain around an AI-driven engineering change:
|
|
73
|
+
|
|
74
|
+
```text
|
|
75
|
+
Developer / AI Agent
|
|
76
|
+
│
|
|
77
|
+
▼
|
|
78
|
+
AgentDoctor
|
|
79
|
+
│
|
|
80
|
+
┌───────────────────────────────┐
|
|
81
|
+
│ Repository Intelligence │
|
|
82
|
+
│ AST / Graph / Git / Impact │
|
|
83
|
+
├───────────────────────────────┤
|
|
84
|
+
│ Engineering Knowledge │
|
|
85
|
+
│ Brain / Decisions / Provenance│
|
|
86
|
+
├───────────────────────────────┤
|
|
87
|
+
│ Safety & Policy │
|
|
88
|
+
│ Scan / Fix / Enforce / Secrets│
|
|
89
|
+
├───────────────────────────────┤
|
|
90
|
+
│ Verification │
|
|
91
|
+
│ Tests / Reports / Evidence │
|
|
92
|
+
└───────────────────────────────┘
|
|
93
|
+
│
|
|
94
|
+
▼
|
|
95
|
+
Safer, explainable engineering decisions
|
|
96
|
+
```
|
|
43
97
|
|
|
44
|
-
|
|
45
|
-
# Safety loop
|
|
46
|
-
agentdoctor scan
|
|
47
|
-
agentdoctor fix --dry-run
|
|
48
|
-
agentdoctor verify --baseline agentdoctor-report.json
|
|
98
|
+
---
|
|
49
99
|
|
|
50
|
-
|
|
51
|
-
agentdoctor init --name "My App" --domain "payments"
|
|
52
|
-
agentdoctor brain proposals
|
|
53
|
-
agentdoctor brain review --artifact <id> --decision approved
|
|
100
|
+
## Capability map
|
|
54
101
|
|
|
55
|
-
|
|
56
|
-
agentdoctor graph --mode auto --json
|
|
57
|
-
agentdoctor health --json
|
|
58
|
-
agentdoctor c4 --json
|
|
59
|
-
agentdoctor impact --json
|
|
60
|
-
agentdoctor refactor-impact --symbol MySymbol --json
|
|
102
|
+
Status labels: **SUPPORTED** · **PARTIAL** · **EXPERIMENTAL** · **NOT YET SUPPORTED**
|
|
61
103
|
|
|
62
|
-
|
|
63
|
-
agentdoctor knowledge-create --title "Standard" --content "…"
|
|
64
|
-
agentdoctor knowledge-approve --id <id> --decision approved
|
|
104
|
+
Details and evidence: [docs/2.0/overview/capabilities.md](docs/2.0/overview/capabilities.md) · [readiness matrix](docs/2.0/overview/readiness-matrix.md)
|
|
65
105
|
|
|
66
|
-
|
|
67
|
-
agentdoctor enforce --command "npm test" --json
|
|
106
|
+
### Repository intelligence
|
|
68
107
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
108
|
+
| Capability | Status |
|
|
109
|
+
| ---------------------------------------------------- | ------------ |
|
|
110
|
+
| TypeScript / JavaScript AST graph (+ regex fallback) | PARTIAL |
|
|
111
|
+
| Import / inferred call relationships | PARTIAL |
|
|
112
|
+
| Git hotspot / engineering intelligence | PARTIAL |
|
|
113
|
+
| Change / test / refactor impact | PARTIAL |
|
|
114
|
+
| C4-style architecture views | EXPERIMENTAL |
|
|
72
115
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
116
|
+
### Engineering knowledge
|
|
117
|
+
|
|
118
|
+
| Capability | Status |
|
|
119
|
+
| ------------------------------------------------------------- | --------- |
|
|
120
|
+
| Project Brain store + evidence-backed claims | SUPPORTED |
|
|
121
|
+
| Repository Brain init / proposal review (never auto-approved) | PARTIAL |
|
|
122
|
+
| Governed knowledge + abstention on retrieve | PARTIAL |
|
|
123
|
+
| Provenance envelopes on Brain MCP tools | SUPPORTED |
|
|
124
|
+
|
|
125
|
+
### Agent interfaces
|
|
126
|
+
|
|
127
|
+
| Capability | Status |
|
|
128
|
+
| --------------------------------------------------------------------------------- | --------- |
|
|
129
|
+
| Brain MCP (`brain_*` tools, STDIO) | SUPPORTED |
|
|
130
|
+
| Combined MCP (Brain + intelligence tools) | PARTIAL |
|
|
131
|
+
| Agent MCP (`project_ask`, path-safe file tools, plan, change verify) — 2.1 | PARTIAL |
|
|
132
|
+
| Optional Project Chat / coding agent CLI (`chat`, `ask`, `agent`, `learn`) — 2.1 | PARTIAL |
|
|
133
|
+
| Agent adapters (Cursor, Claude Code, Codex, Copilot, Windsurf, Gemini CLI, Aider) | SUPPORTED |
|
|
134
|
+
| Local dashboard + `/api/v2/*` + ask-only `/api/chat` — 2.1 | PARTIAL |
|
|
135
|
+
| Programmatic API (`scan`, Fix, Brain helpers) | SUPPORTED |
|
|
136
|
+
|
|
137
|
+
### Safety & governance
|
|
138
|
+
|
|
139
|
+
| Capability | Status |
|
|
140
|
+
| -------------------------------------------------------- | --------------------- |
|
|
141
|
+
| Scan → Safe Fix → Verify | SUPPORTED |
|
|
142
|
+
| Policy gates (`--min-score`, severity, rule, verify-new) | SUPPORTED |
|
|
143
|
+
| Evaluate-only policy / controlled enforcement runner | PARTIAL |
|
|
144
|
+
| Secret scan (redacted findings) + export redaction | PARTIAL |
|
|
145
|
+
| Path-safety for MCP / dashboard | PARTIAL |
|
|
146
|
+
| Local-dev team auth (scrypt) | PARTIAL — **not SSO** |
|
|
147
|
+
|
|
148
|
+
### Verification
|
|
149
|
+
|
|
150
|
+
| Capability | Status |
|
|
151
|
+
| ------------------------------------------------------- | -------------------------- |
|
|
152
|
+
| Change assurance assessment + evidence bundles | PARTIAL |
|
|
153
|
+
| Evidence hash verify (`verified` = integrity only) | SUPPORTED |
|
|
154
|
+
| Unit / integration / MCP STDIO tests (`npm run verify`) | SUPPORTED |
|
|
155
|
+
| Packed CLI clean-install smoke | SUPPORTED |
|
|
156
|
+
| Reproducible AST perf harness | PARTIAL (synthetic sample) |
|
|
76
157
|
|
|
77
158
|
---
|
|
78
159
|
|
|
79
|
-
##
|
|
160
|
+
## How AgentDoctor is different
|
|
161
|
+
|
|
162
|
+
Most engineering tools optimize one layer: static analysis, search, docs generation, dashboards, security scanners, or AI chat.
|
|
80
163
|
|
|
81
|
-
|
|
164
|
+
AgentDoctor is designed around the **lifecycle of an AI-driven change**:
|
|
82
165
|
|
|
83
|
-
|
|
166
|
+
```text
|
|
167
|
+
Repository
|
|
168
|
+
→ Understand
|
|
169
|
+
→ Impact
|
|
170
|
+
→ Knowledge
|
|
171
|
+
→ Policy
|
|
172
|
+
→ Change
|
|
173
|
+
→ Verification
|
|
174
|
+
→ Evidence
|
|
175
|
+
```
|
|
84
176
|
|
|
85
|
-
|
|
86
|
-
| --------------------------------------------------------------------------------- | ---------------------------------------------------------- |
|
|
87
|
-
| Safety scan / Safe Fix / verify / policy gates | Exit codes and CI Action preserved |
|
|
88
|
-
| Agent adapters (Cursor, Claude Code, Codex, Copilot, Windsurf, Gemini CLI, Aider) | Detect + rules; Safe Fix where official ignore/deny exists |
|
|
89
|
-
| Project Brain store + Brain MCP tool names (`brain_*`) | STDIO MCP; `--root` required |
|
|
177
|
+
That combination is the product direction. It does not mean every layer is equally mature — see the capability map and limitations.
|
|
90
178
|
|
|
91
|
-
|
|
179
|
+
---
|
|
92
180
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
181
|
+
## Architecture
|
|
182
|
+
|
|
183
|
+
```text
|
|
184
|
+
AgentDoctor
|
|
185
|
+
│
|
|
186
|
+
├── Repository Intelligence
|
|
187
|
+
│ ├── AST (TS/JS)
|
|
188
|
+
│ ├── Graph
|
|
189
|
+
│ ├── Git
|
|
190
|
+
│ └── Impact
|
|
191
|
+
│
|
|
192
|
+
├── Engineering Knowledge
|
|
193
|
+
│ ├── Brain
|
|
194
|
+
│ ├── Governance
|
|
195
|
+
│ └── Provenance
|
|
196
|
+
│
|
|
197
|
+
├── Safety
|
|
198
|
+
│ ├── Scanner
|
|
199
|
+
│ ├── Safe Fix
|
|
200
|
+
│ ├── Secrets
|
|
201
|
+
│ └── Policies
|
|
202
|
+
│
|
|
203
|
+
├── Agent Interface
|
|
204
|
+
│ ├── MCP (brain-mcp / mcp)
|
|
205
|
+
│ ├── CLI
|
|
206
|
+
│ ├── API / dashboard
|
|
207
|
+
│ └── Adapters
|
|
208
|
+
│
|
|
209
|
+
└── Verification
|
|
210
|
+
├── Tests
|
|
211
|
+
├── Reports
|
|
212
|
+
└── Release validation
|
|
213
|
+
```
|
|
104
214
|
|
|
105
|
-
|
|
215
|
+
Code layout: `src/{intelligence,knowledge,core,mcp,platform,enforcement,cli}/`
|
|
106
216
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
217
|
+
Canonical docs: [docs/2.0/overview/architecture.md](docs/2.0/overview/architecture.md)
|
|
218
|
+
|
|
219
|
+
---
|
|
110
220
|
|
|
111
|
-
|
|
221
|
+
## Engineering principles
|
|
112
222
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
223
|
+
1. Evidence over assumptions
|
|
224
|
+
2. Explicit limitations over inflated claims
|
|
225
|
+
3. Safety before automation
|
|
226
|
+
4. Repository context over isolated files
|
|
227
|
+
5. Human approval for governed decisions
|
|
228
|
+
6. Backwards compatibility where documented
|
|
229
|
+
7. Reproducible verification
|
|
230
|
+
8. Explainable agent actions
|
|
231
|
+
9. Least privilege
|
|
232
|
+
10. Secure defaults
|
|
120
233
|
|
|
121
234
|
---
|
|
122
235
|
|
|
123
|
-
##
|
|
236
|
+
## Install
|
|
124
237
|
|
|
125
|
-
|
|
238
|
+
Requires **Node.js 20+**.
|
|
126
239
|
|
|
127
240
|
```bash
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
agentdoctor
|
|
241
|
+
npm install -g @praneeth_54/agentdoctor@2.1.0
|
|
242
|
+
# or:
|
|
243
|
+
npx @praneeth_54/agentdoctor@2.1.0 --help
|
|
131
244
|
```
|
|
132
245
|
|
|
133
|
-
|
|
246
|
+
From source:
|
|
134
247
|
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
248
|
+
```bash
|
|
249
|
+
git clone https://github.com/pranee54/AgentDoctor.git
|
|
250
|
+
cd AgentDoctor
|
|
251
|
+
npm install
|
|
252
|
+
npm run verify
|
|
140
253
|
```
|
|
141
254
|
|
|
142
255
|
---
|
|
143
256
|
|
|
144
|
-
##
|
|
145
|
-
|
|
146
|
-
`agentdoctor init` writes **PROPOSED** artifacts under `.agentdoctor/repository-brain/proposals/`. They are **not** facts until a human reviews them.
|
|
257
|
+
## Quickstart
|
|
147
258
|
|
|
148
259
|
```bash
|
|
149
|
-
agentdoctor
|
|
150
|
-
agentdoctor
|
|
151
|
-
agentdoctor
|
|
260
|
+
agentdoctor --version # 2.1.0
|
|
261
|
+
agentdoctor scan .
|
|
262
|
+
agentdoctor scan . --json
|
|
263
|
+
agentdoctor fix --dry-run
|
|
264
|
+
agentdoctor verify --baseline agentdoctor-report.json
|
|
265
|
+
|
|
266
|
+
# Repository Brain proposals (not auto-approved)
|
|
267
|
+
agentdoctor init --name "My App" --domain "payments"
|
|
268
|
+
agentdoctor brain proposals
|
|
269
|
+
|
|
270
|
+
# Intelligence
|
|
271
|
+
agentdoctor graph --mode auto --json
|
|
272
|
+
agentdoctor impact --json
|
|
273
|
+
agentdoctor c4 --json
|
|
274
|
+
|
|
275
|
+
# Change assurance
|
|
276
|
+
agentdoctor change analyze
|
|
277
|
+
agentdoctor change verify
|
|
278
|
+
agentdoctor change explain|diff|status
|
|
279
|
+
agentdoctor evidence inspect <id>
|
|
280
|
+
agentdoctor evidence verify <id>
|
|
281
|
+
agentdoctor proof build|inspect|verify|export <id>
|
|
282
|
+
|
|
283
|
+
# Architecture / policy / controlled run
|
|
284
|
+
agentdoctor architecture init|check|explain
|
|
285
|
+
agentdoctor policy check|explain --command "npm test"
|
|
286
|
+
agentdoctor run explain --command "npm test"
|
|
287
|
+
agentdoctor workspace create|add|list|status|remove
|
|
288
|
+
|
|
289
|
+
# MCP (absolute --root required)
|
|
290
|
+
agentdoctor brain-mcp --root /ABS/PATH/TO/REPO
|
|
291
|
+
agentdoctor mcp --root /ABS/PATH/TO/REPO
|
|
152
292
|
```
|
|
153
293
|
|
|
154
|
-
|
|
294
|
+
### Project AI Agent (2.1 — optional; local RC)
|
|
155
295
|
|
|
156
|
-
|
|
296
|
+
Requires an explicit provider (`AGENTDOCTOR_AI_PROVIDER=mock` or openai-compatible / ollama). Default `none` fails closed for chat.
|
|
157
297
|
|
|
158
|
-
|
|
298
|
+
```bash
|
|
299
|
+
agentdoctor ask "How does login work?" .
|
|
300
|
+
agentdoctor chat .
|
|
301
|
+
agentdoctor learn .
|
|
302
|
+
agentdoctor learn --viva
|
|
303
|
+
agentdoctor plan "Add registration"
|
|
304
|
+
# Writes require --approve; model cannot self-approve
|
|
305
|
+
agentdoctor agent --goal "Add registration" --approve --apply --apply-ops '[...]' .
|
|
306
|
+
```
|
|
159
307
|
|
|
160
|
-
|
|
161
|
-
- **Git intelligence** — recent-window hotspots / co-change heuristics with method disclosure (`health`).
|
|
162
|
-
- **C4 views** — inferred diagrams (`c4`); label them proposed/inferred.
|
|
163
|
-
- **Impact** — change/test/refactor blast-radius helpers (`impact`, `refactor-impact`).
|
|
308
|
+
Details: [docs/RELEASE_2_1_0.md](docs/RELEASE_2_1_0.md) · [docs/AI_AGENT.md](docs/AI_AGENT.md) · [docs/SECURITY_AGENT.md](docs/SECURITY_AGENT.md)
|
|
164
309
|
|
|
165
|
-
|
|
310
|
+
CLI reference: [docs/2.0/guides/cli.md](docs/2.0/guides/cli.md) · Change assurance: [docs/2.0.1/change-assurance.md](docs/2.0.1/change-assurance.md)
|
|
166
311
|
|
|
167
312
|
---
|
|
168
313
|
|
|
169
|
-
##
|
|
314
|
+
## Project AI Agent (2.1)
|
|
315
|
+
|
|
316
|
+
Optional Project AI on top of the 2.0.1 assurance substrate. See [docs/RELEASE_2_1_0.md](docs/RELEASE_2_1_0.md).
|
|
170
317
|
|
|
171
|
-
|
|
318
|
+
| Piece | Behavior |
|
|
319
|
+
| --------- | ------------------------------------------------------------------------- |
|
|
320
|
+
| Context | Project evidence with truth labels; repository text is untrusted DATA |
|
|
321
|
+
| Tools | Path-safe read/write; commands only via controlled runner (`shell=false`) |
|
|
322
|
+
| Approvals | Human/caller `--approve` required for writes; LEARN mode cannot write |
|
|
323
|
+
| Verify | Change / evidence / proof signals; `ENGINEERING_CORRECTNESS_NOT_CLAIMED` |
|
|
324
|
+
| Limits | Tool calls, iterations, wall time, files modified, context size |
|
|
172
325
|
|
|
173
|
-
|
|
326
|
+
Limitations: not an OS sandbox; native Anthropic/Gemini SDKs not implemented; MCP `approved=true` is trusted-caller input (not cryptographic identity); correctness never guaranteed.
|
|
174
327
|
|
|
175
328
|
---
|
|
176
329
|
|
|
177
|
-
##
|
|
330
|
+
## Change assurance
|
|
331
|
+
|
|
332
|
+
Structured assessment, evidence bundles, and Change Proof **integrity** (not engineering correctness). Optional `--coverage` for coverage-backed / hybrid test impact. See [docs/2.0.1/FINAL_COMPLETION_AUDIT.md](docs/2.0.1/FINAL_COMPLETION_AUDIT.md).
|
|
178
333
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
334
|
+
```bash
|
|
335
|
+
agentdoctor change analyze # ChangeAssessment (verificationStatus: not-run)
|
|
336
|
+
agentdoctor change verify # write .agentdoctor/evidence/<id>/ (evidence-produced)
|
|
337
|
+
agentdoctor change explain|diff|status
|
|
338
|
+
agentdoctor evidence inspect <id> # list artifacts + manifest
|
|
339
|
+
agentdoctor evidence verify <id> # SHA-256 check; verified only if all hashes match
|
|
340
|
+
agentdoctor proof inspect|verify <id> # integrity; correctnessStatus always NOT_CLAIMED
|
|
341
|
+
```
|
|
184
342
|
|
|
185
|
-
|
|
343
|
+
`verified` means artifact integrity against the manifest — not that the change is correct or safe. Details: [docs/2.0.1/change-assurance.md](docs/2.0.1/change-assurance.md) · [docs/2.0.1/evidence.md](docs/2.0.1/evidence.md)
|
|
186
344
|
|
|
187
345
|
---
|
|
188
346
|
|
|
189
347
|
## MCP
|
|
190
348
|
|
|
191
|
-
|
|
192
|
-
| ------------------------------------- | ---------- | -------------------------- |
|
|
193
|
-
| `agentdoctor brain-mcp --root <path>` | Brain only | Stable `brain_*` names |
|
|
194
|
-
| `agentdoctor mcp --root <path>` | Combined | Brain + intelligence tools |
|
|
349
|
+
AgentDoctor exposes local **STDIO** MCP servers (no API key).
|
|
195
350
|
|
|
196
|
-
|
|
351
|
+
| Server | Command | Tools |
|
|
352
|
+
| ------------ | ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
353
|
+
| Brain MCP | `agentdoctor brain-mcp --root <abs>` | `brain_overview`, `brain_query`, `brain_explain`, `brain_trace`, `brain_claims`, `brain_evidence`, `brain_ownership`, `brain_risk`, `brain_delta`, `brain_snapshot` |
|
|
354
|
+
| Combined MCP | `agentdoctor mcp --root <abs>` | All `brain_*` tools **plus** intelligence tools below |
|
|
355
|
+
|
|
356
|
+
Intelligence tools (combined MCP):
|
|
357
|
+
`repo_overview`, `codebase_search`, `symbol_lookup`, `dependency_lookup`, `call_graph_lookup`, `test_impact`, `refactor_impact`, `code_health`, `architecture_info`, `architecture_check`, `knowledge_retrieve`, `policy_evaluate`, `change_analyze`, `proof_inspect`, `evidence_inspect`, `graph_query`
|
|
358
|
+
|
|
359
|
+
Guide: [docs/2.0/guides/mcp.md](docs/2.0/guides/mcp.md) · Deep Brain MCP: [docs/mcp/brain-mcp.md](docs/mcp/brain-mcp.md)
|
|
197
360
|
|
|
198
361
|
---
|
|
199
362
|
|
|
200
|
-
##
|
|
363
|
+
## GitHub Action
|
|
201
364
|
|
|
202
|
-
|
|
203
|
-
- HTTP API (local dashboard): [docs/2.0/guides/api.md](docs/2.0/guides/api.md)
|
|
204
|
-
- Dashboard defaults to `127.0.0.1`; `?user=` role selection is **not** authentication
|
|
365
|
+
Use AgentDoctor Safety in CI for scan / verify gates. Default npm version input is **`2.1.0`**.
|
|
205
366
|
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
|
|
367
|
+
```yaml
|
|
368
|
+
- uses: pranee54/AgentDoctor@v2.1.0
|
|
369
|
+
with:
|
|
370
|
+
path: .
|
|
371
|
+
version: "2.1.0"
|
|
372
|
+
fail-on-severity: critical
|
|
209
373
|
```
|
|
210
374
|
|
|
375
|
+
For repository CI against the checked-out build: `version: workspace` (requires `dist/` from `npm run build`).
|
|
376
|
+
|
|
377
|
+
Guide: [docs/2.0/guides/github-action.md](docs/2.0/guides/github-action.md) · Action metadata: [`action.yml`](action.yml)
|
|
378
|
+
|
|
379
|
+
Marketplace listing: confirm in the GitHub UI if you need Marketplace discovery beyond the Action in this repository.
|
|
380
|
+
|
|
211
381
|
---
|
|
212
382
|
|
|
213
|
-
##
|
|
383
|
+
## Security model
|
|
214
384
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
385
|
+
| Control | Behavior |
|
|
386
|
+
| ----------- | -------------------------------------------------------------------------- |
|
|
387
|
+
| Path safety | MCP / dashboard reject traversal, encoded escapes, hostile URLs |
|
|
388
|
+
| Safe Fix | Preflight targets; refuse symlink write-through / non-allowlisted paths |
|
|
389
|
+
| Secrets | Opt-in scan; findings and exports redact sensitive patterns |
|
|
390
|
+
| Policy | Evaluate-only by default (`executionResult: "not-executed"`) |
|
|
391
|
+
| Enforcement | Controlled runner blocks; does **not** claim IDE interception |
|
|
392
|
+
| Dashboard | Loopback by default; non-loopback requires explicit opt-in |
|
|
393
|
+
| Team auth | Local-dev scrypt + optional OIDC JWT validation — **not** full browser SSO |
|
|
219
394
|
|
|
220
|
-
|
|
395
|
+
Threat model: [docs/2.0/overview/security-threat-model.md](docs/2.0/overview/security-threat-model.md) · Trust boundaries: [docs/2.0/overview/trust-boundaries.md](docs/2.0/overview/trust-boundaries.md)
|
|
221
396
|
|
|
222
397
|
---
|
|
223
398
|
|
|
224
|
-
##
|
|
399
|
+
## What AgentDoctor does not do
|
|
225
400
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
9. Deep 2.0 audits and readiness reports live on GitHub under [docs/2.0/](docs/2.0/README.md) (not inside the npm tarball — packaging Option B).
|
|
401
|
+
- Full browser OAuth / production IdP login UX (JWT validation library path exists; redirect flow is experimental)
|
|
402
|
+
- Complete multi-language AST (Java / Kotlin / Rust / Dart / Go extractors external or unsupported)
|
|
403
|
+
- Coverage as universal ground truth without a coverage file / test map
|
|
404
|
+
- IDE / agent process interception (external host APIs)
|
|
405
|
+
- Production multi-tenant cloud / managed hosting in this package
|
|
406
|
+
- Guaranteed autonomous command execution of “allowed” policies
|
|
407
|
+
- Treating inferred C4 / heuristic impact as approved architecture truth
|
|
408
|
+
- Shipping full `docs/2.0.1/` inside the npm tarball (Option B: README + GitHub docs)
|
|
235
409
|
|
|
236
|
-
Full list: [docs/2.0/overview/known-limitations.md](docs/2.0/overview/known-limitations.md)
|
|
410
|
+
Full list: [docs/2.0.1/limitations.md](docs/2.0.1/limitations.md) · [docs/2.0/overview/known-limitations.md](docs/2.0/overview/known-limitations.md)
|
|
237
411
|
|
|
238
412
|
---
|
|
239
413
|
|
|
240
|
-
##
|
|
414
|
+
## Roadmap note: Change Proof
|
|
415
|
+
|
|
416
|
+
Change assessment, evidence, and proof **integrity** shipped in 2.0.1. `correctnessStatus` is always `ENGINEERING_CORRECTNESS_NOT_CLAIMED`. Broader compliance / team-scale proof UX remains planned.
|
|
241
417
|
|
|
242
|
-
|
|
243
|
-
- Additive 2.0 commands do not remove 1.x workflows.
|
|
244
|
-
- Migration notes: [docs/2.0/guides/migration.md](docs/2.0/guides/migration.md).
|
|
418
|
+
See [ROADMAP.md](ROADMAP.md) · [docs/2.0.1/limitations.md](docs/2.0.1/limitations.md) · [docs/2.0.1/FINAL_COMPLETION_AUDIT.md](docs/2.0.1/FINAL_COMPLETION_AUDIT.md).
|
|
245
419
|
|
|
246
420
|
---
|
|
247
421
|
|
|
248
422
|
## Documentation map
|
|
249
423
|
|
|
250
|
-
|
|
|
251
|
-
|
|
|
252
|
-
| 2.0
|
|
253
|
-
|
|
|
254
|
-
|
|
|
255
|
-
|
|
|
256
|
-
|
|
|
257
|
-
| Contributing
|
|
424
|
+
| Audience | Start here |
|
|
425
|
+
| -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
|
|
426
|
+
| Product / 2.0.1 | [docs/2.0.1/README.md](docs/2.0.1/README.md) |
|
|
427
|
+
| Product / 2.0 | [docs/2.0/README.md](docs/2.0/README.md) |
|
|
428
|
+
| Capabilities / readiness | [capabilities](docs/2.0/overview/capabilities.md) · [readiness](docs/2.0/overview/readiness-matrix.md) |
|
|
429
|
+
| Guides | [docs/2.0/guides/](docs/2.0/guides/) |
|
|
430
|
+
| Reference (rules, scoring, exit codes) | [docs/reference/](docs/reference/) |
|
|
431
|
+
| Contributing | [CONTRIBUTING.md](CONTRIBUTING.md) · [docs/development/development.md](docs/development/development.md) |
|
|
432
|
+
| Changelog | [CHANGELOG.md](CHANGELOG.md) |
|
|
433
|
+
| Release evidence | [FINAL_RELEASE_AUDIT](docs/2.0.1/FINAL_RELEASE_AUDIT.md) · [FINAL_COMPLETION_AUDIT](docs/2.0.1/FINAL_COMPLETION_AUDIT.md) |
|
|
258
434
|
|
|
259
435
|
---
|
|
260
436
|
|
|
261
437
|
## Contributing
|
|
262
438
|
|
|
263
|
-
See [CONTRIBUTING.md](CONTRIBUTING.md) and
|
|
439
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md). Prefer evidence-backed PRs, honest status labels, and no inflated capability claims.
|
|
264
440
|
|
|
265
441
|
---
|
|
266
442
|
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { AgentRiskLevel, AgentToolName } from "./tools/types.js";
|
|
2
|
+
export type ApprovalDecision = "allow" | "deny" | "require-approval";
|
|
3
|
+
export interface ApprovalRequest {
|
|
4
|
+
action: string;
|
|
5
|
+
risk: AgentRiskLevel;
|
|
6
|
+
toolName?: AgentToolName;
|
|
7
|
+
detail?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ApprovalResult {
|
|
10
|
+
decision: ApprovalDecision;
|
|
11
|
+
risk: AgentRiskLevel;
|
|
12
|
+
reason: string;
|
|
13
|
+
/** True when a human must confirm before continuing */
|
|
14
|
+
needsHumanApproval: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Risk-based approval gate. The model cannot approve its own actions.
|
|
18
|
+
* Human approval is represented by an explicit `approvedByHuman` flag from CLI/UI.
|
|
19
|
+
*/
|
|
20
|
+
export declare function evaluateApproval(request: ApprovalRequest, options?: {
|
|
21
|
+
approvedByHuman?: boolean;
|
|
22
|
+
allowAutoLow?: boolean;
|
|
23
|
+
}): ApprovalResult;
|
|
24
|
+
export declare function formatApprovalPrompt(request: ApprovalRequest, result: ApprovalResult): string;
|