@praneeth_54/agentdoctor 1.1.1 → 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 +164 -7
- package/README.md +263 -513
- package/dist/agents/aider/adapter.d.ts +1 -0
- package/dist/agents/aider/adapter.js +1 -0
- package/dist/agents/aider/detector.d.ts +14 -0
- package/dist/agents/aider/detector.js +120 -0
- package/dist/agents/copilot/adapter.d.ts +1 -0
- package/dist/agents/copilot/adapter.js +1 -0
- package/dist/agents/copilot/detector.d.ts +13 -0
- package/dist/agents/copilot/detector.js +113 -0
- package/dist/agents/gemini/adapter.d.ts +1 -0
- package/dist/agents/gemini/adapter.js +1 -0
- package/dist/agents/gemini/detector.d.ts +13 -0
- package/dist/agents/gemini/detector.js +151 -0
- package/dist/agents/registry.js +13 -1
- package/dist/agents/types.d.ts +1 -1
- package/dist/agents/windsurf/adapter.d.ts +1 -0
- package/dist/agents/windsurf/adapter.js +1 -0
- package/dist/agents/windsurf/detector.d.ts +14 -0
- package/dist/agents/windsurf/detector.js +119 -0
- package/dist/architecture/c4.d.ts +22 -0
- package/dist/architecture/c4.js +62 -0
- package/dist/architecture/contract.d.ts +64 -0
- package/dist/architecture/contract.js +373 -0
- package/dist/assurance/change.d.ts +211 -0
- package/dist/assurance/change.js +624 -0
- package/dist/assurance/proof.d.ts +136 -0
- package/dist/assurance/proof.js +338 -0
- package/dist/auth/index.d.ts +81 -0
- package/dist/auth/index.js +130 -0
- package/dist/auth/rbac.d.ts +9 -0
- package/dist/auth/rbac.js +26 -0
- package/dist/cli/commands/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/brain.d.ts +12 -0
- package/dist/cli/commands/brain.js +162 -0
- package/dist/cli/commands/complete.d.ts +23 -0
- package/dist/cli/commands/complete.js +232 -0
- package/dist/cli/commands/explain.js +1 -1
- package/dist/cli/commands/fix.js +22 -2
- package/dist/cli/commands/mcp.d.ts +8 -0
- package/dist/cli/commands/mcp.js +14 -0
- package/dist/cli/commands/platform.d.ts +17 -0
- package/dist/cli/commands/platform.js +195 -0
- 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/v2.d.ts +55 -0
- package/dist/cli/commands/v2.js +278 -0
- package/dist/cli/commands/workspace.d.ts +9 -0
- package/dist/cli/commands/workspace.js +82 -0
- package/dist/cli/program.js +1328 -3
- package/dist/constants.d.ts +3 -2
- package/dist/constants.js +5 -1
- package/dist/contracts/adapters.d.ts +7 -0
- package/dist/contracts/adapters.js +60 -0
- package/dist/contracts/index.d.ts +162 -0
- package/dist/contracts/index.js +18 -0
- package/dist/core/baseline/store.d.ts +48 -0
- package/dist/core/baseline/store.js +163 -0
- package/dist/core/brain-cli/service.d.ts +26 -0
- package/dist/core/brain-cli/service.js +175 -0
- package/dist/core/brain-product/init.d.ts +45 -0
- package/dist/core/brain-product/init.js +235 -0
- package/dist/core/changes/analyze.d.ts +41 -0
- package/dist/core/changes/analyze.js +223 -0
- package/dist/core/context-health/analyze.d.ts +15 -0
- package/dist/core/context-health/analyze.js +234 -0
- package/dist/core/fix/apply.d.ts +21 -4
- package/dist/core/fix/apply.js +118 -18
- package/dist/core/fix/backup.d.ts +30 -0
- package/dist/core/fix/backup.js +193 -0
- package/dist/core/fix/plan.d.ts +6 -3
- package/dist/core/fix/plan.js +113 -9
- package/dist/core/fix/render.d.ts +2 -0
- package/dist/core/fix/render.js +36 -21
- package/dist/core/fix/run.js +5 -1
- package/dist/core/fix/safe-target.d.ts +14 -0
- package/dist/core/fix/safe-target.js +81 -0
- package/dist/core/fix/types.d.ts +12 -1
- package/dist/core/fix/types.js +2 -0
- package/dist/core/fix/writers/claude-settings.js +3 -1
- package/dist/core/fix/writers/codex-config.d.ts +3 -0
- package/dist/core/fix/writers/codex-config.js +24 -3
- package/dist/core/fix/writers/cursorignore.js +3 -1
- package/dist/core/fix/writers/simple-ignore.d.ts +16 -0
- package/dist/core/fix/writers/simple-ignore.js +68 -0
- package/dist/core/monorepo/detect.d.ts +13 -0
- package/dist/core/monorepo/detect.js +121 -0
- package/dist/core/rules/build-context.js +22 -3
- package/dist/core/rules/context/generated-directory.js +11 -1
- package/dist/core/rules/context/large-instruction-file.js +6 -0
- package/dist/core/rules/context/large-log-file.js +16 -1
- package/dist/core/rules/ignore.d.ts +11 -1
- package/dist/core/rules/ignore.js +22 -1
- package/dist/core/rules/instructions/empty-instructions.js +7 -0
- package/dist/core/rules/security/env-file-exposure.js +23 -2
- package/dist/core/rules/security/private-key-file.js +1 -1
- package/dist/core/scanner/scan.js +1 -1
- package/dist/core/schemas/validate.d.ts +6 -0
- package/dist/core/schemas/validate.js +62 -0
- package/dist/core/scoring/compute-scores.d.ts +1 -1
- package/dist/core/scoring/compute-scores.js +5 -1
- package/dist/core/scoring/placeholder.d.ts +1 -1
- package/dist/core/scoring/placeholder.js +5 -1
- package/dist/core/secrets/scan.d.ts +29 -0
- package/dist/core/secrets/scan.js +172 -0
- 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 +24 -0
- package/dist/dashboard/server.js +402 -0
- package/dist/enforcement/runner.d.ts +67 -0
- package/dist/enforcement/runner.js +460 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.js +25 -0
- package/dist/integrations/github/pr-analyze.d.ts +28 -0
- package/dist/integrations/github/pr-analyze.js +98 -0
- package/dist/integrations/local-ai/provider.d.ts +45 -0
- package/dist/integrations/local-ai/provider.js +104 -0
- package/dist/intelligence/git/analyze.d.ts +34 -0
- package/dist/intelligence/git/analyze.js +136 -0
- package/dist/intelligence/graph/build.d.ts +15 -0
- package/dist/intelligence/graph/build.js +259 -0
- 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/knowledge/store.d.ts +25 -0
- package/dist/knowledge/store.js +91 -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/agentdoctor/server.d.ts +16 -0
- package/dist/mcp/agentdoctor/server.js +67 -0
- package/dist/mcp/brain/session.js +7 -7
- package/dist/mcp/intelligence/handlers.d.ts +16 -0
- package/dist/mcp/intelligence/handlers.js +364 -0
- package/dist/mcp/intelligence/path-safety.d.ts +9 -0
- package/dist/mcp/intelligence/path-safety.js +63 -0
- package/dist/mcp/intelligence/registry.d.ts +8 -0
- package/dist/mcp/intelligence/registry.js +228 -0
- package/dist/ops/health.d.ts +18 -0
- package/dist/ops/health.js +51 -0
- package/dist/platform/ai-quality/analyze.d.ts +9 -0
- package/dist/platform/ai-quality/analyze.js +65 -0
- package/dist/platform/architecture/drift.d.ts +17 -0
- package/dist/platform/architecture/drift.js +74 -0
- package/dist/platform/auth/local.d.ts +15 -0
- package/dist/platform/auth/local.js +58 -0
- package/dist/platform/context-security/analyze.d.ts +6 -0
- package/dist/platform/context-security/analyze.js +97 -0
- package/dist/platform/firewall/evaluate.d.ts +57 -0
- package/dist/platform/firewall/evaluate.js +359 -0
- package/dist/platform/graph/build.d.ts +6 -0
- package/dist/platform/graph/build.js +189 -0
- package/dist/platform/health/analyze.d.ts +7 -0
- package/dist/platform/health/analyze.js +192 -0
- package/dist/platform/index.d.ts +27 -0
- package/dist/platform/index.js +89 -0
- package/dist/platform/knowledge/analyze.d.ts +20 -0
- package/dist/platform/knowledge/analyze.js +96 -0
- package/dist/platform/provenance/build.d.ts +44 -0
- package/dist/platform/provenance/build.js +65 -0
- package/dist/platform/readiness/scorecard.d.ts +5 -0
- package/dist/platform/readiness/scorecard.js +98 -0
- package/dist/platform/refactor/impact.d.ts +20 -0
- package/dist/platform/refactor/impact.js +60 -0
- package/dist/platform/reports/export.d.ts +12 -0
- package/dist/platform/reports/export.js +92 -0
- package/dist/platform/security/redact.d.ts +15 -0
- package/dist/platform/security/redact.js +87 -0
- package/dist/platform/sessions/store.d.ts +32 -0
- package/dist/platform/sessions/store.js +97 -0
- package/dist/platform/store.d.ts +6 -0
- package/dist/platform/store.js +57 -0
- package/dist/platform/test-impact/analyze.d.ts +50 -0
- package/dist/platform/test-impact/analyze.js +350 -0
- package/dist/platform/time-machine/compare.d.ts +17 -0
- package/dist/platform/time-machine/compare.js +62 -0
- package/dist/platform/tokens/plan.d.ts +28 -0
- package/dist/platform/tokens/plan.js +108 -0
- package/dist/platform/types.d.ts +120 -0
- package/dist/platform/types.js +5 -0
- package/dist/plugins/runtime.d.ts +36 -0
- package/dist/plugins/runtime.js +101 -0
- package/dist/plugins/sdk.d.ts +29 -0
- package/dist/plugins/sdk.js +114 -0
- package/dist/policy/compose.d.ts +34 -0
- package/dist/policy/compose.js +118 -0
- package/dist/policy/packs.d.ts +9 -0
- package/dist/policy/packs.js +91 -0
- package/dist/reporters/terminal/report.js +38 -5
- 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 +30 -0
- package/dist/storage/provider.js +109 -0
- package/dist/storage/sqlite.d.ts +33 -0
- package/dist/storage/sqlite.js +77 -0
- package/dist/team/auth.d.ts +35 -0
- package/dist/team/auth.js +70 -0
- package/dist/types/index.d.ts +5 -1
- package/dist/workspace/index.d.ts +69 -0
- package/dist/workspace/index.js +220 -0
- package/package.json +15 -5
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
export declare const EVIDENCE_SCHEMA_VERSION = "1.0.0";
|
|
2
|
+
export type VerificationStatus = "not-run" | "partial" | "evidence-produced" | "failed" | "verified";
|
|
3
|
+
export interface ChangeAssessment {
|
|
4
|
+
changeId: string;
|
|
5
|
+
schemaVersion: string;
|
|
6
|
+
agentDoctorVersion: string;
|
|
7
|
+
repository: {
|
|
8
|
+
root: string;
|
|
9
|
+
remote: string | null;
|
|
10
|
+
branch: string | null;
|
|
11
|
+
};
|
|
12
|
+
baseRevision: string | null;
|
|
13
|
+
targetRevision: string | null;
|
|
14
|
+
changedFiles: Array<{
|
|
15
|
+
path: string;
|
|
16
|
+
kind: string;
|
|
17
|
+
}>;
|
|
18
|
+
changedSymbols: string[];
|
|
19
|
+
/** Graph nodes / paths that call or import into changed symbols/files. */
|
|
20
|
+
callers: string[];
|
|
21
|
+
/** Graph targets called or imported from changed symbols/files. */
|
|
22
|
+
callees: string[];
|
|
23
|
+
/** Files that import changed files (reverse import deps). */
|
|
24
|
+
reverseDependencies: string[];
|
|
25
|
+
/** Workspace packages touched by changed files (from package.json workspaces when present). */
|
|
26
|
+
packageImpact: string[];
|
|
27
|
+
affectedComponents: string[];
|
|
28
|
+
dependencyImpact: {
|
|
29
|
+
status: "observed" | "unknown" | "heuristic";
|
|
30
|
+
relatedPaths: string[];
|
|
31
|
+
edgeCount: number;
|
|
32
|
+
limitations: string[];
|
|
33
|
+
};
|
|
34
|
+
architectureImpact: {
|
|
35
|
+
status: "inferred" | "unknown";
|
|
36
|
+
viewLevels: string[];
|
|
37
|
+
limitations: string[];
|
|
38
|
+
};
|
|
39
|
+
knowledgeReferences: Array<{
|
|
40
|
+
id: string;
|
|
41
|
+
title: string;
|
|
42
|
+
status: string;
|
|
43
|
+
authoritative: boolean;
|
|
44
|
+
}>;
|
|
45
|
+
securityFindings: {
|
|
46
|
+
secretFindingCount: number;
|
|
47
|
+
mode: "heuristic";
|
|
48
|
+
limitations: string[];
|
|
49
|
+
};
|
|
50
|
+
policyResults: Array<{
|
|
51
|
+
policyId: string;
|
|
52
|
+
decision: string;
|
|
53
|
+
reason: string;
|
|
54
|
+
subject: string;
|
|
55
|
+
action: string;
|
|
56
|
+
evidence: string;
|
|
57
|
+
}>;
|
|
58
|
+
testImpact: {
|
|
59
|
+
mode: "heuristic" | "coverage-backed";
|
|
60
|
+
recommendedTests: string[];
|
|
61
|
+
confidence: "low" | "medium" | "high";
|
|
62
|
+
limitations: string[];
|
|
63
|
+
};
|
|
64
|
+
evidence: {
|
|
65
|
+
directory: string | null;
|
|
66
|
+
files: string[];
|
|
67
|
+
};
|
|
68
|
+
verificationStatus: VerificationStatus;
|
|
69
|
+
limitations: string[];
|
|
70
|
+
createdAt: string;
|
|
71
|
+
}
|
|
72
|
+
export interface EvidenceManifest {
|
|
73
|
+
schemaVersion: string;
|
|
74
|
+
agentDoctorVersion: string;
|
|
75
|
+
changeId: string;
|
|
76
|
+
repositoryRoot: string;
|
|
77
|
+
baseRevision: string | null;
|
|
78
|
+
targetRevision: string | null;
|
|
79
|
+
createdAt: string;
|
|
80
|
+
files: Array<{
|
|
81
|
+
name: string;
|
|
82
|
+
sha256: string;
|
|
83
|
+
}>;
|
|
84
|
+
verificationStatus: VerificationStatus;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Derive callers / callees / reverse import deps from the intelligence graph
|
|
88
|
+
* for the given changed files and symbol ids. Honest: empty when graph lacks edges.
|
|
89
|
+
*/
|
|
90
|
+
export declare function deriveGraphChangeImpact(graph: {
|
|
91
|
+
nodes: Array<{
|
|
92
|
+
id: string;
|
|
93
|
+
kind: string;
|
|
94
|
+
label: string;
|
|
95
|
+
path?: string;
|
|
96
|
+
}>;
|
|
97
|
+
edges: Array<{
|
|
98
|
+
from: string;
|
|
99
|
+
to: string;
|
|
100
|
+
kind: string;
|
|
101
|
+
}>;
|
|
102
|
+
}, changedFiles: Array<{
|
|
103
|
+
path: string;
|
|
104
|
+
kind: string;
|
|
105
|
+
}>, changedSymbols: string[]): {
|
|
106
|
+
callers: string[];
|
|
107
|
+
callees: string[];
|
|
108
|
+
reverseDependencies: string[];
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* Map changed files onto package.json workspaces (string globs or packages/*).
|
|
112
|
+
* Returns [] when workspaces are absent — does not invent packages.
|
|
113
|
+
*/
|
|
114
|
+
export declare function derivePackageImpact(root: string, changedFiles: Array<{
|
|
115
|
+
path: string;
|
|
116
|
+
}>): Promise<string[]>;
|
|
117
|
+
/**
|
|
118
|
+
* Assemble a ChangeAssessment from existing AgentDoctor signals.
|
|
119
|
+
* Never sets verificationStatus to "verified" — that requires evidence verify.
|
|
120
|
+
*/
|
|
121
|
+
export declare function analyzeChange(options: {
|
|
122
|
+
root: string;
|
|
123
|
+
since?: string;
|
|
124
|
+
changeId?: string;
|
|
125
|
+
coveragePath?: string;
|
|
126
|
+
}): Promise<ChangeAssessment>;
|
|
127
|
+
/**
|
|
128
|
+
* Persist evidence bundle. Status becomes evidence-produced (not "verified").
|
|
129
|
+
* "verified" is reserved for evidence verify when artifact hashes match.
|
|
130
|
+
*/
|
|
131
|
+
export declare function verifyChange(options: {
|
|
132
|
+
root: string;
|
|
133
|
+
since?: string;
|
|
134
|
+
changeId?: string;
|
|
135
|
+
coveragePath?: string;
|
|
136
|
+
}): Promise<{
|
|
137
|
+
assessment: ChangeAssessment;
|
|
138
|
+
manifest: EvidenceManifest;
|
|
139
|
+
}>;
|
|
140
|
+
/**
|
|
141
|
+
* Human-readable explanation of a ChangeAssessment (does not claim correctness).
|
|
142
|
+
*/
|
|
143
|
+
export declare function explainChange(assessment: ChangeAssessment): string;
|
|
144
|
+
/**
|
|
145
|
+
* Summarize base/target file diffs from git for a change.
|
|
146
|
+
*/
|
|
147
|
+
export declare function diffChange(options: {
|
|
148
|
+
root: string;
|
|
149
|
+
since?: string;
|
|
150
|
+
changeId?: string;
|
|
151
|
+
}): Promise<{
|
|
152
|
+
changeId: string | null;
|
|
153
|
+
baseRevision: string | null;
|
|
154
|
+
targetRevision: string | null;
|
|
155
|
+
files: Array<{
|
|
156
|
+
path: string;
|
|
157
|
+
kind: string;
|
|
158
|
+
}>;
|
|
159
|
+
summary: {
|
|
160
|
+
added: number;
|
|
161
|
+
modified: number;
|
|
162
|
+
deleted: number;
|
|
163
|
+
renamed: number;
|
|
164
|
+
untracked: number;
|
|
165
|
+
};
|
|
166
|
+
stat: string | null;
|
|
167
|
+
limitations: string[];
|
|
168
|
+
}>;
|
|
169
|
+
/**
|
|
170
|
+
* Verification / evidence status for latest evidence or a specific change id.
|
|
171
|
+
*/
|
|
172
|
+
export declare function changeStatus(options: {
|
|
173
|
+
root: string;
|
|
174
|
+
changeId?: string;
|
|
175
|
+
}): Promise<{
|
|
176
|
+
changeId: string | null;
|
|
177
|
+
evidenceDirectory: string | null;
|
|
178
|
+
verificationStatus: VerificationStatus;
|
|
179
|
+
evidencePresent: boolean;
|
|
180
|
+
proofPresent: boolean;
|
|
181
|
+
proofId: string | null;
|
|
182
|
+
integrityNote: string;
|
|
183
|
+
files: string[];
|
|
184
|
+
}>;
|
|
185
|
+
export declare function inspectEvidence(options: {
|
|
186
|
+
root: string;
|
|
187
|
+
changeId: string;
|
|
188
|
+
}): Promise<{
|
|
189
|
+
ok: boolean;
|
|
190
|
+
directory: string;
|
|
191
|
+
manifest: EvidenceManifest | null;
|
|
192
|
+
presentFiles: string[];
|
|
193
|
+
error?: string;
|
|
194
|
+
}>;
|
|
195
|
+
/**
|
|
196
|
+
* Hash-check evidence bundle. Returns "verified" only when all listed files match.
|
|
197
|
+
*/
|
|
198
|
+
export declare function verifyEvidence(options: {
|
|
199
|
+
root: string;
|
|
200
|
+
changeId: string;
|
|
201
|
+
}): Promise<{
|
|
202
|
+
ok: boolean;
|
|
203
|
+
verificationStatus: VerificationStatus;
|
|
204
|
+
checked: Array<{
|
|
205
|
+
name: string;
|
|
206
|
+
match: boolean;
|
|
207
|
+
expected?: string;
|
|
208
|
+
actual?: string;
|
|
209
|
+
}>;
|
|
210
|
+
error?: string;
|
|
211
|
+
}>;
|