@warpgogol/forge 9.6.3 → 9.7.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 (1071) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/README.md +12 -0
  3. package/bin/cli.ts +40 -2
  4. package/dist/bin/cli.js +39 -2
  5. package/dist/bin/cli.js.map +1 -1
  6. package/dist/os/adr/handlers/archive.d.ts.map +1 -1
  7. package/dist/os/adr/handlers/archive.js +3 -7
  8. package/dist/os/adr/handlers/archive.js.map +1 -1
  9. package/dist/os/adr/handlers/implement-stamp.d.ts.map +1 -1
  10. package/dist/os/adr/handlers/implement-stamp.js +55 -19
  11. package/dist/os/adr/handlers/implement-stamp.js.map +1 -1
  12. package/dist/os/adr/handlers/list-create.d.ts.map +1 -1
  13. package/dist/os/adr/handlers/list-create.js +8 -6
  14. package/dist/os/adr/handlers/list-create.js.map +1 -1
  15. package/dist/os/adr/handlers/validate.d.ts.map +1 -1
  16. package/dist/os/adr/handlers/validate.js +55 -21
  17. package/dist/os/adr/handlers/validate.js.map +1 -1
  18. package/dist/os/adversarial/adversarial.module.d.ts +3 -0
  19. package/dist/os/adversarial/adversarial.module.d.ts.map +1 -0
  20. package/dist/os/adversarial/adversarial.module.js +128 -0
  21. package/dist/os/adversarial/adversarial.module.js.map +1 -0
  22. package/dist/os/adversarial/catalog.d.ts +11 -0
  23. package/dist/os/adversarial/catalog.d.ts.map +1 -0
  24. package/dist/os/adversarial/catalog.js +72 -0
  25. package/dist/os/adversarial/catalog.js.map +1 -0
  26. package/dist/os/adversarial/runner.d.ts +17 -0
  27. package/dist/os/adversarial/runner.d.ts.map +1 -0
  28. package/dist/os/adversarial/runner.js +479 -0
  29. package/dist/os/adversarial/runner.js.map +1 -0
  30. package/dist/os/agent/handlers/agent-tiers-validate.d.ts.map +1 -1
  31. package/dist/os/agent/handlers/agent-tiers-validate.js +21 -7
  32. package/dist/os/agent/handlers/agent-tiers-validate.js.map +1 -1
  33. package/dist/os/agent/index.js +1 -1
  34. package/dist/os/agent-tools/agent-tools.module.d.ts +3 -0
  35. package/dist/os/agent-tools/agent-tools.module.d.ts.map +1 -0
  36. package/dist/os/agent-tools/agent-tools.module.js +80 -0
  37. package/dist/os/agent-tools/agent-tools.module.js.map +1 -0
  38. package/dist/os/agent-tools/generate.d.ts +18 -0
  39. package/dist/os/agent-tools/generate.d.ts.map +1 -0
  40. package/dist/os/agent-tools/generate.js +79 -0
  41. package/dist/os/agent-tools/generate.js.map +1 -0
  42. package/dist/os/agent-tools/handlers/tools-generate.d.ts +16 -0
  43. package/dist/os/agent-tools/handlers/tools-generate.d.ts.map +1 -0
  44. package/dist/os/agent-tools/handlers/tools-generate.js +108 -0
  45. package/dist/os/agent-tools/handlers/tools-generate.js.map +1 -0
  46. package/dist/os/agent-tools/index.d.ts +7 -0
  47. package/dist/os/agent-tools/index.d.ts.map +1 -0
  48. package/dist/os/agent-tools/index.js +16 -0
  49. package/dist/os/agent-tools/index.js.map +1 -0
  50. package/dist/os/agent-tools/manifest.d.ts +26 -0
  51. package/dist/os/agent-tools/manifest.d.ts.map +1 -0
  52. package/dist/os/agent-tools/manifest.js +70 -0
  53. package/dist/os/agent-tools/manifest.js.map +1 -0
  54. package/dist/os/agent-tools/serve.d.ts +21 -0
  55. package/dist/os/agent-tools/serve.d.ts.map +1 -0
  56. package/dist/os/agent-tools/serve.js +99 -0
  57. package/dist/os/agent-tools/serve.js.map +1 -0
  58. package/dist/os/agent-tools/server.d.ts +53 -0
  59. package/dist/os/agent-tools/server.d.ts.map +1 -0
  60. package/dist/os/agent-tools/server.js +381 -0
  61. package/dist/os/agent-tools/server.js.map +1 -0
  62. package/dist/os/agent-tools/types.d.ts +72 -0
  63. package/dist/os/agent-tools/types.d.ts.map +1 -0
  64. package/dist/os/agent-tools/types.js +74 -0
  65. package/dist/os/agent-tools/types.js.map +1 -0
  66. package/dist/os/audit/handlers/archive.d.ts.map +1 -1
  67. package/dist/os/audit/handlers/archive.js +3 -7
  68. package/dist/os/audit/handlers/archive.js.map +1 -1
  69. package/dist/os/authority/authority.module.d.ts.map +1 -1
  70. package/dist/os/authority/authority.module.js +17 -2
  71. package/dist/os/authority/authority.module.js.map +1 -1
  72. package/dist/os/checks/checks.module.d.ts.map +1 -1
  73. package/dist/os/checks/checks.module.js +44 -11
  74. package/dist/os/checks/checks.module.js.map +1 -1
  75. package/dist/os/checks/handlers/contribution-report.d.ts +3 -0
  76. package/dist/os/checks/handlers/contribution-report.d.ts.map +1 -1
  77. package/dist/os/checks/handlers/contribution-report.js +142 -23
  78. package/dist/os/checks/handlers/contribution-report.js.map +1 -1
  79. package/dist/os/checks/handlers/counters-export.d.ts.map +1 -1
  80. package/dist/os/checks/handlers/counters-export.js +75 -8
  81. package/dist/os/checks/handlers/counters-export.js.map +1 -1
  82. package/dist/os/checks/handlers/counters-validate.d.ts.map +1 -1
  83. package/dist/os/checks/handlers/counters-validate.js +1 -1
  84. package/dist/os/checks/handlers/counters-validate.js.map +1 -1
  85. package/dist/os/codebase/handlers/codebase-measure.d.ts.map +1 -1
  86. package/dist/os/codebase/handlers/codebase-measure.js +15 -18
  87. package/dist/os/codebase/handlers/codebase-measure.js.map +1 -1
  88. package/dist/os/codebase/index.d.ts.map +1 -1
  89. package/dist/os/codebase/index.js +4 -1
  90. package/dist/os/codebase/index.js.map +1 -1
  91. package/dist/os/compass/handlers/compass-audit-handler.d.ts +4 -2
  92. package/dist/os/compass/handlers/compass-audit-handler.d.ts.map +1 -1
  93. package/dist/os/compass/handlers/compass-audit-handler.js +229 -37
  94. package/dist/os/compass/handlers/compass-audit-handler.js.map +1 -1
  95. package/dist/os/compass/handlers/compass-header-scaffold-handler.d.ts.map +1 -1
  96. package/dist/os/compass/handlers/compass-header-scaffold-handler.js +45 -2
  97. package/dist/os/compass/handlers/compass-header-scaffold-handler.js.map +1 -1
  98. package/dist/os/compass/handlers/compass-migrate-handler.d.ts.map +1 -1
  99. package/dist/os/compass/handlers/compass-migrate-handler.js +44 -4
  100. package/dist/os/compass/handlers/compass-migrate-handler.js.map +1 -1
  101. package/dist/os/compass/handlers/git-revision.d.ts +31 -5
  102. package/dist/os/compass/handlers/git-revision.d.ts.map +1 -1
  103. package/dist/os/compass/handlers/git-revision.js +153 -55
  104. package/dist/os/compass/handlers/git-revision.js.map +1 -1
  105. package/dist/os/compass/handlers/summary-record.d.ts.map +1 -1
  106. package/dist/os/compass/handlers/summary-record.js +44 -9
  107. package/dist/os/compass/handlers/summary-record.js.map +1 -1
  108. package/dist/os/context/context.module.d.ts.map +1 -1
  109. package/dist/os/context/context.module.js +23 -4
  110. package/dist/os/context/context.module.js.map +1 -1
  111. package/dist/os/context/handlers/context-assemble.d.ts.map +1 -1
  112. package/dist/os/context/handlers/context-assemble.js +109 -16
  113. package/dist/os/context/handlers/context-assemble.js.map +1 -1
  114. package/dist/os/context/handlers/context-slate-eval.d.ts.map +1 -1
  115. package/dist/os/context/handlers/context-slate-eval.js +34 -9
  116. package/dist/os/context/handlers/context-slate-eval.js.map +1 -1
  117. package/dist/os/context/handlers/index-build.d.ts.map +1 -1
  118. package/dist/os/context/handlers/index-build.js +119 -26
  119. package/dist/os/context/handlers/index-build.js.map +1 -1
  120. package/dist/os/core/archive-regen.d.ts +56 -4
  121. package/dist/os/core/archive-regen.d.ts.map +1 -1
  122. package/dist/os/core/archive-regen.js +173 -15
  123. package/dist/os/core/archive-regen.js.map +1 -1
  124. package/dist/os/core/core.module.d.ts.map +1 -1
  125. package/dist/os/core/core.module.js +187 -50
  126. package/dist/os/core/core.module.js.map +1 -1
  127. package/dist/os/core/handlers/forge-autonomy-validate.d.ts +9 -2
  128. package/dist/os/core/handlers/forge-autonomy-validate.d.ts.map +1 -1
  129. package/dist/os/core/handlers/forge-autonomy-validate.js +81 -0
  130. package/dist/os/core/handlers/forge-autonomy-validate.js.map +1 -1
  131. package/dist/os/core/handlers/package-health.js +6 -6
  132. package/dist/os/core/handlers/pinned-check.d.ts +13 -0
  133. package/dist/os/core/handlers/pinned-check.d.ts.map +1 -1
  134. package/dist/os/core/handlers/pinned-check.js +25 -0
  135. package/dist/os/core/handlers/pinned-check.js.map +1 -1
  136. package/dist/os/core/handlers/pinned-types.d.ts +7 -0
  137. package/dist/os/core/handlers/pinned-types.d.ts.map +1 -1
  138. package/dist/os/core/handlers/pinned-validate.d.ts.map +1 -1
  139. package/dist/os/core/handlers/pinned-validate.js +24 -1
  140. package/dist/os/core/handlers/pinned-validate.js.map +1 -1
  141. package/dist/os/core/handlers/policy-digest.d.ts +11 -0
  142. package/dist/os/core/handlers/policy-digest.d.ts.map +1 -0
  143. package/dist/os/core/handlers/policy-digest.js +421 -0
  144. package/dist/os/core/handlers/policy-digest.js.map +1 -0
  145. package/dist/os/correctness/audit/snapshot.d.ts.map +1 -1
  146. package/dist/os/correctness/audit/snapshot.js +46 -15
  147. package/dist/os/correctness/audit/snapshot.js.map +1 -1
  148. package/dist/os/correctness/correctness.module.d.ts.map +1 -1
  149. package/dist/os/correctness/correctness.module.js +5 -3
  150. package/dist/os/correctness/correctness.module.js.map +1 -1
  151. package/dist/os/correctness/gate/frozen.d.ts +84 -9
  152. package/dist/os/correctness/gate/frozen.d.ts.map +1 -1
  153. package/dist/os/correctness/gate/frozen.js +573 -53
  154. package/dist/os/correctness/gate/frozen.js.map +1 -1
  155. package/dist/os/correctness/gate/origin.d.ts +2 -0
  156. package/dist/os/correctness/gate/origin.d.ts.map +1 -1
  157. package/dist/os/correctness/gate/origin.js +68 -35
  158. package/dist/os/correctness/gate/origin.js.map +1 -1
  159. package/dist/os/correctness/gate/repo.d.ts +58 -2
  160. package/dist/os/correctness/gate/repo.d.ts.map +1 -1
  161. package/dist/os/correctness/gate/repo.js +177 -15
  162. package/dist/os/correctness/gate/repo.js.map +1 -1
  163. package/dist/os/correctness/gate/run.d.ts +6 -0
  164. package/dist/os/correctness/gate/run.d.ts.map +1 -1
  165. package/dist/os/correctness/gate/run.js +394 -62
  166. package/dist/os/correctness/gate/run.js.map +1 -1
  167. package/dist/os/correctness/gate/runner.d.ts.map +1 -1
  168. package/dist/os/correctness/gate/runner.js +42 -8
  169. package/dist/os/correctness/gate/runner.js.map +1 -1
  170. package/dist/os/correctness/gate/tests/gate-fixture.d.ts +5 -1
  171. package/dist/os/correctness/gate/tests/gate-fixture.d.ts.map +1 -1
  172. package/dist/os/correctness/gate/tests/gate-fixture.js +23 -1
  173. package/dist/os/correctness/gate/tests/gate-fixture.js.map +1 -1
  174. package/dist/os/correctness/gate/types.d.ts +3 -0
  175. package/dist/os/correctness/gate/types.d.ts.map +1 -1
  176. package/dist/os/correctness/gate/types.js +1 -0
  177. package/dist/os/correctness/gate/types.js.map +1 -1
  178. package/dist/os/correctness/handlers/gate.d.ts.map +1 -1
  179. package/dist/os/correctness/handlers/gate.js +2 -0
  180. package/dist/os/correctness/handlers/gate.js.map +1 -1
  181. package/dist/os/correctness/handlers/validate.d.ts +30 -0
  182. package/dist/os/correctness/handlers/validate.d.ts.map +1 -1
  183. package/dist/os/correctness/handlers/validate.js +20 -7
  184. package/dist/os/correctness/handlers/validate.js.map +1 -1
  185. package/dist/os/correctness/manifest-schema.d.ts +2 -2
  186. package/dist/os/correctness/references.d.ts +19 -0
  187. package/dist/os/correctness/references.d.ts.map +1 -1
  188. package/dist/os/correctness/references.js +57 -22
  189. package/dist/os/correctness/references.js.map +1 -1
  190. package/dist/os/correctness/workspace.d.ts +22 -2
  191. package/dist/os/correctness/workspace.d.ts.map +1 -1
  192. package/dist/os/correctness/workspace.js +194 -18
  193. package/dist/os/correctness/workspace.js.map +1 -1
  194. package/dist/os/flow/branch-name.d.ts.map +1 -1
  195. package/dist/os/flow/branch-name.js +2 -4
  196. package/dist/os/flow/branch-name.js.map +1 -1
  197. package/dist/os/flow/correctness-step.d.ts.map +1 -1
  198. package/dist/os/flow/correctness-step.js +83 -17
  199. package/dist/os/flow/correctness-step.js.map +1 -1
  200. package/dist/os/flow/digest.d.ts +98 -9
  201. package/dist/os/flow/digest.d.ts.map +1 -1
  202. package/dist/os/flow/digest.js +802 -185
  203. package/dist/os/flow/digest.js.map +1 -1
  204. package/dist/os/flow/dup-id-scan.d.ts +23 -0
  205. package/dist/os/flow/dup-id-scan.d.ts.map +1 -0
  206. package/dist/os/flow/dup-id-scan.js +171 -0
  207. package/dist/os/flow/dup-id-scan.js.map +1 -0
  208. package/dist/os/flow/evidence-lock.d.ts +36 -0
  209. package/dist/os/flow/evidence-lock.d.ts.map +1 -0
  210. package/dist/os/flow/evidence-lock.js +156 -0
  211. package/dist/os/flow/evidence-lock.js.map +1 -0
  212. package/dist/os/flow/flow.module.d.ts.map +1 -1
  213. package/dist/os/flow/flow.module.js +155 -19
  214. package/dist/os/flow/flow.module.js.map +1 -1
  215. package/dist/os/flow/git.d.ts +124 -11
  216. package/dist/os/flow/git.d.ts.map +1 -1
  217. package/dist/os/flow/git.js +793 -84
  218. package/dist/os/flow/git.js.map +1 -1
  219. package/dist/os/flow/guard-files.d.ts.map +1 -1
  220. package/dist/os/flow/guard-files.js +3 -5
  221. package/dist/os/flow/guard-files.js.map +1 -1
  222. package/dist/os/flow/handlers/flow-backmerge.d.ts.map +1 -1
  223. package/dist/os/flow/handlers/flow-backmerge.js +2 -2
  224. package/dist/os/flow/handlers/flow-backmerge.js.map +1 -1
  225. package/dist/os/flow/handlers/flow-check.js +2 -2
  226. package/dist/os/flow/handlers/flow-cut.d.ts +38 -0
  227. package/dist/os/flow/handlers/flow-cut.d.ts.map +1 -1
  228. package/dist/os/flow/handlers/flow-cut.js +325 -186
  229. package/dist/os/flow/handlers/flow-cut.js.map +1 -1
  230. package/dist/os/flow/handlers/flow-digest.d.ts.map +1 -1
  231. package/dist/os/flow/handlers/flow-digest.js +5 -6
  232. package/dist/os/flow/handlers/flow-digest.js.map +1 -1
  233. package/dist/os/flow/handlers/flow-discard.js +6 -6
  234. package/dist/os/flow/handlers/flow-discard.js.map +1 -1
  235. package/dist/os/flow/handlers/flow-fix.d.ts.map +1 -1
  236. package/dist/os/flow/handlers/flow-fix.js +34 -12
  237. package/dist/os/flow/handlers/flow-fix.js.map +1 -1
  238. package/dist/os/flow/handlers/flow-hold.d.ts.map +1 -1
  239. package/dist/os/flow/handlers/flow-hold.js +12 -21
  240. package/dist/os/flow/handlers/flow-hold.js.map +1 -1
  241. package/dist/os/flow/handlers/flow-install.d.ts.map +1 -1
  242. package/dist/os/flow/handlers/flow-install.js +19 -18
  243. package/dist/os/flow/handlers/flow-install.js.map +1 -1
  244. package/dist/os/flow/handlers/flow-integrate.d.ts +50 -2
  245. package/dist/os/flow/handlers/flow-integrate.d.ts.map +1 -1
  246. package/dist/os/flow/handlers/flow-integrate.js +624 -135
  247. package/dist/os/flow/handlers/flow-integrate.js.map +1 -1
  248. package/dist/os/flow/handlers/flow-open.d.ts +11 -0
  249. package/dist/os/flow/handlers/flow-open.d.ts.map +1 -1
  250. package/dist/os/flow/handlers/flow-open.js +82 -12
  251. package/dist/os/flow/handlers/flow-open.js.map +1 -1
  252. package/dist/os/flow/handlers/flow-publication-retire.d.ts +2 -2
  253. package/dist/os/flow/handlers/flow-publication-retire.d.ts.map +1 -1
  254. package/dist/os/flow/handlers/flow-publication-retire.js +36 -16
  255. package/dist/os/flow/handlers/flow-publication-retire.js.map +1 -1
  256. package/dist/os/flow/handlers/flow-push.d.ts +91 -2
  257. package/dist/os/flow/handlers/flow-push.d.ts.map +1 -1
  258. package/dist/os/flow/handlers/flow-push.js +806 -52
  259. package/dist/os/flow/handlers/flow-push.js.map +1 -1
  260. package/dist/os/flow/handlers/flow-status.d.ts +6 -0
  261. package/dist/os/flow/handlers/flow-status.d.ts.map +1 -1
  262. package/dist/os/flow/handlers/flow-status.js +13 -10
  263. package/dist/os/flow/handlers/flow-status.js.map +1 -1
  264. package/dist/os/flow/handlers/flow-swept.d.ts +30 -0
  265. package/dist/os/flow/handlers/flow-swept.d.ts.map +1 -0
  266. package/dist/os/flow/handlers/flow-swept.js +135 -0
  267. package/dist/os/flow/handlers/flow-swept.js.map +1 -0
  268. package/dist/os/flow/handlers/flow-version.d.ts.map +1 -1
  269. package/dist/os/flow/handlers/flow-version.js +3 -5
  270. package/dist/os/flow/handlers/flow-version.js.map +1 -1
  271. package/dist/os/flow/index.d.ts +2 -0
  272. package/dist/os/flow/index.d.ts.map +1 -1
  273. package/dist/os/flow/index.js +7 -4
  274. package/dist/os/flow/index.js.map +1 -1
  275. package/dist/os/flow/line-version.d.ts.map +1 -1
  276. package/dist/os/flow/line-version.js +20 -3
  277. package/dist/os/flow/line-version.js.map +1 -1
  278. package/dist/os/flow/locks.d.ts +15 -0
  279. package/dist/os/flow/locks.d.ts.map +1 -1
  280. package/dist/os/flow/locks.js +20 -7
  281. package/dist/os/flow/locks.js.map +1 -1
  282. package/dist/os/flow/markers.d.ts +1 -1
  283. package/dist/os/flow/markers.d.ts.map +1 -1
  284. package/dist/os/flow/markers.js +14 -5
  285. package/dist/os/flow/markers.js.map +1 -1
  286. package/dist/os/flow/ops-registry.d.ts.map +1 -1
  287. package/dist/os/flow/ops-registry.js +19 -6
  288. package/dist/os/flow/ops-registry.js.map +1 -1
  289. package/dist/os/flow/post-rebase-regen.d.ts +30 -8
  290. package/dist/os/flow/post-rebase-regen.d.ts.map +1 -1
  291. package/dist/os/flow/post-rebase-regen.js +172 -20
  292. package/dist/os/flow/post-rebase-regen.js.map +1 -1
  293. package/dist/os/flow/pre-lock.d.ts +61 -0
  294. package/dist/os/flow/pre-lock.d.ts.map +1 -0
  295. package/dist/os/flow/pre-lock.js +265 -0
  296. package/dist/os/flow/pre-lock.js.map +1 -0
  297. package/dist/os/flow/preflight.d.ts +6 -0
  298. package/dist/os/flow/preflight.d.ts.map +1 -1
  299. package/dist/os/flow/preflight.js +87 -13
  300. package/dist/os/flow/preflight.js.map +1 -1
  301. package/dist/os/flow/primary-dirt.d.ts +63 -0
  302. package/dist/os/flow/primary-dirt.d.ts.map +1 -0
  303. package/dist/os/flow/primary-dirt.js +259 -0
  304. package/dist/os/flow/primary-dirt.js.map +1 -0
  305. package/dist/os/flow/publish.d.ts.map +1 -1
  306. package/dist/os/flow/publish.js +32 -10
  307. package/dist/os/flow/publish.js.map +1 -1
  308. package/dist/os/flow/registry.d.ts +21 -9
  309. package/dist/os/flow/registry.d.ts.map +1 -1
  310. package/dist/os/flow/registry.js +16 -9
  311. package/dist/os/flow/registry.js.map +1 -1
  312. package/dist/os/flow/release-level.d.ts +2 -0
  313. package/dist/os/flow/release-level.d.ts.map +1 -1
  314. package/dist/os/flow/release-level.js +23 -5
  315. package/dist/os/flow/release-level.js.map +1 -1
  316. package/dist/os/flow/release-lines.js +1 -1
  317. package/dist/os/flow/release-tags.d.ts +1 -1
  318. package/dist/os/flow/release-tags.d.ts.map +1 -1
  319. package/dist/os/flow/release-tags.js +43 -19
  320. package/dist/os/flow/release-tags.js.map +1 -1
  321. package/dist/os/flow/repo-kind.d.ts.map +1 -1
  322. package/dist/os/flow/repo-kind.js +6 -3
  323. package/dist/os/flow/repo-kind.js.map +1 -1
  324. package/dist/os/flow/scripts.d.ts.map +1 -1
  325. package/dist/os/flow/scripts.js +40 -7
  326. package/dist/os/flow/scripts.js.map +1 -1
  327. package/dist/os/flow/semver.js +1 -1
  328. package/dist/os/flow/session-checkout.js +3 -3
  329. package/dist/os/flow/standalone-invoke.js +2 -2
  330. package/dist/os/flow/tests/helpers.d.ts +28 -1
  331. package/dist/os/flow/tests/helpers.d.ts.map +1 -1
  332. package/dist/os/flow/tests/helpers.js +159 -19
  333. package/dist/os/flow/tests/helpers.js.map +1 -1
  334. package/dist/os/flow/version-files.d.ts.map +1 -1
  335. package/dist/os/flow/version-files.js +3 -2
  336. package/dist/os/flow/version-files.js.map +1 -1
  337. package/dist/os/flow/worktree-path.d.ts.map +1 -1
  338. package/dist/os/flow/worktree-path.js +1 -1
  339. package/dist/os/flow/worktree-path.js.map +1 -1
  340. package/dist/os/friction/friction.module.d.ts.map +1 -1
  341. package/dist/os/friction/friction.module.js +160 -31
  342. package/dist/os/friction/friction.module.js.map +1 -1
  343. package/dist/os/friction/handlers/friction-add.d.ts +13 -0
  344. package/dist/os/friction/handlers/friction-add.d.ts.map +1 -0
  345. package/dist/os/friction/handlers/friction-add.js +189 -0
  346. package/dist/os/friction/handlers/friction-add.js.map +1 -0
  347. package/dist/os/friction/handlers/friction-migrate.d.ts +23 -0
  348. package/dist/os/friction/handlers/friction-migrate.d.ts.map +1 -0
  349. package/dist/os/friction/handlers/friction-migrate.js +354 -0
  350. package/dist/os/friction/handlers/friction-migrate.js.map +1 -0
  351. package/dist/os/friction/handlers/friction-validate.d.ts.map +1 -1
  352. package/dist/os/friction/handlers/friction-validate.js +144 -106
  353. package/dist/os/friction/handlers/friction-validate.js.map +1 -1
  354. package/dist/os/friction/index.d.ts +2 -0
  355. package/dist/os/friction/index.d.ts.map +1 -1
  356. package/dist/os/friction/index.js +3 -1
  357. package/dist/os/friction/index.js.map +1 -1
  358. package/dist/os/friction/store.d.ts +72 -0
  359. package/dist/os/friction/store.d.ts.map +1 -0
  360. package/dist/os/friction/store.js +251 -0
  361. package/dist/os/friction/store.js.map +1 -0
  362. package/dist/os/friction/types.d.ts +13 -1
  363. package/dist/os/friction/types.d.ts.map +1 -1
  364. package/dist/os/friction/types.js +19 -13
  365. package/dist/os/friction/types.js.map +1 -1
  366. package/dist/os/gate/gate.module.d.ts.map +1 -1
  367. package/dist/os/gate/gate.module.js +47 -6
  368. package/dist/os/gate/gate.module.js.map +1 -1
  369. package/dist/os/gate/handlers/gate-probe-catalog.d.ts +17 -2
  370. package/dist/os/gate/handlers/gate-probe-catalog.d.ts.map +1 -1
  371. package/dist/os/gate/handlers/gate-probe-catalog.js +376 -44
  372. package/dist/os/gate/handlers/gate-probe-catalog.js.map +1 -1
  373. package/dist/os/gate/handlers/gate-probe.d.ts.map +1 -1
  374. package/dist/os/gate/handlers/gate-probe.js +90 -10
  375. package/dist/os/gate/handlers/gate-probe.js.map +1 -1
  376. package/dist/os/gate/handlers/liveness.d.ts +30 -0
  377. package/dist/os/gate/handlers/liveness.d.ts.map +1 -0
  378. package/dist/os/gate/handlers/liveness.js +94 -0
  379. package/dist/os/gate/handlers/liveness.js.map +1 -0
  380. package/dist/os/gate/handlers/probe-runs-journal.d.ts +44 -0
  381. package/dist/os/gate/handlers/probe-runs-journal.d.ts.map +1 -0
  382. package/dist/os/gate/handlers/probe-runs-journal.js +157 -0
  383. package/dist/os/gate/handlers/probe-runs-journal.js.map +1 -0
  384. package/dist/os/gate-run/gate-run.module.d.ts.map +1 -1
  385. package/dist/os/gate-run/gate-run.module.js +3 -0
  386. package/dist/os/gate-run/gate-run.module.js.map +1 -1
  387. package/dist/os/gate-run/index.d.ts.map +1 -1
  388. package/dist/os/gate-run/index.js +10 -0
  389. package/dist/os/gate-run/index.js.map +1 -1
  390. package/dist/os/gate-run/record.d.ts +1 -0
  391. package/dist/os/gate-run/record.d.ts.map +1 -1
  392. package/dist/os/gate-run/record.js +2 -0
  393. package/dist/os/gate-run/record.js.map +1 -1
  394. package/dist/os/gate-run/status.d.ts.map +1 -1
  395. package/dist/os/gate-run/status.js +4 -1
  396. package/dist/os/gate-run/status.js.map +1 -1
  397. package/dist/os/gate-run/types.d.ts +7 -0
  398. package/dist/os/gate-run/types.d.ts.map +1 -1
  399. package/dist/os/gate-run/types.js +1 -0
  400. package/dist/os/gate-run/types.js.map +1 -1
  401. package/dist/os/instructions/handlers/scar-migrate.d.ts +3 -0
  402. package/dist/os/instructions/handlers/scar-migrate.d.ts.map +1 -1
  403. package/dist/os/instructions/handlers/scar-migrate.js +23 -66
  404. package/dist/os/instructions/handlers/scar-migrate.js.map +1 -1
  405. package/dist/os/instructions/instructions.module.d.ts.map +1 -1
  406. package/dist/os/instructions/instructions.module.js +32 -5
  407. package/dist/os/instructions/instructions.module.js.map +1 -1
  408. package/dist/os/knowledge/handlers/knowledge-authz-probe.d.ts.map +1 -1
  409. package/dist/os/knowledge/handlers/knowledge-authz-probe.js +31 -10
  410. package/dist/os/knowledge/handlers/knowledge-authz-probe.js.map +1 -1
  411. package/dist/os/knowledge/handlers/knowledge-rebuild.d.ts.map +1 -1
  412. package/dist/os/knowledge/handlers/knowledge-rebuild.js +24 -12
  413. package/dist/os/knowledge/handlers/knowledge-rebuild.js.map +1 -1
  414. package/dist/os/knowledge/knowledge.module.d.ts.map +1 -1
  415. package/dist/os/knowledge/knowledge.module.js +20 -4
  416. package/dist/os/knowledge/knowledge.module.js.map +1 -1
  417. package/dist/os/mission/handlers/archive.d.ts.map +1 -1
  418. package/dist/os/mission/handlers/archive.js +3 -7
  419. package/dist/os/mission/handlers/archive.js.map +1 -1
  420. package/dist/os/mission/lockfile.d.ts.map +1 -1
  421. package/dist/os/mission/lockfile.js +44 -20
  422. package/dist/os/mission/lockfile.js.map +1 -1
  423. package/dist/os/naming/naming-convention.js +2 -2
  424. package/dist/os/naming/naming-convention.js.map +1 -1
  425. package/dist/os/plan/handlers/archive.d.ts.map +1 -1
  426. package/dist/os/plan/handlers/archive.js +3 -7
  427. package/dist/os/plan/handlers/archive.js.map +1 -1
  428. package/dist/os/program/discovery.d.ts +14 -5
  429. package/dist/os/program/discovery.d.ts.map +1 -1
  430. package/dist/os/program/discovery.js +64 -46
  431. package/dist/os/program/discovery.js.map +1 -1
  432. package/dist/os/program/handlers/complete.d.ts.map +1 -1
  433. package/dist/os/program/handlers/complete.js +28 -10
  434. package/dist/os/program/handlers/complete.js.map +1 -1
  435. package/dist/os/program/handlers/lease.js +12 -2
  436. package/dist/os/program/handlers/lease.js.map +1 -1
  437. package/dist/os/program/handlers/seal.js +3 -3
  438. package/dist/os/program/handlers/seal.js.map +1 -1
  439. package/dist/os/program/handlers/validate.js +3 -3
  440. package/dist/os/program/handlers/validate.js.map +1 -1
  441. package/dist/os/queue/handlers/queue-decision.d.ts +10 -0
  442. package/dist/os/queue/handlers/queue-decision.d.ts.map +1 -0
  443. package/dist/os/queue/handlers/queue-decision.js +177 -0
  444. package/dist/os/queue/handlers/queue-decision.js.map +1 -0
  445. package/dist/os/queue/handlers/queue-validate.d.ts.map +1 -1
  446. package/dist/os/queue/handlers/queue-validate.js +18 -22
  447. package/dist/os/queue/handlers/queue-validate.js.map +1 -1
  448. package/dist/os/queue/manifest.d.ts.map +1 -1
  449. package/dist/os/queue/manifest.js +1 -2
  450. package/dist/os/queue/manifest.js.map +1 -1
  451. package/dist/os/queue/queue.module.d.ts.map +1 -1
  452. package/dist/os/queue/queue.module.js +89 -4
  453. package/dist/os/queue/queue.module.js.map +1 -1
  454. package/dist/os/rfc/frontmatter-io.d.ts.map +1 -1
  455. package/dist/os/rfc/frontmatter-io.js +4 -3
  456. package/dist/os/rfc/frontmatter-io.js.map +1 -1
  457. package/dist/os/rfc/handlers/archive.d.ts.map +1 -1
  458. package/dist/os/rfc/handlers/archive.js +3 -7
  459. package/dist/os/rfc/handlers/archive.js.map +1 -1
  460. package/dist/os/rfc/handlers/implement-stamp-origin.d.ts.map +1 -1
  461. package/dist/os/rfc/handlers/implement-stamp-origin.js +6 -3
  462. package/dist/os/rfc/handlers/implement-stamp-origin.js.map +1 -1
  463. package/dist/os/rfc/handlers/implement-stamp.d.ts.map +1 -1
  464. package/dist/os/rfc/handlers/implement-stamp.js +65 -29
  465. package/dist/os/rfc/handlers/implement-stamp.js.map +1 -1
  466. package/dist/os/rfc/handlers/index-graph.d.ts.map +1 -1
  467. package/dist/os/rfc/handlers/index-graph.js +13 -0
  468. package/dist/os/rfc/handlers/index-graph.js.map +1 -1
  469. package/dist/os/rfc/handlers/list-create.d.ts.map +1 -1
  470. package/dist/os/rfc/handlers/list-create.js +15 -7
  471. package/dist/os/rfc/handlers/list-create.js.map +1 -1
  472. package/dist/os/rfc/handlers/rfc-evidence-sync.d.ts.map +1 -1
  473. package/dist/os/rfc/handlers/rfc-evidence-sync.js +52 -10
  474. package/dist/os/rfc/handlers/rfc-evidence-sync.js.map +1 -1
  475. package/dist/os/rfc/handlers/validate-rules.d.ts +1 -0
  476. package/dist/os/rfc/handlers/validate-rules.d.ts.map +1 -1
  477. package/dist/os/rfc/handlers/validate-rules.js +172 -50
  478. package/dist/os/rfc/handlers/validate-rules.js.map +1 -1
  479. package/dist/os/rfc/handlers/validate.d.ts.map +1 -1
  480. package/dist/os/rfc/handlers/validate.js +0 -3
  481. package/dist/os/rfc/handlers/validate.js.map +1 -1
  482. package/dist/os/rfc/next-id.d.ts +7 -1
  483. package/dist/os/rfc/next-id.d.ts.map +1 -1
  484. package/dist/os/rfc/next-id.js +122 -5
  485. package/dist/os/rfc/next-id.js.map +1 -1
  486. package/dist/os/rfc/outcome-probe.d.ts.map +1 -1
  487. package/dist/os/rfc/outcome-probe.js +5 -2
  488. package/dist/os/rfc/outcome-probe.js.map +1 -1
  489. package/dist/os/rfc/reachable-symbol.d.ts.map +1 -1
  490. package/dist/os/rfc/reachable-symbol.js +61 -19
  491. package/dist/os/rfc/reachable-symbol.js.map +1 -1
  492. package/dist/os/rfc/rfc.module.d.ts.map +1 -1
  493. package/dist/os/rfc/rfc.module.js +26 -4
  494. package/dist/os/rfc/rfc.module.js.map +1 -1
  495. package/dist/os/rfc/types.d.ts +28 -3
  496. package/dist/os/rfc/types.d.ts.map +1 -1
  497. package/dist/os/rfc/types.js +13 -3
  498. package/dist/os/rfc/types.js.map +1 -1
  499. package/dist/os/rfc/verification-evidence.d.ts.map +1 -1
  500. package/dist/os/rfc/verification-evidence.js +72 -24
  501. package/dist/os/rfc/verification-evidence.js.map +1 -1
  502. package/dist/os/rfc/verification-origin.d.ts +41 -3
  503. package/dist/os/rfc/verification-origin.d.ts.map +1 -1
  504. package/dist/os/rfc/verification-origin.js +314 -50
  505. package/dist/os/rfc/verification-origin.js.map +1 -1
  506. package/dist/os/rfc/verifier/rfc-1391/support.js +1 -1
  507. package/dist/os/rfc/verify-workspace.d.ts.map +1 -1
  508. package/dist/os/rfc/verify-workspace.js +148 -48
  509. package/dist/os/rfc/verify-workspace.js.map +1 -1
  510. package/dist/os/session/handlers/archive.d.ts.map +1 -1
  511. package/dist/os/session/handlers/archive.js +3 -7
  512. package/dist/os/session/handlers/archive.js.map +1 -1
  513. package/dist/os/session/handlers/metrics-rfc.d.ts.map +1 -1
  514. package/dist/os/session/handlers/metrics-rfc.js +42 -11
  515. package/dist/os/session/handlers/metrics-rfc.js.map +1 -1
  516. package/dist/os/session/handlers/save.d.ts.map +1 -1
  517. package/dist/os/session/handlers/save.js +50 -24
  518. package/dist/os/session/handlers/save.js.map +1 -1
  519. package/dist/os/session/handlers/session-audit-report.d.ts.map +1 -1
  520. package/dist/os/session/handlers/session-audit-report.js +21 -6
  521. package/dist/os/session/handlers/session-audit-report.js.map +1 -1
  522. package/dist/os/session/handlers/session-audit.d.ts.map +1 -1
  523. package/dist/os/session/handlers/session-audit.js +22 -9
  524. package/dist/os/session/handlers/session-audit.js.map +1 -1
  525. package/dist/os/session/session.module.d.ts.map +1 -1
  526. package/dist/os/session/session.module.js +29 -9
  527. package/dist/os/session/session.module.js.map +1 -1
  528. package/dist/os/system/handlers/system-outbox-scan.d.ts.map +1 -1
  529. package/dist/os/system/handlers/system-outbox-scan.js +36 -18
  530. package/dist/os/system/handlers/system-outbox-scan.js.map +1 -1
  531. package/dist/os/system/handlers/system-product-register.d.ts +24 -0
  532. package/dist/os/system/handlers/system-product-register.d.ts.map +1 -0
  533. package/dist/os/system/handlers/system-product-register.js +322 -0
  534. package/dist/os/system/handlers/system-product-register.js.map +1 -0
  535. package/dist/os/system/handlers/system-products-status.d.ts +23 -0
  536. package/dist/os/system/handlers/system-products-status.d.ts.map +1 -0
  537. package/dist/os/system/handlers/system-products-status.js +235 -0
  538. package/dist/os/system/handlers/system-products-status.js.map +1 -0
  539. package/dist/os/system/handlers/system-task-dispatch.d.ts.map +1 -1
  540. package/dist/os/system/handlers/system-task-dispatch.js +14 -16
  541. package/dist/os/system/handlers/system-task-dispatch.js.map +1 -1
  542. package/dist/os/system/handlers/system-versionset-record.js +3 -3
  543. package/dist/os/system/scenario-schemas.js +1 -1
  544. package/dist/os/system/schemas.d.ts +13 -0
  545. package/dist/os/system/schemas.d.ts.map +1 -1
  546. package/dist/os/system/schemas.js +15 -0
  547. package/dist/os/system/schemas.js.map +1 -1
  548. package/dist/os/system/system.module.d.ts.map +1 -1
  549. package/dist/os/system/system.module.js +126 -11
  550. package/dist/os/system/system.module.js.map +1 -1
  551. package/dist/os/system/task-schemas.d.ts +3 -3
  552. package/dist/os/trajectory/handlers/journal-io.d.ts.map +1 -1
  553. package/dist/os/trajectory/handlers/journal-io.js +2 -2
  554. package/dist/os/trajectory/handlers/journal-io.js.map +1 -1
  555. package/dist/os/trajectory/handlers/outcome-record.d.ts.map +1 -1
  556. package/dist/os/trajectory/handlers/outcome-record.js +49 -9
  557. package/dist/os/trajectory/handlers/outcome-record.js.map +1 -1
  558. package/dist/os/trajectory/handlers/trajectory-index.d.ts.map +1 -1
  559. package/dist/os/trajectory/handlers/trajectory-index.js +75 -21
  560. package/dist/os/trajectory/handlers/trajectory-index.js.map +1 -1
  561. package/dist/os/trajectory/handlers/trajectory-recall.d.ts.map +1 -1
  562. package/dist/os/trajectory/handlers/trajectory-recall.js +38 -10
  563. package/dist/os/trajectory/handlers/trajectory-recall.js.map +1 -1
  564. package/dist/os/trajectory/trajectory.module.d.ts.map +1 -1
  565. package/dist/os/trajectory/trajectory.module.js +35 -7
  566. package/dist/os/trajectory/trajectory.module.js.map +1 -1
  567. package/dist/src/adversarial/types.d.ts +44 -0
  568. package/dist/src/adversarial/types.d.ts.map +1 -0
  569. package/dist/src/adversarial/types.js +82 -0
  570. package/dist/src/adversarial/types.js.map +1 -0
  571. package/dist/src/authority/delegations.d.ts +1 -1
  572. package/dist/src/authority/delegations.d.ts.map +1 -1
  573. package/dist/src/authority/delegations.js +9 -2
  574. package/dist/src/authority/delegations.js.map +1 -1
  575. package/dist/src/command-modules.d.ts.map +1 -1
  576. package/dist/src/command-modules.js +2 -0
  577. package/dist/src/command-modules.js.map +1 -1
  578. package/dist/src/config/forge-config.d.ts +67 -1
  579. package/dist/src/config/forge-config.d.ts.map +1 -1
  580. package/dist/src/config/forge-config.js +116 -13
  581. package/dist/src/config/forge-config.js.map +1 -1
  582. package/dist/src/correctness/policy-bundle.d.ts +72 -0
  583. package/dist/src/correctness/policy-bundle.d.ts.map +1 -0
  584. package/dist/src/correctness/policy-bundle.js +170 -0
  585. package/dist/src/correctness/policy-bundle.js.map +1 -0
  586. package/dist/src/knowledge/paths.d.ts +21 -0
  587. package/dist/src/knowledge/paths.d.ts.map +1 -0
  588. package/dist/src/knowledge/paths.js +57 -0
  589. package/dist/src/knowledge/paths.js.map +1 -0
  590. package/dist/src/knowledge/sync.d.ts +7 -0
  591. package/dist/src/knowledge/sync.d.ts.map +1 -1
  592. package/dist/src/knowledge/sync.js +41 -13
  593. package/dist/src/knowledge/sync.js.map +1 -1
  594. package/dist/src/onboarding/create.d.ts.map +1 -1
  595. package/dist/src/onboarding/create.js +27 -2
  596. package/dist/src/onboarding/create.js.map +1 -1
  597. package/dist/src/onboarding/init.d.ts.map +1 -1
  598. package/dist/src/onboarding/init.js +19 -5
  599. package/dist/src/onboarding/init.js.map +1 -1
  600. package/dist/src/onboarding/npm-token-check.d.ts.map +1 -1
  601. package/dist/src/onboarding/npm-token-check.js +9 -1
  602. package/dist/src/onboarding/npm-token-check.js.map +1 -1
  603. package/dist/src/onboarding/scaffold-project.d.ts.map +1 -1
  604. package/dist/src/onboarding/scaffold-project.js +17 -5
  605. package/dist/src/onboarding/scaffold-project.js.map +1 -1
  606. package/dist/src/onboarding/trust-boundary.d.ts +16 -0
  607. package/dist/src/onboarding/trust-boundary.d.ts.map +1 -0
  608. package/dist/src/onboarding/trust-boundary.js +806 -0
  609. package/dist/src/onboarding/trust-boundary.js.map +1 -0
  610. package/dist/src/onboarding/upgrade.d.ts +4 -0
  611. package/dist/src/onboarding/upgrade.d.ts.map +1 -1
  612. package/dist/src/onboarding/upgrade.js +120 -9
  613. package/dist/src/onboarding/upgrade.js.map +1 -1
  614. package/dist/src/profiles/stack-profile.js +2 -2
  615. package/dist/src/types.d.ts +6 -1
  616. package/dist/src/types.d.ts.map +1 -1
  617. package/dist/src/types.js +4 -4
  618. package/dist/src/utils/verifier-git.d.ts +1329 -0
  619. package/dist/src/utils/verifier-git.d.ts.map +1 -0
  620. package/dist/src/utils/verifier-git.js +7827 -0
  621. package/dist/src/utils/verifier-git.js.map +1 -0
  622. package/dist/src/validators/skill-validate.d.ts.map +1 -1
  623. package/dist/src/validators/skill-validate.js +17 -5
  624. package/dist/src/validators/skill-validate.js.map +1 -1
  625. package/docs/adversarial/downgrade-forge/scenario.yaml +22 -0
  626. package/docs/adversarial/drop-manifest-entry/scenario.yaml +25 -0
  627. package/docs/adversarial/edit-frozen-file/scenario.yaml +24 -0
  628. package/docs/adversarial/edit-policy-key/scenario.yaml +41 -0
  629. package/docs/adversarial/forge-review-record/scenario.yaml +34 -0
  630. package/docs/adversarial/grow-allow/scenario.yaml +46 -0
  631. package/docs/adversarial/mixed-weakening/scenario.yaml +26 -0
  632. package/docs/adversarial/rebind-checkrun/scenario.yaml +41 -0
  633. package/docs/adversarial/self-exempt/scenario.yaml +41 -0
  634. package/docs/adversarial/shrink-policy-decl/scenario.yaml +41 -0
  635. package/docs/adversarial/spoof-verifier-trailer/scenario.yaml +26 -0
  636. package/docs/adversarial/weaken-oracle/scenario.yaml +22 -0
  637. package/docs/maintainers/publishing.md +1 -1
  638. package/docs/reference/correctness-gate.md +35 -5
  639. package/docs/reference/forge-yaml.md +16 -0
  640. package/docs/reference/system-hub.md +104 -0
  641. package/docs/reference/trust-boundary.md +36 -0
  642. package/os/adr/handlers/archive.ts +3 -11
  643. package/os/adr/handlers/implement-stamp.ts +56 -26
  644. package/os/adr/handlers/list-create.test.ts +174 -0
  645. package/os/adr/handlers/list-create.ts +16 -8
  646. package/os/adr/handlers/validate.ts +66 -28
  647. package/os/adversarial/adversarial.module.ts +147 -0
  648. package/os/adversarial/catalog.test.ts +96 -0
  649. package/os/adversarial/catalog.ts +79 -0
  650. package/os/adversarial/runner.ts +533 -0
  651. package/os/agent/handlers/agent-tiers-validate.ts +39 -10
  652. package/os/agent/index.ts +1 -1
  653. package/os/agent-tools/agent-tools.module.ts +84 -0
  654. package/os/agent-tools/generate.ts +104 -0
  655. package/os/agent-tools/handlers/tools-generate.ts +137 -0
  656. package/os/agent-tools/index.ts +23 -0
  657. package/os/agent-tools/manifest.ts +95 -0
  658. package/os/agent-tools/serve.ts +127 -0
  659. package/os/agent-tools/server.ts +460 -0
  660. package/os/agent-tools/tool-server.test.ts +226 -0
  661. package/os/agent-tools/tools-generate.test.ts +204 -0
  662. package/os/agent-tools/types.ts +139 -0
  663. package/os/audit/handlers/archive.ts +3 -11
  664. package/os/authority/authority.module.ts +17 -2
  665. package/os/checks/checks.module.ts +46 -11
  666. package/os/checks/handlers/contribution-liveness.test.ts +142 -0
  667. package/os/checks/handlers/contribution-report.test.ts +46 -11
  668. package/os/checks/handlers/contribution-report.ts +222 -44
  669. package/os/checks/handlers/counters-export.test.ts +179 -8
  670. package/os/checks/handlers/counters-export.ts +77 -9
  671. package/os/checks/handlers/counters-journal.test.ts +25 -5
  672. package/os/checks/handlers/counters-validate.test.ts +21 -6
  673. package/os/checks/handlers/counters-validate.ts +4 -2
  674. package/os/checks/handlers/variant-candidates.test.ts +6 -2
  675. package/os/codebase/handlers/codebase-measure.ts +17 -20
  676. package/os/codebase/index.ts +4 -1
  677. package/os/compass/handlers/compass-audit-handler.ts +236 -38
  678. package/os/compass/handlers/compass-header-scaffold-handler.ts +47 -2
  679. package/os/compass/handlers/compass-migrate-handler.ts +46 -4
  680. package/os/compass/handlers/git-revision.ts +183 -63
  681. package/os/compass/handlers/summary-record.ts +48 -10
  682. package/os/context/context.module.ts +23 -4
  683. package/os/context/handlers/context-assemble.test.ts +5 -2
  684. package/os/context/handlers/context-assemble.ts +144 -28
  685. package/os/context/handlers/context-slate-eval.test.ts +11 -5
  686. package/os/context/handlers/context-slate-eval.ts +36 -10
  687. package/os/context/handlers/index-build.ts +179 -40
  688. package/os/context/handlers/no-model-deps.test.ts +8 -3
  689. package/os/context/handlers/slate-fill.test.ts +7 -2
  690. package/os/core/archive-regen.ts +209 -18
  691. package/os/core/core.module.ts +215 -51
  692. package/os/core/docs-archive.test.ts +159 -37
  693. package/os/core/handlers/forge-autonomy-validate.ts +104 -2
  694. package/os/core/handlers/package-health.ts +6 -6
  695. package/os/core/handlers/pinned-check.ts +30 -0
  696. package/os/core/handlers/pinned-types.ts +7 -0
  697. package/os/core/handlers/pinned-validate.ts +28 -3
  698. package/os/core/handlers/policy-digest.test.ts +143 -0
  699. package/os/core/handlers/policy-digest.ts +470 -0
  700. package/os/correctness/audit/snapshot.ts +46 -22
  701. package/os/correctness/correctness-chain.test.ts +6 -2
  702. package/os/correctness/correctness.module.ts +6 -3
  703. package/os/correctness/gate/anchor-events.test.ts +5 -1
  704. package/os/correctness/gate/freeze-coverage.test.ts +1 -1
  705. package/os/correctness/gate/freeze-diff.test.ts +1 -1
  706. package/os/correctness/gate/frozen.ts +691 -58
  707. package/os/correctness/gate/gate-mode.test.ts +5 -1
  708. package/os/correctness/gate/hardening.test.ts +5 -2
  709. package/os/correctness/gate/origin.ts +77 -37
  710. package/os/correctness/gate/policy-freeze-cx.test.ts +174 -0
  711. package/os/correctness/gate/policy-freeze-cx10.test.ts +873 -0
  712. package/os/correctness/gate/policy-freeze-cx11.test.ts +534 -0
  713. package/os/correctness/gate/policy-freeze-cx12.test.ts +488 -0
  714. package/os/correctness/gate/policy-freeze-cx13.test.ts +734 -0
  715. package/os/correctness/gate/policy-freeze-cx14.test.ts +533 -0
  716. package/os/correctness/gate/policy-freeze-cx15.test.ts +830 -0
  717. package/os/correctness/gate/policy-freeze-cx16.test.ts +652 -0
  718. package/os/correctness/gate/policy-freeze-cx17.test.ts +717 -0
  719. package/os/correctness/gate/policy-freeze-cx18.test.ts +705 -0
  720. package/os/correctness/gate/policy-freeze-cx19.test.ts +376 -0
  721. package/os/correctness/gate/policy-freeze-cx2.test.ts +691 -0
  722. package/os/correctness/gate/policy-freeze-cx20.test.ts +572 -0
  723. package/os/correctness/gate/policy-freeze-cx21.test.ts +423 -0
  724. package/os/correctness/gate/policy-freeze-cx22.test.ts +978 -0
  725. package/os/correctness/gate/policy-freeze-cx23.test.ts +431 -0
  726. package/os/correctness/gate/policy-freeze-cx24.test.ts +509 -0
  727. package/os/correctness/gate/policy-freeze-cx25.test.ts +1064 -0
  728. package/os/correctness/gate/policy-freeze-cx3.test.ts +569 -0
  729. package/os/correctness/gate/policy-freeze-cx4.test.ts +731 -0
  730. package/os/correctness/gate/policy-freeze-cx5.test.ts +577 -0
  731. package/os/correctness/gate/policy-freeze-cx6.test.ts +944 -0
  732. package/os/correctness/gate/policy-freeze-cx7.test.ts +622 -0
  733. package/os/correctness/gate/policy-freeze-cx8.test.ts +638 -0
  734. package/os/correctness/gate/policy-freeze-cx9.test.ts +959 -0
  735. package/os/correctness/gate/policy-freeze.test.ts +249 -0
  736. package/os/correctness/gate/repo.ts +194 -15
  737. package/os/correctness/gate/run.ts +444 -65
  738. package/os/correctness/gate/runner.ts +41 -8
  739. package/os/correctness/gate/tests/gate-fixture.ts +27 -2
  740. package/os/correctness/gate/tier-high.test.ts +5 -1
  741. package/os/correctness/gate/trust-boundary-cx1.test.ts +1020 -0
  742. package/os/correctness/gate/trust-boundary-cx10.test.ts +755 -0
  743. package/os/correctness/gate/trust-boundary-cx11.test.ts +515 -0
  744. package/os/correctness/gate/trust-boundary-cx12.test.ts +552 -0
  745. package/os/correctness/gate/trust-boundary-cx13.test.ts +446 -0
  746. package/os/correctness/gate/trust-boundary-cx14.test.ts +375 -0
  747. package/os/correctness/gate/trust-boundary-cx15.test.ts +421 -0
  748. package/os/correctness/gate/trust-boundary-cx16.test.ts +487 -0
  749. package/os/correctness/gate/trust-boundary-cx17.test.ts +319 -0
  750. package/os/correctness/gate/trust-boundary-cx18.test.ts +516 -0
  751. package/os/correctness/gate/trust-boundary-cx19.test.ts +514 -0
  752. package/os/correctness/gate/trust-boundary-cx2.test.ts +979 -0
  753. package/os/correctness/gate/trust-boundary-cx20.test.ts +216 -0
  754. package/os/correctness/gate/trust-boundary-cx22.test.ts +193 -0
  755. package/os/correctness/gate/trust-boundary-cx23.test.ts +283 -0
  756. package/os/correctness/gate/trust-boundary-cx24.test.ts +180 -0
  757. package/os/correctness/gate/trust-boundary-cx25.test.ts +482 -0
  758. package/os/correctness/gate/trust-boundary-cx26.test.ts +408 -0
  759. package/os/correctness/gate/trust-boundary-cx27.test.ts +983 -0
  760. package/os/correctness/gate/trust-boundary-cx28.test.ts +587 -0
  761. package/os/correctness/gate/trust-boundary-cx29a.test.ts +226 -0
  762. package/os/correctness/gate/trust-boundary-cx29b.test.ts +271 -0
  763. package/os/correctness/gate/trust-boundary-cx29c.test.ts +217 -0
  764. package/os/correctness/gate/trust-boundary-cx29d.test.ts +544 -0
  765. package/os/correctness/gate/trust-boundary-cx29e.test.ts +207 -0
  766. package/os/correctness/gate/trust-boundary-cx29f.test.ts +226 -0
  767. package/os/correctness/gate/trust-boundary-cx29g.test.ts +74 -0
  768. package/os/correctness/gate/trust-boundary-cx3.test.ts +929 -0
  769. package/os/correctness/gate/trust-boundary-cx30a.test.ts +195 -0
  770. package/os/correctness/gate/trust-boundary-cx30b.test.ts +296 -0
  771. package/os/correctness/gate/trust-boundary-cx31a.test.ts +129 -0
  772. package/os/correctness/gate/trust-boundary-cx31b.test.ts +333 -0
  773. package/os/correctness/gate/trust-boundary-cx31c.test.ts +259 -0
  774. package/os/correctness/gate/trust-boundary-cx31d.test.ts +132 -0
  775. package/os/correctness/gate/trust-boundary-cx32a.test.ts +275 -0
  776. package/os/correctness/gate/trust-boundary-cx32b.test.ts +509 -0
  777. package/os/correctness/gate/trust-boundary-cx32c.test.ts +211 -0
  778. package/os/correctness/gate/trust-boundary-cx32d.test.ts +184 -0
  779. package/os/correctness/gate/trust-boundary-cx33a.test.ts +250 -0
  780. package/os/correctness/gate/trust-boundary-cx33b.test.ts +287 -0
  781. package/os/correctness/gate/trust-boundary-cx33c.test.ts +122 -0
  782. package/os/correctness/gate/trust-boundary-cx33d.test.ts +357 -0
  783. package/os/correctness/gate/trust-boundary-cx33e.test.ts +96 -0
  784. package/os/correctness/gate/trust-boundary-cx34a.test.ts +283 -0
  785. package/os/correctness/gate/trust-boundary-cx34b.test.ts +228 -0
  786. package/os/correctness/gate/trust-boundary-cx34d.test.ts +282 -0
  787. package/os/correctness/gate/trust-boundary-cx34e.test.ts +224 -0
  788. package/os/correctness/gate/trust-boundary-cx34f.test.ts +250 -0
  789. package/os/correctness/gate/trust-boundary-cx34g.test.ts +179 -0
  790. package/os/correctness/gate/trust-boundary-cx34h.test.ts +293 -0
  791. package/os/correctness/gate/trust-boundary-cx34i.test.ts +245 -0
  792. package/os/correctness/gate/trust-boundary-cx35a.test.ts +181 -0
  793. package/os/correctness/gate/trust-boundary-cx35b.test.ts +137 -0
  794. package/os/correctness/gate/trust-boundary-cx35c.test.ts +149 -0
  795. package/os/correctness/gate/trust-boundary-cx35d.test.ts +121 -0
  796. package/os/correctness/gate/trust-boundary-cx35e.test.ts +108 -0
  797. package/os/correctness/gate/trust-boundary-cx36.test.ts +120 -0
  798. package/os/correctness/gate/trust-boundary-cx37.test.ts +430 -0
  799. package/os/correctness/gate/trust-boundary-cx38.test.ts +436 -0
  800. package/os/correctness/gate/trust-boundary-cx39.test.ts +432 -0
  801. package/os/correctness/gate/trust-boundary-cx4.test.ts +764 -0
  802. package/os/correctness/gate/trust-boundary-cx40.test.ts +264 -0
  803. package/os/correctness/gate/trust-boundary-cx41.test.ts +460 -0
  804. package/os/correctness/gate/trust-boundary-cx42.test.ts +432 -0
  805. package/os/correctness/gate/trust-boundary-cx43.test.ts +257 -0
  806. package/os/correctness/gate/trust-boundary-cx5.test.ts +998 -0
  807. package/os/correctness/gate/trust-boundary-cx6.test.ts +701 -0
  808. package/os/correctness/gate/trust-boundary-cx7.test.ts +1007 -0
  809. package/os/correctness/gate/trust-boundary-cx8.test.ts +929 -0
  810. package/os/correctness/gate/trust-boundary-cx9.test.ts +993 -0
  811. package/os/correctness/gate/types.ts +4 -0
  812. package/os/correctness/handlers/gate.ts +2 -0
  813. package/os/correctness/handlers/validate.ts +63 -12
  814. package/os/correctness/references.ts +63 -20
  815. package/os/correctness/workspace.ts +203 -22
  816. package/os/flow/branch-name.ts +3 -6
  817. package/os/flow/correctness-step.ts +91 -17
  818. package/os/flow/digest.ts +962 -201
  819. package/os/flow/dup-id-scan.ts +187 -0
  820. package/os/flow/evidence-lock.ts +184 -0
  821. package/os/flow/flow.module.ts +162 -19
  822. package/os/flow/git.ts +952 -86
  823. package/os/flow/guard-files.ts +5 -14
  824. package/os/flow/handlers/flow-backmerge.ts +11 -22
  825. package/os/flow/handlers/flow-check.ts +2 -2
  826. package/os/flow/handlers/flow-cut.ts +459 -252
  827. package/os/flow/handlers/flow-digest.ts +14 -9
  828. package/os/flow/handlers/flow-discard.ts +6 -6
  829. package/os/flow/handlers/flow-fix.ts +104 -29
  830. package/os/flow/handlers/flow-hold.ts +24 -37
  831. package/os/flow/handlers/flow-install.ts +61 -33
  832. package/os/flow/handlers/flow-integrate.ts +992 -209
  833. package/os/flow/handlers/flow-open.ts +104 -12
  834. package/os/flow/handlers/flow-publication-retire.ts +38 -17
  835. package/os/flow/handlers/flow-push.ts +925 -73
  836. package/os/flow/handlers/flow-status.ts +32 -13
  837. package/os/flow/handlers/flow-swept.ts +185 -0
  838. package/os/flow/handlers/flow-version.ts +5 -18
  839. package/os/flow/index.ts +8 -4
  840. package/os/flow/line-version.ts +21 -8
  841. package/os/flow/locks.ts +44 -16
  842. package/os/flow/markers.ts +16 -5
  843. package/os/flow/ops-registry.ts +25 -7
  844. package/os/flow/post-rebase-regen.ts +218 -25
  845. package/os/flow/pre-lock.ts +334 -0
  846. package/os/flow/preflight.ts +110 -17
  847. package/os/flow/primary-dirt.ts +319 -0
  848. package/os/flow/publish.ts +35 -17
  849. package/os/flow/registry.ts +29 -15
  850. package/os/flow/release-level.ts +25 -12
  851. package/os/flow/release-lines.ts +4 -5
  852. package/os/flow/release-tags.ts +47 -19
  853. package/os/flow/repo-kind.ts +6 -3
  854. package/os/flow/scripts.ts +40 -7
  855. package/os/flow/semver.ts +1 -1
  856. package/os/flow/session-checkout.ts +3 -3
  857. package/os/flow/standalone-invoke.ts +2 -2
  858. package/os/flow/tests/branch-name.test.ts +15 -7
  859. package/os/flow/tests/digest-id-inputs.test.ts +106 -0
  860. package/os/flow/tests/digest-persist.test.ts +243 -0
  861. package/os/flow/tests/evidence-preflight-surface-skip.test.ts +218 -0
  862. package/os/flow/tests/flow-backmerge.test.ts +8 -6
  863. package/os/flow/tests/flow-check.test.ts +6 -11
  864. package/os/flow/tests/flow-cut-prepare.test.ts +64 -15
  865. package/os/flow/tests/flow-cut.rerun.test.ts +1 -1
  866. package/os/flow/tests/flow-cut.test.ts +230 -11
  867. package/os/flow/tests/flow-detachable.test.ts +10 -2
  868. package/os/flow/tests/flow-digest.test.ts +109 -29
  869. package/os/flow/tests/flow-fix.test.ts +96 -20
  870. package/os/flow/tests/flow-guard-parity.test.ts +55 -53
  871. package/os/flow/tests/flow-guard-push.test.ts +39 -2
  872. package/os/flow/tests/flow-guard.test.ts +5 -10
  873. package/os/flow/tests/flow-hold.test.ts +43 -10
  874. package/os/flow/tests/flow-install-markers.test.ts +47 -20
  875. package/os/flow/tests/flow-install.rerun.test.ts +18 -9
  876. package/os/flow/tests/flow-install.test.ts +19 -19
  877. package/os/flow/tests/flow-integrate-correctness-gate.test.ts +3 -4
  878. package/os/flow/tests/flow-integrate-prelock.test.ts +392 -0
  879. package/os/flow/tests/flow-integrate.gate-report.test.ts +2 -4
  880. package/os/flow/tests/flow-integrate.post-rebase-regen.test.ts +33 -0
  881. package/os/flow/tests/flow-integrate.preflight.test.ts +36 -1
  882. package/os/flow/tests/flow-integrate.test.ts +375 -21
  883. package/os/flow/tests/flow-open.test.ts +123 -9
  884. package/os/flow/tests/flow-publication-retire.test.ts +13 -6
  885. package/os/flow/tests/flow-push-attest.test.ts +137 -0
  886. package/os/flow/tests/flow-push-publish.test.ts +45 -19
  887. package/os/flow/tests/flow-push-review-baseline.test.ts +339 -0
  888. package/os/flow/tests/flow-push-supersede.test.ts +37 -34
  889. package/os/flow/tests/flow-push-verifier-batch.test.ts +134 -0
  890. package/os/flow/tests/flow-push-verifier-review.test.ts +190 -0
  891. package/os/flow/tests/flow-push.test.ts +15 -7
  892. package/os/flow/tests/flow-status.test.ts +54 -1
  893. package/os/flow/tests/flow-swept.test.ts +105 -0
  894. package/os/flow/tests/flow-task-files.test.ts +18 -4
  895. package/os/flow/tests/helpers.test.ts +91 -0
  896. package/os/flow/tests/helpers.ts +188 -19
  897. package/os/flow/tests/locks.test.ts +5 -4
  898. package/os/flow/tests/post-rebase-regen.test.ts +315 -0
  899. package/os/flow/tests/scripts.test.ts +8 -4
  900. package/os/flow/tests/state-roots.test.ts +8 -11
  901. package/os/flow/version-files.ts +4 -2
  902. package/os/flow/worktree-path.ts +3 -9
  903. package/os/friction/friction-add.test.ts +183 -0
  904. package/os/friction/friction-migrate.test.ts +203 -0
  905. package/os/friction/friction-store.test.ts +184 -0
  906. package/os/friction/friction-validate.test.ts +133 -21
  907. package/os/friction/friction.module.ts +169 -31
  908. package/os/friction/handlers/friction-add.ts +263 -0
  909. package/os/friction/handlers/friction-migrate.ts +425 -0
  910. package/os/friction/handlers/friction-validate.ts +238 -176
  911. package/os/friction/index.ts +14 -1
  912. package/os/friction/qa-log-shards.test.ts +111 -0
  913. package/os/friction/store.ts +303 -0
  914. package/os/friction/types.ts +19 -13
  915. package/os/gate/gate.module.ts +47 -6
  916. package/os/gate/handlers/gate-probe-catalog.test.ts +1 -1
  917. package/os/gate/handlers/gate-probe-catalog.ts +445 -42
  918. package/os/gate/handlers/gate-probe-ratchet.test.ts +364 -0
  919. package/os/gate/handlers/gate-probe.test.ts +27 -5
  920. package/os/gate/handlers/gate-probe.ts +110 -12
  921. package/os/gate/handlers/liveness.ts +113 -0
  922. package/os/gate/handlers/probe-runs-journal.ts +167 -0
  923. package/os/gate-run/gate-run.module.ts +3 -0
  924. package/os/gate-run/index.ts +11 -0
  925. package/os/gate-run/record.ts +8 -1
  926. package/os/gate-run/status.ts +9 -1
  927. package/os/gate-run/tests/gate-run-record.test.ts +11 -1
  928. package/os/gate-run/tests/gate-run-status.test.ts +2 -0
  929. package/os/gate-run/types.ts +8 -0
  930. package/os/instructions/budget.test.ts +32 -7
  931. package/os/instructions/handlers/scar-migrate.ts +55 -66
  932. package/os/instructions/instructions.module.ts +32 -5
  933. package/os/knowledge/handlers/knowledge-authz-probe.ts +38 -12
  934. package/os/knowledge/handlers/knowledge-rebuild.test.ts +5 -2
  935. package/os/knowledge/handlers/knowledge-rebuild.ts +39 -16
  936. package/os/knowledge/knowledge.module.ts +21 -4
  937. package/os/mission/handlers/archive.test.ts +47 -30
  938. package/os/mission/handlers/archive.ts +3 -11
  939. package/os/mission/lockfile.ts +47 -20
  940. package/os/naming/naming-convention.test.ts +1 -0
  941. package/os/naming/naming-convention.ts +2 -2
  942. package/os/plan/handlers/archive.ts +3 -11
  943. package/os/program/discovery.ts +70 -44
  944. package/os/program/handlers/complete.ts +28 -10
  945. package/os/program/handlers/lease.ts +11 -2
  946. package/os/program/handlers/seal.ts +3 -3
  947. package/os/program/handlers/validate.ts +3 -3
  948. package/os/queue/handlers/queue-decision.ts +253 -0
  949. package/os/queue/handlers/queue-validate.ts +24 -23
  950. package/os/queue/manifest.ts +1 -2
  951. package/os/queue/queue-decision.test.ts +262 -0
  952. package/os/queue/queue.module.ts +93 -4
  953. package/os/rfc/frontmatter-io.ts +6 -3
  954. package/os/rfc/handlers/archive.ts +3 -11
  955. package/os/rfc/handlers/implement-stamp-origin.ts +6 -3
  956. package/os/rfc/handlers/implement-stamp.ts +65 -46
  957. package/os/rfc/handlers/index-graph.ts +14 -0
  958. package/os/rfc/handlers/list-create.ts +22 -17
  959. package/os/rfc/handlers/rfc-evidence-sync.ts +62 -22
  960. package/os/rfc/handlers/validate-moves.test.ts +221 -0
  961. package/os/rfc/handlers/validate-probe-meta.test.ts +21 -1
  962. package/os/rfc/handlers/validate-rules.ts +216 -60
  963. package/os/rfc/handlers/validate.ts +1 -5
  964. package/os/rfc/next-id.ts +155 -21
  965. package/os/rfc/outcome-probe.ts +13 -4
  966. package/os/rfc/reachable-symbol.ts +65 -43
  967. package/os/rfc/rfc-0000-template.md +10 -0
  968. package/os/rfc/rfc.module.ts +26 -4
  969. package/os/rfc/types.ts +31 -3
  970. package/os/rfc/verification-evidence.ts +74 -25
  971. package/os/rfc/verification-origin.ts +358 -62
  972. package/os/rfc/verifier/rfc-1333/imp12-binding.acceptance.test.ts +1 -1
  973. package/os/rfc/verifier/rfc-1333/imp12-gate.acceptance.test.ts +1 -1
  974. package/os/rfc/verifier/rfc-1333/skills-and-types.acceptance.test.ts +1 -1
  975. package/os/rfc/verifier/rfc-1333/verify-workspace.acceptance.test.ts +1 -1
  976. package/os/rfc/verifier/rfc-1391/fixtures/no-report.proof.test.ts +1 -1
  977. package/os/rfc/verifier/rfc-1391/fixtures/small-domain.proof.test.ts +1 -1
  978. package/os/rfc/verifier/rfc-1391/support.ts +1 -1
  979. package/os/rfc/verify-workspace.ts +147 -53
  980. package/os/session/handlers/archive.ts +3 -11
  981. package/os/session/handlers/metrics-rfc.ts +42 -11
  982. package/os/session/handlers/save.ts +52 -28
  983. package/os/session/handlers/session-audit-detectors.test.ts +16 -6
  984. package/os/session/handlers/session-audit-report.test.ts +9 -3
  985. package/os/session/handlers/session-audit-report.ts +34 -8
  986. package/os/session/handlers/session-audit.test.ts +25 -7
  987. package/os/session/handlers/session-audit.ts +49 -23
  988. package/os/session/session.module.ts +31 -9
  989. package/os/system/handlers/system-outbox-scan.ts +45 -17
  990. package/os/system/handlers/system-product-register.ts +492 -0
  991. package/os/system/handlers/system-products-status.ts +395 -0
  992. package/os/system/handlers/system-task-dispatch.ts +17 -21
  993. package/os/system/handlers/system-versionset-record.ts +3 -3
  994. package/os/system/scenario-schemas.ts +1 -1
  995. package/os/system/schemas.ts +17 -0
  996. package/os/system/system.module.ts +130 -11
  997. package/os/system/tests/scenario-pin-drift-check.test.ts +2 -0
  998. package/os/system/tests/scenario-validator-check.test.ts +2 -0
  999. package/os/system/tests/system-product-register.test.ts +304 -0
  1000. package/os/system/tests/system-products-status.test.ts +154 -0
  1001. package/os/system/tests/system-task-collect.test.ts +25 -15
  1002. package/os/system/tests/system-task-dispatch.test.ts +18 -7
  1003. package/os/system/tests/system-task-status.test.ts +7 -1
  1004. package/os/system/tests/system-task.test.ts +15 -4
  1005. package/os/system/tests/version-set-v2.test.ts +2 -0
  1006. package/os/trajectory/handlers/extract-units.test.ts +11 -6
  1007. package/os/trajectory/handlers/journal-io.ts +21 -7
  1008. package/os/trajectory/handlers/outcome-record.test.ts +28 -8
  1009. package/os/trajectory/handlers/outcome-record.ts +65 -18
  1010. package/os/trajectory/handlers/producer-trust.test.ts +22 -8
  1011. package/os/trajectory/handlers/trajectory-index.test.ts +75 -29
  1012. package/os/trajectory/handlers/trajectory-index.ts +116 -38
  1013. package/os/trajectory/handlers/trajectory-recall.test.ts +67 -19
  1014. package/os/trajectory/handlers/trajectory-recall.ts +115 -41
  1015. package/os/trajectory/handlers/trajectory.test.ts +19 -7
  1016. package/os/trajectory/handlers/verdict-binding.test.ts +138 -33
  1017. package/os/trajectory/trajectory.module.ts +35 -7
  1018. package/os/yaml/scalars.test.ts +1 -1
  1019. package/package.json +30 -1
  1020. package/profiles/godot-game.yaml +4 -4
  1021. package/profiles/root-agents-system.md +82 -0
  1022. package/profiles/system.yaml +1 -0
  1023. package/skills/_shared/fo-pipeline-conventions.md +15 -13
  1024. package/skills/fo/fo-handoff/SKILL.md +10 -2
  1025. package/skills/fo/fo-idea-audit/SKILL.md +4 -0
  1026. package/skills/fo/fo-idea-create-rfc/SKILL.md +21 -10
  1027. package/skills/fo/fo-idea-implement/SKILL.md +2 -10
  1028. package/skills/fo/fo-idea-plan/SKILL.md +7 -5
  1029. package/skills/fo/fo-knowledge-distill/SKILL.md +15 -4
  1030. package/skills/fo/fo-memory-sync/SKILL.md +7 -6
  1031. package/skills/fo/fo-reproduce/SKILL.md +2 -1
  1032. package/skills/fo/fo-session-retro/SKILL.md +87 -44
  1033. package/skills/fo/fo-session-save/SKILL.md +4 -3
  1034. package/skills/fo/fo-system-dispatch/SKILL.md +9 -0
  1035. package/skills/shared/grilling/SKILL.md +17 -9
  1036. package/skills/shared/knowledge/learned-principles.md +1 -1
  1037. package/skills/shared/writing-great-skills/SKILL.md +4 -3
  1038. package/src/adversarial/types.ts +100 -0
  1039. package/src/authority/delegations.ts +9 -2
  1040. package/src/command-modules.ts +6 -0
  1041. package/src/config/forge-config.ts +151 -13
  1042. package/src/correctness/policy-bundle.ts +187 -0
  1043. package/src/knowledge/paths.ts +75 -0
  1044. package/src/knowledge/sync.ts +42 -18
  1045. package/src/onboarding/create-superfolder-guard.test.ts +73 -0
  1046. package/src/onboarding/create.ts +28 -2
  1047. package/src/onboarding/init.ts +20 -5
  1048. package/src/onboarding/npm-token-check.ts +9 -1
  1049. package/src/onboarding/scaffold-project.ts +16 -5
  1050. package/src/onboarding/trust-boundary.test.ts +179 -0
  1051. package/src/onboarding/trust-boundary.ts +825 -0
  1052. package/src/onboarding/upgrade.ts +149 -9
  1053. package/src/profiles/stack-profile.ts +2 -2
  1054. package/src/scaffold/github/CODEOWNERS.template +14 -0
  1055. package/src/scaffold/github/forge-policy.template.yml +40 -0
  1056. package/src/tests/bindings-schema.test.ts +5 -1
  1057. package/src/tests/create.test.ts +74 -20
  1058. package/src/tests/evidence-consult-serialization.test.ts +202 -0
  1059. package/src/tests/forge-config.test.ts +5 -2
  1060. package/src/tests/knowledge-paths.test.ts +80 -0
  1061. package/src/tests/pinned-validate.test.ts +194 -0
  1062. package/src/tests/profile-flow-hooks.test.ts +1 -0
  1063. package/src/tests/profile-schema.test.ts +1 -0
  1064. package/src/tests/skill-validate.test.ts +76 -0
  1065. package/src/tests/stack-profile.test.ts +1 -0
  1066. package/src/types.ts +11 -6
  1067. package/src/utils/verifier-git.ts +8732 -0
  1068. package/src/validators/skill-validate.ts +17 -5
  1069. /package/skills/fo/fo-memory-sync/{qa-log.md → qa-log/legacy.md} +0 -0
  1070. /package/skills/fo/fo-session-save/{qa-log.md → qa-log/legacy.md} +0 -0
  1071. /package/skills/shared/grilling/{qa-log.md → qa-log/legacy.md} +0 -0
@@ -0,0 +1,1329 @@
1
+ /**
2
+ * Test-only seam — repoint the resolved git binary at a shim so failure-
3
+ * injection probes (PATH-shim suites that predate the hardened channel) can
4
+ * refuse chosen argv prefixes. Module state a session cannot reach: the
5
+ * spawned gate child and the adversarial runner's CLI still resolve the real
6
+ * binary. Pass `undefined` to re-resolve on the next call.
7
+ */
8
+ export declare function setVerifierGitBinForTests(bin: string | undefined): void;
9
+ /**
10
+ * Absolute path to the git executable the verifier may trust. Only
11
+ * well-known install dirs are probed — a session-controlled PATH entry can
12
+ * carry a `git` shim that answers evidence queries with fabrications
13
+ * (CX-52), so session PATH is deliberately never consulted: on layouts
14
+ * where git lives nowhere conventional the bare name is returned and the
15
+ * scrubbed child env fails closed (unreadable evidence, never a forged
16
+ * answer). The result is cached: the binary a run starts with is the
17
+ * binary it finishes with.
18
+ */
19
+ export declare function resolveGitBin(): string;
20
+ /**
21
+ * A PATH rebuilt from directories the session did not place first: the
22
+ * resolved git's own dir, the node's own dir, and the conventional system
23
+ * dirs. Session PATH entries are excluded wholesale — a shim dir earlier in
24
+ * PATH substitutes `git`/`sh`/hook executables for spawned children
25
+ * (CX-52).
26
+ */
27
+ export declare function verifierPath(): string;
28
+ /**
29
+ * Environment for git subprocesses on the trust boundary. Built on the
30
+ * spawned-child ALLOWLIST (verifierSpawnEnv) rather than a strip list —
31
+ * every variable not explicitly kept is dropped: repository redirection
32
+ * (`GIT_DIR`, `GIT_WORK_TREE`, `GIT_INDEX_FILE`, `GIT_OBJECT_DIRECTORY`,
33
+ * alternates), config injection (`GIT_CONFIG_*` url rewrites), transport
34
+ * and exec-path overrides (`GIT_SSH*`, `GIT_EXEC_PATH`), namespaces,
35
+ * ceilings, AND the generic preload/redirect levers a session owns —
36
+ * `LD_PRELOAD`/`LD_*`/`DYLD_*`, `BASH_ENV`/`ENV`/`CDPATH`/`IFS`,
37
+ * `NODE_OPTIONS`/`NODE_PATH`, `PYTHONPATH`/`PYTHONSTARTUP`, `RUBYLIB`,
38
+ * `PERL5LIB`/`PERL5OPT`, `GCONV_PATH`, `LOCALDOMAIN`, and anything not yet
39
+ * invented (CX-71: a compiled LD_PRELOAD .so answered a trusted evidence
40
+ * read verbatim). `refs/replace` substitution is disabled so committed
41
+ * reads see the object's real tree/message (CX-46..CX-51); the
42
+ * global/system config files are `/dev/null` so session-writable
43
+ * `~/.gitconfig` `url.insteadOf`/`alias`/`filter` entries cannot rewrite
44
+ * what a read resolves; and PATH is rebuilt around the resolved real git so
45
+ * a session shim cannot substitute executable resolution.
46
+ */
47
+ export declare function verifierGitEnv(): NodeJS.ProcessEnv;
48
+ /** The null-device path both env pins and dead-dir targets share — platform-aware. */
49
+ export declare const DEVNULL: string;
50
+ /**
51
+ * `-c` argv fragment shared by both evidence spawns — added inside the
52
+ * trusted body, never by the callsite, so the static argv judgment sees
53
+ * only the query itself. The path pins are resolved per call so the
54
+ * lazily-created hooks dir exists before git sees it.
55
+ */
56
+ export declare function evidenceConfigArgs(args?: readonly string[]): string[];
57
+ /**
58
+ * Compose the full pin argv for one evidence call — static pins plus the
59
+ * preflight's dynamic pins. `config` reads carry NO pins at all (CX-148):
60
+ * every pin is command-scope config that shadows the file value, so a
61
+ * `config --get <pinned-key>` answers the pin — verifier-curated output
62
+ * where the contract demands file truth (and provably disagrees with
63
+ * `--local --no-includes --list` on the same channel). Config reads
64
+ * invoke no levers — no drivers, attrs, index, or pager on a non-tty —
65
+ * and the scope pins (`GIT_CONFIG_GLOBAL`/`GIT_CONFIG_SYSTEM` → null
66
+ * device in `verifierGitEnv`) still bound the answer to the local file,
67
+ * so holding every `-c` pair back loses no protection.
68
+ */
69
+ export declare function evidencePinArgs(args: readonly string[], preflight?: EvidencePreflight | null): string[];
70
+ /**
71
+ * The `-c` pin pairs re-encoded as `GIT_CONFIG_*` env — command-scope config
72
+ * with the same precedence over `.git/config` that argv `-c` carries, but
73
+ * the spawned argv stays the judged query alone (`[subcommand, ...]`). The
74
+ * r8 pins-as-argv shifted every argv position: failure-injection seams that
75
+ * match the subcommand at `$1`/`$2` (the resolved-binary shim contract the
76
+ * CX-73..81 fixtures arm) silently missed, so an injected read failure
77
+ * degraded to a pass instead of an `unreadableReads` refusal (CX-115 r9
78
+ * regression). Pins ride the channel-owned env like `GIT_INDEX_FILE` —
79
+ * `verifierGitEnv` already strips ambient `GIT_CONFIG_*`, and caller
80
+ * `extraEnv` cannot re-add GIT_* keys, so the lever stays session-proof.
81
+ */
82
+ export declare function evidencePinEnv(args: readonly string[], preflight?: EvidencePreflight | null): Record<string, string>;
83
+ /**
84
+ * Caller-owned additions to an evidence env are filtered before merge —
85
+ * an `extraEnv` built from session state must not hand a lever back into
86
+ * the trusted subprocess. Allowlist, not denylist: PATH (the very lever
87
+ * `verifierPath` exists to replace), `http_proxy`/`https_proxy`/
88
+ * `SSL_CERT_FILE`/`NODE_EXTRA_CA_CERTS` MITM redirects, `GIT_*`
89
+ * redirections, preload levers — all dropped (CX-84). Locale/timezone/temp
90
+ * overrides are the only caller concerns the channel honors.
91
+ */
92
+ export declare function filterEvidenceExtraEnv(extra: Record<string, string> | undefined): Record<string, string>;
93
+ export interface EvidencePreflight {
94
+ /** `-c key=value` pairs neutralizing session-set config keys the static pins miss. */
95
+ configArgs: string[];
96
+ /**
97
+ * Config pins carried as SPLIT key/value pairs — for keys the flat
98
+ * `key=value` `-c` form cannot express (CX-r42-F3): `-c` grammar (and
99
+ * the `GIT_CONFIG_KEY_n` re-encode that used to consume it) splits at
100
+ * the first `=`, so a key containing `=` — `branch.<name>.*` for the
101
+ * legal refname character `=` — mangles to a garbage key and silently
102
+ * never pins. Env transport (`GIT_CONFIG_KEY_n`/`GIT_CONFIG_VALUE_n`)
103
+ * carries the key verbatim; `evidencePinEnv` appends these after the
104
+ * `-c` pairs, withheld on `config` reads like every other pin.
105
+ */
106
+ envPins: ReadonlyArray<{
107
+ key: string;
108
+ value: string;
109
+ }>;
110
+ /**
111
+ * `-c` pairs that must NOT sit on a `config` read — `core.hooksPath` is
112
+ * repo truth the install/check surface judges drift through
113
+ * (FLOW-ADOPT-02 reads `config --get core.hooksPath` on this channel);
114
+ * pinning it there answers the pin, not the repo. Applied to every
115
+ * subcommand except `config` — a hook-invoking read (fetch's
116
+ * reference-transaction, CX-74) still needs the dead dir.
117
+ */
118
+ hookArgs: string[];
119
+ /**
120
+ * Session-set keys `-c` cannot neutralize — the transport children that
121
+ * read them (remote helpers, proxies, credential/ssh helpers) are spawned
122
+ * without the parent's cmdline config, so a file value always wins
123
+ * (CX-72/CX-73/CX-76 empirically confirmed on git 2.53). Presence refuses
124
+ * the channel: an evidence answer through an unverifiable lever could be
125
+ * fabricated, and refusing is the only fail-closed answer.
126
+ */
127
+ refusedKeys: string[];
128
+ /**
129
+ * Session-writable `.git` metadata files that rewrite what a read
130
+ * resolves and have NO env/config kill switch — `info/grafts` (grafted
131
+ * parents reach rev-list/merge-base around GIT_NO_REPLACE_OBJECTS,
132
+ * CX-79), `objects/info/alternates` (foreign object store injected into
133
+ * every lookup), `shallow` (fabricated history truncation),
134
+ * `info/attributes` (CX-125: the file needs no program to falsify a
135
+ * content hash — git's BUILT-IN clean-side conversions
136
+ * `working-tree-encoding`/`text`/`eol`/`crlf`/`ident` run inside the
137
+ * index-vs-worktree hash, so a session-set `working-tree-encoding`
138
+ * transcoding to the committed blob's encoding makes status/diff
139
+ * answer clean on completely different worktree bytes; the
140
+ * `core.attributesFile` pin only covers the GLOBAL file — repo-local
141
+ * info/attributes is always consulted and has no kill switch).
142
+ * Presence refuses the channel.
143
+ */
144
+ shapeViolations: string[];
145
+ /**
146
+ * Shape files present with content but unable to falsify committed
147
+ * evidence once the reader pins hold — the commit-graph/MIDX caches
148
+ * are regenerable indexes ignored under
149
+ * `core.commitGraph=false`/`core.multiPackIndex=false`, so a forged
150
+ * cache cannot remap parentage or oid→pack bytes. Reported for
151
+ * digest diagnostics rather than refused.
152
+ */
153
+ warnedShape: string[];
154
+ /**
155
+ * The verifier-owned claims index — `.git/index` is session-writable
156
+ * and a forged stat tuple answers `status --porcelain` clean on dirty
157
+ * bytes (CX-121), while a HEAD-anchored index cannot express staged or
158
+ * unborn-HEAD state. The index is self-serialized DIRC v2 from
159
+ * `ls-files --stage` claims with zeroed stat, so every
160
+ * index-consulting read (status/diff/ls-files/grep --cached)
161
+ * content-hashes the worktree instead of trusting a session tuple.
162
+ * Held as an inherited fd (`GIT_INDEX_FILE=/dev/fd/3`) so no path a
163
+ * same-uid session can rewrite ever exists (CX-129); platforms
164
+ * without `/dev/fd` keep the on-disk path and re-verify the bytes
165
+ * against `bytes` before every spawn.
166
+ */
167
+ index?: EvidenceIndex;
168
+ /**
169
+ * Set when a `.git/config` file exists but its bytes could not be
170
+ * captured into the fingerprint — an unreadable config cannot be
171
+ * drift-checked, so the channel refuses every spawn outright (fail
172
+ * closed, not unjudged).
173
+ */
174
+ configUnproven?: string;
175
+ /**
176
+ * The repo's `extensions.objectformat` (`sha256` when declared) —
177
+ * selects the empty-tree oid `GIT_ATTR_SOURCE` pins so attribute-
178
+ * driven config levers starve on every hash flavor (R13-D).
179
+ */
180
+ objectFormat?: string;
181
+ /**
182
+ * Set when the claims rebuild could not be proven (CX-124): no
183
+ * verifier-owned index view exists, so index-consulting spawns would
184
+ * consult the session-writable ambient index — exactly the CX-121
185
+ * forgery surface. Index-consulting argv must refuse; non-index
186
+ * reads (rev-parse/cat-file/log/ls-tree/…) never consult the index
187
+ * and stay trustworthy — refusing them wholesale would turn a
188
+ * corrupt-index fixture into a dead channel instead of the per-read
189
+ * degradation the gate contract records.
190
+ */
191
+ indexUnproven?: string;
192
+ /**
193
+ * The session-writable state this judgment was derived from, captured
194
+ * BEFORE the judged reads ran so it never records a surface newer than
195
+ * the one judged (CX-134/CX-135). A cached preflight (OriginGit)
196
+ * re-proves the fingerprint synchronously before every spawn — any
197
+ * drift (config rewrite, new shape file, planted/rewritten object,
198
+ * index rewrite, .git indirection change) discards the cache and
199
+ * re-runs the full preflight, so a post-preflight session write can
200
+ * never ride a stale judgment. Per-call channels re-prove right
201
+ * before the spawn to shrink the judgment→spawn window.
202
+ */
203
+ fingerprint?: EvidenceFingerprint;
204
+ /**
205
+ * Verifier-owned overlay of the consultable `.git` namespace
206
+ * (CX-r35-A), minted lazily on the first consult that needs it and
207
+ * shared by every child on this preflight — the binding instant is
208
+ * the first armed window, never a mid-consult live path. `null`
209
+ * records a failed mint; `undefined` means not yet attempted.
210
+ */
211
+ overlay?: EvidenceGitdirOverlay | null;
212
+ /**
213
+ * Capture-instant worktree baseline (CX-r38-W1): every claims-index
214
+ * tracked path's lstat plus every worktree directory's member set,
215
+ * snapped inside the same preflight that minted the claims index.
216
+ * The arm compares this against arm-instant state — a flip or hide
217
+ * landing between capture and arm reads as drift exactly like the
218
+ * `.git` fingerprint's, instead of being adopted as the pin
219
+ * baseline. `undefined` means the surface was not capturable
220
+ * (bare repo or no claims index) — worktree-consulting argv then
221
+ * refuses via `worktreeArmPlan` returning null.
222
+ */
223
+ worktreeSurface?: WorktreeSurface;
224
+ /**
225
+ * RFC-1644: `true` when the preflight was asked to skip the worktree
226
+ * baseline (`worktreeSurface: "skip"`) — `worktreeSurface` is then
227
+ * `undefined`, which every consumer already treats as fail-closed.
228
+ */
229
+ worktreeSurfaceSkipped?: true;
230
+ }
231
+ /**
232
+ * RFC-1644: per-call preflight options. `worktreeSurface: "skip"` leaves
233
+ * the CX-r38-W1 worktree baseline uncaptured — only per-spawn preflights
234
+ * whose argv `consultReadsWorktreeSurface` classifies false may pass it.
235
+ * Cached/anchored preflights serve argv they cannot see and keep the
236
+ * default `"capture"`.
237
+ */
238
+ export interface EvidencePreflightOptions {
239
+ worktreeSurface?: "capture" | "skip";
240
+ }
241
+ /**
242
+ * The capture-instant worktree baseline a worktree-consulting spawn is
243
+ * judged against (CX-r38-W1). Mirrors the fingerprint's role for `.git`:
244
+ * the arm's pins/watches prove the surface did not drift between this
245
+ * capture and the consult; anything that did is a refusal, not a
246
+ * re-baseline.
247
+ */
248
+ export interface WorktreeSurface {
249
+ /**
250
+ * Consulted worktree-file path → capture-instant lstat (`null` =
251
+ * absent at capture). Carries three slot families: every claims-index
252
+ * path; `<dir>/.gitignore` for every inventoried directory (CX-r39-C1
253
+ * — an untracked rule source's bytes shape ignore verdicts exactly
254
+ * like a tracked one's, and a null-captured slot makes a plant drift
255
+ * instead of baseline); and `<gitlink>/.git` for every claimed name
256
+ * that materialized as a directory (CX-r39-S1 — populated means the
257
+ * consult reaches a nested gitdir the plan refuses outright, absent
258
+ * means a mid-window plant has a null baseline to drift against).
259
+ * ctime is kernel-owned — a write+restore cannot replay it, so a
260
+ * content flip inside the window always reads as drift.
261
+ */
262
+ readonly files: ReadonlyMap<string, {
263
+ ino: number;
264
+ ctimeMs: number;
265
+ } | null>;
266
+ /**
267
+ * Claims-index names whose capture-instant lstat is a DIRECTORY —
268
+ * gitlinks (mode-160000 claims materialize as a submodule/embedded-
269
+ * repo checkout dir) and file→dir typechanges alike. Only these
270
+ * paths can host a consultable `<name>/.git`.
271
+ */
272
+ readonly claimedDirs: ReadonlySet<string>;
273
+ /**
274
+ * Directory → capture-instant member-name set (`null` = unreadable at
275
+ * capture), for every enumerable directory under the worktree. The
276
+ * untracked/ignored enumeration a `status`-class consult runs cannot
277
+ * hide or invent a dirent between capture and arm without drifting a
278
+ * member set (CX-r38-W1 untracked-hide). The inventory is COMPLETE —
279
+ * every dir git reports ignored stays captured (`ignoredDirs` marks
280
+ * them) because which consults may drop them is a per-argv judgment
281
+ * (CX-r41-F1): `check-ignore`/`add` never descend ignored dirs, but
282
+ * `status` under the forced `--ignored` opens them and probes their
283
+ * `.gitignore` even in collapsed `!!` mode, and `ls-files -o` post-
284
+ * strip enumerates every ignored interior. The arm — not the capture
285
+ * — subtracts the ignored set, and only for consults proven never to
286
+ * consult it. Non-root directories holding a `.git` node are the one
287
+ * structural exception (a repository boundary — `status`/`add`/
288
+ * `ls-files` show one entry and never descend regardless of flags).
289
+ */
290
+ readonly dirs: ReadonlyMap<string, ReadonlySet<string> | null>;
291
+ /**
292
+ * Absolute dirs `check-ignore` verdict-ignored at capture (CX-r39
293
+ * reliability prune set, CX-r41-F1). `worktreeArmPlan` subtracts this
294
+ * set from the ARMED dir/.gitignore coverage when — and only when —
295
+ * `consultDescendsIgnoredDirs(args)` proves the consult never reads
296
+ * the interiors. EMPTY when the check-ignore consult fails — an
297
+ * unproven ignore boundary keeps full coverage, never widens it.
298
+ */
299
+ readonly ignoredDirs: ReadonlySet<string>;
300
+ /**
301
+ * `false` = the dir walk hit `EVIDENCE_WT_DIR_BOUND` — the captured
302
+ * inventory is incomplete, so an untracked-covering consult cannot
303
+ * prove its enumeration surface and must refuse.
304
+ */
305
+ readonly dirsComplete: boolean;
306
+ }
307
+ /**
308
+ * Capture the worktree baseline a consult is judged against
309
+ * (CX-r38-W1). Runs inside `evidenceRepoPreflight` so the baseline is
310
+ * the CAPTURE-instant surface — the same guarantee the `.git`
311
+ * fingerprint gives metadata. Tracked files pin by lstat+ctime (the
312
+ * kernel-unrestorable tuple; symlink targets are never followed), and
313
+ * every worktree directory records its member set so a dirent created,
314
+ * hidden, or renamed between capture and arm compares as drift.
315
+ */
316
+ export declare function captureWorktreeSurface(workTree: string, names: readonly string[]): WorktreeSurface;
317
+ /**
318
+ * Record the dirs git itself reports ignored on a captured surface
319
+ * (CX-r39 reliability, CX-r41-F1): `check-ignore`'s per-dir verdict is
320
+ * the precise "git never descends here" boundary — a collapsed
321
+ * `status --ignored` `!!` entry or `ls-files --directory` line also
322
+ * covers dirs that are merely fully-ignored-CONTAINING but still
323
+ * consulted for `.gitignore`, so only the check-ignore answer may mark
324
+ * the set. The set stays RECORDED, never subtracted at capture:
325
+ * whether a consult may drop the interiors is a per-argv judgment
326
+ * (`consultDescendsIgnoredDirs`) the arm makes, since `status`'s
327
+ * forced `--ignored` and `ls-files -o`'s stripped exclusions DO read
328
+ * them. Claimed-name pins and `<gitlink>/.git` slots inside ignored
329
+ * dirs are never pruned regardless — tracked entries consult
330
+ * regardless of ignore state.
331
+ */
332
+ export declare function markIgnoredDirs(surface: WorktreeSurface, ignoredAbs: ReadonlySet<string>): void;
333
+ /**
334
+ * Parse `check-ignore -z` output into the absolute dir set it matched —
335
+ * a record echoes the input pathname verbatim (NUL-separated under
336
+ * `-z`). Failure to consult (exit other than 0/1) yields the EMPTY set:
337
+ * an unproven ignore boundary must keep full coverage, never widen it.
338
+ */
339
+ export declare function ignoredDirSetFromCheckIgnore(workTree: string, stdout: string): Set<string>;
340
+ /**
341
+ * The `.git` surface state a captured preflight judgment depends on.
342
+ * Every member is observable with sync fs calls — no git spawn — so a
343
+ * cached preflight can be re-proven in microseconds (CX-134).
344
+ */
345
+ export interface EvidenceFingerprint {
346
+ /**
347
+ * `<repoRoot>/.git` identity: `{dir}` carries the inode+ctime of the
348
+ * directory (a same-uid rename swap keeps the path but changes the
349
+ * inode), `{file}` pins a gitfile's bytes (linked worktrees), and
350
+ * `null` records its absence (non-repo — the op fails on its own).
351
+ */
352
+ dotGit: {
353
+ kind: "dir";
354
+ ino: number;
355
+ ctimeMs: number;
356
+ } | {
357
+ kind: "file";
358
+ bytes: Buffer;
359
+ } | {
360
+ kind: "absent";
361
+ };
362
+ /**
363
+ * The resolution anchors `rev-parse` answered at capture time —
364
+ * `gitDir` is the directory HEAD/objects live under (a linked
365
+ * worktree's admin metadir, `<root>/.git` for a primary checkout,
366
+ * resolved through ANY parent for a subdirectory cwd, CX-143);
367
+ * `workTree` is `--show-toplevel` (null for bare/unresolved). Every
368
+ * judged spawn and every internal preflight subprocess pins these
369
+ * through `GIT_DIR`/`GIT_COMMON_DIR`/`GIT_WORK_TREE` env, so `.git`
370
+ * indirection files (gitfile, `commondir`) reach NOTHING in a child
371
+ * — a post-capture plant or rewrite can only register as fingerprint
372
+ * drift, never redirect a read.
373
+ */
374
+ gitDir: string | null;
375
+ /** `gitDir`'s inode+ctime — a same-path dir swap always reads as drift. */
376
+ gitDirStat: {
377
+ ino: number;
378
+ ctimeMs: number;
379
+ } | null;
380
+ /**
381
+ * The shared git dir — derived STRUCTURALLY from `gitDir`'s path
382
+ * shape (`<common>/worktrees/<id>` → `<common>`, else `gitDir`
383
+ * itself), NEVER from `commondir` file content: honoring the file
384
+ * would resolve a same-uid session's forged common dir. Children
385
+ * pin `GIT_COMMON_DIR` only when it differs from `GIT_DIR` (CX-162)
386
+ * — in a primary `.git` a `commondir` file is instead refused on
387
+ * presence, so the file is drift-or-refusal either way, never a
388
+ * redirect (CX-143).
389
+ */
390
+ commonDir: string | null;
391
+ /** `--show-toplevel` at capture — null for bare or unresolved repos. */
392
+ workTree: string | null;
393
+ /**
394
+ * Capture-instant stat of every path-valued resolution root the
395
+ * armed window holds an fd to (CX-r38-W2): worktree root, gitDir,
396
+ * commonDir, objectsDir, and the index's containing dir. The held
397
+ * fd's `fstat` must match the captured tuple — a root renamed and
398
+ * substituted between capture and arm opens the FORGED inode, which
399
+ * the compare reads as drift. A `null` entry means the root existed
400
+ * in the anchors but could not be statted — the held fd then has no
401
+ * proven baseline and the arm fails closed.
402
+ */
403
+ rootStats?: ReadonlyMap<string, {
404
+ ino: number;
405
+ ctimeMs: number;
406
+ } | null>;
407
+ /** Indirection files a redirect rewrite touches first — gitfile target, commondir. */
408
+ indirection: readonly {
409
+ path: string;
410
+ bytes: Buffer | null;
411
+ }[];
412
+ /** The `.git/config` file the judged dump derived from — resolved path + bytes. */
413
+ configPath: string | null;
414
+ configBytes: Buffer | null;
415
+ /**
416
+ * Every `--git-path`-resolved shape path + its CONTENT bytes at
417
+ * judgment time — presence alone is not provable: a zero-byte
418
+ * `info/grafts`/`shallow`/`info/attributes` rides "present" unchanged
419
+ * while a session arms it post-capture, so the fingerprint pins the
420
+ * bytes and the reprove compares content (R13-A). `bytes` is null
421
+ * when the file is absent or unreadable at capture.
422
+ */
423
+ shapeFiles: readonly {
424
+ path: string;
425
+ present: boolean;
426
+ bytes: Buffer | null;
427
+ }[];
428
+ /** Resolved object store + every file inside it, keyed by relative path. */
429
+ objectsDir: string | null;
430
+ objectFiles: ReadonlyMap<string, EvidenceSurfaceFile>;
431
+ /**
432
+ * `<common>/worktrees/` — the linked-worktree registry git serves
433
+ * verbatim in `worktree list`. The whole subtree is pinned so a
434
+ * post-capture planted admin dir (phantom worktree, R13-B) always
435
+ * reads as drift; well-formedness of each entry is the judge's job.
436
+ */
437
+ worktreesDir: string | null;
438
+ /**
439
+ * This worktree's OWN metadir — `gitDir` when it sits directly under
440
+ * `worktreesDir`, else null. Sibling `<common>/worktrees/<other-id>`
441
+ * metadirs are a CONCURRENT session's write surface (rebases, index
442
+ * refreshes, reflog appends) that no consult of ours resolves
443
+ * through, so pinning/watching them turned sibling activity into
444
+ * systematic mid-window refuses; only the own metadir (and loose
445
+ * container files) stays judged (FLOW-INT flake under parallel
446
+ * session worktrees).
447
+ */
448
+ worktreeMetadir: string | null;
449
+ worktreeFiles: ReadonlyMap<string, EvidenceSurfaceFile>;
450
+ /**
451
+ * The `--git-path modules`-resolved submodule-gitdir tree — the judge
452
+ * refuses a POPULATED modules/ once, but presence+bytes alone cannot
453
+ * fingerprint a directory (CX-179): an empty-at-capture `modules/`
454
+ * populated inside the judgment→spawn window would consult unjudged
455
+ * submodule config/index surface in the very `status`/`diff` spawn
456
+ * that follows. The whole subtree is pinned like `objects/` and
457
+ * `worktrees/` so any population reads as drift → re-preflight →
458
+ * the populated-dir refusal.
459
+ */
460
+ modulesDir: string | null;
461
+ modulesFiles: ReadonlyMap<string, EvidenceSurfaceFile>;
462
+ /**
463
+ * `<common>/refs/` — the loose-ref tree every ref-resolving op
464
+ * (`rev-parse`, `log`, `reset`, `diff`, `status`) answers through.
465
+ * Loose refs are files like loose objects: a flip between capture and
466
+ * spawn (or inside the spawn window) steers the resolution — including
467
+ * anchored `reset`, which resolves `HEAD → refs/heads/<branch>` to
468
+ * decide which tree's blobs the index claims (CX-r24-A).
469
+ */
470
+ refsDir: string | null;
471
+ refsFiles: ReadonlyMap<string, EvidenceSurfaceFile>;
472
+ /**
473
+ * `<gitdir>/refs` — the PER-WORKTREE namespace (`refs/worktree/`,
474
+ * `refs/bisect/`, `refs/rewritten/` live in the worktree's own
475
+ * gitdir, which `--git-path refs` does NOT resolve on a linked
476
+ * worktree). Null when it equals `refsDir` (plain/main repos) or
477
+ * `gitDir` is unresolved (CX-r25).
478
+ */
479
+ wtRefsDir: string | null;
480
+ wtRefsFiles: ReadonlyMap<string, EvidenceSurfaceFile>;
481
+ /**
482
+ * Every dirent directly under `gitDir` AND `commonDir` — git's
483
+ * pseudo-ref channel: `rev-parse FOO`/`log ORIG_HEAD`/`reset <name>`
484
+ * resolve `$GIT_DIR/<name>` before refs, so `ORIG_HEAD`,
485
+ * `MERGE_HEAD`, `AUTO_MERGE`, `BISECT_HEAD`, and ANY planted file
486
+ * (`.git/FOO`) answer as revs from unpinned bytes (CX-r25-A).
487
+ * Non-regular dirents carry `kind` — a FIFO is a consultable
488
+ * forged-byte channel a feeder drives (CX-r26-A). Keyed by ABSOLUTE
489
+ * path — directories are excluded from the map and recorded in
490
+ * `rootDirs` instead. Files shared by both roots (plain repos)
491
+ * dedupe by key.
492
+ */
493
+ rootFiles: ReadonlyMap<string, EvidenceSurfaceFile>;
494
+ /**
495
+ * Every dir-shaped entry directly under `gitDir` AND `commonDir` —
496
+ * real dirs and symlinks resolving to dirs. A `.git/x/` planted
497
+ * post-capture is drift even before contents are compared: the
498
+ * dwim resolves `$GIT_DIR/x/FOO` at arbitrary depth (CX-r26-B).
499
+ * Absolute-keyed; member-covered dirs still join the set (their
500
+ * contents are the member's job).
501
+ */
502
+ rootDirs: ReadonlySet<string>;
503
+ /**
504
+ * Files, symlinks, and non-regular dirents under every top-level dir
505
+ * NOT owned by a tree member (`objects/`/`refs/`/`wtRefs`/
506
+ * `worktrees/`/`modules/`) — `logs/`, `info/`, `hooks/`,
507
+ * `sequencer/`, `rr-cache/`, `forge/`, and any novel dir. Git's
508
+ * `$GIT_DIR/<name>` dwim resolves pseudo-refs at ARBITRARY depth
509
+ * (`rev-parse logs/FOO`), so these trees answer revs from unpinned
510
+ * bytes without coverage — including a post-preflight plant that no
511
+ * named member could describe (CX-r26-B). Absolute-keyed.
512
+ */
513
+ nestedFiles: ReadonlyMap<string, EvidenceSurfaceFile>;
514
+ /**
515
+ * `<common>/packed-refs` — the packed half of the same namespace;
516
+ * byte-pinned like the index so a pre-arm rewrite is drift too.
517
+ */
518
+ packedRefsPath: string | null;
519
+ packedRefsBytes: Buffer | null;
520
+ /** The ambient `.git/index` the claims rebuild enumerated — resolved path + bytes. */
521
+ indexPath: string | null;
522
+ indexBytes: Buffer | null;
523
+ /**
524
+ * `.git/sharedindex.*` byte captures beside `indexBytes` — a split
525
+ * index's `link` extension makes the claims enumeration consult
526
+ * these too, so the held enumeration dir mints them alongside the
527
+ * index copy (CX-r36-E). Keyed by absolute path.
528
+ */
529
+ sharedIndexBytes: ReadonlyMap<string, Buffer | null>;
530
+ /**
531
+ * Bytes of every overlay-consultable `.git` file at capture (CX-r35-A)
532
+ * — root/nested/refs/wtRefs/worktrees members ≤64KiB, ≤4MiB total.
533
+ * Stat tuples cannot observe a silent mmap flip between capture and
534
+ * the overlay mint; the mint compares each copied source against
535
+ * these bytes so a flip that slipped the stat layer can never serve.
536
+ */
537
+ consultBytes: ReadonlyMap<string, Buffer>;
538
+ /**
539
+ * How the resolved `gitDir` was reached (CX-171): `"worktree"` — a
540
+ * `.git` node (dir or gitfile) at some ancestor resolved it;
541
+ * `"selfdir"` — git self-discovered the gitdir with no worktree node,
542
+ * so bareness is a topological fact, not the `core.bare` config claim;
543
+ * `"unknown"` — `gitDir` is null or the walk could not re-derive the
544
+ * resolution (the judge refuses that pairing).
545
+ */
546
+ topology: RepoTopology;
547
+ }
548
+ /**
549
+ * How the resolved gitdir was discovered — see `classifyTopology`.
550
+ */
551
+ export type RepoTopology = "worktree" | "selfdir" | "unknown";
552
+ /**
553
+ * One pinned file inside a fingerprinted subtree — the stat triple is
554
+ * unforgeable (ctime is kernel-managed, CX-114); `link` records a
555
+ * symlink's target string so a retarget — which never changes the
556
+ * link's own stat — still reads as drift (R13 secondary: symlink
557
+ * dirents under the object store were invisible to the sweep).
558
+ */
559
+ export interface EvidenceSurfaceFile {
560
+ ino: number;
561
+ ctimeMs: number;
562
+ size: number;
563
+ link?: string;
564
+ /**
565
+ * The symlink resolves to a DIRECTORY — the walk records the link as
566
+ * one leaf and never descends, so members beneath it are fingerprint-
567
+ * invisible while git (and the loose/pack scans) DO descend through
568
+ * it (CX-145). Git never creates symlinked dirs inside `objects/` or
569
+ * `worktrees/`, so the judge refuses the channel on this marker —
570
+ * refusal is the only answer an unpinnable member set can get.
571
+ */
572
+ linkDir?: true;
573
+ /**
574
+ * A non-regular node's type — recorded so presence/type swaps read as
575
+ * drift at the reprove compare. `fifo`/`device`/`other` mark the
576
+ * surface unverifiable: git's `$GIT_DIR/<name>` dwim `open()`s them
577
+ * successfully, so a session feeder serves forged rev bytes no stat
578
+ * can pin (CX-r26-A). `socket` is record-only — `open()` fails
579
+ * outright, so it can never carry chosen bytes (`fsmonitor--daemon`
580
+ * stays verifiable). On a symlink leaf the kind describes the
581
+ * RESOLVED target.
582
+ */
583
+ kind?: "fifo" | "socket" | "device" | "other";
584
+ }
585
+ /**
586
+ * A `.git` index file the verifier owns end to end: `bytes` is the
587
+ * self-serialized DIRC claims index — `fd` (held open, passed to
588
+ * children so `GIT_INDEX_FILE=/dev/fd/3` resolves inside their own fd
589
+ * table) is the airtight form, `path` the no-`/dev/fd` fallback whose
590
+ * on-disk bytes are re-verified against `bytes` before every spawn
591
+ * (CX-129: a same-uid session can enumerate and rewrite anything under
592
+ * `os.tmpdir()`, so the rebuild must not sit there addressably).
593
+ */
594
+ export interface EvidenceIndex {
595
+ fd?: number;
596
+ path?: string;
597
+ bytes: Buffer;
598
+ /**
599
+ * Kernel-managed change time pinned at fd-form mint. The fd is
600
+ * `fchmod`ed `0400` at mint, so the only residual same-UID write
601
+ * channel — `mmap(MAP_SHARED)` stores ride no observable signal and
602
+ * do not reliably bump `i_ctime` on tmpfs — is an owner `chmodat`
603
+ * on `/proc/<pid>/fd/N`, which cannot avoid bumping this stamp.
604
+ * Optional: path-form held files carry no fd pin and pre-r34 mints
605
+ * lack it — an fd-form index WITHOUT it simply skips the ctime half
606
+ * of the re-verify (CX-r34-E).
607
+ */
608
+ ctimeNs?: bigint;
609
+ /**
610
+ * Claim pathnames parsed from `ls-files --stage` at mint — the same
611
+ * staged set `bytes` serializes, kept so a consult can answer
612
+ * membership questions in-process instead of spawning an unarmed
613
+ * claims-index child (CX-r33-D).
614
+ */
615
+ names?: string[];
616
+ }
617
+ /**
618
+ * The env/`indexFd` a trusted spawn needs for the verifier index, plus
619
+ * the honesty flag: `unproven` when no proven index view exists —
620
+ * either the rebuild failed (CX-124) or a path-mode index failed its
621
+ * integrity re-read just now (CX-129's post-build rewrite). In fd mode
622
+ * the bytes are pinned by the open file description; a session rewrite
623
+ * of the (already-unlinked) name is impossible.
624
+ */
625
+ export declare function evidenceSpawnState(preflight: EvidencePreflight | null | undefined, withIndex?: boolean, overlayRefs?: boolean): {
626
+ env: Record<string, string>;
627
+ indexFd?: number;
628
+ /**
629
+ * Absolute roots the child must resolve INODE-bound (CX-r38-W2): every
630
+ * path-valued env pin below a bound root is rewritten to
631
+ * `/proc/self/fd/<slot>`-relative inside `spawnCaptured`, so a worktree-
632
+ * root rename exchange cannot redirect `GIT_WORK_TREE`/`GIT_DIR`/
633
+ * `GIT_OBJECT_DIRECTORY`/`GIT_INDEX_FILE` resolution onto a foreign
634
+ * tree — the env value follows the pinned inode, not the (swap-prone)
635
+ * name. Longest-first ordering; env values under no root get their own
636
+ * fd directly.
637
+ */
638
+ bindRoots: string[];
639
+ unproven: boolean;
640
+ refUnproven: boolean;
641
+ };
642
+ /**
643
+ * Close the per-spawn fd `evidenceSpawnState` minted — required on
644
+ * every path that returns BEFORE `spawnCaptured` (which closes it
645
+ * itself once the child inherited its dup).
646
+ */
647
+ export declare function closeSpawnFds(fds: {
648
+ indexFd?: number;
649
+ }): void;
650
+ /** Release a preflight's held resources — per-call channels close them; cached preflights keep them. */
651
+ export declare function closeEvidenceIndex(preflight: EvidencePreflight | null | undefined): void;
652
+ export declare function isIndexConsultingRead(args: readonly string[]): boolean;
653
+ /**
654
+ * Legacy two-argument form kept for callers that carry the preflight:
655
+ * true when the read consults the index AND the preflight could not
656
+ * prove the verifier-owned index view (CX-124's fail-closed rule).
657
+ */
658
+ export declare function isUnprovenIndexRead(args: readonly string[], preflight?: EvidencePreflight | null): boolean;
659
+ /** The stderr prefix a refused evidence call carries — callers treat it as unverifiable, never as an empty answer. */
660
+ export declare const EVIDENCE_REFUSED_PREFIX = "EVIDENCE-REFUSED";
661
+ /**
662
+ * `--git-path` query order for the topology check — refuse paths first,
663
+ * then warn-only. Each path is queried by its own `--git-path` call: a
664
+ * resolved path may itself CONTAIN a newline (linked-worktree common dir
665
+ * under a hostile dirname, CX-89), so one multi-query line-split cannot
666
+ * keep the positional mapping honest.
667
+ */
668
+ export declare const EVIDENCE_SHAPE_QUERY_PATHS: readonly ["info/grafts", "objects/info/alternates", "shallow", "info/attributes", "info/exclude", "modules", "objects/info/commit-graph", "objects/info/commit-graphs", "objects/pack/multi-pack-index"];
669
+ /**
670
+ * Raw trusted-git spawn without the config preflight — the preflight's own
671
+ * probe channel, and the binary-reachability probe callers use to tell a
672
+ * dead resolved path (fail loud) from an unenumerable repo (fail closed).
673
+ * `extraEnv` is CHANNEL-owned env merged over the scrub — the trusted-index
674
+ * rebuild uses it to aim `update-index --index-info` at a verifier-created
675
+ * file and to ride the static pins; it is the body's own contract, never a
676
+ * caller lever (GIT_* stays session-stripped).
677
+ */
678
+ export declare function execEvidenceGit(cwd: string, args: string[], opts?: {
679
+ extraEnv?: Record<string, string>;
680
+ internalEnv?: Record<string, string>;
681
+ input?: string | Buffer;
682
+ }): Promise<VerifierGitResult>;
683
+ /**
684
+ * Runtime argv judgment for the evidence channel — the predicate the
685
+ * static scan assumes exists behind `gitEvidence` the way
686
+ * isReadOnlyGitQuery sits behind `git()` on io.exec (CX-70: a dynamic
687
+ * argv tail like `["log", ...flags]` was static-exempt and ran unjudged,
688
+ * so `--ext-diff`/`--output` could reach the trusted subprocess). The
689
+ * body-owned `-C`/`-c` pins are added after this check and are not part
690
+ * of the judged argv.
691
+ */
692
+ export declare function isEvidenceGitQuery(args: readonly string[]): boolean;
693
+ /**
694
+ * The argv space `verifierGit` may spawn — the evidence read table minus
695
+ * `fetch` (nothing on the runner/policy path refreshes remotes). This is
696
+ * the CX-108/109 boundary: the channel used to scan only for
697
+ * `@{…}`/reflog-shaped args, so `reflog`/`stash`/`update-ref`/
698
+ * `config`-writes and every leading global option rode through — and a
699
+ * caller `-c`/`--git-dir` lands AFTER the pins where the last write wins.
700
+ * Nothing outside the table prefixes can be proven safe, so the table is
701
+ * the allowlist, not a denylist.
702
+ */
703
+ export declare function isVerifierGitQuery(args: readonly string[]): boolean;
704
+ export declare function reportsRepoGeometry(args: readonly string[]): boolean;
705
+ /**
706
+ * Answers a pure-geometry `rev-parse` from the fingerprint — `null`
707
+ * when the argv is not all-local flags (mixed flag+rev forms still
708
+ * spawn through the overlay + path substitution below). The spawn
709
+ * channel pins `GIT_DIR`/`GIT_WORK_TREE` absolutely, so `--git-dir` &
710
+ * friends print absolute answers under the channel's own contract.
711
+ */
712
+ export declare function geometryLocalAnswer(args: readonly string[], preflight: EvidencePreflight | null, cwd: string): VerifierGitResult | null;
713
+ /**
714
+ * Geometry spawn output under the overlay `GIT_DIR` can embed mint
715
+ * paths — `--git-dir`/`--git-common-dir`/`--git-path`/`--local-env-vars`
716
+ * print env values verbatim (verified). The child resolved every REF
717
+ * through minted bytes; only path-shaped ANSWER tokens need the real
718
+ * anchors substituted back (CX-r36-B).
719
+ */
720
+ export declare function substituteOverlayPaths(stdout: string, overlay: {
721
+ gitDir: string;
722
+ commonDir?: string;
723
+ }, fp: EvidenceFingerprint, args?: readonly string[], fdEnv?: Record<string, string>): string;
724
+ export declare function catFileObjectRequest(args: readonly string[]): {
725
+ type: string;
726
+ oid: string;
727
+ } | null;
728
+ /**
729
+ * Runtime argv judgment for the scratch-repo channel — `verifierScratchGit`
730
+ * spawns the same trusted binary/env as `verifierGit`, but the argv is
731
+ * the bounded mutation set above or the read table; a scenario-authored
732
+ * string can never name `reflog`/`stash`/`update-ref`/`config --file` or
733
+ * a global-option redirect (CX-108/109).
734
+ */
735
+ export declare function isScratchGitQuery(args: readonly string[]): boolean;
736
+ export declare function scanPackObjects(objectsDir: string, internalEnv?: Record<string, string>): Promise<string[]>;
737
+ /**
738
+ * A verifier-owned shadow of the consultable `.git` namespace (CX-r35-A):
739
+ * copied bytes of `HEAD`/`config`/`refs/**`/`packed-refs`/pseudo-refs/
740
+ * `info/**` minted at 0400 inside the private dir, plus the `GIT_DIR`/
741
+ * `GIT_COMMON_DIR`/`GIT_OBJECT_DIRECTORY` env that points children at
742
+ * it. The armed window's stat triples cannot observe `mmap` flip→restore
743
+ * on git-legit-writable refs, so consults must never resolve live paths
744
+ * mid-window — a child resolving through the overlay reads the
745
+ * arm-instant bytes regardless of what the live ref says between flips.
746
+ * Objects stay on the real dir (`GIT_OBJECT_DIRECTORY`): 0444-owned
747
+ * objects need only their capture-time writable check, and `index`
748
+ * rides `GIT_INDEX_FILE` (claims fd, live snapshot, or the real path
749
+ * for the anchored op itself).
750
+ */
751
+ interface EvidenceGitdirOverlay {
752
+ /** Minted overlay root inside `evidencePrivateTmpdir()`. */
753
+ dir: string;
754
+ /** Overlay `GIT_DIR`. */
755
+ gitDir: string;
756
+ /** Overlay `GIT_COMMON_DIR` — set only when the repo has a separate common dir (linked worktree metadir). */
757
+ commonDir: string | undefined;
758
+ /** Absolute paths of minted files — join the window's stat pins. */
759
+ files: string[];
760
+ /** Absolute paths of minted dirs — join the window's dir watchers (a plant inside fires create/move events). */
761
+ dirs: string[];
762
+ /**
763
+ * Live source path ↔ the bytes that source held at mint, for every
764
+ * file the overlay copied. The armed window's settle re-reads each
765
+ * live source and compares it to these bytes — stat pins cannot see
766
+ * a flip that landed BEFORE the mint and restored after (the overlay
767
+ * would hold C' while live reads C again), but the byte compare
768
+ * catches every ordering: pre-mint flip→restore ends live≠minted
769
+ * (refuse); a persistent flip ends live==minted — the child saw the
770
+ * repo's real bytes (honest); a mid-window flip→restore ends
771
+ * live==minted and the consult read captured bytes (honest).
772
+ */
773
+ sources: {
774
+ live: string;
775
+ bytes: Buffer;
776
+ }[];
777
+ /**
778
+ * Every minted file ↔ its bytes + post-mint ctime pin. An unarmed
779
+ * consult (lazy mint) binds this overlay with no window watch — the
780
+ * minted files are `0400` but a same-UID poller can find the random
781
+ * root and `chmodat`+flip a file in the mint→spawn gap, so the
782
+ * consult channel re-proves each entry after the child exits: a
783
+ * write needs a `chmodat`, which cannot avoid moving ctimeNs
784
+ * (CX-r35-A's unarmed sibling of the held-fd post-check, CX-r34-E).
785
+ */
786
+ held: {
787
+ dst: string;
788
+ bytes: Buffer;
789
+ ctimeNs: bigint;
790
+ }[];
791
+ }
792
+ /**
793
+ * Build the throwaway index index-consulting reads (status/diff/ls-files)
794
+ * must see — a verifier-owned rebuild of the session index's CLAIMS.
795
+ * `.git/index` is session-writable in three ways a HEAD-anchored
796
+ * `read-tree` index both fixes and breaks: it drops forged stat tuples
797
+ * (CX-121) but also drops the session's real staged entries, and it
798
+ * cannot exist at all on an unborn HEAD — `status --porcelain -uno` then
799
+ * hides staged dirt and `ls-files` answers empty on a populated index.
800
+ * So the verifier index is rebuilt from `ls-files --stage` output: the
801
+ * listing carries only `mode sha stage path` claims — no stat cache, no
802
+ * assume-unchanged/skip-worktree flags — and `--index-info` writes the
803
+ * entries back with ZEROED stat. Every index-vs-worktree column then
804
+ * content-hashes instead of trusting a tuple the session wrote, while
805
+ * staged-vs-HEAD columns still show what the session index claims —
806
+ * a forged claim can only fabricate dirt, never hide it. Each call gets
807
+ * a fresh file: concurrent preflights in one process must not interleave
808
+ * writes into a shared index.
809
+ *
810
+ * A failed enumeration or rebuild is FAIL-CLOSED (CX-124): `failure`
811
+ * carries a shape-violation string the caller pushes into the preflight,
812
+ * so every index-consulting read refuses outright. Falling back to the
813
+ * ambient index would route the verdict at the session-writable
814
+ * `.git/index` — exactly the CX-121 forgery surface — so an unprovable
815
+ * index must refuse, never degrade.
816
+ */
817
+ export interface EvidenceIndexPreparation {
818
+ /** The verifier-owned claims index; absent on failure. */
819
+ index?: EvidenceIndex;
820
+ /** Failure string when the rebuild could not be proven. */
821
+ failure?: string;
822
+ }
823
+ /**
824
+ * Re-prove a path-mode held file's on-disk bytes before a spawn trusts
825
+ * the pin — the no-`/dev/fd` fallback leaves an addressable file a
826
+ * same-uid session can rewrite, so `GIT_INDEX_FILE=<path>` must
827
+ * byte-compare right before use or the pinned scope silently reads
828
+ * forged bytes (R13-D parity with the fd form's re-prove). Returns
829
+ * true for fd-form held files — the open file description pins them
830
+ * already.
831
+ */
832
+ export declare function heldPathProven(held: EvidenceIndex): boolean;
833
+ /**
834
+ * Produce the `EvidenceIndex` a preflight stores — fd form where
835
+ * `/dev/fd` exists, named-path fallback elsewhere (the per-spawn byte
836
+ * re-prove still applies). `null` when even the fallback write failed.
837
+ */
838
+ export declare function heldEvidenceFile(bytes: Buffer, stem: string): EvidenceIndex | null;
839
+ export declare function prepareEvidenceIndex(repoRoot: string, internalEnv: Record<string, string> | undefined, liveIndex: {
840
+ path: string | null;
841
+ bytes: Buffer | null;
842
+ shared: ReadonlyMap<string, Buffer | null>;
843
+ }): Promise<EvidenceIndexPreparation>;
844
+ export declare function judgeEvidenceRepoSurface(repoRoot: string, listedStdout: string, shapePaths: readonly (string | null)[], objectsDir?: string | null, headBranch?: string | null, fingerprint?: EvidenceFingerprint): EvidencePreflight;
845
+ /**
846
+ * The `GIT_DIR`/`GIT_COMMON_DIR`/`GIT_WORK_TREE` env pins a fingerprint's
847
+ * resolution anchors emit — applied to every internal preflight
848
+ * subprocess (`--git-path`, config dump, claims `ls-files`, verify-pack)
849
+ * and to every judged spawn, so `.git` indirection files (gitfile,
850
+ * `commondir`, and a planted `<subdir>/.git`) reach nothing inside a
851
+ * child: env selectors preempt discovery and indirection files outright
852
+ * (CX-143). Null members simply emit nothing (bare repos have no
853
+ * worktree pin).
854
+ */
855
+ export declare function resolutionEnv(fp: Partial<Pick<EvidenceFingerprint, "gitDir" | "commonDir" | "workTree">> | null | undefined): Record<string, string>;
856
+ /**
857
+ * The `rev-parse --git-path` resolves + `.git` indirection + fingerprint —
858
+ * one fused surface-capture (CX-134/CX-135) so callers cannot misorder
859
+ * the three steps. Ordering contract: indirection bytes are read BEFORE
860
+ * the resolves they govern (a redirect rewrite is always
861
+ * later-than-fingerprint, so reprove reads it as drift, never a
862
+ * consistent stale world), and the fingerprint freezes same-or-older
863
+ * state BEFORE any judged read the caller runs next (config dump, shape
864
+ * bodies, object scans, index claims). `config`/`index`/`objects` join
865
+ * the shape query list so the fingerprint pins the very files the judged
866
+ * dump/claims derive from. A failed resolve yields `null` for that path
867
+ * (the judge counts it a violation); `anyFailed` distinguishes "git
868
+ * itself is dead" from "this path is absent" for the caller's own error
869
+ * contract. Each query is its own spawn — a resolved path may itself
870
+ * contain a newline (CX-89). The returned `*Path` fields are the raw
871
+ * resolves for the judge; the fingerprint pins their absolute forms.
872
+ */
873
+ /**
874
+ * BEFORE the first spawn: find the `.git` git's own discovery would see
875
+ * and prove the metadata git opens at startup is regular — a FIFO
876
+ * `.git/config` (or `HEAD`, a gitfile, `commondir`) blocks open()
877
+ * forever, deadlocking every child instead of refusing (CX-144). The
878
+ * scan mirrors git's walk-up so a subdirectory cwd sees the parent's
879
+ * `.git`; any non-regular member is reported and the caller refuses
880
+ * WITHOUT spawning — no child ever enters a blocking read.
881
+ */
882
+ /**
883
+ * Whether a repo-shaped surface exists at or above `dir` — any `.git`
884
+ * node (dir, gitfile, link, FIFO) at lstat level, or a bare-repo
885
+ * signature (`HEAD` + `objects/` + `refs/`). Consulted ONLY when the
886
+ * trusted channel could not answer: `-1` means both "no repo" and
887
+ * "unenumerable repo", indistinguishable by exit code — a same-UID
888
+ * session can fabricate the not-a-repo shape (`.git/HEAD` FIFO →
889
+ * preflight null, CX-156), so existence of git state to forge is the
890
+ * honest discriminator. Absent → genuinely nothing to protect.
891
+ */
892
+ export declare function repoShaped(repoRoot: string): boolean;
893
+ export declare function captureEvidenceSurface(repoRoot: string, runGit: EvidenceGitRunner, prior?: Pick<EvidenceFingerprint, "gitDir" | "commonDir" | "workTree"> | null): Promise<{
894
+ configPath: string | null;
895
+ indexPath: string | null;
896
+ objectsDir: string | null;
897
+ shapePaths: (string | null)[];
898
+ /** `symbolic-ref --short HEAD` — the current branch name for the
899
+ * upstream-lever pin, or null (detached/absent/failed). */
900
+ headBranch: string | null;
901
+ anyFailed: boolean;
902
+ /** Non-regular `.git` metadata that would block git's own startup
903
+ * reads (CX-144) — the caller refuses without spawning. */
904
+ hazards: string[];
905
+ /**
906
+ * Live-consulted files carrying a prepared silent write channel —
907
+ * a writable description or mapping the mode barrier cannot revoke
908
+ * (CX-r36). The caller refuses through shapeViolations.
909
+ */
910
+ writeChannels: string[];
911
+ fingerprint: EvidenceFingerprint;
912
+ }>;
913
+ /**
914
+ * Re-prove a captured preflight against the live `.git` surface — sync
915
+ * fs checks only, so a cached preflight (OriginGit) can afford it before
916
+ * EVERY spawn (CX-134/CX-135). Any drift — config rewrite, shape file
917
+ * added/removed, object store change, index rewrite, `.git` or
918
+ * indirection tampering — means the stored judgment no longer describes
919
+ * the repo the spawn would read, and the caller must re-run the full
920
+ * preflight. Returns false when the fingerprint is absent or the
921
+ * preflight itself is null (an unproven surface can never be cached).
922
+ */
923
+ /**
924
+ * Armed kernel watch over the judged `.git` surface for the LENGTH of
925
+ * one trusted child's lifetime (CX-r22-A/B/D/F): the fingerprint
926
+ * reprove ends at *spawn*, but the child opens `.git` metadata inside
927
+ * its own lifetime — a same-UID watcher keying on
928
+ * `/proc/<ppid>/task/<ppid>/children` plants a refuse-on-presence file
929
+ * (`shallow`, `info/exclude`, `objects/info/alternates`, a loose
930
+ * object, a rewritten `config`/`packed-refs`/`index`) and unlinks it
931
+ * when the child exits, so the surface looks clean to every
932
+ * pre-/post-check. inotify events are queued by the kernel AT the
933
+ * filesystem operation — a plant+unlink inside the window still leaves
934
+ * its event record — so draining the watch after child close turns
935
+ * every mid-window touch into a deterministic refusal, never a trusted
936
+ * fabricated answer. `fs.watch` is inotify on Linux (the claims-index
937
+ * inode is watched through `/proc/self/fd/N`, which resolves to the
938
+ * inode — a `/proc/<pid>/fd/3` write then fires `change` exactly like a
939
+ * path write, CX-r22-D).
940
+ *
941
+ * Coverage: every directory under the resolved `gitDir`/`commonDir`
942
+ * (bounded — a new dir beneath an unwatched dir cannot appear without
943
+ * first firing `create` on its watched parent), the caller's repoRoot
944
+ * and worktree-top dirs (`.git` node swaps), plus the claims-index
945
+ * inode/path. A watch that cannot arm every surface fails closed —
946
+ * the caller treats it as unverifiable rather than partially covered.
947
+ */
948
+ interface EvidenceWindowWatch {
949
+ /** Event paths recorded so far (watched-dir-absolute). */
950
+ readonly events: string[];
951
+ /**
952
+ * Dir fds opened at ARM time for every resolution root the spawn's
953
+ * env pins consult (CX-r38-W2). `spawnCaptured` hands each to its
954
+ * child at a stdio slot and rewrites the pin to `/proc/self/fd/N` —
955
+ * the value then binds the ARMED inode, so a worktree-root rename
956
+ * exchange cannot redirect resolution onto a foreign tree and the
957
+ * parent's per-root fd survives name churn until `settle` closes it.
958
+ */
959
+ readonly heldRoots: ReadonlyMap<string, number>;
960
+ /** Drain queued events, close every watcher, return the event paths. */
961
+ settle(): Promise<string[]>;
962
+ }
963
+ /**
964
+ * Arm the window watch. `ignore` (anchored-mutation callers) drops
965
+ * events on the mutation's own write surface — `add`/`reset`
966
+ * legitimately touch `index`, `objects/`, `refs/`, `HEAD`,
967
+ * `*_HEAD`/lock files; anything else still refuses.
968
+ */
969
+ /**
970
+ * Anchored-mutation event filter factory (CX-169's channel): the
971
+ * admitted ops write exactly the real index + `index.lock` (+
972
+ * `sharedindex.*` under core.splitIndex), and `add` also churns the
973
+ * object store — resolved-path ignores for those only. Refs, logs,
974
+ * HEAD, pseudo-refs and every other lock stay FOREIGN: `reset -q --`
975
+ * is a pathspec-only index op — verified empirically it writes no ref
976
+ * and no reflog — yet it RESOLVES `HEAD → refs/heads/<branch>` for its
977
+ * blobs, so an unignored ref flip steers it (CX-r24-A). Basename
978
+ * matching was the r25 hole: `refs/heads/index`/`refs/heads/ORIG_HEAD`
979
+ * are legal branch names that basename ignores made invisible to the
980
+ * watch (CX-r25-B) — the filter therefore compares resolved absolute
981
+ * paths from the fingerprint, never name shapes.
982
+ */
983
+ export declare function anchoredMutationIgnorable(fp: Pick<EvidenceFingerprint, "objectsDir" | "indexPath" | "gitDir" | "commonDir"> | undefined, op: string): (abs: string) => boolean;
984
+ /**
985
+ * The tracked-worktree surface a judged consult may read (CX-r38-W1):
986
+ * tracked file inodes to pin+barrier+audit, and the containing dirs to
987
+ * watch — name-filtered to the basenames the claims index says live
988
+ * there (every path component level, so an interior-dir rename fires
989
+ * on the parent's filtered watch too).
990
+ */
991
+ export interface WorktreeArmPlan {
992
+ files: readonly string[];
993
+ dirNameSets: ReadonlyMap<string, ReadonlySet<string>>;
994
+ /**
995
+ * Unfiltered dir watches — the untracked-set consult surface
996
+ * (`status`/`ls-files -o`/`add`): every dir the capture-instant
997
+ * inventory holds, so a transient hide/rename fires a dirent event
998
+ * on its containing dir (CX-r38-W1).
999
+ */
1000
+ dirs?: readonly string[];
1001
+ /**
1002
+ * `true` = the files get the write-barrier treatment (anchored
1003
+ * `add`: it hashes content only, so the 0400 mode bump does not
1004
+ * leak into its judged output). Read consults (`status`/`diff`)
1005
+ * pin+watch WITHOUT the chmod — `core.fileMode` would read the
1006
+ * barrier's mode flip as fabricated dirt on an honest tree.
1007
+ */
1008
+ barrier?: boolean;
1009
+ /**
1010
+ * The capture-instant baseline the arm compares against — the
1011
+ * preflight-minted worktree surface. Without it the pin's baseline
1012
+ * is arm-instant state, and a flip landing between capture and arm
1013
+ * is silently adopted as baseline (the forged window CX-r38-W1).
1014
+ */
1015
+ baseline: WorktreeSurface;
1016
+ }
1017
+ /**
1018
+ * Which worktree surface a judged argv consults (CX-r38-W1):
1019
+ * - `tracked`: file stat+bytes of the claims-index tracked set
1020
+ * (`diff`, worktree-`grep`, `describe --dirty`, `ls-files` stat forms).
1021
+ * - `tracked+untracked`: that PLUS the untracked/ignored dirent
1022
+ * enumeration (`status`, `ls-files -o`, `add`) — every dir git's
1023
+ * untracked walk can descend joins the unfiltered dir-watch set via
1024
+ * the plan's own in-process readdir walk (CX-r38-W1).
1025
+ * - `none`: no worktree-content channel (`rev-parse`, `log`,
1026
+ * `cat-file`, `for-each-ref`, …). `check-ignore` stays `none` here —
1027
+ * its coverage is not the claims-derived tracked set but the
1028
+ * ignore-rule surface, which `resolveWorktreeArm` resolves to the
1029
+ * full untracked plan plus the tracked rule sources (CX-r39-C1).
1030
+ */
1031
+ export type WorktreeConsultScope = "none" | "tracked" | "tracked+untracked";
1032
+ export declare function worktreeConsultScope(args: readonly string[]): WorktreeConsultScope;
1033
+ /**
1034
+ * Build the pin+barrier+watch plan for a worktree-content consult from
1035
+ * the held claims index — the only tracking basis the op cannot have
1036
+ * written (CX-r38-W1). `null` = the tracked set is unverifiable (no
1037
+ * claims basis, or no worktree) and the caller must fail closed.
1038
+ */
1039
+ export declare function worktreeArmPlan(preflight: EvidencePreflight, coverUntrackedDirs?: boolean, barrier?: boolean, allowIgnoredDirPrune?: boolean): WorktreeArmPlan | null;
1040
+ /**
1041
+ * Whether the consult's spawned child reads the interiors of dirs git
1042
+ * reports ignored — the per-argv precondition for pruning them from
1043
+ * armed coverage (CX-r41-F1). The test is admit-listed to the proven
1044
+ * descent shapes, never "unlisted flag means safe", and it models
1045
+ * GIT's argv parse — negation last-wins and required-arg value
1046
+ * consumption — not flag spellings (CX-r42-F1). Callers evaluate it on
1047
+ * `evidenceSpawnArgs(args)`, the argv the child actually runs:
1048
+ *
1049
+ * - `status` post-transform always carries `--ignored`, and `--ignored`
1050
+ * opens every ignored dir and probes its `.gitignore` even when the
1051
+ * output collapses to `!! dir/` (Git 2.53, strace-verified) — only an
1052
+ * ATTACHED `-u`/`--untracked-files` mode of `no` skips the untracked
1053
+ * walk; bare `-u` forms leave the following token a pathspec.
1054
+ * - `ls-files -o`/`--others` post-transform carries NO exclusion
1055
+ * machinery, so the enumeration opens every ignored interior. The
1056
+ * `--directory` collapse reports dir entries without reading them —
1057
+ * unless `--no-empty-directory` forces the emptiness check — and
1058
+ * OPT_BOOL negations toggle it last-wins (`--directory
1059
+ * --no-directory` descends, `--no-directory --directory` collapses).
1060
+ * `-k`/`--killed` never opens an ignored dir (verified), and
1061
+ * index-only forms never walk untracked dirs at all.
1062
+ * - `add`/`rm`-family consults prune ignored dirs from their walk
1063
+ * unless `-f`/`--force` compels them (`git add -nf` reads interiors).
1064
+ * - `check-ignore` never descends — its per-dir verdict IS the prune
1065
+ * source. Tracked-scope consults stat pinned tracked paths; every
1066
+ * other admitted op is index/object/ref.
1067
+ */
1068
+ export declare function consultDescendsIgnoredDirs(args: readonly string[]): boolean;
1069
+ /**
1070
+ * Resolve a consult's worktree arm inputs in one place — both judged
1071
+ * channels (`verifierGitSpawn`, `gitEvidence`) carry the same CX-r38-W1
1072
+ * contract: `tracked*` scopes fold the claims-derived plan into the arm;
1073
+ * `check-ignore` folds its tracked rule sources into `extraWatchPaths`;
1074
+ * everything else adds nothing. `null` = the required surface is
1075
+ * unverifiable and the consult must refuse.
1076
+ */
1077
+ /**
1078
+ * RFC-1644: whether a consult's worktree arm consumes the capture-instant
1079
+ * worktree surface (CX-r38-W1). `resolveWorktreeArm` branches on THIS
1080
+ * predicate, and the per-spawn preflights skip the capture exactly when it
1081
+ * is false — the skip and the arm can never disagree. "Consumes no
1082
+ * surface" describes the ARM, not git's I/O: a bare rev token without
1083
+ * `--` still makes git probe a same-named worktree file (pre-existing
1084
+ * CX-r39-A1 miss, F-0396) — unarmed before and after this predicate.
1085
+ */
1086
+ export declare function consultReadsWorktreeSurface(args: readonly string[]): boolean;
1087
+ export declare function resolveWorktreeArm(args: readonly string[], preflight: EvidencePreflight, extraWatchPaths: readonly string[] | undefined): {
1088
+ scope: WorktreeConsultScope;
1089
+ wtPlan: WorktreeArmPlan | null;
1090
+ extraWatch: readonly string[] | undefined;
1091
+ } | null;
1092
+ export declare function armEvidenceWindowWatch(repoRoot: string, preflight: EvidencePreflight, ignore?: (absPath: string) => boolean, extraFiles?: readonly string[], pinObjects?: boolean, wtArm?: WorktreeArmPlan | null): EvidenceWindowWatch | null;
1093
+ export declare function reproveEvidenceSurface(repoRoot: string, preflight: EvidencePreflight | null | undefined): boolean;
1094
+ /** The runner signature both evidence channels hand the shared resolve —
1095
+ * the optional opts union keeps `execEvidenceGit`/`gitEvidence` directly
1096
+ * assignable, so callers pass existing definitions, never fresh closures. */
1097
+ export type EvidenceGitRunner = (repoRoot: string, args: string[], opts?: {
1098
+ timeoutMs?: number;
1099
+ extraEnv?: Record<string, string>;
1100
+ /**
1101
+ * Verifier-owned env applied verbatim (never filtered, never
1102
+ * caller-visible): the fingerprint's resolution pins. Internal
1103
+ * preflight subprocesses carry it so `.git` indirection plants
1104
+ * cannot steer their resolution mid-capture (CX-143).
1105
+ */
1106
+ internalEnv?: Record<string, string>;
1107
+ input?: string | Buffer;
1108
+ preflight?: boolean;
1109
+ }) => Promise<{
1110
+ exitCode: number | null;
1111
+ stdout: string;
1112
+ stderr: string;
1113
+ }>;
1114
+ /**
1115
+ * Spawning half of the preflight for the runner channel — `verifierGit`
1116
+ * shells out itself, so it captures the two enumerations and hands them
1117
+ * to the pure judge. `null` when the repo surface cannot be enumerated
1118
+ * (non-repo cwds included — the op itself decides whether it needed one);
1119
+ * the os/flow evidence channel runs its own driver inside `gitEvidence`
1120
+ * so every subprocess stays in the argv-judged body.
1121
+ */
1122
+ export declare function evidenceRepoPreflight(repoRoot: string, prior?: EvidenceFingerprint | null, options?: EvidencePreflightOptions): Promise<EvidencePreflight | null>;
1123
+ export interface VerifierGitResult {
1124
+ exitCode: number;
1125
+ stdout: string;
1126
+ stderr: string;
1127
+ }
1128
+ export declare function verifierSpawnEnv(extra?: Record<string, string>): NodeJS.ProcessEnv;
1129
+ export declare function verifierSubprocessEnv(extra?: Record<string, string>): NodeJS.ProcessEnv;
1130
+ /**
1131
+ * Spawn a trusted forge-side binary (the gate child, the runner's CLI) with
1132
+ * a fully replaced, allowlisted env — not the io.exec merge, which can never
1133
+ * delete a hostile inherited variable. resolveSpawnPlan keeps the
1134
+ * PATHEXT/.cmd resolution io.exec gives on Windows; a spawn failure reports
1135
+ * exitCode -1.
1136
+ */
1137
+ export declare function verifierSpawn(bin: string, args: string[], opts: {
1138
+ cwd: string;
1139
+ timeoutMs?: number;
1140
+ extraEnv?: Record<string, string>;
1141
+ }): Promise<VerifierGitResult>;
1142
+ export declare function spawnCaptured(bin: string, args: readonly string[], opts: {
1143
+ cwd: string;
1144
+ env: NodeJS.ProcessEnv;
1145
+ timeoutMs: number;
1146
+ maxBuffer: number;
1147
+ indexFd?: number;
1148
+ /** Inode-bind roots for path-valued env pins (CX-r38-W2). */
1149
+ boundRoots?: readonly string[];
1150
+ /**
1151
+ * Arm-held root dir fds (CX-r38-W2): when set, env pins under a
1152
+ * held root bind through ITS fd — opened while the armed window
1153
+ * guaranteed the honest tree's dirent, so a post-arm rename
1154
+ * exchange cannot steer the bind onto a foreign inode.
1155
+ */
1156
+ heldRoots?: ReadonlyMap<string, number>;
1157
+ input?: string | Buffer;
1158
+ }): Promise<{
1159
+ exitCode: number;
1160
+ stdout: Buffer;
1161
+ stderr: Buffer;
1162
+ /** `/proc/self/fd/N` literal → the canonical path it bound (CX-r38-W2). */
1163
+ fdEnv?: Record<string, string>;
1164
+ }>;
1165
+ /**
1166
+ * Post-`add` staged-set coverage proof (CX-r28-B): `git add` expanding
1167
+ * a directory pathspec silently skips every member an ignore source
1168
+ * hides — worktree `.gitignore` files are session-writable and live
1169
+ * OUTSIDE the `.git` fingerprint, so a planted rule shrinks the staged
1170
+ * set while the op exits 0 and a caller's `staged: N` claim fabricates.
1171
+ * Tracked `.gitignore` rule sources the `add` child may consult —
1172
+ * enumerated from the CLAIMS index (the caller's pre-op intent, so the
1173
+ * op's own writes and any same-window real-index write never enter
1174
+ * it), resolved to worktree-absolute paths present at arm time. The
1175
+ * caller folds them into the spawn window's pin+event watch: a
1176
+ * mid-window rewrite of a tracked rule source then reads as drift
1177
+ * instead of laundering a foreign rule through the staged-set verdict
1178
+ * (CX-r29-B — the consult-time bytes and the verdict-time sample were
1179
+ * otherwise unpinned against each other, so a flip→restore pair
1180
+ * attested "clean" content the `add` never saw). A source absent at
1181
+ * arm or untracked-in-claims can never be attested; `null` marks the
1182
+ * domain unverifiable (claims index refused) and the op fails closed.
1183
+ */
1184
+ export declare function enumerateTrackedRuleSources(preflight: EvidencePreflight): Set<string> | null;
1185
+ /**
1186
+ * Spawn-argv transform applied AFTER argv judgment on every trusted
1187
+ * spawn — the judged caller argv stays verbatim while the spawned body
1188
+ * gains honesty flags no config/env pin can express (CX-141/CX-142):
1189
+ *
1190
+ * - `diff`/`log`/`show` gain `--no-ext-diff` (the `diff.external`
1191
+ * lever execs even an empty value; presence is REFUSE'd but argv is
1192
+ * the only airtight neutralizer).
1193
+ * - `status` gains `--ignored` — hidden-by-`.gitignore` files surface
1194
+ * as `!!` entries instead of disappearing (CX-142). Callers that
1195
+ * treat ignored files as non-dirt filter `!!` themselves; a session-
1196
+ * authored `.gitignore` is always dirt via the fs cross-check.
1197
+ * - `ls-files` drops exclude-rule flags before `--` — a trusted
1198
+ * enumeration answers every untracked file (CX-142). The strip is
1199
+ * mechanism-level: long names match abbreviation-aware, space-form
1200
+ * values ride the next token, and `-x`/`-X`/`-i` inside short
1201
+ * clusters are dropped without losing sibling flags (CX-r41-F2 — an
1202
+ * argv-named pattern/rule file sits outside every armed surface).
1203
+ * - `grep --untracked`/`--no-index` gains `--no-exclude-standard` —
1204
+ * git greps apply exclude rules to untracked files otherwise.
1205
+ */
1206
+ export declare function evidenceSpawnArgs(args: readonly string[]): string[];
1207
+ /**
1208
+ * `.gitignore` files present in the worktree that no commit owns —
1209
+ * session-authored ignore rules. A worktree `.gitignore` can hide
1210
+ * itself AND every sibling path it matches from `status`/`ls-files`
1211
+ * (CX-142): a session plants `*` and dirty content, and the trusted
1212
+ * enumeration answers clean. `--ignored` exposes the hidden entries
1213
+ * as `!!` lines, but the ONLY way to prove an ignore rule is
1214
+ * session-authored rather than committed policy is a filesystem walk
1215
+ * plus a tracked-set check — git's own enumeration is the channel
1216
+ * under attack. The walk is anchored at the worktree TOPLEVEL resolved
1217
+ * through the judged channel, never the caller's cwd: a rule one level
1218
+ * up still applies to a subdirectory cwd, and a cwd-scoped walk would
1219
+ * never see it (CX-167). Returned paths are toplevel-relative.
1220
+ *
1221
+ * Returns every `.gitignore` path NOT in the tracked set; when
1222
+ * `tracked` cannot answer (failed ls-files), every found rule counts
1223
+ * as session-authored — fail closed, never silently clean. `tracked`
1224
+ * maps the found paths to the subset git knows (its index claims) —
1225
+ * `null` on a failed read — and receives the resolved root so its
1226
+ * pathspec queries anchor where the relative names are true. `null`
1227
+ * return marks the toplevel itself unresolvable (refused channel,
1228
+ * bare/non-worktree cwd) — an unverifiable rule set, never "no rules".
1229
+ */
1230
+ /**
1231
+ * Whether every `!!` verdict `status --ignored` emitted is backed by a
1232
+ * COMMITTED rule source (CX-r22 worktree side): a `.gitignore` planted
1233
+ * inside the judged child's lifetime reclassifies `??` payloads as `!!`
1234
+ * — `sessionIgnoreRulePaths` can't see it (absent at its fs walk, gone
1235
+ * by its post-check), and the dir watch can't cover a whole worktree.
1236
+ * `check-ignore -v` reports which file's rule produced each verdict —
1237
+ * an ignored claim is proven only when that source is a TRACKED
1238
+ * `.gitignore` in the claims index. `info/exclude` is already
1239
+ * refuse-on-presence + watched, `core.excludesFile` is pinned DEVNULL,
1240
+ * so an `!!` whose source is missing, untracked, or the gone-again
1241
+ * transient plant is unproven — callers treat those paths as `??`
1242
+ * dirt/eligible (over-inclusive, never silent).
1243
+ *
1244
+ * `ignored` carries the raw porcelain path fields. With `-z` the input
1245
+ * is taken literally (no C-quote unquoting) — a quoted field simply
1246
+ * reports no source and lands in `unproven`, which is the safe
1247
+ * direction (over-inclusive, never silent). `null` = the provenance
1248
+ * could not be established (channel refused) — every claim
1249
+ * unverifiable.
1250
+ */
1251
+ export declare function unprovenIgnoredPaths(worktree: string, ignored: readonly string[]): Promise<Set<string> | null>;
1252
+ export declare function sessionIgnoreRulePaths(worktree: string, tracked: (paths: string[], root: string) => Promise<Set<string> | null>): Promise<string[] | null>;
1253
+ /**
1254
+ * `execFile(<resolved git>, args, {cwd, env: verifierGitEnv()})` returning
1255
+ * the same `{exitCode, stdout, stderr}` shape io.exec produces, so boundary
1256
+ * call sites swap without contract churn. The executable is the resolved
1257
+ * absolute path (CX-52) and `extraEnv` adds caller-owned variables to the
1258
+ * scrubbed env — never session-inherited ones. A spawn failure reports
1259
+ * exitCode -1 — callers treat non-zero as a failed read, never as an empty
1260
+ * answer. argv is judged against `isVerifierGitQuery` — the evidence read
1261
+ * table minus `fetch` — so only provable read ops reach the trusted spawn
1262
+ * (CX-108/109).
1263
+ */
1264
+ export declare function verifierGit(cwd: string, args: string[], opts?: {
1265
+ timeoutMs?: number;
1266
+ maxBuffer?: number;
1267
+ extraEnv?: Record<string, string>;
1268
+ /**
1269
+ * A caller-owned preflight to anchor this read to — reused so a
1270
+ * read→mutation sequence judges ONE proven surface; drift against
1271
+ * it refuses rather than re-judging a swapped repo (CX-169).
1272
+ */
1273
+ preflight?: EvidencePreflight | null;
1274
+ /** Optional bytes piped to the child's stdin (`check-ignore --stdin`). */
1275
+ input?: string | Buffer;
1276
+ /** Extra file inodes folded into the spawn-window watch (see `verifierGitSpawn`). */
1277
+ extraWatchPaths?: readonly string[];
1278
+ }): Promise<VerifierGitResult>;
1279
+ /**
1280
+ * `verifierGit` for the adversarial runner's OWN scratch clone — same
1281
+ * env/preflight/pins, but argv is judged by `isScratchGitQuery`: the
1282
+ * bounded mutation ops (clone/config/add/commit/…) the replay needs on a
1283
+ * repo it owns, everything else through the read table. A scenario-
1284
+ * authored token can never reach `reflog`/`stash`/`update-ref`, a
1285
+ * `config --file` foreign store, or a global-option redirect
1286
+ * (CX-108/109).
1287
+ */
1288
+ export declare function verifierScratchGit(cwd: string, args: string[], opts?: {
1289
+ timeoutMs?: number;
1290
+ maxBuffer?: number;
1291
+ extraEnv?: Record<string, string>;
1292
+ }): Promise<VerifierGitResult>;
1293
+ /**
1294
+ * Runtime argv judgment for the anchored-mutation channel — only the
1295
+ * ops above, and never a ref-store handle (`@{…}` is a fabrication
1296
+ * channel in every position).
1297
+ */
1298
+ export declare function isAnchoredMutationQuery(args: readonly string[]): boolean;
1299
+ /**
1300
+ * A trusted mutation anchored to a caller-captured preflight: forge
1301
+ * writes into the repo it just proved — `pinnedGitAdd`, archive
1302
+ * move-staging, the lockfile un-stage (CX-169/CX-170). The anchored
1303
+ * fingerprint is re-proved immediately before the spawn and drift
1304
+ * refuses outright: an ambient `git add` between a judged read and the
1305
+ * mutation would follow a swapped `.git` indirection into a foreign
1306
+ * index, while a fresh preflight would happily attest THAT repo
1307
+ * (CX-169). The spawn still carries the full evidence env — resolved
1308
+ * binary, scrubbed env, resolution pins, `GIT_ATTR_SOURCE` starvation
1309
+ * — so `info/attributes` `filter.*` drivers never rewrite staged bytes
1310
+ * (they refuse the channel anyway via shapeViolations). `opts.preflight`
1311
+ * is required: `null` means the caller's own preflight found nothing
1312
+ * provable, and the op fails closed downstream the same way a missing
1313
+ * repo does.
1314
+ */
1315
+ export declare function evidenceAnchoredGit(cwd: string, args: string[], opts: {
1316
+ timeoutMs?: number;
1317
+ maxBuffer?: number;
1318
+ extraEnv?: Record<string, string>;
1319
+ preflight: EvidencePreflight | null;
1320
+ /**
1321
+ * Caller-pinned `.gitignore` (or other rule source) whose bytes the
1322
+ * op may consult — attested content the staged-set coverage proof
1323
+ * accepts (CX-r28-B). Every untracked rule source NOT pinned here
1324
+ * makes a staged-set shrink refuse.
1325
+ */
1326
+ extraWatchPaths?: readonly string[];
1327
+ }): Promise<VerifierGitResult>;
1328
+ export {};
1329
+ //# sourceMappingURL=verifier-git.d.ts.map