auditor-lambda 0.1.0 → 0.2.2

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 (87) hide show
  1. package/README.md +2 -1
  2. package/audit-code-wrapper-lib.mjs +205 -187
  3. package/dist/adapters/eslint.js +4 -2
  4. package/dist/adapters/npmAudit.js +1 -1
  5. package/dist/cli.js +296 -12
  6. package/dist/coverage.d.ts +0 -1
  7. package/dist/coverage.js +3 -34
  8. package/dist/extractors/bucketing.js +14 -35
  9. package/dist/extractors/disposition.js +8 -9
  10. package/dist/extractors/flows.js +14 -23
  11. package/dist/extractors/pathPatterns.d.ts +19 -0
  12. package/dist/extractors/pathPatterns.js +87 -0
  13. package/dist/extractors/surfaces.js +2 -7
  14. package/dist/io/artifacts.d.ts +23 -1
  15. package/dist/io/artifacts.js +3 -1
  16. package/dist/io/runArtifacts.js +1 -1
  17. package/dist/orchestrator/advance.js +1 -1
  18. package/dist/orchestrator/flowPlanning.d.ts +1 -1
  19. package/dist/orchestrator/flowPlanning.js +21 -28
  20. package/dist/orchestrator/internalExecutors.js +4 -7
  21. package/dist/orchestrator/planning.js +12 -20
  22. package/dist/orchestrator/resultIngestion.js +3 -2
  23. package/dist/orchestrator/runtimeValidation.js +5 -0
  24. package/dist/orchestrator/syntaxResolutionExecutor.js +10 -2
  25. package/dist/orchestrator/taskBuilder.d.ts +7 -2
  26. package/dist/orchestrator/taskBuilder.js +47 -52
  27. package/dist/prompts/renderWorkerPrompt.js +33 -0
  28. package/dist/providers/claudeCodeProvider.js +5 -0
  29. package/dist/providers/constants.d.ts +1 -0
  30. package/dist/providers/constants.js +1 -0
  31. package/dist/providers/index.js +9 -2
  32. package/dist/providers/spawnLoggedCommand.js +4 -0
  33. package/dist/reporting/mergeFindings.js +0 -7
  34. package/dist/reporting/rootCause.d.ts +0 -1
  35. package/dist/reporting/rootCause.js +0 -6
  36. package/dist/reporting/synthesis.js +18 -0
  37. package/dist/supervisor/operatorHandoff.d.ts +2 -0
  38. package/dist/supervisor/operatorHandoff.js +21 -9
  39. package/dist/supervisor/runLedger.js +6 -3
  40. package/dist/supervisor/sessionConfig.js +1 -0
  41. package/dist/types/flowCoverage.d.ts +1 -1
  42. package/dist/types/runLedger.d.ts +1 -1
  43. package/dist/types/runtimeValidation.d.ts +2 -1
  44. package/dist/types/sessionConfig.d.ts +2 -0
  45. package/dist/types/surfaces.d.ts +2 -1
  46. package/dist/types/workerSession.d.ts +4 -0
  47. package/dist/types.d.ts +0 -2
  48. package/dist/validation/auditResults.d.ts +11 -0
  49. package/dist/validation/auditResults.js +118 -0
  50. package/docs/agent-integrations.md +61 -56
  51. package/docs/agent-roles.md +69 -69
  52. package/docs/architecture.md +90 -90
  53. package/docs/artifacts.md +69 -69
  54. package/docs/bootstrap-install.md +1 -1
  55. package/docs/model-selection.md +86 -86
  56. package/docs/next-steps.md +11 -9
  57. package/docs/packaging.md +3 -3
  58. package/docs/pipeline.md +152 -152
  59. package/docs/production-readiness.md +6 -5
  60. package/docs/repo-layout.md +18 -18
  61. package/docs/run-flow.md +5 -5
  62. package/docs/session-config.md +216 -210
  63. package/docs/supervisor.md +70 -70
  64. package/docs/windows-setup.md +139 -139
  65. package/package.json +56 -56
  66. package/schemas/audit-code-v1alpha1.schema.json +80 -76
  67. package/schemas/audit_result.schema.json +54 -48
  68. package/schemas/audit_state.schema.json +2 -2
  69. package/schemas/audit_task.schema.json +60 -49
  70. package/schemas/blind_spot_register.schema.json +13 -3
  71. package/schemas/coverage_matrix.schema.json +14 -17
  72. package/schemas/critical_flows.schema.json +6 -3
  73. package/schemas/external_analyzer_results.schema.json +10 -4
  74. package/schemas/file_disposition.schema.json +33 -33
  75. package/schemas/finding.schema.json +86 -62
  76. package/schemas/flow_coverage.schema.json +53 -44
  77. package/schemas/graph_bundle.schema.json +12 -6
  78. package/schemas/merged_findings.schema.json +7 -2
  79. package/schemas/risk_register.schema.json +5 -1
  80. package/schemas/root_cause_clusters.schema.json +2 -5
  81. package/schemas/runtime_validation_report.schema.json +34 -34
  82. package/schemas/runtime_validation_tasks.schema.json +4 -1
  83. package/schemas/surface_manifest.schema.json +4 -1
  84. package/schemas/synthesis_report.schema.json +61 -61
  85. package/schemas/unit_manifest.schema.json +10 -3
  86. package/skills/audit-code/SKILL.md +37 -37
  87. package/skills/audit-code/audit-code.prompt.md +54 -54
package/docs/artifacts.md CHANGED
@@ -1,69 +1,69 @@
1
- # Core artifacts
2
-
3
- These JSON artifacts are the stable contract between deterministic tooling and LLM audit passes.
4
-
5
- ## Core files
6
-
7
- - `repo_manifest.json`
8
- - `file_disposition.json`
9
- - `unit_manifest.json`
10
- - `graph_bundle.json`
11
- - `surface_manifest.json`
12
- - `critical_flows.json`
13
- - `flow_coverage.json`
14
- - `risk_register.json`
15
- - `coverage_matrix.json`
16
- - `runtime_validation_tasks.json`
17
- - `runtime_validation_report.json`
18
- - `external_analyzer_results.json`
19
- - `audit_results.json`
20
- - `requeue_tasks.json`
21
- - `merged_findings.json`
22
- - `root_cause_clusters.json`
23
- - `synthesis_report.json`
24
-
25
- ## Design rule
26
-
27
- Tool-specific collectors should write into these normalized formats so that the agent layer can remain portable across runtimes.
28
-
29
- ## Coverage rule
30
-
31
- Coverage is not based only on test instrumentation. It is based on explicit audit accounting:
32
-
33
- - file classification
34
- - file disposition
35
- - unit assignment
36
- - required lenses
37
- - reviewed source ranges
38
- - completed passes
39
- - requeue targets for missing review
40
- - critical-flow coverage state
41
-
42
- ## Excluded artifact behavior
43
-
44
- Files marked as generated, vendor, binary, doc-only, or explicitly excluded should remain visible in manifests and disposition tracking, but should not receive normal audit-unit assignment or requeue tasks.
45
-
46
- ## Critical flow role
47
-
48
- `critical_flows.json` is intended to bridge deterministic planning and higher-order semantic review. It gives LLM agents a bounded way to inspect important end-to-end paths without reading the entire repository at once.
49
-
50
- `flow_coverage.json` tracks whether those important paths have received the intended lenses, which allows the planner to treat critical-flow review as a first-class coverage requirement rather than a loose advisory layer.
51
-
52
- ## Runtime validation role
53
-
54
- `runtime_validation_tasks.json` turns unresolved high-risk units and incomplete critical flows into explicit dynamic follow-up work.
55
-
56
- `runtime_validation_report.json` is where evidence from those checks should land so that later synthesis can distinguish confirmed, not-confirmed, and inconclusive concerns.
57
-
58
- ## External analyzer role
59
-
60
- `external_analyzer_results.json` is the normalized landing zone for third-party tools such as SAST analyzers, coverage summaries, lint diagnostics, dependency scanners, and similar sources. Downstream prompts should prefer this normalized form over raw tool-native payloads.
61
-
62
- External analyzer results now also influence:
63
-
64
- - risk scoring
65
- - required lenses in coverage
66
- - task priority
67
- - dedicated analyzer follow-up tasks
68
- - requeue priority
69
- - synthesis evidence and summaries
1
+ # Core artifacts
2
+
3
+ These JSON artifacts are the stable contract between deterministic tooling and LLM audit passes.
4
+
5
+ ## Core files
6
+
7
+ - `repo_manifest.json`
8
+ - `file_disposition.json`
9
+ - `unit_manifest.json`
10
+ - `graph_bundle.json`
11
+ - `surface_manifest.json`
12
+ - `critical_flows.json`
13
+ - `flow_coverage.json`
14
+ - `risk_register.json`
15
+ - `coverage_matrix.json`
16
+ - `runtime_validation_tasks.json`
17
+ - `runtime_validation_report.json`
18
+ - `external_analyzer_results.json`
19
+ - `audit_results.json`
20
+ - `requeue_tasks.json`
21
+ - `merged_findings.json`
22
+ - `root_cause_clusters.json`
23
+ - `synthesis_report.json`
24
+
25
+ ## Design rule
26
+
27
+ Tool-specific collectors should write into these normalized formats so that the agent layer can remain portable across runtimes.
28
+
29
+ ## Coverage rule
30
+
31
+ Coverage is not based only on test instrumentation. It is based on explicit audit accounting:
32
+
33
+ - file classification
34
+ - file disposition
35
+ - unit assignment
36
+ - required lenses
37
+ - reviewed source ranges
38
+ - completed passes
39
+ - requeue targets for missing review
40
+ - critical-flow coverage state
41
+
42
+ ## Excluded artifact behavior
43
+
44
+ Files marked as generated, vendor, binary, doc-only, or explicitly excluded should remain visible in manifests and disposition tracking, but should not receive normal audit-unit assignment or requeue tasks.
45
+
46
+ ## Critical flow role
47
+
48
+ `critical_flows.json` is intended to bridge deterministic planning and higher-order semantic review. It gives LLM agents a bounded way to inspect important end-to-end paths without reading the entire repository at once.
49
+
50
+ `flow_coverage.json` tracks whether those important paths have received the intended lenses, which allows the planner to treat critical-flow review as a first-class coverage requirement rather than a loose advisory layer.
51
+
52
+ ## Runtime validation role
53
+
54
+ `runtime_validation_tasks.json` turns unresolved high-risk units and incomplete critical flows into explicit dynamic follow-up work.
55
+
56
+ `runtime_validation_report.json` is where evidence from those checks should land so that later synthesis can distinguish confirmed, not-confirmed, and inconclusive concerns.
57
+
58
+ ## External analyzer role
59
+
60
+ `external_analyzer_results.json` is the normalized landing zone for third-party tools such as SAST analyzers, coverage summaries, lint diagnostics, dependency scanners, and similar sources. Downstream prompts should prefer this normalized form over raw tool-native payloads.
61
+
62
+ External analyzer results now also influence:
63
+
64
+ - risk scoring
65
+ - required lenses in coverage
66
+ - task priority
67
+ - dedicated analyzer follow-up tasks
68
+ - requeue priority
69
+ - synthesis evidence and summaries
@@ -24,7 +24,7 @@ Installed always-on compatibility surfaces:
24
24
 
25
25
  Installed repo-local canonical assets:
26
26
 
27
- - `.audit-code/install/audit-code.prompt.md`
27
+ - `.audit-code/install/audit-code.import.md`
28
28
  - `.audit-code/install/SKILL.md`
29
29
  - `.audit-code/install/GETTING-STARTED.md`
30
30
 
@@ -1,86 +1,86 @@
1
- # model selection
2
-
3
- This repository has two distinct model-selection layers.
4
-
5
- ## 1. Skill-first product rule
6
-
7
- The canonical product surface is `/audit-code` in conversation.
8
-
9
- For that surface, the default model rule is:
10
-
11
- - use the active conversation model by default
12
- - avoid forcing the user to supply a model in normal usage
13
-
14
- That is the intended product contract.
15
-
16
- ## 2. Backend provider rule
17
-
18
- When the local backend delegates bounded worker runs into an external provider, model selection becomes provider-specific.
19
-
20
- That means the supervisor should not invent a global model abstraction unless it can be implemented consistently across adapters.
21
-
22
- Today the practical rule is:
23
-
24
- - no provider-specific model override by default
25
- - let each provider use its own default model unless explicitly configured otherwise
26
- - when a model is required, pass it through the provider's own native CLI arguments via `extra_args`
27
-
28
- ## Current provider behavior
29
-
30
- ### `local-subprocess`
31
-
32
- No external LLM provider is selected here.
33
-
34
- The supervisor simply launches the bounded local worker command.
35
-
36
- ### `claude-code`
37
-
38
- The built-in Claude Code adapter supports model overrides through `claude_code.extra_args`.
39
-
40
- Example:
41
-
42
- ```json
43
- {
44
- "provider": "claude-code",
45
- "ui_mode": "visible",
46
- "claude_code": {
47
- "command": "claude",
48
- "extra_args": ["--model", "sonnet"]
49
- }
50
- }
51
- ```
52
-
53
- Use this only when you want to force a specific Claude Code model instead of relying on the user's normal Claude Code default.
54
-
55
- ### `opencode`
56
-
57
- The built-in OpenCode adapter supports model overrides through `opencode.extra_args`.
58
-
59
- Example:
60
-
61
- ```json
62
- {
63
- "provider": "opencode",
64
- "ui_mode": "visible",
65
- "opencode": {
66
- "command": "opencode",
67
- "extra_args": ["--model", "anthropic/claude-sonnet-4.5"]
68
- }
69
- }
70
- ```
71
-
72
- Use this only when you want to force a specific OpenCode provider/model pair instead of relying on the user's normal OpenCode default.
73
-
74
- ### `subprocess-template` and `vscode-task`
75
-
76
- These adapters do not define model semantics themselves.
77
-
78
- If you need model selection here, include it in the external launcher command template or in the external tool being invoked.
79
-
80
- ## Recommendation
81
-
82
- For the cleanest product behavior:
83
-
84
- 1. in conversation, let `/audit-code` inherit the active conversation model
85
- 2. for repo-local backend usage, do not force model selection unless the operator has a concrete reason
86
- 3. when needed, set model selection in the provider-native config rather than inventing another repo-level abstraction
1
+ # model selection
2
+
3
+ This repository has two distinct model-selection layers.
4
+
5
+ ## 1. Skill-first product rule
6
+
7
+ The canonical product surface is `/audit-code` in conversation.
8
+
9
+ For that surface, the default model rule is:
10
+
11
+ - use the active conversation model by default
12
+ - avoid forcing the user to supply a model in normal usage
13
+
14
+ That is the intended product contract.
15
+
16
+ ## 2. Backend provider rule
17
+
18
+ When the local backend delegates bounded worker runs into an external provider, model selection becomes provider-specific.
19
+
20
+ That means the supervisor should not invent a global model abstraction unless it can be implemented consistently across adapters.
21
+
22
+ Today the practical rule is:
23
+
24
+ - no provider-specific model override by default
25
+ - let each provider use its own default model unless explicitly configured otherwise
26
+ - when a model is required, pass it through the provider's own native CLI arguments via `extra_args`
27
+
28
+ ## Current provider behavior
29
+
30
+ ### `local-subprocess`
31
+
32
+ No external LLM provider is selected here.
33
+
34
+ The supervisor simply launches the bounded local worker command.
35
+
36
+ ### `claude-code`
37
+
38
+ The built-in Claude Code adapter supports model overrides through `claude_code.extra_args`.
39
+
40
+ Example:
41
+
42
+ ```json
43
+ {
44
+ "provider": "claude-code",
45
+ "ui_mode": "visible",
46
+ "claude_code": {
47
+ "command": "claude",
48
+ "extra_args": ["--model", "sonnet"]
49
+ }
50
+ }
51
+ ```
52
+
53
+ Use this only when you want to force a specific Claude Code model instead of relying on the user's normal Claude Code default.
54
+
55
+ ### `opencode`
56
+
57
+ The built-in OpenCode adapter supports model overrides through `opencode.extra_args`.
58
+
59
+ Example:
60
+
61
+ ```json
62
+ {
63
+ "provider": "opencode",
64
+ "ui_mode": "visible",
65
+ "opencode": {
66
+ "command": "opencode",
67
+ "extra_args": ["--model", "anthropic/claude-sonnet-4.5"]
68
+ }
69
+ }
70
+ ```
71
+
72
+ Use this only when you want to force a specific OpenCode provider/model pair instead of relying on the user's normal OpenCode default.
73
+
74
+ ### `subprocess-template` and `vscode-task`
75
+
76
+ These adapters do not define model semantics themselves.
77
+
78
+ If you need model selection here, include it in the external launcher command template or in the external tool being invoked.
79
+
80
+ ## Recommendation
81
+
82
+ For the cleanest product behavior:
83
+
84
+ 1. in conversation, let `/audit-code` inherit the active conversation model
85
+ 2. for repo-local backend usage, do not force model selection unless the operator has a concrete reason
86
+ 3. when needed, set model selection in the provider-native config rather than inventing another repo-level abstraction
@@ -2,7 +2,7 @@
2
2
 
3
3
  This document tracks the next meaningful implementation work after the current skill-first productionization pass.
4
4
 
5
- As of April 17, 2026, this repository is not yet ready for a public production launch.
5
+ As of April 18, 2026, this repository is not yet ready for a public production launch.
6
6
 
7
7
  See:
8
8
 
@@ -20,6 +20,7 @@ The repository now supports:
20
20
  - `audit-code validate` as a machine-readable backend operator check
21
21
  - an explicit in-repo release gate via `npm run verify:release`
22
22
  - structured operator handoff output plus `.audit-artifacts/operator-handoff.{json,md}` for blocked fallback runs
23
+ - configured provider bridges that can continue audit-task review by writing structured results and handing control back to the bounded worker command
23
24
 
24
25
  That means the current release is suitable for a controlled alpha or beta skill-first workflow, but it is not yet the final public production end-state.
25
26
 
@@ -52,15 +53,15 @@ Near-term work should focus on:
52
53
  - removing host-specific manual prompt wiring where practical
53
54
  - keeping the active conversation model and attached repo context as the default operating mode
54
55
 
55
- ### 3. Improve continuation through assisted review
56
+ ### 3. Polish continuation through assisted review
56
57
 
57
- The repo-local backend fallback still intentionally stops once only manual or provider-assisted review remains.
58
+ The repo-local backend fallback still intentionally stops in blocked state under `local-subprocess`, but configured provider bridges can now continue the audit-task review phase automatically.
58
59
 
59
60
  Near-term work should focus on:
60
61
 
61
- - smoother continuation when an interactive provider is configured
62
62
  - clearer evidence handoff for imported results and runtime updates
63
- - less operator guesswork when the backend reaches a blocked terminal handoff
63
+ - less operator guesswork when a configured provider fails to return usable results
64
+ - stronger host-specific guidance for provider-assisted bridges
64
65
 
65
66
  ### 4. Harden publish and release operations
66
67
 
@@ -92,7 +93,7 @@ The repository should not be described as frictionless and production-ready unti
92
93
 
93
94
  ### Assisted review continuation
94
95
 
95
- - when an interactive provider is configured, blocked audits continue with less manual result import
96
+ - configured interactive providers can continue blocked audits through audit-task review in the same wrapper invocation
96
97
  - operator handoff artifacts remain explicit and inspectable even when continuation is smoother
97
98
 
98
99
  ### Release operations
@@ -120,17 +121,18 @@ Follow-on shape:
120
121
  - document the exact install and verification path for hosts that still need extra handling
121
122
  - only claim native support for a host once its install surface is equally concrete and testable
122
123
 
123
- ### 2. Continue blocked reviews through a configured interactive provider
124
+ ### 2. Harden configured interactive-provider continuation
124
125
 
125
126
  Most likely shape:
126
127
 
127
128
  - use the existing provider configuration surface in `.audit-artifacts/session-config.json`
128
- - make the blocked handoff less manual when `claude-code`, `opencode`, or another bridge is intentionally configured
129
+ - keep the provider-assisted review handoff less manual when `claude-code`, `opencode`, or another bridge is intentionally configured
129
130
  - preserve explicit artifact imports and operator visibility instead of hiding state transitions
131
+ - improve diagnostics and recovery when the provider fails to emit structured results
130
132
 
131
133
  Practical success bar:
132
134
 
133
- - a blocked audit can continue through the configured provider with fewer manual result-import and handoff steps
135
+ - a configured provider can continue through audit-task review with good diagnostics and low operator guesswork when something goes wrong
134
136
 
135
137
  ### 3. Prove the release path outside the repository
136
138
 
package/docs/packaging.md CHANGED
@@ -25,12 +25,12 @@ A packaged-install smoke test proves the same assets still work when consumed fr
25
25
  ## Packaged smoke command
26
26
 
27
27
  From the repository root:
28
-
28
+
29
29
  ```bash
30
30
  npm install
31
31
  npm run verify:release
32
32
  ```
33
-
33
+
34
34
  That script:
35
35
 
36
36
  - creates a tarball with `npm pack`
@@ -55,7 +55,7 @@ The release publish gate also runs both installed-entrypoint smoke paths before
55
55
  ```text
56
56
  .github/workflows/publish-package.yml
57
57
  ```
58
-
58
+
59
59
  ## Publish pipeline state
60
60
 
61
61
  The repository now includes packaging metadata and lifecycle hooks intended for registry publication: