scip-query 0.19.4 → 0.19.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (400) hide show
  1. package/CHANGELOG.md +75 -1
  2. package/README.md +242 -49
  3. package/dist/augment-vue-worker.js +1 -1
  4. package/dist/{chunk-2YU7I3QO.js → chunk-24QNP7MN.js} +2 -2
  5. package/dist/{chunk-CNKAGUPL.js → chunk-26X7KCJR.js} +2 -2
  6. package/dist/{chunk-GPBBJ5Y4.js → chunk-273W2U4Y.js} +3 -3
  7. package/dist/{chunk-7GXM52MI.js → chunk-2CVXCGL4.js} +2 -2
  8. package/dist/{chunk-ABMYA4TN.js → chunk-2EZSOTSY.js} +2 -2
  9. package/dist/{chunk-HKEHS2AS.js → chunk-2GSQR6YA.js} +2 -2
  10. package/dist/{chunk-FECYOO5O.js → chunk-2OXVAGGT.js} +2 -2
  11. package/dist/chunk-2ZOCHAL2.js +8 -0
  12. package/dist/{chunk-QGXBRIM5.js → chunk-336DC5NJ.js} +2 -2
  13. package/dist/chunk-35SQLYCQ.js +2 -0
  14. package/dist/{chunk-VXQNNXJE.js → chunk-3OIKRYU5.js} +2 -2
  15. package/dist/{chunk-52ZYCAEO.js → chunk-47X75ZKH.js} +2 -2
  16. package/dist/{chunk-NPKYOIFM.js → chunk-4CGVLUDP.js} +2 -2
  17. package/dist/chunk-4RI4BJGT.js +8 -0
  18. package/dist/{chunk-P2PC2WGR.js → chunk-52HQTTPB.js} +2 -2
  19. package/dist/{chunk-YNRNA5LK.js → chunk-5OC3HWP5.js} +2 -2
  20. package/dist/{chunk-STOL2BTL.js → chunk-6XFC7PQ5.js} +2 -2
  21. package/dist/{chunk-J77UIT3I.js → chunk-6XHTISLI.js} +2 -2
  22. package/dist/chunk-6YTSKJJ3.js +2 -0
  23. package/dist/{chunk-BTEE5NZQ.js → chunk-7E3TH5ZN.js} +2 -2
  24. package/dist/{chunk-X6D5IC6I.js → chunk-7LABSJSR.js} +2 -2
  25. package/dist/chunk-7Q6VYYCH.js +2 -0
  26. package/dist/{chunk-FWUUZTIO.js → chunk-A43URCQ3.js} +2 -2
  27. package/dist/chunk-A63U2W3P.js +3 -0
  28. package/dist/{chunk-3MJ5YA4Y.js → chunk-ADFSIJP2.js} +2 -2
  29. package/dist/chunk-AOLE4DYM.js +6 -0
  30. package/dist/chunk-APMMR5Y2.js +2 -0
  31. package/dist/chunk-B5MHCHP3.js +107 -0
  32. package/dist/{chunk-4RSI5EMG.js → chunk-CSTYYXKC.js} +2 -2
  33. package/dist/{chunk-25LPM4DG.js → chunk-CYJM7CYF.js} +2 -2
  34. package/dist/{chunk-S44IULR6.js → chunk-DD5BOU5I.js} +2 -2
  35. package/dist/{chunk-YGAGTIDK.js → chunk-DGMCFMPG.js} +7 -7
  36. package/dist/{chunk-UOAV44HR.js → chunk-E2ZXPB7J.js} +2 -2
  37. package/dist/{chunk-IZKFSVBV.js → chunk-EVOC5I5I.js} +2 -2
  38. package/dist/{chunk-XTX6QHOF.js → chunk-F42A3AKG.js} +2 -2
  39. package/dist/{chunk-Q4IIEGXJ.js → chunk-FHCTEANE.js} +2 -2
  40. package/dist/{chunk-3SVWW4PN.js → chunk-FKGN4A4E.js} +2 -2
  41. package/dist/{chunk-IG7N5ZIK.js → chunk-FQTPPXNA.js} +2 -2
  42. package/dist/{chunk-F6O7AAC3.js → chunk-G4UQL4CP.js} +2 -2
  43. package/dist/chunk-GA64UPMI.js +6 -0
  44. package/dist/{chunk-ZXJYMGD3.js → chunk-GK3GRUJX.js} +2 -2
  45. package/dist/chunk-HEBAY673.js +2 -0
  46. package/dist/chunk-HELS7KFF.js +2 -0
  47. package/dist/{chunk-B5NLK2B3.js → chunk-IPDCSB6N.js} +2 -2
  48. package/dist/{chunk-M7MTH5NR.js → chunk-IYAOX36F.js} +2 -2
  49. package/dist/{chunk-YVVCVR2L.js → chunk-J7VT2CRB.js} +2 -2
  50. package/dist/{chunk-4333ETTV.js → chunk-JELJLXEE.js} +2 -2
  51. package/dist/{chunk-LBMJEAEW.js → chunk-JERWGHQT.js} +2 -2
  52. package/dist/chunk-JJJCO4QC.js +945 -0
  53. package/dist/{chunk-6E7UTQY7.js → chunk-JZNLMHWY.js} +2 -2
  54. package/dist/{chunk-R4FQGQ4X.js → chunk-K42M2KWT.js} +2 -2
  55. package/dist/{chunk-H7UKLTWJ.js → chunk-KLVJABXA.js} +2 -2
  56. package/dist/chunk-KP4KBDVF.js +3 -0
  57. package/dist/{chunk-RV2FQIX3.js → chunk-LMFVTUW2.js} +2 -2
  58. package/dist/chunk-LRTP3DKL.js +3 -0
  59. package/dist/{chunk-U6WNH5GC.js → chunk-MGBJHRFB.js} +2 -2
  60. package/dist/{chunk-QDV6RDCP.js → chunk-MLGTCX56.js} +2 -2
  61. package/dist/{chunk-54HA4ZXH.js → chunk-N3SE646F.js} +2 -2
  62. package/dist/{chunk-KP6XRY5Z.js → chunk-NBRUH7OE.js} +2 -2
  63. package/dist/{chunk-M7AIS73L.js → chunk-NN4ZIRPK.js} +2 -2
  64. package/dist/{chunk-I5RJM53C.js → chunk-NQLSSVOB.js} +2 -2
  65. package/dist/{chunk-4SALD7RU.js → chunk-OBKDTVZ3.js} +2 -2
  66. package/dist/{chunk-GBQ5NYPR.js → chunk-OHWZKLVA.js} +6 -6
  67. package/dist/{chunk-6NSFJYRC.js → chunk-OP3MTFJR.js} +2 -2
  68. package/dist/{chunk-EOOJGLDU.js → chunk-OQ2A4G2G.js} +2 -2
  69. package/dist/{chunk-DLWR3NUU.js → chunk-P6HBYNBE.js} +2 -2
  70. package/dist/{chunk-QVWS2VWZ.js → chunk-PC44K7RF.js} +2 -2
  71. package/dist/{chunk-A2EZV2UM.js → chunk-QBYYWGAT.js} +2 -2
  72. package/dist/{chunk-QRGV2F7L.js → chunk-QHKUY4FW.js} +2 -2
  73. package/dist/chunk-QHRL4LKM.js +2 -0
  74. package/dist/{chunk-I5AWSI2G.js → chunk-QQWOFXNW.js} +2 -2
  75. package/dist/{chunk-WQTAC523.js → chunk-RBFFD4V2.js} +2 -2
  76. package/dist/{chunk-SOAT6NLA.js → chunk-RJHCPSZ7.js} +2 -2
  77. package/dist/{chunk-VGRICIQI.js → chunk-RWRLUZ6U.js} +2 -2
  78. package/dist/{chunk-4T3LTWUS.js → chunk-S2GP3CU3.js} +2 -2
  79. package/dist/{chunk-HEXVUYFQ.js → chunk-SHKZ7OVJ.js} +2 -2
  80. package/dist/{chunk-NSS46APD.js → chunk-TFUU5MQQ.js} +2 -2
  81. package/dist/{chunk-IUFDSKGG.js → chunk-TYQ76QHQ.js} +2 -2
  82. package/dist/{chunk-NRCXJDHL.js → chunk-U5CNPPTZ.js} +2 -2
  83. package/dist/{chunk-MITTUCEH.js → chunk-UQK5CRUK.js} +2 -2
  84. package/dist/{chunk-XLTP42QA.js → chunk-UUJBLG6J.js} +2 -2
  85. package/dist/chunk-UXP636P5.js +144 -0
  86. package/dist/{chunk-64RFXJT5.js → chunk-VEVBIAOJ.js} +6 -6
  87. package/dist/chunk-VKRQDBW5.js +9 -0
  88. package/dist/{chunk-C7NIYIQ4.js → chunk-VOQFGC2W.js} +4 -4
  89. package/dist/{chunk-DZ74OMG6.js → chunk-VP542C25.js} +2 -2
  90. package/dist/{chunk-Q3AFUTGB.js → chunk-WMXRRBII.js} +2 -2
  91. package/dist/{chunk-ZGZUZ7XE.js → chunk-WXAAURU7.js} +2 -2
  92. package/dist/chunk-X3NLZHPA.js +20 -0
  93. package/dist/{chunk-WER3B7MI.js → chunk-XF3KLXN3.js} +2 -2
  94. package/dist/{chunk-NH5ALKPW.js → chunk-XVJ3V7LM.js} +2 -2
  95. package/dist/{chunk-4XTA5OMB.js → chunk-YGQN3XGZ.js} +2 -2
  96. package/dist/{chunk-CFMXJPHH.js → chunk-YHXBD52M.js} +2 -2
  97. package/dist/{chunk-7B3UPBVA.js → chunk-YLVE3SXZ.js} +2 -2
  98. package/dist/{chunk-YIJ7ZAA4.js → chunk-YTUD45PU.js} +2 -2
  99. package/dist/{chunk-VTKGCT3V.js → chunk-YWB2EBNB.js} +2 -2
  100. package/dist/{chunk-UKZBVX4U.js → chunk-Z2LHPIOM.js} +2 -2
  101. package/dist/chunk-Z5QQPJ3U.js +30 -0
  102. package/dist/{chunk-NZL2DBT7.js → chunk-ZLJLE6LK.js} +2 -2
  103. package/dist/{chunk-XYADIZHU.js → chunk-ZTTISZ7J.js} +2 -2
  104. package/dist/cli.js +3 -3
  105. package/dist/command-descriptors-SJDZ7QGR.js +617 -0
  106. package/dist/{config-types-D20KuvvZ.d.ts → config-types-BWQ5xPGI.d.ts} +4 -0
  107. package/dist/{db-G_II8yXU.d.ts → db-B0r1o7Vt.d.ts} +18 -1
  108. package/dist/direct-navigation-HTKOZEOM.js +3 -0
  109. package/dist/{health-oblXYgkF.d.ts → health-CFnlCiTz.d.ts} +1 -1
  110. package/dist/index.d.ts +2 -2
  111. package/dist/index.js +1 -1
  112. package/dist/postinstall.js +1 -1
  113. package/dist/queries/affected.d.ts +2 -2
  114. package/dist/queries/affected.js +1 -1
  115. package/dist/queries/architecture.d.ts +2 -2
  116. package/dist/queries/architecture.js +1 -1
  117. package/dist/queries/bottlenecks.d.ts +2 -2
  118. package/dist/queries/bottlenecks.js +1 -1
  119. package/dist/queries/by-kind.d.ts +2 -2
  120. package/dist/queries/by-kind.js +1 -1
  121. package/dist/queries/call-graph.d.ts +2 -2
  122. package/dist/queries/call-graph.js +1 -1
  123. package/dist/queries/change-surface.d.ts +2 -2
  124. package/dist/queries/change-surface.js +1 -1
  125. package/dist/queries/cleanup-plan.d.ts +2 -2
  126. package/dist/queries/cleanup-plan.js +1 -1
  127. package/dist/queries/co-change.d.ts +2 -2
  128. package/dist/queries/co-change.js +1 -1
  129. package/dist/queries/code.d.ts +2 -2
  130. package/dist/queries/code.js +1 -1
  131. package/dist/queries/complexity-hotspots.d.ts +2 -2
  132. package/dist/queries/complexity-hotspots.js +1 -1
  133. package/dist/queries/complexity.d.ts +2 -2
  134. package/dist/queries/complexity.js +1 -1
  135. package/dist/queries/convergence.d.ts +2 -2
  136. package/dist/queries/convergence.js +1 -1
  137. package/dist/queries/coupling.d.ts +2 -2
  138. package/dist/queries/coupling.js +1 -1
  139. package/dist/queries/cycles.d.ts +2 -2
  140. package/dist/queries/cycles.js +1 -1
  141. package/dist/queries/dataflow.d.ts +2 -2
  142. package/dist/queries/dataflow.js +1 -1
  143. package/dist/queries/dead.d.ts +2 -2
  144. package/dist/queries/dead.js +1 -1
  145. package/dist/queries/decorative-checkers.d.ts +3 -3
  146. package/dist/queries/decorative-checkers.js +1 -1
  147. package/dist/queries/deep-chains.d.ts +2 -2
  148. package/dist/queries/deep-chains.js +1 -1
  149. package/dist/queries/deps.d.ts +2 -2
  150. package/dist/queries/deps.js +1 -1
  151. package/dist/queries/diff-gate.d.ts +30 -2
  152. package/dist/queries/diff-gate.js +1 -1
  153. package/dist/queries/diff-impact.d.ts +2 -2
  154. package/dist/queries/diff-impact.js +1 -1
  155. package/dist/queries/doc-drift.d.ts +2 -2
  156. package/dist/queries/doc-drift.js +1 -1
  157. package/dist/queries/drift.d.ts +2 -2
  158. package/dist/queries/drift.js +1 -1
  159. package/dist/queries/duplicate-bodies.d.ts +2 -2
  160. package/dist/queries/duplicate-bodies.js +1 -1
  161. package/dist/queries/extract-candidates.d.ts +2 -2
  162. package/dist/queries/extract-candidates.js +1 -1
  163. package/dist/queries/fan.d.ts +2 -2
  164. package/dist/queries/fan.js +1 -1
  165. package/dist/queries/files.d.ts +2 -2
  166. package/dist/queries/health.d.ts +3 -3
  167. package/dist/queries/health.js +1 -1
  168. package/dist/queries/hierarchy.d.ts +2 -2
  169. package/dist/queries/hierarchy.js +1 -1
  170. package/dist/queries/hotspots.d.ts +2 -2
  171. package/dist/queries/hotspots.js +1 -1
  172. package/dist/queries/imports.d.ts +2 -2
  173. package/dist/queries/imports.js +1 -1
  174. package/dist/queries/incomplete-migration.d.ts +2 -2
  175. package/dist/queries/incomplete-migration.js +1 -1
  176. package/dist/queries/index.d.ts +17 -3
  177. package/dist/queries/index.js +1 -1
  178. package/dist/queries/isolated.d.ts +2 -2
  179. package/dist/queries/isolated.js +1 -1
  180. package/dist/queries/locality-candidates.d.ts +2 -2
  181. package/dist/queries/locality-candidates.js +1 -1
  182. package/dist/queries/members.d.ts +2 -2
  183. package/dist/queries/members.js +1 -1
  184. package/dist/queries/methods.d.ts +2 -2
  185. package/dist/queries/methods.js +1 -1
  186. package/dist/queries/not-implemented.d.ts +3 -3
  187. package/dist/queries/not-implemented.js +1 -1
  188. package/dist/queries/outline.d.ts +2 -2
  189. package/dist/queries/outline.js +1 -1
  190. package/dist/queries/passthrough-candidates.d.ts +2 -2
  191. package/dist/queries/passthrough-candidates.js +1 -1
  192. package/dist/queries/plan-context.d.ts +2 -2
  193. package/dist/queries/plan-context.js +1 -1
  194. package/dist/queries/react-component-duplicates.d.ts +2 -2
  195. package/dist/queries/react-component-duplicates.js +1 -1
  196. package/dist/queries/react-hook-candidates.d.ts +2 -2
  197. package/dist/queries/react-hook-candidates.js +1 -1
  198. package/dist/queries/react-large-component-pressure.d.ts +2 -2
  199. package/dist/queries/react-large-component-pressure.js +1 -1
  200. package/dist/queries/recent-duplicates.d.ts +2 -2
  201. package/dist/queries/recent-duplicates.js +1 -1
  202. package/dist/queries/redundant-reexports.d.ts +2 -2
  203. package/dist/queries/redundant-reexports.js +1 -1
  204. package/dist/queries/refs.d.ts +2 -2
  205. package/dist/queries/refs.js +1 -1
  206. package/dist/queries/self-audit.d.ts +2 -2
  207. package/dist/queries/self-audit.js +1 -1
  208. package/dist/queries/similar-chains.d.ts +2 -2
  209. package/dist/queries/similar-chains.js +1 -1
  210. package/dist/queries/similar-files.d.ts +2 -2
  211. package/dist/queries/similar-files.js +1 -1
  212. package/dist/queries/similar-signatures.d.ts +2 -2
  213. package/dist/queries/similar-signatures.js +1 -1
  214. package/dist/queries/similar.d.ts +2 -2
  215. package/dist/queries/similar.js +1 -1
  216. package/dist/queries/slice.d.ts +2 -2
  217. package/dist/queries/slice.js +1 -1
  218. package/dist/queries/stale-abstractions.d.ts +2 -2
  219. package/dist/queries/stale-abstractions.js +1 -1
  220. package/dist/queries/stats.d.ts +2 -2
  221. package/dist/queries/stats.js +1 -1
  222. package/dist/queries/surface.d.ts +2 -2
  223. package/dist/queries/surface.js +1 -1
  224. package/dist/queries/symbols.d.ts +2 -2
  225. package/dist/queries/symbols.js +1 -1
  226. package/dist/queries/system.d.ts +2 -2
  227. package/dist/queries/system.js +1 -1
  228. package/dist/queries/test-quality.d.ts +2 -2
  229. package/dist/queries/test-quality.js +1 -1
  230. package/dist/queries/trace.d.ts +2 -2
  231. package/dist/queries/trace.js +1 -1
  232. package/dist/queries/twin-ab.d.ts +3 -3
  233. package/dist/queries/twin-ab.js +1 -1
  234. package/dist/queries/twin-drift.d.ts +2 -2
  235. package/dist/queries/twin-drift.js +1 -1
  236. package/dist/queries/unused-imports.d.ts +2 -2
  237. package/dist/queries/unused-imports.js +1 -1
  238. package/dist/queries/unused-params.d.ts +2 -2
  239. package/dist/queries/unused-params.js +1 -1
  240. package/dist/queries/vue-component-duplicates.d.ts +2 -2
  241. package/dist/queries/vue-component-duplicates.js +1 -1
  242. package/dist/queries/vue-composable-candidates.d.ts +2 -2
  243. package/dist/queries/vue-composable-candidates.js +1 -1
  244. package/dist/queries/vue-large-view-pressure.d.ts +2 -2
  245. package/dist/queries/vue-large-view-pressure.js +1 -1
  246. package/dist/queries/wrapper-candidates.d.ts +2 -2
  247. package/dist/queries/wrapper-candidates.js +1 -1
  248. package/dist/reindex-worker.js +23 -24
  249. package/dist/reindex.d.ts +10 -4
  250. package/dist/reindex.js +33 -38
  251. package/dist/runtime.d.ts +167 -11
  252. package/dist/runtime.js +3 -2
  253. package/dist/rust-semantic-session-server.js +1 -1
  254. package/dist/rust-semantic-session-worker.js +1 -1
  255. package/dist/rust-semantic-worker.js +1 -1
  256. package/dist/{scip-cli-kRpaexVJ.d.ts → scip-cli-DCvnlZCu.d.ts} +5 -1
  257. package/dist/watch-server.js +5 -5
  258. package/docs/AGENT_GUIDE.md +1 -1
  259. package/docs/AI_FAILURE_MODES.md +18 -18
  260. package/docs/API_EVOLUTION.md +71 -0
  261. package/docs/CLI_JSON_OUTPUT.md +83 -0
  262. package/docs/COMMAND_REFERENCE.md +10 -8
  263. package/docs/COMMITTED_RECORD_COMPATIBILITY.md +117 -0
  264. package/docs/CONFIGURATION_WRITE_SAFETY.md +130 -0
  265. package/docs/DETECTOR_GUIDE.md +47 -47
  266. package/docs/DURABILITY.md +103 -0
  267. package/docs/INDEX_GENERATIONS.md +121 -0
  268. package/docs/LOCK_PROTOCOL.md +133 -0
  269. package/docs/MAILBOX_LIFECYCLE.md +197 -0
  270. package/docs/REINDEX_METADATA_COMPATIBILITY.md +84 -0
  271. package/docs/RUST_DURABLE_SESSION_PROTOCOL.md +126 -0
  272. package/docs/TELEMETRY_RETENTION.md +72 -0
  273. package/docs/TIME_SEMANTICS.md +77 -0
  274. package/docs/WATCH_REFRESH_REQUESTS.md +110 -0
  275. package/docs/WINDOWS_SIDECAR_RELEASE.md +298 -0
  276. package/docs/analyzer-validation-ledger.md +24 -23
  277. package/docs/schemas/cli-json-envelope.schema.json +53 -0
  278. package/docs/schemas/npm-release-state.schema.json +146 -0
  279. package/docs/schemas/outcome-event-record.schema.json +39 -0
  280. package/docs/schemas/project-config.schema.json +247 -0
  281. package/docs/schemas/suppression-record.schema.json +31 -0
  282. package/docs/schemas/windows-sidecar-provenance.schema.json +137 -0
  283. package/package.json +15 -5
  284. package/scripts/build-scip-windows.mjs +180 -61
  285. package/scripts/scip-windows-provenance.mjs +364 -0
  286. package/scripts/verify-scip-windows.mjs +29 -0
  287. package/skills/_shared/SKILL.md +91 -242
  288. package/skills/_shared/agents/openai.yaml +1 -1
  289. package/skills/_shared/references/agent-contract-catalog.md +105 -0
  290. package/skills/_shared/references/command-catalog.md +118 -0
  291. package/skills/_shared/references/detector-precision-and-diffgate.md +59 -0
  292. package/skills/_shared/references/evidence-and-dead-code.md +25 -0
  293. package/skills/scip-audit/SKILL.md +76 -0
  294. package/skills/scip-audit/agents/openai.yaml +4 -0
  295. package/skills/scip-audit/references/claims.md +98 -0
  296. package/skills/scip-audit/references/cleanup.md +101 -0
  297. package/skills/scip-audit/references/directory.md +222 -0
  298. package/skills/scip-audit/references/frontend.md +130 -0
  299. package/skills/scip-audit/references/integrity.md +154 -0
  300. package/skills/scip-audit/references/maintainability.md +162 -0
  301. package/skills/scip-audit/references/twin-drift.md +104 -0
  302. package/skills/scip-diagnose/SKILL.md +52 -0
  303. package/skills/scip-diagnose/agents/openai.yaml +4 -0
  304. package/skills/scip-diagnose/references/debug.md +117 -0
  305. package/skills/{scip-probe-reachability/SKILL.md → scip-diagnose/references/probe-reachability.md} +12 -27
  306. package/skills/scip-diagnose/references/root-cause.md +145 -0
  307. package/skills/scip-diagnose/references/triage.md +119 -0
  308. package/skills/scip-explore/SKILL.md +53 -84
  309. package/skills/scip-explore/agents/openai.yaml +2 -2
  310. package/skills/scip-explore/references/diagrams.md +40 -0
  311. package/skills/scip-explore/references/language-playbook.md +49 -0
  312. package/skills/scip-improve/SKILL.md +56 -0
  313. package/skills/scip-improve/agents/openai.yaml +4 -0
  314. package/skills/scip-improve/references/cleanup-batches.md +53 -0
  315. package/skills/scip-improve/references/directory-moves.md +53 -0
  316. package/skills/scip-improve/references/doc-reconcile.md +30 -0
  317. package/skills/scip-improve/references/frontend-extraction.md +39 -0
  318. package/skills/scip-improve/references/maintainability-mechanism.md +43 -0
  319. package/skills/scip-improve/references/twin-drift.md +35 -0
  320. package/skills/scip-plan/SKILL.md +68 -0
  321. package/skills/scip-plan/agents/openai.yaml +4 -0
  322. package/skills/scip-plan/references/api-impact.md +19 -0
  323. package/skills/scip-plan/references/conductor.md +41 -0
  324. package/skills/scip-plan/references/high-assurance.md +43 -0
  325. package/skills/scip-plan/references/hyper-optimization.md +50 -0
  326. package/skills/scip-plan/references/tla-model.md +88 -0
  327. package/skills/scip-query/SKILL.md +52 -97
  328. package/skills/scip-query/agents/openai.yaml +2 -2
  329. package/skills/scip-setup/SKILL.md +65 -176
  330. package/skills/scip-setup/agents/openai.yaml +3 -3
  331. package/skills/scip-setup/references/bootstrap-workflow.md +120 -0
  332. package/skills/scip-setup/references/language-verification.md +61 -0
  333. package/skills/scip-setup/references/lifecycle-commands.md +119 -0
  334. package/skills/scip-setup/references/per-repo-triage.md +24 -0
  335. package/skills/scip-verify/SKILL.md +123 -70
  336. package/skills/scip-verify/agents/openai.yaml +2 -2
  337. package/skills/scip-verify/references/calibrate-detectors.md +170 -0
  338. package/dist/chunk-2CTX5CMX.js +0 -4
  339. package/dist/chunk-2Y373BDD.js +0 -2
  340. package/dist/chunk-C2QSK7E7.js +0 -2
  341. package/dist/chunk-D4U5Q3FT.js +0 -7
  342. package/dist/chunk-K2ERX4UT.js +0 -3
  343. package/dist/chunk-KHE7J5ZN.js +0 -3
  344. package/dist/chunk-L7SPDE73.js +0 -84
  345. package/dist/chunk-LHMNRHGV.js +0 -3
  346. package/dist/chunk-LM72NQ7T.js +0 -3
  347. package/dist/chunk-MSWVMDAH.js +0 -122
  348. package/dist/chunk-NH7WNNQC.js +0 -20
  349. package/dist/chunk-OMPZHGHO.js +0 -2
  350. package/dist/chunk-SVLTAG5O.js +0 -927
  351. package/dist/chunk-U7DSEKOM.js +0 -30
  352. package/dist/chunk-V27BEQJN.js +0 -7
  353. package/dist/chunk-VMNZB6WI.js +0 -4
  354. package/dist/chunk-XBN5VO53.js +0 -2
  355. package/dist/chunk-ZAIILQNP.js +0 -5
  356. package/dist/command-descriptors-MFU4BCJ7.js +0 -612
  357. package/dist/direct-navigation-MRMQFIRB.js +0 -3
  358. package/skills/scip-api-impact/SKILL.md +0 -139
  359. package/skills/scip-api-impact/agents/openai.yaml +0 -4
  360. package/skills/scip-calibrate/SKILL.md +0 -131
  361. package/skills/scip-calibrate/agents/openai.yaml +0 -4
  362. package/skills/scip-claim-audit/SKILL.md +0 -106
  363. package/skills/scip-claim-audit/agents/openai.yaml +0 -4
  364. package/skills/scip-cleanup-audit/SKILL.md +0 -126
  365. package/skills/scip-cleanup-audit/agents/openai.yaml +0 -4
  366. package/skills/scip-cleanup-improve/SKILL.md +0 -84
  367. package/skills/scip-cleanup-improve/agents/openai.yaml +0 -4
  368. package/skills/scip-concrete-plan/SKILL.md +0 -262
  369. package/skills/scip-concrete-plan/agents/openai.yaml +0 -4
  370. package/skills/scip-conductor/SKILL.md +0 -133
  371. package/skills/scip-conductor/agents/openai.yaml +0 -4
  372. package/skills/scip-debug/SKILL.md +0 -130
  373. package/skills/scip-debug/agents/openai.yaml +0 -4
  374. package/skills/scip-diagram/SKILL.md +0 -110
  375. package/skills/scip-diagram/agents/openai.yaml +0 -4
  376. package/skills/scip-directory-architecture/SKILL.md +0 -254
  377. package/skills/scip-directory-architecture/agents/openai.yaml +0 -4
  378. package/skills/scip-doc-reconcile/SKILL.md +0 -89
  379. package/skills/scip-doc-reconcile/agents/openai.yaml +0 -4
  380. package/skills/scip-hyper-optimization/SKILL.md +0 -156
  381. package/skills/scip-hyper-optimization/agents/openai.yaml +0 -4
  382. package/skills/scip-integrity-audit/SKILL.md +0 -152
  383. package/skills/scip-integrity-audit/agents/openai.yaml +0 -4
  384. package/skills/scip-language-playbook/SKILL.md +0 -106
  385. package/skills/scip-language-playbook/agents/openai.yaml +0 -4
  386. package/skills/scip-maintainability/SKILL.md +0 -158
  387. package/skills/scip-maintainability/agents/openai.yaml +0 -4
  388. package/skills/scip-probe-reachability/agents/openai.yaml +0 -4
  389. package/skills/scip-react-maintainability/SKILL.md +0 -101
  390. package/skills/scip-react-maintainability/agents/openai.yaml +0 -4
  391. package/skills/scip-root-cause/SKILL.md +0 -150
  392. package/skills/scip-root-cause/agents/openai.yaml +0 -4
  393. package/skills/scip-tla-model-system/SKILL.md +0 -148
  394. package/skills/scip-tla-model-system/agents/openai.yaml +0 -4
  395. package/skills/scip-triage-issue/SKILL.md +0 -126
  396. package/skills/scip-triage-issue/agents/openai.yaml +0 -4
  397. package/skills/scip-twin-drift/SKILL.md +0 -107
  398. package/skills/scip-twin-drift/agents/openai.yaml +0 -4
  399. package/skills/scip-vue-maintainability/SKILL.md +0 -107
  400. package/skills/scip-vue-maintainability/agents/openai.yaml +0 -4
@@ -1,78 +1,197 @@
1
1
  #!/usr/bin/env node
2
2
  import { execFileSync } from 'node:child_process';
3
- import { copyFileSync, mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs';
3
+ import { copyFileSync, mkdirSync, mkdtempSync, readFileSync, renameSync, rmSync, writeFileSync } from 'node:fs';
4
4
  import { tmpdir } from 'node:os';
5
- import { dirname, join, resolve } from 'node:path';
5
+ import { basename, dirname, join, resolve } from 'node:path';
6
6
  import { fileURLToPath } from 'node:url';
7
+ import {
8
+ createWindowsSidecarProvenance,
9
+ DEFAULT_SCIP_REPOSITORY,
10
+ DEFAULT_SCIP_TAG,
11
+ PINNED_GO_VERSION,
12
+ verifyWindowsSidecarProvenance,
13
+ WINDOWS_SIDECAR_BUILD,
14
+ WINDOWS_SIDECAR_PROVENANCE_FILE,
15
+ WINDOWS_SIDECAR_TARGETS,
16
+ } from './scip-windows-provenance.mjs';
7
17
 
8
- const SCIP_VERSION = process.env.SCIP_VERSION ?? 'v0.8.1';
9
- const SCIP_REPO_URL = process.env.SCIP_REPO_URL ?? 'https://github.com/scip-code/scip.git';
10
18
  const ROOT = resolve(dirname(fileURLToPath(import.meta.url)), '..');
11
- const VENDOR_DIR = join(ROOT, 'packages', 'scip-windows');
12
19
 
13
- const TARGETS = [
14
- { goarch: 'amd64', packageArch: 'x64' },
15
- { goarch: 'arm64', packageArch: 'arm64' },
16
- ];
20
+ export function buildScipWindowsSidecar(
21
+ {
22
+ root = ROOT,
23
+ sourceRepository = process.env.SCIP_REPO_URL ?? DEFAULT_SCIP_REPOSITORY,
24
+ sourceTag = process.env.SCIP_VERSION ?? DEFAULT_SCIP_TAG,
25
+ expectedGoVersion = process.env.SCIP_GO_VERSION ?? PINNED_GO_VERSION,
26
+ } = {},
27
+ runtime = createBuildRuntime(),
28
+ ) {
29
+ const sidecarDir = join(root, 'packages', 'scip-windows');
30
+ const sidecarPackage = JSON.parse(runtime.readFile(join(sidecarDir, 'package.json'), 'utf8'));
31
+ runtime.assertAvailable('git');
32
+ runtime.assertAvailable('go');
17
33
 
18
- function run(binary, args, options = {}) {
19
- console.log(`$ ${binary} ${args.join(' ')}`);
20
- execFileSync(binary, args, {
21
- stdio: 'inherit',
22
- ...options,
23
- });
24
- }
25
-
26
- function assertAvailable(binary) {
27
- const probe = process.platform === 'win32' ? 'where' : 'which';
34
+ const workDir = runtime.makeTempDirectory(join(runtime.tempDirectory(), 'scip-query-scip-'));
28
35
  try {
29
- execFileSync(probe, [binary], { stdio: 'ignore' });
30
- } catch {
31
- throw new Error(`Required command not found on PATH: ${binary}`);
32
- }
33
- }
36
+ const checkoutDir = join(workDir, 'scip');
37
+ const artifactDir = join(workDir, 'artifacts');
38
+ runtime.mkdir(artifactDir);
39
+
40
+ const goVersion = parseGoVersion(
41
+ runtime.run('go', ['version'], {
42
+ encoding: 'utf8',
43
+ stdio: ['ignore', 'pipe', 'pipe'],
44
+ }),
45
+ );
46
+ if (goVersion !== expectedGoVersion) {
47
+ throw new Error(
48
+ `Go toolchain mismatch: expected ${expectedGoVersion}, received ${goVersion}. ` +
49
+ `Install the pinned toolchain or intentionally update the provenance contract.`,
50
+ );
51
+ }
34
52
 
35
- assertAvailable('git');
36
- assertAvailable('go');
53
+ runtime.run('git', ['clone', '--depth', '1', '--branch', sourceTag, sourceRepository, checkoutDir], {
54
+ stdio: 'inherit',
55
+ });
56
+ const sourceCommit = runtime
57
+ .run('git', ['rev-parse', 'HEAD'], {
58
+ cwd: checkoutDir,
59
+ encoding: 'utf8',
60
+ stdio: ['ignore', 'pipe', 'pipe'],
61
+ })
62
+ .trim();
63
+
64
+ runtime.copyFile(join(checkoutDir, 'LICENSE'), join(artifactDir, 'LICENSE.scip'));
65
+ runtime.writeFile(
66
+ join(artifactDir, 'README.md'),
67
+ renderSidecarReadme({ sourceRepository, sourceTag, sourceCommit, goVersion }),
68
+ );
37
69
 
38
- const workDir = mkdtempSync(join(tmpdir(), 'scip-query-scip-'));
70
+ for (const target of WINDOWS_SIDECAR_TARGETS) {
71
+ const outputPath = join(artifactDir, target.filename);
72
+ runtime.run('go', ['build', ...WINDOWS_SIDECAR_BUILD.flags, '-o', outputPath, WINDOWS_SIDECAR_BUILD.package], {
73
+ cwd: checkoutDir,
74
+ env: {
75
+ ...process.env,
76
+ ...WINDOWS_SIDECAR_BUILD.environment,
77
+ GOARCH: target.goarch,
78
+ },
79
+ stdio: 'inherit',
80
+ });
81
+ }
39
82
 
40
- try {
41
- const checkoutDir = join(workDir, 'scip');
42
- run('git', ['clone', '--depth', '1', '--branch', SCIP_VERSION, SCIP_REPO_URL, checkoutDir]);
43
- mkdirSync(VENDOR_DIR, { recursive: true });
44
- copyFileSync(join(checkoutDir, 'LICENSE'), join(VENDOR_DIR, 'LICENSE.scip'));
45
- writeFileSync(
46
- join(VENDOR_DIR, 'README.md'),
47
- [
48
- '# Windows scip.exe npm sidecar',
49
- '',
50
- `These binaries are built from ${SCIP_REPO_URL} at ${SCIP_VERSION}.`,
51
- 'They are bundled in the OS-gated `scip-query-scip-windows` npm package. The main',
52
- '`scip-query` package declares that sidecar as an optional dependency, so npm',
53
- 'installs it automatically on Windows and `reindex` works without Go or WSL.',
54
- '',
55
- 'Run `npm run build:scip-windows` to rebuild the binaries. Publishing the main',
56
- 'package verifies the version pin, builds missing binaries, and publishes the',
57
- 'matching sidecar first.',
58
- '',
59
- ].join('\n'),
60
- );
83
+ const manifest = createWindowsSidecarProvenance({
84
+ sidecarDir: artifactDir,
85
+ packageName: sidecarPackage.name,
86
+ packageVersion: sidecarPackage.version,
87
+ sourceRepository,
88
+ sourceTag,
89
+ sourceCommit,
90
+ goVersion,
91
+ readFile: runtime.readFile,
92
+ });
93
+ runtime.writeFile(join(artifactDir, WINDOWS_SIDECAR_PROVENANCE_FILE), `${JSON.stringify(manifest, null, 2)}\n`);
61
94
 
62
- for (const target of TARGETS) {
63
- const outputPath = join(VENDOR_DIR, `scip-win32-${target.packageArch}.exe`);
64
- mkdirSync(VENDOR_DIR, { recursive: true });
95
+ for (const file of [
96
+ 'LICENSE.scip',
97
+ 'README.md',
98
+ ...WINDOWS_SIDECAR_TARGETS.map((target) => target.filename),
99
+ WINDOWS_SIDECAR_PROVENANCE_FILE,
100
+ ]) {
101
+ runtime.promoteFile(join(artifactDir, file), join(sidecarDir, file));
102
+ }
65
103
 
66
- run('go', ['build', '-trimpath', '-ldflags=-s -w', '-o', outputPath, './cmd/scip'], {
67
- cwd: checkoutDir,
68
- env: {
69
- ...process.env,
70
- CGO_ENABLED: '0',
71
- GOOS: 'windows',
72
- GOARCH: target.goarch,
73
- },
104
+ const verified = verifyWindowsSidecarProvenance({
105
+ sidecarDir,
106
+ expectedSourceRepository: sourceRepository,
107
+ expectedSourceTag: sourceTag,
108
+ expectedGoVersion,
109
+ readFile: runtime.readFile,
74
110
  });
111
+ runtime.log(
112
+ `Built and verified ${verified.package.name}@${verified.package.version} from ${sourceTag} (${sourceCommit.slice(0, 12)}).`,
113
+ );
114
+ return verified;
115
+ } finally {
116
+ runtime.removeTree(workDir);
117
+ }
118
+ }
119
+
120
+ export function createBuildRuntime() {
121
+ return {
122
+ assertAvailable(binary) {
123
+ const probe = process.platform === 'win32' ? 'where' : 'which';
124
+ try {
125
+ execFileSync(probe, [binary], { stdio: 'ignore' });
126
+ } catch {
127
+ throw new Error(`Required command not found on PATH: ${binary}`);
128
+ }
129
+ },
130
+ copyFile: copyFileSync,
131
+ log: console.log,
132
+ makeTempDirectory: mkdtempSync,
133
+ mkdir(path) {
134
+ mkdirSync(path, { recursive: true });
135
+ },
136
+ promoteFile(source, destination) {
137
+ mkdirSync(dirname(destination), { recursive: true });
138
+ const staging = join(dirname(destination), `.${basename(destination)}.${process.pid}.tmp`);
139
+ try {
140
+ copyFileSync(source, staging);
141
+ renameSync(staging, destination);
142
+ } finally {
143
+ rmSync(staging, { force: true });
144
+ }
145
+ },
146
+ readFile: readFileSync,
147
+ removeTree(path) {
148
+ rmSync(path, { recursive: true, force: true });
149
+ },
150
+ run(binary, args, options = {}) {
151
+ console.log(`$ ${binary} ${args.join(' ')}`);
152
+ return execFileSync(binary, args, options);
153
+ },
154
+ tempDirectory: tmpdir,
155
+ writeFile: writeFileSync,
156
+ };
157
+ }
158
+
159
+ export function parseGoVersion(output) {
160
+ const match = /\b(go\d+(?:\.\d+){1,2}(?:[a-z0-9.-]*)?)\b/.exec(String(output));
161
+ if (!match) {
162
+ throw new Error(`Could not parse Go toolchain version from: ${String(output).trim()}`);
163
+ }
164
+ return match[1];
165
+ }
166
+
167
+ export function renderSidecarReadme({ sourceRepository, sourceTag, sourceCommit, goVersion }) {
168
+ return [
169
+ '# Windows scip.exe npm sidecar',
170
+ '',
171
+ `These binaries are built from ${sourceRepository} at ${sourceTag}`,
172
+ `(${sourceCommit}) with ${goVersion}.`,
173
+ 'They are bundled in the OS-gated `scip-query-scip-windows` npm package. The main',
174
+ '`scip-query` package declares that sidecar as an optional dependency, so npm',
175
+ 'installs it automatically on Windows and `reindex` works without Go or WSL.',
176
+ '',
177
+ `\`${WINDOWS_SIDECAR_PROVENANCE_FILE}\` binds the package version and exact source,`,
178
+ 'toolchain, build flags, target machine, file size, and SHA-256 for both binaries.',
179
+ 'Build, pack, and publish checks reject missing or mismatched evidence.',
180
+ '',
181
+ 'Run `npm run build:scip-windows` to rebuild the binaries and provenance manifest.',
182
+ 'Review and commit the manifest change before release. Publishing the main package',
183
+ 'verifies the version pin and the complete sidecar provenance before any registry',
184
+ 'decision.',
185
+ '',
186
+ ].join('\n');
187
+ }
188
+
189
+ const invokedPath = process.argv[1] ? resolve(process.argv[1]) : null;
190
+ if (invokedPath === fileURLToPath(import.meta.url)) {
191
+ try {
192
+ buildScipWindowsSidecar();
193
+ } catch (error) {
194
+ console.error(`Windows sidecar build FAILED:\n - ${error instanceof Error ? error.message : String(error)}`);
195
+ process.exitCode = 1;
75
196
  }
76
- } finally {
77
- rmSync(workDir, { recursive: true, force: true });
78
197
  }
@@ -0,0 +1,364 @@
1
+ import { createHash } from 'node:crypto';
2
+ import { readFileSync } from 'node:fs';
3
+ import { join } from 'node:path';
4
+
5
+ export const WINDOWS_SIDECAR_PROVENANCE_KIND = 'scip-query-windows-sidecar-provenance';
6
+ export const WINDOWS_SIDECAR_PROVENANCE_VERSION = 1;
7
+ export const WINDOWS_SIDECAR_PROVENANCE_FILE = 'provenance.json';
8
+ export const DEFAULT_SCIP_REPOSITORY = 'https://github.com/scip-code/scip.git';
9
+ export const DEFAULT_SCIP_TAG = 'v0.8.1';
10
+ export const PINNED_GO_VERSION = 'go1.26.4';
11
+
12
+ export const WINDOWS_SIDECAR_BUILD = Object.freeze({
13
+ command: 'go build',
14
+ package: './cmd/scip',
15
+ flags: Object.freeze(['-trimpath', '-ldflags=-s -w']),
16
+ environment: Object.freeze({
17
+ CGO_ENABLED: '0',
18
+ GOOS: 'windows',
19
+ }),
20
+ });
21
+
22
+ export const WINDOWS_SIDECAR_TARGETS = Object.freeze([
23
+ Object.freeze({
24
+ goarch: 'amd64',
25
+ packageArch: 'x64',
26
+ filename: 'scip-win32-x64.exe',
27
+ peMachine: 'AMD64',
28
+ peMachineCode: 0x8664,
29
+ }),
30
+ Object.freeze({
31
+ goarch: 'arm64',
32
+ packageArch: 'arm64',
33
+ filename: 'scip-win32-arm64.exe',
34
+ peMachine: 'ARM64',
35
+ peMachineCode: 0xaa64,
36
+ }),
37
+ ]);
38
+
39
+ export class WindowsSidecarProvenanceError extends Error {
40
+ constructor(code, message) {
41
+ super(message);
42
+ this.name = 'WindowsSidecarProvenanceError';
43
+ this.code = code;
44
+ }
45
+ }
46
+
47
+ export function sha256(bytes) {
48
+ return createHash('sha256').update(bytes).digest('hex');
49
+ }
50
+
51
+ export function inspectPortableExecutable(bytes, filename = '<binary>') {
52
+ if (!Buffer.isBuffer(bytes) || bytes.length < 0x40) {
53
+ throw provenanceError('malformed-binary', `${filename} is too short to be a PE executable.`);
54
+ }
55
+ if (bytes[0] !== 0x4d || bytes[1] !== 0x5a) {
56
+ throw provenanceError('malformed-binary', `${filename} is missing the DOS MZ signature.`);
57
+ }
58
+
59
+ const peOffset = bytes.readUInt32LE(0x3c);
60
+ if (!Number.isSafeInteger(peOffset) || peOffset < 0x40 || peOffset + 26 > bytes.length) {
61
+ throw provenanceError('malformed-binary', `${filename} has an invalid PE header offset.`);
62
+ }
63
+ if (
64
+ bytes[peOffset] !== 0x50 ||
65
+ bytes[peOffset + 1] !== 0x45 ||
66
+ bytes[peOffset + 2] !== 0 ||
67
+ bytes[peOffset + 3] !== 0
68
+ ) {
69
+ throw provenanceError('malformed-binary', `${filename} is missing the PE signature.`);
70
+ }
71
+
72
+ const machineCode = bytes.readUInt16LE(peOffset + 4);
73
+ const target = WINDOWS_SIDECAR_TARGETS.find((candidate) => candidate.peMachineCode === machineCode);
74
+ if (!target) {
75
+ throw provenanceError(
76
+ 'wrong-architecture',
77
+ `${filename} has unsupported PE machine 0x${machineCode.toString(16).padStart(4, '0')}.`,
78
+ );
79
+ }
80
+
81
+ const optionalHeaderMagic = bytes.readUInt16LE(peOffset + 24);
82
+ if (optionalHeaderMagic !== 0x20b) {
83
+ throw provenanceError(
84
+ 'malformed-binary',
85
+ `${filename} is not a PE32+ executable (optional-header magic 0x${optionalHeaderMagic
86
+ .toString(16)
87
+ .padStart(4, '0')}).`,
88
+ );
89
+ }
90
+
91
+ return {
92
+ peMachine: target.peMachine,
93
+ peMachineCode: `0x${machineCode.toString(16).padStart(4, '0')}`,
94
+ };
95
+ }
96
+
97
+ export function inspectWindowsSidecarBinary(file, readFile = readFileSync) {
98
+ const bytes = readFile(file);
99
+ const pe = inspectPortableExecutable(bytes, file);
100
+ return {
101
+ size: bytes.length,
102
+ sha256: sha256(bytes),
103
+ ...pe,
104
+ };
105
+ }
106
+
107
+ export function createWindowsSidecarProvenance({
108
+ sidecarDir,
109
+ packageName,
110
+ packageVersion,
111
+ sourceRepository = DEFAULT_SCIP_REPOSITORY,
112
+ sourceTag = DEFAULT_SCIP_TAG,
113
+ sourceCommit,
114
+ goVersion = PINNED_GO_VERSION,
115
+ readFile = readFileSync,
116
+ }) {
117
+ if (!isCommit(sourceCommit)) {
118
+ throw provenanceError('invalid-build-input', `Source commit must be a full 40-character Git commit.`);
119
+ }
120
+
121
+ return {
122
+ kind: WINDOWS_SIDECAR_PROVENANCE_KIND,
123
+ schemaVersion: WINDOWS_SIDECAR_PROVENANCE_VERSION,
124
+ package: {
125
+ name: packageName,
126
+ version: packageVersion,
127
+ },
128
+ source: {
129
+ repository: sourceRepository,
130
+ tag: sourceTag,
131
+ commit: sourceCommit,
132
+ },
133
+ toolchain: {
134
+ goVersion,
135
+ },
136
+ build: {
137
+ command: WINDOWS_SIDECAR_BUILD.command,
138
+ package: WINDOWS_SIDECAR_BUILD.package,
139
+ flags: [...WINDOWS_SIDECAR_BUILD.flags],
140
+ environment: {
141
+ ...WINDOWS_SIDECAR_BUILD.environment,
142
+ },
143
+ },
144
+ binaries: WINDOWS_SIDECAR_TARGETS.map((target) => {
145
+ const inspected = inspectWindowsSidecarBinary(join(sidecarDir, target.filename), readFile);
146
+ if (inspected.peMachine !== target.peMachine) {
147
+ throw provenanceError(
148
+ 'wrong-architecture',
149
+ `${target.filename} declares ${target.packageArch} but contains ${inspected.peMachine}.`,
150
+ );
151
+ }
152
+ return {
153
+ filename: target.filename,
154
+ target: {
155
+ goos: 'windows',
156
+ goarch: target.goarch,
157
+ packageArch: target.packageArch,
158
+ },
159
+ size: inspected.size,
160
+ sha256: inspected.sha256,
161
+ peMachine: inspected.peMachine,
162
+ peMachineCode: inspected.peMachineCode,
163
+ };
164
+ }),
165
+ };
166
+ }
167
+
168
+ export function verifyWindowsSidecarProvenance({
169
+ sidecarDir,
170
+ expectedSourceRepository = DEFAULT_SCIP_REPOSITORY,
171
+ expectedSourceTag = DEFAULT_SCIP_TAG,
172
+ expectedGoVersion = PINNED_GO_VERSION,
173
+ readFile = readFileSync,
174
+ }) {
175
+ const packageRecord = parseJsonFile(join(sidecarDir, 'package.json'), 'sidecar package', readFile);
176
+ const manifest = parseJsonFile(
177
+ join(sidecarDir, WINDOWS_SIDECAR_PROVENANCE_FILE),
178
+ 'sidecar provenance manifest',
179
+ readFile,
180
+ );
181
+ const decoded = decodeWindowsSidecarProvenance(manifest);
182
+
183
+ requireEqual(decoded.package.name, packageRecord.name, 'package name');
184
+ requireEqual(decoded.package.version, packageRecord.version, 'package version');
185
+ requireEqual(decoded.source.repository, expectedSourceRepository, 'SCIP source repository');
186
+ requireEqual(decoded.source.tag, expectedSourceTag, 'SCIP source tag');
187
+ requireEqual(decoded.toolchain.goVersion, expectedGoVersion, 'pinned Go version');
188
+ requireBuildContract(decoded.build);
189
+
190
+ const entries = new Map(decoded.binaries.map((binary) => [binary.filename, binary]));
191
+ for (const target of WINDOWS_SIDECAR_TARGETS) {
192
+ const expected = entries.get(target.filename);
193
+ if (!expected) {
194
+ throw provenanceError('malformed-manifest', `Manifest is missing ${target.filename}.`);
195
+ }
196
+
197
+ requireEqual(expected.target.goos, 'windows', `${target.filename} GOOS`);
198
+ requireEqual(expected.target.goarch, target.goarch, `${target.filename} GOARCH`);
199
+ requireEqual(expected.target.packageArch, target.packageArch, `${target.filename} package arch`);
200
+ requireEqual(expected.peMachine, target.peMachine, `${target.filename} PE machine`);
201
+ requireEqual(
202
+ expected.peMachineCode,
203
+ `0x${target.peMachineCode.toString(16).padStart(4, '0')}`,
204
+ `${target.filename} PE machine code`,
205
+ );
206
+
207
+ let actual;
208
+ try {
209
+ actual = inspectWindowsSidecarBinary(join(sidecarDir, target.filename), readFile);
210
+ } catch (error) {
211
+ if (error?.code === 'ENOENT') {
212
+ throw provenanceError('missing-binary', `${target.filename} is missing.`);
213
+ }
214
+ throw error;
215
+ }
216
+ requireEqual(actual.peMachine, target.peMachine, `${target.filename} actual PE machine`);
217
+ requireEqual(actual.size, expected.size, `${target.filename} byte size`);
218
+ requireEqual(actual.sha256, expected.sha256, `${target.filename} SHA-256`);
219
+ }
220
+
221
+ return decoded;
222
+ }
223
+
224
+ export function decodeWindowsSidecarProvenance(value) {
225
+ const record = requireRecord(value, 'manifest');
226
+ requireEqual(record.kind, WINDOWS_SIDECAR_PROVENANCE_KIND, 'manifest kind');
227
+ if (record.schemaVersion !== WINDOWS_SIDECAR_PROVENANCE_VERSION) {
228
+ throw provenanceError(
229
+ 'unsupported-manifest',
230
+ `Unsupported Windows sidecar provenance schema ${String(record.schemaVersion)}; expected ${WINDOWS_SIDECAR_PROVENANCE_VERSION}.`,
231
+ );
232
+ }
233
+
234
+ const packageRecord = requireRecord(record.package, 'package');
235
+ const source = requireRecord(record.source, 'source');
236
+ const toolchain = requireRecord(record.toolchain, 'toolchain');
237
+ const build = requireRecord(record.build, 'build');
238
+ if (!Array.isArray(record.binaries) || record.binaries.length !== WINDOWS_SIDECAR_TARGETS.length) {
239
+ throw provenanceError(
240
+ 'malformed-manifest',
241
+ `binaries must contain exactly ${WINDOWS_SIDECAR_TARGETS.length} entries.`,
242
+ );
243
+ }
244
+
245
+ const binaries = record.binaries.map((value, index) => {
246
+ const binary = requireRecord(value, `binaries[${index}]`);
247
+ const target = requireRecord(binary.target, `binaries[${index}].target`);
248
+ requireNonEmptyString(binary.filename, `binaries[${index}].filename`);
249
+ requireNonEmptyString(target.goos, `binaries[${index}].target.goos`);
250
+ requireNonEmptyString(target.goarch, `binaries[${index}].target.goarch`);
251
+ requireNonEmptyString(target.packageArch, `binaries[${index}].target.packageArch`);
252
+ requirePositiveSafeInteger(binary.size, `binaries[${index}].size`);
253
+ if (typeof binary.sha256 !== 'string' || !/^[a-f0-9]{64}$/.test(binary.sha256)) {
254
+ throw provenanceError('malformed-manifest', `binaries[${index}].sha256 must be lowercase SHA-256.`);
255
+ }
256
+ requireNonEmptyString(binary.peMachine, `binaries[${index}].peMachine`);
257
+ if (typeof binary.peMachineCode !== 'string' || !/^0x[a-f0-9]{4}$/.test(binary.peMachineCode)) {
258
+ throw provenanceError(
259
+ 'malformed-manifest',
260
+ `binaries[${index}].peMachineCode must be a four-digit hexadecimal code.`,
261
+ );
262
+ }
263
+ return binary;
264
+ });
265
+
266
+ requireNonEmptyString(packageRecord.name, 'package.name');
267
+ requireNonEmptyString(packageRecord.version, 'package.version');
268
+ requireNonEmptyString(source.repository, 'source.repository');
269
+ requireNonEmptyString(source.tag, 'source.tag');
270
+ if (!isCommit(source.commit)) {
271
+ throw provenanceError('malformed-manifest', `source.commit must be a full 40-character Git commit.`);
272
+ }
273
+ requireNonEmptyString(toolchain.goVersion, 'toolchain.goVersion');
274
+ requireNonEmptyString(build.command, 'build.command');
275
+ requireNonEmptyString(build.package, 'build.package');
276
+ if (!Array.isArray(build.flags) || !build.flags.every((flag) => typeof flag === 'string')) {
277
+ throw provenanceError('malformed-manifest', `build.flags must be an array of strings.`);
278
+ }
279
+ requireRecord(build.environment, 'build.environment');
280
+
281
+ const filenames = binaries.map((binary) => binary.filename);
282
+ if (new Set(filenames).size !== filenames.length) {
283
+ throw provenanceError('malformed-manifest', `binaries contains duplicate filenames.`);
284
+ }
285
+
286
+ return {
287
+ ...record,
288
+ package: packageRecord,
289
+ source,
290
+ toolchain,
291
+ build,
292
+ binaries,
293
+ };
294
+ }
295
+
296
+ function requireBuildContract(build) {
297
+ requireEqual(build.command, WINDOWS_SIDECAR_BUILD.command, 'build command');
298
+ requireEqual(build.package, WINDOWS_SIDECAR_BUILD.package, 'build package');
299
+ if (JSON.stringify(build.flags) !== JSON.stringify(WINDOWS_SIDECAR_BUILD.flags)) {
300
+ throw provenanceError(
301
+ 'build-input-mismatch',
302
+ `Build flags do not match the pinned contract (${WINDOWS_SIDECAR_BUILD.flags.join(' ')}).`,
303
+ );
304
+ }
305
+ const environment = requireRecord(build.environment, 'build.environment');
306
+ requireEqual(environment.CGO_ENABLED, WINDOWS_SIDECAR_BUILD.environment.CGO_ENABLED, 'CGO_ENABLED');
307
+ requireEqual(environment.GOOS, WINDOWS_SIDECAR_BUILD.environment.GOOS, 'GOOS');
308
+ }
309
+
310
+ function parseJsonFile(file, label, readFile) {
311
+ let bytes;
312
+ try {
313
+ bytes = readFile(file);
314
+ } catch (error) {
315
+ if (error?.code === 'ENOENT') {
316
+ throw provenanceError(
317
+ label === 'sidecar provenance manifest' ? 'missing-manifest' : 'missing-package',
318
+ `${label} is missing at ${file}.`,
319
+ );
320
+ }
321
+ throw error;
322
+ }
323
+ try {
324
+ return JSON.parse(bytes.toString('utf8'));
325
+ } catch {
326
+ throw provenanceError('malformed-manifest', `${label} is not valid JSON at ${file}.`);
327
+ }
328
+ }
329
+
330
+ function requireRecord(value, field) {
331
+ if (value === null || typeof value !== 'object' || Array.isArray(value)) {
332
+ throw provenanceError('malformed-manifest', `${field} must be an object.`);
333
+ }
334
+ return value;
335
+ }
336
+
337
+ function requireNonEmptyString(value, field) {
338
+ if (typeof value !== 'string' || value.trim().length === 0) {
339
+ throw provenanceError('malformed-manifest', `${field} must be a non-empty string.`);
340
+ }
341
+ }
342
+
343
+ function requirePositiveSafeInteger(value, field) {
344
+ if (typeof value !== 'number' || !Number.isSafeInteger(value) || value <= 0) {
345
+ throw provenanceError('malformed-manifest', `${field} must be a positive safe integer.`);
346
+ }
347
+ }
348
+
349
+ function requireEqual(actual, expected, field) {
350
+ if (actual !== expected) {
351
+ throw provenanceError(
352
+ 'build-input-mismatch',
353
+ `${field} mismatch: expected ${JSON.stringify(expected)}, received ${JSON.stringify(actual)}.`,
354
+ );
355
+ }
356
+ }
357
+
358
+ function isCommit(value) {
359
+ return typeof value === 'string' && /^[a-f0-9]{40}$/.test(value);
360
+ }
361
+
362
+ function provenanceError(code, message) {
363
+ return new WindowsSidecarProvenanceError(code, message);
364
+ }
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env node
2
+ import { dirname, resolve } from 'node:path';
3
+ import { fileURLToPath } from 'node:url';
4
+ import {
5
+ DEFAULT_SCIP_REPOSITORY,
6
+ DEFAULT_SCIP_TAG,
7
+ PINNED_GO_VERSION,
8
+ verifyWindowsSidecarProvenance,
9
+ } from './scip-windows-provenance.mjs';
10
+
11
+ const root = resolve(dirname(fileURLToPath(import.meta.url)), '..');
12
+ const sidecarDir = resolve(root, 'packages', 'scip-windows');
13
+
14
+ try {
15
+ const manifest = verifyWindowsSidecarProvenance({
16
+ sidecarDir,
17
+ expectedSourceRepository: process.env.SCIP_REPO_URL ?? DEFAULT_SCIP_REPOSITORY,
18
+ expectedSourceTag: process.env.SCIP_VERSION ?? DEFAULT_SCIP_TAG,
19
+ expectedGoVersion: process.env.SCIP_GO_VERSION ?? PINNED_GO_VERSION,
20
+ });
21
+ console.log(
22
+ `Verified ${manifest.package.name}@${manifest.package.version}: ${manifest.source.tag} (${manifest.source.commit.slice(0, 12)}), ${manifest.toolchain.goVersion}, ${manifest.binaries.length} PE binaries.`,
23
+ );
24
+ } catch (error) {
25
+ console.error(
26
+ `Windows sidecar provenance check FAILED:\n - ${error instanceof Error ? error.message : String(error)}`,
27
+ );
28
+ process.exitCode = 1;
29
+ }