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.
- package/README.md +173 -0
- package/audit-code-wrapper-lib.mjs +905 -0
- package/audit-code.mjs +13 -0
- package/dist/adapters/coverageSummary.d.ts +8 -0
- package/dist/adapters/coverageSummary.js +13 -0
- package/dist/adapters/eslint.d.ts +13 -0
- package/dist/adapters/eslint.js +21 -0
- package/dist/adapters/normalizeExternal.d.ts +12 -0
- package/dist/adapters/normalizeExternal.js +19 -0
- package/dist/adapters/npmAudit.d.ts +15 -0
- package/dist/adapters/npmAudit.js +12 -0
- package/dist/adapters/semgrep.d.ts +22 -0
- package/dist/adapters/semgrep.js +14 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +724 -0
- package/dist/coverage.d.ts +11 -0
- package/dist/coverage.js +102 -0
- package/dist/extractors/bucketing.d.ts +7 -0
- package/dist/extractors/bucketing.js +72 -0
- package/dist/extractors/disposition.d.ts +4 -0
- package/dist/extractors/disposition.js +41 -0
- package/dist/extractors/fileInventory.d.ts +7 -0
- package/dist/extractors/fileInventory.js +44 -0
- package/dist/extractors/flows.d.ts +5 -0
- package/dist/extractors/flows.js +125 -0
- package/dist/extractors/fsIntake.d.ts +8 -0
- package/dist/extractors/fsIntake.js +66 -0
- package/dist/extractors/graph.d.ts +4 -0
- package/dist/extractors/graph.js +46 -0
- package/dist/extractors/ignore.d.ts +1 -0
- package/dist/extractors/ignore.js +17 -0
- package/dist/extractors/risk.d.ts +5 -0
- package/dist/extractors/risk.js +45 -0
- package/dist/extractors/surfaces.d.ts +4 -0
- package/dist/extractors/surfaces.js +40 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/io/artifacts.d.ts +38 -0
- package/dist/io/artifacts.js +100 -0
- package/dist/io/json.d.ts +8 -0
- package/dist/io/json.js +96 -0
- package/dist/io/runArtifacts.d.ts +14 -0
- package/dist/io/runArtifacts.js +37 -0
- package/dist/orchestrator/advance.d.ts +24 -0
- package/dist/orchestrator/advance.js +104 -0
- package/dist/orchestrator/artifactMetadata.d.ts +4 -0
- package/dist/orchestrator/artifactMetadata.js +111 -0
- package/dist/orchestrator/autoFixExecutor.d.ts +3 -0
- package/dist/orchestrator/autoFixExecutor.js +63 -0
- package/dist/orchestrator/chunking.d.ts +5 -0
- package/dist/orchestrator/chunking.js +13 -0
- package/dist/orchestrator/dependencyMap.d.ts +1 -0
- package/dist/orchestrator/dependencyMap.js +82 -0
- package/dist/orchestrator/executors.d.ts +6 -0
- package/dist/orchestrator/executors.js +52 -0
- package/dist/orchestrator/flowCoverage.d.ts +4 -0
- package/dist/orchestrator/flowCoverage.js +44 -0
- package/dist/orchestrator/flowPlanning.d.ts +3 -0
- package/dist/orchestrator/flowPlanning.js +42 -0
- package/dist/orchestrator/flowRequeue.d.ts +5 -0
- package/dist/orchestrator/flowRequeue.js +58 -0
- package/dist/orchestrator/internalExecutors.d.ts +16 -0
- package/dist/orchestrator/internalExecutors.js +212 -0
- package/dist/orchestrator/nextStep.d.ts +9 -0
- package/dist/orchestrator/nextStep.js +44 -0
- package/dist/orchestrator/planning.d.ts +4 -0
- package/dist/orchestrator/planning.js +62 -0
- package/dist/orchestrator/requeue.d.ts +3 -0
- package/dist/orchestrator/requeue.js +25 -0
- package/dist/orchestrator/requeueCommand.d.ts +10 -0
- package/dist/orchestrator/requeueCommand.js +27 -0
- package/dist/orchestrator/resultIngestion.d.ts +2 -0
- package/dist/orchestrator/resultIngestion.js +13 -0
- package/dist/orchestrator/runtimeValidation.d.ts +7 -0
- package/dist/orchestrator/runtimeValidation.js +103 -0
- package/dist/orchestrator/runtimeValidationUpdate.d.ts +2 -0
- package/dist/orchestrator/runtimeValidationUpdate.js +52 -0
- package/dist/orchestrator/staleness.d.ts +2 -0
- package/dist/orchestrator/staleness.js +83 -0
- package/dist/orchestrator/state.d.ts +3 -0
- package/dist/orchestrator/state.js +85 -0
- package/dist/orchestrator/syntaxResolutionExecutor.d.ts +3 -0
- package/dist/orchestrator/syntaxResolutionExecutor.js +99 -0
- package/dist/orchestrator/taskBuilder.d.ts +12 -0
- package/dist/orchestrator/taskBuilder.js +154 -0
- package/dist/orchestrator/unitBuilder.d.ts +3 -0
- package/dist/orchestrator/unitBuilder.js +145 -0
- package/dist/orchestrator.d.ts +6 -0
- package/dist/orchestrator.js +33 -0
- package/dist/prompts/renderWorkerPrompt.d.ts +2 -0
- package/dist/prompts/renderWorkerPrompt.js +19 -0
- package/dist/providers/claudeCodeProvider.d.ts +8 -0
- package/dist/providers/claudeCodeProvider.js +20 -0
- package/dist/providers/index.d.ts +7 -0
- package/dist/providers/index.js +77 -0
- package/dist/providers/localSubprocessProvider.d.ts +5 -0
- package/dist/providers/localSubprocessProvider.js +13 -0
- package/dist/providers/opencodeProvider.d.ts +8 -0
- package/dist/providers/opencodeProvider.js +15 -0
- package/dist/providers/spawnLoggedCommand.d.ts +2 -0
- package/dist/providers/spawnLoggedCommand.js +48 -0
- package/dist/providers/subprocessTemplateProvider.d.ts +8 -0
- package/dist/providers/subprocessTemplateProvider.js +41 -0
- package/dist/providers/types.d.ts +22 -0
- package/dist/providers/types.js +1 -0
- package/dist/providers/vscodeTaskProvider.d.ts +8 -0
- package/dist/providers/vscodeTaskProvider.js +14 -0
- package/dist/reporting/mergeFindings.d.ts +4 -0
- package/dist/reporting/mergeFindings.js +136 -0
- package/dist/reporting/rootCause.d.ts +11 -0
- package/dist/reporting/rootCause.js +69 -0
- package/dist/reporting/synthesis.d.ts +21 -0
- package/dist/reporting/synthesis.js +55 -0
- package/dist/supervisor/operatorHandoff.d.ts +37 -0
- package/dist/supervisor/operatorHandoff.js +144 -0
- package/dist/supervisor/runLedger.d.ts +3 -0
- package/dist/supervisor/runLedger.js +17 -0
- package/dist/supervisor/sessionConfig.d.ts +4 -0
- package/dist/supervisor/sessionConfig.js +26 -0
- package/dist/types/artifactMetadata.d.ts +8 -0
- package/dist/types/artifactMetadata.js +1 -0
- package/dist/types/auditState.d.ts +14 -0
- package/dist/types/auditState.js +1 -0
- package/dist/types/disposition.d.ts +9 -0
- package/dist/types/disposition.js +1 -0
- package/dist/types/externalAnalyzer.d.ts +16 -0
- package/dist/types/externalAnalyzer.js +1 -0
- package/dist/types/flowCoverage.d.ts +11 -0
- package/dist/types/flowCoverage.js +1 -0
- package/dist/types/flows.d.ts +11 -0
- package/dist/types/flows.js +1 -0
- package/dist/types/graph.d.ts +18 -0
- package/dist/types/graph.js +1 -0
- package/dist/types/risk.d.ts +9 -0
- package/dist/types/risk.js +1 -0
- package/dist/types/runLedger.d.ts +13 -0
- package/dist/types/runLedger.js +1 -0
- package/dist/types/runtimeValidation.d.ts +22 -0
- package/dist/types/runtimeValidation.js +1 -0
- package/dist/types/sessionConfig.d.ts +27 -0
- package/dist/types/sessionConfig.js +1 -0
- package/dist/types/surfaces.d.ts +11 -0
- package/dist/types/surfaces.js +1 -0
- package/dist/types/workerResult.d.ts +13 -0
- package/dist/types/workerResult.js +1 -0
- package/dist/types/workerSession.d.ts +13 -0
- package/dist/types/workerSession.js +1 -0
- package/dist/types.d.ts +104 -0
- package/dist/types.js +1 -0
- package/dist/validation/artifacts.d.ts +3 -0
- package/dist/validation/artifacts.js +191 -0
- package/dist/validation/basic.d.ts +5 -0
- package/dist/validation/basic.js +9 -0
- package/dist/validation/sessionConfig.d.ts +6 -0
- package/dist/validation/sessionConfig.js +139 -0
- package/docs/agent-integrations.md +237 -0
- package/docs/agent-roles.md +69 -0
- package/docs/architecture.md +90 -0
- package/docs/artifacts.md +69 -0
- package/docs/bootstrap-install.md +79 -0
- package/docs/contract.md +140 -0
- package/docs/github-copilot.md +50 -0
- package/docs/model-selection.md +86 -0
- package/docs/next-steps.md +161 -0
- package/docs/packaging.md +88 -0
- package/docs/pipeline.md +152 -0
- package/docs/product-direction.md +111 -0
- package/docs/production-launch-bar.md +83 -0
- package/docs/production-readiness.md +52 -0
- package/docs/repo-layout.md +30 -0
- package/docs/run-flow.md +49 -0
- package/docs/session-config.md +232 -0
- package/docs/supervisor.md +83 -0
- package/docs/usage.md +172 -0
- package/docs/windows-setup.md +146 -0
- package/package.json +56 -0
- package/schemas/audit-code-v1alpha1.schema.json +191 -0
- package/schemas/audit_result.schema.json +48 -0
- package/schemas/audit_state.schema.json +36 -0
- package/schemas/audit_task.schema.json +49 -0
- package/schemas/blind_spot_register.schema.json +40 -0
- package/schemas/coverage_matrix.schema.json +50 -0
- package/schemas/critical_flows.schema.json +38 -0
- package/schemas/external_analyzer_results.schema.json +31 -0
- package/schemas/file_disposition.schema.json +33 -0
- package/schemas/finding.schema.json +62 -0
- package/schemas/flow_coverage.schema.json +44 -0
- package/schemas/graph_bundle.schema.json +55 -0
- package/schemas/merged_findings.schema.json +14 -0
- package/schemas/repo_manifest.schema.json +37 -0
- package/schemas/risk_register.schema.json +30 -0
- package/schemas/root_cause_clusters.schema.json +31 -0
- package/schemas/runtime_validation_report.schema.json +34 -0
- package/schemas/runtime_validation_tasks.schema.json +36 -0
- package/schemas/surface_manifest.schema.json +32 -0
- package/schemas/synthesis_report.schema.json +61 -0
- package/schemas/unit_manifest.schema.json +36 -0
- package/skills/audit-code/SKILL.md +54 -0
- 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`
|