@praneeth_54/agentdoctor 2.0.0 → 2.0.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.
- package/CHANGELOG.md +73 -4
- package/README.md +283 -158
- 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/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/complete.js +2 -2
- 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 +535 -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 +1 -1
- package/dist/dashboard/server.js +21 -5
- package/dist/enforcement/runner.d.ts +47 -3
- package/dist/enforcement/runner.js +420 -16
- package/dist/index.d.ts +23 -2
- package/dist/index.js +15 -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 +45 -0
- package/dist/languages/index.d.ts +11 -0
- package/dist/languages/index.js +76 -0
- package/dist/languages/php.d.ts +7 -0
- package/dist/languages/php.js +193 -0
- package/dist/languages/python.d.ts +7 -0
- package/dist/languages/python.js +150 -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/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 +105 -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,391 @@
|
|
|
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
|
-
**
|
|
12
|
+
**In-repo cut:** `2.0.1` (publish pending human authorization). Last published: [`@praneeth_54/agentdoctor@2.0.0`](https://www.npmjs.com/package/@praneeth_54/agentdoctor)
|
|
13
13
|
|
|
14
|
-
[
|
|
14
|
+
[Install](#install) · [Quickstart](#quickstart) · [Change assurance](#change-assurance) · [Documentation](docs/2.0.1/README.md) · [MCP](#mcp) · [GitHub Action](#github-action) · [Architecture](#architecture)
|
|
15
15
|
|
|
16
16
|
---
|
|
17
17
|
|
|
18
|
-
## What AgentDoctor
|
|
18
|
+
## What AgentDoctor is
|
|
19
19
|
|
|
20
|
-
AgentDoctor
|
|
20
|
+
AgentDoctor sits between developers / AI coding agents and the repository’s engineering reality.
|
|
21
21
|
|
|
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.
|
|
22
|
+
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
23
|
|
|
26
|
-
|
|
24
|
+
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
25
|
|
|
28
|
-
|
|
26
|
+
It is **not** an autonomous coding agent, chatbot, or IDE interceptor. It does **not** guarantee correctness. It produces **evidence and controls** you can inspect.
|
|
29
27
|
|
|
30
|
-
|
|
28
|
+
**Short description:** Engineering assurance for AI coding agents — repository intelligence, change evidence, safety controls, and MCP tools.
|
|
31
29
|
|
|
32
|
-
|
|
33
|
-
npm install -g @praneeth_54/agentdoctor
|
|
34
|
-
# or
|
|
35
|
-
npx @praneeth_54/agentdoctor --help
|
|
36
|
-
```
|
|
30
|
+
---
|
|
37
31
|
|
|
38
|
-
|
|
32
|
+
## Why AgentDoctor?
|
|
33
|
+
|
|
34
|
+
Modern AI coding agents can:
|
|
35
|
+
|
|
36
|
+
- read individual files
|
|
37
|
+
- generate and edit code
|
|
38
|
+
- run tests when asked
|
|
39
|
+
|
|
40
|
+
Repository-level context is usually fragmented across:
|
|
41
|
+
|
|
42
|
+
| Signal | Typical location |
|
|
43
|
+
| ------------------ | ------------------------------ |
|
|
44
|
+
| Source structure | AST / imports / modules |
|
|
45
|
+
| Dependencies | manifests / lockfiles |
|
|
46
|
+
| History | Git |
|
|
47
|
+
| Architecture | docs / conventions / inference |
|
|
48
|
+
| Tests | test trees / naming heuristics |
|
|
49
|
+
| Policy | CI rules / allowlists |
|
|
50
|
+
| Decisions | ADRs / RFCs / tribal knowledge |
|
|
51
|
+
| Secrets / exposure | config files / ignore rules |
|
|
52
|
+
|
|
53
|
+
AgentDoctor brings those signals into one local toolchain around an AI-driven engineering change:
|
|
54
|
+
|
|
55
|
+
```text
|
|
56
|
+
Developer / AI Agent
|
|
57
|
+
│
|
|
58
|
+
▼
|
|
59
|
+
AgentDoctor
|
|
60
|
+
│
|
|
61
|
+
┌───────────────────────────────┐
|
|
62
|
+
│ Repository Intelligence │
|
|
63
|
+
│ AST / Graph / Git / Impact │
|
|
64
|
+
├───────────────────────────────┤
|
|
65
|
+
│ Engineering Knowledge │
|
|
66
|
+
│ Brain / Decisions / Provenance│
|
|
67
|
+
├───────────────────────────────┤
|
|
68
|
+
│ Safety & Policy │
|
|
69
|
+
│ Scan / Fix / Enforce / Secrets│
|
|
70
|
+
├───────────────────────────────┤
|
|
71
|
+
│ Verification │
|
|
72
|
+
│ Tests / Reports / Evidence │
|
|
73
|
+
└───────────────────────────────┘
|
|
74
|
+
│
|
|
75
|
+
▼
|
|
76
|
+
Safer, explainable engineering decisions
|
|
77
|
+
```
|
|
39
78
|
|
|
40
79
|
---
|
|
41
80
|
|
|
42
|
-
##
|
|
81
|
+
## Capability map
|
|
43
82
|
|
|
44
|
-
|
|
45
|
-
# Safety loop
|
|
46
|
-
agentdoctor scan
|
|
47
|
-
agentdoctor fix --dry-run
|
|
48
|
-
agentdoctor verify --baseline agentdoctor-report.json
|
|
83
|
+
Status labels: **SUPPORTED** · **PARTIAL** · **EXPERIMENTAL** · **NOT YET SUPPORTED**
|
|
49
84
|
|
|
50
|
-
|
|
51
|
-
agentdoctor init --name "My App" --domain "payments"
|
|
52
|
-
agentdoctor brain proposals
|
|
53
|
-
agentdoctor brain review --artifact <id> --decision approved
|
|
85
|
+
Details and evidence: [docs/2.0/overview/capabilities.md](docs/2.0/overview/capabilities.md) · [readiness matrix](docs/2.0/overview/readiness-matrix.md)
|
|
54
86
|
|
|
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
|
|
87
|
+
### Repository intelligence
|
|
61
88
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
89
|
+
| Capability | Status |
|
|
90
|
+
| ---------------------------------------------------- | ------------ |
|
|
91
|
+
| TypeScript / JavaScript AST graph (+ regex fallback) | PARTIAL |
|
|
92
|
+
| Import / inferred call relationships | PARTIAL |
|
|
93
|
+
| Git hotspot / engineering intelligence | PARTIAL |
|
|
94
|
+
| Change / test / refactor impact | PARTIAL |
|
|
95
|
+
| C4-style architecture views | EXPERIMENTAL |
|
|
65
96
|
|
|
66
|
-
|
|
67
|
-
agentdoctor enforce --command "npm test" --json
|
|
97
|
+
### Engineering knowledge
|
|
68
98
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
99
|
+
| Capability | Status |
|
|
100
|
+
| ------------------------------------------------------------- | --------- |
|
|
101
|
+
| Project Brain store + evidence-backed claims | SUPPORTED |
|
|
102
|
+
| Repository Brain init / proposal review (never auto-approved) | PARTIAL |
|
|
103
|
+
| Governed knowledge + abstention on retrieve | PARTIAL |
|
|
104
|
+
| Provenance envelopes on Brain MCP tools | SUPPORTED |
|
|
72
105
|
|
|
73
|
-
|
|
74
|
-
agentdoctor dashboard
|
|
75
|
-
```
|
|
106
|
+
### Agent interfaces
|
|
76
107
|
|
|
77
|
-
|
|
108
|
+
| Capability | Status |
|
|
109
|
+
| --------------------------------------------------------------------------------- | --------- |
|
|
110
|
+
| Brain MCP (`brain_*` tools, STDIO) | SUPPORTED |
|
|
111
|
+
| Combined MCP (Brain + intelligence tools) | PARTIAL |
|
|
112
|
+
| Agent adapters (Cursor, Claude Code, Codex, Copilot, Windsurf, Gemini CLI, Aider) | SUPPORTED |
|
|
113
|
+
| Local dashboard + `/api/v2/*` | PARTIAL |
|
|
114
|
+
| Programmatic API (`scan`, Fix, Brain helpers) | SUPPORTED |
|
|
78
115
|
|
|
79
|
-
|
|
116
|
+
### Safety & governance
|
|
80
117
|
|
|
81
|
-
|
|
118
|
+
| Capability | Status |
|
|
119
|
+
| -------------------------------------------------------- | --------------------- |
|
|
120
|
+
| Scan → Safe Fix → Verify | SUPPORTED |
|
|
121
|
+
| Policy gates (`--min-score`, severity, rule, verify-new) | SUPPORTED |
|
|
122
|
+
| Evaluate-only policy / controlled enforcement runner | PARTIAL |
|
|
123
|
+
| Secret scan (redacted findings) + export redaction | PARTIAL |
|
|
124
|
+
| Path-safety for MCP / dashboard | PARTIAL |
|
|
125
|
+
| Local-dev team auth (scrypt) | PARTIAL — **not SSO** |
|
|
82
126
|
|
|
83
|
-
###
|
|
127
|
+
### Verification
|
|
84
128
|
|
|
85
|
-
| Capability
|
|
86
|
-
|
|
|
87
|
-
|
|
|
88
|
-
|
|
|
89
|
-
|
|
|
129
|
+
| Capability | Status |
|
|
130
|
+
| ------------------------------------------------------- | -------------------------- |
|
|
131
|
+
| Change assurance assessment + evidence bundles | PARTIAL |
|
|
132
|
+
| Evidence hash verify (`verified` = integrity only) | SUPPORTED |
|
|
133
|
+
| Unit / integration / MCP STDIO tests (`npm run verify`) | SUPPORTED |
|
|
134
|
+
| Packed CLI clean-install smoke | SUPPORTED |
|
|
135
|
+
| Reproducible AST perf harness | PARTIAL (synthetic sample) |
|
|
90
136
|
|
|
91
|
-
|
|
137
|
+
---
|
|
92
138
|
|
|
93
|
-
|
|
94
|
-
| ----------------------------------------------- | ------------------------------------------- |
|
|
95
|
-
| Repository Brain init / proposal review | `init`, `brain review`, `brain proposals` |
|
|
96
|
-
| TS/JS AST intelligence graph (+ regex fallback) | `graph` |
|
|
97
|
-
| Git hotspots / bus-factor style metrics | `health` (method disclosed per metric) |
|
|
98
|
-
| Impact / test-impact / refactor-impact | `impact`, `test-impact`, `refactor-impact` |
|
|
99
|
-
| Knowledge governance + abstention | `knowledge*`; MCP `knowledge_retrieve` |
|
|
100
|
-
| Policy packs + controlled enforcement runner | `enforce`, `platform policy-check` |
|
|
101
|
-
| Combined MCP (`agentdoctor mcp`) | Brain + intelligence tools |
|
|
102
|
-
| Dashboard + `/api/v2/*` | `dashboard` (loopback default) |
|
|
103
|
-
| Local-dev team auth (scrypt) | `team-register`, `team-login` — **not SSO** |
|
|
139
|
+
## How AgentDoctor is different
|
|
104
140
|
|
|
105
|
-
|
|
141
|
+
Most engineering tools optimize one layer: static analysis, search, docs generation, dashboards, security scanners, or AI chat.
|
|
106
142
|
|
|
107
|
-
|
|
108
|
-
| -------------- | --------------------------------------------------------------------------------- |
|
|
109
|
-
| C4-style views | `c4` — **inferred/proposed** from graph evidence, not approved architecture truth |
|
|
143
|
+
AgentDoctor is designed around the **lifecycle of an AI-driven change**:
|
|
110
144
|
|
|
111
|
-
|
|
145
|
+
```text
|
|
146
|
+
Repository
|
|
147
|
+
→ Understand
|
|
148
|
+
→ Impact
|
|
149
|
+
→ Knowledge
|
|
150
|
+
→ Policy
|
|
151
|
+
→ Change
|
|
152
|
+
→ Verification
|
|
153
|
+
→ Evidence
|
|
154
|
+
```
|
|
112
155
|
|
|
113
|
-
|
|
114
|
-
| ------------------------------------------------ | -------------------------------------------------- |
|
|
115
|
-
| Enterprise SSO / IdP | Not bundled |
|
|
116
|
-
| Production SQLite / Postgres / vector search | Flags off / stub only |
|
|
117
|
-
| Full multi-language AST (Python, Go, …) | Unsupported |
|
|
118
|
-
| Direct IDE interception / agent process blocking | Unsupported |
|
|
119
|
-
| Coverage-backed test selection as ground truth | Not bundled (test-impact is heuristic/graph-based) |
|
|
156
|
+
That combination is the product direction. It does not mean every layer is equally mature — see the capability map and limitations.
|
|
120
157
|
|
|
121
158
|
---
|
|
122
159
|
|
|
123
|
-
##
|
|
160
|
+
## Architecture
|
|
161
|
+
|
|
162
|
+
```text
|
|
163
|
+
AgentDoctor
|
|
164
|
+
│
|
|
165
|
+
├── Repository Intelligence
|
|
166
|
+
│ ├── AST (TS/JS)
|
|
167
|
+
│ ├── Graph
|
|
168
|
+
│ ├── Git
|
|
169
|
+
│ └── Impact
|
|
170
|
+
│
|
|
171
|
+
├── Engineering Knowledge
|
|
172
|
+
│ ├── Brain
|
|
173
|
+
│ ├── Governance
|
|
174
|
+
│ └── Provenance
|
|
175
|
+
│
|
|
176
|
+
├── Safety
|
|
177
|
+
│ ├── Scanner
|
|
178
|
+
│ ├── Safe Fix
|
|
179
|
+
│ ├── Secrets
|
|
180
|
+
│ └── Policies
|
|
181
|
+
│
|
|
182
|
+
├── Agent Interface
|
|
183
|
+
│ ├── MCP (brain-mcp / mcp)
|
|
184
|
+
│ ├── CLI
|
|
185
|
+
│ ├── API / dashboard
|
|
186
|
+
│ └── Adapters
|
|
187
|
+
│
|
|
188
|
+
└── Verification
|
|
189
|
+
├── Tests
|
|
190
|
+
├── Reports
|
|
191
|
+
└── Release validation
|
|
192
|
+
```
|
|
124
193
|
|
|
125
|
-
|
|
194
|
+
Code layout: `src/{intelligence,knowledge,core,mcp,platform,enforcement,cli}/`
|
|
126
195
|
|
|
127
|
-
|
|
128
|
-
agentdoctor scan --json
|
|
129
|
-
agentdoctor fix -y
|
|
130
|
-
agentdoctor verify --baseline agentdoctor-report.json
|
|
131
|
-
```
|
|
196
|
+
Canonical docs: [docs/2.0/overview/architecture.md](docs/2.0/overview/architecture.md)
|
|
132
197
|
|
|
133
|
-
|
|
198
|
+
---
|
|
134
199
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
200
|
+
## Engineering principles
|
|
201
|
+
|
|
202
|
+
1. Evidence over assumptions
|
|
203
|
+
2. Explicit limitations over inflated claims
|
|
204
|
+
3. Safety before automation
|
|
205
|
+
4. Repository context over isolated files
|
|
206
|
+
5. Human approval for governed decisions
|
|
207
|
+
6. Backwards compatibility where documented
|
|
208
|
+
7. Reproducible verification
|
|
209
|
+
8. Explainable agent actions
|
|
210
|
+
9. Least privilege
|
|
211
|
+
10. Secure defaults
|
|
141
212
|
|
|
142
213
|
---
|
|
143
214
|
|
|
144
|
-
##
|
|
215
|
+
## Install
|
|
145
216
|
|
|
146
|
-
|
|
217
|
+
Requires **Node.js 20+**.
|
|
147
218
|
|
|
148
219
|
```bash
|
|
149
|
-
|
|
150
|
-
agentdoctor
|
|
151
|
-
|
|
220
|
+
# Local/RC version is 2.0.1; npm registry may still show 2.0.0 until published.
|
|
221
|
+
npm install -g @praneeth_54/agentdoctor@2.0.1 # after publish
|
|
222
|
+
# or from a packed tarball / this repo:
|
|
223
|
+
# npm install /path/to/praneeth_54-agentdoctor-2.0.1.tgz
|
|
224
|
+
npx @praneeth_54/agentdoctor@2.0.1 --help # after publish
|
|
152
225
|
```
|
|
153
226
|
|
|
154
|
-
|
|
227
|
+
From source:
|
|
155
228
|
|
|
156
|
-
|
|
229
|
+
```bash
|
|
230
|
+
git clone https://github.com/pranee54/AgentDoctor.git
|
|
231
|
+
cd AgentDoctor
|
|
232
|
+
npm install
|
|
233
|
+
npm run verify
|
|
234
|
+
```
|
|
157
235
|
|
|
158
|
-
|
|
236
|
+
---
|
|
159
237
|
|
|
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`).
|
|
238
|
+
## Quickstart
|
|
164
239
|
|
|
165
|
-
|
|
240
|
+
```bash
|
|
241
|
+
agentdoctor --version # 2.0.1
|
|
242
|
+
agentdoctor scan .
|
|
243
|
+
agentdoctor scan . --json
|
|
244
|
+
agentdoctor fix --dry-run
|
|
245
|
+
agentdoctor verify --baseline agentdoctor-report.json
|
|
166
246
|
|
|
167
|
-
|
|
247
|
+
# Repository Brain proposals (not auto-approved)
|
|
248
|
+
agentdoctor init --name "My App" --domain "payments"
|
|
249
|
+
agentdoctor brain proposals
|
|
168
250
|
|
|
169
|
-
|
|
251
|
+
# Intelligence
|
|
252
|
+
agentdoctor graph --mode auto --json
|
|
253
|
+
agentdoctor impact --json
|
|
254
|
+
agentdoctor c4 --json
|
|
170
255
|
|
|
171
|
-
|
|
256
|
+
# Change assurance
|
|
257
|
+
agentdoctor change analyze
|
|
258
|
+
agentdoctor change verify
|
|
259
|
+
agentdoctor change explain|diff|status
|
|
260
|
+
agentdoctor evidence inspect <id>
|
|
261
|
+
agentdoctor evidence verify <id>
|
|
262
|
+
agentdoctor proof build|inspect|verify|export <id>
|
|
263
|
+
|
|
264
|
+
# Architecture / policy / controlled run
|
|
265
|
+
agentdoctor architecture init|check|explain
|
|
266
|
+
agentdoctor policy check|explain --command "npm test"
|
|
267
|
+
agentdoctor run explain --command "npm test"
|
|
268
|
+
agentdoctor workspace create|add|list|status|remove
|
|
269
|
+
|
|
270
|
+
# MCP (absolute --root required)
|
|
271
|
+
agentdoctor brain-mcp --root /ABS/PATH/TO/REPO
|
|
272
|
+
agentdoctor mcp --root /ABS/PATH/TO/REPO
|
|
273
|
+
```
|
|
172
274
|
|
|
173
|
-
|
|
275
|
+
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)
|
|
174
276
|
|
|
175
277
|
---
|
|
176
278
|
|
|
177
|
-
##
|
|
279
|
+
## Change assurance
|
|
280
|
+
|
|
281
|
+
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
282
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
283
|
+
```bash
|
|
284
|
+
agentdoctor change analyze # ChangeAssessment (verificationStatus: not-run)
|
|
285
|
+
agentdoctor change verify # write .agentdoctor/evidence/<id>/ (evidence-produced)
|
|
286
|
+
agentdoctor change explain|diff|status
|
|
287
|
+
agentdoctor evidence inspect <id> # list artifacts + manifest
|
|
288
|
+
agentdoctor evidence verify <id> # SHA-256 check; verified only if all hashes match
|
|
289
|
+
agentdoctor proof inspect|verify <id> # integrity; correctnessStatus always NOT_CLAIMED
|
|
290
|
+
```
|
|
184
291
|
|
|
185
|
-
|
|
292
|
+
`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
293
|
|
|
187
294
|
---
|
|
188
295
|
|
|
189
296
|
## MCP
|
|
190
297
|
|
|
191
|
-
|
|
192
|
-
| ------------------------------------- | ---------- | -------------------------- |
|
|
193
|
-
| `agentdoctor brain-mcp --root <path>` | Brain only | Stable `brain_*` names |
|
|
194
|
-
| `agentdoctor mcp --root <path>` | Combined | Brain + intelligence tools |
|
|
298
|
+
AgentDoctor exposes local **STDIO** MCP servers (no API key).
|
|
195
299
|
|
|
196
|
-
|
|
300
|
+
| Server | Command | Tools |
|
|
301
|
+
| ------------ | ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
302
|
+
| 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` |
|
|
303
|
+
| Combined MCP | `agentdoctor mcp --root <abs>` | All `brain_*` tools **plus** intelligence tools below |
|
|
304
|
+
|
|
305
|
+
Intelligence tools (combined MCP):
|
|
306
|
+
`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`
|
|
307
|
+
|
|
308
|
+
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
309
|
|
|
198
310
|
---
|
|
199
311
|
|
|
200
|
-
##
|
|
312
|
+
## GitHub Action
|
|
201
313
|
|
|
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
|
|
314
|
+
Use AgentDoctor Safety in CI for scan / verify gates. Default npm version input is **`2.0.1`**.
|
|
205
315
|
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
|
|
316
|
+
```yaml
|
|
317
|
+
- uses: pranee54/AgentDoctor@v2.0.1
|
|
318
|
+
with:
|
|
319
|
+
path: .
|
|
320
|
+
version: "2.0.1"
|
|
321
|
+
fail-on-severity: critical
|
|
209
322
|
```
|
|
210
323
|
|
|
324
|
+
For repository CI against the checked-out build: `version: workspace` (requires `dist/` from `npm run build`).
|
|
325
|
+
|
|
326
|
+
Guide: [docs/2.0/guides/github-action.md](docs/2.0/guides/github-action.md) · Action metadata: [`action.yml`](action.yml)
|
|
327
|
+
|
|
328
|
+
Marketplace listing: confirm in the GitHub UI if you need Marketplace discovery beyond the Action in this repository.
|
|
329
|
+
|
|
211
330
|
---
|
|
212
331
|
|
|
213
|
-
##
|
|
332
|
+
## Security model
|
|
214
333
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
334
|
+
| Control | Behavior |
|
|
335
|
+
| ----------- | -------------------------------------------------------------------------- |
|
|
336
|
+
| Path safety | MCP / dashboard reject traversal, encoded escapes, hostile URLs |
|
|
337
|
+
| Safe Fix | Preflight targets; refuse symlink write-through / non-allowlisted paths |
|
|
338
|
+
| Secrets | Opt-in scan; findings and exports redact sensitive patterns |
|
|
339
|
+
| Policy | Evaluate-only by default (`executionResult: "not-executed"`) |
|
|
340
|
+
| Enforcement | Controlled runner blocks; does **not** claim IDE interception |
|
|
341
|
+
| Dashboard | Loopback by default; non-loopback requires explicit opt-in |
|
|
342
|
+
| Team auth | Local-dev scrypt + optional OIDC JWT validation — **not** full browser SSO |
|
|
219
343
|
|
|
220
|
-
|
|
344
|
+
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
345
|
|
|
222
346
|
---
|
|
223
347
|
|
|
224
|
-
##
|
|
348
|
+
## What AgentDoctor does not do
|
|
225
349
|
|
|
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).
|
|
350
|
+
- Full browser OAuth / production IdP login UX (JWT validation library path exists; redirect flow is experimental)
|
|
351
|
+
- Complete multi-language AST (Java / Kotlin / Rust / Dart / Go extractors external or unsupported)
|
|
352
|
+
- Coverage as universal ground truth without a coverage file / test map
|
|
353
|
+
- IDE / agent process interception (external host APIs)
|
|
354
|
+
- Production multi-tenant cloud / managed hosting in this package
|
|
355
|
+
- Guaranteed autonomous command execution of “allowed” policies
|
|
356
|
+
- Treating inferred C4 / heuristic impact as approved architecture truth
|
|
357
|
+
- Shipping full `docs/2.0.1/` inside the npm tarball (Option B: README + GitHub docs)
|
|
235
358
|
|
|
236
|
-
Full list: [docs/2.0/overview/known-limitations.md](docs/2.0/overview/known-limitations.md)
|
|
359
|
+
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
360
|
|
|
238
361
|
---
|
|
239
362
|
|
|
240
|
-
##
|
|
363
|
+
## Roadmap note: Change Proof
|
|
364
|
+
|
|
365
|
+
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
366
|
|
|
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).
|
|
367
|
+
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
368
|
|
|
246
369
|
---
|
|
247
370
|
|
|
248
371
|
## Documentation map
|
|
249
372
|
|
|
250
|
-
|
|
|
251
|
-
|
|
|
252
|
-
| 2.0
|
|
253
|
-
|
|
|
254
|
-
|
|
|
255
|
-
|
|
|
256
|
-
|
|
|
257
|
-
| Contributing
|
|
373
|
+
| Audience | Start here |
|
|
374
|
+
| -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
|
|
375
|
+
| Product / 2.0.1 | [docs/2.0.1/README.md](docs/2.0.1/README.md) |
|
|
376
|
+
| Product / 2.0 | [docs/2.0/README.md](docs/2.0/README.md) |
|
|
377
|
+
| Capabilities / readiness | [capabilities](docs/2.0/overview/capabilities.md) · [readiness](docs/2.0/overview/readiness-matrix.md) |
|
|
378
|
+
| Guides | [docs/2.0/guides/](docs/2.0/guides/) |
|
|
379
|
+
| Reference (rules, scoring, exit codes) | [docs/reference/](docs/reference/) |
|
|
380
|
+
| Contributing | [CONTRIBUTING.md](CONTRIBUTING.md) · [docs/development/development.md](docs/development/development.md) |
|
|
381
|
+
| Changelog | [CHANGELOG.md](CHANGELOG.md) |
|
|
382
|
+
| 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
383
|
|
|
259
384
|
---
|
|
260
385
|
|
|
261
386
|
## Contributing
|
|
262
387
|
|
|
263
|
-
See [CONTRIBUTING.md](CONTRIBUTING.md) and
|
|
388
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md). Prefer evidence-backed PRs, honest status labels, and no inflated capability claims.
|
|
264
389
|
|
|
265
390
|
---
|
|
266
391
|
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { RepositoryGraph } from "../platform/types.js";
|
|
2
|
+
export interface ArchitectureLayer {
|
|
3
|
+
id: string;
|
|
4
|
+
paths: string[];
|
|
5
|
+
}
|
|
6
|
+
export interface ForbiddenDependency {
|
|
7
|
+
fromLayer: string;
|
|
8
|
+
toLayer: string;
|
|
9
|
+
id: string;
|
|
10
|
+
description: string;
|
|
11
|
+
}
|
|
12
|
+
export interface AllowedDependency {
|
|
13
|
+
fromLayer: string;
|
|
14
|
+
toLayer: string;
|
|
15
|
+
}
|
|
16
|
+
export interface ArchitectureContract {
|
|
17
|
+
version: "1";
|
|
18
|
+
layers: ArchitectureLayer[];
|
|
19
|
+
forbidden: ForbiddenDependency[];
|
|
20
|
+
allowed: AllowedDependency[];
|
|
21
|
+
}
|
|
22
|
+
export interface ArchitectureViolation {
|
|
23
|
+
ruleId: string;
|
|
24
|
+
kind: "forbidden" | "not-allowed";
|
|
25
|
+
description: string;
|
|
26
|
+
fromPath: string;
|
|
27
|
+
toPath: string;
|
|
28
|
+
fromLayer: string;
|
|
29
|
+
toLayer: string;
|
|
30
|
+
evidence: {
|
|
31
|
+
edgeId: string;
|
|
32
|
+
edgeKind: string;
|
|
33
|
+
evidenceKind: string;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export interface ArchitectureCheckResult {
|
|
37
|
+
root: string;
|
|
38
|
+
contractPath: string | null;
|
|
39
|
+
contract: ArchitectureContract | null;
|
|
40
|
+
violations: ArchitectureViolation[];
|
|
41
|
+
importEdgesChecked: number;
|
|
42
|
+
limitations: string[];
|
|
43
|
+
}
|
|
44
|
+
export declare const DEFAULT_ARCHITECTURE_CONTRACT: ArchitectureContract;
|
|
45
|
+
export declare function layerForPath(filePath: string, layers: ArchitectureLayer[]): string | null;
|
|
46
|
+
/**
|
|
47
|
+
* Minimal YAML subset parser for architecture contracts.
|
|
48
|
+
* Also accepts JSON content inside .yml files.
|
|
49
|
+
*/
|
|
50
|
+
export declare function parseArchitectureYamlSubset(text: string): ArchitectureContract;
|
|
51
|
+
export declare function parseArchitectureJson(text: string): ArchitectureContract;
|
|
52
|
+
export declare function loadArchitectureContract(rootInput: string): Promise<{
|
|
53
|
+
contract: ArchitectureContract;
|
|
54
|
+
path: string;
|
|
55
|
+
} | null>;
|
|
56
|
+
export declare function initArchitecture(rootInput: string): Promise<string>;
|
|
57
|
+
/**
|
|
58
|
+
* Check import edges against the architecture contract.
|
|
59
|
+
* Forbidden rules always apply. When `allowed` is non-empty, cross-layer
|
|
60
|
+
* imports not listed in allowed (and not same-layer) are reported as not-allowed.
|
|
61
|
+
*/
|
|
62
|
+
export declare function checkArchitecture(rootInput: string, graph: RepositoryGraph, contract?: ArchitectureContract | null, contractPath?: string | null): ArchitectureCheckResult;
|
|
63
|
+
export declare function checkArchitectureAtRoot(rootInput: string, graph: RepositoryGraph): Promise<ArchitectureCheckResult>;
|
|
64
|
+
export declare function explainArchitecture(contract: ArchitectureContract | null, check?: ArchitectureCheckResult | null): string;
|