auditor-lambda 0.3.2 → 0.3.4
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 +6 -1
- package/audit-code-wrapper-lib.mjs +78 -5
- package/dist/cli.js +205 -67
- package/dist/extractors/graph.d.ts +5 -1
- package/dist/extractors/graph.js +223 -3
- package/dist/extractors/pathPatterns.d.ts +3 -2
- package/dist/extractors/pathPatterns.js +97 -24
- package/dist/io/artifacts.d.ts +5 -0
- package/dist/io/artifacts.js +2 -0
- package/dist/io/json.js +3 -3
- package/dist/io/runArtifacts.js +4 -0
- package/dist/mcp/server.js +24 -11
- package/dist/orchestrator/advance.js +1 -1
- package/dist/orchestrator/dependencyMap.js +18 -0
- package/dist/orchestrator/internalExecutors.d.ts +1 -1
- package/dist/orchestrator/internalExecutors.js +120 -33
- package/dist/orchestrator/reviewPackets.d.ts +14 -0
- package/dist/orchestrator/reviewPackets.js +300 -0
- package/dist/orchestrator/selectiveDeepening.d.ts +14 -0
- package/dist/orchestrator/selectiveDeepening.js +392 -0
- package/dist/orchestrator/state.js +6 -1
- package/dist/orchestrator/taskBuilder.d.ts +16 -0
- package/dist/orchestrator/taskBuilder.js +68 -11
- package/dist/orchestrator.js +53 -2
- package/dist/prompts/renderWorkerPrompt.js +11 -4
- package/dist/providers/index.js +1 -1
- package/dist/supervisor/sessionConfig.js +1 -1
- package/dist/types/graph.d.ts +1 -0
- package/dist/types/reviewPlanning.d.ts +41 -0
- package/dist/types/reviewPlanning.js +1 -0
- package/dist/validation/artifacts.js +13 -0
- package/dist/validation/sessionConfig.js +1 -1
- package/docs/agent-integrations.md +17 -8
- package/docs/bootstrap-install.md +3 -0
- package/docs/dispatch-implementation-plan.md +179 -481
- package/docs/next-steps.md +13 -8
- package/docs/product-direction.md +5 -3
- package/docs/run-flow.md +23 -30
- package/docs/session-config.md +10 -3
- package/docs/supervisor.md +12 -4
- package/docs/workflow-refactor-brief.md +85 -147
- package/package.json +1 -1
- package/schemas/audit_results.schema.json +10 -0
- package/schemas/finding.schema.json +1 -15
- package/schemas/graph_bundle.schema.json +16 -0
- package/skills/audit-code/SKILL.md +12 -3
- package/skills/audit-code/audit-code.prompt.md +87 -57
package/docs/next-steps.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# Next Implementation Steps
|
|
2
2
|
|
|
3
|
-
This document tracks the next meaningful implementation work after the
|
|
3
|
+
This document tracks the next meaningful implementation work after the packet
|
|
4
|
+
review-dispatch refactor and the current skill-first productionization pass.
|
|
4
5
|
|
|
5
6
|
As of April 22, 2026, the shared MCP substrate and the first host-native installer pass have landed, but this repository is not yet ready for a public production launch.
|
|
6
7
|
|
|
@@ -31,22 +32,26 @@ The repository now supports:
|
|
|
31
32
|
- an explicit in-repo release gate via `npm run verify:release`
|
|
32
33
|
- structured operator handoff output plus `.audit-artifacts/operator-handoff.{json,md}` for blocked fallback runs
|
|
33
34
|
- configured provider bridges that can continue audit-task review by writing structured results and handing control back to the bounded worker command
|
|
35
|
+
- graph-informed review packets, `review_packets.json`, and `audit_plan_metrics.json`
|
|
36
|
+
- compact packet `prepare-dispatch` and `merge-and-ingest` envelopes
|
|
34
37
|
|
|
35
38
|
That means the current release is suitable for a controlled alpha or beta skill-first workflow with MCP-aware host bootstrapping, but it is not yet the final public production end-state.
|
|
36
39
|
|
|
37
40
|
## Near-term priorities
|
|
38
41
|
|
|
39
|
-
### 1.
|
|
42
|
+
### 1. Prove packet review dispatch on real repositories
|
|
40
43
|
|
|
41
|
-
The highest-priority product
|
|
44
|
+
The highest-priority product follow-through is to validate the packet workflow
|
|
45
|
+
outside this repository and compare it to the legacy fan-out baseline.
|
|
42
46
|
|
|
43
47
|
Near-term work should focus on:
|
|
44
48
|
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
-
|
|
49
|
+
- running `/audit-code` against at least one nontrivial external repository
|
|
50
|
+
- recording packet count, task count, warning count, and largest-packet estimate
|
|
51
|
+
- comparing observed worker count and token/quota behavior against the old
|
|
52
|
+
one-task-per-worker model
|
|
53
|
+
- tightening packet budgets or warning thresholds if real repositories expose
|
|
54
|
+
rough edges
|
|
50
55
|
|
|
51
56
|
The current handoff for this work is:
|
|
52
57
|
|
|
@@ -94,9 +94,11 @@ That means:
|
|
|
94
94
|
The intended review planner should:
|
|
95
95
|
|
|
96
96
|
- determine which files require which lenses
|
|
97
|
-
-
|
|
98
|
-
-
|
|
99
|
-
-
|
|
97
|
+
- preserve `AuditTask` as the deterministic coverage identity
|
|
98
|
+
- group related tasks into graph-informed review packets for worker dispatch
|
|
99
|
+
- review multiple relevant lenses for the same packet in one worker pass
|
|
100
|
+
- keep one validated `AuditResult` object per underlying task
|
|
101
|
+
- batch tiny homogeneous files rather than spawning one worker per small task
|
|
100
102
|
|
|
101
103
|
## Default context & model rules
|
|
102
104
|
|
package/docs/run-flow.md
CHANGED
|
@@ -4,28 +4,27 @@ The canonical product route is `/audit-code` in conversation.
|
|
|
4
4
|
|
|
5
5
|
This document describes the backend execution flow that supports that conversational route and the repo-local fallback wrapper.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Packet review-dispatch path
|
|
8
8
|
|
|
9
9
|
1. Build or import a repository manifest.
|
|
10
|
-
2. Build units, flows, and other deterministic structure
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
That drift is being tracked explicitly in [docs/workflow-refactor-brief.md](/C:/Code/auditor-lambda/docs/workflow-refactor-brief.md).
|
|
10
|
+
2. Build units, graph edges, flows, risk, and other deterministic structure
|
|
11
|
+
artifacts.
|
|
12
|
+
3. Determine which files require which lenses and create compatible
|
|
13
|
+
`AuditTask` records.
|
|
14
|
+
4. Build `review_packets.json` and `audit_plan_metrics.json` from those tasks.
|
|
15
|
+
5. Stop at semantic review with an active run handoff.
|
|
16
|
+
6. `prepare-dispatch` writes a small run-scoped `dispatch-plan.json` and one
|
|
17
|
+
prompt per review packet.
|
|
18
|
+
7. The active conversation orchestrator launches one bounded subagent per
|
|
19
|
+
packet when the host supports subagents.
|
|
20
|
+
8. Each subagent writes one validated `AuditResult` JSON object per underlying
|
|
21
|
+
task.
|
|
22
|
+
9. `merge-and-ingest` validates the full assigned task set and ingests the
|
|
23
|
+
existing `AuditResult[]` shape.
|
|
24
|
+
10. Result ingestion updates coverage, requeue, runtime-validation state, and
|
|
25
|
+
any selective-deepening follow-up tasks.
|
|
26
|
+
11. Repeat until coverage and runtime rules are satisfied.
|
|
27
|
+
12. Synthesize findings into merged outputs.
|
|
29
28
|
|
|
30
29
|
## Current backend capability
|
|
31
30
|
|
|
@@ -33,7 +32,10 @@ The current TypeScript implementation already covers:
|
|
|
33
32
|
|
|
34
33
|
- repo intake and ignore handling
|
|
35
34
|
- structure and planning artifact generation
|
|
35
|
+
- graph-first packet review planning
|
|
36
|
+
- compact packet dispatch and merge envelopes
|
|
36
37
|
- reviewed-range ingestion from audit results
|
|
38
|
+
- bounded selective deepening
|
|
37
39
|
- runtime validation update ingestion
|
|
38
40
|
- synthesis and completion tracking
|
|
39
41
|
- backend provider handoff for fallback or compatibility review flows
|
|
@@ -43,18 +45,9 @@ The current TypeScript implementation already covers:
|
|
|
43
45
|
- the conversation route should hide this state machine behind `/audit-code`
|
|
44
46
|
- the repo-local `audit-code` wrapper is fallback infrastructure for operators and local harnesses
|
|
45
47
|
- provider adapters and artifact plumbing are backend details, not the primary product story
|
|
46
|
-
- the active conversation agent should own semantic
|
|
48
|
+
- the active conversation agent should own semantic packet dispatch by default
|
|
47
49
|
- when fallback execution blocks, the wrapper should still leave behind explicit operator handoff files and suggested evidence-import paths
|
|
48
50
|
|
|
49
|
-
## Next backend implementation steps
|
|
50
|
-
|
|
51
|
-
The next backend-focused work should support the conversation route more directly by:
|
|
52
|
-
|
|
53
|
-
- realigning review planning around non-overlapping lens blocks
|
|
54
|
-
- moving semantic-review ownership back to the active conversation agent
|
|
55
|
-
- keeping backend provider bridges explicitly secondary
|
|
56
|
-
- keeping evidence import and runtime-update handoff paths explicit and easier to follow
|
|
57
|
-
|
|
58
51
|
Broader product priorities are tracked in:
|
|
59
52
|
|
|
60
53
|
- `docs/workflow-refactor-brief.md`
|
package/docs/session-config.md
CHANGED
|
@@ -80,7 +80,10 @@ How many audit tasks to include in one provider-assisted review batch.
|
|
|
80
80
|
|
|
81
81
|
When this is greater than `1`, the generated worker prompt points at `current-tasks.json` / `pending-audit-tasks.json` and expects one `AuditResult` per assigned task.
|
|
82
82
|
|
|
83
|
-
|
|
83
|
+
This setting only affects explicit backend provider-assisted fallback batches.
|
|
84
|
+
The canonical conversation route uses run-scoped review packets from
|
|
85
|
+
`prepare-dispatch` while still preserving one validated `AuditResult` per
|
|
86
|
+
underlying task.
|
|
84
87
|
|
|
85
88
|
### `parallel_workers`
|
|
86
89
|
|
|
@@ -88,7 +91,8 @@ How many provider-assisted review batches to launch in parallel when the selecte
|
|
|
88
91
|
|
|
89
92
|
This setting only applies to explicit backend bridge launches.
|
|
90
93
|
|
|
91
|
-
It should not be treated as the source of truth for
|
|
94
|
+
It should not be treated as the source of truth for slash-command subagent
|
|
95
|
+
parallelism, which belongs to the host runtime.
|
|
92
96
|
|
|
93
97
|
## Auto provider mode
|
|
94
98
|
|
|
@@ -112,7 +116,10 @@ This keeps the current default stable while still allowing best-effort cross-edi
|
|
|
112
116
|
|
|
113
117
|
No extra config is required.
|
|
114
118
|
|
|
115
|
-
This mode covers deterministic audit execution locally and stops in a terminal
|
|
119
|
+
This mode covers deterministic audit execution locally and stops in a terminal
|
|
120
|
+
blocked state once the remaining work requires semantic review. The
|
|
121
|
+
slash-command orchestrator should then dispatch bounded subagents when the host
|
|
122
|
+
supports them, or complete one assigned task and stop when it does not.
|
|
116
123
|
|
|
117
124
|
When the active conversation agent reviews multiple task batches before ingestion, prefer `audit-code --batch-results <dir>` over ad hoc artifact edits.
|
|
118
125
|
|
package/docs/supervisor.md
CHANGED
|
@@ -6,8 +6,13 @@ The primary product contract is `/audit-code` in conversation.
|
|
|
6
6
|
|
|
7
7
|
Everything here is fallback and implementation detail guidance for the repo-local backend surface.
|
|
8
8
|
|
|
9
|
-
In the intended workflow, the
|
|
10
|
-
|
|
9
|
+
In the intended workflow, the conversation agent owns orchestration and
|
|
10
|
+
ingestion control, but bounded subagents own semantic review whenever the host
|
|
11
|
+
can dispatch them. If subagents are unavailable, the conversation agent reviews
|
|
12
|
+
one assigned task and stops so `/audit-code` can be rerun from fresh context.
|
|
13
|
+
|
|
14
|
+
Provider adapters are compatibility bridges for backend fallback mode, not the
|
|
15
|
+
default review owner.
|
|
11
16
|
|
|
12
17
|
## Repo-local backend surface
|
|
13
18
|
|
|
@@ -59,7 +64,8 @@ audit-code --provider vscode-task
|
|
|
59
64
|
```
|
|
60
65
|
|
|
61
66
|
Those `--provider` invocations are the explicit bridge handoff point.
|
|
62
|
-
Without an explicit `--provider` flag, the backend
|
|
67
|
+
Without an explicit `--provider` flag, the backend stops at the semantic-review
|
|
68
|
+
boundary and exposes scoped task artifacts for the slash-command orchestrator.
|
|
63
69
|
|
|
64
70
|
## Auto resolution rule
|
|
65
71
|
|
|
@@ -87,4 +93,6 @@ See:
|
|
|
87
93
|
## Note
|
|
88
94
|
|
|
89
95
|
Provider adapters are backend integrations, not the primary product concept.
|
|
90
|
-
Session config defines bridge settings
|
|
96
|
+
Session config defines bridge settings. An explicit `provider: "auto"` or
|
|
97
|
+
`--provider` bridge selection is what opts the backend into provider-mediated
|
|
98
|
+
review dispatch.
|
|
@@ -1,177 +1,115 @@
|
|
|
1
|
-
# Workflow Refactor
|
|
1
|
+
# Workflow Refactor Status
|
|
2
2
|
|
|
3
|
-
This document
|
|
3
|
+
This document records the packet-dispatch refactor that replaced the older
|
|
4
|
+
one-agent-per-small-task review plan.
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
## Goal
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
Reduce token and quota usage for `/audit-code` while preserving deterministic
|
|
9
|
+
validation, ingestion, coverage tracking, and report synthesis.
|
|
8
10
|
|
|
9
|
-
The
|
|
11
|
+
The implemented design is a compatibility-preserving packet layer:
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
- keep `AuditTask` as the backend planning and coverage identity
|
|
14
|
+
- keep `AuditResult[]` as the ingestion contract
|
|
15
|
+
- group related task records into worker-facing review packets
|
|
16
|
+
- make each worker read a coherent file set once and review multiple lenses in
|
|
17
|
+
one pass
|
|
18
|
+
- write one validated result file per underlying task
|
|
12
19
|
|
|
13
|
-
|
|
20
|
+
## Current Product Model
|
|
14
21
|
|
|
15
|
-
|
|
22
|
+
The canonical workflow is still conversation-first:
|
|
16
23
|
|
|
17
|
-
The
|
|
24
|
+
1. The active conversation agent owns orchestration and ingestion control.
|
|
25
|
+
2. Bounded subagents own semantic packet review when the host supports them.
|
|
26
|
+
3. If subagents are unavailable, the conversation agent completes one assigned
|
|
27
|
+
fallback review task and stops so `/audit-code` can be rerun from fresh
|
|
28
|
+
context.
|
|
29
|
+
4. Backend provider adapters remain explicit compatibility bridges, not the
|
|
30
|
+
default semantic-review owner.
|
|
18
31
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
3. Pending review is partitioned into non-overlapping review blocks, preferably grouped by lens.
|
|
22
|
-
4. One dispatched review task should correspond to one review block.
|
|
23
|
-
5. `agent_task_batch_size` should stay `1` by default.
|
|
24
|
-
6. If the active conversation agent can delegate to subagents in parallel, that fan-out belongs to the host agent runtime, not to the backend session config.
|
|
25
|
-
7. Backend provider adapters are fallback compatibility bridges only. They should not be the default review owner.
|
|
32
|
+
Session config remains backend fallback configuration. It should not be treated
|
|
33
|
+
as the normal way to redirect semantic review into a second external LLM.
|
|
26
34
|
|
|
27
|
-
##
|
|
35
|
+
## Implemented Changes
|
|
28
36
|
|
|
29
|
-
The
|
|
37
|
+
The refactor now includes:
|
|
30
38
|
|
|
31
|
-
|
|
39
|
+
- deterministic `review_packets.json` derived from current `AuditTask` records
|
|
40
|
+
- `audit_plan_metrics.json` with packet counts, repeated reference estimates,
|
|
41
|
+
largest packet details, and estimated agent reduction
|
|
42
|
+
- packet-first pending-task ordering for provider-assisted batches
|
|
43
|
+
- tiny homogeneous test-file batching before dispatch
|
|
44
|
+
- graph-edge expansion from import, call, and reference edges
|
|
45
|
+
- packet prompts that assign multiple task outputs to one worker
|
|
46
|
+
- validation and merge checks for missing, duplicate, unknown, malformed, or
|
|
47
|
+
out-of-scope task results
|
|
48
|
+
- compact `prepare-dispatch` and `merge-and-ingest` JSON envelopes
|
|
49
|
+
- terse worker completion convention:
|
|
50
|
+
`valid: <packet_id>, findings=<n>`
|
|
51
|
+
- selective deepening for high-severity, low-confidence, conflicting,
|
|
52
|
+
high-risk clean, and runtime-disagreement cases
|
|
53
|
+
- refreshed packet metrics whenever selective deepening adds follow-up tasks
|
|
32
54
|
|
|
33
|
-
|
|
55
|
+
## Dispatch Contract
|
|
34
56
|
|
|
35
|
-
|
|
57
|
+
`prepare-dispatch` writes a small `dispatch-plan.json`. Each entry points to a
|
|
58
|
+
packet prompt under the run-scoped `task-results/` directory.
|
|
36
59
|
|
|
37
|
-
|
|
38
|
-
- [src/providers/index.ts](/C:/Code/auditor-lambda/src/providers/index.ts:37)
|
|
39
|
-
- [src/providers/claudeCodeProvider.ts](/C:/Code/auditor-lambda/src/providers/claudeCodeProvider.ts:12)
|
|
40
|
-
- [src/providers/opencodeProvider.ts](/C:/Code/auditor-lambda/src/providers/opencodeProvider.ts)
|
|
41
|
-
- [src/providers/spawnLoggedCommand.ts](/C:/Code/auditor-lambda/src/providers/spawnLoggedCommand.ts:24)
|
|
60
|
+
The conversation orchestrator should:
|
|
42
61
|
|
|
43
|
-
|
|
62
|
+
- read only `dispatch-plan.json`
|
|
63
|
+
- launch one subagent per packet entry
|
|
64
|
+
- tell the subagent to read and follow `entry.prompt_path`
|
|
65
|
+
- wait for terse success replies
|
|
66
|
+
- run `merge-and-ingest`
|
|
44
67
|
|
|
45
|
-
|
|
68
|
+
The parent should not read source files, prompt bodies, result payloads, or
|
|
69
|
+
large task manifests during the normal packet route.
|
|
46
70
|
|
|
47
|
-
|
|
71
|
+
## Artifacts
|
|
48
72
|
|
|
49
|
-
|
|
50
|
-
- [src/orchestrator/unitBuilder.ts](/C:/Code/auditor-lambda/src/orchestrator/unitBuilder.ts:130)
|
|
73
|
+
Packet mode adds or updates these artifacts:
|
|
51
74
|
|
|
52
|
-
|
|
75
|
+
- `review_packets.json`
|
|
76
|
+
- `audit_plan_metrics.json`
|
|
77
|
+
- `<artifacts_dir>/runs/<run_id>/dispatch-plan.json`
|
|
78
|
+
- `<artifacts_dir>/runs/<run_id>/task-results/*.prompt.md`
|
|
79
|
+
- `<artifacts_dir>/runs/<run_id>/task-results/*.json`
|
|
80
|
+
- `<artifacts_dir>/runs/<run_id>/dispatch-warnings.json`, only when needed
|
|
53
81
|
|
|
54
|
-
The
|
|
82
|
+
The existing coverage, runtime validation, requeue, and synthesis artifacts
|
|
83
|
+
remain backend-owned.
|
|
55
84
|
|
|
56
|
-
|
|
85
|
+
## Verification
|
|
57
86
|
|
|
58
|
-
|
|
87
|
+
Current in-repo verification:
|
|
59
88
|
|
|
60
|
-
-
|
|
61
|
-
- [src/orchestrator/planning.ts](/C:/Code/auditor-lambda/src/orchestrator/planning.ts:63)
|
|
62
|
-
- [src/coverage.ts](/C:/Code/auditor-lambda/src/coverage.ts:29)
|
|
89
|
+
- `npm test` passes with 143 tests.
|
|
63
90
|
|
|
64
|
-
|
|
91
|
+
Relevant test coverage:
|
|
65
92
|
|
|
66
|
-
|
|
93
|
+
- packet construction and metrics
|
|
94
|
+
- packet ordering
|
|
95
|
+
- graph-connected packet merging
|
|
96
|
+
- tiny test-file batching
|
|
97
|
+
- packet prompt generation
|
|
98
|
+
- packet merge compatibility with the legacy result array
|
|
99
|
+
- missing-result blocking
|
|
100
|
+
- path-heuristic regressions
|
|
101
|
+
- graph extraction from source contents
|
|
102
|
+
- selective deepening triggers and packet refresh
|
|
67
103
|
|
|
68
|
-
|
|
104
|
+
## Remaining Follow-Up
|
|
69
105
|
|
|
70
|
-
|
|
106
|
+
The main remaining work is operational, not structural:
|
|
71
107
|
|
|
72
|
-
|
|
108
|
+
- run `/audit-code` against at least one nontrivial external repository and
|
|
109
|
+
compare packet counts, warning counts, worker completion summaries, and
|
|
110
|
+
observed token/quota behavior against the legacy baseline
|
|
111
|
+
- keep host-specific smoke testing current for Codex, Claude Desktop, OpenCode,
|
|
112
|
+
VS Code, and Antigravity guidance
|
|
73
113
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
It does not represent, and should not limit, the active conversation agent's own ability to use subagents.
|
|
77
|
-
|
|
78
|
-
Relevant files:
|
|
79
|
-
|
|
80
|
-
- [src/cli.ts](/C:/Code/auditor-lambda/src/cli.ts:83)
|
|
81
|
-
- [src/cli.ts](/C:/Code/auditor-lambda/src/cli.ts:960)
|
|
82
|
-
|
|
83
|
-
## Evidence from the current stale audit
|
|
84
|
-
|
|
85
|
-
The current stale audit run produced:
|
|
86
|
-
|
|
87
|
-
- `91` units
|
|
88
|
-
- average `3.26` required lenses per unit
|
|
89
|
-
- `333` audit tasks total
|
|
90
|
-
- `294` regular unit-lens tasks
|
|
91
|
-
- `10` large-file split tasks
|
|
92
|
-
- `29` flow tasks
|
|
93
|
-
|
|
94
|
-
That fan-out is consistent with the current unit-first planner, not with the intended lens-block dispatch model.
|
|
95
|
-
|
|
96
|
-
## Refactor goals
|
|
97
|
-
|
|
98
|
-
The next implementation pass should do the following.
|
|
99
|
-
|
|
100
|
-
### A. Make the active conversation agent the semantic-review owner
|
|
101
|
-
|
|
102
|
-
The `agent` executor should represent review work owned by the current conversation or host agent session.
|
|
103
|
-
|
|
104
|
-
Target behavior:
|
|
105
|
-
|
|
106
|
-
- normal `/audit-code` usage does not require `provider: "claude-code"` or `provider: "opencode"`
|
|
107
|
-
- session-config should not be the normal way to choose a second LLM for review
|
|
108
|
-
- backend provider bridges remain available only for explicit fallback workflows
|
|
109
|
-
|
|
110
|
-
### B. Plan review work at the file/lens level
|
|
111
|
-
|
|
112
|
-
Coverage should still know which files require which lenses, but dispatch planning should work from unresolved `(file, lens)` obligations rather than from unit-wide lens unions.
|
|
113
|
-
|
|
114
|
-
Target behavior:
|
|
115
|
-
|
|
116
|
-
- each review block should have explicit `file_paths`
|
|
117
|
-
- each review block should represent one lens
|
|
118
|
-
- review blocks in the same dispatch wave should be file-disjoint unless overlap is intentionally justified
|
|
119
|
-
|
|
120
|
-
### C. Partition pending review into non-overlapping blocks
|
|
121
|
-
|
|
122
|
-
Replace the current unit-first task planner with a lens-aware block planner.
|
|
123
|
-
|
|
124
|
-
Target behavior:
|
|
125
|
-
|
|
126
|
-
- no combinatorial `unit x lens` explosion unless that is genuinely the smallest valid partition
|
|
127
|
-
- large-file splitting may remain, but it should happen inside the lens-block planner
|
|
128
|
-
- critical-flow context should influence block construction without blindly adding overlapping tasks on top
|
|
129
|
-
|
|
130
|
-
### D. Keep result ingestion deterministic
|
|
131
|
-
|
|
132
|
-
The current ingestion model is mostly sound and should be preserved.
|
|
133
|
-
|
|
134
|
-
Relevant files:
|
|
135
|
-
|
|
136
|
-
- [src/orchestrator/resultIngestion.ts](/C:/Code/auditor-lambda/src/orchestrator/resultIngestion.ts)
|
|
137
|
-
- [src/coverage.ts](/C:/Code/auditor-lambda/src/coverage.ts:42)
|
|
138
|
-
|
|
139
|
-
### E. Reframe session-config as backend fallback only
|
|
140
|
-
|
|
141
|
-
`session-config.json` should continue to configure backend fallback bridges, but it should not be treated as the owner of semantic-review orchestration in the canonical workflow.
|
|
142
|
-
|
|
143
|
-
`parallel_workers` should either:
|
|
144
|
-
|
|
145
|
-
- become a legacy fallback-only knob, or
|
|
146
|
-
- be removed from the semantic-review mental model entirely
|
|
147
|
-
|
|
148
|
-
## Acceptance criteria
|
|
149
|
-
|
|
150
|
-
The refactor should be treated as done only when all of the following are true.
|
|
151
|
-
|
|
152
|
-
- Starting `/audit-code` in a conversation does not rely on an external `claude-code` or `opencode` subprocess to own semantic review.
|
|
153
|
-
- The backend fallback still supports deterministic stages and explicit compatibility bridges.
|
|
154
|
-
- The default dispatch granularity for semantic review remains one review block per task.
|
|
155
|
-
- Pending review tasks are planned as lens-aware, non-overlapping file blocks.
|
|
156
|
-
- `parallel_workers` no longer defines the default semantic-review parallelism model.
|
|
157
|
-
- The next fresh audit can be run from a clean slate without inheriting the current stale provider-mediated task queue.
|
|
158
|
-
|
|
159
|
-
## Suggested implementation order
|
|
160
|
-
|
|
161
|
-
1. Refactor the review-ownership model in [src/cli.ts](/C:/Code/auditor-lambda/src/cli.ts), [src/providers/index.ts](/C:/Code/auditor-lambda/src/providers/index.ts), and related supervisor docs.
|
|
162
|
-
2. Replace the current task planner in [src/orchestrator/taskBuilder.ts](/C:/Code/auditor-lambda/src/orchestrator/taskBuilder.ts) with a lens-block planner.
|
|
163
|
-
3. Rework flow-aware planning in [src/orchestrator/flowPlanning.ts](/C:/Code/auditor-lambda/src/orchestrator/flowPlanning.ts) so it participates in block construction instead of layering overlapping tasks afterward.
|
|
164
|
-
4. Update docs and tests.
|
|
165
|
-
5. Delete the stale audit state and rerun the audit from scratch.
|
|
166
|
-
|
|
167
|
-
## Clean rerun after refactor
|
|
168
|
-
|
|
169
|
-
Once the refactor is in place, the next context should:
|
|
170
|
-
|
|
171
|
-
1. keep the source changes and documentation already in the worktree
|
|
172
|
-
2. delete `.audit-artifacts/`
|
|
173
|
-
3. delete `audit-report.md`
|
|
174
|
-
4. run the workflow again from a clean state
|
|
175
|
-
5. treat the new audit output as authoritative
|
|
176
|
-
|
|
177
|
-
For the remediation baseline that should survive the stale audit reset, see [docs/remediation-baseline.md](/C:/Code/auditor-lambda/docs/remediation-baseline.md).
|
|
114
|
+
For the detailed packet dispatch reference, see
|
|
115
|
+
`docs/dispatch-implementation-plan.md`.
|
package/package.json
CHANGED
|
@@ -17,21 +17,7 @@
|
|
|
17
17
|
"properties": {
|
|
18
18
|
"id": { "type": "string" },
|
|
19
19
|
"title": { "type": "string" },
|
|
20
|
-
"category": {
|
|
21
|
-
"type": "string",
|
|
22
|
-
"enum": [
|
|
23
|
-
"correctness",
|
|
24
|
-
"architecture",
|
|
25
|
-
"maintainability",
|
|
26
|
-
"security",
|
|
27
|
-
"reliability",
|
|
28
|
-
"performance",
|
|
29
|
-
"data_integrity",
|
|
30
|
-
"tests",
|
|
31
|
-
"operability",
|
|
32
|
-
"config_deployment"
|
|
33
|
-
]
|
|
34
|
-
},
|
|
20
|
+
"category": { "type": "string", "minLength": 1 },
|
|
35
21
|
"severity": {
|
|
36
22
|
"type": "string",
|
|
37
23
|
"enum": ["critical", "high", "medium", "low", "info"]
|
|
@@ -40,6 +40,22 @@
|
|
|
40
40
|
"additionalProperties": false
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
|
+
"references": {
|
|
44
|
+
"type": "array",
|
|
45
|
+
"items": {
|
|
46
|
+
"type": "object",
|
|
47
|
+
"required": ["from", "to"],
|
|
48
|
+
"properties": {
|
|
49
|
+
"from": { "type": "string" },
|
|
50
|
+
"to": { "type": "string" },
|
|
51
|
+
"kind": {
|
|
52
|
+
"type": "string",
|
|
53
|
+
"description": "Reference edge kind from literal or path-oriented extraction (e.g. 'relative-string-reference', 'repo-path-reference')."
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"additionalProperties": false
|
|
57
|
+
}
|
|
58
|
+
},
|
|
43
59
|
"routes": {
|
|
44
60
|
"type": "array",
|
|
45
61
|
"items": {
|
|
@@ -17,8 +17,16 @@ Normal usage should:
|
|
|
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
19
|
|
|
20
|
-
Semantic review should
|
|
21
|
-
|
|
20
|
+
Semantic review should be delegated to bounded subagents whenever the host can
|
|
21
|
+
dispatch them. The conversation orchestrator owns dispatch and ingestion control;
|
|
22
|
+
it should not perform broad review itself when subagents are available.
|
|
23
|
+
|
|
24
|
+
If the host cannot delegate to subagents, the conversation orchestrator may
|
|
25
|
+
complete exactly one assigned review task, ingest it through the provided backend
|
|
26
|
+
command, then stop so the user can rerun `/audit-code` from fresh context.
|
|
27
|
+
|
|
28
|
+
Subagent fan-out belongs to the host agent runtime rather than to repo-local
|
|
29
|
+
backend provider settings.
|
|
22
30
|
|
|
23
31
|
Bounded steps are a backend implementation detail, not the intended user experience.
|
|
24
32
|
|
|
@@ -66,7 +74,8 @@ audit-code --single-step
|
|
|
66
74
|
For repo-local backend usage:
|
|
67
75
|
|
|
68
76
|
- omitted provider remains `local-subprocess`
|
|
69
|
-
- `local-subprocess` should stop cleanly once
|
|
77
|
+
- `local-subprocess` should stop cleanly once semantic review is needed and
|
|
78
|
+
expose scoped task artifacts for the slash-command orchestrator
|
|
70
79
|
- `provider: "auto"` is the explicit opt-in best-effort routing mode
|
|
71
80
|
- explicit provider names remain available when an operator wants a specific backend
|
|
72
81
|
|