audit-tools 0.53.0 → 0.54.0

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 (74) hide show
  1. package/dist/audit/cli/conceptualDispatch.d.ts +2 -2
  2. package/dist/audit/cli/conceptualDispatch.d.ts.map +1 -1
  3. package/dist/audit/cli/conceptualDispatch.js +6 -5
  4. package/dist/audit/cli/conceptualDispatch.js.map +1 -1
  5. package/dist/audit/cli/confirmIntentStep.d.ts.map +1 -1
  6. package/dist/audit/cli/confirmIntentStep.js +3 -16
  7. package/dist/audit/cli/confirmIntentStep.js.map +1 -1
  8. package/dist/audit/cli/dispatch/hostHandoff.d.ts.map +1 -1
  9. package/dist/audit/cli/dispatch/hostHandoff.js +21 -0
  10. package/dist/audit/cli/dispatch/hostHandoff.js.map +1 -1
  11. package/dist/audit/cli/functionalPreflight.d.ts.map +1 -1
  12. package/dist/audit/cli/functionalPreflight.js +6 -3
  13. package/dist/audit/cli/functionalPreflight.js.map +1 -1
  14. package/dist/audit/cli/nextStepCommand.d.ts.map +1 -1
  15. package/dist/audit/cli/nextStepCommand.js +15 -14
  16. package/dist/audit/cli/nextStepCommand.js.map +1 -1
  17. package/dist/audit/cli/nextStepHelpers.js +2 -2
  18. package/dist/audit/cli/nextStepHelpers.js.map +1 -1
  19. package/dist/audit/orchestrator/advance.d.ts.map +1 -1
  20. package/dist/audit/orchestrator/advance.js +21 -1
  21. package/dist/audit/orchestrator/advance.js.map +1 -1
  22. package/dist/audit/orchestrator/architectureDiscovery.d.ts +15 -1
  23. package/dist/audit/orchestrator/architectureDiscovery.d.ts.map +1 -1
  24. package/dist/audit/orchestrator/architectureDiscovery.js +30 -11
  25. package/dist/audit/orchestrator/architectureDiscovery.js.map +1 -1
  26. package/dist/audit/orchestrator/dependencyMap.d.ts +20 -0
  27. package/dist/audit/orchestrator/dependencyMap.d.ts.map +1 -1
  28. package/dist/audit/orchestrator/dependencyMap.js +47 -0
  29. package/dist/audit/orchestrator/dependencyMap.js.map +1 -1
  30. package/dist/audit/orchestrator/dependencySlices.d.ts.map +1 -1
  31. package/dist/audit/orchestrator/dependencySlices.js +37 -3
  32. package/dist/audit/orchestrator/dependencySlices.js.map +1 -1
  33. package/dist/audit/orchestrator/designReviewPrompt.d.ts +2 -2
  34. package/dist/audit/orchestrator/designReviewPrompt.js +2 -2
  35. package/dist/audit/orchestrator/executors.js +1 -1
  36. package/dist/audit/orchestrator/executors.js.map +1 -1
  37. package/dist/audit/orchestrator/ingestionExecutors.d.ts.map +1 -1
  38. package/dist/audit/orchestrator/ingestionExecutors.js +38 -37
  39. package/dist/audit/orchestrator/ingestionExecutors.js.map +1 -1
  40. package/dist/audit/orchestrator/nextStep.d.ts.map +1 -1
  41. package/dist/audit/orchestrator/nextStep.js +0 -1
  42. package/dist/audit/orchestrator/nextStep.js.map +1 -1
  43. package/dist/audit/orchestrator/staleness.d.ts.map +1 -1
  44. package/dist/audit/orchestrator/staleness.js +14 -10
  45. package/dist/audit/orchestrator/staleness.js.map +1 -1
  46. package/dist/audit/orchestrator/state.d.ts.map +1 -1
  47. package/dist/audit/orchestrator/state.js +1 -3
  48. package/dist/audit/orchestrator/state.js.map +1 -1
  49. package/dist/audit/types.d.ts +12 -1
  50. package/dist/audit/types.d.ts.map +1 -1
  51. package/dist/audit/types.js +92 -11
  52. package/dist/audit/types.js.map +1 -1
  53. package/dist/remediate/steps/contractPipeline.d.ts.map +1 -1
  54. package/dist/remediate/steps/contractPipeline.js +11 -3
  55. package/dist/remediate/steps/contractPipeline.js.map +1 -1
  56. package/dist/remediate/steps/nextStep.d.ts.map +1 -1
  57. package/dist/remediate/steps/nextStep.js +8 -23
  58. package/dist/remediate/steps/nextStep.js.map +1 -1
  59. package/dist/remediate/steps/prompts.js +4 -4
  60. package/dist/shared/loopCorePaths.d.ts.map +1 -1
  61. package/dist/shared/loopCorePaths.js +31 -5
  62. package/dist/shared/loopCorePaths.js.map +1 -1
  63. package/dist/shared/prompts.d.ts +23 -8
  64. package/dist/shared/prompts.d.ts.map +1 -1
  65. package/dist/shared/prompts.js +26 -11
  66. package/dist/shared/prompts.js.map +1 -1
  67. package/package.json +2 -1
  68. package/scripts/shared/primitives.mjs +20 -0
  69. package/skills/audit-code/SKILL.md +5 -12
  70. package/skills/audit-code/audit-code.prompt.md +5 -8
  71. package/skills/audit-code/opencode-command-template.txt +2 -2
  72. package/skills/remediate-code/SKILL.md +5 -7
  73. package/skills/remediate-code/remediate-code.prompt.md +5 -5
  74. package/dispatch/lens-definitions.json +0 -46
@@ -27,12 +27,27 @@ export interface CacheablePromptParts {
27
27
  */
28
28
  export declare function buildCacheablePrompt(parts: CacheablePromptParts): string;
29
29
  /**
30
- * Host instruction emitted in dispatch step prompts: each subagent should
31
- * receive its `prompt_path` file path and follow it directly. Loading worker
32
- * prompts into the main conversation inflates context for no benefit — the
33
- * worker executes in its own context and reports results back through its
34
- * assigned result path. Single-sourced so audit-code and remediate-code stay
35
- * in parity on the dispatch handoff policy.
30
+ * The host-facing vocabulary for where a lane runs. Every phrase names the
31
+ * NEED — a context, separate or independent — and never a delegation mechanism:
32
+ * hosts differ in how (or whether) they can open another context, and a
33
+ * mechanism noun is an instruction a host without that mechanism cannot follow.
34
+ * `tests/shared/host-prompt-vocabulary.test.ts` holds every string literal in
35
+ * the shipped code to this.
36
+ *
37
+ * - `INDEPENDENT_CONTEXT`: a review lane that must not be judged by the agent
38
+ * that drove the work under review.
39
+ * - `SEPARATE_CONTEXT_OR_SELF`: an ordinary lane, run apart from the driving
40
+ * conversation when the host can, else by the driver itself.
41
+ */
42
+ export declare const INDEPENDENT_CONTEXT = "an independent context that did not drive this audit";
43
+ export declare const SEPARATE_CONTEXT_OR_SELF = "in a separate context when the host can, else yourself";
44
+ /**
45
+ * Host instruction emitted in dispatch step prompts: each lane handed to a
46
+ * separate context receives its `prompt_path` file path and follows it
47
+ * directly. Loading worker prompts into the main conversation inflates context
48
+ * for no benefit — the worker executes in its own context and reports results
49
+ * back through its assigned result path. Single-sourced so audit-code and
50
+ * remediate-code stay in parity on the dispatch handoff policy.
36
51
  */
37
52
  export declare const DISPATCH_PROMPT_HANDOFF_NOTE: string;
38
53
  /**
@@ -46,7 +61,7 @@ export declare const DISPATCH_PROMPT_HANDOFF_NOTE: string;
46
61
  *
47
62
  * ⚠ THE MANDATE STATES THE NEED, NEVER A MECHANISM. It used to say "dispatch it
48
63
  * to a fresh, independent sub-agent", which names one way to get independence
49
- * and presumes the host has it — in-process subagents are not universal, and a
64
+ * and presumes the host has it — in-process delegation is not universal, and a
50
65
  * host without them read an instruction it could not follow (the same defect the
51
66
  * former contract-pipeline fan-out carried). Independence is a property of the
52
67
  * CONTEXT, so that is what the text requires and the host owns the mechanism.
@@ -86,7 +101,7 @@ export declare function renderFanoutExecutionLines(params: {
86
101
  };
87
102
  reviewRequirement?: "ordinary" | "independent" | "degraded_allowed";
88
103
  }[];
89
- /** Host-declared max concurrent subagents, when known. */
104
+ /** Host-declared max concurrent lanes, when known. */
90
105
  concurrencyHint?: number | null;
91
106
  /** A driver cannot execute these lanes itself; unavailable independence stops the step. */
92
107
  independenceRequired?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../src/shared/prompts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAIvE;;;;;;GAMG;AACH,MAAM,WAAW,oBAAoB;IACnC;;0BAEsB;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,uEAAuE;IACvE,eAAe,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,oBAAoB,GAAG,MAAM,CAMxE;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B,QAG+C,CAAC;AAEzF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,8BAA8B,CAC5C,KAAK,CAAC,EAAE,OAAO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;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,8BAA8B,CAC5C,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,EACxB,WAAW,GAAE,iBAA0E,GACtF,MAAM,CAcR;AAED;;;;;;;;GAQG;AAEH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE;IACjD;;;;;;OAMG;IACH,KAAK,EAAE;QACL,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,MAAM,CAAC,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,UAAU,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC;QAC5D,iBAAiB,CAAC,EAAE,UAAU,GAAG,aAAa,GAAG,kBAAkB,CAAC;KACrE,EAAE,CAAC;IACJ,sDAAsD;IACtD,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,2FAA2F;IAC3F,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC,GAAG,MAAM,EAAE,CA4CX;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,CAMpE"}
@@ -17,14 +17,29 @@ export function buildCacheablePrompt(parts) {
17
17
  return `${sharedPrefix}\n\n${perAgentPayload}`;
18
18
  }
19
19
  /**
20
- * Host instruction emitted in dispatch step prompts: each subagent should
21
- * receive its `prompt_path` file path and follow it directly. Loading worker
22
- * prompts into the main conversation inflates context for no benefit — the
23
- * worker executes in its own context and reports results back through its
24
- * assigned result path. Single-sourced so audit-code and remediate-code stay
25
- * in parity on the dispatch handoff policy.
20
+ * The host-facing vocabulary for where a lane runs. Every phrase names the
21
+ * NEED — a context, separate or independent — and never a delegation mechanism:
22
+ * hosts differ in how (or whether) they can open another context, and a
23
+ * mechanism noun is an instruction a host without that mechanism cannot follow.
24
+ * `tests/shared/host-prompt-vocabulary.test.ts` holds every string literal in
25
+ * the shipped code to this.
26
+ *
27
+ * - `INDEPENDENT_CONTEXT`: a review lane that must not be judged by the agent
28
+ * that drove the work under review.
29
+ * - `SEPARATE_CONTEXT_OR_SELF`: an ordinary lane, run apart from the driving
30
+ * conversation when the host can, else by the driver itself.
31
+ */
32
+ export const INDEPENDENT_CONTEXT = "an independent context that did not drive this audit";
33
+ export const SEPARATE_CONTEXT_OR_SELF = "in a separate context when the host can, else yourself";
34
+ /**
35
+ * Host instruction emitted in dispatch step prompts: each lane handed to a
36
+ * separate context receives its `prompt_path` file path and follows it
37
+ * directly. Loading worker prompts into the main conversation inflates context
38
+ * for no benefit — the worker executes in its own context and reports results
39
+ * back through its assigned result path. Single-sourced so audit-code and
40
+ * remediate-code stay in parity on the dispatch handoff policy.
26
41
  */
27
- export const DISPATCH_PROMPT_HANDOFF_NOTE = "For each subagent, pass its `prompt_path` to the agent tool directly — " +
42
+ export const DISPATCH_PROMPT_HANDOFF_NOTE = "For each lane handed to a separate context, pass its `prompt_path` as the instruction directly — " +
28
43
  "do not read the worker prompt file into this conversation. " +
29
44
  "Each worker executes in its own context and writes only to its assigned result path.";
30
45
  /**
@@ -38,7 +53,7 @@ export const DISPATCH_PROMPT_HANDOFF_NOTE = "For each subagent, pass its `prompt
38
53
  *
39
54
  * ⚠ THE MANDATE STATES THE NEED, NEVER A MECHANISM. It used to say "dispatch it
40
55
  * to a fresh, independent sub-agent", which names one way to get independence
41
- * and presumes the host has it — in-process subagents are not universal, and a
56
+ * and presumes the host has it — in-process delegation is not universal, and a
42
57
  * host without them read an instruction it could not follow (the same defect the
43
58
  * former contract-pipeline fan-out carried). Independence is a property of the
44
59
  * CONTEXT, so that is what the text requires and the host owns the mechanism.
@@ -95,8 +110,8 @@ export function renderFanoutExecutionLines(params) {
95
110
  : [];
96
111
  return [
97
112
  (params.independenceRequired || params.lanes.some(lane => lane.reviewRequirement === "independent"))
98
- ? `Execute the ${n} lane prompt file${plural} below in an independent context that did not drive this audit. The host chooses how to obtain that context. If none is available, stop and report that this review could not be performed independently. Do not write a result or run the continue command in that case; this overrides the output and continuation instructions below. An unavailable review is not an empty findings result.`
99
- : `Execute the ${n} lane prompt file${plural} below: dispatch one subagent per file if a subagent facility exists, else read and follow each file sequentially yourself. The same files and result paths apply either way.`,
113
+ ? `Execute the ${n} lane prompt file${plural} below in ${INDEPENDENT_CONTEXT}. The host chooses how to obtain that context. If none is available, stop and report that this review could not be performed independently. Do not write a result or run the continue command in that case; this overrides the output and continuation instructions below. An unavailable review is not an empty findings result.`
114
+ : `Execute the ${n} lane prompt file${plural} below, each ${SEPARATE_CONTEXT_OR_SELF} — run separate contexts in parallel where the host can; otherwise read and follow each file sequentially yourself. The same files and result paths apply either way.`,
100
115
  "",
101
116
  ...concurrency,
102
117
  ...(params.lanes.some((lane) => lane.demand !== undefined)
@@ -113,7 +128,7 @@ export function renderFanoutExecutionLines(params) {
113
128
  "",
114
129
  (params.independenceRequired || params.lanes.some(lane => lane.reviewRequirement === "independent"))
115
130
  ? "Pass each lane's prompt path verbatim to its independent executor. Lane prompt files carry no continue-command; return here once the independently produced lane results exist."
116
- : "When dispatching a lane to a subagent, pass its prompt path verbatim as the instruction — do not read the lane file into this conversation. When executing a lane yourself, read and follow its file directly. Lane prompt files carry no continue-command; return here once the lane results exist.",
131
+ : "When handing a lane to a separate context, pass its prompt path verbatim as the instruction — do not read the lane file into this conversation. When executing a lane yourself, read and follow its file directly. Lane prompt files carry no continue-command; return here once the lane results exist.",
117
132
  ];
118
133
  }
119
134
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../src/shared/prompts.ts"],"names":[],"mappings":"AAoBA;;;;;;;;;;GAUG;AACH,MAAM,UAAU,oBAAoB,CAAC,KAA2B;IAC9D,MAAM,EAAE,YAAY,EAAE,eAAe,EAAE,GAAG,KAAK,CAAC;IAChD,IAAI,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC9B,OAAO,eAAe,CAAC;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EAAE,CAAC,IAAI,CAAC,iBAAiB,KAAK,aAAa,CAAC,CAAC;YAClG,CAAC,CAAC,iLAAiL;YACnL,CAAC,CAAC,0SAA0S;KAC/S,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,qBAAqB,CAAC,cAAsB;IAC1D,OAAO,CACL,0EAA0E;QAC1E,8CAA8C,cAAc,OAAO;QACnE,yEAAyE,CAC1E,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "audit-tools",
3
- "version": "0.53.0",
3
+ "version": "0.54.0",
4
4
  "private": false,
5
5
  "license": "ISC",
6
6
  "description": "Provider-neutral code auditing and remediation workflows for arbitrary repositories.",
@@ -116,6 +116,7 @@
116
116
  "generate:shard-baseline": "node scripts/shared/generate-vitest-shard-baseline.mjs",
117
117
  "check:orphan-modules": "node scripts/check-orphan-modules.mjs",
118
118
  "check:loop-core-closure": "node scripts/check-loop-core-closure.mjs",
119
+ "check:loop-core-attestations": "node scripts/check-loop-core-attestations.mjs",
119
120
  "check:pin-obligations": "node scripts/check-pin-obligations.mjs",
120
121
  "check:contract-sites": "node --import tsx/esm scripts/check-contract-sites.mjs",
121
122
  "check:sites-pinned": "node scripts/check-sites-pinned.mjs",
@@ -21,6 +21,10 @@
21
21
  // The gate's rule tables list BOTH homes, so a re-roll anywhere in either tree
22
22
  // is red. Change one and change the other — the rules treat them as one home in
23
23
  // two files, which is what makes the divergence impossible to miss.
24
+ //
25
+ // `processAlive` is not a twin: it is the governance tree's one liveness probe,
26
+ // imported by the prebuild guard and the dispatch lane and re-exported to the
27
+ // test helpers.
24
28
  import { createHash } from "node:crypto";
25
29
  import { isAbsolute, relative, resolve, sep } from "node:path";
26
30
 
@@ -87,3 +91,19 @@ export function resolveWithinRoot(root, candidate, options = {}) {
87
91
  if (rel === ".." || rel.startsWith(`..${sep}`) || rel.startsWith("../")) return null;
88
92
  return absolutePath;
89
93
  }
94
+
95
+ // sites-pinned: tests/shared/dispatch-lane-worktree.test.ts
96
+ /**
97
+ * Whether a process with this pid exists. `kill(pid, 0)` sends no signal; it
98
+ * reports deliverability, so an EPERM answer still means the process EXISTS.
99
+ * A pid that is not a positive integer names no process.
100
+ */
101
+ export function processAlive(pid) {
102
+ if (typeof pid !== "number" || !Number.isInteger(pid) || pid <= 0) return false;
103
+ try {
104
+ process.kill(pid, 0);
105
+ return true;
106
+ } catch (err) {
107
+ return /** @type {any} */ (err).code === "EPERM";
108
+ }
109
+ }
@@ -18,8 +18,8 @@ Normal usage should:
18
18
 
19
19
  audit-tools owns deterministic discovery, planning, persisted state, strict
20
20
  result ingestion, and synthesis. When semantic review is ready it emits a
21
- complete provider-neutral workload. Delegate those bounded items through the
22
- host's native subagent facilities when available, then return only the bound
21
+ complete provider-neutral workload. Run those bounded items in separate
22
+ contexts when the host can, then return only the bound
23
23
  result artifacts requested by the current prompt.
24
24
 
25
25
  If the host cannot delegate, complete exactly one emitted review item in the
@@ -36,21 +36,14 @@ audit-code ensure --quiet
36
36
  audit-code next-step
37
37
  ```
38
38
 
39
- When developing audit-tools itself, use the repository-local wrapper:
40
-
41
- ```bash
42
- node audit-code.mjs ensure --quiet
43
- node audit-code.mjs next-step
44
- ```
45
-
46
39
  The target-directory rule has one full statement in
47
40
  `skills/audit-code/audit-code.prompt.md` (whose absolute path `audit-code
48
41
  prompt-path` prints); follow it as written there. Do not add provider, model,
49
42
  quota, routing, or launch flags.
50
43
 
51
- Read the returned JSON only far enough to find `prompt_path`, then read and
52
- follow only that prompt. Do not inspect workload, result, schema, or state files
53
- unless the current prompt directs you to them. When it says to continue, call
44
+ The command prints a JSON step record. Read the prompt file at its
45
+ `prompt_path`, then follow only that prompt. Do not inspect workload, result,
46
+ schema, or state files unless the current prompt directs you to them. When it says to continue, call
54
47
  `next-step` again. Stop when it says to stop.
55
48
 
56
49
  The package install seeds command and skill assets. Use `audit-code install`
@@ -16,9 +16,6 @@ First bootstrap current assets:
16
16
  audit-code ensure --quiet
17
17
  ```
18
18
 
19
- When developing audit-tools itself, use `node audit-code.mjs` from the
20
- repository root.
21
-
22
19
  Preserve user arguments:
23
20
 
24
21
  - run from inside the target repository; every command resolves that repository's
@@ -32,12 +29,12 @@ Ask for exactly one step:
32
29
  audit-code next-step
33
30
  ```
34
31
 
35
- Read the returned JSON only far enough to find `prompt_path`, then read and
36
- follow only that prompt. Do not inspect workload, result, schema, or state files
37
- unless the current prompt directs you to them.
32
+ The command prints a JSON step record. Read the prompt file at its
33
+ `prompt_path`, then follow only that prompt. Do not inspect workload, result,
34
+ schema, or state files unless the current prompt directs you to them.
38
35
 
39
- When the prompt emits semantic review items, assign them with the host's native
40
- subagent facilities when available. Do not send provider, model, quota,
36
+ When the prompt emits semantic review items, run each in a separate context
37
+ when the host can, else yourself, as the prompt directs. Do not send provider, model, quota,
41
38
  context-window, routing, or launch configuration to audit-tools. Write the
42
39
  prompt-bound result artifacts exactly where requested and let the next backend
43
40
  step validate and ingest them.
@@ -3,10 +3,10 @@
3
3
  Use `audit-code next-step` as the primary interface to the audit workflow.
4
4
 
5
5
  1. Run `audit-code next-step` directly when shell access is available.
6
- 2. Read the returned JSON far enough to find `prompt_path`, then read and follow the prompt file it points to.
6
+ 2. Read the prompt file at the returned step record's `prompt_path`, then follow it.
7
7
  3. When a step completes (not blocked), run `audit-code next-step` again.
8
8
  4. Stop when the step instructions say to stop.
9
9
 
10
- Use the `task` tool or equivalent for subagent dispatch when the step tells you to fan out review work.
10
+ When the step tells you to fan out review work, run each lane in a separate context when the host can, else yourself.
11
11
 
12
12
  If shell access to `audit-code next-step` is unavailable, stop and report that no next-step interface is connected.
@@ -19,8 +19,7 @@ Normal usage should:
19
19
  The backend owns intake, contract planning, persisted state, dependency and
20
20
  phase safety, strict result ingestion, verification, and closeout. When
21
21
  implementation is ready it emits every eligible provider-neutral work item.
22
- Delegate bounded work through the host's native subagent facilities when
23
- available. The host returns prompt-bound commit and test evidence; the backend
22
+ Run bounded work in separate contexts when the host can. The host returns prompt-bound commit and test evidence; the backend
24
23
  corroborates that evidence before it accepts completion.
25
24
 
26
25
  If the host cannot delegate, complete exactly one emitted work item in the
@@ -43,13 +42,12 @@ them as written there.
43
42
  Do not add capability, provider, model, quota, context-window, or concurrency
44
43
  flags.
45
44
 
46
- Read the returned JSON only far enough to find `prompt_path`, then read and
47
- follow only that prompt. Do not inspect workload, result, schema, or state files
48
- unless the current prompt directs you to them. When it says to continue, call
45
+ The command prints a JSON step record. Read the prompt file at its
46
+ `prompt_path`, then follow only that prompt. Do not inspect workload, result,
47
+ schema, or state files unless the current prompt directs you to them. When it says to continue, call
49
48
  `next-step` again. Stop when it says to stop.
50
49
 
51
- When developing audit-tools itself, prefer `node remediate-code.mjs`. Use
52
- `remediate-code install` for repair or forced asset refresh.
50
+ Use `remediate-code install` for repair or forced asset refresh.
53
51
 
54
52
  ## Development rule
55
53
 
@@ -40,12 +40,12 @@ Then ask for exactly one step:
40
40
  remediate-code next-step
41
41
  ```
42
42
 
43
- Read the returned JSON only far enough to find `prompt_path`, then read and
44
- follow only that prompt. Do not inspect workload, result, schema, or state files
45
- unless the current prompt directs you to them.
43
+ The command prints a JSON step record. Read the prompt file at its
44
+ `prompt_path`, then follow only that prompt. Do not inspect workload, result,
45
+ schema, or state files unless the current prompt directs you to them.
46
46
 
47
- When the prompt emits implementation items, assign them using the host's native
48
- subagent facilities when available. Do not send provider, model, quota,
47
+ When the prompt emits implementation items, run each in a separate context
48
+ when the host can, else yourself, as the prompt directs. Do not send provider, model, quota,
49
49
  context-window, routing, launch, or concurrency configuration to audit-tools.
50
50
  Write the bound result artifacts exactly where requested; the next backend step
51
51
  validates workload identity, worktree and commit evidence, changed files, and
@@ -1,46 +0,0 @@
1
- {
2
- "correctness": {
3
- "description": "Logic errors, incorrect algorithm implementations, off-by-one bugs, type mismatches, wrong return values, incorrect state transitions, missing null/undefined guards, misuse of APIs. Focus on code that does the wrong thing.",
4
- "do_not_report": "Style issues, naming problems, missing tests, or findings that belong to other lenses."
5
- },
6
- "maintainability": {
7
- "description": "Code that is hard to change safely: excessive function length, deep nesting, tight coupling between unrelated modules, poor naming, magic constants, duplicated logic, inconsistent abstractions, unclear public APIs. A specific high-value smell: the same logic, format, or contract implemented in two or more places and kept consistent by a test or by convention instead of extracted to one shared source — flag the duplication and recommend single-sourcing it (the sync test is a workaround for the missing abstraction, not the fix). The change-cost tell is 'every edit must be made in N places to stay correct.'",
8
- "do_not_report": "Correctness bugs, test gaps, or operational concerns."
9
- },
10
- "tests": {
11
- "description": "Test coverage gaps for important paths, tests that assert incorrect behavior (pinning bugs as expected), fragile or non-deterministic tests, missing negative/edge-case tests, tests that silently pass on stale builds (e.g. importing compiled dist/ rather than source). Also flag a test whose purpose is to keep two copies of logic/format/output in sync (a drift guard): the real defect is the duplication it polices, which should be extracted to one shared source so the guard is unnecessary — report the test as the symptom and call out the duplication to single-source.",
12
- "do_not_report": "Source code bugs — report only issues with the tests themselves."
13
- },
14
- "security": {
15
- "description": "Injection vulnerabilities (SQL, shell, path traversal), authentication/authorization flaws, secret exposure, insecure deserialization, privilege escalation, unsafe use of eval or child processes with user input.",
16
- "do_not_report": "Performance or correctness issues that are not security-relevant."
17
- },
18
- "reliability": {
19
- "description": "Failure modes without recovery, missing timeouts, unhandled promise rejections, race conditions, resource leaks (file handles, sockets, timers), incorrect retry logic, cascading failure risks.",
20
- "do_not_report": "Correctness bugs that do not affect reliability under failure conditions."
21
- },
22
- "performance": {
23
- "description": "Algorithmic inefficiencies (O(n²) where O(n) is possible), unnecessary re-computation, missing caching, synchronous blocking in hot paths, excessive memory allocation.",
24
- "do_not_report": "Correctness bugs unrelated to performance."
25
- },
26
- "data_integrity": {
27
- "description": "Missing input validation at trust boundaries, schema violations, inconsistent field naming across related schemas, data loss scenarios, missing required fields, enum values that are present in some schemas but not others.",
28
- "do_not_report": "UI or presentation issues; operational or deployment concerns."
29
- },
30
- "operability": {
31
- "description": "Missing or low-quality log output, error messages that don't help operators diagnose problems, missing progress indicators for long operations, no elapsed-time reporting, lack of dry-run or preview modes for destructive operations.",
32
- "do_not_report": "Correctness bugs or deployment configuration."
33
- },
34
- "config_deployment": {
35
- "description": "CI/CD pipeline correctness (wrong triggers, missing branch filters, floating version pins), deployment safety (no gate before publish, missing rollback), insecure secret handling in configs, mutable action tags that should be pinned to commit SHAs.",
36
- "do_not_report": "Runtime code issues; findings that belong to other lenses."
37
- },
38
- "architecture": {
39
- "description": "Big-picture design, conceptual elegance, over-engineering, under-engineering, appropriate use of abstractions, and identifying opportunities where custom code should be replaced by third-party tools or standard libraries. Flag a missing single source of truth: the same logic, format, or contract realized in multiple components where it should live in one shared module — the durable fix is extraction to that shared source, not a test or convention that keeps the copies in sync. Flag structural findings that span multiple components as 'systemic: true'.",
40
- "do_not_report": "Minor style issues, localized logic bugs, or formatting."
41
- },
42
- "observability": {
43
- "description": "Logging quality, telemetry, distributed tracing context, meaningful metrics, and error reporting context.",
44
- "do_not_report": "Correctness bugs or deployment configuration."
45
- }
46
- }