audit-tools 0.41.1 → 0.42.1

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 (209) hide show
  1. package/dist/audit/cli/args.d.ts +0 -1
  2. package/dist/audit/cli/args.d.ts.map +1 -1
  3. package/dist/audit/cli/args.js +0 -7
  4. package/dist/audit/cli/args.js.map +1 -1
  5. package/dist/audit/cli/auditStep.d.ts +18 -0
  6. package/dist/audit/cli/auditStep.d.ts.map +1 -1
  7. package/dist/audit/cli/auditStep.js +35 -1
  8. package/dist/audit/cli/auditStep.js.map +1 -1
  9. package/dist/audit/cli/cleanup.d.ts +1 -0
  10. package/dist/audit/cli/cleanup.d.ts.map +1 -1
  11. package/dist/audit/cli/cleanup.js +22 -7
  12. package/dist/audit/cli/cleanup.js.map +1 -1
  13. package/dist/audit/cli/confirmIntentStep.d.ts.map +1 -1
  14. package/dist/audit/cli/confirmIntentStep.js +11 -0
  15. package/dist/audit/cli/confirmIntentStep.js.map +1 -1
  16. package/dist/audit/cli/dispatch/hostHandoff.d.ts.map +1 -1
  17. package/dist/audit/cli/dispatch/hostHandoff.js +19 -1
  18. package/dist/audit/cli/dispatch/hostHandoff.js.map +1 -1
  19. package/dist/audit/cli/envelope.d.ts +0 -24
  20. package/dist/audit/cli/envelope.d.ts.map +1 -1
  21. package/dist/audit/cli/envelope.js +0 -18
  22. package/dist/audit/cli/envelope.js.map +1 -1
  23. package/dist/audit/cli/fanoutLanes.d.ts +24 -0
  24. package/dist/audit/cli/fanoutLanes.d.ts.map +1 -1
  25. package/dist/audit/cli/fanoutLanes.js +46 -2
  26. package/dist/audit/cli/fanoutLanes.js.map +1 -1
  27. package/dist/audit/cli/nextStepCommand.d.ts.map +1 -1
  28. package/dist/audit/cli/nextStepCommand.js +19 -24
  29. package/dist/audit/cli/nextStepCommand.js.map +1 -1
  30. package/dist/audit/cli/nextStepHelpers.d.ts.map +1 -1
  31. package/dist/audit/cli/nextStepHelpers.js +20 -6
  32. package/dist/audit/cli/nextStepHelpers.js.map +1 -1
  33. package/dist/audit/cli/workerResult.d.ts +0 -13
  34. package/dist/audit/cli/workerResult.d.ts.map +1 -1
  35. package/dist/audit/cli/workerResult.js +0 -15
  36. package/dist/audit/cli/workerResult.js.map +1 -1
  37. package/dist/audit/contracts/workerSchemas.d.ts +13 -83
  38. package/dist/audit/contracts/workerSchemas.d.ts.map +1 -1
  39. package/dist/audit/contracts/workerSchemas.js +10 -4
  40. package/dist/audit/contracts/workerSchemas.js.map +1 -1
  41. package/dist/audit/orchestrator/advance.d.ts +30 -0
  42. package/dist/audit/orchestrator/advance.d.ts.map +1 -1
  43. package/dist/audit/orchestrator/advance.js +45 -2
  44. package/dist/audit/orchestrator/advance.js.map +1 -1
  45. package/dist/audit/orchestrator/designReviewPrompt.d.ts.map +1 -1
  46. package/dist/audit/orchestrator/designReviewPrompt.js +6 -4
  47. package/dist/audit/orchestrator/designReviewPrompt.js.map +1 -1
  48. package/dist/audit/orchestrator/intentCheckpointExecutor.d.ts +8 -0
  49. package/dist/audit/orchestrator/intentCheckpointExecutor.d.ts.map +1 -1
  50. package/dist/audit/orchestrator/intentCheckpointExecutor.js +2 -0
  51. package/dist/audit/orchestrator/intentCheckpointExecutor.js.map +1 -1
  52. package/dist/audit/orchestrator/partitionTaskGraph.d.ts.map +1 -1
  53. package/dist/audit/orchestrator/partitionTaskGraph.js +2 -2
  54. package/dist/audit/orchestrator/partitionTaskGraph.js.map +1 -1
  55. package/dist/audit/orchestrator/reviewPacketSizing.d.ts +0 -1
  56. package/dist/audit/orchestrator/reviewPacketSizing.d.ts.map +1 -1
  57. package/dist/audit/orchestrator/reviewPacketSizing.js +0 -5
  58. package/dist/audit/orchestrator/reviewPacketSizing.js.map +1 -1
  59. package/dist/audit/orchestrator/reviewPackets.d.ts +8 -2
  60. package/dist/audit/orchestrator/reviewPackets.d.ts.map +1 -1
  61. package/dist/audit/orchestrator/reviewPackets.js +7 -8
  62. package/dist/audit/orchestrator/reviewPackets.js.map +1 -1
  63. package/dist/audit/orchestrator/taskAffinityGraph.d.ts +0 -6
  64. package/dist/audit/orchestrator/taskAffinityGraph.d.ts.map +1 -1
  65. package/dist/audit/orchestrator/taskAffinityGraph.js +0 -16
  66. package/dist/audit/orchestrator/taskAffinityGraph.js.map +1 -1
  67. package/dist/audit/orchestrator/taskBuilder.d.ts.map +1 -1
  68. package/dist/audit/orchestrator/taskBuilder.js +1 -2
  69. package/dist/audit/orchestrator/taskBuilder.js.map +1 -1
  70. package/dist/audit/reporting/synthesis.d.ts.map +1 -1
  71. package/dist/audit/reporting/synthesis.js +2 -3
  72. package/dist/audit/reporting/synthesis.js.map +1 -1
  73. package/dist/audit/reporting/workBlocks.d.ts +0 -1
  74. package/dist/audit/reporting/workBlocks.d.ts.map +1 -1
  75. package/dist/audit/reporting/workBlocks.js +4 -41
  76. package/dist/audit/reporting/workBlocks.js.map +1 -1
  77. package/dist/audit/systemic/systemicChallengeLoop.d.ts +0 -8
  78. package/dist/audit/systemic/systemicChallengeLoop.d.ts.map +1 -1
  79. package/dist/audit/systemic/systemicChallengeLoop.js +0 -9
  80. package/dist/audit/systemic/systemicChallengeLoop.js.map +1 -1
  81. package/dist/audit/types.d.ts +4 -4
  82. package/dist/remediate/contractPipeline/artifactStore.d.ts +19 -23
  83. package/dist/remediate/contractPipeline/artifactStore.d.ts.map +1 -1
  84. package/dist/remediate/contractPipeline/artifactStore.js +22 -29
  85. package/dist/remediate/contractPipeline/artifactStore.js.map +1 -1
  86. package/dist/remediate/contractPipeline/changeClassification.d.ts +0 -12
  87. package/dist/remediate/contractPipeline/changeClassification.d.ts.map +1 -1
  88. package/dist/remediate/contractPipeline/changeClassification.js +0 -101
  89. package/dist/remediate/contractPipeline/changeClassification.js.map +1 -1
  90. package/dist/remediate/contractPipeline/derive.d.ts +0 -42
  91. package/dist/remediate/contractPipeline/derive.d.ts.map +1 -1
  92. package/dist/remediate/contractPipeline/derive.js +0 -108
  93. package/dist/remediate/contractPipeline/derive.js.map +1 -1
  94. package/dist/remediate/index.d.ts +0 -1
  95. package/dist/remediate/index.d.ts.map +1 -1
  96. package/dist/remediate/index.js +5 -132
  97. package/dist/remediate/index.js.map +1 -1
  98. package/dist/remediate/intake.d.ts +0 -55
  99. package/dist/remediate/intake.d.ts.map +1 -1
  100. package/dist/remediate/intake.js +1 -81
  101. package/dist/remediate/intake.js.map +1 -1
  102. package/dist/remediate/phases/plan.d.ts +0 -1
  103. package/dist/remediate/phases/plan.d.ts.map +1 -1
  104. package/dist/remediate/phases/plan.js +1 -207
  105. package/dist/remediate/phases/plan.js.map +1 -1
  106. package/dist/remediate/state/types.d.ts +4 -4
  107. package/dist/remediate/steps/contractPipeline.d.ts.map +1 -1
  108. package/dist/remediate/steps/contractPipeline.js +15 -12
  109. package/dist/remediate/steps/contractPipeline.js.map +1 -1
  110. package/dist/remediate/steps/contractPipelinePrompts.d.ts +9 -9
  111. package/dist/remediate/steps/contractPipelinePrompts.d.ts.map +1 -1
  112. package/dist/remediate/steps/contractPipelinePrompts.js +26 -18
  113. package/dist/remediate/steps/contractPipelinePrompts.js.map +1 -1
  114. package/dist/remediate/steps/dispatch/hostHandoff.d.ts +0 -1
  115. package/dist/remediate/steps/dispatch/hostHandoff.d.ts.map +1 -1
  116. package/dist/remediate/steps/dispatch/hostHandoff.js +3 -2
  117. package/dist/remediate/steps/dispatch/hostHandoff.js.map +1 -1
  118. package/dist/remediate/steps/dispatch.d.ts +0 -8
  119. package/dist/remediate/steps/dispatch.d.ts.map +1 -1
  120. package/dist/remediate/steps/dispatch.js +3 -9
  121. package/dist/remediate/steps/dispatch.js.map +1 -1
  122. package/dist/remediate/steps/nextStep.d.ts +0 -1
  123. package/dist/remediate/steps/nextStep.d.ts.map +1 -1
  124. package/dist/remediate/steps/nextStep.js +0 -1
  125. package/dist/remediate/steps/nextStep.js.map +1 -1
  126. package/dist/remediate/utils/fileIntegrity.d.ts +0 -8
  127. package/dist/remediate/utils/fileIntegrity.d.ts.map +1 -1
  128. package/dist/remediate/utils/fileIntegrity.js +5 -65
  129. package/dist/remediate/utils/fileIntegrity.js.map +1 -1
  130. package/dist/remediate/validation/contractPipelineGates.d.ts.map +1 -1
  131. package/dist/remediate/validation/contractPipelineGates.js +27 -19
  132. package/dist/remediate/validation/contractPipelineGates.js.map +1 -1
  133. package/dist/shared/analyzers/candidates.d.ts +6 -6
  134. package/dist/shared/analyzers/candidates.d.ts.map +1 -1
  135. package/dist/shared/analyzers/candidates.js +6 -6
  136. package/dist/shared/analyzers/candidates.js.map +1 -1
  137. package/dist/shared/chunkByBudget.d.ts +8 -8
  138. package/dist/shared/decompose/contentCoherence.d.ts +43 -273
  139. package/dist/shared/decompose/contentCoherence.d.ts.map +1 -1
  140. package/dist/shared/decompose/contentCoherence.js +120 -63
  141. package/dist/shared/decompose/contentCoherence.js.map +1 -1
  142. package/dist/shared/decompose/modularity.d.ts +17 -0
  143. package/dist/shared/decompose/modularity.d.ts.map +1 -1
  144. package/dist/shared/decompose/modularity.js +78 -3
  145. package/dist/shared/decompose/modularity.js.map +1 -1
  146. package/dist/shared/decompose/systemicChallenge.d.ts +4 -4
  147. package/dist/shared/decompose/workBlockSeams.d.ts +45 -0
  148. package/dist/shared/decompose/workBlockSeams.d.ts.map +1 -0
  149. package/dist/shared/decompose/workBlockSeams.js +82 -0
  150. package/dist/shared/decompose/workBlockSeams.js.map +1 -0
  151. package/dist/shared/index.d.ts +6 -5
  152. package/dist/shared/index.d.ts.map +1 -1
  153. package/dist/shared/index.js +6 -4
  154. package/dist/shared/index.js.map +1 -1
  155. package/dist/shared/io/auditToolsPaths.d.ts +0 -20
  156. package/dist/shared/io/auditToolsPaths.d.ts.map +1 -1
  157. package/dist/shared/io/auditToolsPaths.js +0 -24
  158. package/dist/shared/io/auditToolsPaths.js.map +1 -1
  159. package/dist/shared/loopCorePaths.d.ts.map +1 -1
  160. package/dist/shared/loopCorePaths.js +15 -9
  161. package/dist/shared/loopCorePaths.js.map +1 -1
  162. package/dist/shared/reporting/auditDeliverable.d.ts.map +1 -1
  163. package/dist/shared/reporting/auditDeliverable.js +8 -3
  164. package/dist/shared/reporting/auditDeliverable.js.map +1 -1
  165. package/dist/shared/types/finding.d.ts +119 -317
  166. package/dist/shared/types/finding.d.ts.map +1 -1
  167. package/dist/shared/types/finding.js +38 -11
  168. package/dist/shared/types/finding.js.map +1 -1
  169. package/dist/shared/validation/findingGrounding.d.ts +11 -0
  170. package/dist/shared/validation/findingGrounding.d.ts.map +1 -1
  171. package/dist/shared/validation/findingGrounding.js +21 -0
  172. package/dist/shared/validation/findingGrounding.js.map +1 -1
  173. package/dist/shared/validation/findingsReport.d.ts.map +1 -1
  174. package/dist/shared/validation/findingsReport.js +19 -7
  175. package/dist/shared/validation/findingsReport.js.map +1 -1
  176. package/docs/audit-pkg/contracts.md +2 -2
  177. package/docs/audit-pkg/development.md +1 -1
  178. package/docs/audit-pkg/release.md +20 -114
  179. package/package.json +6 -2
  180. package/schemas/audit_result.schema.json +0 -20
  181. package/schemas/audit_results.schema.json +0 -20
  182. package/schemas/finding.schema.json +0 -20
  183. package/skills/audit-code/SKILL.md +3 -7
  184. package/skills/audit-code/audit-code.prompt.md +5 -9
  185. package/skills/remediate-code/SKILL.md +0 -1
  186. package/dist/remediate/steps/dispatch/common.d.ts +0 -126
  187. package/dist/remediate/steps/dispatch/common.d.ts.map +0 -1
  188. package/dist/remediate/steps/dispatch/common.js +0 -204
  189. package/dist/remediate/steps/dispatch/common.js.map +0 -1
  190. package/dist/remediate/steps/dispatch/dagNodeFields.d.ts +0 -25
  191. package/dist/remediate/steps/dispatch/dagNodeFields.d.ts.map +0 -1
  192. package/dist/remediate/steps/dispatch/dagNodeFields.js +0 -5
  193. package/dist/remediate/steps/dispatch/dagNodeFields.js.map +0 -1
  194. package/dist/remediate/steps/dispatch/implementPrompt.d.ts +0 -47
  195. package/dist/remediate/steps/dispatch/implementPrompt.d.ts.map +0 -1
  196. package/dist/remediate/steps/dispatch/implementPrompt.js +0 -165
  197. package/dist/remediate/steps/dispatch/implementPrompt.js.map +0 -1
  198. package/dist/remediate/steps/dispatch/verifyCommands.d.ts +0 -144
  199. package/dist/remediate/steps/dispatch/verifyCommands.d.ts.map +0 -1
  200. package/dist/remediate/steps/dispatch/verifyCommands.js +0 -331
  201. package/dist/remediate/steps/dispatch/verifyCommands.js.map +0 -1
  202. package/dist/remediate/steps/dispatch/writeScope.d.ts +0 -43
  203. package/dist/remediate/steps/dispatch/writeScope.d.ts.map +0 -1
  204. package/dist/remediate/steps/dispatch/writeScope.js +0 -81
  205. package/dist/remediate/steps/dispatch/writeScope.js.map +0 -1
  206. package/dist/remediate/utils/hostAssets.d.ts +0 -21
  207. package/dist/remediate/utils/hostAssets.d.ts.map +0 -1
  208. package/dist/remediate/utils/hostAssets.js +0 -34
  209. package/dist/remediate/utils/hostAssets.js.map +0 -1
@@ -27,13 +27,6 @@ current conversation, write its required result artifact, ingest it, and stop
27
27
  so the user can resume from fresh context. Do not invent a smaller task or an
28
28
  alternate execution path.
29
29
 
30
- ## Scope confirmation
31
-
32
- After intake, echo the repository root, auditable file count, and git
33
- availability from `scope_summary.json`. If `mis_scope_smells` is non-empty,
34
- show them and require confirmation before continuing. Otherwise the scope echo
35
- is informational and the workflow continues.
36
-
37
30
  ## Loader protocol
38
31
 
39
32
  Bootstrap once, then request one step at a time:
@@ -50,6 +43,9 @@ node audit-code.mjs ensure --quiet
50
43
  node audit-code.mjs next-step
51
44
  ```
52
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.
48
+
53
49
  Read the returned JSON only far enough to find `prompt_path`, then read and
54
50
  follow only that prompt. Do not inspect workload, result, schema, or state files
55
51
  unless the current prompt directs you to them. When it says to continue, call
@@ -19,6 +19,11 @@ audit-code ensure --quiet
19
19
  When developing audit-tools itself, use `node audit-code.mjs` from the
20
20
  repository root.
21
21
 
22
+ Preserve user arguments:
23
+
24
+ - pass a typed target directory with `--root <path>` on every `audit-code`
25
+ command (`ensure` and each `next-step`)
26
+
22
27
  Ask for exactly one step:
23
28
 
24
29
  ```bash
@@ -35,14 +40,5 @@ context-window, routing, or launch configuration to audit-tools. Write the
35
40
  prompt-bound result artifacts exactly where requested and let the next backend
36
41
  step validate and ingest them.
37
42
 
38
- After intake, read `.audit-tools/audit/scope_summary.json` and echo:
39
-
40
- ```text
41
- Auditing <repo_root>, <auditable_file_count> files, git: <yes|no>
42
- ```
43
-
44
- If `mis_scope_smells` is non-empty, show each warning and wait for explicit
45
- confirmation. Otherwise continue without interrupting the workflow.
46
-
47
43
  When a prompt says to continue, call `audit-code next-step` again and follow
48
44
  only the new `prompt_path`. Stop when the current prompt says to stop.
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  name: remediate-code
3
3
  description: Conversation-first remediation of audit findings or feedback through provider-neutral host work items.
4
- version: 0.3.0
5
4
  ---
6
5
 
7
6
  # remediate-code skill
@@ -1,126 +0,0 @@
1
- export interface DispatchOptions {
2
- root: string;
3
- artifactsDir: string;
4
- }
5
- /** Normalize a declared path (absolute, repo-relative, or back-slashed) to a repo-relative forward-slash string. */
6
- export declare function toRepoRelative(p: string, root: string): string;
7
- /**
8
- * Canonical comparison key for a filesystem path. `realpathSync` resolves
9
- * symlinks and platform short-names so it matches git's `--show-toplevel`
10
- * output (macOS TMPDIR `/var`→`/private/var`, Windows 8.3 names); falls back to
11
- * `resolve` for paths that don't exist on disk (e.g. mocked unit tests).
12
- */
13
- export declare function canonicalPathKey(p: string): string;
14
- /**
15
- * The git top-level directory containing `cwd`, or `null` when `cwd` is not
16
- * inside a git working tree (or git is unavailable). `git rev-parse
17
- * --show-toplevel` emits a forward-slash absolute path on every platform.
18
- */
19
- export declare function gitTopLevel(cwd: string): string | null;
20
- /**
21
- * True when `dir` is ITS OWN git top-level — i.e. a real (registered) worktree
22
- * or repo root, not an orphan plain directory whose git calls resolve UP to an
23
- * enclosing checkout. The accept/reverify cluster's defects 4/7/11 all shared
24
- * one mechanism: a node worktree de-registered mid-recovery leaves a plain dir,
25
- * and any git call with that cwd silently operates on the MAIN checkout
26
- * (committing its dirt onto the run branch, or reading its dirty status as the
27
- * node's un-landed work). Every worktree-cwd git WRITE and every
28
- * worktree-state READ that feeds a reuse decision must pass this first.
29
- */
30
- export declare function isOwnGitTopLevel(dir: string): boolean;
31
- /** True when `root` is inside a git work tree (the git tool is present and it's a repo). */
32
- export declare function isGitWorkTree(root: string): boolean;
33
- /**
34
- * True when `commitOid` is reachable from `ref` (default HEAD) — the node-identity
35
- * ancestry probe (INV-WTS-3). `git merge-base --is-ancestor <commit> <ref>` exits 0
36
- * when the commit IS an ancestor, 1 when it is not, and >1 on a bad object. A
37
- * landed node's cherry-pick commit stays an ancestor of HEAD as later siblings pile
38
- * on top; a node whose landing was rolled back / clobbered is NOT an ancestor, so
39
- * this distinguishes a genuinely-landed node from a false-close (a sibling or
40
- * pre-existing file at the same path can never make it pass). Fail-closed: a git
41
- * error / missing object returns false (treated as not-landed → re-block).
42
- */
43
- export declare function gitCommitIsAncestor(root: string, commitOid: string, ref?: string): boolean;
44
- /** True when `branch` resolves to a commit in the repo at `root`. */
45
- export declare function gitBranchExists(root: string, branch: string): boolean;
46
- /** Branch name a block's isolated worktree is created on (mirrors `worktreePath`). */
47
- export declare function worktreeBranchForBlock(blockId: string, runId: string): string;
48
- /** Outcome of resolving the worker's ACTUAL edited files from git. */
49
- export type GitEditedFiles = {
50
- available: true;
51
- files: Set<string>;
52
- }
53
- /** git is present but a probe failed against a real repo → fail closed. */
54
- | {
55
- available: false;
56
- reason: "probe_failed";
57
- error: string;
58
- }
59
- /** root is not under version control at all → no ground truth, gate is skipped. */
60
- | {
61
- available: false;
62
- reason: "not_a_repo";
63
- error: string;
64
- };
65
- /**
66
- * The files a worker's worktree branch changed relative to HEAD — the ground
67
- * truth for write-scope enforcement. Diffs `HEAD...<branch>` (the branch's own
68
- * commits). Fail-closed / not-a-repo semantics mirror `gitEditedFiles`.
69
- */
70
- export declare function gitEditedFilesForBranch(root: string, branch: string): GitEditedFiles;
71
- /** A single edited hunk on the NEW side of a branch diff (repo-relative path). */
72
- export interface GitBranchHunk {
73
- /** Repo-relative forward-slash path the hunk belongs to. */
74
- file: string;
75
- /** 1-based first line of the hunk on the new side. */
76
- startLine: number;
77
- /** Number of new-side lines the hunk spans (a pure deletion has 0). */
78
- lineCount: number;
79
- }
80
- /**
81
- * Outcome of resolving a branch's ACTUAL edited HUNKS from git. Fail-closed like
82
- * {@link gitEditedFilesForBranch}: on a non-repo, a failed probe, or a diff we
83
- * cannot parse, `available` is false and callers MUST treat hunk info as absent
84
- * (conservatively assume same-file blocks overlap — never silently drop a
85
- * collision).
86
- */
87
- export type GitBranchHunks = {
88
- available: true;
89
- hunks: GitBranchHunk[];
90
- } | {
91
- available: false;
92
- reason: "not_a_repo";
93
- error: string;
94
- } | {
95
- available: false;
96
- reason: "probe_failed";
97
- error: string;
98
- };
99
- /**
100
- * Parse `git diff HEAD...<branch>` into per-hunk NEW-side line ranges — the
101
- * ground truth for whether two same-file edits actually touch disjoint regions.
102
- * Mirrors {@link gitEditedFilesForBranch}'s fail-closed / not-a-repo semantics:
103
- * never throws; on a non-repo / failed probe / malformed diff returns a
104
- * discriminated result marking hunks unavailable so the caller can fail closed.
105
- *
106
- * Paths are normalised to repo-relative forward-slash (the same scheme
107
- * {@link gitEditedFilesForBranch} emits) so hunk files compare like-for-like
108
- * with the file set.
109
- */
110
- export declare function gitHunksForBranch(root: string, branch: string): GitBranchHunks;
111
- /**
112
- * Parse a unified-diff body into NEW-side hunk ranges. Extracted for testability
113
- * (no git spawn). Recognises `+++ b/<path>` file headers and
114
- * `@@ -a,b +c,d @@` hunk headers; a header we cannot parse fails the whole probe
115
- * closed (returns `probe_failed`) rather than silently producing partial hunks
116
- * that would let a real overlap slip through.
117
- */
118
- export declare function parseUnifiedDiffHunks(diffText: string): GitBranchHunks;
119
- /**
120
- * Files the worker edited (from git) that fall OUTSIDE the block's declared
121
- * write scope. Result-file artifacts and the agent-feedback file are excluded
122
- * (they are sanctioned side outputs, never source edits). Returns the offending
123
- * repo-relative paths (empty when the edits are fully within scope).
124
- */
125
- export declare function writeScopeViolations(declaredWritePaths: string[], editedFiles: Set<string>, root: string): string[];
126
- //# sourceMappingURL=common.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../src/remediate/steps/dispatch/common.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;CACtB;AAMD,oHAAoH;AACpH,wBAAgB,cAAc,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAO9D;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAMlD;AAMD;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAStD;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAGrD;AAED,4FAA4F;AAC5F,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAOnD;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,SAAS,GAAG,OAAO,CAQ1F;AAED,qEAAqE;AACrE,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAOrE;AAED,sFAAsF;AACtF,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAE7E;AAMD,sEAAsE;AACtE,MAAM,MAAM,cAAc,GACtB;IAAE,SAAS,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,GAA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M,EAAE,CAYV"}
@@ -1,204 +0,0 @@
1
- import { realpathSync } from "node:fs";
2
- import { resolve } from "node:path";
3
- import { spawnSyncHidden } from "audit-tools/shared";
4
- import { AGENT_FEEDBACK_FILENAME, normalizeRepoPath, } from "audit-tools/shared";
5
- // ---------------------------------------------------------------------------
6
- // Path + set primitives
7
- // ---------------------------------------------------------------------------
8
- /** Normalize a declared path (absolute, repo-relative, or back-slashed) to a repo-relative forward-slash string. */
9
- export function toRepoRelative(p, root) {
10
- const normalizedRoot = root.replace(/\\/g, "/").replace(/\/$/, "");
11
- let s = p.replace(/\\/g, "/");
12
- if (s.startsWith(normalizedRoot + "/")) {
13
- s = s.slice(normalizedRoot.length + 1);
14
- }
15
- return s;
16
- }
17
- /**
18
- * Canonical comparison key for a filesystem path. `realpathSync` resolves
19
- * symlinks and platform short-names so it matches git's `--show-toplevel`
20
- * output (macOS TMPDIR `/var`→`/private/var`, Windows 8.3 names); falls back to
21
- * `resolve` for paths that don't exist on disk (e.g. mocked unit tests).
22
- */
23
- export function canonicalPathKey(p) {
24
- try {
25
- return normalizeRepoPath(realpathSync(p));
26
- }
27
- catch {
28
- return normalizeRepoPath(resolve(p));
29
- }
30
- }
31
- // ---------------------------------------------------------------------------
32
- // Git primitives
33
- // ---------------------------------------------------------------------------
34
- /**
35
- * The git top-level directory containing `cwd`, or `null` when `cwd` is not
36
- * inside a git working tree (or git is unavailable). `git rev-parse
37
- * --show-toplevel` emits a forward-slash absolute path on every platform.
38
- */
39
- export function gitTopLevel(cwd) {
40
- const result = spawnSyncHidden("git", ["rev-parse", "--show-toplevel"], {
41
- cwd,
42
- encoding: "utf8",
43
- shell: false,
44
- });
45
- if (result.status !== 0)
46
- return null;
47
- const top = (result.stdout ?? "").trim();
48
- return top.length > 0 ? top : null;
49
- }
50
- /**
51
- * True when `dir` is ITS OWN git top-level — i.e. a real (registered) worktree
52
- * or repo root, not an orphan plain directory whose git calls resolve UP to an
53
- * enclosing checkout. The accept/reverify cluster's defects 4/7/11 all shared
54
- * one mechanism: a node worktree de-registered mid-recovery leaves a plain dir,
55
- * and any git call with that cwd silently operates on the MAIN checkout
56
- * (committing its dirt onto the run branch, or reading its dirty status as the
57
- * node's un-landed work). Every worktree-cwd git WRITE and every
58
- * worktree-state READ that feeds a reuse decision must pass this first.
59
- */
60
- export function isOwnGitTopLevel(dir) {
61
- const top = gitTopLevel(dir);
62
- return top !== null && canonicalPathKey(top) === canonicalPathKey(dir);
63
- }
64
- /** True when `root` is inside a git work tree (the git tool is present and it's a repo). */
65
- export function isGitWorkTree(root) {
66
- const probe = spawnSyncHidden("git", ["rev-parse", "--is-inside-work-tree"], { cwd: root, encoding: "utf8", shell: false });
67
- return !probe.error && probe.status === 0 && /true/.test(probe.stdout ?? "");
68
- }
69
- /**
70
- * True when `commitOid` is reachable from `ref` (default HEAD) — the node-identity
71
- * ancestry probe (INV-WTS-3). `git merge-base --is-ancestor <commit> <ref>` exits 0
72
- * when the commit IS an ancestor, 1 when it is not, and >1 on a bad object. A
73
- * landed node's cherry-pick commit stays an ancestor of HEAD as later siblings pile
74
- * on top; a node whose landing was rolled back / clobbered is NOT an ancestor, so
75
- * this distinguishes a genuinely-landed node from a false-close (a sibling or
76
- * pre-existing file at the same path can never make it pass). Fail-closed: a git
77
- * error / missing object returns false (treated as not-landed → re-block).
78
- */
79
- export function gitCommitIsAncestor(root, commitOid, ref = "HEAD") {
80
- if (!commitOid)
81
- return false;
82
- const probe = spawnSyncHidden("git", ["merge-base", "--is-ancestor", commitOid, ref], { cwd: root, encoding: "utf8", shell: false });
83
- return !probe.error && probe.status === 0;
84
- }
85
- /** True when `branch` resolves to a commit in the repo at `root`. */
86
- export function gitBranchExists(root, branch) {
87
- const probe = spawnSyncHidden("git", ["rev-parse", "--verify", "--quiet", `${branch}^{commit}`], { cwd: root, encoding: "utf8", shell: false });
88
- return !probe.error && probe.status === 0;
89
- }
90
- /** Branch name a block's isolated worktree is created on (mirrors `worktreePath`). */
91
- export function worktreeBranchForBlock(blockId, runId) {
92
- return `remediate-${blockId}-${runId}`;
93
- }
94
- /**
95
- * The files a worker's worktree branch changed relative to HEAD — the ground
96
- * truth for write-scope enforcement. Diffs `HEAD...<branch>` (the branch's own
97
- * commits). Fail-closed / not-a-repo semantics mirror `gitEditedFiles`.
98
- */
99
- export function gitEditedFilesForBranch(root, branch) {
100
- if (!isGitWorkTree(root)) {
101
- return { available: false, reason: "not_a_repo", error: "root is not a git work tree" };
102
- }
103
- const diff = spawnSyncHidden("git", ["diff", "--name-only", `HEAD...${branch}`], { cwd: root, encoding: "utf8", shell: false });
104
- if (diff.error || typeof diff.status !== "number" || diff.status !== 0) {
105
- const detail = (diff.stderr ?? diff.error?.message ?? "git diff failed").toString().trim();
106
- return { available: false, reason: "probe_failed", error: detail };
107
- }
108
- const files = new Set();
109
- for (const line of (diff.stdout ?? "").split(/\r?\n/)) {
110
- const p = line.trim();
111
- if (p.length > 0)
112
- files.add(p.replace(/\\/g, "/"));
113
- }
114
- return { available: true, files };
115
- }
116
- /**
117
- * Parse `git diff HEAD...<branch>` into per-hunk NEW-side line ranges — the
118
- * ground truth for whether two same-file edits actually touch disjoint regions.
119
- * Mirrors {@link gitEditedFilesForBranch}'s fail-closed / not-a-repo semantics:
120
- * never throws; on a non-repo / failed probe / malformed diff returns a
121
- * discriminated result marking hunks unavailable so the caller can fail closed.
122
- *
123
- * Paths are normalised to repo-relative forward-slash (the same scheme
124
- * {@link gitEditedFilesForBranch} emits) so hunk files compare like-for-like
125
- * with the file set.
126
- */
127
- export function gitHunksForBranch(root, branch) {
128
- if (!isGitWorkTree(root)) {
129
- return { available: false, reason: "not_a_repo", error: "root is not a git work tree" };
130
- }
131
- const diff = spawnSyncHidden("git",
132
- // No rename detection / context noise beyond what we parse; a plain unified
133
- // diff carries the `+++ b/<path>` and `@@ … +start,count @@` headers we need.
134
- ["diff", `HEAD...${branch}`], { cwd: root, encoding: "utf8", shell: false });
135
- if (diff.error || typeof diff.status !== "number" || diff.status !== 0) {
136
- const detail = (diff.stderr ?? diff.error?.message ?? "git diff failed").toString().trim();
137
- return { available: false, reason: "probe_failed", error: detail };
138
- }
139
- return parseUnifiedDiffHunks(diff.stdout ?? "");
140
- }
141
- /**
142
- * Parse a unified-diff body into NEW-side hunk ranges. Extracted for testability
143
- * (no git spawn). Recognises `+++ b/<path>` file headers and
144
- * `@@ -a,b +c,d @@` hunk headers; a header we cannot parse fails the whole probe
145
- * closed (returns `probe_failed`) rather than silently producing partial hunks
146
- * that would let a real overlap slip through.
147
- */
148
- export function parseUnifiedDiffHunks(diffText) {
149
- const hunks = [];
150
- let currentFile = null;
151
- for (const rawLine of diffText.split(/\r?\n/)) {
152
- if (rawLine.startsWith("+++ ")) {
153
- // `+++ b/path` — or `+++ /dev/null` for a pure deletion (no new side).
154
- const target = rawLine.slice(4).trim();
155
- if (target === "/dev/null") {
156
- currentFile = null;
157
- continue;
158
- }
159
- // Strip the conventional `b/` prefix; leave already-bare paths intact.
160
- const bare = target.startsWith("b/") ? target.slice(2) : target;
161
- currentFile = bare.replace(/\\/g, "/");
162
- continue;
163
- }
164
- if (rawLine.startsWith("@@")) {
165
- const match = /^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@/.exec(rawLine);
166
- if (!match) {
167
- return {
168
- available: false,
169
- reason: "probe_failed",
170
- error: `unparseable hunk header: ${rawLine}`,
171
- };
172
- }
173
- if (currentFile === null)
174
- continue; // deletion-only target: no new-side hunk.
175
- const startLine = Number(match[1]);
176
- const lineCount = match[2] === undefined ? 1 : Number(match[2]);
177
- hunks.push({ file: currentFile, startLine, lineCount });
178
- }
179
- }
180
- return { available: true, hunks };
181
- }
182
- /**
183
- * Files the worker edited (from git) that fall OUTSIDE the block's declared
184
- * write scope. Result-file artifacts and the agent-feedback file are excluded
185
- * (they are sanctioned side outputs, never source edits). Returns the offending
186
- * repo-relative paths (empty when the edits are fully within scope).
187
- */
188
- export function writeScopeViolations(declaredWritePaths, editedFiles, root) {
189
- const declared = new Set(declaredWritePaths.map((p) => toRepoRelative(p, root)));
190
- const violations = [];
191
- for (const edited of editedFiles) {
192
- const rel = toRepoRelative(edited, root);
193
- if (declared.has(rel))
194
- continue;
195
- // Sanctioned non-source outputs: result JSON files and the reflection file.
196
- if (rel.endsWith(".result.json"))
197
- continue;
198
- if (rel.endsWith(AGENT_FEEDBACK_FILENAME))
199
- continue;
200
- violations.push(rel);
201
- }
202
- return violations;
203
- }
204
- //# sourceMappingURL=common.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../src/remediate/steps/dispatch/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EACL,uBAAuB,EACvB,iBAAiB,GAClB,MAAM,oBAAoB,CAAC;AAO5B,8EAA8E;AAC9E,wBAAwB;AACxB,8EAA8E;AAE9E,oHAAoH;AACpH,MAAM,UAAU,cAAc,CAAC,CAAS,EAAE,IAAY;IACpD,MAAM,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACnE,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAC9B,IAAI,CAAC,CAAC,UAAU,CAAC,cAAc,GAAG,GAAG,CAAC,EAAE,CAAC;QACvC,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACzC,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,CAAS;IACxC,IAAI,CAAC;QACH,OAAO,iBAAiB,CAAC,YAAY,CAAC,CAAC,CAAC,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,MAAM,GAAG,GAAG,cAAc,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QACzC,IAAI,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC;YAAE,SAAS;QAChC,4EAA4E;QAC5E,IAAI,GAAG,CAAC,QAAQ,CAAC,cAAc,CAAC;YAAE,SAAS;QAC3C,IAAI,GAAG,CAAC,QAAQ,CAAC,uBAAuB,CAAC;YAAE,SAAS;QACpD,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACvB,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC"}
@@ -1,25 +0,0 @@
1
- /**
2
- * The implementation-DAG node fields `promoteImplementationDagToExtractedPlan`
3
- * writes onto each Finding (one node ↔ one finding ↔ one block in the contract
4
- * pipeline). The shared `Finding` type does not declare these overlay fields, so
5
- * they are read through this structural view rather than added to the shared
6
- * contract. Every field is optional: a finding sourced from a plain
7
- * `audit-findings.json` (not the contract pipeline) carries none of them and the
8
- * seam degrades to the block-level behavior.
9
- */
10
- export interface DagNodeFields {
11
- /** Upstream contracts' declared outputs this node builds on. */
12
- preconditions?: string[];
13
- /** Human-readable description of the concrete changes the node is expected to produce. */
14
- expected_changes?: string;
15
- /** Human-readable verification checks beyond `targeted_commands`. */
16
- verification?: string[];
17
- /**
18
- * Reconciliation expectations carried from seam reconciliation: what an
19
- * upstream/neighbor contract agreed to provide this node, expressed either as
20
- * a list of strings or, when richer, as the precondition list. Read tolerantly
21
- * because the promotion shape can vary across pipeline versions.
22
- */
23
- reconciliation_expectations?: string[];
24
- }
25
- //# sourceMappingURL=dagNodeFields.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dagNodeFields.d.ts","sourceRoot":"","sources":["../../../../src/remediate/steps/dispatch/dagNodeFields.ts"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AACH,MAAM,WAAW,aAAa;IAC5B,gEAAgE;IAChE,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,0FAA0F;IAC1F,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,qEAAqE;IACrE,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB;;;;;OAKG;IACH,2BAA2B,CAAC,EAAE,MAAM,EAAE,CAAC;CACxC"}
@@ -1,5 +0,0 @@
1
- // ---------------------------------------------------------------------------
2
- // DAG-node metadata overlay shape
3
- // ---------------------------------------------------------------------------
4
- export {};
5
- //# sourceMappingURL=dagNodeFields.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dagNodeFields.js","sourceRoot":"","sources":["../../../../src/remediate/steps/dispatch/dagNodeFields.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,kCAAkC;AAClC,8EAA8E"}
@@ -1,47 +0,0 @@
1
- /**
2
- * Best-effort: repo-relative test files that reference any of `sourceFiles` (by
3
- * module basename). Pulling them into a block's access lets the worker that
4
- * changes or removes a symbol also fix the tests that assert it, instead of
5
- * leaving orphaned test breakage for a separate central mop-up. Matching is
6
- * deliberately loose (a false positive only grants slightly broader, harmless
7
- * write access; a false negative is the failure mode we want to avoid).
8
- */
9
- export interface TestFileEntry {
10
- rel: string;
11
- content: string;
12
- }
13
- /**
14
- * Walk the repo ONCE and read every test file's content (bounded). Built once per
15
- * dispatch and shared across all blocks so the filesystem walk + reads are not
16
- * repeated per block.
17
- */
18
- export declare function buildTestFileIndex(root: string): TestFileEntry[];
19
- /**
20
- * Collect test files from `index` that reference any of `sourceFiles` by
21
- * module basename. When `packageRoot` is supplied (repo-relative prefix, e.g.
22
- * `packages/foo`), only test files under that package are considered —
23
- * otherwise all test files in the index are matched (existing behavior).
24
- */
25
- export declare function collectReferencingTests(index: TestFileEntry[], sourceFiles: string[], packageRoot?: string): string[];
26
- /**
27
- * Returns true when any path in `writePaths` is one of the live infra modules.
28
- * Paths are normalised to forward-slash form (win32 backslash → `/`) and matched
29
- * by trailing repo-relative segment so absolute/worktree/relative spellings all
30
- * resolve identically. Used to gate the live-surface verification section in the
31
- * implement prompt.
32
- */
33
- export declare function isInfraModifyingBlock(writePaths: string[]): boolean;
34
- /**
35
- * INV-B3-5: resolve a cited source path to the token the worker should open.
36
- *
37
- * A bare basename (`advance.ts`) that uniquely resolves to one tracked path
38
- * (`src/audit/orchestrator/advance.ts`) is rewritten to that tracked path FIRST,
39
- * so it never surfaces as a broken `<worktreeRoot>/advance.ts` prefix that
40
- * misdirects the worker to a non-existent top-level file. Full / dotfile-dir /
41
- * already-absolute / drive-letter paths pass through unchanged; when a worktree
42
- * root is present, a relative path is prefixed onto it (unchanged behaviour). An
43
- * ambiguous or unresolvable basename is left as-is (monotonic — never a
44
- * regression on paths that already resolved).
45
- */
46
- export declare function resolveCitationPathForPrompt(rel: string, worktreeRoot: string | undefined, trackedPaths: ReadonlySet<string>): string;
47
- //# sourceMappingURL=implementPrompt.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"implementPrompt.d.ts","sourceRoot":"","sources":["../../../../src/remediate/steps/dispatch/implementPrompt.ts"],"names":[],"mappings":"AAyCA;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,EAAE,CAYhE;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,aAAa,EAAE,EACtB,WAAW,EAAE,MAAM,EAAE,EACrB,WAAW,CAAC,EAAE,MAAM,GACnB,MAAM,EAAE,CAsBV;AAsCD;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,OAAO,CAUnE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,4BAA4B,CAC1C,GAAG,EAAE,MAAM,EACX,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,YAAY,EAAE,WAAW,CAAC,MAAM,CAAC,GAChC,MAAM,CASR"}