auditor-lambda 0.10.2 → 0.10.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.
Files changed (186) hide show
  1. package/audit-code-wrapper-build.mjs +198 -0
  2. package/audit-code-wrapper-install-hosts.mjs +1140 -0
  3. package/audit-code-wrapper-io.mjs +155 -0
  4. package/audit-code-wrapper-legacy.mjs +125 -0
  5. package/audit-code-wrapper-lib.mjs +17 -1801
  6. package/audit-code-wrapper-opencode.mjs +256 -0
  7. package/dispatch/merge-results.mjs +5 -3
  8. package/dispatch/validate-result.mjs +2 -2
  9. package/dist/adapters/coverageSummary.js +6 -2
  10. package/dist/adapters/normalizeExternal.js +16 -1
  11. package/dist/adapters/npmAudit.js +20 -9
  12. package/dist/adapters/semgrep.js +26 -1
  13. package/dist/cli/advanceAuditCommand.d.ts +1 -0
  14. package/dist/cli/advanceAuditCommand.js +95 -0
  15. package/dist/cli/args.js +1 -2
  16. package/dist/cli/auditStep.js +2 -2
  17. package/dist/cli/cleanup.d.ts +11 -1
  18. package/dist/cli/cleanup.js +25 -5
  19. package/dist/cli/cleanupCommand.d.ts +1 -0
  20. package/dist/cli/cleanupCommand.js +24 -0
  21. package/dist/cli/dispatch.d.ts +55 -31
  22. package/dist/cli/dispatch.js +298 -241
  23. package/dist/cli/dispatchStatusCommand.d.ts +1 -0
  24. package/dist/cli/dispatchStatusCommand.js +68 -0
  25. package/dist/cli/explainTaskCommand.d.ts +1 -0
  26. package/dist/cli/explainTaskCommand.js +33 -0
  27. package/dist/cli/importExternalAnalyzerCommand.d.ts +1 -0
  28. package/dist/cli/importExternalAnalyzerCommand.js +20 -0
  29. package/dist/cli/ingestResultsCommand.d.ts +1 -0
  30. package/dist/cli/ingestResultsCommand.js +34 -0
  31. package/dist/cli/intakeCommand.d.ts +1 -0
  32. package/dist/cli/intakeCommand.js +17 -0
  33. package/dist/cli/lineIndex.js +19 -12
  34. package/dist/cli/mergeAndIngestCommand.js +68 -26
  35. package/dist/cli/nextStepCommand.d.ts +139 -0
  36. package/dist/cli/nextStepCommand.js +281 -232
  37. package/dist/cli/planCommand.d.ts +1 -0
  38. package/dist/cli/planCommand.js +16 -0
  39. package/dist/cli/prepareDispatchCommand.d.ts +1 -0
  40. package/dist/cli/prepareDispatchCommand.js +25 -0
  41. package/dist/cli/quotaCommand.d.ts +1 -0
  42. package/dist/cli/quotaCommand.js +56 -0
  43. package/dist/cli/requeueCommand.d.ts +1 -0
  44. package/dist/cli/requeueCommand.js +10 -0
  45. package/dist/cli/runToCompletion.js +451 -412
  46. package/dist/cli/sampleRunCommand.d.ts +1 -0
  47. package/dist/cli/sampleRunCommand.js +93 -0
  48. package/dist/cli/statusCommand.js +1 -1
  49. package/dist/cli/steps.js +4 -1
  50. package/dist/cli/submitPacketCommand.js +16 -15
  51. package/dist/cli/synthesizeCommand.d.ts +1 -0
  52. package/dist/cli/synthesizeCommand.js +15 -0
  53. package/dist/cli/updateRuntimeValidationCommand.d.ts +1 -0
  54. package/dist/cli/updateRuntimeValidationCommand.js +16 -0
  55. package/dist/cli/validateCommand.d.ts +1 -0
  56. package/dist/cli/validateCommand.js +41 -0
  57. package/dist/cli/validateResultCommand.d.ts +1 -0
  58. package/dist/cli/validateResultCommand.js +63 -0
  59. package/dist/cli/validateResultsCommand.d.ts +1 -0
  60. package/dist/cli/validateResultsCommand.js +31 -0
  61. package/dist/cli/workerRunCommand.d.ts +15 -1
  62. package/dist/cli/workerRunCommand.js +40 -4
  63. package/dist/cli.d.ts +3 -2
  64. package/dist/cli.js +21 -628
  65. package/dist/coverage.js +7 -3
  66. package/dist/extractors/analyzers/css.js +2 -2
  67. package/dist/extractors/analyzers/html.js +2 -2
  68. package/dist/extractors/analyzers/python.js +2 -2
  69. package/dist/extractors/analyzers/registry.js +17 -36
  70. package/dist/extractors/analyzers/treeSitter.d.ts +10 -1
  71. package/dist/extractors/analyzers/treeSitter.js +28 -6
  72. package/dist/extractors/analyzers/typescript.js +104 -85
  73. package/dist/extractors/browserExtension.js +4 -1
  74. package/dist/extractors/designAssessment.js +21 -21
  75. package/dist/extractors/fsIntake.js +34 -10
  76. package/dist/extractors/graph.js +17 -7
  77. package/dist/extractors/graphManifestEdges/cargo.d.ts +4 -0
  78. package/dist/extractors/graphManifestEdges/cargo.js +107 -0
  79. package/dist/extractors/graphManifestEdges/go.d.ts +5 -0
  80. package/dist/extractors/graphManifestEdges/go.js +151 -0
  81. package/dist/extractors/graphManifestEdges/index.d.ts +8 -0
  82. package/dist/extractors/graphManifestEdges/index.js +11 -0
  83. package/dist/extractors/graphManifestEdges/jsonc.d.ts +3 -0
  84. package/dist/extractors/graphManifestEdges/jsonc.js +97 -0
  85. package/dist/extractors/graphManifestEdges/maven.d.ts +3 -0
  86. package/dist/extractors/graphManifestEdges/maven.js +73 -0
  87. package/dist/extractors/graphManifestEdges/packageJson.d.ts +19 -0
  88. package/dist/extractors/graphManifestEdges/packageJson.js +204 -0
  89. package/dist/extractors/graphManifestEdges/pnpm.d.ts +2 -0
  90. package/dist/extractors/graphManifestEdges/pnpm.js +42 -0
  91. package/dist/extractors/graphManifestEdges/pyproject.d.ts +3 -0
  92. package/dist/extractors/graphManifestEdges/pyproject.js +83 -0
  93. package/dist/extractors/graphManifestEdges/toml.d.ts +4 -0
  94. package/dist/extractors/graphManifestEdges/toml.js +68 -0
  95. package/dist/extractors/graphManifestEdges/typescript.d.ts +3 -0
  96. package/dist/extractors/graphManifestEdges/typescript.js +56 -0
  97. package/dist/extractors/graphManifestEdges/workspace.d.ts +10 -0
  98. package/dist/extractors/graphManifestEdges/workspace.js +72 -0
  99. package/dist/extractors/graphManifestEdges/yaml.d.ts +3 -0
  100. package/dist/extractors/graphManifestEdges/yaml.js +59 -0
  101. package/dist/extractors/graphManifestEdges/yamlPaths.d.ts +4 -0
  102. package/dist/extractors/graphManifestEdges/yamlPaths.js +89 -0
  103. package/dist/extractors/graphPythonImports.js +4 -20
  104. package/dist/extractors/pathPatterns.js +3 -13
  105. package/dist/io/artifacts.d.ts +1 -1
  106. package/dist/io/artifacts.js +4 -1
  107. package/dist/io/runArtifacts.d.ts +8 -2
  108. package/dist/io/runArtifacts.js +103 -69
  109. package/dist/io/toolingManifest.js +2 -1
  110. package/dist/orchestrator/advance.js +36 -0
  111. package/dist/orchestrator/artifactFreshness.d.ts +1 -1
  112. package/dist/orchestrator/artifactFreshness.js +1 -1
  113. package/dist/orchestrator/artifactMetadata.js +5 -5
  114. package/dist/orchestrator/auditTaskUtils.d.ts +4 -0
  115. package/dist/orchestrator/auditTaskUtils.js +8 -12
  116. package/dist/orchestrator/autoFixExecutor.js +40 -26
  117. package/dist/orchestrator/dependencyMap.js +1 -1
  118. package/dist/orchestrator/executorResult.d.ts +33 -0
  119. package/dist/orchestrator/executors.d.ts +7 -0
  120. package/dist/orchestrator/executors.js +24 -0
  121. package/dist/orchestrator/fileAnchors.js +42 -29
  122. package/dist/orchestrator/fileIntegrity.js +6 -1
  123. package/dist/orchestrator/flowCoverage.js +1 -2
  124. package/dist/orchestrator/flowPlanning.js +8 -4
  125. package/dist/orchestrator/graphEnrichmentExecutor.js +67 -45
  126. package/dist/orchestrator/ingestionExecutors.js +9 -1
  127. package/dist/orchestrator/intakeExecutors.d.ts +0 -4
  128. package/dist/orchestrator/intakeExecutors.js +24 -14
  129. package/dist/orchestrator/localCommands.d.ts +1 -0
  130. package/dist/orchestrator/localCommands.js +10 -17
  131. package/dist/orchestrator/nextStep.js +3 -1
  132. package/dist/orchestrator/requeueCommand.js +4 -0
  133. package/dist/orchestrator/reviewPacketGraph.js +50 -18
  134. package/dist/orchestrator/reviewPackets.js +10 -8
  135. package/dist/orchestrator/runtimeCommand.js +35 -7
  136. package/dist/orchestrator/runtimeValidationUpdate.js +6 -0
  137. package/dist/orchestrator/selectiveDeepening/highRiskClean.js +3 -2
  138. package/dist/orchestrator/selectiveDeepening/lensVerification.js +44 -18
  139. package/dist/orchestrator/staleness.js +3 -3
  140. package/dist/orchestrator/state.js +1 -1
  141. package/dist/orchestrator/syntaxResolutionExecutor.js +17 -24
  142. package/dist/orchestrator/synthesisExecutors.js +1 -0
  143. package/dist/orchestrator/taskBuilder.js +5 -4
  144. package/dist/providers/claudeCodeProvider.js +4 -1
  145. package/dist/providers/opencodeProvider.js +4 -1
  146. package/dist/quota/discoveredLimits.js +3 -3
  147. package/dist/quota/headerExtraction.js +5 -2
  148. package/dist/quota/headerExtractors/claudeCodeHeaderExtractor.js +3 -0
  149. package/dist/quota/headerExtractors/index.js +3 -3
  150. package/dist/quota/index.d.ts +3 -1
  151. package/dist/quota/index.js +3 -0
  152. package/dist/reporting/findingIdentity.d.ts +21 -0
  153. package/dist/reporting/findingIdentity.js +72 -0
  154. package/dist/reporting/findingRanks.d.ts +3 -0
  155. package/dist/reporting/findingRanks.js +24 -0
  156. package/dist/reporting/mergeFindings.js +1 -24
  157. package/dist/reporting/synthesis.d.ts +3 -1
  158. package/dist/reporting/synthesis.js +36 -7
  159. package/dist/reporting/synthesisNarrativePrompt.js +3 -0
  160. package/dist/reporting/workBlocks.js +1 -14
  161. package/dist/supervisor/operatorHandoff.js +2 -6
  162. package/dist/supervisor/runLedger.js +30 -41
  163. package/dist/types/activeDispatch.d.ts +31 -0
  164. package/dist/types/activeDispatch.js +2 -0
  165. package/dist/types.d.ts +21 -4
  166. package/dist/types.js +24 -16
  167. package/dist/validation/artifacts.js +3 -0
  168. package/dist/validation/auditResults.js +8 -2
  169. package/package.json +2 -2
  170. package/schemas/audit_findings.schema.json +5 -1
  171. package/schemas/audit_plan_metrics.schema.json +1 -1
  172. package/schemas/audit_result.schema.json +5 -6
  173. package/schemas/audit_task.schema.json +1 -4
  174. package/schemas/blind_spot_register.schema.json +1 -1
  175. package/schemas/coverage_matrix.schema.json +2 -8
  176. package/schemas/finding.schema.json +3 -17
  177. package/schemas/flow_coverage.schema.json +2 -8
  178. package/schemas/graph_bundle.schema.json +31 -0
  179. package/schemas/lens.schema.json +7 -0
  180. package/schemas/review_packets.schema.json +6 -17
  181. package/schemas/step_contract.schema.json +8 -2
  182. package/schemas/unit_manifest.schema.json +1 -4
  183. package/scripts/postinstall.mjs +3 -1
  184. package/skills/audit-code/audit-code.prompt.md +2 -3
  185. package/dist/extractors/graphManifestEdges.d.ts +0 -12
  186. package/dist/extractors/graphManifestEdges.js +0 -1135
package/dist/types.d.ts CHANGED
@@ -1,10 +1,25 @@
1
1
  import type { Finding as SharedFinding } from "@audit-tools/shared";
2
2
  export type Lens = "correctness" | "architecture" | "maintainability" | "security" | "reliability" | "performance" | "data_integrity" | "tests" | "operability" | "config_deployment" | "observability";
3
- /** Canonical list of every valid {@link Lens}. Single source of truth — import
4
- * {@link isLens} / `ALL_LENSES` instead of hand-copying lens lists into local
5
- * guards, which drift (a copy omitting "observability" caused it to be wrongly
6
- * rejected in flow requeue). */
3
+ /** Single authoritative record for one audit lens. `order_weight` governs task
4
+ * priority ordering lower values sort earlier (higher urgency). */
5
+ export interface LensDefinition {
6
+ id: Lens;
7
+ display_name: string;
8
+ /** Lower = higher priority in task ordering. */
9
+ order_weight: number;
10
+ default_enabled: boolean;
11
+ }
12
+ /** Single source of truth for all lens metadata. Adding or renaming a lens
13
+ * requires a single edit here; `ALL_LENSES`, `ENABLED_LENSES`, and
14
+ * `LENS_ORDER` (in auditTaskUtils) are all derived from this registry. */
15
+ export declare const LENS_REGISTRY: readonly LensDefinition[];
16
+ /** Canonical list of every valid {@link Lens}. Derived from {@link LENS_REGISTRY}
17
+ * — import {@link isLens} / `ALL_LENSES` instead of hand-copying lens lists into
18
+ * local guards, which drift (a copy omitting "observability" caused it to be
19
+ * wrongly rejected in flow requeue). */
7
20
  export declare const ALL_LENSES: readonly Lens[];
21
+ /** Lenses enabled by default (all entries in the registry with default_enabled true). */
22
+ export declare const ENABLED_LENSES: readonly Lens[];
8
23
  export declare function isLens(value: unknown): value is Lens;
9
24
  export interface FileRecord {
10
25
  path: string;
@@ -100,4 +115,6 @@ export interface AuditResult {
100
115
  requires_followup?: boolean;
101
116
  followup_tasks?: string[];
102
117
  verification?: AuditVerification;
118
+ run_id?: string;
119
+ submitted_at?: string;
103
120
  }
package/dist/types.js CHANGED
@@ -1,20 +1,28 @@
1
- /** Canonical list of every valid {@link Lens}. Single source of truth — import
2
- * {@link isLens} / `ALL_LENSES` instead of hand-copying lens lists into local
3
- * guards, which drift (a copy omitting "observability" caused it to be wrongly
4
- * rejected in flow requeue). */
5
- export const ALL_LENSES = [
6
- "correctness",
7
- "architecture",
8
- "maintainability",
9
- "security",
10
- "reliability",
11
- "performance",
12
- "data_integrity",
13
- "tests",
14
- "operability",
15
- "config_deployment",
16
- "observability",
1
+ /** Single source of truth for all lens metadata. Adding or renaming a lens
2
+ * requires a single edit here; `ALL_LENSES`, `ENABLED_LENSES`, and
3
+ * `LENS_ORDER` (in auditTaskUtils) are all derived from this registry. */
4
+ export const LENS_REGISTRY = [
5
+ { id: "security", display_name: "Security", order_weight: 10, default_enabled: true },
6
+ { id: "correctness", display_name: "Correctness", order_weight: 20, default_enabled: true },
7
+ { id: "reliability", display_name: "Reliability", order_weight: 30, default_enabled: true },
8
+ { id: "data_integrity", display_name: "Data Integrity", order_weight: 40, default_enabled: true },
9
+ { id: "performance", display_name: "Performance", order_weight: 50, default_enabled: true },
10
+ { id: "architecture", display_name: "Architecture", order_weight: 60, default_enabled: true },
11
+ { id: "operability", display_name: "Operability", order_weight: 70, default_enabled: true },
12
+ { id: "config_deployment", display_name: "Config & Deployment", order_weight: 80, default_enabled: true },
13
+ { id: "observability", display_name: "Observability", order_weight: 90, default_enabled: true },
14
+ { id: "maintainability", display_name: "Maintainability", order_weight: 100, default_enabled: true },
15
+ { id: "tests", display_name: "Tests", order_weight: 110, default_enabled: true },
17
16
  ];
17
+ /** Canonical list of every valid {@link Lens}. Derived from {@link LENS_REGISTRY}
18
+ * — import {@link isLens} / `ALL_LENSES` instead of hand-copying lens lists into
19
+ * local guards, which drift (a copy omitting "observability" caused it to be
20
+ * wrongly rejected in flow requeue). */
21
+ export const ALL_LENSES = LENS_REGISTRY.map((d) => d.id);
22
+ /** Lenses enabled by default (all entries in the registry with default_enabled true). */
23
+ export const ENABLED_LENSES = LENS_REGISTRY
24
+ .filter((d) => d.default_enabled)
25
+ .map((d) => d.id);
18
26
  export function isLens(value) {
19
27
  return (typeof value === "string" && ALL_LENSES.includes(value));
20
28
  }
@@ -261,5 +261,8 @@ export function validateArtifactBundle(bundle) {
261
261
  }
262
262
  }
263
263
  }
264
+ if (issues.length > 0) {
265
+ process.stderr.write(`[artifact-bundle validation] ${issues.length} issue(s)\n`);
266
+ }
264
267
  return issues;
265
268
  }
@@ -589,7 +589,8 @@ export function validateAuditResults(results, tasks, options = {}) {
589
589
  if (!isRecord(affected) || !isNonEmptyString(affected.path)) {
590
590
  continue;
591
591
  }
592
- if (!declaredAssignedCoveragePaths.has(affected.path)) {
592
+ const affectedPathNorm = normalizeCoveragePath(affected.path);
593
+ if (!declaredAssignedCoveragePaths.has(affectedPathNorm)) {
593
594
  pushIssue(issues, {
594
595
  result_index: i,
595
596
  task_id: taskId,
@@ -605,7 +606,7 @@ export function validateAuditResults(results, tasks, options = {}) {
605
606
  const end = Number.isInteger(affected.line_end)
606
607
  ? Number(affected.line_end)
607
608
  : start;
608
- if (!coversAffectedSpan(normalizedFileCoverage, affected.path, start, end)) {
609
+ if (!coversAffectedSpan(normalizedFileCoverage, affectedPathNorm, start, end)) {
609
610
  pushIssue(issues, {
610
611
  result_index: i,
611
612
  task_id: taskId,
@@ -618,6 +619,11 @@ export function validateAuditResults(results, tasks, options = {}) {
618
619
  }
619
620
  validateVerification(result.verification, result, task, normalizedFileCoverage, taskId, i, issues);
620
621
  }
622
+ if (issues.length > 0) {
623
+ const errors = issues.filter((i) => i.severity === "error").length;
624
+ const warnings = issues.filter((i) => i.severity === "warning").length;
625
+ process.stderr.write(`[audit-results validation] ${errors} error(s), ${warnings} warning(s) across ${results.length} result(s)\n`);
626
+ }
621
627
  return issues;
622
628
  }
623
629
  export function formatAuditResultIssues(issues) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "auditor-lambda",
3
- "version": "0.10.2",
3
+ "version": "0.10.7",
4
4
  "private": false,
5
5
  "description": "Portable hybrid code-auditing framework for arbitrary repositories.",
6
6
  "type": "module",
@@ -10,7 +10,7 @@
10
10
  "files": [
11
11
  "dist/**",
12
12
  "audit-code.mjs",
13
- "audit-code-wrapper-lib.mjs",
13
+ "audit-code-wrapper-*.mjs",
14
14
  "dispatch/**",
15
15
  "schemas/**",
16
16
  "skills/audit-code/**",
@@ -24,6 +24,10 @@
24
24
  "type": "object",
25
25
  "additionalProperties": { "type": "integer", "minimum": 0 }
26
26
  },
27
+ "lens_breakdown": {
28
+ "type": "object",
29
+ "additionalProperties": { "type": "integer", "minimum": 0 }
30
+ },
27
31
  "audited_file_count": { "type": "integer", "minimum": 0 },
28
32
  "excluded_file_count": { "type": "integer", "minimum": 0 },
29
33
  "budget_deferred_task_count": { "type": "integer", "minimum": 0 },
@@ -58,7 +62,7 @@
58
62
  "enum": ["critical", "high", "medium", "low", "info"]
59
63
  },
60
64
  "confidence": { "type": "string", "enum": ["high", "medium", "low"] },
61
- "lens": { "type": "string", "enum": ["correctness", "architecture", "maintainability", "security", "reliability", "performance", "data_integrity", "tests", "operability", "config_deployment", "observability"] },
65
+ "lens": { "$ref": "lens.schema.json" },
62
66
  "summary": { "type": "string" },
63
67
  "affected_files": {
64
68
  "type": "array",
@@ -341,7 +341,7 @@
341
341
  "minimum": 0
342
342
  }
343
343
  },
344
- "additionalProperties": false
344
+ "additionalProperties": { "type": "integer", "minimum": 0 }
345
345
  }
346
346
  }
347
347
  }
@@ -23,10 +23,7 @@
23
23
  "task_id": { "type": "string" },
24
24
  "unit_id": { "type": "string" },
25
25
  "pass_id": { "type": "string" },
26
- "lens": {
27
- "type": "string",
28
- "enum": ["correctness", "architecture", "maintainability", "security", "reliability", "performance", "data_integrity", "tests", "operability", "config_deployment", "observability"]
29
- },
26
+ "lens": { "$ref": "lens.schema.json" },
30
27
  "agent_role": { "type": "string" },
31
28
  "file_coverage": {
32
29
  "type": "array",
@@ -52,7 +49,7 @@
52
49
  "requires_followup": { "type": "boolean" },
53
50
  "followup_tasks": {
54
51
  "type": "array",
55
- "items": { "type": "string" }
52
+ "items": { "$ref": "#/$defs/AuditTask" }
56
53
  },
57
54
  "verification": {
58
55
  "type": "object",
@@ -78,7 +75,9 @@
78
75
  }
79
76
  },
80
77
  "additionalProperties": false
81
- }
78
+ },
79
+ "run_id": { "type": "string" },
80
+ "submitted_at": { "type": "string", "format": "date-time" }
82
81
  },
83
82
  "additionalProperties": false
84
83
  }
@@ -15,10 +15,7 @@
15
15
  "task_id": { "type": "string" },
16
16
  "unit_id": { "type": "string" },
17
17
  "pass_id": { "type": "string" },
18
- "lens": {
19
- "type": "string",
20
- "enum": ["correctness", "architecture", "maintainability", "security", "reliability", "performance", "data_integrity", "tests", "operability", "config_deployment", "observability"]
21
- },
18
+ "lens": { "$ref": "lens.schema.json" },
22
19
  "file_paths": {
23
20
  "type": "array",
24
21
  "minItems": 1,
@@ -35,7 +35,7 @@
35
35
  },
36
36
  "suggested_lenses": {
37
37
  "type": "array",
38
- "items": { "type": "string" }
38
+ "items": { "$ref": "lens.schema.json" }
39
39
  },
40
40
  "suggested_runtime_checks": {
41
41
  "type": "array",
@@ -26,17 +26,11 @@
26
26
  },
27
27
  "required_lenses": {
28
28
  "type": "array",
29
- "items": {
30
- "type": "string",
31
- "enum": ["correctness", "architecture", "maintainability", "security", "reliability", "performance", "data_integrity", "tests", "operability", "config_deployment", "observability"]
32
- }
29
+ "items": { "$ref": "lens.schema.json" }
33
30
  },
34
31
  "completed_lenses": {
35
32
  "type": "array",
36
- "items": {
37
- "type": "string",
38
- "enum": ["correctness", "architecture", "maintainability", "security", "reliability", "performance", "data_integrity", "tests", "operability", "config_deployment", "observability"]
39
- }
33
+ "items": { "$ref": "lens.schema.json" }
40
34
  }
41
35
  },
42
36
  "additionalProperties": false
@@ -23,22 +23,7 @@
23
23
  "enum": ["critical", "high", "medium", "low", "info"]
24
24
  },
25
25
  "confidence": { "type": "string", "enum": ["high", "medium", "low"] },
26
- "lens": {
27
- "type": "string",
28
- "enum": [
29
- "correctness",
30
- "architecture",
31
- "maintainability",
32
- "security",
33
- "reliability",
34
- "performance",
35
- "data_integrity",
36
- "tests",
37
- "operability",
38
- "config_deployment",
39
- "observability"
40
- ]
41
- },
26
+ "lens": { "$ref": "lens.schema.json" },
42
27
  "summary": { "type": "string" },
43
28
  "affected_files": {
44
29
  "type": "array",
@@ -50,7 +35,8 @@
50
35
  "path": { "type": "string" },
51
36
  "line_start": { "type": "integer", "minimum": 1 },
52
37
  "line_end": { "type": "integer", "minimum": 1 },
53
- "symbol": { "type": "string" }
38
+ "symbol": { "type": "string" },
39
+ "hash_at_plan_time": { "type": "string" }
54
40
  },
55
41
  "additionalProperties": false
56
42
  }
@@ -24,17 +24,11 @@
24
24
  },
25
25
  "required_lenses": {
26
26
  "type": "array",
27
- "items": {
28
- "type": "string",
29
- "enum": ["correctness", "architecture", "maintainability", "security", "reliability", "performance", "data_integrity", "tests", "operability", "config_deployment", "observability"]
30
- }
27
+ "items": { "$ref": "lens.schema.json" }
31
28
  },
32
29
  "completed_lenses": {
33
30
  "type": "array",
34
- "items": {
35
- "type": "string",
36
- "enum": ["correctness", "architecture", "maintainability", "security", "reliability", "performance", "data_integrity", "tests", "operability", "config_deployment", "observability"]
37
- }
31
+ "items": { "$ref": "lens.schema.json" }
38
32
  },
39
33
  "status": {
40
34
  "type": "string",
@@ -113,6 +113,37 @@
113
113
  },
114
114
  "additionalProperties": false
115
115
  }
116
+ },
117
+ "heuristics": {
118
+ "type": "array",
119
+ "items": {
120
+ "type": "object",
121
+ "required": ["from", "to"],
122
+ "properties": {
123
+ "from": { "type": "string" },
124
+ "to": { "type": "string" },
125
+ "kind": {
126
+ "type": "string",
127
+ "description": "Heuristic edge kind from path/co-location analysis (e.g. 'heuristic-container-edge', 'heuristic-auth-session-link')."
128
+ },
129
+ "direction": {
130
+ "type": "string",
131
+ "enum": ["directed", "undirected"],
132
+ "description": "Whether the edge should be interpreted as directional."
133
+ },
134
+ "confidence": {
135
+ "type": "number",
136
+ "minimum": 0,
137
+ "maximum": 1,
138
+ "description": "Extractor confidence for graph-informed planning."
139
+ },
140
+ "reason": {
141
+ "type": "string",
142
+ "description": "Short explanation of why the edge exists."
143
+ }
144
+ },
145
+ "additionalProperties": false
146
+ }
116
147
  }
117
148
  },
118
149
  "additionalProperties": false
@@ -0,0 +1,7 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "lens.schema.json",
4
+ "title": "Lens",
5
+ "type": "string",
6
+ "enum": ["correctness", "architecture", "maintainability", "security", "reliability", "performance", "data_integrity", "tests", "operability", "config_deployment", "observability"]
7
+ }
@@ -7,22 +7,6 @@
7
7
  "$ref": "#/$defs/reviewPacket"
8
8
  },
9
9
  "$defs": {
10
- "lens": {
11
- "type": "string",
12
- "enum": [
13
- "correctness",
14
- "architecture",
15
- "maintainability",
16
- "security",
17
- "reliability",
18
- "performance",
19
- "data_integrity",
20
- "tests",
21
- "operability",
22
- "config_deployment",
23
- "observability"
24
- ]
25
- },
26
10
  "priority": {
27
11
  "type": "string",
28
12
  "enum": ["high", "medium", "low"]
@@ -34,6 +18,11 @@
34
18
  "from": { "type": "string" },
35
19
  "to": { "type": "string" },
36
20
  "kind": { "type": "string" },
21
+ "direction": {
22
+ "type": "string",
23
+ "enum": ["directed", "undirected"],
24
+ "description": "Whether the edge should be interpreted as directional."
25
+ },
37
26
  "confidence": {
38
27
  "type": "number",
39
28
  "minimum": 0,
@@ -108,7 +97,7 @@
108
97
  "lenses": {
109
98
  "type": "array",
110
99
  "minItems": 1,
111
- "items": { "$ref": "#/$defs/lens" }
100
+ "items": { "$ref": "lens.schema.json" }
112
101
  },
113
102
  "file_paths": {
114
103
  "type": "array",
@@ -37,7 +37,7 @@
37
37
  "enum": ["ready", "blocked", "complete"]
38
38
  },
39
39
  "prompt_path": { "type": "string" },
40
- "run_id": { "type": ["string", "null"] },
40
+ "run_id": { "type": ["string", "null"], "description": "Identifies the active dispatch run. Null when no dispatch run is in progress (e.g., blocked, present_report, intake, synthesis, and other non-dispatch step kinds)." },
41
41
  "progress": {
42
42
  "type": "object",
43
43
  "required": ["summary"],
@@ -46,7 +46,13 @@
46
46
  "pending_packets": { "type": "integer" },
47
47
  "pending_tasks": { "type": "integer" },
48
48
  "completed_tasks": { "type": "integer" },
49
- "wave_size": { "type": "integer" }
49
+ "wave_size": { "type": "integer" },
50
+ "phase": { "type": "string", "enum": ["canary", "fan_out"] },
51
+ "canary_packet_id": { "type": ["string", "null"] },
52
+ "agent_count": { "type": "integer" },
53
+ "wave_count": { "type": "integer" },
54
+ "confirmation_recommended": { "type": "boolean" },
55
+ "dispatch_summary": { "type": "string" }
50
56
  },
51
57
  "additionalProperties": false
52
58
  },
@@ -27,10 +27,7 @@
27
27
  "required_lenses": {
28
28
  "type": "array",
29
29
  "minItems": 1,
30
- "items": {
31
- "type": "string",
32
- "enum": ["correctness", "architecture", "maintainability", "security", "reliability", "performance", "data_integrity", "tests", "operability", "config_deployment", "observability"]
33
- }
30
+ "items": { "$ref": "lens.schema.json" }
34
31
  },
35
32
  "critical_flows": {
36
33
  "type": "array",
@@ -36,6 +36,8 @@ function writeGeneratedFile(path, content) {
36
36
  return action;
37
37
  }
38
38
 
39
+ const OPENCODE_AUDIT_EXTERNAL_DIRECTORY_PERMISSION = { '*': 'allow' };
40
+
39
41
  const OPENCODE_AUDIT_EDIT_PERMISSION = {
40
42
  '*': 'ask',
41
43
  '.audit-code/**': 'allow',
@@ -143,7 +145,7 @@ function mergeOpenCodePermissionConfig(existingPermission, generatedPermission)
143
145
  external_directory: mergeOpenCodePermissionRule(
144
146
  existingPermission.external_directory,
145
147
  generatedPermission.external_directory,
146
- generatedPermission.external_directory,
148
+ OPENCODE_AUDIT_EXTERNAL_DIRECTORY_PERMISSION,
147
149
  ),
148
150
  edit: mergeOpenCodePermissionRule(
149
151
  existingPermission.edit,
@@ -59,9 +59,8 @@ If the returned step is a dispatch step, before launching subagents check
59
59
 
60
60
  After the **first** `next-step` (the intake step) completes, confirm the audit
61
61
  scope before proceeding. Read `scope_summary.json` from the `.audit-artifacts/`
62
- directory (if absent, extract the JSON that follows the `SCOPE_SUMMARY:` marker
63
- at the start of the step's `progress_summary`). It contains `repo_root`,
64
- `auditable_file_count`, `git_available`, and `mis_scope_smells`. Then:
62
+ directory. It contains `repo_root`, `auditable_file_count`, `git_available`, and
63
+ `mis_scope_smells`. Then:
65
64
 
66
65
  - Echo one informational line to the user:
67
66
  `Auditing <repo_root>, <auditable_file_count> files, git: <yes|no>`.
@@ -1,12 +0,0 @@
1
- import type { GraphEdge } from "@audit-tools/shared";
2
- import { isCargoManifestPath, isGoWorkspaceManifestPath, isMavenPomPath, isPyprojectPath } from "./graphPathUtils.js";
3
- export { isCargoManifestPath, isGoWorkspaceManifestPath, isMavenPomPath, isPyprojectPath, };
4
- export declare function extractPackageEntrypointEdges(fromPath: string, content: string, pathLookup: Map<string, string>): GraphEdge[];
5
- export declare function extractPackageScriptEdges(fromPath: string, content: string, pathLookup: Map<string, string>): GraphEdge[];
6
- export declare function extractWorkspacePackageEdges(fromPath: string, content: string, pathLookup: Map<string, string>): GraphEdge[];
7
- export declare function extractCargoWorkspaceMemberEdges(fromPath: string, content: string, pathLookup: Map<string, string>): GraphEdge[];
8
- export declare function extractTypescriptProjectReferenceEdges(fromPath: string, content: string, pathLookup: Map<string, string>): GraphEdge[];
9
- export declare function extractGoWorkspaceModuleEdges(fromPath: string, content: string, pathLookup: Map<string, string>): GraphEdge[];
10
- export declare function extractMavenModuleEdges(fromPath: string, content: string, pathLookup: Map<string, string>): GraphEdge[];
11
- export declare function extractPyprojectTestpathLinks(fromPath: string, content: string, pathLookup: Map<string, string>): GraphEdge[];
12
- export declare function extractYamlPathReferenceEdges(fromPath: string, content: string, pathLookup: Map<string, string>): GraphEdge[];