@praneeth_54/agentdoctor 1.0.0 → 1.1.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 (208) hide show
  1. package/CHANGELOG.md +60 -5
  2. package/README.md +462 -251
  3. package/dist/cli/commands/brain-mcp.d.ts +9 -0
  4. package/dist/cli/commands/brain-mcp.js +38 -0
  5. package/dist/cli/program.js +13 -0
  6. package/dist/constants.d.ts +1 -1
  7. package/dist/constants.js +1 -1
  8. package/dist/core/understanding/architecture/index.d.ts +4 -0
  9. package/dist/core/understanding/architecture/index.js +3 -0
  10. package/dist/core/understanding/architecture/infer.d.ts +6 -0
  11. package/dist/core/understanding/architecture/infer.js +39 -0
  12. package/dist/core/understanding/architecture/models.d.ts +23 -0
  13. package/dist/core/understanding/architecture/models.js +127 -0
  14. package/dist/core/understanding/architecture/patterns/distribution.d.ts +2 -0
  15. package/dist/core/understanding/architecture/patterns/distribution.js +115 -0
  16. package/dist/core/understanding/architecture/patterns/index.d.ts +2 -0
  17. package/dist/core/understanding/architecture/patterns/index.js +8 -0
  18. package/dist/core/understanding/architecture/patterns/layered.d.ts +2 -0
  19. package/dist/core/understanding/architecture/patterns/layered.js +279 -0
  20. package/dist/core/understanding/architecture/patterns/structural.d.ts +2 -0
  21. package/dist/core/understanding/architecture/patterns/structural.js +197 -0
  22. package/dist/core/understanding/architecture/rules.d.ts +4 -0
  23. package/dist/core/understanding/architecture/rules.js +6 -0
  24. package/dist/core/understanding/architecture/types.d.ts +52 -0
  25. package/dist/core/understanding/architecture/types.js +1 -0
  26. package/dist/core/understanding/brain/build.d.ts +13 -0
  27. package/dist/core/understanding/brain/build.js +158 -0
  28. package/dist/core/understanding/brain/claims/index.d.ts +3 -0
  29. package/dist/core/understanding/brain/claims/index.js +2 -0
  30. package/dist/core/understanding/brain/claims/lifecycle.d.ts +16 -0
  31. package/dist/core/understanding/brain/claims/lifecycle.js +78 -0
  32. package/dist/core/understanding/brain/claims/types.d.ts +32 -0
  33. package/dist/core/understanding/brain/claims/types.js +25 -0
  34. package/dist/core/understanding/brain/components/index.d.ts +17 -0
  35. package/dist/core/understanding/brain/components/index.js +97 -0
  36. package/dist/core/understanding/brain/components/types.d.ts +16 -0
  37. package/dist/core/understanding/brain/components/types.js +8 -0
  38. package/dist/core/understanding/brain/confidence.d.ts +19 -0
  39. package/dist/core/understanding/brain/confidence.js +39 -0
  40. package/dist/core/understanding/brain/contract.d.ts +17 -0
  41. package/dist/core/understanding/brain/contract.js +100 -0
  42. package/dist/core/understanding/brain/contradictions/index.d.ts +12 -0
  43. package/dist/core/understanding/brain/contradictions/index.js +57 -0
  44. package/dist/core/understanding/brain/contradictions/types.d.ts +12 -0
  45. package/dist/core/understanding/brain/contradictions/types.js +8 -0
  46. package/dist/core/understanding/brain/delta.d.ts +25 -0
  47. package/dist/core/understanding/brain/delta.js +116 -0
  48. package/dist/core/understanding/brain/evidence/index.d.ts +3 -0
  49. package/dist/core/understanding/brain/evidence/index.js +2 -0
  50. package/dist/core/understanding/brain/evidence/redact.d.ts +4 -0
  51. package/dist/core/understanding/brain/evidence/redact.js +36 -0
  52. package/dist/core/understanding/brain/evidence/types.d.ts +34 -0
  53. package/dist/core/understanding/brain/evidence/types.js +35 -0
  54. package/dist/core/understanding/brain/explain.d.ts +17 -0
  55. package/dist/core/understanding/brain/explain.js +33 -0
  56. package/dist/core/understanding/brain/index.d.ts +28 -0
  57. package/dist/core/understanding/brain/index.js +16 -0
  58. package/dist/core/understanding/brain/migrate.d.ts +21 -0
  59. package/dist/core/understanding/brain/migrate.js +47 -0
  60. package/dist/core/understanding/brain/query.d.ts +60 -0
  61. package/dist/core/understanding/brain/query.js +92 -0
  62. package/dist/core/understanding/brain/security.d.ts +3 -0
  63. package/dist/core/understanding/brain/security.js +43 -0
  64. package/dist/core/understanding/brain/storage/index.d.ts +2 -0
  65. package/dist/core/understanding/brain/storage/index.js +1 -0
  66. package/dist/core/understanding/brain/storage/store.d.ts +53 -0
  67. package/dist/core/understanding/brain/storage/store.js +305 -0
  68. package/dist/core/understanding/brain/trace.d.ts +24 -0
  69. package/dist/core/understanding/brain/trace.js +207 -0
  70. package/dist/core/understanding/brain/types.d.ts +32 -0
  71. package/dist/core/understanding/brain/types.js +8 -0
  72. package/dist/core/understanding/brain/version.d.ts +13 -0
  73. package/dist/core/understanding/brain/version.js +7 -0
  74. package/dist/core/understanding/delta/compare.d.ts +26 -0
  75. package/dist/core/understanding/delta/compare.js +74 -0
  76. package/dist/core/understanding/delta/index.d.ts +2 -0
  77. package/dist/core/understanding/delta/index.js +1 -0
  78. package/dist/core/understanding/dependencies/discover.d.ts +7 -0
  79. package/dist/core/understanding/dependencies/discover.js +550 -0
  80. package/dist/core/understanding/dependencies/extract.d.ts +10 -0
  81. package/dist/core/understanding/dependencies/extract.js +189 -0
  82. package/dist/core/understanding/dependencies/index.d.ts +4 -0
  83. package/dist/core/understanding/dependencies/index.js +3 -0
  84. package/dist/core/understanding/dependencies/models.d.ts +12 -0
  85. package/dist/core/understanding/dependencies/models.js +125 -0
  86. package/dist/core/understanding/dependencies/types.d.ts +27 -0
  87. package/dist/core/understanding/dependencies/types.js +1 -0
  88. package/dist/core/understanding/domain/discover.d.ts +14 -0
  89. package/dist/core/understanding/domain/discover.js +90 -0
  90. package/dist/core/understanding/domain/index.d.ts +2 -0
  91. package/dist/core/understanding/domain/index.js +1 -0
  92. package/dist/core/understanding/entrypoints/discover.d.ts +6 -0
  93. package/dist/core/understanding/entrypoints/discover.js +62 -0
  94. package/dist/core/understanding/entrypoints/extract.d.ts +19 -0
  95. package/dist/core/understanding/entrypoints/extract.js +43 -0
  96. package/dist/core/understanding/entrypoints/index.d.ts +4 -0
  97. package/dist/core/understanding/entrypoints/index.js +3 -0
  98. package/dist/core/understanding/entrypoints/models.d.ts +26 -0
  99. package/dist/core/understanding/entrypoints/models.js +216 -0
  100. package/dist/core/understanding/entrypoints/types.d.ts +20 -0
  101. package/dist/core/understanding/entrypoints/types.js +1 -0
  102. package/dist/core/understanding/index.d.ts +32 -0
  103. package/dist/core/understanding/index.js +18 -0
  104. package/dist/core/understanding/mind/build.d.ts +16 -0
  105. package/dist/core/understanding/mind/build.js +134 -0
  106. package/dist/core/understanding/mind/index.d.ts +6 -0
  107. package/dist/core/understanding/mind/index.js +3 -0
  108. package/dist/core/understanding/mind/query.d.ts +33 -0
  109. package/dist/core/understanding/mind/query.js +39 -0
  110. package/dist/core/understanding/mind/types.d.ts +24 -0
  111. package/dist/core/understanding/mind/types.js +7 -0
  112. package/dist/core/understanding/model/builder.d.ts +9 -0
  113. package/dist/core/understanding/model/builder.js +209 -0
  114. package/dist/core/understanding/model/ids.d.ts +7 -0
  115. package/dist/core/understanding/model/ids.js +48 -0
  116. package/dist/core/understanding/model/index.d.ts +7 -0
  117. package/dist/core/understanding/model/index.js +6 -0
  118. package/dist/core/understanding/model/schema.d.ts +12 -0
  119. package/dist/core/understanding/model/schema.js +33 -0
  120. package/dist/core/understanding/model/serializer.d.ts +9 -0
  121. package/dist/core/understanding/model/serializer.js +46 -0
  122. package/dist/core/understanding/model/types.d.ts +110 -0
  123. package/dist/core/understanding/model/types.js +1 -0
  124. package/dist/core/understanding/model/validator.d.ts +5 -0
  125. package/dist/core/understanding/model/validator.js +126 -0
  126. package/dist/core/understanding/model/version.d.ts +9 -0
  127. package/dist/core/understanding/model/version.js +7 -0
  128. package/dist/core/understanding/ownership/discover.d.ts +12 -0
  129. package/dist/core/understanding/ownership/discover.js +242 -0
  130. package/dist/core/understanding/ownership/index.d.ts +2 -0
  131. package/dist/core/understanding/ownership/index.js +1 -0
  132. package/dist/core/understanding/ownership/types.d.ts +23 -0
  133. package/dist/core/understanding/ownership/types.js +1 -0
  134. package/dist/core/understanding/query/engine.d.ts +24 -0
  135. package/dist/core/understanding/query/engine.js +35 -0
  136. package/dist/core/understanding/query/errors.d.ts +13 -0
  137. package/dist/core/understanding/query/errors.js +26 -0
  138. package/dist/core/understanding/query/executor.d.ts +8 -0
  139. package/dist/core/understanding/query/executor.js +34 -0
  140. package/dist/core/understanding/query/index.d.ts +7 -0
  141. package/dist/core/understanding/query/index.js +5 -0
  142. package/dist/core/understanding/query/models.d.ts +102 -0
  143. package/dist/core/understanding/query/models.js +1 -0
  144. package/dist/core/understanding/query/query.d.ts +68 -0
  145. package/dist/core/understanding/query/query.js +145 -0
  146. package/dist/core/understanding/query/registry.d.ts +8 -0
  147. package/dist/core/understanding/query/registry.js +340 -0
  148. package/dist/core/understanding/query/types.d.ts +63 -0
  149. package/dist/core/understanding/query/types.js +1 -0
  150. package/dist/core/understanding/relationships/discover.d.ts +11 -0
  151. package/dist/core/understanding/relationships/discover.js +517 -0
  152. package/dist/core/understanding/relationships/extract.d.ts +14 -0
  153. package/dist/core/understanding/relationships/extract.js +165 -0
  154. package/dist/core/understanding/relationships/index.d.ts +4 -0
  155. package/dist/core/understanding/relationships/index.js +3 -0
  156. package/dist/core/understanding/relationships/models.d.ts +21 -0
  157. package/dist/core/understanding/relationships/models.js +185 -0
  158. package/dist/core/understanding/relationships/types.d.ts +42 -0
  159. package/dist/core/understanding/relationships/types.js +1 -0
  160. package/dist/core/understanding/risks/discover.d.ts +8 -0
  161. package/dist/core/understanding/risks/discover.js +155 -0
  162. package/dist/core/understanding/risks/index.d.ts +2 -0
  163. package/dist/core/understanding/risks/index.js +1 -0
  164. package/dist/core/understanding/risks/types.d.ts +26 -0
  165. package/dist/core/understanding/risks/types.js +1 -0
  166. package/dist/core/understanding/shared/domain-lexicon.d.ts +9 -0
  167. package/dist/core/understanding/shared/domain-lexicon.js +107 -0
  168. package/dist/core/understanding/shared/index.d.ts +2 -0
  169. package/dist/core/understanding/shared/index.js +2 -0
  170. package/dist/core/understanding/shared/tokens.d.ts +7 -0
  171. package/dist/core/understanding/shared/tokens.js +141 -0
  172. package/dist/core/understanding/snapshot/identity.d.ts +24 -0
  173. package/dist/core/understanding/snapshot/identity.js +79 -0
  174. package/dist/core/understanding/snapshot/index.d.ts +2 -0
  175. package/dist/core/understanding/snapshot/index.js +1 -0
  176. package/dist/core/understanding/types/index.d.ts +22 -0
  177. package/dist/core/understanding/types/index.js +1 -0
  178. package/dist/core/understanding/understand/formatter.d.ts +10 -0
  179. package/dist/core/understanding/understand/formatter.js +115 -0
  180. package/dist/core/understanding/understand/index.d.ts +4 -0
  181. package/dist/core/understanding/understand/index.js +3 -0
  182. package/dist/core/understanding/understand/service.d.ts +17 -0
  183. package/dist/core/understanding/understand/service.js +76 -0
  184. package/dist/core/understanding/understand/summary.d.ts +14 -0
  185. package/dist/core/understanding/understand/summary.js +39 -0
  186. package/dist/core/understanding/understand/types.d.ts +31 -0
  187. package/dist/core/understanding/understand/types.js +1 -0
  188. package/dist/mcp/brain/compile.d.ts +9 -0
  189. package/dist/mcp/brain/compile.js +42 -0
  190. package/dist/mcp/brain/errors.d.ts +12 -0
  191. package/dist/mcp/brain/errors.js +23 -0
  192. package/dist/mcp/brain/index.d.ts +11 -0
  193. package/dist/mcp/brain/index.js +8 -0
  194. package/dist/mcp/brain/provenance.d.ts +29 -0
  195. package/dist/mcp/brain/provenance.js +59 -0
  196. package/dist/mcp/brain/schemas.d.ts +13 -0
  197. package/dist/mcp/brain/schemas.js +105 -0
  198. package/dist/mcp/brain/security/root.d.ts +6 -0
  199. package/dist/mcp/brain/security/root.js +66 -0
  200. package/dist/mcp/brain/server.d.ts +12 -0
  201. package/dist/mcp/brain/server.js +46 -0
  202. package/dist/mcp/brain/session.d.ts +33 -0
  203. package/dist/mcp/brain/session.js +117 -0
  204. package/dist/mcp/brain/tools/handlers.d.ts +13 -0
  205. package/dist/mcp/brain/tools/handlers.js +483 -0
  206. package/dist/mcp/brain/tools/registry.d.ts +9 -0
  207. package/dist/mcp/brain/tools/registry.js +191 -0
  208. package/package.json +11 -4
package/README.md CHANGED
@@ -1,278 +1,418 @@
1
1
  # AgentDoctor
2
2
 
3
+ Evidence-backed Project Brain for AI Coding Agents
4
+
5
+ ![AgentDoctor hero](docs/assets/agentdoctor-hero.svg)
6
+
7
+ AI coding agents can read files. They still lack reliable **repository-level** understanding — what is in a project, what evidence supports a claim, what is dangerous to change, and what must stay **UNKNOWN**.
8
+
9
+ AgentDoctor analyzes a repository, builds a structured **Project Brain** (claims, evidence, confidence, ownership, risks, snapshots, deltas), and exposes it to agents through local **STDIO MCP**.
10
+
3
11
  [![npm](https://img.shields.io/npm/v/@praneeth_54/agentdoctor?label=npm)](https://www.npmjs.com/package/@praneeth_54/agentdoctor)
4
- [![npm downloads](https://img.shields.io/npm/dm/@praneeth_54/agentdoctor)](https://www.npmjs.com/package/@praneeth_54/agentdoctor)
5
- [![CI](https://img.shields.io/github/actions/workflow/status/pranee54/AgentDoctor/ci.yml?branch=main&label=CI)](https://github.com/pranee54/AgentDoctor/actions)
12
+ [![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)
6
13
  [![Node](https://img.shields.io/node/v/@praneeth_54/agentdoctor)](https://nodejs.org)
7
14
  [![License](https://img.shields.io/github/license/pranee54/AgentDoctor)](LICENSE)
8
15
 
9
- **Lighthouse for AI coding agents.**
16
+ [Documentation](docs/README.md) · [Project Brain](docs/project-brain.md) · [MCP](docs/mcp/brain-mcp.md) · [GitHub Action](#github-action) · [Demo](docs/demo/brain-mcp-demo.md) · [Security](SECURITY.md) · [Roadmap](ROADMAP.md)
10
17
 
11
- Audit coding-agent configuration before it becomes a repository problem.
18
+ ```text
19
+ Repository
20
+ ↓
21
+ Project Understanding
22
+ ↓
23
+ Project Brain
24
+ ↓
25
+ Evidence / Claims / Confidence
26
+ ↓
27
+ MCP
28
+ ↓
29
+ AI Coding Agent
30
+ ```
12
31
 
13
- AgentDoctor is a local CLI that inspects project-level AI coding agent setup — Cursor, Claude Code, and Codex — for security, instructions, context, and MCP configuration. Deterministic static analysis. No API key. No code upload by default.
32
+ Also ships **Safety V1**: Scan → Fix → Verify → Policy → CI for Cursor, Claude Code, and Codex configuration. Brain risk is **change-danger analysis**, not vulnerability scanning.
14
33
 
15
- ```bash
16
- npx @praneeth_54/agentdoctor
17
- ```
34
+ ---
35
+
36
+ ## What is AgentDoctor?
37
+
38
+ Local developer infrastructure for AI coding agents (`@praneeth_54/agentdoctor`, CLI `agentdoctor`, **1.1.0**, Node.js **20+**).
18
39
 
19
- Public release (`1.0.0`). Scan → Fix → Verify → CI. Deterministic scores in the terminal and JSON.
40
+ It:
41
+
42
+ - analyzes repositories with deterministic discovery passes
43
+ - builds a structured Project Brain
44
+ - represents claims with typed evidence and confidence
45
+ - preserves **UNKNOWN** when evidence is missing
46
+ - persists snapshots and computes deltas
47
+ - exposes Brain capabilities through MCP (`agentdoctor brain-mcp --root <path>`)
48
+
49
+ It is **not** an autonomous coding agent, chatbot, RAG memory product, AGI claim, or vulnerability scanner. It does not claim universal or perfect repository understanding.
20
50
 
21
51
  ---
22
52
 
23
- ## What you get
53
+ ## Why Project Brain?
24
54
 
25
- ![AgentDoctor scanning a repository and reporting coding-agent security findings](docs/images/cli-scan.png)
55
+ Agents edit with fragmented context. Ownership gets invented. Blast radius stays implicit. “Why should I trust that?” rarely has an answer with a snapshot id.
26
56
 
27
- _Real scan of the included `insecure-agent-project` fixture using AgentDoctor v1.0.0._
57
+ Project Brain structures understanding that exists in this codebase:
28
58
 
29
- ```text
30
- $ npx @praneeth_54/agentdoctor
59
+ architecture · domains · components · entrypoints · dependencies · relationships · ownership · change-danger risks · claims · evidence · confidence · snapshots · deltas
31
60
 
32
- 🩺 AgentDoctor v1.0.0
61
+ Details: [docs/project-brain.md](docs/project-brain.md)
33
62
 
34
- Scanning repository...
63
+ ---
35
64
 
36
- Repository
37
- Framework: Node.js
38
- Language: JavaScript
39
- Package manager: npm
40
- Files scanned: 7
65
+ ## Architecture
66
+
67
+ ![Architecture](docs/assets/architecture.svg)
68
+
69
+ | Layer | Location |
70
+ | ------------------------- | ----------------------------------------------------------- |
71
+ | Understanding / discovery | `src/core/understanding/` |
72
+ | Project Brain | `src/core/understanding/brain/` |
73
+ | MCP bridge | `src/mcp/brain/` |
74
+ | CLI | `src/cli/commands/brain-mcp.ts` |
75
+ | Safety (separate path) | `src/core/{scanner,rules,fix,verify,policy}/`, `action.yml` |
41
76
 
42
- AI Coding Agents
77
+ MCP depends on Brain. Brain does not depend on MCP.
43
78
 
44
- ✓ Cursor configured
45
- ✓ Claude Code configured
46
- ✓ Codex configured
79
+ ---
47
80
 
48
- Findings
81
+ ## Project Brain
49
82
 
50
- CRITICAL
83
+ ![Provenance](docs/assets/provenance.svg)
51
84
 
52
- ✗ Sensitive environment file may enter agent context
53
- .env
54
- Affected: Claude Code, Codex
55
- Fix: Add an agent-specific exclusion (for example .cursorignore or a
56
- Claude Code Read deny rule), keep the file out of version control,
57
- and rotate any credentials that may have been exposed.
85
+ ### Evidence & provenance
58
86
 
59
- ✗ Private key or credential file present in repository
60
- test-private-key.pem
61
- Affected: Claude Code, Codex, Cursor
87
+ ```text
88
+ Claim
89
+ ↓
90
+ Evidence
91
+ ↓
92
+ Snapshot
93
+ ```
62
94
 
63
- WARNING
95
+ Successful MCP tools return a provenance envelope: `result`, `evidenceIds`, `confidence` (`[0,1]`, rule-derived / uncalibrated), `snapshot` (`id` + `contentHash`), and `claimStatus` when applicable.
64
96
 
65
- ! Claude Code bypassPermissions mode enabled
66
- .claude/settings.json
97
+ Claim lifecycle: `ACTIVE` · `INVALIDATED` · `SUPERSEDED` · `CONTRADICTED`
67
98
 
68
- Summary
99
+ Epistemics on evidence: `observed` | `inferred`. ACTIVE claims must reference evidence. Serialization redacts secret-like values.
69
100
 
70
- 3 critical
71
- 1 warning
72
- 0 info
101
+ ### UNKNOWN semantics
73
102
 
74
- Readiness: 13/100
75
- Category and agent scores: agentdoctor scan --json
103
+ ```text
104
+ Ownership evidence unavailable
105
+ ↓
106
+ UNKNOWN
76
107
  ```
77
108
 
78
- Abbreviated text example from the same fixture for accessibility and search. Secret values are never printed. Re-run the scan if counts change.
109
+ No invented owners. Contract: `preserve-unknown-never-invent`.
110
+
111
+ Local runtime store (not committed product source): `<repo>/.agentdoctor/project-brain/`.
79
112
 
80
113
  ---
81
114
 
82
- ## Why AgentDoctor?
115
+ ## MCP
83
116
 
84
- Repositories accumulate agent configuration quickly:
117
+ ![MCP tools](docs/assets/mcp-tools.svg)
85
118
 
86
- - Multiple instruction formats (`.cursor/rules`, `CLAUDE.md`, `AGENTS.md`)
87
- - Stale path references in always-on instructions
88
- - Ignore differences between `.gitignore`, `.cursorignore`, and agent defaults
89
- - MCP filesystem scopes that are broader than intended
90
- - Generated directories and large logs that waste context
91
- - Credential-like files that may be readable by agents
92
- - Conflicting assumptions about what each agent can see
119
+ ```text
120
+ AI Coding Agent → MCP client → agentdoctor brain-mcp --root <abs> → Project Brain
121
+ ```
93
122
 
94
- Manually reviewing all of that across Cursor, Claude Code, and Codex is slow and inconsistent. AgentDoctor provides one deterministic local audit with stable rule IDs, evidence paths, and affected-agent information.
123
+ STDIO only. No API key. No upload. `--root` is required. Diagnostics on **stderr**; protocol on **stdout**.
95
124
 
96
- | Analogy | Domain |
97
- | --------------- | -------------------------------- |
98
- | Lighthouse | Web pages |
99
- | `npm audit` | Dependencies |
100
- | ESLint | Source code |
101
- | **AgentDoctor** | **AI coding agent environments** |
125
+ ### Tools (from `src/mcp/brain/tools/registry.ts`)
102
126
 
103
- AgentDoctor analyzes configuration. It does not run agents or call an LLM. `agentdoctor fix` may append safe context exclusions (Cursor `.cursorignore`, Claude Code Read deny rules, and Codex filesystem deny keys); it does not rewrite secrets, credentials, or security modes such as `bypassPermissions`.
127
+ | Tool | Purpose |
128
+ | ----------------- | ------------------------------------------------------ |
129
+ | `brain_overview` | Compact summary + confidence envelope |
130
+ | `brain_query` | Typed `BrainQueryEngine` queries |
131
+ | `brain_explain` | Evidence-backed `explainClaim` |
132
+ | `brain_trace` | Capped deterministic `traceBrain` |
133
+ | `brain_claims` | Claim lifecycle (default ACTIVE + CONTRADICTED) |
134
+ | `brain_evidence` | Typed redacted evidence |
135
+ | `brain_ownership` | Explicit CODEOWNERS / MAINTAINERS / package only |
136
+ | `brain_risk` | Change-danger risk (not SAST / CVE) |
137
+ | `brain_delta` | Read-only snapshot comparison |
138
+ | `brain_snapshot` | `current` · `history` · `compare` · `load` · `rebuild` |
104
139
 
105
- ---
140
+ Only controlled write: `brain_snapshot` `rebuild` under `<root>/.agentdoctor/project-brain/`.
106
141
 
107
- ## Before / after
142
+ Contract: [docs/mcp/brain-mcp.md](docs/mcp/brain-mcp.md)
108
143
 
109
- **Before**
144
+ ---
145
+
146
+ ## Real Cursor Agent Validation
110
147
 
111
- A repository may contain:
148
+ ![Agent validation](docs/assets/agent-validation.svg)
112
149
 
113
150
  ```text
114
- .cursor/rules/
115
- AGENTS.md
116
- CLAUDE.md
117
- .claude/settings.json
118
- .mcp.json
119
- .env
151
+ Cursor Agent
152
+ ↓
153
+ MCP discovery (agentdoctor-brain)
154
+ ↓
155
+ brain_* tool call
156
+ ↓
157
+ Project Brain
158
+ ↓
159
+ Evidence-backed result (+ provenance)
120
160
  ```
121
161
 
122
- Potential problems stay invisible until something leaks into model context, CI, or a teammate’s agent session:
162
+ Harness: `validation/mcp-agent` on `fixtures/understanding-dependencies-project`.
123
163
 
124
- - environment or credential-like files reachable by agents
125
- - stale instruction path references
126
- - broad MCP filesystem access
127
- - oversized always-on context
164
+ | Q | Focus | Expected tools |
165
+ | --- | -------------- | ------------------------------------------------- |
166
+ | Q1 | Overview | `brain_overview` |
167
+ | Q2 | Entrypoints | `brain_query` |
168
+ | Q3 | Change risk | `brain_risk` |
169
+ | Q4 | Ownership | `brain_ownership` |
170
+ | Q5 | Impact / trace | `brain_trace` |
171
+ | Q6 | Provenance | `brain_explain`, `brain_claims`, `brain_evidence` |
172
+ | Q7 | Delta | `brain_delta`, `brain_snapshot` |
128
173
 
129
- **Run**
174
+ Documented harness results ([validation/mcp-agent/README.md](validation/mcp-agent/README.md), 2026-08-13, AgentDoctor 1.1.0):
130
175
 
131
- ```bash
132
- npx @praneeth_54/agentdoctor
133
- ```
176
+ - Deterministic Brain tool exercise: **10/10** succeeded (actual tool calls, not prose inference)
177
+ - Cursor MCP tools discovered: **PASS** (all 10 listed)
178
+ - Security checks: **10/10**
179
+ - Provenance (tool-level): **PASS**
180
+ - Authenticated LLM Q1–Q7 grading: **BLOCKED** without agent login — kept separate from MCP contract PASS
181
+
182
+ Checks include grounding, UNKNOWN ownership guard, risk semantics, provenance, snapshot/delta semantics — not “zero hallucinations.”
134
183
 
135
- **After**
184
+ Demo: [docs/demo/brain-mcp-demo.md](docs/demo/brain-mcp-demo.md)
185
+
186
+ ---
136
187
 
137
- You get deterministic findings with:
188
+ ## Built Through Real Validation
138
189
 
139
- - stable rule IDs (for example `security/env-file-exposure`)
140
- - evidence paths
141
- - affected agents when exposure claims are supported
142
- - conservative recommendations
143
- - readiness score (`scores.overall` in JSON; overall line in the terminal)
190
+ 1.1.0 was hardened under real MCP, CI, and Windows pressure — not README theater.
144
191
 
145
- Safe context exclusions (Cursor / Claude Code / Codex) can be applied with `agentdoctor fix`. Security and review findings stay manual — Fix explains why and does not invent unsafe edits.
192
+ | Problem | What we learned |
193
+ | ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
194
+ | MCP cold start | Session loads latest snapshot or, by default, **compiles on first connect** (`buildIfMissing`). Large roots make host MCP timeouts more likely — prefer an existing snapshot / explicit `rebuild` before attaching an agent. |
195
+ | Large Brain init | First compile writes under `.agentdoctor/project-brain/`; local Brain state ≠ committed source. |
196
+ | STDIO discipline | Protocol on stdout only; logs on stderr (`src/mcp/brain/server.ts`, `tests/unit/mcp/`). |
197
+ | Cross-process MCP tests | Unit STDIO client + protocol tests matter more than assuming tool use from answer quality. |
198
+ | Windows CLI | `.cmd` / POSIX shim pitfalls → invoke via `node` + `npm-cli.js`; native `cmd` quoting. |
199
+ | Argument escaping | CodeQL-driven hardening of Windows command argument escaping in test helpers. |
200
+ | CI matrix | Ubuntu + Windows quality job; Project Brain laboratory requires `npm run build` before spawn (`f3cd550`). |
201
+ | Snapshots | Atomic writes, checksum fail-closed, refuse divergent overwrite of the same snapshot id. |
202
+ | Terminal / injection surface | Findings must not become escape channels; Security policy calls out terminal escape injection. |
203
+ | UNKNOWN | Inventing ownership is a product failure mode. |
146
204
 
147
205
  ---
148
206
 
149
- ## Quick start
207
+ ## Repository Structure
150
208
 
151
- ### One-shot (recommended)
209
+ ![Repository layout](docs/assets/repository-architecture.svg)
152
210
 
153
- ```bash
154
- npx @praneeth_54/agentdoctor
211
+ ```text
212
+ src/
213
+ ├── core/
214
+ │ └── understanding/ # discovery + Project Brain
215
+ ├── mcp/
216
+ │ └── brain/ # STDIO MCP bridge
217
+ └── cli/
218
+ └── commands/
219
+ └── brain-mcp.ts
220
+
221
+ tests/
222
+ └── unit/
223
+ ├── understanding/
224
+ └── mcp/
225
+
226
+ validation/
227
+ ├── project-brain/
228
+ ├── software-understanding/
229
+ ├── real-world/
230
+ └── mcp-agent/
231
+
232
+ docs/
233
+ ├── assets/ # README diagrams (this landing page)
234
+ ├── mcp/
235
+ ├── demo/
236
+ └── project-brain.md
237
+
238
+ examples/mcp/ # Cursor / Claude Code / Codex config samples
155
239
  ```
156
240
 
157
- Pin a version when you need a fixed install:
241
+ Do not treat `.agentdoctor/` or project-local agent config dirs as committed AgentDoctor source.
158
242
 
159
- ```bash
160
- npx @praneeth_54/agentdoctor@1.0.0
161
- ```
243
+ ---
244
+
245
+ ## Validation
162
246
 
163
- ### Global (optional)
247
+ ![Validation pipeline](docs/assets/validation-pipeline.svg)
164
248
 
165
249
  ```bash
166
- npm install -g @praneeth_54/agentdoctor
167
- agentdoctor
250
+ npm run verify # typecheck · lint · format · unit · build
251
+ npm run verify:understanding
252
+ npm run verify:mcp
253
+ npm run verify:project-brain # understanding + validate:project-brain + benchmark
254
+ npm run validate:mcp-agent
168
255
  ```
169
256
 
170
- ### Scan → Fix → Verify
171
-
172
- ```bash
173
- # 1. Scan (save a baseline for Verify)
174
- npx @praneeth_54/agentdoctor scan . --json > agentdoctor-report.json
257
+ | Layer | How verified | Current note |
258
+ | ---------------- | ------------------------------------------------------- | --------------------------------------------------------------------------------- |
259
+ | Core / Safety | `npm run verify` + CI quality (Ubuntu/Windows) | Live [CI badge](https://github.com/pranee54/AgentDoctor/actions/workflows/ci.yml) |
260
+ | Understanding | `npm run verify:understanding` | Unit surface under `tests/unit/understanding/` |
261
+ | Project Brain | `npm run verify:project-brain` + CI `project-brain` job | Requires built CLI |
262
+ | MCP | `npm run verify:mcp` | Protocol + STDIO client tests |
263
+ | Agent validation | `npm run validate:mcp-agent` | MCP discovery **PASS**; LLM Q1–Q7 **BLOCKED** (see report) |
264
+ | Benchmark | `benchmark:project-brain` | Part of `verify:project-brain` |
265
+ | Package | npm `@praneeth_54/agentdoctor` | Published **1.1.0** |
266
+ | Security | mcp-agent security suite + [SECURITY.md](SECURITY.md) | Tool-level **10/10** in report |
175
267
 
176
- # 2. Fix safe context exclusions (preview first with --dry-run)
177
- npx @praneeth_54/agentdoctor fix . --dry-run
178
- npx @praneeth_54/agentdoctor fix . -y
268
+ Re-run the commands above for live status; do not treat this table as a substitute for CI.
179
269
 
180
- # 3. Verify against the baseline
181
- npx @praneeth_54/agentdoctor verify . --baseline agentdoctor-report.json
182
- ```
270
+ ---
183
271
 
184
- `fix` writes safe context exclusions for Cursor (`.cursorignore`), Claude Code
185
- (`permissions.deny` Read rules in `.claude/settings.json`), and Codex (filesystem `deny`
186
- keys under a permissions profile in `.codex/config.toml`) for findings such as unignored
187
- `build/` or large logs. Review/manual security findings are listed as skipped — address those
188
- yourself, then re-run `verify`.
272
+ ## Installation
189
273
 
190
- ### Common commands
274
+ ```bash
275
+ npx @praneeth_54/agentdoctor@1.1.1
276
+ # or
277
+ npm install -g @praneeth_54/agentdoctor
278
+ agentdoctor --help
279
+ ```
191
280
 
192
281
  ```bash
282
+ agentdoctor brain-mcp --root /ABSOLUTE/PATH/TO/YOUR/PROJECT
283
+
193
284
  agentdoctor .
194
285
  agentdoctor scan . --json
195
286
  agentdoctor fix . --dry-run
196
- agentdoctor verify . --ci --baseline agentdoctor-report.json
287
+ agentdoctor verify . --baseline agentdoctor-report.json
197
288
  agentdoctor explain security/env-file-exposure
198
289
  agentdoctor doctor
199
290
  ```
200
291
 
201
- Package name: `@praneeth_54/agentdoctor` (npm blocks the unscoped name). CLI binary: `agentdoctor`. Requires **Node.js 20+**.
292
+ ---
293
+
294
+ ## GitHub Action
202
295
 
203
- ### Programmatic API
296
+ AgentDoctor can run repository-level AI coding-agent configuration audits inside GitHub Actions and enforce CI policy gates.
204
297
 
205
- ```bash
206
- npm install @praneeth_54/agentdoctor
207
- ```
298
+ This Action is the **Safety / CI** surface (`action.yml`): Scan → policy gates → JSON report. It does **not** expose Project Brain or MCP. For Brain/MCP, use the CLI and [docs/mcp/brain-mcp.md](docs/mcp/brain-mcp.md).
208
299
 
209
- ```ts
210
- import { scan, verify, buildFixPlan, applyFixPlan } from "@praneeth_54/agentdoctor";
300
+ Recommended pin:
211
301
 
212
- const result = await scan({ cwd: process.cwd() });
213
- console.log(result.summary);
214
- console.log(result.scores?.overall);
215
- console.log(result.agentSecurityAnalysis); // "full" | "limited"
302
+ ```yaml
303
+ uses: pranee54/AgentDoctor@v1.1.0
216
304
  ```
217
305
 
218
- ---
306
+ For maximum supply-chain pinning, pin a full commit SHA of this repository. Do not use `@main`.
219
307
 
220
- ## Supported agents
308
+ ### CLI version default (intentional)
221
309
 
222
- Project-level configuration only (repository files). Global user settings are not scanned.
310
+ | Surface | Value |
311
+ | ---------------------------------- | -------------------------------------------- |
312
+ | Action release tag | `v1.1.0` (this repository’s Action metadata) |
313
+ | Action input `version` **default** | **`1.0.0`** |
223
314
 
224
- | Agent | What AgentDoctor inspects |
225
- | --------------- | ---------------------------------------------------------------------- |
226
- | **Cursor** | `.cursor/rules/*.mdc`, `.cursorignore`, Cursor MCP config, `AGENTS.md` |
227
- | **Claude Code** | `CLAUDE.md`, `.claude/settings*.json`, `.claude/rules`, MCP config |
228
- | **Codex** | `AGENTS.md` / overrides, project `.codex/` configuration |
315
+ The `v1.1.0` Action release still defaults to the published AgentDoctor **CLI `1.0.0`** for compatibility. That is intentional.
229
316
 
230
- Additional adapters are planned — see [ROADMAP.md](ROADMAP.md).
317
+ - Omit `version` (or set `version: "1.0.0"`) → install `@praneeth_54/agentdoctor@1.0.0`
318
+ - Set `version: "1.1.1"` explicitly when you want the newer CLI in CI
319
+ - `version: workspace` runs this repo’s built `dist/cli/index.js` (maintainers / local CI after `npm run build`)
320
+ - `latest` / `beta` dist-tags are also accepted
231
321
 
232
- ---
322
+ Project Brain and MCP are **not** started by this Action even when `version: "1.1.1"`. The Action still runs Safety scan/verify only.
233
323
 
234
- ## Finding categories
324
+ The Action is report-only until you set a policy input (`minimum-score`, `fail-on-severity`, `fail-on-rule`, or `fail-on-new` with `verify-baseline`).
235
325
 
236
- | Category | Examples |
237
- | ---------------- | --------------------------------------------------------------------- |
238
- | **Security** | Env-file exposure, private-key filenames, broad MCP filesystem scopes |
239
- | **Context** | Large instruction files, large logs, unignored generated directories |
240
- | **Instructions** | Empty instructions, duplicate content, missing path references |
241
- | **MCP** | Malformed MCP config, high-risk filesystem path arguments |
326
+ ### Examples
242
327
 
243
- Full catalog with severities and fixability: [docs/rules.md](docs/rules.md).
328
+ **1. Basic scan** (report-only; default CLI `1.0.0`):
244
329
 
245
- Explain any rule:
330
+ ```yaml
331
+ permissions:
332
+ contents: read
246
333
 
247
- ```bash
248
- npx @praneeth_54/agentdoctor explain security/env-file-exposure
334
+ steps:
335
+ - uses: actions/checkout@v4
336
+
337
+ - name: Audit coding-agent configuration
338
+ id: agentdoctor
339
+ uses: pranee54/AgentDoctor@v1.1.0
340
+ with:
341
+ path: .
249
342
  ```
250
343
 
251
- ---
344
+ **2. Minimum readiness score:**
252
345
 
253
- ## Privacy and trust
346
+ ```yaml
347
+ - uses: pranee54/AgentDoctor@v1.1.0
348
+ with:
349
+ path: .
350
+ minimum-score: "70"
351
+ ```
254
352
 
255
- **Scans run locally on your machine.**
353
+ **3. Severity gate:**
256
354
 
257
- AgentDoctor:
355
+ ```yaml
356
+ - uses: pranee54/AgentDoctor@v1.1.0
357
+ with:
358
+ path: .
359
+ fail-on-severity: critical
360
+ ```
258
361
 
259
- - does not require an API key
260
- - does not upload repository contents by default
261
- - does not call an LLM for core scanning
262
- - does not execute MCP servers
263
- - does not execute project code
264
- - never prints secret values from files it flags by name
265
- - enforces repository boundary checks for path references and symlink escape
362
+ **4. Rule gate:**
266
363
 
267
- This is still software that reads untrusted repository trees. Treat findings as guidance, not a security certification. AgentDoctor is **not** a complete secret-content scanner.
364
+ ```yaml
365
+ - uses: pranee54/AgentDoctor@v1.1.0
366
+ with:
367
+ path: .
368
+ fail-on-rule: security/env-file-exposure
369
+ ```
268
370
 
269
- ---
371
+ **5. Baseline verification:**
270
372
 
271
- ## CI usage
373
+ ```yaml
374
+ - uses: pranee54/AgentDoctor@v1.1.0
375
+ with:
376
+ path: .
377
+ verify-baseline: agentdoctor-report.json
378
+ fail-on-new: "true"
379
+ ```
272
380
 
273
- ### GitHub Action
381
+ **6. JSON report** (default `json-output: "true"`; customize path):
274
382
 
275
- Run AgentDoctor directly in a workflow:
383
+ ```yaml
384
+ - uses: pranee54/AgentDoctor@v1.1.0
385
+ id: agentdoctor
386
+ with:
387
+ path: .
388
+ json-output: "true"
389
+ output-file: agentdoctor-report.json
390
+
391
+ - uses: actions/upload-artifact@v4
392
+ with:
393
+ name: agentdoctor-report
394
+ path: ${{ steps.agentdoctor.outputs.report-path }}
395
+ ```
396
+
397
+ **7. GitHub summary:**
398
+
399
+ ```yaml
400
+ - uses: pranee54/AgentDoctor@v1.1.0
401
+ with:
402
+ path: .
403
+ summary: "true"
404
+ ```
405
+
406
+ **8. GitHub annotations:**
407
+
408
+ ```yaml
409
+ - uses: pranee54/AgentDoctor@v1.1.0
410
+ with:
411
+ path: .
412
+ annotations: "true"
413
+ ```
414
+
415
+ **Combined policy example** (explicit newer CLI):
276
416
 
277
417
  ```yaml
278
418
  permissions:
@@ -283,148 +423,219 @@ steps:
283
423
 
284
424
  - name: Audit coding-agent configuration
285
425
  id: agentdoctor
286
- uses: pranee54/AgentDoctor@v1.0.0
426
+ uses: pranee54/AgentDoctor@v1.1.0
287
427
  with:
288
428
  path: .
289
- version: "1.0.0"
429
+ version: "1.1.1"
290
430
  output-file: agentdoctor-report.json
431
+ json-output: "true"
291
432
  minimum-score: "70"
292
433
  fail-on-severity: critical
293
434
  summary: "true"
435
+ annotations: "true"
294
436
 
295
437
  - name: Upload AgentDoctor report
438
+ if: always()
296
439
  uses: actions/upload-artifact@v4
297
440
  with:
298
441
  name: agentdoctor-report
299
442
  path: ${{ steps.agentdoctor.outputs.report-path }}
300
443
  ```
301
444
 
302
- Policy inputs: `minimum-score`, `fail-on-severity`, `fail-on-rule`, `fail-on-new`,
303
- `verify-baseline`, `summary`, `annotations`. The Action stays report-only until you set a
304
- policy input. Explicitly set `version: "1.0.0"` after npm publish (the Action default remains
305
- `0.3.0-beta` until that post-publish bump). For local CI against this repo, use
306
- `version: workspace` after `npm run build`. The action installs `@praneeth_54/agentdoctor`,
307
- runs scan (or `verify` when `verify-baseline` is set) with `--json`, and writes the report
308
- inside the workspace.
445
+ ### Inputs
309
446
 
310
- ### CLI
447
+ From [`action.yml`](action.yml):
311
448
 
312
- Use JSON directly in other CI systems:
449
+ | Input | Required | Default | Description |
450
+ | ------------------ | -------- | ------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
451
+ | `path` | no | `.` | Repository-relative directory to scan. |
452
+ | `version` | no | `1.0.0` | Published AgentDoctor npm version or dist-tag (`latest` \| `beta`), or `workspace` to run the checked-out repository’s built CLI at `dist/cli/index.js`. |
453
+ | `output-file` | no | `agentdoctor-report.json` | Repository-relative path for the JSON report. |
454
+ | `minimum-score` | no | _(empty)_ | Fail when overall readiness score is below this integer (0–100). Empty skips the gate. |
455
+ | `fail-on-severity` | no | _(empty)_ | Fail when any finding has this severity or higher (`critical` \| `warning` \| `info`). Empty skips the gate. |
456
+ | `fail-on-rule` | no | _(empty)_ | Comma-separated rule IDs that fail CI when present (e.g. `security/env-file-exposure`). |
457
+ | `fail-on-new` | no | _(empty)_ | When `verify-baseline` is set, fail on new findings vs the baseline. Defaults to true whenever `verify-baseline` is non-empty unless set to `false`. |
458
+ | `verify-baseline` | no | _(empty)_ | Repository-relative path to a prior scan JSON baseline. When set, runs `agentdoctor verify` instead of scan. |
459
+ | `json-output` | no | `true` | Write a JSON report to `output-file` (`true`/`false`). |
460
+ | `summary` | no | `false` | Write a GitHub Actions job step summary (requires CLI with `--summary` support). |
461
+ | `annotations` | no | `false` | Emit GitHub Actions annotations for findings (requires CLI with `--annotations` support). |
313
462
 
314
- ```bash
315
- # Report-only (exit 0 even when findings exist; scores still in JSON)
316
- npx @praneeth_54/agentdoctor --json
463
+ ### Outputs
317
464
 
318
- # Fail when any critical finding exists
319
- npx @praneeth_54/agentdoctor --ci --json
465
+ | Output | Description |
466
+ | --------------- | ------------------------------------------------------------------------------- |
467
+ | `report-path` | Absolute path to the generated JSON report (empty when `json-output` is false). |
468
+ | `outcome` | `success` \| `policy-failure` \| `configuration-error` \| `internal-failure` |
469
+ | `overall-score` | Overall readiness score from the scan/verify result when available. |
320
470
 
321
- # Fail when overall readiness is below 70 (with --ci also fails on criticals)
322
- npx @praneeth_54/agentdoctor --ci --json --min-score 70
471
+ | `outcome` value | Meaning |
472
+ | --------------------- | ----------------------------------------------------- |
473
+ | `success` | Scan/verify completed without a failing policy gate. |
474
+ | `policy-failure` | A configured policy gate failed (exit `1`). |
475
+ | `configuration-error` | Invalid Action/CLI configuration or usage (exit `2`). |
476
+ | `internal-failure` | Unexpected failure during execution. |
323
477
 
324
- # Fail on warning-or-higher (overrides the default critical gate from --ci)
325
- npx @praneeth_54/agentdoctor --ci --json --fail-on-severity warning
326
- ```
478
+ Exit-code details: [docs/exit-codes.md](docs/exit-codes.md). Scoring: [docs/scoring.md](docs/scoring.md).
479
+
480
+ ### Action security notes
481
+
482
+ Controls implemented in `action.yml`:
327
483
 
328
- `--ci` fails when any **critical** finding exists. Override the severity floor with
329
- `--fail-on-severity`, and use `--min-score` / `--fail-on-rule` for additional gates.
330
- Omit `--ci` for report-only JSON (exit `0` even when findings exist).
484
+ - Paths must stay inside `GITHUB_WORKSPACE` (`realpath` + containment checks)
485
+ - Traversal and parent-escape attempts are rejected
486
+ - Symlink escapes for `output-file` parents / final file and for `verify-baseline` are rejected
487
+ - Newlines in Action path inputs are rejected
488
+ - `output-file` must resolve to a regular file path inside the workspace (not a directory or symlink)
489
+ - `verify-baseline` must exist, realpath back into the workspace, and remain a file
490
+ - `version` must match an exact npm semver, `latest`/`beta`, or `workspace`
491
+ - No Action-level credential inputs
331
492
 
332
- Exit codes: [docs/exit-codes.md](docs/exit-codes.md). Compatibility promises: [docs/compatibility.md](docs/compatibility.md).
493
+ Boundary (honest): the Action executes AgentDoctor against repository contents (treated as untrusted) and, except for `version: workspace`, may invoke `npm exec` against the public npm registry. This is not a claim of universal security.
333
494
 
334
- ### Readiness scoring
495
+ Related: [SECURITY.md](SECURITY.md)
335
496
 
336
- Scans populate `scoringAvailable: true` and a deterministic `scores` object
337
- (overall, categories, agents). The terminal prints overall readiness; category and agent
338
- scores are in JSON (`--json`).
497
+ ### Action versioning
339
498
 
340
- `--min-score N` is enforced by the CLI. Details (weights, security caps, threshold rules,
341
- and deferred v2 items): [docs/scoring.md](docs/scoring.md).
499
+ | Recommendation | Value |
500
+ | -------------- | ----------------------------------- |
501
+ | Preferred tag | `uses: pranee54/AgentDoctor@v1.1.0` |
502
+ | Stronger pin | Full commit SHA of this repository |
503
+ | Avoid | `@main` |
504
+
505
+ The existing `v1.1.0` product tag is the Action metadata consumers should pin today. Changing the Action’s default CLI `version` input is a separate, explicit decision and is **not** done in this documentation update.
342
506
 
343
507
  ---
344
508
 
345
- ## Known limitations
509
+ ## Try it yourself
346
510
 
347
- Honest limits of v1:
511
+ 1. **Install:** `npx @praneeth_54/agentdoctor@1.1.1 --help`
512
+ 2. **Run Brain MCP:** `agentdoctor brain-mcp --root /ABSOLUTE/PATH/TO/YOUR/PROJECT`
513
+ 3. **Connect MCP:** copy [examples/mcp/cursor.mcp.json](examples/mcp/cursor.mcp.json) (or Claude / Codex siblings) with absolute paths
514
+ 4. **First query:** call `brain_overview`
515
+ 5. **Demo:** [docs/demo/first-5-minutes.md](docs/demo/first-5-minutes.md)
348
516
 
349
- | Limitation | Status |
350
- | --------------------------- | ------------------------------------------------------------------------------- |
351
- | Automatic fixes | Safe Cursor / Claude Code / Codex context exclusions only |
352
- | Security findings | Review/manual — Fix does not rewrite secrets or security modes |
353
- | Secret-content scanning | Filename / config heuristics only |
354
- | Detection style | Intentionally conservative; false security findings are avoided |
355
- | Agent coverage | Cursor, Claude Code, Codex project configs |
356
- | Missing-path residual noise | Broad path-lattice expansion deferred; instruction-directory resolution shipped |
517
+ ### Built for developers who care about repository understanding
357
518
 
358
- See [CHANGELOG.md](CHANGELOG.md) and [docs/compatibility.md](docs/compatibility.md).
519
+ | Link | Purpose |
520
+ | ------------------------------------------------------------------------------ | ------------------------------ |
521
+ | [docs/quickstart.md](docs/quickstart.md) | 5-minute path to MCP |
522
+ | [docs/demo/first-5-minutes.md](docs/demo/first-5-minutes.md) | Practical walkthrough |
523
+ | [docs/demo/architecture-walkthrough.md](docs/demo/architecture-walkthrough.md) | Architecture for evaluators |
524
+ | [docs/why-agentdoctor.md](docs/why-agentdoctor.md) | Why this exists |
525
+ | [docs/engineering-lessons.md](docs/engineering-lessons.md) | Real 1.1.0 engineering lessons |
526
+ | [CONTRIBUTING.md](CONTRIBUTING.md) | Dev setup + gates |
527
+ | [docs/community/good-first-issues.md](docs/community/good-first-issues.md) | Starter contributions |
528
+ | [ROADMAP.md](ROADMAP.md) | Shipped vs planned |
529
+ | [docs/mcp/brain-mcp.md](docs/mcp/brain-mcp.md) | MCP contract |
359
530
 
360
- ---
531
+ Primary ask: run AgentDoctor on a repository you know well. If the Brain is wrong or incomplete, [file a Brain-quality issue](.github/ISSUE_TEMPLATE/brain-quality.md).
361
532
 
362
- ## Architecture
533
+ ---
363
534
 
364
- ```text
365
- Discovery → Project detect → Agent adapters → Rule engine → Findings → Scores → Terminal / JSON
535
+ ## MCP Quick Start
536
+
537
+ Configs: [examples/mcp/](examples/mcp/). Use placeholders — never commit machine paths.
538
+
539
+ **Cursor** ([examples/mcp/cursor.mcp.json](examples/mcp/cursor.mcp.json)):
540
+
541
+ ```json
542
+ {
543
+ "mcpServers": {
544
+ "agentdoctor-brain": {
545
+ "command": "node",
546
+ "args": [
547
+ "/ABSOLUTE/PATH/TO/AgentDoctor/dist/cli/index.js",
548
+ "brain-mcp",
549
+ "--root",
550
+ "/ABSOLUTE/PATH/TO/YOUR/PROJECT"
551
+ ]
552
+ }
553
+ }
554
+ }
366
555
  ```
367
556
 
368
- Details: [docs/architecture.md](docs/architecture.md)
557
+ Also: [examples/mcp/claude-code.mcp.json](examples/mcp/claude-code.mcp.json), [examples/mcp/codex.config.toml](examples/mcp/codex.config.toml).
558
+
559
+ Tip: rebuild or ensure a snapshot exists before attaching an agent if the repository is large.
560
+
561
+ ---
562
+
563
+ ## Design Boundaries
564
+
565
+ | AgentDoctor IS | AgentDoctor IS NOT |
566
+ | ------------------------ | ---------------------------------- |
567
+ | Repository understanding | Chatbot |
568
+ | Structured Project Brain | Generic RAG / AI memory |
569
+ | Evidence-backed claims | Autonomous coding agent |
570
+ | MCP interface | Vulnerability scanner |
571
+ | Change-danger analysis | “Understands every repo perfectly” |
572
+ | Snapshots / deltas | Zero-hallucination guarantee |
573
+
574
+ ---
575
+
576
+ ## Release 1.1.0
577
+
578
+ Version verified in `package.json` / `PACKAGE_VERSION`: **1.1.0** (also on npm).
579
+
580
+ Shipped: Project Brain packaging, `brain-mcp`, ten provenance tools, snapshots/delta, agent validation harness + docs. Safety V1 unchanged.
581
+
582
+ [docs/release-notes-v1.1.0.md](docs/release-notes-v1.1.0.md) · [CHANGELOG.md](CHANGELOG.md)
583
+
584
+ GitHub Action usage and the intentional CLI `version` default (`1.0.0`): [GitHub Action](#github-action).
369
585
 
370
586
  ---
371
587
 
372
588
  ## Documentation
373
589
 
374
- | Doc | Contents |
375
- | ------------------------------------------------------------------ | ------------------------------- |
376
- | [docs/README.md](docs/README.md) | Documentation index |
377
- | [docs/architecture.md](docs/architecture.md) | Scan pipeline |
378
- | [docs/rules.md](docs/rules.md) | Stable rule IDs |
379
- | [docs/exit-codes.md](docs/exit-codes.md) | Process exit codes |
380
- | [docs/scoring.md](docs/scoring.md) | Readiness scoring specification |
381
- | [docs/compatibility.md](docs/compatibility.md) | Beta compatibility promises |
382
- | [docs/development.md](docs/development.md) | Local development |
383
- | [docs/github-launch-checklist.md](docs/github-launch-checklist.md) | GitHub About / topics / launch |
384
- | [ROADMAP.md](ROADMAP.md) | Near- and medium-term plans |
385
- | [CHANGELOG.md](CHANGELOG.md) | Release history |
590
+ | Doc | Contents |
591
+ | ------------------------------------------------------------ | ------------------------- |
592
+ | [docs/quickstart.md](docs/quickstart.md) | Developer quickstart |
593
+ | [docs/project-brain.md](docs/project-brain.md) | Project Brain model |
594
+ | [docs/mcp/brain-mcp.md](docs/mcp/brain-mcp.md) | MCP contract |
595
+ | [docs/demo/brain-mcp-demo.md](docs/demo/brain-mcp-demo.md) | Fixture-backed MCP demo |
596
+ | [docs/demo/first-5-minutes.md](docs/demo/first-5-minutes.md) | 5-minute walkthrough |
597
+ | [docs/why-agentdoctor.md](docs/why-agentdoctor.md) | Product rationale |
598
+ | [docs/engineering-lessons.md](docs/engineering-lessons.md) | 1.1.0 engineering lessons |
599
+ | [docs/release-notes-v1.1.0.md](docs/release-notes-v1.1.0.md) | 1.1.0 notes |
600
+ | [SECURITY.md](SECURITY.md) | Vulnerability reporting |
601
+ | [ROADMAP.md](ROADMAP.md) | Shipped vs planned |
602
+ | [docs/README.md](docs/README.md) | Full index |
386
603
 
387
604
  ---
388
605
 
389
- ## Contributing
606
+ ## Roadmap
607
+
608
+ From [ROADMAP.md](ROADMAP.md):
390
609
 
391
- Issues and pull requests are welcome.
610
+ | Status | Focus |
611
+ | -------------- | --------------------------------------------------------------------------------- |
612
+ | 🟢 Shipped | Safety `1.0.x`; Project Brain → MCP → Agent (`1.1.0`) |
613
+ | 🟡 Next | Developer adoption: feedback, Brain quality, docs/ecosystem (not a new Brain API) |
614
+ | 🟡 Planned | Agent Context layer; change-aware / reliable agent context; Brain Delta workflows |
615
+ | 🔵 Exploratory | CI/PR Brain analysis; team-scale intelligence; additional MCP transports |
392
616
 
393
- 1. Read [CONTRIBUTING.md](CONTRIBUTING.md) and the [Code of Conduct](CODE_OF_CONDUCT.md)
394
- 2. Prefer [good first issues](docs/good-first-issues.md) ideas
395
- 3. Report security issues via [SECURITY.md](SECURITY.md) — never paste real secrets into issues
617
+ Non-goals: chatbot / RAG memory, autonomous coding agent, vulnerability-scanner replacement, fabricated ownership.
618
+
619
+ ---
620
+
621
+ ## Contributing
622
+
623
+ [CONTRIBUTING.md](CONTRIBUTING.md) · [Code of Conduct](CODE_OF_CONDUCT.md) · [good first issues](docs/good-first-issues.md)
396
624
 
397
625
  ```bash
398
626
  git clone https://github.com/pranee54/AgentDoctor.git
399
627
  cd AgentDoctor
400
628
  npm install
401
629
  npm run verify
402
- node dist/cli/index.js ./fixtures/clean-configured-project
403
630
  ```
404
631
 
405
632
  ---
406
633
 
407
- ## Project Brain (separate laboratory capability)
408
-
409
- AgentDoctor V1 ships the **safety** product: Scan → Fix → Verify → Policy → CI.
410
-
411
- A parallel **Project Brain** engineering layer lives under `src/core/understanding/` (durable local claims, evidence, snapshots, query/trace/delta). It is:
412
-
413
- - **not** part of the published npm package (`tsconfig.build` excludes it)
414
- - **not** wired into the public CLI
415
- - documented in [docs/project-brain.md](docs/project-brain.md)
416
-
417
- See [PROJECT_AUDIT.txt](PROJECT_AUDIT.txt) and [RELEASE_CHECKLIST.txt](RELEASE_CHECKLIST.txt).
418
-
419
- ---
634
+ ## Security
420
635
 
421
- ## Next steps
636
+ Local analysis. No API key for core Brain/Safety. No default upload. Redacted Brain serialization.
422
637
 
423
- - **Try it:** `npx @praneeth_54/agentdoctor`
424
- - **Report a false positive / false negative:** use the issue templates (include version, rule ID, anonymized evidence — no secrets)
425
- - **Propose a rule or adapter:** [feature request](.github/ISSUE_TEMPLATE/feature_request.md) / [rule proposal](.github/ISSUE_TEMPLATE/rule_proposal.md)
426
- - **Contribute:** [CONTRIBUTING.md](CONTRIBUTING.md)
427
- - **Useful?** Star or watch the repository so you see updates
638
+ Report privately via [SECURITY.md](SECURITY.md).
428
639
 
429
640
  ---
430
641