audit-tools 0.45.0 → 0.48.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 (288) hide show
  1. package/README.md +51 -18
  2. package/dispatch/merge-results.mjs +3 -3
  3. package/dispatch/validate-result.mjs +3 -3
  4. package/dist/audit/cli/charterExtractionPrompt.d.ts.map +1 -1
  5. package/dist/audit/cli/charterExtractionPrompt.js +11 -1
  6. package/dist/audit/cli/charterExtractionPrompt.js.map +1 -1
  7. package/dist/audit/cli/cleanupCommand.d.ts +25 -0
  8. package/dist/audit/cli/cleanupCommand.d.ts.map +1 -1
  9. package/dist/audit/cli/cleanupCommand.js +76 -1
  10. package/dist/audit/cli/cleanupCommand.js.map +1 -1
  11. package/dist/audit/cli/dispatch/hostHandoff.d.ts.map +1 -1
  12. package/dist/audit/cli/dispatch/hostHandoff.js +52 -76
  13. package/dist/audit/cli/dispatch/hostHandoff.js.map +1 -1
  14. package/dist/audit/cli/dispatch/packetFilter.d.ts +1 -1
  15. package/dist/audit/cli/fanoutLanes.d.ts.map +1 -1
  16. package/dist/audit/cli/fanoutLanes.js +6 -1
  17. package/dist/audit/cli/fanoutLanes.js.map +1 -1
  18. package/dist/audit/cli/laneSubmissions.d.ts +13 -0
  19. package/dist/audit/cli/laneSubmissions.d.ts.map +1 -1
  20. package/dist/audit/cli/laneSubmissions.js +38 -27
  21. package/dist/audit/cli/laneSubmissions.js.map +1 -1
  22. package/dist/audit/cli/nextStepCommand.d.ts +12 -0
  23. package/dist/audit/cli/nextStepCommand.d.ts.map +1 -1
  24. package/dist/audit/cli/nextStepCommand.js +23 -12
  25. package/dist/audit/cli/nextStepCommand.js.map +1 -1
  26. package/dist/audit/cli/nextStepHelpers.d.ts +3 -2
  27. package/dist/audit/cli/nextStepHelpers.d.ts.map +1 -1
  28. package/dist/audit/cli/nextStepHelpers.js +65 -37
  29. package/dist/audit/cli/nextStepHelpers.js.map +1 -1
  30. package/dist/audit/cli/reviewRun.d.ts +1 -1
  31. package/dist/audit/cli/reviewRun.d.ts.map +1 -1
  32. package/dist/audit/cli/reviewRun.js +2 -9
  33. package/dist/audit/cli/reviewRun.js.map +1 -1
  34. package/dist/audit/cli/sampleRunCommand.d.ts +215 -0
  35. package/dist/audit/cli/sampleRunCommand.d.ts.map +1 -1
  36. package/dist/audit/cli/sampleRunCommand.js +60 -3
  37. package/dist/audit/cli/sampleRunCommand.js.map +1 -1
  38. package/dist/audit/cli/semanticReviewStep.d.ts.map +1 -1
  39. package/dist/audit/cli/semanticReviewStep.js +9 -1
  40. package/dist/audit/cli/semanticReviewStep.js.map +1 -1
  41. package/dist/audit/cli/steps.d.ts +6 -6
  42. package/dist/audit/contracts/workerSchemas.d.ts +36 -26
  43. package/dist/audit/contracts/workerSchemas.d.ts.map +1 -1
  44. package/dist/audit/contracts/workerSchemas.js +11 -1
  45. package/dist/audit/contracts/workerSchemas.js.map +1 -1
  46. package/dist/audit/contracts/wrapperResponse.d.ts +52 -28
  47. package/dist/audit/contracts/wrapperResponse.d.ts.map +1 -1
  48. package/dist/audit/contracts/wrapperResponse.js +8 -5
  49. package/dist/audit/contracts/wrapperResponse.js.map +1 -1
  50. package/dist/audit/decompose/sources.d.ts.map +1 -1
  51. package/dist/audit/decompose/sources.js +21 -5
  52. package/dist/audit/decompose/sources.js.map +1 -1
  53. package/dist/audit/extractors/analyzers/registry.d.ts +8 -5
  54. package/dist/audit/extractors/analyzers/registry.d.ts.map +1 -1
  55. package/dist/audit/extractors/analyzers/registry.js +28 -7
  56. package/dist/audit/extractors/analyzers/registry.js.map +1 -1
  57. package/dist/audit/extractors/designAssessment.js +1 -1
  58. package/dist/audit/extractors/gitHistory.d.ts +1 -1
  59. package/dist/audit/extractors/gitHistory.js +1 -1
  60. package/dist/audit/extractors/graph.d.ts +1 -1
  61. package/dist/audit/extractors/graph.js +1 -1
  62. package/dist/audit/extractors/risk.d.ts +1 -1
  63. package/dist/audit/extractors/risk.js +1 -1
  64. package/dist/audit/io/artifacts.d.ts.map +1 -1
  65. package/dist/audit/io/artifacts.js +5 -5
  66. package/dist/audit/io/artifacts.js.map +1 -1
  67. package/dist/audit/orchestrator/acquisitionExecutor.d.ts +12 -7
  68. package/dist/audit/orchestrator/acquisitionExecutor.d.ts.map +1 -1
  69. package/dist/audit/orchestrator/acquisitionExecutor.js +1 -1
  70. package/dist/audit/orchestrator/acquisitionExecutor.js.map +1 -1
  71. package/dist/audit/orchestrator/advance.d.ts +14 -10
  72. package/dist/audit/orchestrator/advance.d.ts.map +1 -1
  73. package/dist/audit/orchestrator/advance.js +49 -24
  74. package/dist/audit/orchestrator/advance.js.map +1 -1
  75. package/dist/audit/orchestrator/advanceTypes.d.ts +14 -0
  76. package/dist/audit/orchestrator/advanceTypes.d.ts.map +1 -1
  77. package/dist/audit/orchestrator/autoFixExecutor.d.ts +20 -1
  78. package/dist/audit/orchestrator/autoFixExecutor.d.ts.map +1 -1
  79. package/dist/audit/orchestrator/autoFixExecutor.js +77 -15
  80. package/dist/audit/orchestrator/autoFixExecutor.js.map +1 -1
  81. package/dist/audit/orchestrator/dependencyMap.js +1 -1
  82. package/dist/audit/orchestrator/dependencyMap.js.map +1 -1
  83. package/dist/audit/orchestrator/designReviewPrompt.d.ts.map +1 -1
  84. package/dist/audit/orchestrator/designReviewPrompt.js +7 -0
  85. package/dist/audit/orchestrator/designReviewPrompt.js.map +1 -1
  86. package/dist/audit/orchestrator/executorRunners.d.ts.map +1 -1
  87. package/dist/audit/orchestrator/executorRunners.js +18 -4
  88. package/dist/audit/orchestrator/executorRunners.js.map +1 -1
  89. package/dist/audit/orchestrator/executors.d.ts +54 -0
  90. package/dist/audit/orchestrator/executors.d.ts.map +1 -1
  91. package/dist/audit/orchestrator/executors.js +352 -0
  92. package/dist/audit/orchestrator/executors.js.map +1 -1
  93. package/dist/audit/orchestrator/hostInputPause.d.ts +28 -13
  94. package/dist/audit/orchestrator/hostInputPause.d.ts.map +1 -1
  95. package/dist/audit/orchestrator/hostInputPause.js +17 -11
  96. package/dist/audit/orchestrator/hostInputPause.js.map +1 -1
  97. package/dist/audit/orchestrator/intentInterpreter.d.ts +15 -18
  98. package/dist/audit/orchestrator/intentInterpreter.d.ts.map +1 -1
  99. package/dist/audit/orchestrator/intentInterpreter.js +12 -26
  100. package/dist/audit/orchestrator/intentInterpreter.js.map +1 -1
  101. package/dist/audit/orchestrator/localCommands.d.ts +24 -1
  102. package/dist/audit/orchestrator/localCommands.d.ts.map +1 -1
  103. package/dist/audit/orchestrator/localCommands.js +44 -9
  104. package/dist/audit/orchestrator/localCommands.js.map +1 -1
  105. package/dist/audit/orchestrator/nextStep.d.ts +13 -0
  106. package/dist/audit/orchestrator/nextStep.d.ts.map +1 -1
  107. package/dist/audit/orchestrator/nextStep.js +13 -0
  108. package/dist/audit/orchestrator/nextStep.js.map +1 -1
  109. package/dist/audit/orchestrator/requeueCommand.d.ts +1 -1
  110. package/dist/audit/orchestrator/runtimeCommand.d.ts +32 -1
  111. package/dist/audit/orchestrator/runtimeCommand.d.ts.map +1 -1
  112. package/dist/audit/orchestrator/runtimeCommand.js +90 -3
  113. package/dist/audit/orchestrator/runtimeCommand.js.map +1 -1
  114. package/dist/audit/orchestrator/structureExecutors.js +1 -1
  115. package/dist/audit/orchestrator/structureExecutors.js.map +1 -1
  116. package/dist/audit/orchestrator/syntaxResolutionExecutor.d.ts +11 -1
  117. package/dist/audit/orchestrator/syntaxResolutionExecutor.d.ts.map +1 -1
  118. package/dist/audit/orchestrator/syntaxResolutionExecutor.js +25 -9
  119. package/dist/audit/orchestrator/syntaxResolutionExecutor.js.map +1 -1
  120. package/dist/audit/supervisor/operatorHandoff.d.ts +0 -1
  121. package/dist/audit/supervisor/operatorHandoff.d.ts.map +1 -1
  122. package/dist/audit/supervisor/operatorHandoff.js +2 -1
  123. package/dist/audit/supervisor/operatorHandoff.js.map +1 -1
  124. package/dist/audit/types.d.ts +18 -18
  125. package/dist/remediate/contractPipeline/derive.d.ts.map +1 -1
  126. package/dist/remediate/contractPipeline/derive.js +1 -0
  127. package/dist/remediate/contractPipeline/derive.js.map +1 -1
  128. package/dist/remediate/contractPipeline/semanticProjection.d.ts +5 -4
  129. package/dist/remediate/contractPipeline/semanticProjection.d.ts.map +1 -1
  130. package/dist/remediate/contractPipeline/semanticProjection.js +34 -19
  131. package/dist/remediate/contractPipeline/semanticProjection.js.map +1 -1
  132. package/dist/remediate/index.d.ts.map +1 -1
  133. package/dist/remediate/index.js +3 -2
  134. package/dist/remediate/index.js.map +1 -1
  135. package/dist/remediate/intake.js +1 -1
  136. package/dist/remediate/intake.js.map +1 -1
  137. package/dist/remediate/phases/close.d.ts +45 -2
  138. package/dist/remediate/phases/close.d.ts.map +1 -1
  139. package/dist/remediate/phases/close.js +111 -43
  140. package/dist/remediate/phases/close.js.map +1 -1
  141. package/dist/remediate/phases/closeVerifyAnalyzerLeads.js +2 -2
  142. package/dist/remediate/phases/closeVerifyAnalyzerLeads.js.map +1 -1
  143. package/dist/remediate/phases/triage.d.ts.map +1 -1
  144. package/dist/remediate/phases/triage.js +61 -19
  145. package/dist/remediate/phases/triage.js.map +1 -1
  146. package/dist/remediate/review/autonomousGate.d.ts +3 -7
  147. package/dist/remediate/review/autonomousGate.d.ts.map +1 -1
  148. package/dist/remediate/review/autonomousGate.js +10 -24
  149. package/dist/remediate/review/autonomousGate.js.map +1 -1
  150. package/dist/remediate/riskSignal.d.ts +8 -20
  151. package/dist/remediate/riskSignal.d.ts.map +1 -1
  152. package/dist/remediate/riskSignal.js +21 -76
  153. package/dist/remediate/riskSignal.js.map +1 -1
  154. package/dist/remediate/state/accessMemory.d.ts +2 -3
  155. package/dist/remediate/state/accessMemory.d.ts.map +1 -1
  156. package/dist/remediate/state/accessMemory.js +3 -6
  157. package/dist/remediate/state/accessMemory.js.map +1 -1
  158. package/dist/remediate/state/store.d.ts +6 -7
  159. package/dist/remediate/state/store.d.ts.map +1 -1
  160. package/dist/remediate/state/store.js.map +1 -1
  161. package/dist/remediate/state/types.d.ts +2 -84
  162. package/dist/remediate/state/types.d.ts.map +1 -1
  163. package/dist/remediate/state/types.js +1 -39
  164. package/dist/remediate/state/types.js.map +1 -1
  165. package/dist/remediate/steps/contractPipeline.d.ts +13 -19
  166. package/dist/remediate/steps/contractPipeline.d.ts.map +1 -1
  167. package/dist/remediate/steps/contractPipeline.js +157 -66
  168. package/dist/remediate/steps/contractPipeline.js.map +1 -1
  169. package/dist/remediate/steps/dispatch/hostHandoff.d.ts +1 -1
  170. package/dist/remediate/steps/dispatch/hostHandoff.d.ts.map +1 -1
  171. package/dist/remediate/steps/dispatch/hostHandoff.js +297 -141
  172. package/dist/remediate/steps/dispatch/hostHandoff.js.map +1 -1
  173. package/dist/remediate/steps/nextStep.d.ts +16 -7
  174. package/dist/remediate/steps/nextStep.d.ts.map +1 -1
  175. package/dist/remediate/steps/nextStep.js +207 -216
  176. package/dist/remediate/steps/nextStep.js.map +1 -1
  177. package/dist/remediate/steps/stepUtils.d.ts +10 -2
  178. package/dist/remediate/steps/stepUtils.d.ts.map +1 -1
  179. package/dist/remediate/steps/stepUtils.js +13 -3
  180. package/dist/remediate/steps/stepUtils.js.map +1 -1
  181. package/dist/remediate/steps/types.d.ts +1 -1
  182. package/dist/remediate/steps/types.d.ts.map +1 -1
  183. package/dist/remediate/steps/types.js.map +1 -1
  184. package/dist/remediate/types/options.d.ts +1 -1
  185. package/dist/remediate/validation/artifacts.d.ts.map +1 -1
  186. package/dist/remediate/validation/artifacts.js +1 -16
  187. package/dist/remediate/validation/artifacts.js.map +1 -1
  188. package/dist/remediate/validation/remediationState.d.ts +0 -1
  189. package/dist/remediate/validation/remediationState.d.ts.map +1 -1
  190. package/dist/remediate/validation/remediationState.js +0 -51
  191. package/dist/remediate/validation/remediationState.js.map +1 -1
  192. package/dist/shared/analyzerPolicy.d.ts +18 -6
  193. package/dist/shared/analyzerPolicy.d.ts.map +1 -1
  194. package/dist/shared/analyzerPolicy.js +15 -3
  195. package/dist/shared/analyzerPolicy.js.map +1 -1
  196. package/dist/shared/analyzers/acquisitionEngine.d.ts +71 -32
  197. package/dist/shared/analyzers/acquisitionEngine.d.ts.map +1 -1
  198. package/dist/shared/analyzers/acquisitionEngine.js +86 -28
  199. package/dist/shared/analyzers/acquisitionEngine.js.map +1 -1
  200. package/dist/shared/analyzers/binaryAcquisition.d.ts +8 -2
  201. package/dist/shared/analyzers/binaryAcquisition.d.ts.map +1 -1
  202. package/dist/shared/analyzers/binaryAcquisition.js +4 -4
  203. package/dist/shared/analyzers/binaryAcquisition.js.map +1 -1
  204. package/dist/shared/constitutionalDocPaths.d.ts.map +1 -1
  205. package/dist/shared/constitutionalDocPaths.js +7 -0
  206. package/dist/shared/constitutionalDocPaths.js.map +1 -1
  207. package/dist/shared/engine/obligationEngine.d.ts +44 -3
  208. package/dist/shared/engine/obligationEngine.d.ts.map +1 -1
  209. package/dist/shared/engine/obligationEngine.js +53 -7
  210. package/dist/shared/engine/obligationEngine.js.map +1 -1
  211. package/dist/shared/findings/dedupe.d.ts.map +1 -1
  212. package/dist/shared/findings/dedupe.js +8 -0
  213. package/dist/shared/findings/dedupe.js.map +1 -1
  214. package/dist/shared/friction/frictionRecord.d.ts +42 -2
  215. package/dist/shared/friction/frictionRecord.d.ts.map +1 -1
  216. package/dist/shared/friction/frictionRecord.js +111 -3
  217. package/dist/shared/friction/frictionRecord.js.map +1 -1
  218. package/dist/shared/friction/triage.d.ts +15 -0
  219. package/dist/shared/friction/triage.d.ts.map +1 -1
  220. package/dist/shared/friction/triage.js +33 -2
  221. package/dist/shared/friction/triage.js.map +1 -1
  222. package/dist/shared/index.d.ts +15 -9
  223. package/dist/shared/index.d.ts.map +1 -1
  224. package/dist/shared/index.js +15 -7
  225. package/dist/shared/index.js.map +1 -1
  226. package/dist/shared/intent/constraintClauses.d.ts +31 -0
  227. package/dist/shared/intent/constraintClauses.d.ts.map +1 -0
  228. package/dist/shared/intent/constraintClauses.js +37 -0
  229. package/dist/shared/intent/constraintClauses.js.map +1 -0
  230. package/dist/shared/io/fileLock.d.ts.map +1 -1
  231. package/dist/shared/io/fileLock.js +22 -3
  232. package/dist/shared/io/fileLock.js.map +1 -1
  233. package/dist/shared/io/frictionCapture.d.ts +73 -19
  234. package/dist/shared/io/frictionCapture.d.ts.map +1 -1
  235. package/dist/shared/io/frictionCapture.js +21 -30
  236. package/dist/shared/io/frictionCapture.js.map +1 -1
  237. package/dist/shared/io/lockedJsonStore.d.ts +24 -3
  238. package/dist/shared/io/lockedJsonStore.d.ts.map +1 -1
  239. package/dist/shared/io/lockedJsonStore.js +35 -7
  240. package/dist/shared/io/lockedJsonStore.js.map +1 -1
  241. package/dist/shared/io/stepContractWriter.d.ts +3 -3
  242. package/dist/shared/io/stepContractWriter.d.ts.map +1 -1
  243. package/dist/shared/io/stepContractWriter.js +97 -13
  244. package/dist/shared/io/stepContractWriter.js.map +1 -1
  245. package/dist/shared/submission/expectedSubmissions.d.ts +18 -0
  246. package/dist/shared/submission/expectedSubmissions.d.ts.map +1 -1
  247. package/dist/shared/submission/expectedSubmissions.js +17 -0
  248. package/dist/shared/submission/expectedSubmissions.js.map +1 -1
  249. package/dist/shared/submission/handRecovery.d.ts.map +1 -1
  250. package/dist/shared/submission/handRecovery.js +9 -11
  251. package/dist/shared/submission/handRecovery.js.map +1 -1
  252. package/dist/shared/submission/hostHandoffCore.d.ts +155 -0
  253. package/dist/shared/submission/hostHandoffCore.d.ts.map +1 -0
  254. package/dist/shared/submission/hostHandoffCore.js +210 -0
  255. package/dist/shared/submission/hostHandoffCore.js.map +1 -0
  256. package/dist/shared/submission/submissionLedger.d.ts +5 -1
  257. package/dist/shared/submission/submissionLedger.d.ts.map +1 -1
  258. package/dist/shared/submission/submissionLedger.js +33 -3
  259. package/dist/shared/submission/submissionLedger.js.map +1 -1
  260. package/dist/shared/tooling/commandShape.d.ts +29 -0
  261. package/dist/shared/tooling/commandShape.d.ts.map +1 -1
  262. package/dist/shared/tooling/commandShape.js +82 -10
  263. package/dist/shared/tooling/commandShape.js.map +1 -1
  264. package/dist/shared/tooling/exec.d.ts +32 -0
  265. package/dist/shared/tooling/exec.d.ts.map +1 -1
  266. package/dist/shared/tooling/exec.js +189 -0
  267. package/dist/shared/tooling/exec.js.map +1 -1
  268. package/docs/audit-pkg/contracts.md +2 -1
  269. package/docs/audit-pkg/operator-guide.md +12 -6
  270. package/docs/audit-pkg/product.md +22 -6
  271. package/package.json +13 -6
  272. package/schemas/audit-code-v1alpha1.schema.json +297 -0
  273. package/schemas/audit_result.schema.json +4 -0
  274. package/schemas/audit_results.schema.json +4 -0
  275. package/scripts/audit/postinstall.mjs +4 -2
  276. package/scripts/postinstall.mjs +1 -1
  277. package/scripts/remediate/postinstall.mjs +3 -1
  278. package/scripts/shared/install-host-assets.mjs +15 -8
  279. package/skills/audit-code/SKILL.md +4 -2
  280. package/skills/audit-code/audit-code.prompt.md +5 -2
  281. package/skills/audit-code/opencode-command-template.txt +1 -1
  282. package/wrapper/audit-code-wrapper-build.mjs +3 -3
  283. package/wrapper/audit-code-wrapper-install-hosts.mjs +3 -3
  284. package/wrapper/audit-code-wrapper-lib.mjs +82 -16
  285. package/wrapper/installer-verb-help.mjs +14 -4
  286. package/wrapper/remediate-code-wrapper-install-hosts.mjs +3 -3
  287. package/docs/audit-pkg/development.md +0 -113
  288. package/docs/audit-pkg/release.md +0 -140
@@ -52,6 +52,18 @@ const VERB_DETAIL = Object.freeze({
52
52
  ],
53
53
  });
54
54
 
55
+ /**
56
+ * One verb's one-line summary, with `{product}` bound to the slash-command the
57
+ * bin installs. The accessor exists so the surface can be RENDERED — the docs
58
+ * that list these verbs read this module rather than restating it, which is how
59
+ * `docs/audit-pkg/product.md` came to omit two of the four.
60
+ */
61
+ export function installerVerbSummary(verb, product) {
62
+ const summary = VERB_SUMMARY[verb];
63
+ if (summary === undefined) throw new Error(`unknown installer verb: ${verb}`);
64
+ return summary.replace('{product}', product);
65
+ }
66
+
55
67
  /** True when `verb` is one of the wrapper-intercepted installer verbs. */
56
68
  export function isInstallerVerb(verb) {
57
69
  return typeof verb === 'string' && INSTALLER_VERBS.includes(verb);
@@ -76,7 +88,7 @@ export function wantsInstallerVerbHelp(argv) {
76
88
  * installs (e.g. `/audit-code`); `usageName` is the bin as the caller invoked it.
77
89
  */
78
90
  export function installerVerbHelp(verb, { usageName, product }) {
79
- const summary = VERB_SUMMARY[verb].replace('{product}', product);
91
+ const summary = installerVerbSummary(verb, product);
80
92
  return [
81
93
  `Usage: node ${usageName} ${verb} [--root PATH] [--quiet]`,
82
94
  '',
@@ -92,7 +104,5 @@ export function installerVerbHelp(verb, { usageName, product }) {
92
104
 
93
105
  /** The one-line summaries, for a bin's top-level help listing. */
94
106
  export function installerVerbSummaries(product) {
95
- return INSTALLER_VERBS.map(
96
- (verb) => `- ${verb} ${VERB_SUMMARY[verb].replace('{product}', product)}`,
97
- );
107
+ return INSTALLER_VERBS.map((verb) => `- ${verb} ${installerVerbSummary(verb, product)}`);
98
108
  }
@@ -406,7 +406,7 @@ export function buildHostCatalog({ root, host, assets }) {
406
406
  steps: definition.steps,
407
407
  };
408
408
  })
409
- .filter(Boolean)
409
+ .filter((entry) => entry !== null)
410
410
  .map((entry) => ({
411
411
  ...entry,
412
412
  primary_path: entry.primary_path,
@@ -918,9 +918,9 @@ export async function verifyInstalledBootstrap(argv) {
918
918
  return;
919
919
  }
920
920
 
921
- const assetPaths = installManifest.asset_paths ?? {};
921
+ const assetPaths = /** @type {any} */ (installManifest).asset_paths ?? {};
922
922
  const hostCatalog = new Map(
923
- (installManifest.hosts ?? []).map((entry) => [entry.host, entry]),
923
+ (/** @type {any} */ (installManifest).hosts ?? []).map((entry) => [entry.host, entry]),
924
924
  );
925
925
  const selectedHosts = requestedHost && requestedHost !== 'all'
926
926
  ? getInstallHostKeys(requestedHost)
@@ -1,113 +0,0 @@
1
- # Development
2
-
3
- ## Repository layout
4
-
5
- - `src/`: implementation code
6
- - `schemas/`: JSON schemas for public and internal artifacts
7
- - `examples/`: validated artifact examples
8
- - `skills/audit-code/`: canonical prompt and skill-facing instructions
9
- - `dispatch/`: standalone result validation and merge helpers
10
- - `tests/`: vitest-based test suite and regression coverage
11
- - `dist/`: build output (gitignored, not checked in) produced by `npm run build` / the `prepack` script;
12
- shipped only in the packed npm tarball
13
-
14
- ## Agent handoff
15
-
16
- Long-term product direction lives in [`product.md`](product.md). Current state + immediate next steps are in
17
- [`HANDOFF.md`](../HANDOFF.md); open work in [`backlog.md`](../backlog.md). There is no
18
- shipped-sprint archive — that history lives in git + project memory.
19
-
20
- ## Build and test
21
-
22
- ```bash
23
- npm install
24
- npm run check
25
- npm test
26
- npx vitest run tests/audit/host-handoff.test.ts
27
- npm run verify:release
28
- ```
29
-
30
- Run `npm install` from the repository root before running build, check, test, or
31
- package-scoped workflows in a fresh clone or git worktree. Missing
32
- `node_modules` can surface as misleading `audit-tools/shared` export or type
33
- errors because dependents may resolve stale compiled `dist/` output.
34
-
35
- The test suite is intentionally contract-heavy. Update tests when changing
36
- schema shape, prompt contracts, host-handoff behavior, installer output, or release
37
- workflow semantics.
38
-
39
- ## Architecture
40
-
41
- The system separates deterministic extraction from bounded LLM judgment: intake, analysis artifacts,
42
- task planning, provider-neutral host workloads, strict result ingestion, and synthesis into
43
- `audit-report.md`. Backend/model selection, concurrency, retries, and transport belong to the host and
44
- are not audit-tools configuration.
45
-
46
- **The ordering has one home** — the `PRIORITY` array in `src/audit/orchestrator/nextStep.ts`, walked by
47
- `decideNextStep`. `src/audit/README.md` carries the conceptual grouping with the disclaimer that `PRIORITY` is
48
- authoritative; read the array for the real sequence. Copies of it have drifted before, which is why
49
- neither this file nor any other keeps a second one.
50
-
51
- Portability rules:
52
-
53
- - tool-specific collectors write tool-agnostic JSON
54
- - prompts consume artifacts and bounded source context
55
- - review work is attributable to files, lenses, passes, and tasks
56
- - coverage gaps are machine-detectable
57
-
58
- `AuditTask` is the coverage identity; `AuditResult[]` is the ingestion contract.
59
-
60
- ## Adding language analyzers
61
-
62
- Language support should be adapter-based. A new analyzer should enrich shared
63
- artifacts instead of inventing a language-specific planning path.
64
-
65
- Avoid adding another bespoke manifest or project-file parser by default. First
66
- ask whether the signal is common in expected repositories, whether it provides
67
- direction or ownership that path heuristics cannot, and whether the same value
68
- could come from a generic analyzer-supplied ownership hint.
69
-
70
- Preferred outputs:
71
-
72
- - graph edges with kind, direction, confidence, and reason
73
- - entrypoints and surfaces
74
- - test-to-source links
75
- - package/module ownership hints, including analyzer-supplied `ownership_roots`
76
- that become `analyzer-ownership-root-link` graph references
77
- - contract-suite links for small JSON Schema, workflow, package-script, or
78
- TypeScript type suites when planner metrics show otherwise weak packets
79
- - external boundary hints
80
- - line counts and anchor summaries for large files
81
-
82
- Keep deep analyzers optional: a repository should still produce useful packets
83
- from manifests, paths, tests, and external analyzer results when a language has
84
- only fallback support. Command-backed analyzers should prove project intent
85
- before running — prefer repo-local config checks (`eslint.config.*`, `.eslintrc*`,
86
- `package.json` `eslintConfig`) over executing a globally installed tool and
87
- parsing its no-config failure.
88
-
89
- Language-agnostic semantic affinity is useful for ranking adjacent context but
90
- should stay low-authority: don't let shared token frequency alone force packet
91
- merges; use it for `boundary_files` or candidate explanations unless a
92
- deterministic edge corroborates the relationship.
93
-
94
- ## Production readiness
95
-
96
- Drive priorities from field trials, not speculation: run representative
97
- repositories through planning, validate the bundle (`audit-code validate`), and
98
- compare `audit_plan_metrics.json` (packet count, weak-packet count, cohesion,
99
- merge/boundary edge kinds) across runs. Promote an extractor or planner change
100
- when those metrics expose a deterministic gap — and prefer improving shared
101
- graph resolution or generic analyzer ownership roots before adding another
102
- ecosystem-specific parser.
103
-
104
- Before treating a build as production-ready, verify the full review loop in one
105
- real host (`next-step` emits the complete workload → the host writes each bound
106
- result → `next-step` ingests them → `validate`), then run the release gate from a clean
107
- checkout (see [`release.md`](release.md) for what `npm run verify:release`
108
- covers and when to run it). Keep runtime command execution covered when
109
- changing it — including the Windows package-manager-shim path (see the Windows
110
- notes in [`operator-guide.md`](operator-guide.md)). If the
111
- final `audit-report.md` cannot be promoted from `.audit-tools/audit/` to
112
- `.audit-tools/audit-report.md` due to local permissions, completion still succeeds and the
113
- pre-promotion copy under `.audit-tools/audit/` is authoritative.
@@ -1,140 +0,0 @@
1
- # Release
2
-
3
- The maintainer land-and-publish flow — release gate, publication, version bumps —
4
- is owned by the ship skill (`.claude/skills/ship/SKILL.md`), including the
5
- generated gate-step list. `npm run release:patch` bumps + tags;
6
- `npm run release:patch:publish` runs the full flow (`release:minor` /
7
- `release:major` variants likewise). Routine CI exercises the
8
- Node majors matrixed in `.github/workflows/*.yml` (the matrix there is
9
- self-describing).
10
-
11
- This page keeps what the skill does not carry: manual host validation, manual
12
- workflow dispatch, trusted-publisher configuration, and troubleshooting.
13
-
14
- ## Host validation — the manual half of the release gate
15
-
16
- The automated half of multi-host validation lives in `npm run verify:hosts`
17
- (wired into `verify:release`): it deploys every host surface into an isolated
18
- temp `$HOME` and re-runs each host's own `verify()` handler from the same
19
- `INSTALL_HOST_DEFINITIONS` table the postinstall deploy uses. That gate catches
20
- *our* drift — a missing, unparseable, or canonical-body-diverged asset — before
21
- publish.
22
-
23
- This checklist covers only what CI **cannot** reach: actually invoking
24
- `/audit-code` inside a GUI host and confirming a host handoff round-trips. A GUI
25
- host can change its asset format or command-rendering out from under us; the
26
- no-drift guard does not see that, so a human runs these rows at release. A failed
27
- row becomes a backlog item.
28
-
29
- Concrete semantic execution is outside the package boundary, so release
30
- validation covers workload emission and result ingestion rather than a matrix
31
- of execution backends.
32
-
33
- ### How to run a row
34
-
35
- For each GUI host below:
36
-
37
- 1. **Install** — from a clean repo, run `npm install -g audit-tools` (or the
38
- local equivalent) so postinstall deploys the host surface, then open the
39
- repository in the host.
40
- 2. **Command appears** — confirm the host registers/offers `/audit-code` (slash
41
- command, skill, or agent, per the host's setup kind).
42
- 3. **One live handoff** — invoke `/audit-code` and let it run one bounded audit
43
- step (a single `audit-code next-step` round-trip). If semantic work is
44
- reached, complete one emitted host work item.
45
- 4. **Result lands** — confirm the step's result artifact is written under
46
- `.audit-tools/audit/` (e.g. `steps/current-step.json` advances and the
47
- expected artifact for that step appears).
48
-
49
- Mark each cell pass / fail; record the release version and date **in the release's own
50
- notes or a `docs/reviews/` record — never by committing a filled copy of the grids below.**
51
- They are a timeless template, like `docs/end-of-sprint-report-template.md`.
52
-
53
- ### Checklist (one row per GUI host)
54
-
55
- | Host | Surface deployed | 1. Install + open | 2. `/audit-code` visible | 3. One live handoff | 4. Result lands under `.audit-tools/audit/` |
56
- |---|---|---|---|---|---|
57
- | Antigravity | `.agent/skills/audit-code/SKILL.md` skill, `.gemini/commands/audit-code.toml` slash command, planning guide, AGENTS instructions | ☐ | ☐ | ☐ | ☐ |
58
- | OpenCode | global `/audit-code` command (npm-installed) + generated `opencode.json` project permissions | ☐ | ☐ | ☐ | ☐ |
59
- | VS Code | generated prompt file + custom agent + Copilot instructions (`INSTALL_HOST_DEFINITIONS.vscode`, `setup_kind: 'prompt+agent'`) | ☐ | ☐ | ☐ | ☐ |
60
-
61
- Notes / failures (file each as a backlog item):
62
-
63
- -
64
-
65
- ### remediate-code checklist (one row per GUI host)
66
-
67
- `remediate-code` has its own automated half — `npm run verify:remediate-hosts`
68
- (`scripts/remediate/verify-hosts.mjs`, wired into `verify:release`), the mirror of
69
- the audit gate: it deploys every remediate host surface into an isolated temp
70
- `$HOME` and re-runs each host's `verify()` handler from the same
71
- `INSTALL_HOST_DEFINITIONS` table. As with audit, that gate catches *our* drift but
72
- cannot invoke `/remediate-code` inside a live GUI host — a human runs the rows
73
- below at release, using the same GUI-host set.
74
-
75
- | Host | Surface deployed | 1. Install + open | 2. `/remediate-code` visible | 3. One live handoff | 4. Result lands under `.audit-tools/remediation/` |
76
- |---|---|---|---|---|---|
77
- | Antigravity | `.agent/skills/remediate-code/SKILL.md` skill, `.gemini/commands/remediate-code.toml` slash command, planning guide, AGENTS instructions | ☐ | ☐ | ☐ | ☐ |
78
- | OpenCode | global `/remediate-code` command (npm-installed) + generated `opencode.json` project permissions | ☐ | ☐ | ☐ | ☐ |
79
- | VS Code | generated prompt file + custom agent + Copilot instructions (`INSTALL_HOST_DEFINITIONS.vscode`, `setup_kind: 'prompt+agent'`) | ☐ | ☐ | ☐ | ☐ |
80
-
81
- Notes / failures (file each as a backlog item):
82
-
83
- -
84
-
85
- ## Manual workflow dispatch
86
-
87
- Use GitHub Actions `workflow_dispatch` to exercise or run the publish workflow.
88
-
89
- Dry run:
90
-
91
- - `dry_run=true`
92
- - `publish_tag=auto`
93
-
94
- Live publish:
95
-
96
- - `dry_run=false`
97
- - `publish_tag=auto` unless intentionally overriding the dist-tag
98
-
99
- `publish_tag=auto` resolves stable versions to `latest` and prerelease versions
100
- to `next`.
101
-
102
- Publishing a GitHub Release triggers the same workflow.
103
-
104
- ## Trusted publisher setup
105
-
106
- npm Trusted Publishing is configured for this repository. If repository,
107
- workflow, or ownership details change, keep the npm trusted publisher entry
108
- aligned with:
109
-
110
- - owner or organization: `OhOkThisIsFine`
111
- - repository: `audit-tools`
112
- - workflow filename: `publish-package.yml`
113
-
114
- ## Troubleshooting
115
-
116
- If a GitHub Actions run fails:
117
-
118
- 1. download the uploaded `*-npm-logs` artifact
119
- 2. rerun `npm ci` and `npm run verify:release` locally from the same commit
120
- 3. for publish failures, rerun `publish-package.yml` with `dry_run=true`
121
- 4. confirm npm Trusted Publishing still targets `publish-package.yml`
122
-
123
- For live child-process output while debugging the packaged/linked smokes:
124
-
125
- ```bash
126
- AUDIT_CODE_VERBOSE=1 npm run smoke:packaged-audit-code
127
- AUDIT_CODE_VERBOSE=1 npm run smoke:linked-audit-code
128
- ```
129
-
130
- The packaged smoke path strips inherited `npm_config_*`, `NODE_AUTH_TOKEN`, and
131
- `NPM_TOKEN` values before nested npm operations so dry runs and smoke installs
132
- do not accidentally inherit publish credentials or suppress tarball generation.
133
-
134
- Post-publish checks:
135
-
136
- ```bash
137
- npm view audit-tools version
138
- npm view audit-tools dist-tags --json
139
- npm audit signatures
140
- ```