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/pipeline.md CHANGED
@@ -1,152 +1,152 @@
1
- # Audit pipeline
2
-
3
- ## Phase 0: intake
4
-
5
- Automated:
6
-
7
- - enumerate files
8
- - detect languages and frameworks
9
- - identify exclusions
10
- - hash files
11
- - collect git metadata
12
-
13
- Outputs:
14
-
15
- - `repo_manifest.json`
16
- - `file_inventory.json`
17
- - `stack_profile.json`
18
-
19
- ## Phase 1: structural extraction
20
-
21
- Automated:
22
-
23
- - detect services, packages, apps
24
- - detect routes, jobs, commands, workflows
25
- - bucket files
26
- - extract graphs
27
- - detect data-layer artifacts
28
-
29
- Outputs:
30
-
31
- - `unit_manifest.json`
32
- - `surface_manifest.json`
33
- - `bucket_assignments.json`
34
- - `graph_bundle.json`
35
-
36
- LLM role:
37
-
38
- - resolve ambiguous units and suspicious classifications
39
-
40
- ## Phase 2: mechanical analysis
41
-
42
- Automated:
43
-
44
- - lint
45
- - typecheck
46
- - tests
47
- - coverage
48
- - secrets
49
- - dependencies
50
- - static security
51
- - complexity and duplication
52
-
53
- Outputs:
54
-
55
- - `mechanical_results.json`
56
- - `hotspot_report.json`
57
-
58
- LLM role:
59
-
60
- - distinguish signal from noise
61
- - identify what deserves deeper review
62
-
63
- ## Phase 3: risk scoring
64
-
65
- Automated inputs:
66
-
67
- - exposure
68
- - privilege indicators
69
- - persistent writes
70
- - secrets access
71
- - concurrency signals
72
- - churn
73
- - coverage weakness
74
-
75
- Outputs:
76
-
77
- - `risk_register.json`
78
-
79
- LLM role:
80
-
81
- - adjust for semantic criticality
82
-
83
- ## Phase 4: blind-spot mapping
84
-
85
- LLM task:
86
-
87
- - use manifests, graphs, and bounded source excerpts to identify what tools are likely missing
88
-
89
- Outputs:
90
-
91
- - `blind_spot_register.json`
92
- - `runtime_validation_targets.json`
93
-
94
- ## Phase 5: unit audits
95
-
96
- LLM task:
97
-
98
- - audit each unit under required lenses
99
-
100
- Outputs:
101
-
102
- - `audit_results/<unit>/<lens>.json`
103
-
104
- ## Phase 6: cross-cutting audits
105
-
106
- LLM task:
107
-
108
- - audit repo-wide concerns such as auth, retries, migrations, config validation, observability, and secrets flow
109
-
110
- Outputs:
111
-
112
- - `cross_cutting/<theme>.json`
113
-
114
- ## Phase 7: dynamic validation
115
-
116
- Automated + LLM:
117
-
118
- - run targeted checks for suspicious cases
119
- - interpret repro results
120
-
121
- Outputs:
122
-
123
- - `runtime_validation_report.json`
124
-
125
- ## Phase 8: coverage verification
126
-
127
- Automated:
128
-
129
- - verify every file is classified
130
- - verify every file is audited or explicitly excluded
131
- - verify reviewed line ranges cover the intended source
132
- - verify multi-pass overlap for critical units
133
-
134
- Outputs:
135
-
136
- - `coverage_matrix.json`
137
- - `line_coverage_map.json`
138
- - `uncovered_items.json`
139
-
140
- ## Phase 9: synthesis
141
-
142
- LLM task:
143
-
144
- - deduplicate findings
145
- - cluster by root cause
146
- - prioritize remediation
147
-
148
- Outputs:
149
-
150
- - `findings.json`
151
- - `root_cause_clusters.json`
152
- - `remediation_plan.md`
1
+ # Audit pipeline
2
+
3
+ ## Phase 0: intake
4
+
5
+ Automated:
6
+
7
+ - enumerate files
8
+ - detect languages and frameworks
9
+ - identify exclusions
10
+ - hash files
11
+ - collect git metadata
12
+
13
+ Outputs:
14
+
15
+ - `repo_manifest.json`
16
+ - `file_inventory.json`
17
+ - `stack_profile.json`
18
+
19
+ ## Phase 1: structural extraction
20
+
21
+ Automated:
22
+
23
+ - detect services, packages, apps
24
+ - detect routes, jobs, commands, workflows
25
+ - bucket files
26
+ - extract graphs
27
+ - detect data-layer artifacts
28
+
29
+ Outputs:
30
+
31
+ - `unit_manifest.json`
32
+ - `surface_manifest.json`
33
+ - `bucket_assignments.json`
34
+ - `graph_bundle.json`
35
+
36
+ LLM role:
37
+
38
+ - resolve ambiguous units and suspicious classifications
39
+
40
+ ## Phase 2: mechanical analysis
41
+
42
+ Automated:
43
+
44
+ - lint
45
+ - typecheck
46
+ - tests
47
+ - coverage
48
+ - secrets
49
+ - dependencies
50
+ - static security
51
+ - complexity and duplication
52
+
53
+ Outputs:
54
+
55
+ - `mechanical_results.json`
56
+ - `hotspot_report.json`
57
+
58
+ LLM role:
59
+
60
+ - distinguish signal from noise
61
+ - identify what deserves deeper review
62
+
63
+ ## Phase 3: risk scoring
64
+
65
+ Automated inputs:
66
+
67
+ - exposure
68
+ - privilege indicators
69
+ - persistent writes
70
+ - secrets access
71
+ - concurrency signals
72
+ - churn
73
+ - coverage weakness
74
+
75
+ Outputs:
76
+
77
+ - `risk_register.json`
78
+
79
+ LLM role:
80
+
81
+ - adjust for semantic criticality
82
+
83
+ ## Phase 4: blind-spot mapping
84
+
85
+ LLM task:
86
+
87
+ - use manifests, graphs, and bounded source excerpts to identify what tools are likely missing
88
+
89
+ Outputs:
90
+
91
+ - `blind_spot_register.json`
92
+ - `runtime_validation_targets.json`
93
+
94
+ ## Phase 5: unit audits
95
+
96
+ LLM task:
97
+
98
+ - audit each unit under required lenses
99
+
100
+ Outputs:
101
+
102
+ - `audit_results/<unit>/<lens>.json`
103
+
104
+ ## Phase 6: cross-cutting audits
105
+
106
+ LLM task:
107
+
108
+ - audit repo-wide concerns such as auth, retries, migrations, config validation, observability, and secrets flow
109
+
110
+ Outputs:
111
+
112
+ - `cross_cutting/<theme>.json`
113
+
114
+ ## Phase 7: dynamic validation
115
+
116
+ Automated + LLM:
117
+
118
+ - run targeted checks for suspicious cases
119
+ - interpret repro results
120
+
121
+ Outputs:
122
+
123
+ - `runtime_validation_report.json`
124
+
125
+ ## Phase 8: coverage verification
126
+
127
+ Automated:
128
+
129
+ - verify every file is classified
130
+ - verify every file is audited or explicitly excluded
131
+ - verify reviewed line ranges cover the intended source
132
+ - verify multi-pass overlap for critical units
133
+
134
+ Outputs:
135
+
136
+ - `coverage_matrix.json`
137
+ - `line_coverage_map.json`
138
+ - `uncovered_items.json`
139
+
140
+ ## Phase 9: synthesis
141
+
142
+ LLM task:
143
+
144
+ - deduplicate findings
145
+ - cluster by root cause
146
+ - prioritize remediation
147
+
148
+ Outputs:
149
+
150
+ - `findings.json`
151
+ - `root_cause_clusters.json`
152
+ - `remediation_plan.md`
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Verdict
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
  It is in good shape for a controlled alpha or beta release:
8
8
 
@@ -14,6 +14,7 @@ It is in good shape for a controlled alpha or beta release:
14
14
  - malformed config and corrupted artifact handling are explicit
15
15
  - blocked fallback runs now emit structured operator handoff guidance
16
16
  - supported repo-local hosts now share a bootstrap install path via `audit-code install`
17
+ - configured provider-assisted review can now continue to completion in a single wrapper invocation
17
18
 
18
19
  ## Why It Is Not Yet Production-Ready
19
20
 
@@ -23,8 +24,8 @@ The biggest remaining gaps are product and release-operational, not core wrapper
23
24
  The repo has publish automation, but package-name ownership and registry credentials still need to be confirmed outside the codebase.
24
25
  2. The primary conversation-first product still has setup friction on hosts without a verified repo-local slash-command surface.
25
26
  VS Code / Copilot, OpenCode, and Claude Code now share a bootstrap path, but Claude Desktop, Antigravity, and other hosts still need more work.
26
- 3. Assisted-review continuation is still only partially solved.
27
- The fallback wrapper now explains blocked states much better, but the smoothest path is still missing when an interactive provider should continue the review directly.
27
+ 3. Provider-assisted continuation still needs polish outside the happy path.
28
+ Configured interactive bridges can now continue through audit-task review, but operator guidance and host-specific ergonomics still need refinement when a provider cannot produce results cleanly.
28
29
 
29
30
  The explicit launch bar is now documented in `docs/production-launch-bar.md`, and the in-repo release gate is codified as `npm run verify:release`.
30
31
 
@@ -34,8 +35,8 @@ The explicit launch bar is now documented in `docs/production-launch-bar.md`, an
34
35
  Validate npm package-name availability and ownership for `auditor-lambda`, confirm `NPM_TOKEN` access in GitHub Actions, and run a real pre-release or dry-run publish from the release workflow path.
35
36
  2. Extend bootstrap coverage beyond the currently automated hosts.
36
37
  Keep `audit-code install` stable for VS Code / Copilot, OpenCode, and Claude Code, and close the remaining friction gap for hosts that still lack a verified repo-local install surface.
37
- 3. Improve interactive continuation.
38
- When an interactive provider is configured, continue through provider-assisted review with less operator handoff and less manual evidence re-import.
38
+ 3. Polish provider-assisted UX.
39
+ Keep the new continuation path explicit and inspectable while improving failure hints, host guidance, and operator recovery when a provider bridge misbehaves.
39
40
 
40
41
  ## Nice-To-Have Follow-On Work
41
42
 
@@ -1,5 +1,5 @@
1
- # Repository layout
2
-
1
+ # Repository layout
2
+
3
3
  ## Top-level purpose
4
4
 
5
5
  - `docs/`: architecture, pipeline, layout, and design notes
@@ -12,19 +12,19 @@
12
12
  - `docs/next-steps.md`: current roadmap and next implementation notes
13
13
  - `docs/production-launch-bar.md`: explicit minimum launch criteria and release verification bar
14
14
  - `docs/production-readiness.md`: current production-readiness verdict and launch blockers
15
-
16
- ## Near-term code layout
17
-
18
- - `src/extractors/`: deterministic collectors and heuristic classifiers
19
- - `src/orchestrator/`: task construction, chunking, pass logic, and requeue support
20
- - `src/coverage/` or `src/coverage.ts`: coverage accounting helpers
21
- - `src/reporting/`: result merging and remediation views
22
- - `src/types.ts`: shared TypeScript interfaces mirroring the JSON schemas as closely as practical
23
-
24
- ## Skill portability rule
25
-
26
- The repo should be usable even when the host environment changes. For that reason:
27
-
28
- - prompts should remain plain markdown
29
- - artifacts should remain plain JSON
30
- - orchestration logic should not depend on one editor or one agent runtime
15
+
16
+ ## Near-term code layout
17
+
18
+ - `src/extractors/`: deterministic collectors and heuristic classifiers
19
+ - `src/orchestrator/`: task construction, chunking, pass logic, and requeue support
20
+ - `src/coverage/` or `src/coverage.ts`: coverage accounting helpers
21
+ - `src/reporting/`: result merging and remediation views
22
+ - `src/types.ts`: shared TypeScript interfaces mirroring the JSON schemas as closely as practical
23
+
24
+ ## Skill portability rule
25
+
26
+ The repo should be usable even when the host environment changes. For that reason:
27
+
28
+ - prompts should remain plain markdown
29
+ - artifacts should remain plain JSON
30
+ - orchestration logic should not depend on one editor or one agent runtime
package/docs/run-flow.md CHANGED
@@ -9,11 +9,11 @@ This document describes the backend execution flow that supports that conversati
9
9
  1. Build or import a repository manifest.
10
10
  2. Build audit units from the repository manifest.
11
11
  3. Initialize a coverage matrix from the file list.
12
- 4. Apply unit-to-file coverage requirements.
13
- 5. Build initial audit tasks.
14
- 6. Dispatch those tasks to LLM agents or other runtimes.
15
- 7. Ingest structured audit results.
16
- 8. Apply reviewed ranges and completed lenses to the coverage matrix.
12
+ 4. Apply unit-to-file coverage requirements.
13
+ 5. Build initial audit tasks.
14
+ 6. Dispatch those tasks to LLM agents or other runtimes.
15
+ 7. Ingest structured audit results.
16
+ 8. Apply reviewed ranges and completed lenses to the coverage matrix.
17
17
  9. Build requeue tasks for missing lenses or uncovered ranges.
18
18
  10. Repeat until coverage rules are satisfied.
19
19
  11. Synthesize findings into merged outputs.