audit-tools 0.44.0 → 0.46.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 (266) hide show
  1. package/README.md +15 -2
  2. package/dist/audit/cli/charterExtractionPrompt.d.ts.map +1 -1
  3. package/dist/audit/cli/charterExtractionPrompt.js +11 -1
  4. package/dist/audit/cli/charterExtractionPrompt.js.map +1 -1
  5. package/dist/audit/cli/cleanupCommand.d.ts +25 -0
  6. package/dist/audit/cli/cleanupCommand.d.ts.map +1 -1
  7. package/dist/audit/cli/cleanupCommand.js +69 -0
  8. package/dist/audit/cli/cleanupCommand.js.map +1 -1
  9. package/dist/audit/cli/dispatch/hostHandoff.d.ts +64 -3
  10. package/dist/audit/cli/dispatch/hostHandoff.d.ts.map +1 -1
  11. package/dist/audit/cli/dispatch/hostHandoff.js +247 -99
  12. package/dist/audit/cli/dispatch/hostHandoff.js.map +1 -1
  13. package/dist/audit/cli/dispatch/packetFilter.d.ts +1 -1
  14. package/dist/audit/cli/dispatch.d.ts +1 -1
  15. package/dist/audit/cli/dispatch.d.ts.map +1 -1
  16. package/dist/audit/cli/dispatch.js +1 -1
  17. package/dist/audit/cli/dispatch.js.map +1 -1
  18. package/dist/audit/cli/fanoutLanes.d.ts.map +1 -1
  19. package/dist/audit/cli/fanoutLanes.js +6 -1
  20. package/dist/audit/cli/fanoutLanes.js.map +1 -1
  21. package/dist/audit/cli/laneSubmissions.d.ts +16 -2
  22. package/dist/audit/cli/laneSubmissions.d.ts.map +1 -1
  23. package/dist/audit/cli/laneSubmissions.js +38 -27
  24. package/dist/audit/cli/laneSubmissions.js.map +1 -1
  25. package/dist/audit/cli/nextStepCommand.d.ts.map +1 -1
  26. package/dist/audit/cli/nextStepCommand.js +9 -6
  27. package/dist/audit/cli/nextStepCommand.js.map +1 -1
  28. package/dist/audit/cli/nextStepHelpers.d.ts +39 -4
  29. package/dist/audit/cli/nextStepHelpers.d.ts.map +1 -1
  30. package/dist/audit/cli/nextStepHelpers.js +132 -42
  31. package/dist/audit/cli/nextStepHelpers.js.map +1 -1
  32. package/dist/audit/cli/reviewRun.d.ts +1 -1
  33. package/dist/audit/cli/reviewRun.d.ts.map +1 -1
  34. package/dist/audit/cli/reviewRun.js +2 -9
  35. package/dist/audit/cli/reviewRun.js.map +1 -1
  36. package/dist/audit/cli/sampleRunCommand.d.ts.map +1 -1
  37. package/dist/audit/cli/sampleRunCommand.js +12 -1
  38. package/dist/audit/cli/sampleRunCommand.js.map +1 -1
  39. package/dist/audit/cli/semanticReviewStep.d.ts +5 -2
  40. package/dist/audit/cli/semanticReviewStep.d.ts.map +1 -1
  41. package/dist/audit/cli/semanticReviewStep.js +28 -1
  42. package/dist/audit/cli/semanticReviewStep.js.map +1 -1
  43. package/dist/audit/cli/steps.d.ts +6 -6
  44. package/dist/audit/cli/unacceptResultsCommand.d.ts +18 -0
  45. package/dist/audit/cli/unacceptResultsCommand.d.ts.map +1 -0
  46. package/dist/audit/cli/unacceptResultsCommand.js +49 -0
  47. package/dist/audit/cli/unacceptResultsCommand.js.map +1 -0
  48. package/dist/audit/cli.d.ts +6 -0
  49. package/dist/audit/cli.d.ts.map +1 -1
  50. package/dist/audit/cli.js +34 -59
  51. package/dist/audit/cli.js.map +1 -1
  52. package/dist/audit/contracts/findingContractPrompt.d.ts +11 -0
  53. package/dist/audit/contracts/findingContractPrompt.d.ts.map +1 -0
  54. package/dist/audit/contracts/findingContractPrompt.js +112 -0
  55. package/dist/audit/contracts/findingContractPrompt.js.map +1 -0
  56. package/dist/audit/contracts/workerSchemas.d.ts +106 -42
  57. package/dist/audit/contracts/workerSchemas.d.ts.map +1 -1
  58. package/dist/audit/contracts/workerSchemas.js +16 -7
  59. package/dist/audit/contracts/workerSchemas.js.map +1 -1
  60. package/dist/audit/contracts/wrapperResponse.d.ts +52 -28
  61. package/dist/audit/contracts/wrapperResponse.d.ts.map +1 -1
  62. package/dist/audit/contracts/wrapperResponse.js +8 -5
  63. package/dist/audit/contracts/wrapperResponse.js.map +1 -1
  64. package/dist/audit/decompose/sources.d.ts.map +1 -1
  65. package/dist/audit/decompose/sources.js +21 -5
  66. package/dist/audit/decompose/sources.js.map +1 -1
  67. package/dist/audit/extractors/analyzers/registry.d.ts +8 -5
  68. package/dist/audit/extractors/analyzers/registry.d.ts.map +1 -1
  69. package/dist/audit/extractors/analyzers/registry.js +28 -7
  70. package/dist/audit/extractors/analyzers/registry.js.map +1 -1
  71. package/dist/audit/extractors/designAssessment.js +1 -1
  72. package/dist/audit/extractors/gitHistory.d.ts +1 -1
  73. package/dist/audit/extractors/gitHistory.js +1 -1
  74. package/dist/audit/extractors/graph.d.ts +1 -1
  75. package/dist/audit/extractors/graph.js +1 -1
  76. package/dist/audit/extractors/risk.d.ts +1 -1
  77. package/dist/audit/extractors/risk.js +1 -1
  78. package/dist/audit/io/artifacts.d.ts.map +1 -1
  79. package/dist/audit/io/artifacts.js +5 -5
  80. package/dist/audit/io/artifacts.js.map +1 -1
  81. package/dist/audit/orchestrator/acquisitionExecutor.d.ts +11 -6
  82. package/dist/audit/orchestrator/acquisitionExecutor.d.ts.map +1 -1
  83. package/dist/audit/orchestrator/acquisitionExecutor.js +1 -1
  84. package/dist/audit/orchestrator/acquisitionExecutor.js.map +1 -1
  85. package/dist/audit/orchestrator/advance.d.ts +14 -10
  86. package/dist/audit/orchestrator/advance.d.ts.map +1 -1
  87. package/dist/audit/orchestrator/advance.js +49 -24
  88. package/dist/audit/orchestrator/advance.js.map +1 -1
  89. package/dist/audit/orchestrator/advanceTypes.d.ts +14 -0
  90. package/dist/audit/orchestrator/advanceTypes.d.ts.map +1 -1
  91. package/dist/audit/orchestrator/autoFixExecutor.d.ts +20 -1
  92. package/dist/audit/orchestrator/autoFixExecutor.d.ts.map +1 -1
  93. package/dist/audit/orchestrator/autoFixExecutor.js +77 -15
  94. package/dist/audit/orchestrator/autoFixExecutor.js.map +1 -1
  95. package/dist/audit/orchestrator/dependencyMap.js +1 -1
  96. package/dist/audit/orchestrator/dependencyMap.js.map +1 -1
  97. package/dist/audit/orchestrator/executorRunners.d.ts.map +1 -1
  98. package/dist/audit/orchestrator/executorRunners.js +18 -4
  99. package/dist/audit/orchestrator/executorRunners.js.map +1 -1
  100. package/dist/audit/orchestrator/executors.d.ts +54 -0
  101. package/dist/audit/orchestrator/executors.d.ts.map +1 -1
  102. package/dist/audit/orchestrator/executors.js +352 -0
  103. package/dist/audit/orchestrator/executors.js.map +1 -1
  104. package/dist/audit/orchestrator/hostInputPause.d.ts +20 -11
  105. package/dist/audit/orchestrator/hostInputPause.d.ts.map +1 -1
  106. package/dist/audit/orchestrator/hostInputPause.js +17 -11
  107. package/dist/audit/orchestrator/hostInputPause.js.map +1 -1
  108. package/dist/audit/orchestrator/localCommands.d.ts +24 -1
  109. package/dist/audit/orchestrator/localCommands.d.ts.map +1 -1
  110. package/dist/audit/orchestrator/localCommands.js +44 -9
  111. package/dist/audit/orchestrator/localCommands.js.map +1 -1
  112. package/dist/audit/orchestrator/nextStep.d.ts +13 -0
  113. package/dist/audit/orchestrator/nextStep.d.ts.map +1 -1
  114. package/dist/audit/orchestrator/nextStep.js +13 -0
  115. package/dist/audit/orchestrator/nextStep.js.map +1 -1
  116. package/dist/audit/orchestrator/requeueCommand.d.ts +1 -1
  117. package/dist/audit/orchestrator/runtimeCommand.d.ts +32 -1
  118. package/dist/audit/orchestrator/runtimeCommand.d.ts.map +1 -1
  119. package/dist/audit/orchestrator/runtimeCommand.js +90 -3
  120. package/dist/audit/orchestrator/runtimeCommand.js.map +1 -1
  121. package/dist/audit/orchestrator/structureExecutors.js +1 -1
  122. package/dist/audit/orchestrator/structureExecutors.js.map +1 -1
  123. package/dist/audit/orchestrator/syntaxResolutionExecutor.d.ts +11 -1
  124. package/dist/audit/orchestrator/syntaxResolutionExecutor.d.ts.map +1 -1
  125. package/dist/audit/orchestrator/syntaxResolutionExecutor.js +25 -9
  126. package/dist/audit/orchestrator/syntaxResolutionExecutor.js.map +1 -1
  127. package/dist/audit/supervisor/operatorHandoff.d.ts +0 -1
  128. package/dist/audit/supervisor/operatorHandoff.d.ts.map +1 -1
  129. package/dist/audit/supervisor/operatorHandoff.js +2 -1
  130. package/dist/audit/supervisor/operatorHandoff.js.map +1 -1
  131. package/dist/audit/types.d.ts +33 -19
  132. package/dist/audit/types.d.ts.map +1 -1
  133. package/dist/audit/validation/auditResults.d.ts +39 -0
  134. package/dist/audit/validation/auditResults.d.ts.map +1 -1
  135. package/dist/audit/validation/auditResults.js +111 -53
  136. package/dist/audit/validation/auditResults.js.map +1 -1
  137. package/dist/audit/validation/ingestIssueCodes.d.ts +18 -0
  138. package/dist/audit/validation/ingestIssueCodes.d.ts.map +1 -0
  139. package/dist/audit/validation/ingestIssueCodes.js +26 -0
  140. package/dist/audit/validation/ingestIssueCodes.js.map +1 -0
  141. package/dist/remediate/contractPipeline/derive.d.ts.map +1 -1
  142. package/dist/remediate/contractPipeline/derive.js +1 -0
  143. package/dist/remediate/contractPipeline/derive.js.map +1 -1
  144. package/dist/remediate/contractPipeline/semanticProjection.d.ts +5 -4
  145. package/dist/remediate/contractPipeline/semanticProjection.d.ts.map +1 -1
  146. package/dist/remediate/contractPipeline/semanticProjection.js +34 -19
  147. package/dist/remediate/contractPipeline/semanticProjection.js.map +1 -1
  148. package/dist/remediate/index.d.ts.map +1 -1
  149. package/dist/remediate/index.js +3 -2
  150. package/dist/remediate/index.js.map +1 -1
  151. package/dist/remediate/phases/close.d.ts +37 -2
  152. package/dist/remediate/phases/close.d.ts.map +1 -1
  153. package/dist/remediate/phases/close.js +100 -31
  154. package/dist/remediate/phases/close.js.map +1 -1
  155. package/dist/remediate/phases/closeVerifyAnalyzerLeads.js +2 -2
  156. package/dist/remediate/phases/closeVerifyAnalyzerLeads.js.map +1 -1
  157. package/dist/remediate/phases/triage.d.ts.map +1 -1
  158. package/dist/remediate/phases/triage.js +61 -19
  159. package/dist/remediate/phases/triage.js.map +1 -1
  160. package/dist/remediate/state/types.d.ts +15 -1
  161. package/dist/remediate/state/types.d.ts.map +1 -1
  162. package/dist/remediate/steps/contractPipeline.d.ts +13 -0
  163. package/dist/remediate/steps/contractPipeline.d.ts.map +1 -1
  164. package/dist/remediate/steps/contractPipeline.js +82 -3
  165. package/dist/remediate/steps/contractPipeline.js.map +1 -1
  166. package/dist/remediate/steps/dispatch/hostHandoff.d.ts +1 -1
  167. package/dist/remediate/steps/dispatch/hostHandoff.d.ts.map +1 -1
  168. package/dist/remediate/steps/dispatch/hostHandoff.js +297 -139
  169. package/dist/remediate/steps/dispatch/hostHandoff.js.map +1 -1
  170. package/dist/remediate/steps/nextStep.d.ts.map +1 -1
  171. package/dist/remediate/steps/nextStep.js +37 -7
  172. package/dist/remediate/steps/nextStep.js.map +1 -1
  173. package/dist/remediate/types/options.d.ts +1 -1
  174. package/dist/shared/analyzers/acquisitionEngine.d.ts +61 -28
  175. package/dist/shared/analyzers/acquisitionEngine.d.ts.map +1 -1
  176. package/dist/shared/analyzers/acquisitionEngine.js +83 -24
  177. package/dist/shared/analyzers/acquisitionEngine.js.map +1 -1
  178. package/dist/shared/analyzers/binaryAcquisition.d.ts +8 -2
  179. package/dist/shared/analyzers/binaryAcquisition.d.ts.map +1 -1
  180. package/dist/shared/analyzers/binaryAcquisition.js +4 -4
  181. package/dist/shared/analyzers/binaryAcquisition.js.map +1 -1
  182. package/dist/shared/constitutionalDocPaths.d.ts.map +1 -1
  183. package/dist/shared/constitutionalDocPaths.js +7 -0
  184. package/dist/shared/constitutionalDocPaths.js.map +1 -1
  185. package/dist/shared/decompose/systemicChallenge.d.ts +15 -1
  186. package/dist/shared/decompose/systemicChallenge.d.ts.map +1 -1
  187. package/dist/shared/engine/obligationEngine.d.ts +44 -3
  188. package/dist/shared/engine/obligationEngine.d.ts.map +1 -1
  189. package/dist/shared/engine/obligationEngine.js +53 -7
  190. package/dist/shared/engine/obligationEngine.js.map +1 -1
  191. package/dist/shared/findings/dedupe.d.ts.map +1 -1
  192. package/dist/shared/findings/dedupe.js +8 -0
  193. package/dist/shared/findings/dedupe.js.map +1 -1
  194. package/dist/shared/friction/frictionRecord.d.ts +42 -2
  195. package/dist/shared/friction/frictionRecord.d.ts.map +1 -1
  196. package/dist/shared/friction/frictionRecord.js +111 -3
  197. package/dist/shared/friction/frictionRecord.js.map +1 -1
  198. package/dist/shared/friction/triage.d.ts +15 -0
  199. package/dist/shared/friction/triage.d.ts.map +1 -1
  200. package/dist/shared/friction/triage.js +33 -2
  201. package/dist/shared/friction/triage.js.map +1 -1
  202. package/dist/shared/index.d.ts +16 -11
  203. package/dist/shared/index.d.ts.map +1 -1
  204. package/dist/shared/index.js +16 -9
  205. package/dist/shared/index.js.map +1 -1
  206. package/dist/shared/io/fileLock.d.ts.map +1 -1
  207. package/dist/shared/io/fileLock.js +22 -3
  208. package/dist/shared/io/fileLock.js.map +1 -1
  209. package/dist/shared/io/frictionCapture.d.ts +73 -19
  210. package/dist/shared/io/frictionCapture.d.ts.map +1 -1
  211. package/dist/shared/io/frictionCapture.js +21 -30
  212. package/dist/shared/io/frictionCapture.js.map +1 -1
  213. package/dist/shared/io/lockedJsonStore.d.ts +24 -3
  214. package/dist/shared/io/lockedJsonStore.d.ts.map +1 -1
  215. package/dist/shared/io/lockedJsonStore.js +35 -7
  216. package/dist/shared/io/lockedJsonStore.js.map +1 -1
  217. package/dist/shared/io/stepContractWriter.d.ts +3 -3
  218. package/dist/shared/io/stepContractWriter.d.ts.map +1 -1
  219. package/dist/shared/io/stepContractWriter.js +97 -13
  220. package/dist/shared/io/stepContractWriter.js.map +1 -1
  221. package/dist/shared/submission/expectedSubmissions.d.ts +18 -0
  222. package/dist/shared/submission/expectedSubmissions.d.ts.map +1 -1
  223. package/dist/shared/submission/expectedSubmissions.js +17 -0
  224. package/dist/shared/submission/expectedSubmissions.js.map +1 -1
  225. package/dist/shared/submission/handRecovery.d.ts.map +1 -1
  226. package/dist/shared/submission/handRecovery.js +9 -11
  227. package/dist/shared/submission/handRecovery.js.map +1 -1
  228. package/dist/shared/submission/hostHandoffCore.d.ts +155 -0
  229. package/dist/shared/submission/hostHandoffCore.d.ts.map +1 -0
  230. package/dist/shared/submission/hostHandoffCore.js +210 -0
  231. package/dist/shared/submission/hostHandoffCore.js.map +1 -0
  232. package/dist/shared/submission/submissionClassifier.d.ts +4 -1
  233. package/dist/shared/submission/submissionClassifier.d.ts.map +1 -1
  234. package/dist/shared/submission/submissionClassifier.js.map +1 -1
  235. package/dist/shared/submission/submissionLedger.d.ts +16 -5
  236. package/dist/shared/submission/submissionLedger.d.ts.map +1 -1
  237. package/dist/shared/submission/submissionLedger.js +42 -3
  238. package/dist/shared/submission/submissionLedger.js.map +1 -1
  239. package/dist/shared/tooling/commandShape.d.ts +29 -0
  240. package/dist/shared/tooling/commandShape.d.ts.map +1 -1
  241. package/dist/shared/tooling/commandShape.js +82 -10
  242. package/dist/shared/tooling/commandShape.js.map +1 -1
  243. package/dist/shared/tooling/exec.d.ts +32 -0
  244. package/dist/shared/tooling/exec.d.ts.map +1 -1
  245. package/dist/shared/tooling/exec.js +189 -0
  246. package/dist/shared/tooling/exec.js.map +1 -1
  247. package/dist/shared/types/finding.d.ts +132 -20
  248. package/dist/shared/types/finding.d.ts.map +1 -1
  249. package/dist/shared/types/finding.js +70 -63
  250. package/dist/shared/types/finding.js.map +1 -1
  251. package/docs/audit-pkg/contracts.md +8 -1
  252. package/docs/audit-pkg/operator-guide.md +13 -2
  253. package/docs/audit-pkg/product.md +22 -6
  254. package/package.json +10 -6
  255. package/schemas/audit-code-v1alpha1.schema.json +297 -0
  256. package/schemas/audit_result.schema.json +5 -1
  257. package/schemas/audit_results.schema.json +5 -1
  258. package/schemas/finding.schema.json +1 -1
  259. package/scripts/shared/install-host-assets.mjs +8 -5
  260. package/skills/audit-code/SKILL.md +4 -2
  261. package/skills/audit-code/audit-code.prompt.md +5 -2
  262. package/skills/audit-code/opencode-command-template.txt +1 -1
  263. package/wrapper/audit-code-wrapper-lib.mjs +82 -16
  264. package/wrapper/installer-verb-help.mjs +14 -4
  265. package/docs/audit-pkg/development.md +0 -113
  266. package/docs/audit-pkg/release.md +0 -140
@@ -0,0 +1,297 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "audit-code-v1alpha1.schema.json",
4
+ "title": "Audit Code Response",
5
+ "type": "object",
6
+ "properties": {
7
+ "contract_version": {
8
+ "type": "string",
9
+ "const": "audit-code/v1alpha1"
10
+ },
11
+ "audit_state": {
12
+ "type": "object",
13
+ "properties": {
14
+ "status": {
15
+ "type": "string",
16
+ "enum": [
17
+ "not_started",
18
+ "active",
19
+ "blocked",
20
+ "complete"
21
+ ]
22
+ },
23
+ "last_executor": {
24
+ "type": "string"
25
+ },
26
+ "last_obligation": {
27
+ "type": "string"
28
+ },
29
+ "blockers": {
30
+ "type": "array",
31
+ "items": {
32
+ "type": "string"
33
+ }
34
+ },
35
+ "obligations": {
36
+ "type": "array",
37
+ "items": {
38
+ "type": "object",
39
+ "properties": {
40
+ "id": {
41
+ "type": "string"
42
+ },
43
+ "state": {
44
+ "type": "string",
45
+ "enum": [
46
+ "missing",
47
+ "present",
48
+ "stale",
49
+ "blocked",
50
+ "satisfied"
51
+ ]
52
+ },
53
+ "reason": {
54
+ "type": "string"
55
+ }
56
+ },
57
+ "required": [
58
+ "id",
59
+ "state"
60
+ ],
61
+ "additionalProperties": false
62
+ }
63
+ }
64
+ },
65
+ "required": [
66
+ "status",
67
+ "obligations"
68
+ ],
69
+ "additionalProperties": false
70
+ },
71
+ "selected_obligation": {
72
+ "type": [
73
+ "string",
74
+ "null"
75
+ ]
76
+ },
77
+ "selected_executor": {
78
+ "type": [
79
+ "string",
80
+ "null"
81
+ ]
82
+ },
83
+ "progress_made": {
84
+ "type": "boolean"
85
+ },
86
+ "artifacts_written": {
87
+ "type": "array",
88
+ "items": {
89
+ "type": "string"
90
+ }
91
+ },
92
+ "progress_summary": {
93
+ "type": "string"
94
+ },
95
+ "next_likely_step": {
96
+ "type": [
97
+ "string",
98
+ "null"
99
+ ]
100
+ },
101
+ "handoff": {
102
+ "type": "object",
103
+ "properties": {
104
+ "status": {
105
+ "type": "string",
106
+ "enum": [
107
+ "not_started",
108
+ "active",
109
+ "blocked",
110
+ "complete"
111
+ ]
112
+ },
113
+ "repo_root": {
114
+ "type": "string"
115
+ },
116
+ "artifacts_dir": {
117
+ "type": "string"
118
+ },
119
+ "summary": {
120
+ "type": "string"
121
+ },
122
+ "pending_obligations": {
123
+ "type": "array",
124
+ "items": {
125
+ "type": "string"
126
+ }
127
+ },
128
+ "suggested_inputs": {
129
+ "type": "array",
130
+ "items": {
131
+ "type": "object",
132
+ "properties": {
133
+ "flag": {
134
+ "type": "string",
135
+ "enum": [
136
+ "--results",
137
+ "--batch-results",
138
+ "--updates",
139
+ "--external-analyzer-results"
140
+ ]
141
+ },
142
+ "suggested_path": {
143
+ "type": "string"
144
+ },
145
+ "description": {
146
+ "type": "string"
147
+ }
148
+ },
149
+ "required": [
150
+ "flag",
151
+ "suggested_path",
152
+ "description"
153
+ ],
154
+ "additionalProperties": false
155
+ }
156
+ },
157
+ "suggested_commands": {
158
+ "type": "array",
159
+ "items": {
160
+ "type": "string"
161
+ }
162
+ },
163
+ "active_review_run": {
164
+ "type": "object",
165
+ "properties": {
166
+ "contract_version": {
167
+ "type": "string",
168
+ "const": "audit-review-run/v1alpha1"
169
+ },
170
+ "run_id": {
171
+ "type": "string"
172
+ },
173
+ "review_run_path": {
174
+ "type": "string"
175
+ },
176
+ "pending_audit_tasks_path": {
177
+ "type": "string"
178
+ },
179
+ "host_workload_path": {
180
+ "type": "string"
181
+ },
182
+ "host_result_map_path": {
183
+ "type": "string"
184
+ }
185
+ },
186
+ "required": [
187
+ "contract_version",
188
+ "run_id",
189
+ "review_run_path",
190
+ "pending_audit_tasks_path",
191
+ "host_workload_path",
192
+ "host_result_map_path"
193
+ ],
194
+ "additionalProperties": false
195
+ },
196
+ "artifact_paths": {
197
+ "type": "object",
198
+ "properties": {
199
+ "operator_inputs_dir": {
200
+ "type": "string"
201
+ },
202
+ "operator_handoff_json": {
203
+ "type": "string"
204
+ },
205
+ "operator_handoff_markdown": {
206
+ "type": "string"
207
+ },
208
+ "session_config": {
209
+ "type": "string"
210
+ },
211
+ "run_ledger": {
212
+ "type": "string"
213
+ },
214
+ "current_review_run": {
215
+ "type": [
216
+ "string",
217
+ "null"
218
+ ]
219
+ },
220
+ "current_prompt": {
221
+ "type": [
222
+ "string",
223
+ "null"
224
+ ]
225
+ },
226
+ "current_tasks": {
227
+ "type": [
228
+ "string",
229
+ "null"
230
+ ]
231
+ },
232
+ "audit_tasks": {
233
+ "type": [
234
+ "string",
235
+ "null"
236
+ ]
237
+ },
238
+ "runtime_validation_tasks": {
239
+ "type": [
240
+ "string",
241
+ "null"
242
+ ]
243
+ },
244
+ "friction_record": {
245
+ "type": "string"
246
+ }
247
+ },
248
+ "required": [
249
+ "operator_inputs_dir",
250
+ "operator_handoff_json",
251
+ "operator_handoff_markdown",
252
+ "session_config",
253
+ "run_ledger",
254
+ "current_review_run",
255
+ "current_prompt",
256
+ "current_tasks",
257
+ "audit_tasks",
258
+ "runtime_validation_tasks",
259
+ "friction_record"
260
+ ],
261
+ "additionalProperties": false
262
+ },
263
+ "quick_start": {
264
+ "type": "string"
265
+ },
266
+ "file_map": {
267
+ "type": "object",
268
+ "additionalProperties": {
269
+ "type": "string"
270
+ }
271
+ }
272
+ },
273
+ "required": [
274
+ "status",
275
+ "repo_root",
276
+ "artifacts_dir",
277
+ "summary",
278
+ "pending_obligations",
279
+ "suggested_inputs",
280
+ "suggested_commands",
281
+ "artifact_paths"
282
+ ],
283
+ "additionalProperties": false
284
+ }
285
+ },
286
+ "required": [
287
+ "contract_version",
288
+ "audit_state",
289
+ "selected_obligation",
290
+ "selected_executor",
291
+ "progress_made",
292
+ "artifacts_written",
293
+ "progress_summary",
294
+ "next_likely_step"
295
+ ],
296
+ "additionalProperties": false
297
+ }
@@ -43,6 +43,10 @@
43
43
  "total_lines": {
44
44
  "type": "integer",
45
45
  "minimum": 0
46
+ },
47
+ "reviewed_lines": {
48
+ "type": "integer",
49
+ "minimum": 0
46
50
  }
47
51
  },
48
52
  "required": [
@@ -101,7 +105,7 @@
101
105
  "config_deployment",
102
106
  "observability"
103
107
  ],
104
- "description": "Optional: defaults from the enclosing AuditResult lens when omitted."
108
+ "description": "defaults from the enclosing AuditResult lens when omitted."
105
109
  },
106
110
  "summary": {
107
111
  "type": "string"
@@ -45,6 +45,10 @@
45
45
  "total_lines": {
46
46
  "type": "integer",
47
47
  "minimum": 0
48
+ },
49
+ "reviewed_lines": {
50
+ "type": "integer",
51
+ "minimum": 0
48
52
  }
49
53
  },
50
54
  "required": [
@@ -103,7 +107,7 @@
103
107
  "config_deployment",
104
108
  "observability"
105
109
  ],
106
- "description": "Optional: defaults from the enclosing AuditResult lens when omitted."
110
+ "description": "defaults from the enclosing AuditResult lens when omitted."
107
111
  },
108
112
  "summary": {
109
113
  "type": "string"
@@ -47,7 +47,7 @@
47
47
  "config_deployment",
48
48
  "observability"
49
49
  ],
50
- "description": "Optional: defaults from the enclosing AuditResult lens when omitted."
50
+ "description": "defaults from the enclosing AuditResult lens when omitted."
51
51
  },
52
52
  "summary": {
53
53
  "type": "string"
@@ -14,14 +14,17 @@ import { mkdirSync, existsSync, readFileSync, writeFileSync } from "node:fs";
14
14
 
15
15
  /**
16
16
  * Read a source file that is required for the install to proceed at all
17
- * (e.g. the prompt/skill markdown). Missing source is reported as a skip
18
- * (exitCode reset to 0, not a failure) rather than thrown.
17
+ * (e.g. the prompt/skill markdown the product surface itself). A missing
18
+ * required source is a LOUD failure: it throws so the postinstall exits
19
+ * non-zero and any failure an earlier step already recorded is never masked
20
+ * by an exit-code reset here. Only truly optional sources go through
21
+ * readOptionalSource, which still degrades to a skip.
19
22
  */
20
23
  export function readRequiredSource(path, label, toolName) {
21
24
  if (!existsSync(path)) {
22
- console.warn(`${toolName}: ${label} source not found at ${path} - skipping global command install`);
23
- process.exitCode = 0;
24
- return null;
25
+ throw new Error(
26
+ `${toolName}: ${label} source not found at ${path} - required for the install; not skipping silently`,
27
+ );
25
28
  }
26
29
  return readFileSync(path);
27
30
  }
@@ -43,8 +43,10 @@ node audit-code.mjs ensure --quiet
43
43
  node audit-code.mjs next-step
44
44
  ```
45
45
 
46
- Pass a user-supplied target directory with `--root <path>` on every command. Do
47
- not add provider, model, quota, routing, or launch flags.
46
+ The target-directory rule has one home *Preserve user arguments* in the
47
+ `/audit-code` loader prompt, whose absolute path `audit-code prompt-path` prints.
48
+ Follow it as written there. Do not add provider, model, quota, routing, or launch
49
+ flags.
48
50
 
49
51
  Read the returned JSON only far enough to find `prompt_path`, then read and
50
52
  follow only that prompt. Do not inspect workload, result, schema, or state files
@@ -21,8 +21,11 @@ repository root.
21
21
 
22
22
  Preserve user arguments:
23
23
 
24
- - pass a typed target directory with `--root <path>` on every `audit-code`
25
- command (`ensure` and each `next-step`)
24
+ - pass the user-supplied target directory with `--root <path>` on every
25
+ `audit-code` command (`ensure` and each `next-step`)
26
+
27
+ This is the one full statement of the target-directory rule; the `audit-code`
28
+ skill points here instead of restating it.
26
29
 
27
30
  Ask for exactly one step:
28
31
 
@@ -3,7 +3,7 @@
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 `prompt_content` in the response and follow it.
6
+ 2. Read the returned JSON far enough to find `prompt_path`, then read and follow the prompt file it points to.
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
 
@@ -15,7 +15,11 @@ import {
15
15
  _getInstallProfile,
16
16
  _renderGeminiCommandToml,
17
17
  } from './audit-code-wrapper-install-hosts.mjs';
18
- import { wantsInstallerVerbHelp, installerVerbHelp } from './installer-verb-help.mjs';
18
+ import {
19
+ wantsInstallerVerbHelp,
20
+ installerVerbHelp,
21
+ installerVerbSummaries,
22
+ } from './installer-verb-help.mjs';
19
23
 
20
24
  export { shouldBuildDistForPaths, assertWorkspaceInstalled };
21
25
  export { _INSTALL_HOST_ORDER, _INSTALL_HOST_DEFINITIONS, _getInstallHostKeys, _getInstallProfile, _renderGeminiCommandToml };
@@ -45,24 +49,84 @@ function hasLeadingFlag(argv, name) {
45
49
  return false;
46
50
  }
47
51
 
52
+ // Every occurrence of a flag in an argv, classified by the SAME grammar
53
+ // src/audit/cli/args.ts reads with: an equals token (`--root=/x`) carries its
54
+ // value inline; a bare token (`--root /x`) consumes the FOLLOWING token as its
55
+ // value only when that token exists and is not itself a flag (the mirror of
56
+ // args.ts's isLongFlagToken guard). Reading the dist grammar here is what makes
57
+ // the wrapper's view of "what did the caller pass" agree with what the child
58
+ // will actually act on. Ordered by ascending index; spans never overlap.
59
+ function flagOccurrences(argv, name) {
60
+ const prefix = `${name}=`;
61
+ const occurrences = [];
62
+ for (let index = 0; index < argv.length; index += 1) {
63
+ if (argv[index].startsWith(prefix)) {
64
+ occurrences.push({ index, span: 1, inline: true });
65
+ } else if (argv[index] === name) {
66
+ const consumesValue =
67
+ argv[index + 1] !== undefined && !argv[index + 1].startsWith("--");
68
+ occurrences.push({ index, span: consumesValue ? 2 : 1, inline: false });
69
+ if (consumesValue) index += 1;
70
+ }
71
+ }
72
+ return occurrences;
73
+ }
74
+
75
+ // The caller's LAST occurrence is their final word for the flag.
76
+ function lastFlagEntry(argv, name) {
77
+ const occurrences = flagOccurrences(argv, name);
78
+ return occurrences[occurrences.length - 1];
79
+ }
80
+
48
81
  function getFlag(argv, name) {
49
- const index = argv.indexOf(name);
50
- if (index < 0) return undefined;
51
- return argv[index + 1];
82
+ const entry = lastFlagEntry(argv, name);
83
+ if (!entry) return undefined;
84
+ return entry.inline ? argv[entry.index].slice(name.length + 1) : argv[entry.index + 1];
52
85
  }
53
86
 
54
- // Overwrite an existing flag's value (or append when absent). A fill-only-if-
55
- // missing default would forward a user-supplied RELATIVE --root/--artifacts-dir
56
- // raw, re-resolved against the child's cwd (repoRoot), not the caller's cwd
57
- // e.g. `--root .` pointed at the package dir (CE-001). Normalizing to an
58
- // absolute path here makes the forwarded value cwd-stable.
87
+ // Overwrite an existing flag's value or append when absent, ALWAYS emitting the
88
+ // bare two-token form (`--name value`) the only spelling
89
+ // src/audit/cli/args.ts parses (argv.indexOf, no '=' handling anywhere in
90
+ // src/audit), so forwarding an equals-form token verbatim means dist silently
91
+ // drops it and the CLI default wins — explicit loses, the exact failure class
92
+ // this guards. Every OTHER occurrence (either spelling, including each bare
93
+ // occurrence's consumed value token) is removed, so exactly one canonical
94
+ // occurrence reaches the child and dist's first-match parse cannot land on a
95
+ // stale one. A fill-only-if-missing default would otherwise forward a
96
+ // user-supplied RELATIVE --root/--artifacts-dir raw, re-resolved against the
97
+ // child's cwd (repoRoot), not the caller's cwd — e.g. `--root .` pointed at the
98
+ // package dir (CE-001). Normalizing to an absolute path here makes the
99
+ // forwarded value cwd-stable.
59
100
  function setFlag(argv, name, value) {
60
- const index = argv.indexOf(name);
61
- if (index < 0) {
101
+ const occurrences = flagOccurrences(argv, name);
102
+ const kept = occurrences[occurrences.length - 1];
103
+
104
+ // Drop the superseded occurrences, highest index first, together with the
105
+ // value token each bare one consumed.
106
+ for (let occ = occurrences.length - 2; occ >= 0; occ -= 1) {
107
+ argv.splice(occurrences[occ].index, occurrences[occ].span);
108
+ }
109
+
110
+ if (!kept) {
62
111
  argv.push(name, value);
63
- } else {
112
+ return;
113
+ }
114
+
115
+ // Removed occurrences shifted the kept one left; recompute its index.
116
+ const removedBefore = occurrences.reduce(
117
+ (span, occ) => (occ.index < kept.index ? span + occ.span : span),
118
+ 0,
119
+ );
120
+ const index = kept.index - removedBefore;
121
+ if (kept.span === 2) {
122
+ // Bare with a value slot: overwrite the value in place.
64
123
  argv[index + 1] = value;
124
+ return;
65
125
  }
126
+ // Inline (`--name=x`) or dangling bare: collapse the token to the bare flag
127
+ // and insert the value after it.
128
+ argv[index] = name;
129
+ argv.splice(index + 1, 0, value);
66
130
  }
67
131
 
68
132
  export { hasLeadingFlag, setFlag };
@@ -185,15 +249,17 @@ function printHelp({ usageName, preferredEntrypoint }) {
185
249
  '',
186
250
  'Helper commands:',
187
251
  '- prompt-path prints the absolute path to the canonical /audit-code prompt asset',
188
- '- ensure lazily bootstraps repo-local /audit-code assets when they are missing or stale',
189
- '- install bootstraps /audit-code into supported repo-local host surfaces',
190
- '- verify-install smoke-tests the generated host assets after install',
252
+ // The four wrapper-intercepted installer verbs are RENDERED from the module
253
+ // this file already answers `<verb> --help` from, so the listing and the
254
+ // per-verb help cannot disagree. They were hand-restated here and had
255
+ // already drifted from it on two of the four.
256
+ ...installerVerbSummaries('/audit-code'),
191
257
  '- mcp starts the local stdio MCP server for repo-local IDE integrations',
192
- '- install-host --host copilot keeps the narrower Copilot-focused install path available',
193
258
  '- validate checks the current artifact bundle and canonical session intent and exits non-zero when issues exist',
194
259
  '- validate-results --results FILE validates AuditResult payloads against the active task manifest without ingesting them',
195
260
  '- explain-task <task_id> prints the resolved file coverage and current status for a task id',
196
261
  '- ingest-results --results FILE validates and ingests canonical AuditResult payloads',
262
+ '- unaccept-results --work-item <id> (repeatable) or --all removes entries from the accepted host-results pair so a poisoned acceptance can be re-ingested after repair',
197
263
  '- status summarizes deterministic audit state and pending review work',
198
264
  '',
199
265
  'Defaults:',
@@ -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
  }