audit-tools 0.55.4 → 0.55.6

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 (262) hide show
  1. package/dist/audit/cli/auditReviewBindings.d.ts +4 -4
  2. package/dist/audit/cli/auditStep.d.ts +15 -1
  3. package/dist/audit/cli/auditStep.d.ts.map +1 -1
  4. package/dist/audit/cli/auditStep.js +24 -11
  5. package/dist/audit/cli/auditStep.js.map +1 -1
  6. package/dist/audit/cli/charterExtractionPrompt.d.ts.map +1 -1
  7. package/dist/audit/cli/charterExtractionPrompt.js +3 -1
  8. package/dist/audit/cli/charterExtractionPrompt.js.map +1 -1
  9. package/dist/audit/cli/cleanup.d.ts.map +1 -1
  10. package/dist/audit/cli/cleanup.js +26 -2
  11. package/dist/audit/cli/cleanup.js.map +1 -1
  12. package/dist/audit/cli/conceptualDispatch.d.ts +2 -0
  13. package/dist/audit/cli/conceptualDispatch.d.ts.map +1 -1
  14. package/dist/audit/cli/conceptualDispatch.js +29 -8
  15. package/dist/audit/cli/conceptualDispatch.js.map +1 -1
  16. package/dist/audit/cli/dispatch/hostHandoff.d.ts +37 -3
  17. package/dist/audit/cli/dispatch/hostHandoff.d.ts.map +1 -1
  18. package/dist/audit/cli/dispatch/hostHandoff.js +185 -16
  19. package/dist/audit/cli/dispatch/hostHandoff.js.map +1 -1
  20. package/dist/audit/cli/dispatch/packetFilter.d.ts +1 -1
  21. package/dist/audit/cli/envelope.d.ts +1 -1
  22. package/dist/audit/cli/envelope.d.ts.map +1 -1
  23. package/dist/audit/cli/envelope.js +4 -1
  24. package/dist/audit/cli/envelope.js.map +1 -1
  25. package/dist/audit/cli/fanoutLanes.d.ts +30 -0
  26. package/dist/audit/cli/fanoutLanes.d.ts.map +1 -1
  27. package/dist/audit/cli/fanoutLanes.js +76 -8
  28. package/dist/audit/cli/fanoutLanes.js.map +1 -1
  29. package/dist/audit/cli/laneValidators.d.ts +9 -6
  30. package/dist/audit/cli/laneValidators.d.ts.map +1 -1
  31. package/dist/audit/cli/laneValidators.js +22 -7
  32. package/dist/audit/cli/laneValidators.js.map +1 -1
  33. package/dist/audit/cli/nextStepCommand.d.ts +3 -0
  34. package/dist/audit/cli/nextStepCommand.d.ts.map +1 -1
  35. package/dist/audit/cli/nextStepCommand.js +104 -66
  36. package/dist/audit/cli/nextStepCommand.js.map +1 -1
  37. package/dist/audit/cli/nextStepHelpers.d.ts +49 -14
  38. package/dist/audit/cli/nextStepHelpers.d.ts.map +1 -1
  39. package/dist/audit/cli/nextStepHelpers.js +169 -68
  40. package/dist/audit/cli/nextStepHelpers.js.map +1 -1
  41. package/dist/audit/cli/reviewRun.d.ts +10 -0
  42. package/dist/audit/cli/reviewRun.d.ts.map +1 -1
  43. package/dist/audit/cli/reviewRun.js +4 -3
  44. package/dist/audit/cli/reviewRun.js.map +1 -1
  45. package/dist/audit/cli/sampleRunCommand.d.ts +1 -1
  46. package/dist/audit/cli/semanticReviewStep.d.ts +2 -0
  47. package/dist/audit/cli/semanticReviewStep.d.ts.map +1 -1
  48. package/dist/audit/cli/semanticReviewStep.js +5 -50
  49. package/dist/audit/cli/semanticReviewStep.js.map +1 -1
  50. package/dist/audit/cli/validateResultsCommand.d.ts.map +1 -1
  51. package/dist/audit/cli/validateResultsCommand.js +3 -1
  52. package/dist/audit/cli/validateResultsCommand.js.map +1 -1
  53. package/dist/audit/contracts/workerSchemas.d.ts +14 -14
  54. package/dist/audit/extractors/fsIntake.d.ts +13 -0
  55. package/dist/audit/extractors/fsIntake.d.ts.map +1 -1
  56. package/dist/audit/extractors/fsIntake.js +11 -1
  57. package/dist/audit/extractors/fsIntake.js.map +1 -1
  58. package/dist/audit/io/artifacts.d.ts +35 -9
  59. package/dist/audit/io/artifacts.d.ts.map +1 -1
  60. package/dist/audit/io/artifacts.js +84 -67
  61. package/dist/audit/io/artifacts.js.map +1 -1
  62. package/dist/audit/io/rollover.d.ts +18 -0
  63. package/dist/audit/io/rollover.d.ts.map +1 -0
  64. package/dist/audit/io/rollover.js +152 -0
  65. package/dist/audit/io/rollover.js.map +1 -0
  66. package/dist/audit/io/runSnapshot.d.ts +149 -0
  67. package/dist/audit/io/runSnapshot.d.ts.map +1 -0
  68. package/dist/audit/io/runSnapshot.js +710 -0
  69. package/dist/audit/io/runSnapshot.js.map +1 -0
  70. package/dist/audit/orchestrator/advanceTypes.d.ts +11 -0
  71. package/dist/audit/orchestrator/advanceTypes.d.ts.map +1 -1
  72. package/dist/audit/orchestrator/autoFixExecutor.d.ts +9 -0
  73. package/dist/audit/orchestrator/autoFixExecutor.d.ts.map +1 -1
  74. package/dist/audit/orchestrator/autoFixExecutor.js +22 -2
  75. package/dist/audit/orchestrator/autoFixExecutor.js.map +1 -1
  76. package/dist/audit/orchestrator/charterExtractionExecutor.d.ts.map +1 -1
  77. package/dist/audit/orchestrator/charterExtractionExecutor.js +18 -3
  78. package/dist/audit/orchestrator/charterExtractionExecutor.js.map +1 -1
  79. package/dist/audit/orchestrator/charterPackets.d.ts +11 -1
  80. package/dist/audit/orchestrator/charterPackets.d.ts.map +1 -1
  81. package/dist/audit/orchestrator/charterPackets.js +13 -0
  82. package/dist/audit/orchestrator/charterPackets.js.map +1 -1
  83. package/dist/audit/orchestrator/dependencyMap.d.ts.map +1 -1
  84. package/dist/audit/orchestrator/dependencyMap.js +6 -0
  85. package/dist/audit/orchestrator/dependencyMap.js.map +1 -1
  86. package/dist/audit/orchestrator/dependencySlices.d.ts.map +1 -1
  87. package/dist/audit/orchestrator/dependencySlices.js +35 -11
  88. package/dist/audit/orchestrator/dependencySlices.js.map +1 -1
  89. package/dist/audit/orchestrator/designReviewPrompt.d.ts +9 -0
  90. package/dist/audit/orchestrator/designReviewPrompt.d.ts.map +1 -1
  91. package/dist/audit/orchestrator/designReviewPrompt.js +69 -31
  92. package/dist/audit/orchestrator/designReviewPrompt.js.map +1 -1
  93. package/dist/audit/orchestrator/designReviewSnapshot.d.ts +1 -0
  94. package/dist/audit/orchestrator/designReviewSnapshot.d.ts.map +1 -1
  95. package/dist/audit/orchestrator/designReviewSnapshot.js +2 -1
  96. package/dist/audit/orchestrator/designReviewSnapshot.js.map +1 -1
  97. package/dist/audit/orchestrator/executorRunners.d.ts.map +1 -1
  98. package/dist/audit/orchestrator/executorRunners.js +13 -4
  99. package/dist/audit/orchestrator/executorRunners.js.map +1 -1
  100. package/dist/audit/orchestrator/hostInputPause.js +1 -1
  101. package/dist/audit/orchestrator/hostInputPause.js.map +1 -1
  102. package/dist/audit/orchestrator/intakeExecutors.d.ts +8 -1
  103. package/dist/audit/orchestrator/intakeExecutors.d.ts.map +1 -1
  104. package/dist/audit/orchestrator/intakeExecutors.js +13 -4
  105. package/dist/audit/orchestrator/intakeExecutors.js.map +1 -1
  106. package/dist/audit/orchestrator/obligationPolicy.d.ts.map +1 -1
  107. package/dist/audit/orchestrator/obligationPolicy.js +4 -1
  108. package/dist/audit/orchestrator/obligationPolicy.js.map +1 -1
  109. package/dist/audit/orchestrator/planningExecutors.d.ts +1 -1
  110. package/dist/audit/orchestrator/planningExecutors.d.ts.map +1 -1
  111. package/dist/audit/orchestrator/planningExecutors.js +40 -6
  112. package/dist/audit/orchestrator/planningExecutors.js.map +1 -1
  113. package/dist/audit/orchestrator/requeueCommand.d.ts +1 -1
  114. package/dist/audit/orchestrator/systemicChallengeExecutor.d.ts.map +1 -1
  115. package/dist/audit/orchestrator/systemicChallengeExecutor.js +4 -1
  116. package/dist/audit/orchestrator/systemicChallengeExecutor.js.map +1 -1
  117. package/dist/audit/orchestrator/taskBuilder.d.ts +20 -0
  118. package/dist/audit/orchestrator/taskBuilder.d.ts.map +1 -1
  119. package/dist/audit/orchestrator/taskBuilder.js +80 -18
  120. package/dist/audit/orchestrator/taskBuilder.js.map +1 -1
  121. package/dist/audit/systemic/reviewFileMap.d.ts +72 -21
  122. package/dist/audit/systemic/reviewFileMap.d.ts.map +1 -1
  123. package/dist/audit/systemic/reviewFileMap.js +96 -45
  124. package/dist/audit/systemic/reviewFileMap.js.map +1 -1
  125. package/dist/audit/systemic/secondOrderAdversaryPrompt.d.ts +7 -0
  126. package/dist/audit/systemic/secondOrderAdversaryPrompt.d.ts.map +1 -1
  127. package/dist/audit/systemic/secondOrderAdversaryPrompt.js +39 -8
  128. package/dist/audit/systemic/secondOrderAdversaryPrompt.js.map +1 -1
  129. package/dist/audit/types.d.ts +12 -12
  130. package/dist/audit/validation/auditResults.d.ts +1 -0
  131. package/dist/audit/validation/auditResults.d.ts.map +1 -1
  132. package/dist/audit/validation/auditResults.js +1 -0
  133. package/dist/audit/validation/auditResults.js.map +1 -1
  134. package/dist/remediate/findingFilter.js +1 -1
  135. package/dist/remediate/findingFilter.js.map +1 -1
  136. package/dist/remediate/phases/close.d.ts +1 -0
  137. package/dist/remediate/phases/close.d.ts.map +1 -1
  138. package/dist/remediate/phases/close.js +29 -5
  139. package/dist/remediate/phases/close.js.map +1 -1
  140. package/dist/remediate/phases/closeVerifyAnalyzerLeads.d.ts +1 -1
  141. package/dist/remediate/phases/triage.d.ts +2 -1
  142. package/dist/remediate/phases/triage.d.ts.map +1 -1
  143. package/dist/remediate/phases/triage.js +46 -25
  144. package/dist/remediate/phases/triage.js.map +1 -1
  145. package/dist/remediate/phases/triageConformance.d.ts +14 -0
  146. package/dist/remediate/phases/triageConformance.d.ts.map +1 -0
  147. package/dist/remediate/phases/triageConformance.js +189 -0
  148. package/dist/remediate/phases/triageConformance.js.map +1 -0
  149. package/dist/remediate/state/decisionConsumption.d.ts +110 -0
  150. package/dist/remediate/state/decisionConsumption.d.ts.map +1 -0
  151. package/dist/remediate/state/decisionConsumption.js +122 -0
  152. package/dist/remediate/state/decisionConsumption.js.map +1 -0
  153. package/dist/remediate/state/store.d.ts +4 -0
  154. package/dist/remediate/state/store.d.ts.map +1 -1
  155. package/dist/remediate/state/store.js +16 -0
  156. package/dist/remediate/state/store.js.map +1 -1
  157. package/dist/remediate/steps/contractPipeline.d.ts +0 -6
  158. package/dist/remediate/steps/contractPipeline.d.ts.map +1 -1
  159. package/dist/remediate/steps/contractPipeline.js +3 -32
  160. package/dist/remediate/steps/contractPipeline.js.map +1 -1
  161. package/dist/remediate/steps/dispatch/contractConformanceReview.d.ts +9 -0
  162. package/dist/remediate/steps/dispatch/contractConformanceReview.d.ts.map +1 -1
  163. package/dist/remediate/steps/dispatch/contractConformanceReview.js +32 -14
  164. package/dist/remediate/steps/dispatch/contractConformanceReview.js.map +1 -1
  165. package/dist/remediate/steps/dispatch/hostContracts.js +1 -1
  166. package/dist/remediate/steps/dispatch/hostContracts.js.map +1 -1
  167. package/dist/remediate/steps/dispatch/hostHandoff.d.ts.map +1 -1
  168. package/dist/remediate/steps/dispatch/hostHandoff.js +6 -2
  169. package/dist/remediate/steps/dispatch/hostHandoff.js.map +1 -1
  170. package/dist/remediate/steps/dispatch/requiredTests.js +1 -1
  171. package/dist/remediate/steps/dispatch/requiredTests.js.map +1 -1
  172. package/dist/remediate/steps/gateCommands.d.ts +1 -0
  173. package/dist/remediate/steps/gateCommands.d.ts.map +1 -1
  174. package/dist/remediate/steps/gateCommands.js +8 -52
  175. package/dist/remediate/steps/gateCommands.js.map +1 -1
  176. package/dist/remediate/steps/nextStep.d.ts +7 -0
  177. package/dist/remediate/steps/nextStep.d.ts.map +1 -1
  178. package/dist/remediate/steps/nextStep.js +69 -75
  179. package/dist/remediate/steps/nextStep.js.map +1 -1
  180. package/dist/remediate/steps/prompts.d.ts.map +1 -1
  181. package/dist/remediate/steps/prompts.js +6 -9
  182. package/dist/remediate/steps/prompts.js.map +1 -1
  183. package/dist/remediate/steps/recoverIngest.js +1 -1
  184. package/dist/remediate/steps/recoverIngest.js.map +1 -1
  185. package/dist/shared/analyzers/provenance.d.ts +1 -1
  186. package/dist/shared/analyzers/provenance.js +1 -1
  187. package/dist/shared/contentKey.d.ts +3 -2
  188. package/dist/shared/contentKey.d.ts.map +1 -1
  189. package/dist/shared/contentKey.js +3 -2
  190. package/dist/shared/contentKey.js.map +1 -1
  191. package/dist/shared/decompose/charterExtraction.d.ts +200 -13
  192. package/dist/shared/decompose/charterExtraction.d.ts.map +1 -1
  193. package/dist/shared/decompose/charterExtraction.js +34 -6
  194. package/dist/shared/decompose/charterExtraction.js.map +1 -1
  195. package/dist/shared/decompose/systemicChallenge.js +1 -1
  196. package/dist/shared/decompose/systemicChallenge.js.map +1 -1
  197. package/dist/shared/engine/obligationEngine.d.ts +1 -1
  198. package/dist/shared/engine/obligationEngine.js +1 -1
  199. package/dist/shared/findings/dedupe.js +1 -1
  200. package/dist/shared/findings/dedupe.js.map +1 -1
  201. package/dist/shared/git.d.ts +30 -1
  202. package/dist/shared/git.d.ts.map +1 -1
  203. package/dist/shared/git.js +65 -6
  204. package/dist/shared/git.js.map +1 -1
  205. package/dist/shared/index.d.ts +1 -0
  206. package/dist/shared/index.d.ts.map +1 -1
  207. package/dist/shared/index.js +1 -0
  208. package/dist/shared/index.js.map +1 -1
  209. package/dist/shared/intent/clauseBoundaries.d.ts +1 -0
  210. package/dist/shared/intent/clauseBoundaries.d.ts.map +1 -1
  211. package/dist/shared/intent/clauseBoundaries.js +1 -0
  212. package/dist/shared/intent/clauseBoundaries.js.map +1 -1
  213. package/dist/shared/intent/pathScope.d.ts +1 -0
  214. package/dist/shared/intent/pathScope.d.ts.map +1 -1
  215. package/dist/shared/intent/pathScope.js +1 -0
  216. package/dist/shared/intent/pathScope.js.map +1 -1
  217. package/dist/shared/io/nodeWorktreeGuard.d.ts +1 -1
  218. package/dist/shared/io/nodeWorktreeGuard.js +1 -1
  219. package/dist/shared/io/pathIdentity.d.ts.map +1 -1
  220. package/dist/shared/io/pathIdentity.js +1 -0
  221. package/dist/shared/io/pathIdentity.js.map +1 -1
  222. package/dist/shared/io/stepContractWriter.d.ts +1 -0
  223. package/dist/shared/io/stepContractWriter.d.ts.map +1 -1
  224. package/dist/shared/io/stepContractWriter.js +1 -0
  225. package/dist/shared/io/stepContractWriter.js.map +1 -1
  226. package/dist/shared/loopCorePaths.d.ts.map +1 -1
  227. package/dist/shared/loopCorePaths.js +11 -0
  228. package/dist/shared/loopCorePaths.js.map +1 -1
  229. package/dist/shared/prompts.d.ts +2 -0
  230. package/dist/shared/prompts.d.ts.map +1 -1
  231. package/dist/shared/prompts.js +8 -2
  232. package/dist/shared/prompts.js.map +1 -1
  233. package/dist/shared/submission/ingestReport.d.ts.map +1 -1
  234. package/dist/shared/submission/ingestReport.js +19 -1
  235. package/dist/shared/submission/ingestReport.js.map +1 -1
  236. package/dist/shared/submission/submissionLedger.js +2 -2
  237. package/dist/shared/submission/submissionLedger.js.map +1 -1
  238. package/dist/shared/submission/submissionScan.js +1 -1
  239. package/dist/shared/submission/submissionScan.js.map +1 -1
  240. package/dist/shared/tooling/exec.js +2 -2
  241. package/dist/shared/tooling/exec.js.map +1 -1
  242. package/dist/shared/types/charter.d.ts +9 -0
  243. package/dist/shared/types/charter.d.ts.map +1 -1
  244. package/dist/shared/types/charter.js +7 -0
  245. package/dist/shared/types/charter.js.map +1 -1
  246. package/dist/shared/types/closingActions.js +1 -1
  247. package/dist/shared/types/closingActions.js.map +1 -1
  248. package/dist/shared/types/finding.js +2 -2
  249. package/dist/shared/types/finding.js.map +1 -1
  250. package/dist/shared/types/stepContract.js +1 -1
  251. package/dist/shared/types/stepContract.js.map +1 -1
  252. package/dist/shared/validation/findingGrounding.d.ts +1 -0
  253. package/dist/shared/validation/findingGrounding.d.ts.map +1 -1
  254. package/dist/shared/validation/findingGrounding.js +1 -0
  255. package/dist/shared/validation/findingGrounding.js.map +1 -1
  256. package/dist/shared/validation/producerBoundary.d.ts +10 -0
  257. package/dist/shared/validation/producerBoundary.d.ts.map +1 -0
  258. package/dist/shared/validation/producerBoundary.js +26 -0
  259. package/dist/shared/validation/producerBoundary.js.map +1 -0
  260. package/docs/audit-pkg/contracts.md +6 -2
  261. package/docs/audit-pkg/operator-guide.md +13 -4
  262. package/package.json +5 -1
@@ -1,8 +1,10 @@
1
+ // sites-pinned: tests/audit/frozen-snapshot.test.ts
1
2
  import { readJsonFile } from "audit-tools/shared";
2
3
  import { resolve } from "node:path";
3
4
  import { loadArtifactBundle } from "../io/artifacts.js";
4
5
  import { validateAuditResults } from "../validation/auditResults.js";
5
6
  import { buildLineIndex } from "./lineIndex.js";
7
+ import { readRunSourceRoot } from "../io/runSnapshot.js";
6
8
  import { getArtifactsDir, getFlag, getRootDir } from "./args.js";
7
9
  export async function cmdValidateResults(argv) {
8
10
  const artifactsDir = getArtifactsDir(argv);
@@ -12,7 +14,7 @@ export async function cmdValidateResults(argv) {
12
14
  }
13
15
  const bundle = await loadArtifactBundle(artifactsDir);
14
16
  const lineIndex = bundle.repo_manifest
15
- ? await buildLineIndex(getRootDir(argv), bundle.repo_manifest)
17
+ ? await buildLineIndex(await readRunSourceRoot(getRootDir(argv), artifactsDir), bundle.repo_manifest)
16
18
  : undefined;
17
19
  const auditResults = await readJsonFile(resultsPath);
18
20
  const issues = validateAuditResults(auditResults, bundle.audit_tasks ?? [], {
@@ -1 +1 @@
1
- {"version":3,"file":"validateResultsCommand.js","sourceRoot":"","sources":["../../../src/audit/cli/validateResultsCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEjE,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,IAAc;IACrD,MAAM,YAAY,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;IAC3C,MAAM,WAAW,GAAG,OAAO,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IAC/C,IAAI,CAAC,WAAW,EAAE,CAAC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,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC;IACxE,OAAO,CAAC,GAAG,CACT,IAAI,CAAC,SAAS,CACZ;QACE,aAAa,EAAE,YAAY;QAC3B,YAAY,EAAE,OAAO,CAAC,WAAW,CAAC;QAClC,aAAa,EAAE,QAAQ,CAAC,MAAM;QAC9B,WAAW,EAAE,MAAM,CAAC,MAAM;QAC1B,MAAM;KACP,EACD,IAAI,EACJ,CAAC,CACF,CACF,CAAC;IACF,OAAO,CAAC,QAAQ,GAAG,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC/C,CAAC"}
@@ -368,9 +368,9 @@ export declare const WorkerAuditTaskSchema: z.ZodObject<{
368
368
  status?: "pending" | "complete" | undefined;
369
369
  tags?: string[] | undefined;
370
370
  token_estimate?: number | undefined;
371
+ inputs?: Record<string, string> | undefined;
371
372
  completed_at?: string | undefined;
372
373
  file_line_counts?: Record<string, number> | undefined;
373
- inputs?: Record<string, string> | undefined;
374
374
  line_ranges?: {
375
375
  path: string;
376
376
  end: number;
@@ -397,9 +397,9 @@ export declare const WorkerAuditTaskSchema: z.ZodObject<{
397
397
  status?: "pending" | "complete" | undefined;
398
398
  tags?: string[] | undefined;
399
399
  token_estimate?: number | undefined;
400
+ inputs?: Record<string, string> | undefined;
400
401
  completed_at?: string | undefined;
401
402
  file_line_counts?: Record<string, number> | undefined;
402
- inputs?: Record<string, string> | undefined;
403
403
  line_ranges?: {
404
404
  path: string;
405
405
  end: number;
@@ -756,9 +756,9 @@ export declare const WorkerAuditResultSchema: z.ZodObject<{
756
756
  status?: "pending" | "complete" | undefined;
757
757
  tags?: string[] | undefined;
758
758
  token_estimate?: number | undefined;
759
+ inputs?: Record<string, string> | undefined;
759
760
  completed_at?: string | undefined;
760
761
  file_line_counts?: Record<string, number> | undefined;
761
- inputs?: Record<string, string> | undefined;
762
762
  line_ranges?: {
763
763
  path: string;
764
764
  end: number;
@@ -785,9 +785,9 @@ export declare const WorkerAuditResultSchema: z.ZodObject<{
785
785
  status?: "pending" | "complete" | undefined;
786
786
  tags?: string[] | undefined;
787
787
  token_estimate?: number | undefined;
788
+ inputs?: Record<string, string> | undefined;
788
789
  completed_at?: string | undefined;
789
790
  file_line_counts?: Record<string, number> | undefined;
790
- inputs?: Record<string, string> | undefined;
791
791
  line_ranges?: {
792
792
  path: string;
793
793
  end: number;
@@ -821,9 +821,9 @@ export declare const WorkerAuditResultSchema: z.ZodObject<{
821
821
  status?: "pending" | "complete" | undefined;
822
822
  tags?: string[] | undefined;
823
823
  token_estimate?: number | undefined;
824
+ inputs?: Record<string, string> | undefined;
824
825
  completed_at?: string | undefined;
825
826
  file_line_counts?: Record<string, number> | undefined;
826
- inputs?: Record<string, string> | undefined;
827
827
  line_ranges?: {
828
828
  path: string;
829
829
  end: number;
@@ -858,9 +858,9 @@ export declare const WorkerAuditResultSchema: z.ZodObject<{
858
858
  status?: "pending" | "complete" | undefined;
859
859
  tags?: string[] | undefined;
860
860
  token_estimate?: number | undefined;
861
+ inputs?: Record<string, string> | undefined;
861
862
  completed_at?: string | undefined;
862
863
  file_line_counts?: Record<string, number> | undefined;
863
- inputs?: Record<string, string> | undefined;
864
864
  line_ranges?: {
865
865
  path: string;
866
866
  end: number;
@@ -964,9 +964,9 @@ export declare const WorkerAuditResultSchema: z.ZodObject<{
964
964
  status?: "pending" | "complete" | undefined;
965
965
  tags?: string[] | undefined;
966
966
  token_estimate?: number | undefined;
967
+ inputs?: Record<string, string> | undefined;
967
968
  completed_at?: string | undefined;
968
969
  file_line_counts?: Record<string, number> | undefined;
969
- inputs?: Record<string, string> | undefined;
970
970
  line_ranges?: {
971
971
  path: string;
972
972
  end: number;
@@ -1074,9 +1074,9 @@ export declare const WorkerAuditResultSchema: z.ZodObject<{
1074
1074
  status?: "pending" | "complete" | undefined;
1075
1075
  tags?: string[] | undefined;
1076
1076
  token_estimate?: number | undefined;
1077
+ inputs?: Record<string, string> | undefined;
1077
1078
  completed_at?: string | undefined;
1078
1079
  file_line_counts?: Record<string, number> | undefined;
1079
- inputs?: Record<string, string> | undefined;
1080
1080
  line_ranges?: {
1081
1081
  path: string;
1082
1082
  end: number;
@@ -1441,9 +1441,9 @@ export declare const WorkerAuditResultsSchema: z.ZodArray<z.ZodObject<{
1441
1441
  status?: "pending" | "complete" | undefined;
1442
1442
  tags?: string[] | undefined;
1443
1443
  token_estimate?: number | undefined;
1444
+ inputs?: Record<string, string> | undefined;
1444
1445
  completed_at?: string | undefined;
1445
1446
  file_line_counts?: Record<string, number> | undefined;
1446
- inputs?: Record<string, string> | undefined;
1447
1447
  line_ranges?: {
1448
1448
  path: string;
1449
1449
  end: number;
@@ -1470,9 +1470,9 @@ export declare const WorkerAuditResultsSchema: z.ZodArray<z.ZodObject<{
1470
1470
  status?: "pending" | "complete" | undefined;
1471
1471
  tags?: string[] | undefined;
1472
1472
  token_estimate?: number | undefined;
1473
+ inputs?: Record<string, string> | undefined;
1473
1474
  completed_at?: string | undefined;
1474
1475
  file_line_counts?: Record<string, number> | undefined;
1475
- inputs?: Record<string, string> | undefined;
1476
1476
  line_ranges?: {
1477
1477
  path: string;
1478
1478
  end: number;
@@ -1506,9 +1506,9 @@ export declare const WorkerAuditResultsSchema: z.ZodArray<z.ZodObject<{
1506
1506
  status?: "pending" | "complete" | undefined;
1507
1507
  tags?: string[] | undefined;
1508
1508
  token_estimate?: number | undefined;
1509
+ inputs?: Record<string, string> | undefined;
1509
1510
  completed_at?: string | undefined;
1510
1511
  file_line_counts?: Record<string, number> | undefined;
1511
- inputs?: Record<string, string> | undefined;
1512
1512
  line_ranges?: {
1513
1513
  path: string;
1514
1514
  end: number;
@@ -1543,9 +1543,9 @@ export declare const WorkerAuditResultsSchema: z.ZodArray<z.ZodObject<{
1543
1543
  status?: "pending" | "complete" | undefined;
1544
1544
  tags?: string[] | undefined;
1545
1545
  token_estimate?: number | undefined;
1546
+ inputs?: Record<string, string> | undefined;
1546
1547
  completed_at?: string | undefined;
1547
1548
  file_line_counts?: Record<string, number> | undefined;
1548
- inputs?: Record<string, string> | undefined;
1549
1549
  line_ranges?: {
1550
1550
  path: string;
1551
1551
  end: number;
@@ -1649,9 +1649,9 @@ export declare const WorkerAuditResultsSchema: z.ZodArray<z.ZodObject<{
1649
1649
  status?: "pending" | "complete" | undefined;
1650
1650
  tags?: string[] | undefined;
1651
1651
  token_estimate?: number | undefined;
1652
+ inputs?: Record<string, string> | undefined;
1652
1653
  completed_at?: string | undefined;
1653
1654
  file_line_counts?: Record<string, number> | undefined;
1654
- inputs?: Record<string, string> | undefined;
1655
1655
  line_ranges?: {
1656
1656
  path: string;
1657
1657
  end: number;
@@ -1759,9 +1759,9 @@ export declare const WorkerAuditResultsSchema: z.ZodArray<z.ZodObject<{
1759
1759
  status?: "pending" | "complete" | undefined;
1760
1760
  tags?: string[] | undefined;
1761
1761
  token_estimate?: number | undefined;
1762
+ inputs?: Record<string, string> | undefined;
1762
1763
  completed_at?: string | undefined;
1763
1764
  file_line_counts?: Record<string, number> | undefined;
1764
- inputs?: Record<string, string> | undefined;
1765
1765
  line_ranges?: {
1766
1766
  path: string;
1767
1767
  end: number;
@@ -1,9 +1,22 @@
1
1
  import type { RepoManifest } from "../types.js";
2
2
  export interface IntakeOptions {
3
3
  root: string;
4
+ /**
5
+ * The manifest's name. A run reads a frozen snapshot whose directory name is
6
+ * not the repository's, so the caller names the manifest after the LIVE root;
7
+ * defaults to the basename of `root`.
8
+ */
9
+ name?: string;
4
10
  ignore?: string[];
5
11
  hash_files?: boolean;
6
12
  max_file_size_bytes?: number;
7
13
  }
14
+ /**
15
+ * True when intake skips `relativePath` — its default set plus `extra` (the
16
+ * repository's `.auditorignore` rules). The one rule a frozen copy of a non-git
17
+ * root (`runSnapshot.ts`) uses to decide what it links instead of copying, so
18
+ * the copy and the walk can never disagree about what intake reads.
19
+ */
20
+ export declare function isIntakeIgnored(relativePath: string, extra?: readonly string[]): boolean;
8
21
  export declare function buildRepoManifestFromFs(options: IntakeOptions): Promise<RepoManifest>;
9
22
  //# sourceMappingURL=fsIntake.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fsIntake.d.ts","sourceRoot":"","sources":["../../../src/audit/extractors/fsIntake.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGhD,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAuGD,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,YAAY,CAAC,CAavB"}
1
+ {"version":3,"file":"fsIntake.d.ts","sourceRoot":"","sources":["../../../src/audit/extractors/fsIntake.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGhD,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAiBD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,GAAE,SAAS,MAAM,EAAO,GAAG,OAAO,CAE5F;AAwFD,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,YAAY,CAAC,CAavB"}
@@ -1,3 +1,4 @@
1
+ // sites-pinned: tests/audit/frozen-snapshot.test.ts, tests/audit/run-snapshot.test.ts
1
2
  import { readdir, readFile, stat } from "node:fs/promises";
2
3
  import { hashContent, toPosixPath } from "audit-tools/shared";
3
4
  import { join, relative, resolve } from "node:path";
@@ -16,6 +17,15 @@ const DEFAULT_IGNORES = [
16
17
  ".claude",
17
18
  "coverage",
18
19
  ];
20
+ /**
21
+ * True when intake skips `relativePath` — its default set plus `extra` (the
22
+ * repository's `.auditorignore` rules). The one rule a frozen copy of a non-git
23
+ * root (`runSnapshot.ts`) uses to decide what it links instead of copying, so
24
+ * the copy and the walk can never disagree about what intake reads.
25
+ */
26
+ export function isIntakeIgnored(relativePath, extra = []) {
27
+ return shouldIgnore(relativePath, [...DEFAULT_IGNORES, ...extra]);
28
+ }
19
29
  function shouldIgnore(relativePath, ignores) {
20
30
  const normalized = toPosixPath(relativePath);
21
31
  return ignores.some((ignore) => {
@@ -87,6 +97,6 @@ export async function buildRepoManifestFromFs(options) {
87
97
  maxFileSizeBytes: options.max_file_size_bytes ?? 1024 * 1024,
88
98
  };
89
99
  await walk(ctx, root, files);
90
- return buildRepoManifest(root.split(/[\\/]/).pop() ?? "repo", files);
100
+ return buildRepoManifest(options.name ?? root.split(/[\\/]/).pop() ?? "repo", files);
91
101
  }
92
102
  //# sourceMappingURL=fsIntake.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fsIntake.js","sourceRoot":"","sources":["../../../src/audit/extractors/fsIntake.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AASvD,MAAM,eAAe,GAAG;IACtB,MAAM;IACN,cAAc;IACd,MAAM;IACN,OAAO;IACP,OAAO;IACP,QAAQ;IACR,YAAY;IACZ,cAAc;IACd,qBAAqB;IACrB,QAAQ;IACR,SAAS;IACT,UAAU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KAAK,GAA+D,EAAE,CAAC;IAE7E,MAAM,GAAG,GAAgB;QACvB,IAAI;QACJ,OAAO,EAAE,MAAM;QACf,SAAS,EAAE,OAAO,CAAC,UAAU,IAAI,KAAK;QACtC,gBAAgB,EAAE,OAAO,CAAC,mBAAmB,IAAI,IAAI,GAAG,IAAI;KAC7D,CAAC;IACF,MAAM,IAAI,CAAC,GAAG,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;IAC7B,OAAO,iBAAiB,CAAC,OAAO,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,IAAI,MAAM,EAAE,KAAK,CAAC,CAAC;AACvF,CAAC"}
@@ -1,4 +1,4 @@
1
- import { cp, rm } from "node:fs/promises";
1
+ import { cp } from "node:fs/promises";
2
2
  import { AUDIT_REPORT_FILENAME } from "audit-tools/shared";
3
3
  import type { AuditResult, AuditTask, CoverageMatrix, RepoManifest, UnitManifest } from "../types.js";
4
4
  import type { AuditState } from "../types/auditState.js";
@@ -178,20 +178,46 @@ export declare function loadArtifactBundle(root: string): Promise<ArtifactBundle
178
178
  export declare function writeCoreArtifacts(root: string, bundle: ArtifactBundle, options?: {
179
179
  prune?: boolean;
180
180
  }): Promise<void>;
181
+ /**
182
+ * Archive the run's append-only diagnostics one level up — agent feedback,
183
+ * friction records and the submission ledger — and name every member that did
184
+ * not archive. Promotion runs it; so does the next run's rollover
185
+ * (`rollOverFinishedRun`), because a host may append to these after promotion
186
+ * and the rollover deletes them.
187
+ */
188
+ export declare function archiveRunDiagnostics(params: {
189
+ artifactsDir: string;
190
+ }, options?: {
191
+ copy?: typeof cp;
192
+ warn?: (message: string) => void;
193
+ }): Promise<{
194
+ lost: string[];
195
+ ledger_dropped: SubmissionLedgerDrop[];
196
+ }>;
197
+ /**
198
+ * Promote the run's deliverables one level up and ARCHIVE every member that
199
+ * the next run's rollover (`rollOverFinishedRun`) will delete: the findings
200
+ * contract, agent feedback, friction records and the submission ledger. The
201
+ * working dir itself is KEPT (owner decision 2026-10-08, "keep the artifacts
202
+ * dir"): the next run reuses its derived artifacts through the staleness DAG.
203
+ * `archived` is the rollover's gate (through `isWorkingDirFullyPromoted`): a
204
+ * member that did not archive keeps the dir from being rolled over, so its only
205
+ * copy is never deleted.
206
+ */
181
207
  export declare function promoteFinalAuditReport(params: {
182
208
  artifactsDir: string;
183
209
  }, options?: {
184
210
  copy?: typeof cp;
185
- remove?: typeof rm;
186
211
  warn?: (message: string) => void;
187
212
  }): Promise<{
188
213
  promoted: boolean;
189
- cleaned: boolean;
214
+ /** Every archive member is verified one level up (INV 1). */
215
+ archived: boolean;
190
216
  warning?: string;
191
217
  /**
192
- * Artifacts that could NOT be archived before the cleanup. Non-empty means the
193
- * delete was ABORTED, so a caller reading { promoted: true, cleaned: true } can
194
- * trust that nothing was lost — which is exactly what it could not do while a
218
+ * Artifacts that could NOT be archived. Non-empty means `archived` is false,
219
+ * so a caller reading { promoted: true, archived: true } can trust that
220
+ * nothing will be lost — which is exactly what it could not do while a
195
221
  * findings-copy failure was a `warn()` with no effect on the returned shape
196
222
  * (INV 3 / DAT-4802dc9e-2, -3).
197
223
  */
@@ -205,12 +231,12 @@ export declare function promoteFinalAuditReport(params: {
205
231
  /**
206
232
  * Has the completion transition NOTHING left to do for this working dir — is
207
233
  * every artifact `promoteFinalAuditReport` archives already one level up,
208
- * byte-identical? This is the stale-dir cleanup rule's question
234
+ * byte-identical? This is the stale-dir rule's question
209
235
  * (`cleanupStaleArtifactsDir`), and it is answered by promotion's OWN archive
210
236
  * walk rather than by a second enumeration of the archive set: the walk runs
211
237
  * with its copy replaced by a byte comparison against what is already at each
212
- * destination and its delete replaced by a no-op, so "fully promoted" means
213
- * exactly "the delete gate (INV 1) would pass without copying anything". A
238
+ * destination, so "fully promoted" means exactly "the archive gate (INV 1)
239
+ * would pass without copying anything". A
214
240
  * member promotion archives is a member this walk checks; the two cannot drift.
215
241
  *
216
242
  * Identity, not existence: a destination that is missing, or that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;;;;;;;;;;;GAiBG;AACH,wBAAsB,yBAAyB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAyBtF"}
@@ -1,5 +1,5 @@
1
1
  import { AuditTaskSchema, AuditResultSchema, CoverageMatrixSchema } from "../types.js";
2
- import { cp, readFile, rm, unlink } from "node:fs/promises";
2
+ import { cp, readFile, unlink } from "node:fs/promises";
3
3
  import { dirname, join } from "node:path";
4
4
  import { AuditFindingsReportSchema, AUDIT_REPORT_FILENAME, AUDIT_FINDINGS_FILENAME, archiveFrictionRecords, listFrictionRecordFilenames, auditReportPath, auditFindingsPath, promotedAuditReportPath, promotedAuditFindingsPath, readSubmissionLedger, submissionLedgerPath, } from "audit-tools/shared";
5
5
  import { loadDesignReviewSnapshots, } from "../orchestrator/designReviewSnapshot.js";
@@ -259,48 +259,20 @@ async function archiveVerified(copyFn, from, to) {
259
259
  await copyFn(from, to, { force: true });
260
260
  return verifyArchivedBytes(to, sourceBytes);
261
261
  }
262
- export async function promoteFinalAuditReport(params, options = {}) {
262
+ /**
263
+ * Archive the run's append-only diagnostics one level up — agent feedback,
264
+ * friction records and the submission ledger — and name every member that did
265
+ * not archive. Promotion runs it; so does the next run's rollover
266
+ * (`rollOverFinishedRun`), because a host may append to these after promotion
267
+ * and the rollover deletes them.
268
+ */
269
+ export async function archiveRunDiagnostics(params, options = {}) {
263
270
  const lost = [];
264
- const source = auditReportPath(params.artifactsDir);
265
271
  const destination = promotedAuditReportPath(params.artifactsDir);
266
272
  const copy = options.copy ?? cp;
267
- const remove = options.remove ?? rm;
268
273
  const warn = options.warn ?? ((message) => process.stderr.write(`${message}\n`));
269
- try {
270
- await copy(source, destination, { force: true });
271
- }
272
- catch (error) {
273
- const warning = `audit-code: completed audit but could not promote final report to ${destination}: ` +
274
- (error instanceof Error ? error.message : String(error));
275
- warn(warning);
276
- return { promoted: false, cleaned: false, warning };
277
- }
278
- // Promote the canonical machine contract alongside the human report. Missing
279
- // (e.g. legacy bundle) or unreadable: best-effort, never blocks completion.
280
- try {
281
- const mismatch = await archiveVerified(copy, auditFindingsPath(params.artifactsDir), promotedAuditFindingsPath(params.artifactsDir));
282
- if (mismatch)
283
- lost.push(AUDIT_FINDINGS_FILENAME + " (" + mismatch + ")");
284
- }
285
- catch (error) {
286
- // The warning is unchanged — an absent findings file (the legacy-bundle
287
- // case) still announces a partial promotion. What changed is the DELETE
288
- // GATE: an absent file has nothing to lose, but any OTHER failure means the
289
- // machine contract is about to be destroyed by the rm below with no copy
290
- // anywhere, and warning-and-proceeding turned that into silent data loss
291
- // reported as { promoted: true, cleaned: true }.
292
- warn(`audit-code: could not promote ${AUDIT_FINDINGS_FILENAME} to ${promotedAuditFindingsPath(params.artifactsDir)}: ` +
293
- (error instanceof Error ? error.message : String(error)));
294
- // An ABSENT findings file (the legacy-bundle case) has nothing to lose. Any
295
- // other failure means the machine contract is about to be destroyed by the
296
- // rm below with no copy anywhere — DAT-4802dc9e-2 / -3 — so it is recorded
297
- // as loss and gates the delete.
298
- if (!isFileMissingError(error)) {
299
- lost.push(`${AUDIT_FINDINGS_FILENAME} (${error instanceof Error ? error.message : String(error)})`);
300
- }
301
- }
302
274
  // agent-feedback.jsonl is worker-owned, append-only, and lives inside
303
- // artifactsDir — so the rm below destroys it. It had no archive step at all
275
+ // artifactsDir — so the rollover destroys it. It had no archive step at all
304
276
  // while the friction records and the ledger beside it both had one
305
277
  // (DAT-4802dc9e).
306
278
  try {
@@ -317,8 +289,8 @@ export async function promoteFinalAuditReport(params, options = {}) {
317
289
  // Records may be untriaged: development reflection is not a product gate.
318
290
  // The RETURN is consumed, not discarded. `archiveFrictionRecords` warns per
319
291
  // failed file and simply omits it from the archived list, so dropping the
320
- // return meant a friction record that failed to copy was destroyed by the rm
321
- // below with nothing gating it - the same class as the findings and ledger
292
+ // return meant a friction record that failed to copy was destroyed by the
293
+ // delete with nothing gating it - the same class as the findings and ledger
322
294
  // archives beside it. Comparing the archived count against what is on disk
323
295
  // surfaces a per-file failure without reaching into that module's internals.
324
296
  // The listing is the SAME helper `archiveFrictionRecords` walks, so the two
@@ -327,10 +299,10 @@ export async function promoteFinalAuditReport(params, options = {}) {
327
299
  // AN UNLISTABLE DIR IS A SHORTFALL, not an empty one. The listing used to
328
300
  // return `[]` for every readdir failure alike, and the archive that walks the
329
301
  // same helper degraded the same way — so both sides read zero, the comparison
330
- // below was satisfied, and the rm destroyed a directory full of records with
331
- // nothing gating it. It now throws on anything but ENOENT: an absent dir
302
+ // below was satisfied, and the delete destroyed a directory full of records
303
+ // with nothing gating it. It now throws on anything but ENOENT: an absent dir
332
304
  // really has nothing to lose, any other errno means records may exist and
333
- // were NOT archived, so the delete is refused — the same answer an
305
+ // were NOT archived, so the rollover is refused — the same answer an
334
306
  // unarchivable FILE already gets (the CP-NODE-3 residual: "an unlistable
335
307
  // directory refuses the delete, same as an unarchivable file").
336
308
  let frictionNames = [];
@@ -356,7 +328,7 @@ export async function promoteFinalAuditReport(params, options = {}) {
356
328
  }
357
329
  // The submission ledger rides the same seam. It is the only durable statement
358
330
  // that a run drifted and was repaired — a rejection, a re-emit, a hand
359
- // recovery — so letting the tree rm take it would mean the distinction
331
+ // recovery — so letting the rollover take it would mean the distinction
360
332
  // between a clean run and a repaired one survives only in a transcript.
361
333
  // Best-effort: a run that never drifted has no ledger to archive.
362
334
  const ledgerSource = submissionLedgerPath(params.artifactsDir);
@@ -376,50 +348,95 @@ export async function promoteFinalAuditReport(params, options = {}) {
376
348
  catch (error) {
377
349
  // A missing ledger is the ordinary case (nothing was ever submitted through
378
350
  // a gate) and says nothing. Any OTHER failure means the one durable record
379
- // that this run drifted is about to be destroyed by the rm below — so it is
351
+ // that this run drifted is about to be destroyed by the rollover — so it is
380
352
  // announced, exactly as the friction-archive seam announces its own copy
381
353
  // failures. Still best-effort: bookkeeping must not fail a completed audit.
382
354
  if (!isFileMissingError(error)) {
383
- // GATES THE DELETE, like every other member of the archive set. Warning
355
+ // GATES THE ROLLOVER, like every other member of the archive set. Warning
384
356
  // and falling through meant the one durable statement that this run
385
- // drifted and was repaired got destroyed by the rm below - the exact loss
357
+ // drifted and was repaired got destroyed by the rollover - the exact loss
386
358
  // the ledger exists to prevent, with only a console line left behind.
387
359
  lost.push("the submission ledger (" +
388
360
  (error instanceof Error ? error.message : String(error)) + ")");
389
361
  }
390
362
  }
391
- const dropped = ledgerDropped.length > 0 ? { ledger_dropped: ledgerDropped } : {};
392
- // THE DELETE IS CONDITIONED ON VERIFIED COPIES (INV 1). Anything that failed
393
- // to archive still exists only inside artifactsDir, so removing it destroys
394
- // the sole copy. Keeping the directory is always recoverable; the delete is
395
- // not — REL-4802dc9e.
396
- if (lost.length > 0) {
397
- const warning = `audit-code: promoted final report to ${destination}, but could NOT archive ` +
398
- `${lost.join("; ")} — leaving ${params.artifactsDir} in place rather than ` +
399
- "destroying the only copy. Recover those files, then remove the directory by hand.";
363
+ return { lost, ledger_dropped: [...ledgerDropped] };
364
+ }
365
+ /**
366
+ * Promote the run's deliverables one level up and ARCHIVE every member that
367
+ * the next run's rollover (`rollOverFinishedRun`) will delete: the findings
368
+ * contract, agent feedback, friction records and the submission ledger. The
369
+ * working dir itself is KEPT (owner decision 2026-10-08, "keep the artifacts
370
+ * dir"): the next run reuses its derived artifacts through the staleness DAG.
371
+ * `archived` is the rollover's gate (through `isWorkingDirFullyPromoted`): a
372
+ * member that did not archive keeps the dir from being rolled over, so its only
373
+ * copy is never deleted.
374
+ */
375
+ export async function promoteFinalAuditReport(params, options = {}) {
376
+ const lost = [];
377
+ const source = auditReportPath(params.artifactsDir);
378
+ const destination = promotedAuditReportPath(params.artifactsDir);
379
+ const copy = options.copy ?? cp;
380
+ const warn = options.warn ?? ((message) => process.stderr.write(`${message}\n`));
381
+ try {
382
+ await copy(source, destination, { force: true });
383
+ }
384
+ catch (error) {
385
+ const warning = `audit-code: completed audit but could not promote final report to ${destination}: ` +
386
+ (error instanceof Error ? error.message : String(error));
400
387
  warn(warning);
401
- return { promoted: true, cleaned: false, warning, unarchived: lost, ...dropped };
388
+ return { promoted: false, archived: false, warning };
402
389
  }
390
+ // Promote the canonical machine contract alongside the human report. Missing
391
+ // (e.g. legacy bundle) or unreadable: best-effort, never blocks completion.
403
392
  try {
404
- await remove(params.artifactsDir, { recursive: true, force: true });
405
- return { promoted: true, cleaned: true, ...dropped };
393
+ const mismatch = await archiveVerified(copy, auditFindingsPath(params.artifactsDir), promotedAuditFindingsPath(params.artifactsDir));
394
+ if (mismatch)
395
+ lost.push(AUDIT_FINDINGS_FILENAME + " (" + mismatch + ")");
406
396
  }
407
397
  catch (error) {
408
- const warning = `audit-code: promoted final report to ${destination}, but could not remove ${params.artifactsDir}: ` +
409
- (error instanceof Error ? error.message : String(error));
398
+ // The warning is unchanged — an absent findings file (the legacy-bundle
399
+ // case) still announces a partial promotion. What changed is the DELETE
400
+ // GATE: an absent file has nothing to lose, but any OTHER failure means the
401
+ // machine contract is about to be destroyed by the rollover with no copy
402
+ // anywhere, and warning-and-proceeding turned that into silent data loss
403
+ // reported as { promoted: true, cleaned: true }.
404
+ warn(`audit-code: could not promote ${AUDIT_FINDINGS_FILENAME} to ${promotedAuditFindingsPath(params.artifactsDir)}: ` +
405
+ (error instanceof Error ? error.message : String(error)));
406
+ // An ABSENT findings file (the legacy-bundle case) has nothing to lose. Any
407
+ // other failure means the machine contract is about to be destroyed by the
408
+ // rollover with no copy anywhere — DAT-4802dc9e-2 / -3 — so it is recorded
409
+ // as loss and gates the delete.
410
+ if (!isFileMissingError(error)) {
411
+ lost.push(`${AUDIT_FINDINGS_FILENAME} (${error instanceof Error ? error.message : String(error)})`);
412
+ }
413
+ }
414
+ const diagnostics = await archiveRunDiagnostics({ artifactsDir: params.artifactsDir }, { copy, warn });
415
+ lost.push(...diagnostics.lost);
416
+ const ledgerDropped = diagnostics.ledger_dropped;
417
+ const dropped = ledgerDropped.length > 0 ? { ledger_dropped: ledgerDropped } : {};
418
+ // THE ROLLOVER IS CONDITIONED ON VERIFIED COPIES (INV 1). Anything that failed
419
+ // to archive still exists only inside artifactsDir, so rolling it over
420
+ // destroys the sole copy. Keeping the run is always recoverable; the delete
421
+ // is not — REL-4802dc9e.
422
+ if (lost.length > 0) {
423
+ const warning = `audit-code: promoted final report to ${destination}, but could NOT archive ` +
424
+ `${lost.join("; ")} — the next audit will not roll ${params.artifactsDir} over ` +
425
+ "while it holds the only copy. Recover those files, then run `audit-code cleanup --force`.";
410
426
  warn(warning);
411
- return { promoted: true, cleaned: false, warning, ...dropped };
427
+ return { promoted: true, archived: false, warning, unarchived: lost, ...dropped };
412
428
  }
429
+ return { promoted: true, archived: true, ...dropped };
413
430
  }
414
431
  /**
415
432
  * Has the completion transition NOTHING left to do for this working dir — is
416
433
  * every artifact `promoteFinalAuditReport` archives already one level up,
417
- * byte-identical? This is the stale-dir cleanup rule's question
434
+ * byte-identical? This is the stale-dir rule's question
418
435
  * (`cleanupStaleArtifactsDir`), and it is answered by promotion's OWN archive
419
436
  * walk rather than by a second enumeration of the archive set: the walk runs
420
437
  * with its copy replaced by a byte comparison against what is already at each
421
- * destination and its delete replaced by a no-op, so "fully promoted" means
422
- * exactly "the delete gate (INV 1) would pass without copying anything". A
438
+ * destination, so "fully promoted" means exactly "the archive gate (INV 1)
439
+ * would pass without copying anything". A
423
440
  * member promotion archives is a member this walk checks; the two cannot drift.
424
441
  *
425
442
  * Identity, not existence: a destination that is missing, or that differs from
@@ -448,7 +465,7 @@ export async function isWorkingDirFullyPromoted(artifactsDir) {
448
465
  throw new Error(`not promoted: ${String(to)} differs from ${String(from)}`);
449
466
  }
450
467
  };
451
- const result = await promoteFinalAuditReport({ artifactsDir }, { copy: verifyOnly, remove: async () => { }, warn: () => { } });
452
- return result.promoted && result.cleaned;
468
+ const result = await promoteFinalAuditReport({ artifactsDir }, { copy: verifyOnly, warn: () => { } });
469
+ return result.promoted && result.archived;
453
470
  }
454
471
  //# sourceMappingURL=artifacts.js.map