auditor-lambda 0.6.6 → 0.6.7
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/dist/cli/prompts.js +5 -2
- package/dist/cli/steps.d.ts +9 -0
- package/dist/cli/steps.js +3 -0
- package/dist/cli.js +2 -6
- package/dist/quota/scheduler.js +8 -0
- package/package.json +1 -1
- package/skills/audit-code/audit-code.prompt.md +12 -5
package/dist/cli/prompts.js
CHANGED
|
@@ -22,9 +22,12 @@ export function mergeAndIngestCommand(artifactsDir, runId) {
|
|
|
22
22
|
export function renderDispatchReviewPrompt(params) {
|
|
23
23
|
const mergeCommand = mergeAndIngestCommand(params.artifactsDir, params.activeReviewRun.run_id);
|
|
24
24
|
const continueCommand = nextStepCommand(params.root, params.artifactsDir);
|
|
25
|
+
// Only mention model_hint when the host can actually act on it. When it
|
|
26
|
+
// cannot, the field is left as inert plan metadata rather than surfacing a
|
|
27
|
+
// contradictory "here is model_hint, now ignore it" instruction.
|
|
25
28
|
const modelLine = params.hostCanSelectSubagentModel
|
|
26
29
|
? "When launching each subagent, map `entry.model_hint.tier` (`small`, `standard`, `deep`) to an available host model without asking the user for model names."
|
|
27
|
-
:
|
|
30
|
+
: null;
|
|
28
31
|
const toolsLine = params.hostCanRestrictSubagentTools
|
|
29
32
|
? "Restrict review subagents to read/search plus the packet submit command named in their prompt. Do not give them source edit/write tools."
|
|
30
33
|
: "Do not ask the user about per-subagent tool restrictions; this host did not report a callable restriction facility.";
|
|
@@ -59,7 +62,7 @@ export function renderDispatchReviewPrompt(params) {
|
|
|
59
62
|
"",
|
|
60
63
|
' Read and follow the audit instructions in: <entry.prompt_path>',
|
|
61
64
|
"",
|
|
62
|
-
modelLine,
|
|
65
|
+
...(modelLine ? [modelLine] : []),
|
|
63
66
|
toolsLine,
|
|
64
67
|
"",
|
|
65
68
|
"Each subagent must submit its packet through the submit command printed in its packet prompt and stop after successful submission.",
|
package/dist/cli/steps.d.ts
CHANGED
|
@@ -8,7 +8,15 @@ export interface StepArtifact {
|
|
|
8
8
|
prompt_path: string;
|
|
9
9
|
status: StepStatus;
|
|
10
10
|
run_id: string | null;
|
|
11
|
+
/** Shell commands the host may run for this step. */
|
|
11
12
|
allowed_commands: string[];
|
|
13
|
+
/**
|
|
14
|
+
* MCP tool names equivalent to `allowed_commands`, for hosts driving the
|
|
15
|
+
* backend through the MCP adapter. Omitted when the step has no MCP
|
|
16
|
+
* equivalents, so a shell host never has to guess which list entries are
|
|
17
|
+
* tool names versus runnable commands.
|
|
18
|
+
*/
|
|
19
|
+
allowed_mcp_tools?: string[];
|
|
12
20
|
stop_condition: string;
|
|
13
21
|
repo_root: string;
|
|
14
22
|
artifacts_dir: string;
|
|
@@ -21,6 +29,7 @@ export declare function writeCurrentStep(params: {
|
|
|
21
29
|
status: StepStatus;
|
|
22
30
|
runId: string | null;
|
|
23
31
|
allowedCommands: string[];
|
|
32
|
+
allowedMcpTools?: string[];
|
|
24
33
|
stopCondition: string;
|
|
25
34
|
repoRoot: string;
|
|
26
35
|
artifactPaths: Record<string, string | null>;
|
package/dist/cli/steps.js
CHANGED
|
@@ -15,6 +15,9 @@ export async function writeCurrentStep(params) {
|
|
|
15
15
|
status: params.status,
|
|
16
16
|
run_id: params.runId,
|
|
17
17
|
allowed_commands: params.allowedCommands,
|
|
18
|
+
...(params.allowedMcpTools && params.allowedMcpTools.length > 0
|
|
19
|
+
? { allowed_mcp_tools: params.allowedMcpTools }
|
|
20
|
+
: {}),
|
|
18
21
|
stop_condition: params.stopCondition,
|
|
19
22
|
repo_root: params.repoRoot,
|
|
20
23
|
artifacts_dir: params.artifactsDir,
|
package/dist/cli.js
CHANGED
|
@@ -935,12 +935,8 @@ async function renderSemanticReviewStep(params) {
|
|
|
935
935
|
stepKind: "dispatch_review",
|
|
936
936
|
status: "ready",
|
|
937
937
|
runId: activeReviewRun.run_id,
|
|
938
|
-
allowedCommands: [
|
|
939
|
-
|
|
940
|
-
"auditor_continue_audit",
|
|
941
|
-
mergeCommand,
|
|
942
|
-
continueCommand,
|
|
943
|
-
],
|
|
938
|
+
allowedCommands: [mergeCommand, continueCommand],
|
|
939
|
+
allowedMcpTools: ["auditor_merge_and_ingest", "auditor_continue_audit"],
|
|
944
940
|
stopCondition: "Dispatch every packet, run merge-and-ingest once, then run next-step.",
|
|
945
941
|
repoRoot: root,
|
|
946
942
|
artifactPaths: {
|
package/dist/quota/scheduler.js
CHANGED
|
@@ -87,6 +87,14 @@ export function scheduleWave(options) {
|
|
|
87
87
|
: computeMaxSafeConcurrency(quotaStateEntry, halfLifeHours);
|
|
88
88
|
waveSize = Math.min(waveSize, learnedCap);
|
|
89
89
|
}
|
|
90
|
+
else if (hostConcurrencyLimit !== null) {
|
|
91
|
+
// The host explicitly reported its active-subagent capacity. That is a
|
|
92
|
+
// real concurrency signal, so it supersedes the conservative
|
|
93
|
+
// unknown-provider fallback (which exists only when we have no signal at
|
|
94
|
+
// all). Leaving waveSize untouched here lets applyHostConcurrencyLimit()
|
|
95
|
+
// below enforce the reported limit as the hard ceiling, while any RPM/TPM
|
|
96
|
+
// caps applied above still bind.
|
|
97
|
+
}
|
|
90
98
|
else {
|
|
91
99
|
const providerType = classifyProvider(providerName);
|
|
92
100
|
const fallbackCap = providerType === "local"
|
package/package.json
CHANGED
|
@@ -25,16 +25,22 @@ monorepo root). From the monorepo root use:
|
|
|
25
25
|
node packages/audit-code/audit-code.mjs ensure --quiet
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
Then ask the backend for exactly one next step
|
|
28
|
+
Then ask the backend for exactly one next step. This host can dispatch review
|
|
29
|
+
subagents in parallel (via the `Agent`/`task` tool), so report that capacity on
|
|
30
|
+
every `next-step` call — otherwise the backend assumes it cannot parallelize and
|
|
31
|
+
sizes dispatch waves to one packet at a time:
|
|
29
32
|
|
|
30
33
|
```bash
|
|
31
|
-
audit-code next-step
|
|
34
|
+
audit-code next-step --host-max-active-subagents 4
|
|
32
35
|
```
|
|
33
36
|
|
|
37
|
+
`4` is a safe default for this host; raise it for more parallelism or lower it
|
|
38
|
+
under rate-limit pressure. The backend's learned quota adapts from there.
|
|
39
|
+
|
|
34
40
|
When developing `auditor-lambda` itself, from the monorepo root use:
|
|
35
41
|
|
|
36
42
|
```bash
|
|
37
|
-
node packages/audit-code/audit-code.mjs next-step
|
|
43
|
+
node packages/audit-code/audit-code.mjs next-step --host-max-active-subagents 4
|
|
38
44
|
```
|
|
39
45
|
|
|
40
46
|
Read the returned JSON only far enough to find `prompt_path`, then read and
|
|
@@ -47,7 +53,8 @@ Use MCP tools only as a compatibility adapter when direct shell access to
|
|
|
47
53
|
`continue_audit` tools return the same one-step contract; they are not a
|
|
48
54
|
separate orchestration path.
|
|
49
55
|
|
|
50
|
-
When a step prompt tells you to continue, run
|
|
51
|
-
follow only the
|
|
56
|
+
When a step prompt tells you to continue, run
|
|
57
|
+
`audit-code next-step --host-max-active-subagents 4` again and follow only the
|
|
58
|
+
newly returned `prompt_path`.
|
|
52
59
|
|
|
53
60
|
Stop when the current step prompt tells you to stop.
|