@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.
Files changed (95) hide show
  1. package/CHANGELOG.md +73 -4
  2. package/README.md +283 -158
  3. package/dist/architecture/contract.d.ts +64 -0
  4. package/dist/architecture/contract.js +373 -0
  5. package/dist/assurance/change.d.ts +211 -0
  6. package/dist/assurance/change.js +624 -0
  7. package/dist/assurance/proof.d.ts +136 -0
  8. package/dist/assurance/proof.js +338 -0
  9. package/dist/auth/index.d.ts +81 -0
  10. package/dist/auth/index.js +130 -0
  11. package/dist/auth/rbac.d.ts +9 -0
  12. package/dist/auth/rbac.js +26 -0
  13. package/dist/cli/commands/architecture.d.ts +6 -0
  14. package/dist/cli/commands/architecture.js +109 -0
  15. package/dist/cli/commands/assurance.d.ts +67 -0
  16. package/dist/cli/commands/assurance.js +210 -0
  17. package/dist/cli/commands/complete.js +2 -2
  18. package/dist/cli/commands/platform.d.ts +2 -0
  19. package/dist/cli/commands/platform.js +5 -1
  20. package/dist/cli/commands/policy-graph-run.d.ts +40 -0
  21. package/dist/cli/commands/policy-graph-run.js +200 -0
  22. package/dist/cli/commands/workspace.d.ts +9 -0
  23. package/dist/cli/commands/workspace.js +82 -0
  24. package/dist/cli/program.js +535 -17
  25. package/dist/constants.d.ts +1 -1
  26. package/dist/constants.js +1 -1
  27. package/dist/contracts/index.d.ts +1 -1
  28. package/dist/contracts/index.js +2 -2
  29. package/dist/core/brain-product/init.js +5 -2
  30. package/dist/core/secrets/scan.d.ts +7 -1
  31. package/dist/core/secrets/scan.js +9 -9
  32. package/dist/coverage/cobertura.d.ts +6 -0
  33. package/dist/coverage/cobertura.js +52 -0
  34. package/dist/coverage/istanbul.d.ts +7 -0
  35. package/dist/coverage/istanbul.js +134 -0
  36. package/dist/coverage/lcov.d.ts +7 -0
  37. package/dist/coverage/lcov.js +59 -0
  38. package/dist/coverage/load.d.ts +9 -0
  39. package/dist/coverage/load.js +39 -0
  40. package/dist/coverage/types.d.ts +23 -0
  41. package/dist/coverage/types.js +5 -0
  42. package/dist/dashboard/server.d.ts +1 -1
  43. package/dist/dashboard/server.js +21 -5
  44. package/dist/enforcement/runner.d.ts +47 -3
  45. package/dist/enforcement/runner.js +420 -16
  46. package/dist/index.d.ts +23 -2
  47. package/dist/index.js +15 -2
  48. package/dist/intelligence/graph/build.d.ts +2 -0
  49. package/dist/intelligence/graph/build.js +49 -5
  50. package/dist/intelligence/graph/incremental.d.ts +68 -0
  51. package/dist/intelligence/graph/incremental.js +234 -0
  52. package/dist/intelligence/resolve/imports.d.ts +36 -0
  53. package/dist/intelligence/resolve/imports.js +245 -0
  54. package/dist/languages/go.d.ts +9 -0
  55. package/dist/languages/go.js +45 -0
  56. package/dist/languages/index.d.ts +11 -0
  57. package/dist/languages/index.js +76 -0
  58. package/dist/languages/php.d.ts +7 -0
  59. package/dist/languages/php.js +193 -0
  60. package/dist/languages/python.d.ts +7 -0
  61. package/dist/languages/python.js +150 -0
  62. package/dist/languages/types.d.ts +42 -0
  63. package/dist/languages/types.js +26 -0
  64. package/dist/languages/typescript.d.ts +3 -0
  65. package/dist/languages/typescript.js +95 -0
  66. package/dist/mcp/intelligence/handlers.d.ts +5 -0
  67. package/dist/mcp/intelligence/handlers.js +229 -40
  68. package/dist/mcp/intelligence/path-safety.d.ts +2 -4
  69. package/dist/mcp/intelligence/path-safety.js +25 -44
  70. package/dist/mcp/intelligence/registry.d.ts +1 -1
  71. package/dist/mcp/intelligence/registry.js +69 -1
  72. package/dist/platform/firewall/evaluate.d.ts +6 -3
  73. package/dist/platform/firewall/evaluate.js +66 -15
  74. package/dist/platform/graph/build.js +19 -23
  75. package/dist/platform/health/analyze.js +23 -17
  76. package/dist/platform/index.js +2 -0
  77. package/dist/platform/test-impact/analyze.d.ts +21 -3
  78. package/dist/platform/test-impact/analyze.js +214 -28
  79. package/dist/platform/tokens/plan.js +39 -20
  80. package/dist/platform/types.d.ts +9 -0
  81. package/dist/policy/compose.d.ts +34 -0
  82. package/dist/policy/compose.js +118 -0
  83. package/dist/policy/packs.js +33 -1
  84. package/dist/security/paths.d.ts +21 -0
  85. package/dist/security/paths.js +105 -0
  86. package/dist/storage/postgres.d.ts +26 -0
  87. package/dist/storage/postgres.js +90 -0
  88. package/dist/storage/provider.d.ts +2 -7
  89. package/dist/storage/provider.js +22 -16
  90. package/dist/storage/sqlite.d.ts +33 -0
  91. package/dist/storage/sqlite.js +77 -0
  92. package/dist/team/auth.js +1 -1
  93. package/dist/workspace/index.d.ts +69 -0
  94. package/dist/workspace/index.js +220 -0
  95. package/package.json +9 -3
package/README.md CHANGED
@@ -1,266 +1,391 @@
1
1
  # AgentDoctor
2
2
 
3
- **Codebase intelligence for developers, agents, and engineering teams.**
3
+ ## Engineering assurance for AI coding agents.
4
4
 
5
- Local-first tooling that helps you understand a repository, keep AI coding agents safer, and query evidence-backed project knowledge — without requiring a cloud account or API key.
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
  [![npm](https://img.shields.io/npm/v/@praneeth_54/agentdoctor?label=npm)](https://www.npmjs.com/package/@praneeth_54/agentdoctor)
8
8
  [![CI](https://img.shields.io/github/actions/workflow/status/pranee54/AgentDoctor/ci.yml?branch=main&label=CI)](https://github.com/pranee54/AgentDoctor/actions/workflows/ci.yml)
9
9
  [![Node](https://img.shields.io/node/v/@praneeth_54/agentdoctor)](https://nodejs.org)
10
10
  [![License](https://img.shields.io/github/license/pranee54/AgentDoctor)](LICENSE)
11
11
 
12
- **Published package:** `@praneeth_54/agentdoctor@`**2.0.0**
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
- [Documentation index](docs/README.md) · [AgentDoctor 2.0 docs](docs/2.0/README.md) · [Known limitations](docs/2.0/overview/known-limitations.md) · [Readiness matrix](docs/2.0/overview/readiness-matrix.md) · [Security](SECURITY.md) · [Changelog](CHANGELOG.md)
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 does
18
+ ## What AgentDoctor is
19
19
 
20
- AgentDoctor combines three complementary layers:
20
+ AgentDoctor sits between developers / AI coding agents and the repository’s engineering reality.
21
21
 
22
- 1. **Safety** — audit and safely fix AI coding-agent configuration (scan → fix → verify → policy → CI).
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
- It is **not** an autonomous coding agent, chatbot, or IDE process interceptor. It does **not** block Cursor/Claude/Codex unless you deliberately run commands through AgentDoctor’s controlled runner.
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
- ## Install
28
+ **Short description:** Engineering assurance for AI coding agents — repository intelligence, change evidence, safety controls, and MCP tools.
31
29
 
32
- ```bash
33
- npm install -g @praneeth_54/agentdoctor
34
- # or
35
- npx @praneeth_54/agentdoctor --help
36
- ```
30
+ ---
37
31
 
38
- Requires **Node.js 20+**. The runtime depends on the TypeScript compiler API for AST analysis.
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
- ## Quick start
81
+ ## Capability map
43
82
 
44
- ```bash
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
- # Repository Brain proposals (never auto-approved)
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
- # Intelligence
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
- # Knowledge (draft → human approve)
63
- agentdoctor knowledge-create --title "Standard" --content "…"
64
- agentdoctor knowledge-approve --id <id> --decision approved
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
- # Policy (evaluate-only by default)
67
- agentdoctor enforce --command "npm test" --json
97
+ ### Engineering knowledge
68
98
 
69
- # MCP (Brain tools preserved; combined server adds intelligence tools)
70
- agentdoctor brain-mcp --root /ABS/PATH/TO/REPO
71
- agentdoctor mcp --root /ABS/PATH/TO/REPO
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
- # Local dashboard (loopback)
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
- ## Capability status (honest)
116
+ ### Safety & governance
80
117
 
81
- Classifications match [docs/2.0/overview/readiness-matrix.md](docs/2.0/overview/readiness-matrix.md). **No blanket 5/5 claims.**
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
- ### Fully verified (shipped & regression-tested core)
127
+ ### Verification
84
128
 
85
- | Capability | Notes |
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 |
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
- ### Partially validated (implemented, tested; accuracy/perf not independently certified)
137
+ ---
92
138
 
93
- | Capability | Entry points |
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
- ### Experimental
141
+ Most engineering tools optimize one layer: static analysis, search, docs generation, dashboards, security scanners, or AI chat.
106
142
 
107
- | Capability | Notes |
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
- ### Unsupported / not claimed
145
+ ```text
146
+ Repository
147
+ → Understand
148
+ → Impact
149
+ → Knowledge
150
+ → Policy
151
+ → Change
152
+ → Verification
153
+ → Evidence
154
+ ```
112
155
 
113
- | Topic | Status |
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
- ## Safety (preserved)
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
- Scan agent configs and repository hygiene; apply Safe Fix where supported; verify against a baseline; fail CI on severity/score gates.
194
+ Code layout: `src/{intelligence,knowledge,core,mcp,platform,enforcement,cli}/`
126
195
 
127
- ```bash
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
- GitHub Action: pin `pranee54/AgentDoctor@v2.0.0` (default npm version input is `2.0.0`). Surfaces matrix: [docs/reference/surfaces-and-adapters.md](docs/reference/surfaces-and-adapters.md).
198
+ ---
134
199
 
135
- ```yaml
136
- - uses: pranee54/AgentDoctor@v2.0.0
137
- with:
138
- path: .
139
- version: "2.0.0"
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
- ## Repository Brain
215
+ ## Install
145
216
 
146
- `agentdoctor init` writes **PROPOSED** artifacts under `.agentdoctor/repository-brain/proposals/`. They are **not** facts until a human reviews them.
217
+ Requires **Node.js 20+**.
147
218
 
148
219
  ```bash
149
- agentdoctor brain init
150
- agentdoctor brain snapshot
151
- agentdoctor brain review --artifact prop_… --decision approved|rejected
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
- Guide: [docs/2.0/guides/repository-brain.md](docs/2.0/guides/repository-brain.md).
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
- ## Codebase intelligence
236
+ ---
159
237
 
160
- - **AST graph** — TypeScript/JavaScript via the TypeScript compiler API; regex fallback when needed (`graph --mode auto|typescript-ast|regex`).
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
- Limitations: call resolution is best-effort; non-TS languages are not deeply analyzed.
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
- ## Knowledge governance
251
+ # Intelligence
252
+ agentdoctor graph --mode auto --json
253
+ agentdoctor impact --json
254
+ agentdoctor c4 --json
170
255
 
171
- Draft → pending-review → approved/rejected. Retrieval **abstains** when no approved record matches.
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
- Guide: [docs/2.0/guides/knowledge-governance.md](docs/2.0/guides/knowledge-governance.md).
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
- ## Policy evaluation and controlled enforcement
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
- | Mode | Behavior |
180
- | ------------------------------------------------------------------ | ----------------------------------------------------------------------------------------- |
181
- | Policy evaluation (`platform policy-check`, MCP `policy_evaluate`) | Verdict only; `executionResult: "not-executed"` |
182
- | Controlled runner (`enforce`) | Can report `blocked-by-enforcement` when **AgentDoctor** refuses to run a blocked command |
183
- | Third-party IDEs | **Not** intercepted |
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
- Trust boundaries: [docs/2.0/overview/trust-boundaries.md](docs/2.0/overview/trust-boundaries.md).
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
- | Command | Server | Tools |
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
- MCP docs: [docs/2.0/guides/mcp.md](docs/2.0/guides/mcp.md) · legacy detail: [docs/mcp/brain-mcp.md](docs/mcp/brain-mcp.md).
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
- ## CLI / API / dashboard
312
+ ## GitHub Action
201
313
 
202
- - CLI index: [docs/2.0/guides/cli.md](docs/2.0/guides/cli.md)
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
- ```bash
207
- agentdoctor dashboard
208
- agentdoctor doctor --json
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
- ## Local-development team authentication
332
+ ## Security model
214
333
 
215
- ```bash
216
- agentdoctor team-register --username alice --password '………'
217
- agentdoctor team-login --username alice --password '………'
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
- This is **local-dev scrypt auth**, clearly labeled — **not** enterprise SSO.
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
- ## Important limitations (read before adopting)
348
+ ## What AgentDoctor does not do
225
349
 
226
- 1. AST depth is **TypeScript/JavaScript**-oriented.
227
- 2. Test-impact is **heuristic / graph-based**, not coverage-oracle accurate.
228
- 3. C4 views are **inferred**, not approved architecture.
229
- 4. Firewall is **evaluate-only** unless you use AgentDoctor’s controlled runner.
230
- 5. Team auth is **local-dev**, not SSO.
231
- 6. No IDE interception.
232
- 7. No production SQLite/Postgres/vector backend in this package.
233
- 8. No complete multi-language AST.
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
- ## Compatibility
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
- - Safety CLI exit codes and Brain MCP tool names are preserved.
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
- | Area | Link |
251
- | ---------------- | -------------------------------------------------------------------------- |
252
- | 2.0 index | [docs/2.0/README.md](docs/2.0/README.md) |
253
- | CLI / MCP / API | [docs/2.0/guides/](docs/2.0/guides/) |
254
- | Release blockers | [docs/2.0/audits/release-blockers.md](docs/2.0/audits/release-blockers.md) |
255
- | Docs hub | [docs/README.md](docs/README.md) |
256
- | Changelog | [CHANGELOG.md](CHANGELOG.md) |
257
- | Contributing | [CONTRIBUTING.md](CONTRIBUTING.md) |
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 [docs/development/development.md](docs/development/development.md).
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;