auditor-lambda 0.3.20 → 0.3.21
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 +12 -2
- package/audit-code-wrapper-lib.mjs +86 -32
- package/dist/cli.js +576 -10
- package/dist/prompts/renderWorkerPrompt.js +1 -0
- package/dist/supervisor/operatorHandoff.js +3 -7
- package/docs/contracts.md +23 -1
- package/docs/operator-guide.md +11 -4
- package/docs/product.md +4 -3
- package/package.json +1 -1
- package/scripts/postinstall.mjs +33 -0
- package/skills/audit-code/audit-code.prompt.md +15 -170
|
@@ -105,9 +105,7 @@ function buildSuggestedCommands(artifactsDir, suggestedInputs, status, activeRev
|
|
|
105
105
|
return [
|
|
106
106
|
renderShellCommand([
|
|
107
107
|
"audit-code",
|
|
108
|
-
"
|
|
109
|
-
"--run-id",
|
|
110
|
-
activeReviewRun.run_id,
|
|
108
|
+
"next-step",
|
|
111
109
|
"--artifacts-dir",
|
|
112
110
|
artifactsDir,
|
|
113
111
|
]),
|
|
@@ -170,7 +168,7 @@ function renderMarkdown(handoff) {
|
|
|
170
168
|
lines.push(`- ${command}`);
|
|
171
169
|
}
|
|
172
170
|
if (handoff.active_review_run) {
|
|
173
|
-
lines.push("- Use
|
|
171
|
+
lines.push("- Use next-step so the backend renders either packet dispatch or single-task fallback after the host reports capabilities.");
|
|
174
172
|
}
|
|
175
173
|
}
|
|
176
174
|
if (handoff.active_review_run) {
|
|
@@ -233,9 +231,7 @@ export function buildAuditCodeHandoff(params) {
|
|
|
233
231
|
if (params.state.status === BLOCKED_STATUS && params.activeReviewRun) {
|
|
234
232
|
handoff.quick_start = renderShellCommand([
|
|
235
233
|
"audit-code",
|
|
236
|
-
"
|
|
237
|
-
"--run-id",
|
|
238
|
-
params.activeReviewRun.run_id,
|
|
234
|
+
"next-step",
|
|
239
235
|
"--artifacts-dir",
|
|
240
236
|
params.artifactsDir,
|
|
241
237
|
]);
|
package/docs/contracts.md
CHANGED
|
@@ -77,6 +77,23 @@ The backend stores resumable artifacts under `.audit-artifacts/`, including:
|
|
|
77
77
|
Consumers should treat these as versioned JSON artifacts and validate them with
|
|
78
78
|
`audit-code validate` rather than inferring state from filenames alone.
|
|
79
79
|
|
|
80
|
+
## Step artifacts
|
|
81
|
+
|
|
82
|
+
The conversation-first `/audit-code` prompt is a loader. It runs
|
|
83
|
+
`audit-code next-step` and then follows only the returned step prompt. The
|
|
84
|
+
backend writes the current step contract to:
|
|
85
|
+
|
|
86
|
+
- `<artifacts_dir>/steps/current-step.json`
|
|
87
|
+
- `<artifacts_dir>/steps/current-prompt.md`
|
|
88
|
+
|
|
89
|
+
`current-step.json` uses `contract_version: "audit-code-step/v1alpha1"` and
|
|
90
|
+
includes `step_kind`, `prompt_path`, `status`, `run_id`, `allowed_commands`,
|
|
91
|
+
`stop_condition`, `repo_root`, `artifacts_dir`, and relevant `artifact_paths`.
|
|
92
|
+
|
|
93
|
+
When semantic review is blocked, `next-step` first emits a `capability_check`.
|
|
94
|
+
After the host reports `--host-can-dispatch-subagents true|false`, the backend
|
|
95
|
+
renders exactly one review path: packet dispatch or the single-task fallback.
|
|
96
|
+
|
|
80
97
|
## Dispatch packets
|
|
81
98
|
|
|
82
99
|
Packet dispatch preserves the existing `AuditTask` and `AuditResult`
|
|
@@ -92,13 +109,18 @@ Planning artifacts are shaped by:
|
|
|
92
109
|
Normal packet flow:
|
|
93
110
|
|
|
94
111
|
```text
|
|
95
|
-
audit-code
|
|
112
|
+
audit-code next-step --host-can-dispatch-subagents true
|
|
113
|
+
backend prepares dispatch-plan.json
|
|
96
114
|
conversation launches one worker per dispatch-plan entry
|
|
97
115
|
worker reads entry.prompt_path
|
|
98
116
|
worker submits AuditResult[] through submit-packet
|
|
99
117
|
audit-code merge-and-ingest --run-id <run_id> --artifacts-dir <artifacts_dir>
|
|
100
118
|
```
|
|
101
119
|
|
|
120
|
+
`audit-code prepare-dispatch --run-id <run_id> --artifacts-dir
|
|
121
|
+
<artifacts_dir>` remains available for compatibility and tests, but generic
|
|
122
|
+
handoff fields point users and prompts to `next-step`.
|
|
123
|
+
|
|
102
124
|
Packet artifacts:
|
|
103
125
|
|
|
104
126
|
- `<artifacts_dir>/runs/<run_id>/dispatch-plan.json`
|
package/docs/operator-guide.md
CHANGED
|
@@ -43,7 +43,7 @@ Host-specific files may include:
|
|
|
43
43
|
|
|
44
44
|
- Codex: managed `AGENTS.md` fallback guidance
|
|
45
45
|
- Claude Desktop: project template, remote MCP connector, local MCP bundle
|
|
46
|
-
- OpenCode: `opencode.json` with `/audit-code`
|
|
46
|
+
- OpenCode: `opencode.json` with auditor MCP server and permission wiring; the `/audit-code` command is global npm-installed state
|
|
47
47
|
- VS Code/Copilot: prompt, custom agent, instructions, and `.vscode/mcp.json`
|
|
48
48
|
- Antigravity: planning-mode and MCP-oriented guidance
|
|
49
49
|
|
|
@@ -64,9 +64,10 @@ with the canonical `/audit-code` spelling.
|
|
|
64
64
|
Claude Desktop is treated as an MCP-first host. Use the generated project
|
|
65
65
|
template and local bundle artifacts when installing the integration.
|
|
66
66
|
|
|
67
|
-
OpenCode uses
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
OpenCode uses the global command seeded by `npm install -g auditor-lambda`.
|
|
68
|
+
The generated project `opencode.json` should not define `command["audit-code"]`;
|
|
69
|
+
it only wires the auditor MCP server and project permissions. VS Code uses
|
|
70
|
+
repo-local prompt and MCP configuration files.
|
|
70
71
|
|
|
71
72
|
Antigravity should be treated as a workflow-and-artifacts host until it has a
|
|
72
73
|
stable project-local config surface. Use generated planning-mode guidance,
|
|
@@ -100,6 +101,7 @@ The wrapper:
|
|
|
100
101
|
Useful fallback commands:
|
|
101
102
|
|
|
102
103
|
```bash
|
|
104
|
+
audit-code next-step
|
|
103
105
|
audit-code --single-step
|
|
104
106
|
audit-code --results /path/to/audit_results.json
|
|
105
107
|
audit-code --batch-results /path/to/results-dir
|
|
@@ -111,6 +113,11 @@ audit-code cleanup
|
|
|
111
113
|
audit-code mcp
|
|
112
114
|
```
|
|
113
115
|
|
|
116
|
+
`audit-code next-step` is the backend-rendered step engine used by the
|
|
117
|
+
conversation prompt. It writes `.audit-artifacts/steps/current-step.json` and
|
|
118
|
+
`.audit-artifacts/steps/current-prompt.md`, then the host should follow only
|
|
119
|
+
that prompt.
|
|
120
|
+
|
|
114
121
|
`audit-code validate` checks artifact shape, cross-artifact consistency,
|
|
115
122
|
session config, and explicit provider readiness.
|
|
116
123
|
|
package/docs/product.md
CHANGED
|
@@ -148,9 +148,10 @@ Readiness should be judged through three checks:
|
|
|
148
148
|
- field-trial quality: run real repositories through planning, validate
|
|
149
149
|
artifacts, and use `audit_plan_metrics.json` to track packet count, weak
|
|
150
150
|
packet count, average cohesion, merge edge kinds, and weak-packet samples
|
|
151
|
-
- full-loop behavior: prove `
|
|
152
|
-
`submit-packet`, `merge-and-ingest`, selective deepening,
|
|
153
|
-
and final `audit-report.md` promotion in at least one
|
|
151
|
+
- full-loop behavior: prove `next-step` capability routing, packet dispatch,
|
|
152
|
+
worker review, `submit-packet`, `merge-and-ingest`, selective deepening,
|
|
153
|
+
runtime validation, and final `audit-report.md` promotion in at least one
|
|
154
|
+
real host flow
|
|
154
155
|
- release hygiene: keep `npm run verify:release`, linked smoke, packaged
|
|
155
156
|
smoke, tarball preview, and Trusted Publishing green from a clean checkout
|
|
156
157
|
|
package/package.json
CHANGED
package/scripts/postinstall.mjs
CHANGED
|
@@ -56,6 +56,11 @@ const OPENCODE_AUDIT_BASH_PERMISSION = {
|
|
|
56
56
|
'audit-code cleanup*': 'deny',
|
|
57
57
|
'audit-code requeue*': 'deny',
|
|
58
58
|
'audit-code ingest-results*': 'deny',
|
|
59
|
+
'*dist*index.js* run-to-completion*': 'deny',
|
|
60
|
+
'*dist*index.js* synthesize*': 'deny',
|
|
61
|
+
'*dist*index.js* cleanup*': 'deny',
|
|
62
|
+
'*dist*index.js* requeue*': 'deny',
|
|
63
|
+
'*dist*index.js* ingest-results*': 'deny',
|
|
59
64
|
'*audit-code.mjs* run-to-completion*': 'deny',
|
|
60
65
|
'*audit-code.mjs* synthesize*': 'deny',
|
|
61
66
|
'*audit-code.mjs* cleanup*': 'deny',
|
|
@@ -63,25 +68,44 @@ const OPENCODE_AUDIT_BASH_PERMISSION = {
|
|
|
63
68
|
'*audit-code.mjs* ingest-results*': 'deny',
|
|
64
69
|
'audit-code': 'allow',
|
|
65
70
|
'audit-code ensure*': 'allow',
|
|
71
|
+
'audit-code next-step*': 'allow',
|
|
66
72
|
'audit-code prepare-dispatch*': 'allow',
|
|
67
73
|
'audit-code submit-packet*': 'allow',
|
|
68
74
|
'audit-code merge-and-ingest*': 'allow',
|
|
69
75
|
'audit-code validate*': 'allow',
|
|
70
76
|
'*audit-code.mjs': 'allow',
|
|
71
77
|
'*audit-code.mjs* ensure*': 'allow',
|
|
78
|
+
'*audit-code.mjs* next-step*': 'allow',
|
|
72
79
|
'*audit-code.mjs* prepare-dispatch*': 'allow',
|
|
73
80
|
'*audit-code.mjs* submit-packet*': 'allow',
|
|
74
81
|
'*audit-code.mjs* merge-and-ingest*': 'allow',
|
|
75
82
|
'*audit-code.mjs* worker-run*': 'allow',
|
|
76
83
|
'*audit-code.mjs* validate*': 'allow',
|
|
84
|
+
'*node* *auditor-lambda*dist*index.js* worker-run*': 'allow',
|
|
77
85
|
'node* .audit-code/install/run-mcp-server.mjs*': 'allow',
|
|
78
86
|
'node* ./.audit-code/install/run-mcp-server.mjs*': 'allow',
|
|
79
87
|
'git status*': 'allow',
|
|
80
88
|
'git diff*': 'allow',
|
|
81
89
|
'grep *': 'allow',
|
|
90
|
+
'Select-String *': 'allow',
|
|
82
91
|
'rm *': 'deny',
|
|
83
92
|
};
|
|
84
93
|
|
|
94
|
+
function replaceBackslashes(value) {
|
|
95
|
+
return value.replace(/\\/g, '/');
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function externalDirectoryPattern(path) {
|
|
99
|
+
return `${replaceBackslashes(path).replace(/\/+$/u, '')}/**`;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function renderOpenCodeExternalDirectoryPermission() {
|
|
103
|
+
return {
|
|
104
|
+
[externalDirectoryPattern(pkgRoot)]: 'allow',
|
|
105
|
+
[externalDirectoryPattern(dirname(process.execPath))]: 'allow',
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
|
|
85
109
|
function objectValue(value) {
|
|
86
110
|
return value && typeof value === 'object' && !Array.isArray(value)
|
|
87
111
|
? value
|
|
@@ -127,6 +151,14 @@ function mergeOpenCodePermissionConfig(existingPermission, generatedPermission)
|
|
|
127
151
|
return {
|
|
128
152
|
...generatedPermission,
|
|
129
153
|
...existingPermission,
|
|
154
|
+
read: generatedPermission.read,
|
|
155
|
+
glob: generatedPermission.glob,
|
|
156
|
+
grep: generatedPermission.grep,
|
|
157
|
+
external_directory: mergeOpenCodePermissionRule(
|
|
158
|
+
existingPermission.external_directory,
|
|
159
|
+
generatedPermission.external_directory,
|
|
160
|
+
generatedPermission.external_directory,
|
|
161
|
+
),
|
|
130
162
|
edit: mergeOpenCodePermissionRule(
|
|
131
163
|
existingPermission.edit,
|
|
132
164
|
generatedPermission.edit,
|
|
@@ -145,6 +177,7 @@ function renderOpenCodePermissionConfig() {
|
|
|
145
177
|
read: 'allow',
|
|
146
178
|
glob: 'allow',
|
|
147
179
|
grep: 'allow',
|
|
180
|
+
external_directory: renderOpenCodeExternalDirectoryPermission(),
|
|
148
181
|
edit: { ...OPENCODE_AUDIT_EDIT_PERMISSION },
|
|
149
182
|
bash: { ...OPENCODE_AUDIT_BASH_PERMISSION },
|
|
150
183
|
};
|
|
@@ -1,55 +1,17 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Autonomous local loop code auditing -
|
|
2
|
+
description: Autonomous local loop code auditing - loads one backend-rendered audit step at a time
|
|
3
3
|
argument-hint: [target-dir]
|
|
4
4
|
allowed-tools: [Read, Bash, Glob, Grep, Agent]
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
# `/audit-code`
|
|
7
|
+
# `/audit-code` Loader
|
|
8
8
|
|
|
9
9
|
You are the audit-code orchestrator for this conversation. The user-facing
|
|
10
|
-
surface is
|
|
11
|
-
providers, models, paths, or batching strategy during normal operation.
|
|
10
|
+
surface is `/audit-code`, but the backend owns every audit workflow branch.
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
semantic review when the host supports subagents, and let the backend validate
|
|
15
|
-
and ingest results mechanically.
|
|
12
|
+
## Loader
|
|
16
13
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
- Do not edit source files during semantic review. The deterministic
|
|
20
|
-
`auto_fixes_applied` executor may run formatter/remediation commands before
|
|
21
|
-
review; that is part of the backend workflow.
|
|
22
|
-
- Do not manually merge audit results, manually update coverage, or manually
|
|
23
|
-
edit audit state.
|
|
24
|
-
- Do not read result schemas or completed result payloads into context unless
|
|
25
|
-
a backend command fails and the error explicitly requires diagnosis.
|
|
26
|
-
- Do not inspect individual subagent result files after dispatch. Validation
|
|
27
|
-
and ingestion are backend responsibilities.
|
|
28
|
-
- Do not inspect the backend command catalog or try alternate subcommands to
|
|
29
|
-
bypass a blocked semantic-review handoff. In particular, do not run
|
|
30
|
-
`run-to-completion`, `synthesize`, `cleanup`, `requeue`, or direct
|
|
31
|
-
`ingest-results` while following this directive.
|
|
32
|
-
- A report under `.audit-artifacts/` is not a completion signal while
|
|
33
|
-
`audit_state.status` is `"blocked"`. Present a report only after Step 5.
|
|
34
|
-
- 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.
|
|
35
|
-
- Prefer subagent dispatch for semantic review whenever the host exposes an
|
|
36
|
-
Agent/subagent tool.
|
|
37
|
-
- Treat the user's `/audit-code` request as explicit authorization to launch
|
|
38
|
-
review subagents in parallel. Do not ask for a separate delegation request
|
|
39
|
-
before using available Agent/subagent tools.
|
|
40
|
-
- Decide subagent support from the active toolset, not from shell commands or
|
|
41
|
-
backend provider names. A shell command named `agent`, an MCP prompt, or a
|
|
42
|
-
`local-subprocess` provider is not a host subagent facility.
|
|
43
|
-
- Do not use `browser_subagent` for semantic review of source code unless the
|
|
44
|
-
task explicitly requires browser-based validation.
|
|
45
|
-
- If the host cannot dispatch subagents, complete exactly one assigned review
|
|
46
|
-
task, run the provided ingestion command, then stop. The user can run
|
|
47
|
-
`/audit-code` again to continue from fresh context.
|
|
48
|
-
|
|
49
|
-
## Step 1 - Advance Deterministic State
|
|
50
|
-
|
|
51
|
-
First, make sure the repository has the minimal local assets required by the
|
|
52
|
-
current host:
|
|
14
|
+
First, make sure the repository has current local audit assets:
|
|
53
15
|
|
|
54
16
|
```bash
|
|
55
17
|
audit-code ensure --quiet
|
|
@@ -61,141 +23,24 @@ Inside the `auditor-lambda` repository itself, use:
|
|
|
61
23
|
node audit-code.mjs ensure --quiet
|
|
62
24
|
```
|
|
63
25
|
|
|
64
|
-
Then
|
|
26
|
+
Then ask the backend for exactly one next step:
|
|
65
27
|
|
|
66
28
|
```bash
|
|
67
|
-
audit-code
|
|
29
|
+
audit-code next-step
|
|
68
30
|
```
|
|
69
31
|
|
|
70
32
|
Inside the `auditor-lambda` repository itself, use:
|
|
71
33
|
|
|
72
34
|
```bash
|
|
73
|
-
node audit-code.mjs
|
|
35
|
+
node audit-code.mjs next-step
|
|
74
36
|
```
|
|
75
37
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
- `handoff.artifacts_dir`
|
|
81
|
-
- `handoff.active_review_run.task_path`
|
|
82
|
-
- `handoff.active_review_run.prompt_path`
|
|
83
|
-
- `handoff.active_review_run.pending_audit_tasks_path`
|
|
84
|
-
- `handoff.active_review_run.audit_results_path`
|
|
85
|
-
- `handoff.active_review_run.worker_command`
|
|
86
|
-
|
|
87
|
-
If status is `"active"`, deterministic progress was made. Run Step 1 again.
|
|
88
|
-
|
|
89
|
-
If status is `"complete"`, skip to Step 5.
|
|
90
|
-
|
|
91
|
-
If status is `"blocked"` and the blocker is not semantic review, report the
|
|
92
|
-
blocker verbatim and stop.
|
|
93
|
-
|
|
94
|
-
If status is `"blocked"` for semantic review, continue to Step 2.
|
|
95
|
-
|
|
96
|
-
## Step 2 - Dispatch Review Work
|
|
97
|
-
|
|
98
|
-
Use this step only when the active toolset exposes a callable host subagent
|
|
99
|
-
facility such as `Agent`, `Task`, or an equivalent built-in delegation tool.
|
|
100
|
-
Do not try to discover subagent support by running shell commands.
|
|
101
|
-
|
|
102
|
-
When that callable subagent facility exists, prepare a dispatch plan by default:
|
|
103
|
-
|
|
104
|
-
```bash
|
|
105
|
-
audit-code prepare-dispatch --run-id <run_id> --artifacts-dir <artifacts_dir>
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
Read only `<artifacts_dir>/runs/<run_id>/dispatch-plan.json`.
|
|
109
|
-
|
|
110
|
-
In a single message, launch one Agent/subagent call per dispatch-plan entry:
|
|
111
|
-
|
|
112
|
-
```text
|
|
113
|
-
Agent({ description: entry.description, prompt: "Read and follow the audit instructions in: " + entry.prompt_path })
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
Do NOT use your `Read` tool to load `entry.prompt_path` into your context window. The subagent has its own context window and will read the file.
|
|
117
|
-
|
|
118
|
-
If the host supports per-subagent model selection, use `entry.model_hint.tier`
|
|
119
|
-
as a provider-neutral routing hint (`small`, `standard`, or `deep`). Map it to
|
|
120
|
-
available host models without asking the user to choose model names. If model
|
|
121
|
-
selection is unavailable, ignore the hint and dispatch normally.
|
|
122
|
-
|
|
123
|
-
If the host supports per-subagent tool restrictions, give review subagents no
|
|
124
|
-
Write tool and allow shell access only for the `audit-code submit-packet`
|
|
125
|
-
command printed in their prompt.
|
|
126
|
-
|
|
127
|
-
All subagent calls should be launched together. Wait for them to finish.
|
|
128
|
-
|
|
129
|
-
Subagents own bounded semantic review. They must read only their prompt and
|
|
130
|
-
assigned files, produce the requested `AuditResult[]`, pipe it to the
|
|
131
|
-
`submit-packet` command in their prompt, retry up to 3 times if submission
|
|
132
|
-
fails, and stop. The backend command validates and writes the packet-owned
|
|
133
|
-
result artifacts. They must not use direct file writes, edit source files,
|
|
134
|
-
remediate findings, create extra task results, run unrelated audits, or write
|
|
135
|
-
the worker `result.json` control envelope.
|
|
136
|
-
|
|
137
|
-
Then run:
|
|
138
|
-
|
|
139
|
-
```bash
|
|
140
|
-
audit-code merge-and-ingest --run-id <run_id> --artifacts-dir <artifacts_dir>
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
If `merge-and-ingest` exits non-zero, stop immediately and report the exact
|
|
144
|
-
error. Do not improvise manual merging or state edits.
|
|
145
|
-
|
|
146
|
-
Loop back to Step 1.
|
|
147
|
-
|
|
148
|
-
If no callable host subagent facility exists, or a delegation attempt fails
|
|
149
|
-
because the host does not provide such a tool, go directly to Step 3. Do not run
|
|
150
|
-
`prepare-dispatch`, do not inspect generated packet prompts, and do not try
|
|
151
|
-
alternate backend commands.
|
|
152
|
-
|
|
153
|
-
## Step 3 - Single-Task Fallback
|
|
154
|
-
|
|
155
|
-
Use this path only when the host cannot dispatch subagents.
|
|
156
|
-
|
|
157
|
-
Allowed backend command in this step: the exact `worker_command` from the task
|
|
158
|
-
file, after you have written the single-task result. Do not run `audit-code`,
|
|
159
|
-
`run-to-completion`, `prepare-dispatch`, `merge-and-ingest`, `synthesize`,
|
|
160
|
-
`validate`, or any other backend command as a substitute for the fallback.
|
|
161
|
-
|
|
162
|
-
Read the generated single-task fallback prompt at
|
|
163
|
-
`handoff.file_map.single_task_prompt` when present, otherwise
|
|
164
|
-
`.audit-artifacts/dispatch/current-single-task-prompt.md`. That file is
|
|
165
|
-
deterministically narrowed to the first pending task. If it is unavailable, read
|
|
166
|
-
the current review prompt named by `handoff.active_review_run.prompt_path` or
|
|
167
|
-
`.audit-artifacts/dispatch/current-prompt.md`, plus the matching task file
|
|
168
|
-
needed to find `audit_results_path` and `worker_command`.
|
|
169
|
-
|
|
170
|
-
Complete exactly one assigned review task. If a batch file lists multiple tasks,
|
|
171
|
-
choose the first pending task by array order only; do not substitute a smaller
|
|
172
|
-
or easier task. If that first task covers a large file, use targeted reads and
|
|
173
|
-
searches within its assigned files instead of abandoning it. Read only that
|
|
174
|
-
task's assigned files. Write one valid `AuditResult` object, wrapped in a JSON
|
|
175
|
-
array, to `audit_results_path`.
|
|
176
|
-
|
|
177
|
-
If the current review prompt says to produce results for every listed task, the
|
|
178
|
-
single-task fallback overrides that wording for the top-level orchestrator:
|
|
179
|
-
produce exactly one result for the first pending task only.
|
|
180
|
-
|
|
181
|
-
Run the exact `worker_command` from the task file. Then stop and summarize that
|
|
182
|
-
one bounded step. Do not loop into another semantic review task in the same
|
|
183
|
-
conversation turn. Do not re-check audit state or read an audit report after the
|
|
184
|
-
worker command.
|
|
185
|
-
|
|
186
|
-
## Step 4 - Backend Failure Handling
|
|
187
|
-
|
|
188
|
-
If `prepare-dispatch`, `merge-and-ingest`, or `worker_command` fails:
|
|
189
|
-
|
|
190
|
-
- stop immediately
|
|
191
|
-
- report the exact command and error output
|
|
192
|
-
- do not manually create prompts, split tasks, merge results, edit state, or
|
|
193
|
-
remediate application code
|
|
194
|
-
|
|
195
|
-
Invalid or missing subagent output is a blocker. It should not be silently
|
|
196
|
-
merged or treated as automatic progress.
|
|
38
|
+
Read the returned JSON only far enough to find `prompt_path`, then read and
|
|
39
|
+
follow only that prompt. Do not read packet prompts, schemas, command catalogs,
|
|
40
|
+
or handoff files unless the current step prompt explicitly instructs you to do
|
|
41
|
+
so.
|
|
197
42
|
|
|
198
|
-
|
|
43
|
+
When a step prompt tells you to continue, run `audit-code next-step` again and
|
|
44
|
+
follow only the newly returned `prompt_path`.
|
|
199
45
|
|
|
200
|
-
|
|
201
|
-
Read `audit-report.md` and present the completed audit with work blocks first.
|
|
46
|
+
Stop when the current step prompt tells you to stop.
|