auditor-lambda 0.3.8 → 0.3.9

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.
@@ -165,7 +165,7 @@ async function getStatusPayload(context) {
165
165
  };
166
166
  }
167
167
  function asTextContent(value) {
168
- return typeof value === "string" ? value : JSON.stringify(value, null, 2);
168
+ return typeof value === "string" ? value : JSON.stringify(value);
169
169
  }
170
170
  function toolResult(value) {
171
171
  return {
@@ -184,14 +184,14 @@ async function readResource(uri, context) {
184
184
  const bundle = await loadArtifactBundle(context.artifactsDir);
185
185
  return {
186
186
  mimeType: "application/json",
187
- text: JSON.stringify(bundle, null, 2),
187
+ text: JSON.stringify(bundle),
188
188
  };
189
189
  }
190
190
  case "audit-code://handoff/current": {
191
191
  const status = (await getStatusPayload(context)).handoff;
192
192
  return {
193
193
  mimeType: "application/json",
194
- text: JSON.stringify(status, null, 2),
194
+ text: JSON.stringify(status),
195
195
  };
196
196
  }
197
197
  case "audit-code://install/guide": {
@@ -247,14 +247,15 @@ function renderPrompt(name, args) {
247
247
  return [
248
248
  "Use the auditor MCP tools as the primary interface to the backend wrapper.",
249
249
  "1. Call `start_audit`.",
250
- "2. If the audit is blocked, inspect `audit-code://handoff/current` and `audit-code://artifacts/current`.",
250
+ "2. If the audit is blocked, inspect `audit-code://handoff/current`.",
251
+ " Do not read `audit-code://artifacts/current` unless explicitly needed for a specific task; it is massive and consumes your context window.",
251
252
  "3. When the user provides additional evidence, call `import_results` or `import_runtime_updates`.",
252
253
  "4. Call `continue_audit` until the status is complete or explicitly blocked for operator input.",
253
254
  ].join("\n");
254
255
  case "review-task":
255
256
  return [
256
257
  `Use \`explain_task\` for task \`${String(args?.task_id ?? "")}\` before you inspect code manually.`,
257
- "Then read `audit-code://artifacts/current` and use the task scope to review the relevant files.",
258
+ "Do not read the full `audit-code://artifacts/current` bundle unless specifically needed, as it is massive.",
258
259
  ].join("\n");
259
260
  case "synthesize-report":
260
261
  return [
@@ -1,7 +1,7 @@
1
1
  import { createHash } from "node:crypto";
2
2
  import { LENS_ORDER } from "./unitBuilder.js";
3
- const DEFAULT_MAX_TASKS_PER_PACKET = 6;
4
- const DEFAULT_TARGET_PACKET_LINES = 2500;
3
+ const DEFAULT_MAX_TASKS_PER_PACKET = 0;
4
+ const DEFAULT_TARGET_PACKET_LINES = 8000;
5
5
  const ESTIMATED_TOKENS_PER_LINE = 4;
6
6
  const ESTIMATED_PACKET_PROMPT_TOKENS = 900;
7
7
  function priorityRank(priority) {
@@ -121,7 +121,7 @@ function chunkPacketTasks(tasks, options) {
121
121
  const owner = candidate.find((item) => item.file_paths.includes(path));
122
122
  return sum + (owner ? lineCountForPath(owner, path, options.lineIndex) : 0);
123
123
  }, 0);
124
- const wouldExceedTaskCount = current.length > 0 && candidate.length > options.maxTasksPerPacket;
124
+ const wouldExceedTaskCount = options.maxTasksPerPacket > 0 && current.length > 0 && candidate.length > options.maxTasksPerPacket;
125
125
  const wouldExceedLines = current.length > 0 && candidateLines > options.targetPacketLines;
126
126
  if (wouldExceedTaskCount || wouldExceedLines) {
127
127
  chunks.push(current);
@@ -46,9 +46,9 @@ function pickAnalyzerLens(category) {
46
46
  return "maintainability";
47
47
  return "correctness";
48
48
  }
49
- const DEFAULT_FILE_SPLIT_THRESHOLD = 3000;
50
- const DEFAULT_MAX_TASK_LINES = 1500;
51
- const DEFAULT_MAX_TASK_FILES = 8;
49
+ const DEFAULT_FILE_SPLIT_THRESHOLD = 5000;
50
+ const DEFAULT_MAX_TASK_LINES = 3000;
51
+ const DEFAULT_MAX_TASK_FILES = 15;
52
52
  const DEFAULT_TINY_TEST_FILE_LINES = 250;
53
53
  const TINY_TEST_UNIT_ID = "tests-tiny-files";
54
54
  function buildCoverageIndex(coverageMatrix) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "auditor-lambda",
3
- "version": "0.3.8",
3
+ "version": "0.3.9",
4
4
  "private": false,
5
5
  "description": "Portable hybrid code-auditing framework for arbitrary repositories.",
6
6
  "type": "module",
@@ -25,6 +25,7 @@ and ingest results mechanically.
25
25
  a backend command fails and the error explicitly requires diagnosis.
26
26
  - Do not inspect individual subagent result files after dispatch. Validation
27
27
  and ingestion are backend responsibilities.
28
+ - 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.
28
29
  - Prefer subagent dispatch for semantic review whenever the host exposes an
29
30
  Agent/subagent tool.
30
31
  - If the host cannot dispatch subagents, complete exactly one assigned review
@@ -94,6 +95,8 @@ In a single message, launch one Agent/subagent call per dispatch-plan entry:
94
95
  Agent({ description: entry.description, prompt: "Read and follow the audit instructions in: " + entry.prompt_path })
95
96
  ```
96
97
 
98
+ 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.
99
+
97
100
  If the host supports per-subagent model selection, use `entry.model_hint.tier`
98
101
  as a provider-neutral routing hint (`small`, `standard`, or `deep`). Map it to
99
102
  available host models without asking the user to choose model names. If model