auditor-lambda 0.3.12 → 0.3.14

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 (61) hide show
  1. package/README.md +20 -24
  2. package/audit-code-wrapper-lib.mjs +52 -53
  3. package/dist/cli.js +43 -6
  4. package/dist/coverage.js +3 -1
  5. package/dist/extractors/disposition.js +8 -1
  6. package/dist/extractors/graph.d.ts +3 -1
  7. package/dist/extractors/graph.js +1147 -67
  8. package/dist/extractors/graphManifestEdges.d.ts +14 -0
  9. package/dist/extractors/graphManifestEdges.js +1158 -0
  10. package/dist/extractors/graphPathUtils.d.ts +5 -0
  11. package/dist/extractors/graphPathUtils.js +75 -0
  12. package/dist/extractors/pathPatterns.d.ts +1 -0
  13. package/dist/extractors/pathPatterns.js +3 -0
  14. package/dist/io/artifacts.d.ts +10 -1
  15. package/dist/io/artifacts.js +23 -3
  16. package/dist/orchestrator/internalExecutors.d.ts +4 -0
  17. package/dist/orchestrator/internalExecutors.js +35 -6
  18. package/dist/orchestrator/reviewPackets.js +1003 -31
  19. package/dist/orchestrator/syntaxResolutionExecutor.js +34 -0
  20. package/dist/types/externalAnalyzer.d.ts +9 -0
  21. package/dist/types/graph.d.ts +3 -0
  22. package/dist/types/reviewPlanning.d.ts +39 -0
  23. package/docs/contracts.md +215 -0
  24. package/docs/development.md +210 -0
  25. package/docs/handoff.md +204 -0
  26. package/docs/history.md +40 -0
  27. package/docs/operator-guide.md +189 -0
  28. package/docs/product.md +185 -0
  29. package/docs/release.md +131 -0
  30. package/package.json +1 -1
  31. package/schemas/audit_plan_metrics.schema.json +347 -0
  32. package/schemas/external_analyzer_results.schema.json +35 -0
  33. package/schemas/graph_bundle.schema.json +47 -2
  34. package/schemas/review_packets.schema.json +160 -0
  35. package/skills/audit-code/SKILL.md +7 -3
  36. package/skills/audit-code/audit-code.prompt.md +4 -1
  37. package/docs/agent-integrations.md +0 -317
  38. package/docs/agent-roles.md +0 -69
  39. package/docs/architecture.md +0 -90
  40. package/docs/artifacts.md +0 -36
  41. package/docs/bootstrap-install.md +0 -139
  42. package/docs/contract.md +0 -54
  43. package/docs/dispatch-implementation-plan.md +0 -302
  44. package/docs/field-trial-bug-report.md +0 -237
  45. package/docs/github-copilot.md +0 -66
  46. package/docs/model-selection.md +0 -97
  47. package/docs/next-steps.md +0 -202
  48. package/docs/packaging.md +0 -120
  49. package/docs/pipeline.md +0 -152
  50. package/docs/product-direction.md +0 -154
  51. package/docs/production-launch-bar.md +0 -92
  52. package/docs/production-readiness.md +0 -58
  53. package/docs/releasing.md +0 -145
  54. package/docs/remediation-baseline.md +0 -75
  55. package/docs/repo-layout.md +0 -30
  56. package/docs/run-flow.md +0 -56
  57. package/docs/session-config.md +0 -319
  58. package/docs/supervisor.md +0 -100
  59. package/docs/usage.md +0 -215
  60. package/docs/windows-setup.md +0 -146
  61. package/docs/workflow-refactor-brief.md +0 -124
@@ -0,0 +1,160 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "review_packets.schema.json",
4
+ "title": "Review Packets",
5
+ "type": "array",
6
+ "items": {
7
+ "$ref": "#/$defs/reviewPacket"
8
+ },
9
+ "$defs": {
10
+ "lens": {
11
+ "type": "string",
12
+ "enum": [
13
+ "correctness",
14
+ "architecture",
15
+ "maintainability",
16
+ "security",
17
+ "reliability",
18
+ "performance",
19
+ "data_integrity",
20
+ "tests",
21
+ "operability",
22
+ "config_deployment",
23
+ "observability"
24
+ ]
25
+ },
26
+ "priority": {
27
+ "type": "string",
28
+ "enum": ["high", "medium", "low"]
29
+ },
30
+ "graphEdge": {
31
+ "type": "object",
32
+ "required": ["from", "to", "confidence"],
33
+ "properties": {
34
+ "from": { "type": "string" },
35
+ "to": { "type": "string" },
36
+ "kind": { "type": "string" },
37
+ "confidence": {
38
+ "type": "number",
39
+ "minimum": 0,
40
+ "maximum": 1
41
+ },
42
+ "reason": { "type": "string" }
43
+ },
44
+ "additionalProperties": false
45
+ },
46
+ "quality": {
47
+ "type": "object",
48
+ "required": [
49
+ "cohesion_score",
50
+ "internal_edge_count",
51
+ "boundary_edge_count",
52
+ "unexplained_file_count"
53
+ ],
54
+ "properties": {
55
+ "cohesion_score": {
56
+ "type": "number",
57
+ "minimum": 0,
58
+ "maximum": 1
59
+ },
60
+ "internal_edge_count": {
61
+ "type": "integer",
62
+ "minimum": 0
63
+ },
64
+ "boundary_edge_count": {
65
+ "type": "integer",
66
+ "minimum": 0
67
+ },
68
+ "unexplained_file_count": {
69
+ "type": "integer",
70
+ "minimum": 0
71
+ }
72
+ },
73
+ "additionalProperties": false
74
+ },
75
+ "reviewPacket": {
76
+ "type": "object",
77
+ "required": [
78
+ "packet_id",
79
+ "task_ids",
80
+ "unit_ids",
81
+ "pass_ids",
82
+ "lenses",
83
+ "file_paths",
84
+ "file_line_counts",
85
+ "total_lines",
86
+ "priority",
87
+ "quality",
88
+ "rationale",
89
+ "estimated_tokens"
90
+ ],
91
+ "properties": {
92
+ "packet_id": { "type": "string" },
93
+ "task_ids": {
94
+ "type": "array",
95
+ "minItems": 1,
96
+ "items": { "type": "string" }
97
+ },
98
+ "unit_ids": {
99
+ "type": "array",
100
+ "minItems": 1,
101
+ "items": { "type": "string" }
102
+ },
103
+ "pass_ids": {
104
+ "type": "array",
105
+ "minItems": 1,
106
+ "items": { "type": "string" }
107
+ },
108
+ "lenses": {
109
+ "type": "array",
110
+ "minItems": 1,
111
+ "items": { "$ref": "#/$defs/lens" }
112
+ },
113
+ "file_paths": {
114
+ "type": "array",
115
+ "minItems": 1,
116
+ "items": { "type": "string" }
117
+ },
118
+ "file_line_counts": {
119
+ "type": "object",
120
+ "additionalProperties": {
121
+ "type": "integer",
122
+ "minimum": 0
123
+ }
124
+ },
125
+ "total_lines": {
126
+ "type": "integer",
127
+ "minimum": 0
128
+ },
129
+ "priority": { "$ref": "#/$defs/priority" },
130
+ "tags": {
131
+ "type": "array",
132
+ "minItems": 1,
133
+ "items": { "type": "string" }
134
+ },
135
+ "entrypoints": {
136
+ "type": "array",
137
+ "minItems": 1,
138
+ "items": { "type": "string" }
139
+ },
140
+ "key_edges": {
141
+ "type": "array",
142
+ "minItems": 1,
143
+ "items": { "$ref": "#/$defs/graphEdge" }
144
+ },
145
+ "boundary_files": {
146
+ "type": "array",
147
+ "minItems": 1,
148
+ "items": { "type": "string" }
149
+ },
150
+ "quality": { "$ref": "#/$defs/quality" },
151
+ "rationale": { "type": "string" },
152
+ "estimated_tokens": {
153
+ "type": "integer",
154
+ "minimum": 0
155
+ }
156
+ },
157
+ "additionalProperties": false
158
+ }
159
+ }
160
+ }
@@ -20,6 +20,9 @@ Normal usage should:
20
20
  Semantic review should be delegated to bounded subagents whenever the host can
21
21
  dispatch them. The conversation orchestrator owns dispatch and ingestion control;
22
22
  it should not perform broad review itself when subagents are available.
23
+ Entering `/audit-code` is explicit user authorization to fan out those review
24
+ subagents; do not require a separate delegation request before parallel
25
+ dispatch.
23
26
 
24
27
  If the host cannot delegate to subagents, the conversation orchestrator may
25
28
  complete exactly one assigned review task, ingest it through the provided backend
@@ -52,9 +55,10 @@ current repository before advancing the audit:
52
55
  audit-code ensure --quiet
53
56
  ```
54
57
 
55
- That idempotent bootstrap writes repo-local host assets for Codex, Claude Desktop,
56
- OpenCode, VS Code, and Antigravity plus shared MCP setup guidance only when they
57
- are missing or stale.
58
+ That idempotent bootstrap writes repo-local fallback/guidance assets for
59
+ supported hosts plus shared MCP setup guidance only when they are missing or
60
+ stale. Codex uses the global skill installed by npm rather than a repo-local
61
+ skill bundle.
58
62
 
59
63
  Use the explicit installer for repair or forced refresh:
60
64
 
@@ -28,6 +28,9 @@ and ingest results mechanically.
28
28
  - CRITICAL: Do not use your `Read` tool to read `entry.prompt_path` or JSON schemas into your own context window. The subagent will read them. Pass the path literally.
29
29
  - Prefer subagent dispatch for semantic review whenever the host exposes an
30
30
  Agent/subagent tool.
31
+ - Treat the user's `/audit-code` request as explicit authorization to launch
32
+ review subagents in parallel. Do not ask for a separate delegation request
33
+ before using available Agent/subagent tools.
31
34
  - Do not use `browser_subagent` for semantic review of source code unless the
32
35
  task explicitly requires browser-based validation.
33
36
  - If the host cannot dispatch subagents, complete exactly one assigned review
@@ -83,7 +86,7 @@ If status is `"blocked"` for semantic review, continue to Step 2.
83
86
 
84
87
  ## Step 2 - Dispatch Review Work
85
88
 
86
- When the host supports subagents, prepare a dispatch plan:
89
+ When the host supports subagents, prepare a dispatch plan by default:
87
90
 
88
91
  ```bash
89
92
  audit-code prepare-dispatch --run-id <run_id> --artifacts-dir <artifacts_dir>
@@ -1,317 +0,0 @@
1
- # Agent integrations
2
-
3
- This document explains how `auditor-lambda` fits into AI coding agent workflows across editors and provider surfaces.
4
-
5
- ## Primary product contract
6
-
7
- The canonical product surface is the in-conversation `/audit-code` skill.
8
-
9
- The repo-local backend fallback is the zero-argument wrapper:
10
-
11
- Normal product usage should:
12
-
13
- - use the current conversation or editor context as the working context
14
- - avoid manual `--root`, provider flags, and model selection in normal use
15
- - let the supervisor advance the audit automatically until it completes or no further automatic progress is possible
16
-
17
- ## Review ownership rule
18
-
19
- Semantic review should stay with the active conversation agent by default.
20
-
21
- That means:
22
-
23
- - use the current host conversation as the normal owner of review work
24
- - if the host agent can delegate to subagents in parallel, let the host runtime make that decision
25
- - do not treat `.audit-artifacts/session-config.json` as the normal way to choose a second LLM for review
26
- - treat backend provider adapters as compatibility bridges for fallback CLI usage only
27
-
28
- ## Conversation-first setup
29
-
30
- The canonical prompt asset is:
31
-
32
- `skills/audit-code/audit-code.prompt.md`
33
-
34
- The preferred install path for users is:
35
-
36
- ```bash
37
- npm install -g auditor-lambda
38
- ```
39
-
40
- That makes `audit-code` available on `PATH` and seeds user-level command/skill
41
- assets for hosts we can safely update during package installation. Once the
42
- slash command is available, `/audit-code` self-bootstraps the current repository
43
- with:
44
-
45
- ```bash
46
- audit-code ensure --quiet
47
- ```
48
-
49
- `ensure` writes repo-local `/audit-code` surfaces and MCP-oriented support assets
50
- for Codex, Claude Desktop, OpenCode, VS Code, and Antigravity only when they are
51
- missing or stale. It also writes `.audit-code/install/GETTING-STARTED.md` with
52
- dedicated quick-start sections for each host plus `.audit-code/install/manifest.json`
53
- and a shared repo-local MCP launcher.
54
-
55
- Use the explicit installer when you want to repair or force-refresh those
56
- repo-local assets:
57
-
58
- ```bash
59
- audit-code install
60
- ```
61
-
62
- Use one of these supported ways to obtain the raw prompt asset directly when you need prompt import instead:
63
-
64
- 1. install the package and run `audit-code prompt-path`
65
- 2. check out the repository and read the file directly from `skills/audit-code/audit-code.prompt.md`
66
-
67
- Import that prompt into your editor or conversation environment, or use the bootstrap installer above, then use `/audit-code` in conversation.
68
-
69
- ## Editor guidance
70
-
71
- ### ChatGPT project conversations
72
-
73
- This is the intended product surface.
74
-
75
- Use `/audit-code` in conversation, treat the active conversation model as the default model, and treat project files plus attached repository context as the default context.
76
-
77
- ### Codex
78
-
79
- The global npm install seeds `~/.codex/skills/audit-code/` so the command can be
80
- available before a repository is bootstrapped. The first `/audit-code` run then
81
- uses `audit-code ensure --quiet` to create or refresh repo-local Codex support.
82
-
83
- Use `audit-code install --host codex` only when you want to repair or force-refresh
84
- the Codex repo-local files from the target repository root.
85
-
86
- That writes a repo-local Codex skill bundle, updates `AGENTS.md` through a managed block when needed, and emits Codex-specific MCP setup guidance plus an automation recipe in `.audit-code/install/codex/`.
87
- The intended operator flow is still conversational first, with the generated skill and AGENTS guidance steering the active Codex session toward `/audit-code` and the MCP-backed workflow.
88
-
89
- The Codex automation recipe should still be treated as optional follow-through after the basic local flow is validated in the real app.
90
-
91
- ### Claude Desktop
92
-
93
- Use `audit-code install --host claude-desktop` or the default `audit-code install` from the target repository root.
94
-
95
- This repository now treats Claude Desktop as an MCP-first host. The installer writes:
96
-
97
- - `.audit-code/install/claude-desktop/PROJECT-TEMPLATE.md`
98
- - `.audit-code/install/claude-desktop/remote-mcp-connector.json`
99
- - generated local bundle artifacts including `auditor-lambda.dxt` and `auditor-lambda.mcpb`
100
-
101
- The intended path is to install or reference the generated local MCP bundle, then use the shared prompt and project-template guidance to run `/audit-code` conversationally.
102
- Manual prompt import remains a fallback, not the primary documented path.
103
-
104
- ### OpenCode
105
-
106
- OpenCode currently relies on repo-local command and MCP config files for the
107
- cleanest experience. A global `/audit-code` prompt can run `audit-code ensure --quiet`
108
- first; otherwise run `audit-code install` from the target repository root once.
109
-
110
- That writes `.opencode/commands/audit-code.md`, a repo-local OpenCode skill bundle, and `opencode.json` so `/audit-code` is available in the repository with no extra provider flags.
111
- The generated OpenCode assets also point OpenCode toward the shared auditor MCP server instead of rebuilding backend state ad hoc.
112
-
113
- ### VS Code
114
-
115
- VS Code currently relies on workspace prompt and MCP config files for the
116
- cleanest experience. A global `/audit-code` prompt can run `audit-code ensure --quiet`
117
- first; otherwise run `audit-code install` from the target repository root, then
118
- open `.audit-code/install/GETTING-STARTED.md` if you want the exact repo-local
119
- path that bootstrap created for VS Code chat surfaces.
120
-
121
- That writes `.github/prompts/audit-code.prompt.md`, `.github/copilot-instructions.md`, `.github/agents/auditor.agent.md`, and `.vscode/mcp.json`.
122
- The expected happy path is still to invoke `/audit-code` from chat, not to start from the backend CLI.
123
-
124
- ### Antigravity
125
-
126
- Run `/audit-code` from a global prompt-capable host and let `audit-code ensure --quiet`
127
- create the repo-local guidance, or run `audit-code install` from the target
128
- repository root, then open `.audit-code/install/GETTING-STARTED.md`.
129
-
130
- There is still no documented native repo-local saved-workflow surface for Antigravity in this repository today, so the intended path is:
131
-
132
- 1. use the generated planning-mode and MCP setup guidance
133
- 2. invoke `/audit-code` conversationally inside Antigravity when the host surface allows it
134
- 3. use the shared MCP tools and resources when structured state exchange is needed
135
- 4. fall back to `audit-code` from an Antigravity-managed terminal only when you intentionally need the repo-local backend wrapper
136
-
137
- ### Similar manual-import hosts
138
-
139
- Use the same installed prompt asset and repo-local guide pattern as Antigravity, or the same MCP-first bundle pattern as Claude Desktop, depending on what the host actually supports.
140
-
141
- The backend CLI remains optional fallback infrastructure.
142
-
143
- ## Repo-local backend fallback
144
-
145
- From the target repository root:
146
-
147
- ```bash
148
- audit-code
149
- ```
150
-
151
- Use the backend wrapper only when you intentionally need the repo-local fallback, automation harness, or provider-adapter workflow.
152
-
153
- ## What the wrapper actually does
154
-
155
- `audit-code` is the stable backend entrypoint behind the slash command.
156
-
157
- It:
158
-
159
- - defaults artifacts to `<repo-root>/.audit-artifacts`
160
- - persists audit continuity there
161
- - calls `run-to-completion` by default for deterministic work
162
- - creates fresh worker runs behind the scenes
163
- - returns a stable top-level JSON contract with `contract_version: "audit-code/v1alpha1"`
164
-
165
- ## Minimal repo-local flow
166
-
167
- From the target repository root:
168
-
169
- ```bash
170
- audit-code
171
- ```
172
-
173
- Inspect the returned JSON and continue invoking the same entrypoint until either:
174
-
175
- - `next_likely_step === null`
176
-
177
- Terminal interpretation:
178
-
179
- - `audit_state.status === "complete"` means the audit finished end to end.
180
- - `audit_state.status === "blocked"` means the wrapper exhausted deterministic
181
- work and exposed scoped semantic-review task artifacts for the slash-command
182
- orchestrator.
183
-
184
- Current implementation note:
185
-
186
- - the backend fallback still supports explicit provider bridges such as `claude-code`, `opencode`, `subprocess-template`, and `vscode-task`
187
- - those bridges are compatibility modes, not the intended default review owner
188
- - the intended workflow is documented in [docs/workflow-refactor-brief.md](/C:/Code/auditor-lambda/docs/workflow-refactor-brief.md)
189
-
190
- When additional evidence exists, pass it into the same wrapper:
191
-
192
- ```bash
193
- audit-code --results /path/to/audit_results.json
194
- audit-code --updates /path/to/runtime_validation_report.json
195
- audit-code --external-analyzer-results /path/to/external_analyzer_results.json
196
- ```
197
-
198
- Each response also refreshes `.audit-artifacts/operator-handoff.json` and `.audit-artifacts/operator-handoff.md` so operators can see the pending obligations, suggested import paths, and session-config continuation hint without reconstructing the state manually.
199
-
200
- Everything below is backend fallback guidance, not the primary product path.
201
- Use it when the current host cannot keep review inside the active conversation, not as the first choice for semantic-review ownership.
202
-
203
- ## Provider matrix
204
-
205
- ### local-subprocess
206
-
207
- Use when you want the supervisor to stay entirely local.
208
-
209
- This requires no external agent CLI. Deterministic executors run in-process
210
- during normal wrapper runs, and the supervisor only stops once the remaining
211
- work is genuinely semantic review.
212
-
213
- When that review boundary is reached, `local-subprocess` stops in a terminal
214
- blocked handoff instead of pretending more automatic progress is available.
215
- The slash-command orchestrator should dispatch subagents from the handoff when
216
- available; otherwise it should review exactly one task, write results, run the
217
- provided worker command, and stop.
218
-
219
- This is the safest default backend when the repository is already available locally.
220
-
221
- ### claude-code
222
-
223
- Use when Claude Code is installed and authenticated on the machine.
224
-
225
- The current implementation can launch a fresh Claude Code print-mode session for each worker run.
226
-
227
- Treat this as a compatibility bridge only, not as the intended default review owner.
228
-
229
- ### opencode
230
-
231
- Use when OpenCode is installed and authenticated on the machine.
232
-
233
- The current implementation can launch a fresh `opencode run ...` session for each worker run.
234
-
235
- Treat this as a compatibility bridge only, not as the intended default review owner.
236
-
237
- ### subprocess-template
238
-
239
- Use when you need a generic bridge.
240
-
241
- This is the escape hatch for editors, launchers, or agent shells that do not yet have a dedicated provider adapter. The supervisor renders a templated command and executes it as a fresh worker run.
242
- For provider-assisted review stages, that bridge should write `task.audit_results_path` and then execute `task.worker_command`.
243
-
244
- ### vscode-task
245
-
246
- Use when you already have a repository-local or machine-local task bridge and want the supervisor to call that bridge through a command template.
247
-
248
- Treat this as an advanced backend adapter rather than the default path.
249
-
250
- ### Claude Code
251
-
252
- Use `/audit-code` in the active conversation as the primary path.
253
-
254
- Only use the repo-local `audit-code` wrapper with `provider: "claude-code"` in `.audit-artifacts/session-config.json` when you intentionally want backend fallback bridging into Claude Code.
255
-
256
- ### OpenCode
257
-
258
- Use `/audit-code` in the active conversation as the primary path.
259
-
260
- Only use the repo-local `audit-code` wrapper with `provider: "opencode"` when you intentionally want backend fallback bridging into OpenCode.
261
-
262
- ### VS Code
263
-
264
- Use `/audit-code` from chat and let the prompt run `audit-code ensure --quiet`.
265
- Run `audit-code install` manually only when VS Code has not yet discovered the
266
- workspace prompt/MCP files or you want to force-refresh them.
267
-
268
- The backend fallback is still available from the integrated terminal and should keep `local-subprocess` unless you specifically need a task bridge.
269
-
270
- If you already have a launcher or task surface that should own fresh worker windows, use `vscode-task` or `subprocess-template`.
271
-
272
- ### Google Antigravity
273
-
274
- No dedicated Antigravity provider adapter is shipped today.
275
-
276
- Current recommended usage is one of these:
277
-
278
- - use the skill-first conversational contract as the primary surface (note: do NOT use `browser_subagent` for semantic review of code unless explicitly required by the task)
279
- - let `/audit-code` run `audit-code ensure --quiet`, or run `audit-code install` manually so compatibility files are present
280
- - run `audit-code` from an Antigravity-managed terminal with `local-subprocess`
281
- - use `subprocess-template` if you have a reliable Antigravity-side launcher bridge
282
-
283
- That keeps the product usable in Antigravity now without pretending that a native adapter already exists.
284
-
285
- ## Remaining steps
286
-
287
- The current implementation shipped the shared installer and MCP substrate. The remaining work is operational validation and fit-and-finish, not a fresh redesign.
288
-
289
- Highest-value follow-through:
290
-
291
- 1. validate the generated Codex, Claude Desktop, OpenCode, VS Code, and Antigravity assets inside the real products they target
292
- 2. tighten generated quick-start guidance anywhere those host smoke tests expose ambiguity
293
- 3. document exactly how Antigravity artifacts should map into `import_results` and `import_runtime_updates`
294
- 4. keep host claims conservative until those end-to-end product checks are complete
295
-
296
- ## Model-selection rule
297
-
298
- The product direction remains skill-first:
299
-
300
- - in conversation, keep orchestration in the active model and delegate semantic
301
- review to bounded subagents when the host supports them
302
- - for backend CLI delegation, let the chosen provider own its own model-selection behavior unless explicitly configured otherwise
303
-
304
- ## Practical recommendation
305
-
306
- For a polished operator experience today:
307
-
308
- 1. treat `/audit-code` as the canonical user-facing contract
309
- 2. install once with `npm install -g auditor-lambda`, then let `/audit-code` run `audit-code ensure --quiet` in each repository
310
- 3. use `audit-code` as the repo-local backend fallback
311
- 4. prefer `local-subprocess` unless you explicitly want a backend provider bridge
312
- 5. use `subprocess-template` only when integrating a non-native editor or launcher surface
313
-
314
- If you intentionally want the backend fallback to bridge semantic review into
315
- another process, set the matching provider in
316
- `.audit-artifacts/session-config.json` or re-run with an explicit `--provider`
317
- flag after configuring the matching provider section.
@@ -1,69 +0,0 @@
1
- # Agent roles
2
-
3
- ## Principles
4
-
5
- Each agent should consume bounded artifacts and return structured outputs. Agents should not invent process rules.
6
-
7
- ## Roles
8
-
9
- ### intake-normalizer
10
-
11
- - validates repository intake artifacts
12
- - flags suspicious exclusions
13
- - confirms stack profile
14
-
15
- ### structural-mapper
16
-
17
- - reviews extracted units, surfaces, and graph artifacts
18
- - resolves ambiguous file classifications
19
- - flags missing boundaries
20
-
21
- ### blind-spot-mapper
22
-
23
- - identifies repo-specific blind spots tools may miss
24
- - flags hidden operational or security-critical surfaces
25
- - proposes additional lenses or dynamic checks
26
-
27
- ### correctness-auditor
28
-
29
- - checks whether code behavior appears to match intent
30
- - focuses on edge cases, defaults, assumptions, and branch handling
31
-
32
- ### architecture-auditor
33
-
34
- - inspects layering, boundaries, coupling, abstraction fit, and dependency direction
35
-
36
- ### security-auditor
37
-
38
- - inspects trust boundaries, auth/authz, validation, secret handling, risky sinks, and exploitability
39
-
40
- ### reliability-auditor
41
-
42
- - inspects retries, timeouts, idempotency, partial failures, crash consistency, and concurrency risk
43
-
44
- ### performance-auditor
45
-
46
- - inspects hot paths, repeated work, query inefficiency, algorithmic issues, memory pressure, and scalability risk
47
-
48
- ### data-integrity-auditor
49
-
50
- - inspects invariants, migrations, transactional boundaries, schema drift, consistency, and race conditions
51
-
52
- ### test-auditor
53
-
54
- - inspects test adequacy, missing negative-path coverage, brittle tests, and false confidence
55
-
56
- ### operability-auditor
57
-
58
- - inspects logging, metrics, tracing, debuggability, startup validation, and runtime observability
59
-
60
- ### cross-cutting-auditor
61
-
62
- - audits repo-wide themes such as auth, retries, migrations, config validation, feature flags, and secrets flow
63
-
64
- ### synthesizer
65
-
66
- - merges duplicate findings
67
- - clusters root causes
68
- - prioritizes fixes
69
- - identifies quick wins vs structural work
@@ -1,90 +0,0 @@
1
- # Architecture
2
-
3
- ## Objective
4
-
5
- `auditor-lambda` is a portable code-auditing framework for arbitrary repositories. It separates deterministic extraction from bounded LLM judgment so that large or mixed-language codebases can be audited systematically.
6
-
7
- ## Design principles
8
-
9
- 1. Tool outputs first
10
- 2. Artifact-driven orchestration
11
- 3. Bounded LLM tasks
12
- 4. Explicit coverage accounting
13
- 5. Multi-pass review for critical code
14
- 6. Strict schemas for interoperability
15
-
16
- ## System layers
17
-
18
- ### 1. Intake
19
-
20
- - file discovery
21
- - stack detection
22
- - ignore handling
23
- - normalization
24
-
25
- ### 2. Extractors
26
-
27
- - service and package detection
28
- - route, job, command, workflow extraction
29
- - file bucketing
30
- - graph extraction
31
-
32
- ### 3. Mechanical analyzers
33
-
34
- - lint
35
- - typecheck
36
- - tests
37
- - test coverage
38
- - secret scanning
39
- - dependency scanning
40
- - static security scanning
41
- - complexity and duplication metrics
42
-
43
- ### 4. Orchestrator
44
-
45
- - builds audit units
46
- - assigns passes and lenses
47
- - chunks large files
48
- - tracks line coverage and pass overlap
49
- - requeues uncovered ranges
50
-
51
- ### 5. LLM agents
52
-
53
- - ambiguous classification
54
- - blind-spot mapping
55
- - per-lens audits
56
- - cross-cutting audits
57
- - synthesis
58
-
59
- ### 6. Validation
60
-
61
- - targeted runtime checks
62
- - startup/config probes
63
- - adversarial repros
64
-
65
- ### 7. Reporting
66
-
67
- - normalized findings
68
- - coverage matrices
69
- - root-cause clustering
70
- - remediation planning
71
-
72
- ## Core pipeline
73
-
74
- 1. Intake and normalize repository
75
- 2. Extract structure and graph artifacts
76
- 3. Run mechanical analyzers
77
- 4. Build audit units and risk register
78
- 5. Run blind-spot mapping
79
- 6. Run lens-based unit audits
80
- 7. Run cross-cutting audits
81
- 8. Run dynamic validation on targeted cases
82
- 9. Verify file and line coverage
83
- 10. Synthesize findings and remediation plan
84
-
85
- ## Portability rules
86
-
87
- - Tool-specific collectors should write into tool-agnostic JSON artifacts.
88
- - LLM prompts should consume artifacts, not raw repos by default.
89
- - All review work should be attributable to files, line ranges, lenses, and passes.
90
- - Coverage gaps should be machine-detectable.