auditor-lambda 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (199) hide show
  1. package/README.md +173 -0
  2. package/audit-code-wrapper-lib.mjs +905 -0
  3. package/audit-code.mjs +13 -0
  4. package/dist/adapters/coverageSummary.d.ts +8 -0
  5. package/dist/adapters/coverageSummary.js +13 -0
  6. package/dist/adapters/eslint.d.ts +13 -0
  7. package/dist/adapters/eslint.js +21 -0
  8. package/dist/adapters/normalizeExternal.d.ts +12 -0
  9. package/dist/adapters/normalizeExternal.js +19 -0
  10. package/dist/adapters/npmAudit.d.ts +15 -0
  11. package/dist/adapters/npmAudit.js +12 -0
  12. package/dist/adapters/semgrep.d.ts +22 -0
  13. package/dist/adapters/semgrep.js +14 -0
  14. package/dist/cli.d.ts +1 -0
  15. package/dist/cli.js +724 -0
  16. package/dist/coverage.d.ts +11 -0
  17. package/dist/coverage.js +102 -0
  18. package/dist/extractors/bucketing.d.ts +7 -0
  19. package/dist/extractors/bucketing.js +72 -0
  20. package/dist/extractors/disposition.d.ts +4 -0
  21. package/dist/extractors/disposition.js +41 -0
  22. package/dist/extractors/fileInventory.d.ts +7 -0
  23. package/dist/extractors/fileInventory.js +44 -0
  24. package/dist/extractors/flows.d.ts +5 -0
  25. package/dist/extractors/flows.js +125 -0
  26. package/dist/extractors/fsIntake.d.ts +8 -0
  27. package/dist/extractors/fsIntake.js +66 -0
  28. package/dist/extractors/graph.d.ts +4 -0
  29. package/dist/extractors/graph.js +46 -0
  30. package/dist/extractors/ignore.d.ts +1 -0
  31. package/dist/extractors/ignore.js +17 -0
  32. package/dist/extractors/risk.d.ts +5 -0
  33. package/dist/extractors/risk.js +45 -0
  34. package/dist/extractors/surfaces.d.ts +4 -0
  35. package/dist/extractors/surfaces.js +40 -0
  36. package/dist/index.d.ts +1 -0
  37. package/dist/index.js +1 -0
  38. package/dist/io/artifacts.d.ts +38 -0
  39. package/dist/io/artifacts.js +100 -0
  40. package/dist/io/json.d.ts +8 -0
  41. package/dist/io/json.js +96 -0
  42. package/dist/io/runArtifacts.d.ts +14 -0
  43. package/dist/io/runArtifacts.js +37 -0
  44. package/dist/orchestrator/advance.d.ts +24 -0
  45. package/dist/orchestrator/advance.js +104 -0
  46. package/dist/orchestrator/artifactMetadata.d.ts +4 -0
  47. package/dist/orchestrator/artifactMetadata.js +111 -0
  48. package/dist/orchestrator/autoFixExecutor.d.ts +3 -0
  49. package/dist/orchestrator/autoFixExecutor.js +63 -0
  50. package/dist/orchestrator/chunking.d.ts +5 -0
  51. package/dist/orchestrator/chunking.js +13 -0
  52. package/dist/orchestrator/dependencyMap.d.ts +1 -0
  53. package/dist/orchestrator/dependencyMap.js +82 -0
  54. package/dist/orchestrator/executors.d.ts +6 -0
  55. package/dist/orchestrator/executors.js +52 -0
  56. package/dist/orchestrator/flowCoverage.d.ts +4 -0
  57. package/dist/orchestrator/flowCoverage.js +44 -0
  58. package/dist/orchestrator/flowPlanning.d.ts +3 -0
  59. package/dist/orchestrator/flowPlanning.js +42 -0
  60. package/dist/orchestrator/flowRequeue.d.ts +5 -0
  61. package/dist/orchestrator/flowRequeue.js +58 -0
  62. package/dist/orchestrator/internalExecutors.d.ts +16 -0
  63. package/dist/orchestrator/internalExecutors.js +212 -0
  64. package/dist/orchestrator/nextStep.d.ts +9 -0
  65. package/dist/orchestrator/nextStep.js +44 -0
  66. package/dist/orchestrator/planning.d.ts +4 -0
  67. package/dist/orchestrator/planning.js +62 -0
  68. package/dist/orchestrator/requeue.d.ts +3 -0
  69. package/dist/orchestrator/requeue.js +25 -0
  70. package/dist/orchestrator/requeueCommand.d.ts +10 -0
  71. package/dist/orchestrator/requeueCommand.js +27 -0
  72. package/dist/orchestrator/resultIngestion.d.ts +2 -0
  73. package/dist/orchestrator/resultIngestion.js +13 -0
  74. package/dist/orchestrator/runtimeValidation.d.ts +7 -0
  75. package/dist/orchestrator/runtimeValidation.js +103 -0
  76. package/dist/orchestrator/runtimeValidationUpdate.d.ts +2 -0
  77. package/dist/orchestrator/runtimeValidationUpdate.js +52 -0
  78. package/dist/orchestrator/staleness.d.ts +2 -0
  79. package/dist/orchestrator/staleness.js +83 -0
  80. package/dist/orchestrator/state.d.ts +3 -0
  81. package/dist/orchestrator/state.js +85 -0
  82. package/dist/orchestrator/syntaxResolutionExecutor.d.ts +3 -0
  83. package/dist/orchestrator/syntaxResolutionExecutor.js +99 -0
  84. package/dist/orchestrator/taskBuilder.d.ts +12 -0
  85. package/dist/orchestrator/taskBuilder.js +154 -0
  86. package/dist/orchestrator/unitBuilder.d.ts +3 -0
  87. package/dist/orchestrator/unitBuilder.js +145 -0
  88. package/dist/orchestrator.d.ts +6 -0
  89. package/dist/orchestrator.js +33 -0
  90. package/dist/prompts/renderWorkerPrompt.d.ts +2 -0
  91. package/dist/prompts/renderWorkerPrompt.js +19 -0
  92. package/dist/providers/claudeCodeProvider.d.ts +8 -0
  93. package/dist/providers/claudeCodeProvider.js +20 -0
  94. package/dist/providers/index.d.ts +7 -0
  95. package/dist/providers/index.js +77 -0
  96. package/dist/providers/localSubprocessProvider.d.ts +5 -0
  97. package/dist/providers/localSubprocessProvider.js +13 -0
  98. package/dist/providers/opencodeProvider.d.ts +8 -0
  99. package/dist/providers/opencodeProvider.js +15 -0
  100. package/dist/providers/spawnLoggedCommand.d.ts +2 -0
  101. package/dist/providers/spawnLoggedCommand.js +48 -0
  102. package/dist/providers/subprocessTemplateProvider.d.ts +8 -0
  103. package/dist/providers/subprocessTemplateProvider.js +41 -0
  104. package/dist/providers/types.d.ts +22 -0
  105. package/dist/providers/types.js +1 -0
  106. package/dist/providers/vscodeTaskProvider.d.ts +8 -0
  107. package/dist/providers/vscodeTaskProvider.js +14 -0
  108. package/dist/reporting/mergeFindings.d.ts +4 -0
  109. package/dist/reporting/mergeFindings.js +136 -0
  110. package/dist/reporting/rootCause.d.ts +11 -0
  111. package/dist/reporting/rootCause.js +69 -0
  112. package/dist/reporting/synthesis.d.ts +21 -0
  113. package/dist/reporting/synthesis.js +55 -0
  114. package/dist/supervisor/operatorHandoff.d.ts +37 -0
  115. package/dist/supervisor/operatorHandoff.js +144 -0
  116. package/dist/supervisor/runLedger.d.ts +3 -0
  117. package/dist/supervisor/runLedger.js +17 -0
  118. package/dist/supervisor/sessionConfig.d.ts +4 -0
  119. package/dist/supervisor/sessionConfig.js +26 -0
  120. package/dist/types/artifactMetadata.d.ts +8 -0
  121. package/dist/types/artifactMetadata.js +1 -0
  122. package/dist/types/auditState.d.ts +14 -0
  123. package/dist/types/auditState.js +1 -0
  124. package/dist/types/disposition.d.ts +9 -0
  125. package/dist/types/disposition.js +1 -0
  126. package/dist/types/externalAnalyzer.d.ts +16 -0
  127. package/dist/types/externalAnalyzer.js +1 -0
  128. package/dist/types/flowCoverage.d.ts +11 -0
  129. package/dist/types/flowCoverage.js +1 -0
  130. package/dist/types/flows.d.ts +11 -0
  131. package/dist/types/flows.js +1 -0
  132. package/dist/types/graph.d.ts +18 -0
  133. package/dist/types/graph.js +1 -0
  134. package/dist/types/risk.d.ts +9 -0
  135. package/dist/types/risk.js +1 -0
  136. package/dist/types/runLedger.d.ts +13 -0
  137. package/dist/types/runLedger.js +1 -0
  138. package/dist/types/runtimeValidation.d.ts +22 -0
  139. package/dist/types/runtimeValidation.js +1 -0
  140. package/dist/types/sessionConfig.d.ts +27 -0
  141. package/dist/types/sessionConfig.js +1 -0
  142. package/dist/types/surfaces.d.ts +11 -0
  143. package/dist/types/surfaces.js +1 -0
  144. package/dist/types/workerResult.d.ts +13 -0
  145. package/dist/types/workerResult.js +1 -0
  146. package/dist/types/workerSession.d.ts +13 -0
  147. package/dist/types/workerSession.js +1 -0
  148. package/dist/types.d.ts +104 -0
  149. package/dist/types.js +1 -0
  150. package/dist/validation/artifacts.d.ts +3 -0
  151. package/dist/validation/artifacts.js +191 -0
  152. package/dist/validation/basic.d.ts +5 -0
  153. package/dist/validation/basic.js +9 -0
  154. package/dist/validation/sessionConfig.d.ts +6 -0
  155. package/dist/validation/sessionConfig.js +139 -0
  156. package/docs/agent-integrations.md +237 -0
  157. package/docs/agent-roles.md +69 -0
  158. package/docs/architecture.md +90 -0
  159. package/docs/artifacts.md +69 -0
  160. package/docs/bootstrap-install.md +79 -0
  161. package/docs/contract.md +140 -0
  162. package/docs/github-copilot.md +50 -0
  163. package/docs/model-selection.md +86 -0
  164. package/docs/next-steps.md +161 -0
  165. package/docs/packaging.md +88 -0
  166. package/docs/pipeline.md +152 -0
  167. package/docs/product-direction.md +111 -0
  168. package/docs/production-launch-bar.md +83 -0
  169. package/docs/production-readiness.md +52 -0
  170. package/docs/repo-layout.md +30 -0
  171. package/docs/run-flow.md +49 -0
  172. package/docs/session-config.md +232 -0
  173. package/docs/supervisor.md +83 -0
  174. package/docs/usage.md +172 -0
  175. package/docs/windows-setup.md +146 -0
  176. package/package.json +56 -0
  177. package/schemas/audit-code-v1alpha1.schema.json +191 -0
  178. package/schemas/audit_result.schema.json +48 -0
  179. package/schemas/audit_state.schema.json +36 -0
  180. package/schemas/audit_task.schema.json +49 -0
  181. package/schemas/blind_spot_register.schema.json +40 -0
  182. package/schemas/coverage_matrix.schema.json +50 -0
  183. package/schemas/critical_flows.schema.json +38 -0
  184. package/schemas/external_analyzer_results.schema.json +31 -0
  185. package/schemas/file_disposition.schema.json +33 -0
  186. package/schemas/finding.schema.json +62 -0
  187. package/schemas/flow_coverage.schema.json +44 -0
  188. package/schemas/graph_bundle.schema.json +55 -0
  189. package/schemas/merged_findings.schema.json +14 -0
  190. package/schemas/repo_manifest.schema.json +37 -0
  191. package/schemas/risk_register.schema.json +30 -0
  192. package/schemas/root_cause_clusters.schema.json +31 -0
  193. package/schemas/runtime_validation_report.schema.json +34 -0
  194. package/schemas/runtime_validation_tasks.schema.json +36 -0
  195. package/schemas/surface_manifest.schema.json +32 -0
  196. package/schemas/synthesis_report.schema.json +61 -0
  197. package/schemas/unit_manifest.schema.json +36 -0
  198. package/skills/audit-code/SKILL.md +54 -0
  199. package/skills/audit-code/audit-code.prompt.md +66 -0
package/README.md ADDED
@@ -0,0 +1,173 @@
1
+ # auditor-lambda
2
+
3
+ Skill-first audit orchestration backend for the `/audit-code` product surface.
4
+
5
+ ## Canonical Product Route
6
+
7
+ The primary product is `/audit-code` in conversation.
8
+
9
+ Normal product usage should:
10
+
11
+ - use the active conversation model by default
12
+ - use project files and attached repository context by default
13
+ - avoid manual paths, provider flags, and model-selection arguments
14
+ - advance the audit automatically until it completes or no further automatic progress is possible
15
+
16
+ ## Conversation Setup
17
+
18
+ The canonical asset for editor and conversation integrations is:
19
+
20
+ `skills/audit-code/audit-code.prompt.md`
21
+
22
+ Packaged installs and repository checkouts both ship that prompt asset.
23
+
24
+ The recommended zero-guess setup path is now:
25
+
26
+ ```bash
27
+ audit-code install
28
+ ```
29
+
30
+ That bootstraps repo-local `/audit-code` surfaces for the hosts we can automate today, including:
31
+
32
+ - VS Code / GitHub Copilot prompt files
33
+ - OpenCode custom commands
34
+ - Claude Code custom slash commands
35
+ - compatibility instruction files such as `AGENTS.md` and `CLAUDE.md`
36
+
37
+ After that, open a supported conversation surface in the repository and invoke `/audit-code`.
38
+
39
+ If a host still needs manual prompt import after bootstrap, open:
40
+
41
+ ```text
42
+ .audit-code/install/GETTING-STARTED.md
43
+ ```
44
+
45
+ That repo-local guide now includes dedicated quick-start sections for VS Code, OpenCode, Claude Code, Claude Desktop, and Antigravity, plus the installed canonical prompt asset path for manual-import hosts.
46
+
47
+ For narrower compatibility, `audit-code install-host --host copilot` still exists.
48
+
49
+ For hosts that still need manual import after bootstrap, or for environments with no repo-local install surface, after installing the package or checking out the repository, use:
50
+
51
+ ```bash
52
+ audit-code prompt-path
53
+ ```
54
+
55
+ Import the reported file into your editor or conversation environment's custom prompt configuration, then invoke `/audit-code` in conversation.
56
+
57
+ Typical examples include custom instructions, `.cursorrules`, prompt libraries, or comparable editor-specific prompt surfaces.
58
+
59
+ ## Repo-Local Backend Fallback
60
+
61
+ The CLI in this repository is backend infrastructure and a repo-local fallback surface.
62
+
63
+ From the target repository root:
64
+
65
+ ```bash
66
+ audit-code
67
+ ```
68
+
69
+ Repository-local equivalent:
70
+
71
+ ```bash
72
+ node /path/to/auditor-lambda/audit-code.mjs
73
+ ```
74
+
75
+ This wrapper:
76
+
77
+ - defaults artifacts to `<repo-root>/.audit-artifacts`
78
+ - creates that directory automatically
79
+ - auto-builds `dist/` if it is missing
80
+ - advances fresh worker sessions automatically until the audit completes or the remaining work requires imported results or an interactive provider
81
+ - emits `contract_version: "audit-code/v1alpha1"`
82
+ - refreshes `.audit-artifacts/operator-handoff.json` and `.audit-artifacts/operator-handoff.md` with suggested evidence-import paths and continuation hints
83
+
84
+ Explicit root override still exists for callers running from outside the target repository:
85
+
86
+ ```bash
87
+ audit-code --root /path/to/repo
88
+ ```
89
+
90
+ For one bounded debug step instead of run-to-completion:
91
+
92
+ ```bash
93
+ audit-code --single-step
94
+ ```
95
+
96
+ For an operator-side artifact consistency check:
97
+
98
+ ```bash
99
+ audit-code validate
100
+ ```
101
+
102
+ That check now covers the artifact bundle plus `session-config.json` and explicit provider readiness.
103
+
104
+ The backend wrapper response schema is `schemas/audit-code-v1alpha1.schema.json`.
105
+
106
+ ## Backend Provider Modes
107
+
108
+ If `provider` is omitted, the backend defaults to the safest mode:
109
+
110
+ ```json
111
+ {
112
+ "provider": "local-subprocess"
113
+ }
114
+ ```
115
+
116
+ If you want best-effort cross-editor or provider routing, opt into:
117
+
118
+ ```json
119
+ {
120
+ "provider": "auto",
121
+ "ui_mode": "visible"
122
+ }
123
+ ```
124
+
125
+ Optional backend config:
126
+
127
+ `.audit-artifacts/session-config.json`
128
+
129
+ ## Practical Guidance
130
+
131
+ - use `/audit-code` in conversation as the canonical product surface
132
+ - use `audit-code install` first when you want the lowest-friction repo bootstrap
133
+ - use `audit-code prompt-path` to locate the packaged prompt asset
134
+ - use `audit-code` from the repository root only when you need the repo-local backend fallback
135
+ - use omitted provider or `local-subprocess` for the safest deterministic fallback behavior
136
+ - use `provider: "auto"` only when you want best-effort routing across installed backends
137
+
138
+ ## Implementation Next Steps
139
+
140
+ The next implementation work is tracked in:
141
+
142
+ - `docs/next-steps.md`
143
+
144
+ The short version is:
145
+
146
+ - reduce prompt-import friction in the conversation setup flow
147
+ - make the conversation route feel more native in the first target hosts
148
+ - improve continuation when assisted or interactive review is needed
149
+ - finish publish and release hardening for packaged installs
150
+
151
+ ## Build And Test
152
+
153
+ ```bash
154
+ npm install
155
+ npm run verify:release
156
+ ```
157
+
158
+ ## Key Docs
159
+
160
+ - `docs/product-direction.md`
161
+ - `docs/production-readiness.md`
162
+ - `docs/production-launch-bar.md`
163
+ - `docs/next-steps.md`
164
+ - `skills/audit-code/SKILL.md`
165
+ - `docs/bootstrap-install.md`
166
+ - `docs/agent-integrations.md`
167
+ - `docs/github-copilot.md`
168
+ - `docs/contract.md`
169
+ - `docs/model-selection.md`
170
+ - `docs/packaging.md`
171
+ - `docs/session-config.md`
172
+ - `docs/supervisor.md`
173
+ - `docs/windows-setup.md`