auditor-lambda 0.1.0 → 0.2.1

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 (58) hide show
  1. package/README.md +2 -1
  2. package/audit-code-wrapper-lib.mjs +458 -380
  3. package/dist/cli.js +258 -11
  4. package/dist/coverage.d.ts +0 -1
  5. package/dist/coverage.js +3 -34
  6. package/dist/extractors/fileInventory.js +2 -0
  7. package/dist/io/artifacts.js +2 -1
  8. package/dist/orchestrator/advance.js +70 -52
  9. package/dist/orchestrator/flowCoverage.js +2 -1
  10. package/dist/orchestrator/flowPlanning.d.ts +1 -1
  11. package/dist/orchestrator/flowPlanning.js +21 -28
  12. package/dist/orchestrator/internalExecutors.js +0 -1
  13. package/dist/orchestrator/taskBuilder.d.ts +7 -2
  14. package/dist/orchestrator/taskBuilder.js +55 -47
  15. package/dist/prompts/renderWorkerPrompt.js +32 -0
  16. package/dist/providers/claudeCodeProvider.js +6 -0
  17. package/dist/providers/index.js +5 -2
  18. package/dist/providers/opencodeProvider.js +6 -1
  19. package/dist/providers/types.d.ts +1 -0
  20. package/dist/reporting/mergeFindings.js +0 -7
  21. package/dist/reporting/rootCause.d.ts +0 -1
  22. package/dist/reporting/rootCause.js +0 -6
  23. package/dist/reporting/synthesis.js +18 -0
  24. package/dist/supervisor/runLedger.js +6 -2
  25. package/dist/types/sessionConfig.d.ts +8 -0
  26. package/dist/types/workerSession.d.ts +2 -0
  27. package/dist/types.d.ts +1 -2
  28. package/dist/validation/auditResults.d.ts +11 -0
  29. package/dist/validation/auditResults.js +118 -0
  30. package/dist/validation/sessionConfig.js +15 -1
  31. package/docs/agent-integrations.md +61 -56
  32. package/docs/agent-roles.md +69 -69
  33. package/docs/architecture.md +90 -90
  34. package/docs/artifacts.md +69 -69
  35. package/docs/bootstrap-install.md +1 -1
  36. package/docs/model-selection.md +86 -86
  37. package/docs/next-steps.md +11 -9
  38. package/docs/packaging.md +3 -3
  39. package/docs/pipeline.md +152 -152
  40. package/docs/production-readiness.md +6 -5
  41. package/docs/repo-layout.md +18 -18
  42. package/docs/run-flow.md +5 -5
  43. package/docs/session-config.md +216 -210
  44. package/docs/supervisor.md +70 -70
  45. package/docs/windows-setup.md +139 -139
  46. package/package.json +56 -56
  47. package/schemas/audit-code-v1alpha1.schema.json +76 -76
  48. package/schemas/audit_result.schema.json +48 -48
  49. package/schemas/audit_task.schema.json +49 -49
  50. package/schemas/coverage_matrix.schema.json +0 -15
  51. package/schemas/file_disposition.schema.json +33 -33
  52. package/schemas/finding.schema.json +58 -62
  53. package/schemas/flow_coverage.schema.json +44 -44
  54. package/schemas/root_cause_clusters.schema.json +0 -4
  55. package/schemas/runtime_validation_report.schema.json +34 -34
  56. package/schemas/synthesis_report.schema.json +61 -61
  57. package/skills/audit-code/SKILL.md +37 -37
  58. package/skills/audit-code/audit-code.prompt.md +56 -54
@@ -4,51 +4,51 @@ description: Conversation-first autonomous code auditing workflow for the /audit
4
4
  ---
5
5
 
6
6
  # audit-code skill
7
-
8
- The canonical entrypoint is `/audit-code` in conversation.
9
-
10
- This skill should be treated as a conversational product surface first.
11
-
12
- ## Primary contract
13
-
7
+
8
+ The canonical entrypoint is `/audit-code` in conversation.
9
+
10
+ This skill should be treated as a conversational product surface first.
11
+
12
+ ## Primary contract
13
+
14
14
  Normal usage should:
15
15
 
16
16
  - run from conversation, not from manual shell arguments
17
17
  - avoid manual paths, provider flags, and model-selection arguments
18
18
  - advance the audit automatically until it completes or no further automatic progress is possible
19
-
20
- Bounded steps are a backend implementation detail, not the intended user experience.
21
-
22
- ## Embedded Prompt Payload
23
-
24
- For IDE-based LLMs (Antigravity, Copilot, Cursor), you can initialize the skill natively by importing the prompt payload defined in `audit-code.prompt.md`.
25
- This provides the LLM an exact instruction set required to natively intercept the state machine blocking phases securely and assume the responsibilities of the execution "worker".
26
-
27
- ## Repo-local fallback
28
-
29
- The repository still exposes a backend CLI wrapper:
30
-
31
- ```bash
32
- audit-code
33
- ```
34
-
35
- from the target repository root.
36
-
37
- Debug one-step mode:
38
-
39
- ```bash
40
- audit-code --single-step
41
- ```
42
-
43
- ## Backend mode note
44
-
19
+
20
+ Bounded steps are a backend implementation detail, not the intended user experience.
21
+
22
+ ## Embedded Prompt Payload
23
+
24
+ For IDE-based LLMs (Antigravity, Copilot, Cursor), you can initialize the skill natively by importing the prompt payload defined in `audit-code.prompt.md`.
25
+ This provides the LLM an exact instruction set required to natively intercept the state machine blocking phases securely and assume the responsibilities of the execution "worker".
26
+
27
+ ## Repo-local fallback
28
+
29
+ The repository still exposes a backend CLI wrapper:
30
+
31
+ ```bash
32
+ audit-code
33
+ ```
34
+
35
+ from the target repository root.
36
+
37
+ Debug one-step mode:
38
+
39
+ ```bash
40
+ audit-code --single-step
41
+ ```
42
+
43
+ ## Backend mode note
44
+
45
45
  For repo-local backend usage:
46
46
 
47
47
  - omitted provider remains `local-subprocess`
48
48
  - `local-subprocess` should stop cleanly once only manual or provider-assisted review remains
49
49
  - `provider: "auto"` is the explicit opt-in best-effort routing mode
50
50
  - explicit provider names remain available when an operator wants a specific backend
51
-
52
- ## Development rule
53
-
54
- Prefer the skill-first conversational contract over the CLI-first backend shape.
51
+
52
+ ## Development rule
53
+
54
+ Prefer the skill-first conversational contract over the CLI-first backend shape.
@@ -1,17 +1,17 @@
1
- ---
2
- name: Code Auditing Skill
3
- command: /audit-code
4
- description: Autonomous local loop code auditing
5
- ---
6
-
7
- # `/audit-code` Execution Directive
8
-
9
- **SYSTEM DIRECTIVE:** When the user enters `/audit-code` in the chat, you are to assume the role of an autonomous code auditor. You are no longer just a conversational assistant; you must use your local terminal and file-editing tools to act as the "LLM Thinking Worker" for the `auditor-lambda` framework.
10
-
11
- Follow this execution loop rigidly:
12
-
13
- ## Step 1: Step the Orchestrator
14
-
1
+ ---
2
+ name: Code Auditing Skill
3
+ command: /audit-code
4
+ description: Autonomous local loop code auditing
5
+ ---
6
+
7
+ # `/audit-code` Execution Directive
8
+
9
+ **SYSTEM DIRECTIVE:** When the user enters `/audit-code` in the chat, you are to assume the role of an autonomous code auditor. You are no longer just a conversational assistant; you must use your local terminal and file-editing tools to act as the "LLM Thinking Worker" for the `auditor-lambda` framework.
10
+
11
+ Follow this execution loop rigidly:
12
+
13
+ ## Step 1: Step the Orchestrator
14
+
15
15
  To move the state machine forward, execute the backend framework using your terminal tool:
16
16
 
17
17
  ```bash
@@ -19,48 +19,50 @@ audit-code
19
19
  ```
20
20
 
21
21
  _(If the wrapper is only available as a package dependency in the current repository, `npx audit-code` is equivalent. If developing locally against this repository, run `node audit-code.mjs`.)_
22
-
23
- ## Step 2: Handle Blockages (The "Thinking" Phase)
24
-
25
- Read the JSON output from the terminal.
26
- If the top-level status is `"blocked"`, it means the orchestrator needs your LLM "thinking" capabilities to evaluate code logic.
27
-
28
- To determine what task you have been assigned, use your file-reading tool to inspect:
29
-
30
- - `.audit-artifacts/dispatch/current-task.json`
31
- - `.audit-artifacts/dispatch/current-prompt.md`
32
-
33
- ## Step 3: Audit the Code natively
34
-
35
- 1. Read the specific goals and coverage rules laid out in `current-prompt.md`.
36
- 2. Use your file-reading tool to examine the specific source code files mentioned.
37
- 3. Critically analyze the codebase. Use your deepest reasoning capabilities (e.g., chain of thought) to discover defects, logic errors, or systemic architectural issues requested in the prompt.
38
-
39
- ## Step 4: Write the Findings
40
-
41
- Produce your findings array matching exactly the `AuditResult` JSON schema described in the prompt.
42
- Do not use `echo` or generic terminal shell strings for large JSON structures to avoid breaking JSON escaping. Instead, use your raw **File Edit Tool** to reliably save your results entirely to:
43
- `.audit-artifacts/worker_results_pending.json`
44
-
45
- ## Step 5: Feed the Loop
46
-
22
+
23
+ ## Step 2: Handle Blockages (The "Thinking" Phase)
24
+
25
+ Read the JSON output from the terminal.
26
+ If the top-level status is `"blocked"`, it means the orchestrator needs your LLM "thinking" capabilities to evaluate code logic.
27
+
28
+ To determine what task you have been assigned, use your file-reading tool to inspect:
29
+
30
+ - `.audit-artifacts/dispatch/current-task.json`
31
+ - `.audit-artifacts/dispatch/current-prompt.md`
32
+
33
+ ## Step 3: Audit the Code natively
34
+
35
+ 1. Read the specific goals and coverage rules laid out in `current-prompt.md`.
36
+ 2. Use your file-reading tool to examine the specific source code files mentioned.
37
+ 3. Critically analyze the codebase. Use your deepest reasoning capabilities (e.g., chain of thought) to discover defects, logic errors, or systemic architectural issues requested in the prompt.
38
+
39
+ > **Important:** Always read and analyze the files listed in the task's `file_paths` array directly. Do **not** infer which files belong to the task by searching for filename patterns or extensions (e.g. `.test.ts`, `.spec.js`) — the task already identifies the exact files for you. Searching by extension will miss files that use non-standard extensions (e.g. `.test.mjs`) and may produce false "no test files found" conclusions.
40
+
41
+ ## Step 4: Write the Findings
42
+
43
+ Produce your findings array matching exactly the `AuditResult` JSON schema described in the prompt.
44
+ Do not use `echo` or generic terminal shell strings for large JSON structures to avoid breaking JSON escaping. Instead, use your raw **File Edit Tool** to reliably save your results entirely to:
45
+ `.audit-artifacts/worker_results_pending.json`
46
+
47
+ ## Step 5: Feed the Loop
48
+
47
49
  Return your results to the state machine by running the ingestion command in the terminal:
48
50
 
49
51
  ```bash
50
52
  audit-code --results .audit-artifacts/worker_results_pending.json
51
53
  ```
52
-
53
- ## Step 6: Loop or Terminate
54
-
55
- Continue repeating Steps 1 through 5 as necessary. The state machine will iterate through structuring, planning, and tasking.
56
-
57
- **You must stop the loop when the terminal output has `"status": "complete"`.**
58
-
59
- ## Step 7: Presentation
60
-
61
- Once the audit is officially complete, DO NOT run the orchestrator again.
62
- Instead, use your file reading tool to consume:
63
-
64
- - `.audit-artifacts/synthesis_report.json`
65
-
66
- Finally, read these synthesis findings and present them back to the user in a polished, highly readable **Markdown Summary Table** directly in the chat panel. Wait for the user to ask you to begin resolving or patching the root_cause_clusters you discovered.
54
+
55
+ ## Step 6: Loop or Terminate
56
+
57
+ Continue repeating Steps 1 through 5 as necessary. The state machine will iterate through structuring, planning, and tasking.
58
+
59
+ **You must stop the loop when the terminal output has `"status": "complete"`.**
60
+
61
+ ## Step 7: Presentation
62
+
63
+ Once the audit is officially complete, DO NOT run the orchestrator again.
64
+ Instead, use your file reading tool to consume:
65
+
66
+ - `.audit-artifacts/synthesis_report.json`
67
+
68
+ Finally, read these synthesis findings and present them back to the user in a polished, highly readable **Markdown Summary Table** directly in the chat panel. Wait for the user to ask you to begin resolving or patching the root_cause_clusters you discovered.