@sun-asterisk/sungen 3.2.34-beta.1 → 3.3.0-alpha.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 (858) hide show
  1. package/dist/basis/anchor-grammar.d.ts +32 -0
  2. package/dist/basis/anchor-grammar.d.ts.map +1 -0
  3. package/dist/basis/anchor-grammar.js +82 -0
  4. package/dist/basis/anchor-grammar.js.map +1 -0
  5. package/dist/basis/anchor-hash.d.ts +6 -0
  6. package/dist/basis/anchor-hash.d.ts.map +1 -0
  7. package/dist/basis/anchor-hash.js +28 -0
  8. package/dist/basis/anchor-hash.js.map +1 -0
  9. package/dist/basis/bm51-tables.d.ts +20 -0
  10. package/dist/basis/bm51-tables.d.ts.map +1 -0
  11. package/dist/basis/bm51-tables.js +71 -0
  12. package/dist/basis/bm51-tables.js.map +1 -0
  13. package/dist/basis/extract-spec-anchors.d.ts +39 -0
  14. package/dist/basis/extract-spec-anchors.d.ts.map +1 -0
  15. package/dist/basis/extract-spec-anchors.js +81 -0
  16. package/dist/basis/extract-spec-anchors.js.map +1 -0
  17. package/dist/basis/migration-sentinel.d.ts +47 -0
  18. package/dist/basis/migration-sentinel.d.ts.map +1 -0
  19. package/dist/basis/migration-sentinel.js +219 -0
  20. package/dist/basis/migration-sentinel.js.map +1 -0
  21. package/dist/basis/spec-frontmatter.d.ts +18 -0
  22. package/dist/basis/spec-frontmatter.d.ts.map +1 -0
  23. package/dist/basis/spec-frontmatter.js +55 -0
  24. package/dist/basis/spec-frontmatter.js.map +1 -0
  25. package/dist/basis/spec-sections.d.ts +18 -0
  26. package/dist/basis/spec-sections.d.ts.map +1 -0
  27. package/dist/basis/spec-sections.js +27 -0
  28. package/dist/basis/spec-sections.js.map +1 -0
  29. package/dist/basis/test-basis-schema.d.ts +28 -0
  30. package/dist/basis/test-basis-schema.d.ts.map +1 -0
  31. package/dist/basis/test-basis-schema.js +141 -0
  32. package/dist/basis/test-basis-schema.js.map +1 -0
  33. package/dist/capabilities/registry.d.ts +15 -0
  34. package/dist/capabilities/registry.d.ts.map +1 -1
  35. package/dist/capabilities/registry.js.map +1 -1
  36. package/dist/cli/commands/audit.d.ts.map +1 -1
  37. package/dist/cli/commands/audit.js +3 -29
  38. package/dist/cli/commands/audit.js.map +1 -1
  39. package/dist/cli/commands/capability.js +1 -1
  40. package/dist/cli/commands/capability.js.map +1 -1
  41. package/dist/cli/commands/contract-derive-command.d.ts +10 -0
  42. package/dist/cli/commands/contract-derive-command.d.ts.map +1 -0
  43. package/dist/cli/commands/contract-derive-command.js +99 -0
  44. package/dist/cli/commands/contract-derive-command.js.map +1 -0
  45. package/dist/cli/commands/contract.d.ts +17 -0
  46. package/dist/cli/commands/contract.d.ts.map +1 -0
  47. package/dist/cli/commands/contract.js +162 -0
  48. package/dist/cli/commands/contract.js.map +1 -0
  49. package/dist/cli/commands/delivery.d.ts.map +1 -1
  50. package/dist/cli/commands/delivery.js +52 -3
  51. package/dist/cli/commands/delivery.js.map +1 -1
  52. package/dist/cli/commands/generate.d.ts.map +1 -1
  53. package/dist/cli/commands/generate.js +3 -1
  54. package/dist/cli/commands/generate.js.map +1 -1
  55. package/dist/cli/commands/journey.d.ts.map +1 -1
  56. package/dist/cli/commands/journey.js +41 -13
  57. package/dist/cli/commands/journey.js.map +1 -1
  58. package/dist/cli/commands/next.d.ts +8 -0
  59. package/dist/cli/commands/next.d.ts.map +1 -1
  60. package/dist/cli/commands/next.js +64 -6
  61. package/dist/cli/commands/next.js.map +1 -1
  62. package/dist/cli/commands/update.d.ts +11 -0
  63. package/dist/cli/commands/update.d.ts.map +1 -1
  64. package/dist/cli/commands/update.js +31 -6
  65. package/dist/cli/commands/update.js.map +1 -1
  66. package/dist/cli/index.js +20 -35
  67. package/dist/cli/index.js.map +1 -1
  68. package/dist/contract/approve-contract.d.ts +31 -0
  69. package/dist/contract/approve-contract.d.ts.map +1 -0
  70. package/dist/contract/approve-contract.js +87 -0
  71. package/dist/contract/approve-contract.js.map +1 -0
  72. package/dist/contract/assertion-matcher-vocabulary.d.ts +24 -0
  73. package/dist/contract/assertion-matcher-vocabulary.d.ts.map +1 -0
  74. package/dist/contract/assertion-matcher-vocabulary.js +100 -0
  75. package/dist/contract/assertion-matcher-vocabulary.js.map +1 -0
  76. package/dist/contract/build-contract-verdict.d.ts +32 -0
  77. package/dist/contract/build-contract-verdict.d.ts.map +1 -0
  78. package/dist/contract/build-contract-verdict.js +123 -0
  79. package/dist/contract/build-contract-verdict.js.map +1 -0
  80. package/dist/contract/build-trace-conformance.d.ts +18 -0
  81. package/dist/contract/build-trace-conformance.d.ts.map +1 -0
  82. package/dist/contract/build-trace-conformance.js +153 -0
  83. package/dist/contract/build-trace-conformance.js.map +1 -0
  84. package/dist/contract/classify-contract-change.d.ts +23 -0
  85. package/dist/contract/classify-contract-change.d.ts.map +1 -0
  86. package/dist/contract/classify-contract-change.js +98 -0
  87. package/dist/contract/classify-contract-change.js.map +1 -0
  88. package/dist/contract/classify-contract-unit.d.ts +18 -0
  89. package/dist/contract/classify-contract-unit.d.ts.map +1 -0
  90. package/dist/contract/classify-contract-unit.js +49 -0
  91. package/dist/contract/classify-contract-unit.js.map +1 -0
  92. package/dist/contract/classify-trace-conformance.d.ts +32 -0
  93. package/dist/contract/classify-trace-conformance.d.ts.map +1 -0
  94. package/dist/contract/classify-trace-conformance.js +117 -0
  95. package/dist/contract/classify-trace-conformance.js.map +1 -0
  96. package/dist/contract/contract-git.d.ts +24 -0
  97. package/dist/contract/contract-git.d.ts.map +1 -0
  98. package/dist/contract/contract-git.js +144 -0
  99. package/dist/contract/contract-git.js.map +1 -0
  100. package/dist/contract/contract-hash.d.ts +7 -0
  101. package/dist/contract/contract-hash.d.ts.map +1 -0
  102. package/dist/contract/contract-hash.js +38 -0
  103. package/dist/contract/contract-hash.js.map +1 -0
  104. package/dist/contract/contract-report-file.d.ts +4 -0
  105. package/dist/contract/contract-report-file.d.ts.map +1 -0
  106. package/dist/contract/contract-report-file.js +60 -0
  107. package/dist/contract/contract-report-file.js.map +1 -0
  108. package/dist/contract/contract-schema.d.ts +71 -0
  109. package/dist/contract/contract-schema.d.ts.map +1 -0
  110. package/dist/contract/contract-schema.js +102 -0
  111. package/dist/contract/contract-schema.js.map +1 -0
  112. package/dist/contract/contract-units.d.ts +12 -0
  113. package/dist/contract/contract-units.d.ts.map +1 -0
  114. package/dist/contract/contract-units.js +96 -0
  115. package/dist/contract/contract-units.js.map +1 -0
  116. package/dist/contract/contracts-lock-file.d.ts +24 -0
  117. package/dist/contract/contracts-lock-file.d.ts.map +1 -0
  118. package/dist/contract/contracts-lock-file.js +140 -0
  119. package/dist/contract/contracts-lock-file.js.map +1 -0
  120. package/dist/contract/data-normalize.d.ts +10 -0
  121. package/dist/contract/data-normalize.d.ts.map +1 -0
  122. package/dist/contract/data-normalize.js +110 -0
  123. package/dist/contract/data-normalize.js.map +1 -0
  124. package/dist/contract/derive-free-feature.d.ts +30 -0
  125. package/dist/contract/derive-free-feature.d.ts.map +1 -0
  126. package/dist/contract/derive-free-feature.js +145 -0
  127. package/dist/contract/derive-free-feature.js.map +1 -0
  128. package/dist/contract/field-semantic-redaction.d.ts +21 -0
  129. package/dist/contract/field-semantic-redaction.d.ts.map +1 -0
  130. package/dist/contract/field-semantic-redaction.js +118 -0
  131. package/dist/contract/field-semantic-redaction.js.map +1 -0
  132. package/dist/contract/free-feature-blocks.d.ts +10 -0
  133. package/dist/contract/free-feature-blocks.d.ts.map +1 -0
  134. package/dist/contract/free-feature-blocks.js +94 -0
  135. package/dist/contract/free-feature-blocks.js.map +1 -0
  136. package/dist/contract/lock-secret-guard.d.ts +22 -0
  137. package/dist/contract/lock-secret-guard.d.ts.map +1 -0
  138. package/dist/contract/lock-secret-guard.js +134 -0
  139. package/dist/contract/lock-secret-guard.js.map +1 -0
  140. package/dist/contract/lock-vs-git-head.d.ts +26 -0
  141. package/dist/contract/lock-vs-git-head.d.ts.map +1 -0
  142. package/dist/contract/lock-vs-git-head.js +28 -0
  143. package/dist/contract/lock-vs-git-head.js.map +1 -0
  144. package/dist/contract/normalize-contract-step.d.ts +21 -0
  145. package/dist/contract/normalize-contract-step.d.ts.map +1 -0
  146. package/dist/contract/normalize-contract-step.js +70 -0
  147. package/dist/contract/normalize-contract-step.js.map +1 -0
  148. package/dist/contract/normalize-feature-steps.d.ts +7 -0
  149. package/dist/contract/normalize-feature-steps.d.ts.map +1 -0
  150. package/dist/contract/normalize-feature-steps.js +127 -0
  151. package/dist/contract/normalize-feature-steps.js.map +1 -0
  152. package/dist/contract/oracle-strength.d.ts +12 -0
  153. package/dist/contract/oracle-strength.d.ts.map +1 -0
  154. package/dist/contract/oracle-strength.js +88 -0
  155. package/dist/contract/oracle-strength.js.map +1 -0
  156. package/dist/contract/project-contract-blockers.d.ts +10 -0
  157. package/dist/contract/project-contract-blockers.d.ts.map +1 -0
  158. package/dist/contract/project-contract-blockers.js +73 -0
  159. package/dist/contract/project-contract-blockers.js.map +1 -0
  160. package/dist/contract/record-contract-approval.d.ts +21 -0
  161. package/dist/contract/record-contract-approval.d.ts.map +1 -0
  162. package/dist/contract/record-contract-approval.js +98 -0
  163. package/dist/contract/record-contract-approval.js.map +1 -0
  164. package/dist/contract/render-free-gherkin.d.ts +40 -0
  165. package/dist/contract/render-free-gherkin.d.ts.map +1 -0
  166. package/dist/contract/render-free-gherkin.js +141 -0
  167. package/dist/contract/render-free-gherkin.js.map +1 -0
  168. package/dist/contract/render-trace-sentence.d.ts +20 -0
  169. package/dist/contract/render-trace-sentence.d.ts.map +1 -0
  170. package/dist/contract/render-trace-sentence.js +109 -0
  171. package/dist/contract/render-trace-sentence.js.map +1 -0
  172. package/dist/contract/render-trace-target.d.ts +14 -0
  173. package/dist/contract/render-trace-target.d.ts.map +1 -0
  174. package/dist/contract/render-trace-target.js +70 -0
  175. package/dist/contract/render-trace-target.js.map +1 -0
  176. package/dist/contract/resolve-unit-trace-identities.d.ts +8 -0
  177. package/dist/contract/resolve-unit-trace-identities.d.ts.map +1 -0
  178. package/dist/contract/resolve-unit-trace-identities.js +78 -0
  179. package/dist/contract/resolve-unit-trace-identities.js.map +1 -0
  180. package/dist/contract/trace/collect-trace-evidence.d.ts +33 -0
  181. package/dist/contract/trace/collect-trace-evidence.d.ts.map +1 -0
  182. package/dist/contract/trace/collect-trace-evidence.js +161 -0
  183. package/dist/contract/trace/collect-trace-evidence.js.map +1 -0
  184. package/dist/contract/trace/identity-cache.d.ts +19 -0
  185. package/dist/contract/trace/identity-cache.d.ts.map +1 -0
  186. package/dist/contract/trace/identity-cache.js +104 -0
  187. package/dist/contract/trace/identity-cache.js.map +1 -0
  188. package/dist/contract/trace/select-final-attempt.d.ts +27 -0
  189. package/dist/contract/trace/select-final-attempt.d.ts.map +1 -0
  190. package/dist/contract/trace/select-final-attempt.js +116 -0
  191. package/dist/contract/trace/select-final-attempt.js.map +1 -0
  192. package/dist/contract/trace/snapshot-html-renderer.d.ts +31 -0
  193. package/dist/contract/trace/snapshot-html-renderer.d.ts.map +1 -0
  194. package/dist/contract/trace/snapshot-html-renderer.js +172 -0
  195. package/dist/contract/trace/snapshot-html-renderer.js.map +1 -0
  196. package/dist/contract/trace/snapshot-resolver.d.ts +21 -0
  197. package/dist/contract/trace/snapshot-resolver.d.ts.map +1 -0
  198. package/dist/contract/trace/snapshot-resolver.js +65 -0
  199. package/dist/contract/trace/snapshot-resolver.js.map +1 -0
  200. package/dist/contract/trace/snapshot-store.d.ts +66 -0
  201. package/dist/contract/trace/snapshot-store.d.ts.map +1 -0
  202. package/dist/contract/trace/snapshot-store.js +173 -0
  203. package/dist/contract/trace/snapshot-store.js.map +1 -0
  204. package/dist/contract/trace/target-identity.d.ts +74 -0
  205. package/dist/contract/trace/target-identity.d.ts.map +1 -0
  206. package/dist/contract/trace/target-identity.js +68 -0
  207. package/dist/contract/trace/target-identity.js.map +1 -0
  208. package/dist/contract/trace/test-step-join.d.ts +65 -0
  209. package/dist/contract/trace/test-step-join.d.ts.map +1 -0
  210. package/dist/contract/trace/test-step-join.js +80 -0
  211. package/dist/contract/trace/test-step-join.js.map +1 -0
  212. package/dist/contract/trace/trace-binding.d.ts +21 -0
  213. package/dist/contract/trace/trace-binding.d.ts.map +1 -0
  214. package/dist/contract/trace/trace-binding.js +88 -0
  215. package/dist/contract/trace/trace-binding.js.map +1 -0
  216. package/dist/contract/trace/trace-file-reader.d.ts +35 -0
  217. package/dist/contract/trace/trace-file-reader.d.ts.map +1 -0
  218. package/dist/contract/trace/trace-file-reader.js +155 -0
  219. package/dist/contract/trace/trace-file-reader.js.map +1 -0
  220. package/dist/contract/trace/trace-fingerprint.d.ts +22 -0
  221. package/dist/contract/trace/trace-fingerprint.d.ts.map +1 -0
  222. package/dist/contract/trace/trace-fingerprint.js +96 -0
  223. package/dist/contract/trace/trace-fingerprint.js.map +1 -0
  224. package/dist/contract/trace/trace-identity-resolution.d.ts +26 -0
  225. package/dist/contract/trace/trace-identity-resolution.d.ts.map +1 -0
  226. package/dist/contract/trace/trace-identity-resolution.js +84 -0
  227. package/dist/contract/trace/trace-identity-resolution.js.map +1 -0
  228. package/dist/contract/trace/trace-run-record.d.ts +27 -0
  229. package/dist/contract/trace/trace-run-record.d.ts.map +1 -0
  230. package/dist/contract/trace/trace-run-record.js +115 -0
  231. package/dist/contract/trace/trace-run-record.js.map +1 -0
  232. package/dist/contract/trace/trace-steps.d.ts +19 -0
  233. package/dist/contract/trace/trace-steps.d.ts.map +1 -0
  234. package/dist/contract/trace/trace-steps.js +79 -0
  235. package/dist/contract/trace/trace-steps.js.map +1 -0
  236. package/dist/contract/trace/trace-zip-limits.d.ts +41 -0
  237. package/dist/contract/trace/trace-zip-limits.d.ts.map +1 -0
  238. package/dist/contract/trace/trace-zip-limits.js +48 -0
  239. package/dist/contract/trace/trace-zip-limits.js.map +1 -0
  240. package/dist/contract/trace/trace-zip-reader.d.ts +10 -0
  241. package/dist/contract/trace/trace-zip-reader.d.ts.map +1 -0
  242. package/dist/contract/trace/trace-zip-reader.js +186 -0
  243. package/dist/contract/trace/trace-zip-reader.js.map +1 -0
  244. package/dist/contract/verify-approval-decisions.d.ts +5 -0
  245. package/dist/contract/verify-approval-decisions.d.ts.map +1 -0
  246. package/dist/contract/verify-approval-decisions.js +104 -0
  247. package/dist/contract/verify-approval-decisions.js.map +1 -0
  248. package/dist/decisions/append-decision.d.ts +12 -0
  249. package/dist/decisions/append-decision.d.ts.map +1 -0
  250. package/dist/decisions/append-decision.js +73 -0
  251. package/dist/decisions/append-decision.js.map +1 -0
  252. package/dist/decisions/confirmed-decision-commands.d.ts +30 -0
  253. package/dist/decisions/confirmed-decision-commands.d.ts.map +1 -0
  254. package/dist/decisions/confirmed-decision-commands.js +172 -0
  255. package/dist/decisions/confirmed-decision-commands.js.map +1 -0
  256. package/dist/decisions/decision-file.d.ts +31 -0
  257. package/dist/decisions/decision-file.d.ts.map +1 -0
  258. package/dist/decisions/decision-file.js +139 -0
  259. package/dist/decisions/decision-file.js.map +1 -0
  260. package/dist/decisions/decision-identity.d.ts +12 -0
  261. package/dist/decisions/decision-identity.d.ts.map +1 -0
  262. package/dist/decisions/decision-identity.js +78 -0
  263. package/dist/decisions/decision-identity.js.map +1 -0
  264. package/dist/decisions/decision-integrity-check.d.ts +12 -0
  265. package/dist/decisions/decision-integrity-check.d.ts.map +1 -0
  266. package/dist/decisions/decision-integrity-check.js +102 -0
  267. package/dist/decisions/decision-integrity-check.js.map +1 -0
  268. package/dist/decisions/decision-schema.d.ts +42 -0
  269. package/dist/decisions/decision-schema.d.ts.map +1 -0
  270. package/dist/decisions/decision-schema.js +75 -0
  271. package/dist/decisions/decision-schema.js.map +1 -0
  272. package/dist/decisions/decision-source.d.ts +2 -0
  273. package/dist/decisions/decision-source.d.ts.map +1 -0
  274. package/dist/decisions/decision-source.js +18 -0
  275. package/dist/decisions/decision-source.js.map +1 -0
  276. package/dist/decisions/exclusive-file-create.d.ts +3 -0
  277. package/dist/decisions/exclusive-file-create.d.ts.map +1 -0
  278. package/dist/decisions/exclusive-file-create.js +84 -0
  279. package/dist/decisions/exclusive-file-create.js.map +1 -0
  280. package/dist/decisions/git-head-trust.d.ts +7 -0
  281. package/dist/decisions/git-head-trust.d.ts.map +1 -0
  282. package/dist/decisions/git-head-trust.js +76 -0
  283. package/dist/decisions/git-head-trust.js.map +1 -0
  284. package/dist/decisions/human-confirmation.d.ts +33 -0
  285. package/dist/decisions/human-confirmation.d.ts.map +1 -0
  286. package/dist/decisions/human-confirmation.js +155 -0
  287. package/dist/decisions/human-confirmation.js.map +1 -0
  288. package/dist/decisions/legacy-waiver-migration.d.ts +31 -0
  289. package/dist/decisions/legacy-waiver-migration.d.ts.map +1 -0
  290. package/dist/decisions/legacy-waiver-migration.js +170 -0
  291. package/dist/decisions/legacy-waiver-migration.js.map +1 -0
  292. package/dist/decisions/read-decisions.d.ts +19 -0
  293. package/dist/decisions/read-decisions.d.ts.map +1 -0
  294. package/dist/decisions/read-decisions.js +90 -0
  295. package/dist/decisions/read-decisions.js.map +1 -0
  296. package/dist/decisions/viewpoint-baseline-adapter.d.ts +7 -0
  297. package/dist/decisions/viewpoint-baseline-adapter.d.ts.map +1 -0
  298. package/dist/decisions/viewpoint-baseline-adapter.js +109 -0
  299. package/dist/decisions/viewpoint-baseline-adapter.js.map +1 -0
  300. package/dist/decisions/waiver-decisions.d.ts +24 -0
  301. package/dist/decisions/waiver-decisions.d.ts.map +1 -0
  302. package/dist/decisions/waiver-decisions.js +46 -0
  303. package/dist/decisions/waiver-decisions.js.map +1 -0
  304. package/dist/exporters/matrix/build.d.ts +3 -0
  305. package/dist/exporters/matrix/build.d.ts.map +1 -1
  306. package/dist/exporters/matrix/build.js +10 -9
  307. package/dist/exporters/matrix/build.js.map +1 -1
  308. package/dist/exporters/matrix/export.d.ts +3 -0
  309. package/dist/exporters/matrix/export.d.ts.map +1 -1
  310. package/dist/exporters/matrix/export.js +2 -0
  311. package/dist/exporters/matrix/export.js.map +1 -1
  312. package/dist/exporters/matrix/gates.d.ts +6 -1
  313. package/dist/exporters/matrix/gates.d.ts.map +1 -1
  314. package/dist/exporters/matrix/gates.js +57 -128
  315. package/dist/exporters/matrix/gates.js.map +1 -1
  316. package/dist/exporters/matrix/render-csv.d.ts.map +1 -1
  317. package/dist/exporters/matrix/render-csv.js +3 -0
  318. package/dist/exporters/matrix/render-csv.js.map +1 -1
  319. package/dist/exporters/matrix/render-gate-overrides-sheet.d.ts +13 -0
  320. package/dist/exporters/matrix/render-gate-overrides-sheet.d.ts.map +1 -0
  321. package/dist/exporters/matrix/render-gate-overrides-sheet.js +44 -0
  322. package/dist/exporters/matrix/render-gate-overrides-sheet.js.map +1 -0
  323. package/dist/exporters/matrix/render-xlsx.d.ts +1 -0
  324. package/dist/exporters/matrix/render-xlsx.d.ts.map +1 -1
  325. package/dist/exporters/matrix/render-xlsx.js +3 -0
  326. package/dist/exporters/matrix/render-xlsx.js.map +1 -1
  327. package/dist/exporters/matrix/types.d.ts +4 -1
  328. package/dist/exporters/matrix/types.d.ts.map +1 -1
  329. package/dist/exporters/matrix/types.js.map +1 -1
  330. package/dist/generators/test-generator/code-generator.d.ts.map +1 -1
  331. package/dist/generators/test-generator/code-generator.js +13 -0
  332. package/dist/generators/test-generator/code-generator.js.map +1 -1
  333. package/dist/graph/evaluate-graph.d.ts +21 -0
  334. package/dist/graph/evaluate-graph.d.ts.map +1 -0
  335. package/dist/graph/evaluate-graph.js +49 -0
  336. package/dist/graph/evaluate-graph.js.map +1 -0
  337. package/dist/graph/locate-finding.d.ts +20 -0
  338. package/dist/graph/locate-finding.d.ts.map +1 -0
  339. package/dist/graph/locate-finding.js +137 -0
  340. package/dist/graph/locate-finding.js.map +1 -0
  341. package/dist/graph/node-decl.d.ts +59 -0
  342. package/dist/graph/node-decl.d.ts.map +1 -0
  343. package/dist/graph/node-decl.js +8 -0
  344. package/dist/graph/node-decl.js.map +1 -0
  345. package/dist/graph/nodes/core-node-catalog.d.ts +7 -0
  346. package/dist/graph/nodes/core-node-catalog.d.ts.map +1 -0
  347. package/dist/graph/nodes/core-node-catalog.js +13 -0
  348. package/dist/graph/nodes/core-node-catalog.js.map +1 -0
  349. package/dist/graph/nodes/test-case-contract-nodes.d.ts +19 -0
  350. package/dist/graph/nodes/test-case-contract-nodes.d.ts.map +1 -0
  351. package/dist/graph/nodes/test-case-contract-nodes.js +56 -0
  352. package/dist/graph/nodes/test-case-contract-nodes.js.map +1 -0
  353. package/dist/graph/nodes/test-case-nodes.d.ts +26 -0
  354. package/dist/graph/nodes/test-case-nodes.d.ts.map +1 -0
  355. package/dist/graph/nodes/test-case-nodes.js +66 -0
  356. package/dist/graph/nodes/test-case-nodes.js.map +1 -0
  357. package/dist/graph/nodes/unit-audit-nodes.d.ts +18 -0
  358. package/dist/graph/nodes/unit-audit-nodes.d.ts.map +1 -0
  359. package/dist/graph/nodes/unit-audit-nodes.js +95 -0
  360. package/dist/graph/nodes/unit-audit-nodes.js.map +1 -0
  361. package/dist/graph/nodes/unit-contract-node.d.ts +20 -0
  362. package/dist/graph/nodes/unit-contract-node.d.ts.map +1 -0
  363. package/dist/graph/nodes/unit-contract-node.js +81 -0
  364. package/dist/graph/nodes/unit-contract-node.js.map +1 -0
  365. package/dist/graph/nodes/unit-design-nodes.d.ts +14 -0
  366. package/dist/graph/nodes/unit-design-nodes.d.ts.map +1 -0
  367. package/dist/graph/nodes/unit-design-nodes.js +90 -0
  368. package/dist/graph/nodes/unit-design-nodes.js.map +1 -0
  369. package/dist/graph/nodes/unit-execution-nodes.d.ts +16 -0
  370. package/dist/graph/nodes/unit-execution-nodes.d.ts.map +1 -0
  371. package/dist/graph/nodes/unit-execution-nodes.js +79 -0
  372. package/dist/graph/nodes/unit-execution-nodes.js.map +1 -0
  373. package/dist/graph/test-case-identity.d.ts +13 -0
  374. package/dist/graph/test-case-identity.d.ts.map +1 -0
  375. package/dist/graph/test-case-identity.js +106 -0
  376. package/dist/graph/test-case-identity.js.map +1 -0
  377. package/dist/graph/test-case-results.d.ts +11 -0
  378. package/dist/graph/test-case-results.d.ts.map +1 -0
  379. package/dist/graph/test-case-results.js +137 -0
  380. package/dist/graph/test-case-results.js.map +1 -0
  381. package/dist/graph/test-case-satisfied.d.ts +25 -0
  382. package/dist/graph/test-case-satisfied.d.ts.map +1 -0
  383. package/dist/graph/test-case-satisfied.js +51 -0
  384. package/dist/graph/test-case-satisfied.js.map +1 -0
  385. package/dist/graph/test-case-state-shape.d.ts +67 -0
  386. package/dist/graph/test-case-state-shape.d.ts.map +1 -0
  387. package/dist/graph/test-case-state-shape.js +3 -0
  388. package/dist/graph/test-case-state-shape.js.map +1 -0
  389. package/dist/graph/test-case-states.d.ts +9 -0
  390. package/dist/graph/test-case-states.d.ts.map +1 -0
  391. package/dist/graph/test-case-states.js +116 -0
  392. package/dist/graph/test-case-states.js.map +1 -0
  393. package/dist/graph/unit-artifact-probes.d.ts +19 -0
  394. package/dist/graph/unit-artifact-probes.d.ts.map +1 -0
  395. package/dist/graph/unit-artifact-probes.js +133 -0
  396. package/dist/graph/unit-artifact-probes.js.map +1 -0
  397. package/dist/graph/unit-state-facts.d.ts +43 -0
  398. package/dist/graph/unit-state-facts.d.ts.map +1 -0
  399. package/dist/graph/unit-state-facts.js +87 -0
  400. package/dist/graph/unit-state-facts.js.map +1 -0
  401. package/dist/harness/audit.d.ts +11 -0
  402. package/dist/harness/audit.d.ts.map +1 -1
  403. package/dist/harness/audit.js +18 -17
  404. package/dist/harness/audit.js.map +1 -1
  405. package/dist/harness/catalog/gate-rules.yaml +647 -0
  406. package/dist/harness/gates/audit-gate-terms.d.ts +41 -0
  407. package/dist/harness/gates/audit-gate-terms.d.ts.map +1 -0
  408. package/dist/harness/gates/audit-gate-terms.js +72 -0
  409. package/dist/harness/gates/audit-gate-terms.js.map +1 -0
  410. package/dist/harness/gates/audit-gate-verdict.d.ts +31 -0
  411. package/dist/harness/gates/audit-gate-verdict.d.ts.map +1 -0
  412. package/dist/harness/gates/audit-gate-verdict.js +101 -0
  413. package/dist/harness/gates/audit-gate-verdict.js.map +1 -0
  414. package/dist/harness/gates/audit-input-hash.d.ts +4 -0
  415. package/dist/harness/gates/audit-input-hash.d.ts.map +1 -0
  416. package/dist/harness/gates/audit-input-hash.js +96 -0
  417. package/dist/harness/gates/audit-input-hash.js.map +1 -0
  418. package/dist/harness/gates/audit-report-verification.d.ts +32 -0
  419. package/dist/harness/gates/audit-report-verification.d.ts.map +1 -0
  420. package/dist/harness/gates/audit-report-verification.js +207 -0
  421. package/dist/harness/gates/audit-report-verification.js.map +1 -0
  422. package/dist/harness/gates/decisions-hash.d.ts +13 -0
  423. package/dist/harness/gates/decisions-hash.d.ts.map +1 -0
  424. package/dist/harness/gates/decisions-hash.js +72 -0
  425. package/dist/harness/gates/decisions-hash.js.map +1 -0
  426. package/dist/harness/gates/delivery-checklist.d.ts +21 -0
  427. package/dist/harness/gates/delivery-checklist.d.ts.map +1 -0
  428. package/dist/harness/gates/delivery-checklist.js +128 -0
  429. package/dist/harness/gates/delivery-checklist.js.map +1 -0
  430. package/dist/harness/gates/delivery-decision-gate.d.ts +29 -0
  431. package/dist/harness/gates/delivery-decision-gate.d.ts.map +1 -0
  432. package/dist/harness/gates/delivery-decision-gate.js +91 -0
  433. package/dist/harness/gates/delivery-decision-gate.js.map +1 -0
  434. package/dist/harness/gates/delivery-decision-step.d.ts +16 -0
  435. package/dist/harness/gates/delivery-decision-step.d.ts.map +1 -0
  436. package/dist/harness/gates/delivery-decision-step.js +71 -0
  437. package/dist/harness/gates/delivery-decision-step.js.map +1 -0
  438. package/dist/harness/gates/gate-override-report.d.ts +59 -0
  439. package/dist/harness/gates/gate-override-report.d.ts.map +1 -0
  440. package/dist/harness/gates/gate-override-report.js +86 -0
  441. package/dist/harness/gates/gate-override-report.js.map +1 -0
  442. package/dist/harness/gates/gate-override-scope.d.ts +18 -0
  443. package/dist/harness/gates/gate-override-scope.d.ts.map +1 -0
  444. package/dist/harness/gates/gate-override-scope.js +98 -0
  445. package/dist/harness/gates/gate-override-scope.js.map +1 -0
  446. package/dist/harness/gates/gate-override-validation.d.ts +25 -0
  447. package/dist/harness/gates/gate-override-validation.d.ts.map +1 -0
  448. package/dist/harness/gates/gate-override-validation.js +81 -0
  449. package/dist/harness/gates/gate-override-validation.js.map +1 -0
  450. package/dist/harness/gates/gate-rule-catalog.d.ts +24 -0
  451. package/dist/harness/gates/gate-rule-catalog.d.ts.map +1 -0
  452. package/dist/harness/gates/gate-rule-catalog.js +112 -0
  453. package/dist/harness/gates/gate-rule-catalog.js.map +1 -0
  454. package/dist/harness/gates/gate-terms.d.ts +33 -0
  455. package/dist/harness/gates/gate-terms.d.ts.map +1 -0
  456. package/dist/harness/gates/gate-terms.js +41 -0
  457. package/dist/harness/gates/gate-terms.js.map +1 -0
  458. package/dist/harness/gates/in-run-decision-check.d.ts +21 -0
  459. package/dist/harness/gates/in-run-decision-check.d.ts.map +1 -0
  460. package/dist/harness/gates/in-run-decision-check.js +138 -0
  461. package/dist/harness/gates/in-run-decision-check.js.map +1 -0
  462. package/dist/harness/gates/journey-gate-inputs.d.ts +37 -0
  463. package/dist/harness/gates/journey-gate-inputs.d.ts.map +1 -0
  464. package/dist/harness/gates/journey-gate-inputs.js +81 -0
  465. package/dist/harness/gates/journey-gate-inputs.js.map +1 -0
  466. package/dist/harness/gates/migrated-waiver-review.d.ts +6 -0
  467. package/dist/harness/gates/migrated-waiver-review.d.ts.map +1 -0
  468. package/dist/harness/gates/migrated-waiver-review.js +116 -0
  469. package/dist/harness/gates/migrated-waiver-review.js.map +1 -0
  470. package/dist/harness/gates/resolve-rule.d.ts +59 -0
  471. package/dist/harness/gates/resolve-rule.d.ts.map +1 -0
  472. package/dist/harness/gates/resolve-rule.js +41 -0
  473. package/dist/harness/gates/resolve-rule.js.map +1 -0
  474. package/dist/harness/gates/unit-gate-overrides.d.ts +25 -0
  475. package/dist/harness/gates/unit-gate-overrides.d.ts.map +1 -0
  476. package/dist/harness/gates/unit-gate-overrides.js +122 -0
  477. package/dist/harness/gates/unit-gate-overrides.js.map +1 -0
  478. package/dist/harness/journey.d.ts +24 -1
  479. package/dist/harness/journey.d.ts.map +1 -1
  480. package/dist/harness/journey.js +114 -23
  481. package/dist/harness/journey.js.map +1 -1
  482. package/dist/harness/manifest.d.ts +12 -0
  483. package/dist/harness/manifest.d.ts.map +1 -1
  484. package/dist/harness/manifest.js +71 -43
  485. package/dist/harness/manifest.js.map +1 -1
  486. package/dist/harness/next-step.d.ts +39 -6
  487. package/dist/harness/next-step.d.ts.map +1 -1
  488. package/dist/harness/next-step.js +34 -218
  489. package/dist/harness/next-step.js.map +1 -1
  490. package/dist/harness/parse.d.ts +10 -6
  491. package/dist/harness/parse.d.ts.map +1 -1
  492. package/dist/harness/parse.js +22 -11
  493. package/dist/harness/parse.js.map +1 -1
  494. package/dist/harness/script-check.d.ts.map +1 -1
  495. package/dist/harness/script-check.js +22 -5
  496. package/dist/harness/script-check.js.map +1 -1
  497. package/dist/harness/sensors.d.ts +14 -3
  498. package/dist/harness/sensors.d.ts.map +1 -1
  499. package/dist/harness/sensors.js +50 -49
  500. package/dist/harness/sensors.js.map +1 -1
  501. package/dist/harness/viewpoint-baseline.d.ts.map +1 -1
  502. package/dist/harness/viewpoint-baseline.js +1 -7
  503. package/dist/harness/viewpoint-baseline.js.map +1 -1
  504. package/dist/harness/viewpoint-ledger.d.ts +3 -13
  505. package/dist/harness/viewpoint-ledger.d.ts.map +1 -1
  506. package/dist/harness/viewpoint-ledger.js +8 -38
  507. package/dist/harness/viewpoint-ledger.js.map +1 -1
  508. package/dist/hooks/bash-write-targets.d.ts +15 -0
  509. package/dist/hooks/bash-write-targets.d.ts.map +1 -0
  510. package/dist/hooks/bash-write-targets.js +173 -0
  511. package/dist/hooks/bash-write-targets.js.map +1 -0
  512. package/dist/hooks/claude-hook-entry.d.ts +11 -0
  513. package/dist/hooks/claude-hook-entry.d.ts.map +1 -0
  514. package/dist/hooks/claude-hook-entry.js +137 -0
  515. package/dist/hooks/claude-hook-entry.js.map +1 -0
  516. package/dist/hooks/claude-transcript-turn.d.ts +11 -0
  517. package/dist/hooks/claude-transcript-turn.d.ts.map +1 -0
  518. package/dist/hooks/claude-transcript-turn.js +143 -0
  519. package/dist/hooks/claude-transcript-turn.js.map +1 -0
  520. package/dist/hooks/guard-delivery-contract-rule.d.ts +10 -0
  521. package/dist/hooks/guard-delivery-contract-rule.d.ts.map +1 -0
  522. package/dist/hooks/guard-delivery-contract-rule.js +152 -0
  523. package/dist/hooks/guard-delivery-contract-rule.js.map +1 -0
  524. package/dist/hooks/guard-protected-paths.d.ts +9 -0
  525. package/dist/hooks/guard-protected-paths.d.ts.map +1 -0
  526. package/dist/hooks/guard-protected-paths.js +106 -0
  527. package/dist/hooks/guard-protected-paths.js.map +1 -0
  528. package/dist/hooks/guard-rules.d.ts +37 -0
  529. package/dist/hooks/guard-rules.d.ts.map +1 -0
  530. package/dist/hooks/guard-rules.js +61 -0
  531. package/dist/hooks/guard-rules.js.map +1 -0
  532. package/dist/hooks/guard-tty-spoof-rule.d.ts +15 -0
  533. package/dist/hooks/guard-tty-spoof-rule.d.ts.map +1 -0
  534. package/dist/hooks/guard-tty-spoof-rule.js +21 -0
  535. package/dist/hooks/guard-tty-spoof-rule.js.map +1 -0
  536. package/dist/hooks/hand-back-core.d.ts +37 -0
  537. package/dist/hooks/hand-back-core.d.ts.map +1 -0
  538. package/dist/hooks/hand-back-core.js +115 -0
  539. package/dist/hooks/hand-back-core.js.map +1 -0
  540. package/dist/hooks/hook-cli-command.d.ts +9 -0
  541. package/dist/hooks/hook-cli-command.d.ts.map +1 -0
  542. package/dist/hooks/hook-cli-command.js +46 -0
  543. package/dist/hooks/hook-cli-command.js.map +1 -0
  544. package/dist/hooks/hook-registry.d.ts +10 -0
  545. package/dist/hooks/hook-registry.d.ts.map +1 -0
  546. package/dist/hooks/hook-registry.js +24 -0
  547. package/dist/hooks/hook-registry.js.map +1 -0
  548. package/dist/hooks/hook-result-contract.d.ts +50 -0
  549. package/dist/hooks/hook-result-contract.d.ts.map +1 -0
  550. package/dist/hooks/hook-result-contract.js +80 -0
  551. package/dist/hooks/hook-result-contract.js.map +1 -0
  552. package/dist/hooks/hook-toggles.d.ts +10 -0
  553. package/dist/hooks/hook-toggles.d.ts.map +1 -0
  554. package/dist/hooks/hook-toggles.js +107 -0
  555. package/dist/hooks/hook-toggles.js.map +1 -0
  556. package/dist/hooks/pre-tool-guard-hook.d.ts +10 -0
  557. package/dist/hooks/pre-tool-guard-hook.d.ts.map +1 -0
  558. package/dist/hooks/pre-tool-guard-hook.js +105 -0
  559. package/dist/hooks/pre-tool-guard-hook.js.map +1 -0
  560. package/dist/hooks/session-start-unit-state-hook.d.ts +13 -0
  561. package/dist/hooks/session-start-unit-state-hook.d.ts.map +1 -0
  562. package/dist/hooks/session-start-unit-state-hook.js +55 -0
  563. package/dist/hooks/session-start-unit-state-hook.js.map +1 -0
  564. package/dist/hooks/stop-next-step-hook.d.ts +16 -0
  565. package/dist/hooks/stop-next-step-hook.d.ts.map +1 -0
  566. package/dist/hooks/stop-next-step-hook.js +42 -0
  567. package/dist/hooks/stop-next-step-hook.js.map +1 -0
  568. package/dist/hooks/sungen-project-root.d.ts +19 -0
  569. package/dist/hooks/sungen-project-root.d.ts.map +1 -0
  570. package/dist/hooks/sungen-project-root.js +130 -0
  571. package/dist/hooks/sungen-project-root.js.map +1 -0
  572. package/dist/orchestrator/ai-skills/command-partial-includes.d.ts +15 -0
  573. package/dist/orchestrator/ai-skills/command-partial-includes.d.ts.map +1 -0
  574. package/dist/orchestrator/ai-skills/command-partial-includes.js +106 -0
  575. package/dist/orchestrator/ai-skills/command-partial-includes.js.map +1 -0
  576. package/dist/orchestrator/ai-skills/commands.d.ts +5 -1
  577. package/dist/orchestrator/ai-skills/commands.d.ts.map +1 -1
  578. package/dist/orchestrator/ai-skills/commands.js +16 -6
  579. package/dist/orchestrator/ai-skills/commands.js.map +1 -1
  580. package/dist/orchestrator/ai-skills/golden-skills.test.js +29 -0
  581. package/dist/orchestrator/ai-skills/golden-skills.test.js.map +1 -1
  582. package/dist/orchestrator/claude-hooks-install.d.ts +27 -0
  583. package/dist/orchestrator/claude-hooks-install.d.ts.map +1 -0
  584. package/dist/orchestrator/claude-hooks-install.js +203 -0
  585. package/dist/orchestrator/claude-hooks-install.js.map +1 -0
  586. package/dist/orchestrator/flow-manager.d.ts +1 -0
  587. package/dist/orchestrator/flow-manager.d.ts.map +1 -1
  588. package/dist/orchestrator/flow-manager.js +52 -3
  589. package/dist/orchestrator/flow-manager.js.map +1 -1
  590. package/dist/orchestrator/lockstep-version.d.ts +15 -5
  591. package/dist/orchestrator/lockstep-version.d.ts.map +1 -1
  592. package/dist/orchestrator/lockstep-version.js +30 -17
  593. package/dist/orchestrator/lockstep-version.js.map +1 -1
  594. package/dist/orchestrator/project-initializer.d.ts +6 -0
  595. package/dist/orchestrator/project-initializer.d.ts.map +1 -1
  596. package/dist/orchestrator/project-initializer.js +23 -0
  597. package/dist/orchestrator/project-initializer.js.map +1 -1
  598. package/dist/orchestrator/screen-manager.d.ts.map +1 -1
  599. package/dist/orchestrator/screen-manager.js +52 -4
  600. package/dist/orchestrator/screen-manager.js.map +1 -1
  601. package/dist/orchestrator/templates/ai-src/commands/add-api.md +2 -0
  602. package/dist/orchestrator/templates/ai-src/commands/add-flow.md +2 -0
  603. package/dist/orchestrator/templates/ai-src/commands/add-screen.md +2 -0
  604. package/dist/orchestrator/templates/ai-src/commands/create-data-test.md +1 -0
  605. package/dist/orchestrator/templates/ai-src/commands/create-test.md +36 -46
  606. package/dist/orchestrator/templates/ai-src/commands/dashboard.md +2 -0
  607. package/dist/orchestrator/templates/ai-src/commands/delivery.md +2 -0
  608. package/dist/orchestrator/templates/ai-src/commands/design.md +2 -0
  609. package/dist/orchestrator/templates/ai-src/commands/feedback.md +2 -0
  610. package/dist/orchestrator/templates/ai-src/commands/locale.md +2 -0
  611. package/dist/orchestrator/templates/ai-src/commands/review.md +2 -0
  612. package/dist/orchestrator/templates/ai-src/commands/run-test.md +6 -8
  613. package/dist/orchestrator/templates/ai-src/config/claude.md +20 -7
  614. package/dist/orchestrator/templates/ai-src/config/copilot.md +20 -7
  615. package/dist/orchestrator/templates/ai-src/partials/hand-back-rule.claude.md +20 -0
  616. package/dist/orchestrator/templates/ai-src/partials/hand-back-rule.codex.md +20 -0
  617. package/dist/orchestrator/templates/ai-src/partials/hand-back-rule.copilot.md +20 -0
  618. package/dist/orchestrator/templates/ai-src/skills/sungen-api-coverage-model/SKILL.md +1 -1
  619. package/dist/orchestrator/templates/ai-src/skills/sungen-capture-mobile/SKILL.md +3 -3
  620. package/dist/orchestrator/templates/ai-src/skills/sungen-data-factory/SKILL.md +9 -0
  621. package/dist/orchestrator/templates/ai-src/skills/sungen-harness-audit/SKILL.md +1 -3
  622. package/dist/orchestrator/templates/ai-src/skills/sungen-tc-generation/SKILL.md +1 -1
  623. package/dist/orchestrator/templates/ai-src/skills/sungen-viewpoint/SKILL.md +0 -18
  624. package/dist/orchestrator/templates/claude-hooks/sungen-hook.cjs +64 -0
  625. package/dist/orchestrator/viewpoint-pattern-catalog.d.ts +1 -4
  626. package/dist/orchestrator/viewpoint-pattern-catalog.d.ts.map +1 -1
  627. package/dist/orchestrator/viewpoint-pattern-catalog.js +2 -5
  628. package/dist/orchestrator/viewpoint-pattern-catalog.js.map +1 -1
  629. package/dist/utils/safe-yaml-parse.d.ts +8 -0
  630. package/dist/utils/safe-yaml-parse.d.ts.map +1 -0
  631. package/dist/utils/safe-yaml-parse.js +51 -0
  632. package/dist/utils/safe-yaml-parse.js.map +1 -0
  633. package/package.json +3 -3
  634. package/src/basis/anchor-grammar.ts +83 -0
  635. package/src/basis/anchor-hash.ts +27 -0
  636. package/src/basis/bm51-tables.ts +65 -0
  637. package/src/basis/extract-spec-anchors.ts +95 -0
  638. package/src/basis/migration-sentinel.ts +175 -0
  639. package/src/basis/spec-frontmatter.ts +68 -0
  640. package/src/basis/spec-sections.ts +35 -0
  641. package/src/basis/test-basis-schema.ts +81 -0
  642. package/src/capabilities/registry.ts +16 -0
  643. package/src/cli/commands/audit.ts +3 -26
  644. package/src/cli/commands/capability.ts +1 -1
  645. package/src/cli/commands/contract-derive-command.ts +60 -0
  646. package/src/cli/commands/contract.ts +130 -0
  647. package/src/cli/commands/delivery.ts +52 -3
  648. package/src/cli/commands/generate.ts +3 -1
  649. package/src/cli/commands/journey.ts +39 -14
  650. package/src/cli/commands/next.ts +60 -8
  651. package/src/cli/commands/update.ts +35 -8
  652. package/src/cli/index.ts +20 -32
  653. package/src/contract/approve-contract.ts +94 -0
  654. package/src/contract/assertion-matcher-vocabulary.ts +93 -0
  655. package/src/contract/build-contract-verdict.ts +108 -0
  656. package/src/contract/build-trace-conformance.ts +100 -0
  657. package/src/contract/classify-contract-change.ts +92 -0
  658. package/src/contract/classify-contract-unit.ts +47 -0
  659. package/src/contract/classify-trace-conformance.ts +116 -0
  660. package/src/contract/contract-git.ts +106 -0
  661. package/src/contract/contract-hash.ts +34 -0
  662. package/src/contract/contract-report-file.ts +25 -0
  663. package/src/contract/contract-schema.ts +137 -0
  664. package/src/contract/contract-units.ts +52 -0
  665. package/src/contract/contracts-lock-file.ts +97 -0
  666. package/src/contract/data-normalize.ts +66 -0
  667. package/src/contract/derive-free-feature.ts +110 -0
  668. package/src/contract/field-semantic-redaction.ts +80 -0
  669. package/src/contract/free-feature-blocks.ts +56 -0
  670. package/src/contract/lock-secret-guard.ts +95 -0
  671. package/src/contract/lock-vs-git-head.ts +38 -0
  672. package/src/contract/normalize-contract-step.ts +74 -0
  673. package/src/contract/normalize-feature-steps.ts +93 -0
  674. package/src/contract/oracle-strength.ts +80 -0
  675. package/src/contract/project-contract-blockers.ts +36 -0
  676. package/src/contract/record-contract-approval.ts +70 -0
  677. package/src/contract/render-free-gherkin.ts +113 -0
  678. package/src/contract/render-trace-sentence.ts +98 -0
  679. package/src/contract/render-trace-target.ts +68 -0
  680. package/src/contract/resolve-unit-trace-identities.ts +35 -0
  681. package/src/contract/trace/collect-trace-evidence.ts +109 -0
  682. package/src/contract/trace/identity-cache.ts +61 -0
  683. package/src/contract/trace/select-final-attempt.ts +70 -0
  684. package/src/contract/trace/snapshot-html-renderer.ts +136 -0
  685. package/src/contract/trace/snapshot-resolver.ts +66 -0
  686. package/src/contract/trace/snapshot-store.ts +151 -0
  687. package/src/contract/trace/target-identity.ts +104 -0
  688. package/src/contract/trace/test-step-join.ts +103 -0
  689. package/src/contract/trace/trace-binding.ts +56 -0
  690. package/src/contract/trace/trace-file-reader.ts +123 -0
  691. package/src/contract/trace/trace-fingerprint.ts +68 -0
  692. package/src/contract/trace/trace-identity-resolution.ts +74 -0
  693. package/src/contract/trace/trace-run-record.ts +74 -0
  694. package/src/contract/trace/trace-steps.ts +88 -0
  695. package/src/contract/trace/trace-zip-limits.ts +73 -0
  696. package/src/contract/trace/trace-zip-reader.ts +127 -0
  697. package/src/contract/verify-approval-decisions.ts +60 -0
  698. package/src/decisions/append-decision.ts +35 -0
  699. package/src/decisions/confirmed-decision-commands.ts +128 -0
  700. package/src/decisions/decision-file.ts +93 -0
  701. package/src/decisions/decision-identity.ts +73 -0
  702. package/src/decisions/decision-integrity-check.ts +61 -0
  703. package/src/decisions/decision-schema.ts +76 -0
  704. package/src/decisions/decision-source.ts +14 -0
  705. package/src/decisions/exclusive-file-create.ts +42 -0
  706. package/src/decisions/git-head-trust.ts +32 -0
  707. package/src/decisions/human-confirmation.ts +114 -0
  708. package/src/decisions/legacy-waiver-migration.ts +135 -0
  709. package/src/decisions/read-decisions.ts +61 -0
  710. package/src/decisions/viewpoint-baseline-adapter.ts +74 -0
  711. package/src/decisions/waiver-decisions.ts +56 -0
  712. package/src/exporters/matrix/build.ts +11 -9
  713. package/src/exporters/matrix/export.ts +5 -0
  714. package/src/exporters/matrix/gates.ts +62 -129
  715. package/src/exporters/matrix/render-csv.ts +3 -0
  716. package/src/exporters/matrix/render-gate-overrides-sheet.ts +50 -0
  717. package/src/exporters/matrix/render-xlsx.ts +3 -0
  718. package/src/exporters/matrix/types.ts +4 -1
  719. package/src/generators/test-generator/code-generator.ts +13 -0
  720. package/src/graph/evaluate-graph.ts +62 -0
  721. package/src/graph/locate-finding.ts +93 -0
  722. package/src/graph/node-decl.ts +65 -0
  723. package/src/graph/nodes/core-node-catalog.ts +15 -0
  724. package/src/graph/nodes/test-case-contract-nodes.ts +69 -0
  725. package/src/graph/nodes/test-case-nodes.ts +68 -0
  726. package/src/graph/nodes/unit-audit-nodes.ts +95 -0
  727. package/src/graph/nodes/unit-contract-node.ts +82 -0
  728. package/src/graph/nodes/unit-design-nodes.ts +88 -0
  729. package/src/graph/nodes/unit-execution-nodes.ts +77 -0
  730. package/src/graph/test-case-identity.ts +75 -0
  731. package/src/graph/test-case-results.ts +90 -0
  732. package/src/graph/test-case-satisfied.ts +55 -0
  733. package/src/graph/test-case-state-shape.ts +62 -0
  734. package/src/graph/test-case-states.ts +84 -0
  735. package/src/graph/unit-artifact-probes.ts +77 -0
  736. package/src/graph/unit-state-facts.ts +112 -0
  737. package/src/harness/audit.ts +29 -18
  738. package/src/harness/catalog/gate-rules.yaml +647 -0
  739. package/src/harness/gates/audit-gate-terms.ts +80 -0
  740. package/src/harness/gates/audit-gate-verdict.ts +78 -0
  741. package/src/harness/gates/audit-input-hash.ts +55 -0
  742. package/src/harness/gates/audit-report-verification.ts +173 -0
  743. package/src/harness/gates/decisions-hash.ts +42 -0
  744. package/src/harness/gates/delivery-checklist.ts +120 -0
  745. package/src/harness/gates/delivery-decision-gate.ts +111 -0
  746. package/src/harness/gates/delivery-decision-step.ts +73 -0
  747. package/src/harness/gates/gate-override-report.ts +114 -0
  748. package/src/harness/gates/gate-override-scope.ts +66 -0
  749. package/src/harness/gates/gate-override-validation.ts +75 -0
  750. package/src/harness/gates/gate-rule-catalog.ts +82 -0
  751. package/src/harness/gates/gate-terms.ts +59 -0
  752. package/src/harness/gates/in-run-decision-check.ts +99 -0
  753. package/src/harness/gates/journey-gate-inputs.ts +89 -0
  754. package/src/harness/gates/migrated-waiver-review.ts +68 -0
  755. package/src/harness/gates/resolve-rule.ts +94 -0
  756. package/src/harness/gates/unit-gate-overrides.ts +99 -0
  757. package/src/harness/journey.ts +122 -27
  758. package/src/harness/manifest.ts +67 -43
  759. package/src/harness/next-step.ts +59 -210
  760. package/src/harness/parse.ts +25 -15
  761. package/src/harness/script-check.ts +20 -5
  762. package/src/harness/sensors.ts +55 -49
  763. package/src/harness/viewpoint-baseline.ts +1 -7
  764. package/src/harness/viewpoint-ledger.ts +11 -52
  765. package/src/hooks/bash-write-targets.ts +109 -0
  766. package/src/hooks/claude-hook-entry.ts +85 -0
  767. package/src/hooks/claude-transcript-turn.ts +96 -0
  768. package/src/hooks/guard-delivery-contract-rule.ts +110 -0
  769. package/src/hooks/guard-protected-paths.ts +70 -0
  770. package/src/hooks/guard-rules.ts +98 -0
  771. package/src/hooks/guard-tty-spoof-rule.ts +31 -0
  772. package/src/hooks/hand-back-core.ts +106 -0
  773. package/src/hooks/hook-cli-command.ts +17 -0
  774. package/src/hooks/hook-registry.ts +24 -0
  775. package/src/hooks/hook-result-contract.ts +114 -0
  776. package/src/hooks/hook-toggles.ts +66 -0
  777. package/src/hooks/pre-tool-guard-hook.ts +67 -0
  778. package/src/hooks/session-start-unit-state-hook.ts +54 -0
  779. package/src/hooks/stop-next-step-hook.ts +37 -0
  780. package/src/hooks/sungen-project-root.ts +80 -0
  781. package/src/orchestrator/ai-skills/command-partial-includes.ts +72 -0
  782. package/src/orchestrator/ai-skills/commands.ts +22 -8
  783. package/src/orchestrator/ai-skills/golden-skills.test.ts +23 -0
  784. package/src/orchestrator/claude-hooks-install.ts +168 -0
  785. package/src/orchestrator/flow-manager.ts +53 -3
  786. package/src/orchestrator/lockstep-version.ts +28 -15
  787. package/src/orchestrator/project-initializer.ts +21 -0
  788. package/src/orchestrator/screen-manager.ts +52 -4
  789. package/src/orchestrator/templates/ai-src/commands/add-api.md +2 -0
  790. package/src/orchestrator/templates/ai-src/commands/add-flow.md +2 -0
  791. package/src/orchestrator/templates/ai-src/commands/add-screen.md +2 -0
  792. package/src/orchestrator/templates/ai-src/commands/create-data-test.md +1 -0
  793. package/src/orchestrator/templates/ai-src/commands/create-test.md +36 -46
  794. package/src/orchestrator/templates/ai-src/commands/dashboard.md +2 -0
  795. package/src/orchestrator/templates/ai-src/commands/delivery.md +2 -0
  796. package/src/orchestrator/templates/ai-src/commands/design.md +2 -0
  797. package/src/orchestrator/templates/ai-src/commands/feedback.md +2 -0
  798. package/src/orchestrator/templates/ai-src/commands/locale.md +2 -0
  799. package/src/orchestrator/templates/ai-src/commands/review.md +2 -0
  800. package/src/orchestrator/templates/ai-src/commands/run-test.md +6 -8
  801. package/src/orchestrator/templates/ai-src/config/claude.md +20 -7
  802. package/src/orchestrator/templates/ai-src/config/copilot.md +20 -7
  803. package/src/orchestrator/templates/ai-src/partials/hand-back-rule.claude.md +20 -0
  804. package/src/orchestrator/templates/ai-src/partials/hand-back-rule.codex.md +20 -0
  805. package/src/orchestrator/templates/ai-src/partials/hand-back-rule.copilot.md +20 -0
  806. package/src/orchestrator/templates/ai-src/skills/sungen-api-coverage-model/SKILL.md +1 -1
  807. package/src/orchestrator/templates/ai-src/skills/sungen-capture-mobile/SKILL.md +3 -3
  808. package/src/orchestrator/templates/ai-src/skills/sungen-data-factory/SKILL.md +9 -0
  809. package/src/orchestrator/templates/ai-src/skills/sungen-harness-audit/SKILL.md +1 -3
  810. package/src/orchestrator/templates/ai-src/skills/sungen-tc-generation/SKILL.md +1 -1
  811. package/src/orchestrator/templates/ai-src/skills/sungen-viewpoint/SKILL.md +0 -18
  812. package/src/orchestrator/templates/claude-hooks/sungen-hook.cjs +64 -0
  813. package/src/orchestrator/viewpoint-pattern-catalog.ts +2 -5
  814. package/src/utils/safe-yaml-parse.ts +44 -0
  815. package/dist/cli/commands/viewpoint.d.ts +0 -7
  816. package/dist/cli/commands/viewpoint.d.ts.map +0 -1
  817. package/dist/cli/commands/viewpoint.js +0 -70
  818. package/dist/cli/commands/viewpoint.js.map +0 -1
  819. package/dist/harness/viewpoint-draft-header.d.ts +0 -7
  820. package/dist/harness/viewpoint-draft-header.d.ts.map +0 -1
  821. package/dist/harness/viewpoint-draft-header.js +0 -100
  822. package/dist/harness/viewpoint-draft-header.js.map +0 -1
  823. package/dist/harness/viewpoint-mode.d.ts +0 -9
  824. package/dist/harness/viewpoint-mode.d.ts.map +0 -1
  825. package/dist/harness/viewpoint-mode.js +0 -52
  826. package/dist/harness/viewpoint-mode.js.map +0 -1
  827. package/dist/harness/viewpoint-priority.d.ts +0 -19
  828. package/dist/harness/viewpoint-priority.d.ts.map +0 -1
  829. package/dist/harness/viewpoint-priority.js +0 -36
  830. package/dist/harness/viewpoint-priority.js.map +0 -1
  831. package/dist/harness/viewpoint-review-open.d.ts +0 -6
  832. package/dist/harness/viewpoint-review-open.d.ts.map +0 -1
  833. package/dist/harness/viewpoint-review-open.js +0 -90
  834. package/dist/harness/viewpoint-review-open.js.map +0 -1
  835. package/dist/harness/viewpoint-scan-refs.d.ts +0 -50
  836. package/dist/harness/viewpoint-scan-refs.d.ts.map +0 -1
  837. package/dist/harness/viewpoint-scan-refs.js +0 -200
  838. package/dist/harness/viewpoint-scan-refs.js.map +0 -1
  839. package/dist/harness/viewpoint-scan.d.ts +0 -41
  840. package/dist/harness/viewpoint-scan.d.ts.map +0 -1
  841. package/dist/harness/viewpoint-scan.js +0 -118
  842. package/dist/harness/viewpoint-scan.js.map +0 -1
  843. package/dist/orchestrator/templates/ai-src/skills/sungen-viewpoint/review-checklist.md +0 -63
  844. package/dist/orchestrator/templates/ai-src/skills/sungen-viewpoint/viewpoint-template.md +0 -158
  845. package/dist/orchestrator/viewpoint-scaffold.d.ts +0 -3
  846. package/dist/orchestrator/viewpoint-scaffold.d.ts.map +0 -1
  847. package/dist/orchestrator/viewpoint-scaffold.js +0 -70
  848. package/dist/orchestrator/viewpoint-scaffold.js.map +0 -1
  849. package/src/cli/commands/viewpoint.ts +0 -58
  850. package/src/harness/viewpoint-draft-header.ts +0 -55
  851. package/src/harness/viewpoint-mode.ts +0 -49
  852. package/src/harness/viewpoint-priority.ts +0 -38
  853. package/src/harness/viewpoint-review-open.ts +0 -51
  854. package/src/harness/viewpoint-scan-refs.ts +0 -154
  855. package/src/harness/viewpoint-scan.ts +0 -111
  856. package/src/orchestrator/templates/ai-src/skills/sungen-viewpoint/review-checklist.md +0 -63
  857. package/src/orchestrator/templates/ai-src/skills/sungen-viewpoint/viewpoint-template.md +0 -158
  858. package/src/orchestrator/viewpoint-scaffold.ts +0 -36
@@ -16,12 +16,17 @@
16
16
  */
17
17
  import * as fs from 'fs';
18
18
  import * as path from 'path';
19
- import { parse as parseYaml } from 'yaml';
20
- import { reportSlug, featureFilesFor } from './unit-paths';
21
- import { readTextFile } from './read-text';
19
+ import { reportSlug } from './unit-paths';
22
20
  import { checkAssetsDrift } from '../orchestrator/assets-drift';
23
- import { viewpointFileIsAiDraft } from './viewpoint-draft-header';
24
- import { readViewpointDeclaration } from './viewpoint-baseline';
21
+ import type { HeadSnapshot } from '../contract/contract-git';
22
+ import { evaluateGraph, EvaluateOptions } from '../graph/evaluate-graph';
23
+ import { CORE_NODES } from '../graph/nodes/core-node-catalog';
24
+ import type { TestCaseState } from '../graph/test-case-state-shape';
25
+ import { testCaseStates } from '../graph/test-case-states';
26
+ import {
27
+ countFailedResults, countScenarios, hasDeliverableFor, hasResolvedSelector, isCompiled, readIfExists, unitResultFiles,
28
+ } from '../graph/unit-artifact-probes';
29
+ import { AuditNotCounted, ContractFacts, ContractSummary, readContractFacts, readTrustedAudit } from '../graph/unit-state-facts';
25
30
 
26
31
  export interface NextStep {
27
32
  /** The command to run, as the operator would type it. */
@@ -36,6 +41,13 @@ export interface NextStep {
36
41
  * in the same session (#660).
37
42
  */
38
43
  kind: 'do' | 'blocked' | 'optional' | 'decide';
44
+ /** The graph node that produced the step (OES-10.1). `--json` detail; the text never shows it. */
45
+ nodeId?: string;
46
+ granularity?: 'unit' | 'test-case';
47
+ /** The one test case the step is about (`sungen next <unit> --case <id>`). */
48
+ testCase?: string;
49
+ /** Catalog rule ids (gate-rules.yaml) the step answers to. */
50
+ gates?: string[];
39
51
  }
40
52
 
41
53
  export interface UnitState {
@@ -43,8 +55,6 @@ export interface UnitState {
43
55
  kind: 'screen' | 'flow' | 'api';
44
56
  hasSpec: boolean;
45
57
  hasViewpoint: boolean;
46
- /** test-viewpoint.md carries `drafted-by: ai` — written by the AI, not yet accepted by a QA. */
47
- viewpointIsAiDraft?: boolean;
48
58
  hasContract: boolean;
49
59
  hasFlowInventory: boolean;
50
60
  scenarioCount: number;
@@ -52,6 +62,13 @@ export interface UnitState {
52
62
  selectorsArePlaceholder: boolean;
53
63
  compiled: boolean;
54
64
  hasResults: boolean;
65
+ /**
66
+ * Scenarios whose FINAL attempt failed (failed · timedOut · interrupted) across the unit's result
67
+ * files — a retried pass is not a failure. Any failure puts `sungen triage` in the path: with only
68
+ * "optional" left after a deliverable, a red run read as done and its reds reached the export
69
+ * unclassified. Absent when the state was not read from disk.
70
+ */
71
+ failedCount?: number;
55
72
  hasDeliverable: boolean;
56
73
  audit?: {
57
74
  overall: number;
@@ -66,94 +83,42 @@ export interface UnitState {
66
83
  * warning is one grey stderr line at the top of every command (#620).
67
84
  */
68
85
  assetsDrift?: { recordedVersion: string; runningVersion: string };
86
+ /** An audit report exists but does not count (stale, untrusted) — gate and delivery block on it too. */
87
+ auditNotCounted?: AuditNotCounted;
88
+ /** The rebuilt Test Contract verdict (DOS-14.4); absent when not read from disk or no scenario exists. */
89
+ contract?: ContractSummary;
90
+ /** Per-test-case state (DOS-11.1); absent when not read from disk or unreadable. */
91
+ testCases?: TestCaseState[];
69
92
  steps: NextStep[];
70
93
  }
71
94
 
72
- const exists = (p: string): boolean => fs.existsSync(p);
73
-
74
- function readJson(p: string): Record<string, unknown> | null {
75
- try {
76
- return JSON.parse(readTextFile(p)) as Record<string, unknown>;
77
- } catch {
78
- return null; // absent or unreadable — treated as "not run"
79
- }
95
+ export interface ReadUnitStateOptions {
96
+ /** git HEAD read once for many units (`sungen next` with no unit). */
97
+ gitSnapshot?: HeadSnapshot;
80
98
  }
81
99
 
82
- function countScenarios(unitDir: string, unit: string): number {
83
- let n = 0;
84
- for (const f of featureFilesFor(unitDir, unit)) {
85
- const text = fs.existsSync(f) ? readTextFile(f) : '';
86
- n += (text.match(/^\s*Scenario(?: Outline)?:/gm) ?? []).length;
87
- }
88
- return n;
89
- }
90
-
91
- /**
92
- * Everything the resolver needs, read from disk. `unitId` is the catalog id
93
- * (`<screen>` · `flows/<f>` · `api/<a>`); `unitDir` is its directory.
94
- */
95
- const RESULT_FILE = /-test-result(?:\.[^.]+)*\.json$/;
100
+ const exists = (p: string): boolean => fs.existsSync(p);
96
101
 
97
102
  /**
98
- * Does the selector text resolve at least one element? A scaffold resolves none: the web one holds
99
- * only the `page` route, the mobile one only header comments. Matching the WORD "placeholder" was
100
- * wrong both ways (#868): it flagged a real file whose key names an input's placeholder text, and
101
- * missed both scaffolds, which never contain it.
103
+ * Everything the resolver needs, read from disk. `unit` is the catalog id
104
+ * (`<screen>` · `flows/<f>` · `api/<a>`); `unitDir` is its directory. The audit report is read
105
+ * through verifyAuditReport, as `sungen gate` and `sungen delivery` read it: a stale or untrusted
106
+ * report counts as never audited (OES-11.4) and is named in `auditNotCounted`.
102
107
  */
103
- function hasResolvedSelector(selectorText: string): boolean {
104
- let doc: unknown;
105
- try { doc = parseYaml(selectorText); } catch { return selectorText.trim().length >= 40; }
106
- if (!doc || typeof doc !== 'object') return false;
107
- // A real cell, not a marker left to be filled in. Numbers count (an id or index can be numeric).
108
- const real = (v: unknown): boolean => (typeof v === 'string' || typeof v === 'number')
109
- && String(v).trim() !== '' && !/^(?:todo|tbd|placeholder|replace me)$/i.test(String(v).trim());
110
- return Object.values(doc as Record<string, unknown>).some((e) => {
111
- if (!e || typeof e !== 'object') return false;
112
- const { type, value, name, locator } = e as { type?: unknown; value?: unknown; name?: unknown; locator?: unknown };
113
- // Every SelectorEntry shape: a CSS `locator`, or a non-page `type` with a value or a role name.
114
- return real(locator) || (typeof type === 'string' && type !== 'page' && (real(value) || real(name)));
115
- });
116
- }
117
-
118
108
  export function readUnitState(
119
- projectRoot: string, unitDir: string, unit: string, kind: UnitState['kind'],
109
+ projectRoot: string, unitDir: string, unit: string, kind: UnitState['kind'], opts: ReadUnitStateOptions = {},
120
110
  ): UnitState {
121
111
  const req = path.join(unitDir, 'requirements');
122
112
  const slug = reportSlug(unit);
123
- const audit = readJson(path.join(projectRoot, '.sungen', 'reports', `${slug}-audit.json`));
113
+ const { report: audit, notCounted } = readTrustedAudit(projectRoot, unit);
124
114
  const selectorsDir = path.join(unitDir, 'selectors');
125
115
  let selectorFiles: string[] = [];
126
116
  try {
127
117
  selectorFiles = fs.readdirSync(selectorsDir).filter((f) => f.endsWith('.yaml'));
128
118
  } catch { /* api units carry no selectors */ }
129
- // `readTextFile` throws on a missing file, and every path here is legitimately absent at some
130
- // point in a unit's life — the resolver exists to report exactly that, so it must not crash on it.
131
- const read = (p: string): string => (fs.existsSync(p) ? readTextFile(p) : '');
132
- const selectorTexts = selectorFiles.map((f) => read(path.join(selectorsDir, f)));
119
+ const selectorTexts = selectorFiles.map((f) => readIfExists(path.join(selectorsDir, f)));
133
120
  const contractPath = path.join(req, 'flow-contract.yaml');
134
- const contractText = read(contractPath);
135
-
136
- const specDirs = [
137
- path.join(projectRoot, 'specs', 'generated', 'flows', unit),
138
- path.join(projectRoot, 'specs', 'generated', unit),
139
- ];
140
- const compiled = specDirs.some((d) => {
141
- try {
142
- return fs.readdirSync(d).some((f) => f.endsWith('.spec.ts'));
143
- } catch { return false; }
144
- });
145
- const hasResults = specDirs.some((d) => {
146
- try {
147
- // `<f>-test-result[.<os>][.<env>].json` — a mobile run writes the OS into the name, an env
148
- // run (SUNGEN_ENV=staging) the env; both are runs (#868).
149
- return fs.readdirSync(d).some((f) => RESULT_FILE.test(f));
150
- } catch { return false; }
151
- });
152
- let hasDeliverable = false;
153
- try {
154
- hasDeliverable = fs.readdirSync(path.join(projectRoot, 'qa', 'deliverables'))
155
- .some((f) => f.startsWith(`${slug}-`));
156
- } catch { /* nothing exported yet */ }
121
+ const resultFiles = unitResultFiles(projectRoot, unit);
157
122
 
158
123
  const score = (audit?.score ?? {}) as { overall?: number };
159
124
  const baseline = (audit?.viewpointBaseline ?? {}) as { status?: string };
@@ -161,19 +126,19 @@ export function readUnitState(
161
126
  unit, kind,
162
127
  hasSpec: exists(path.join(req, 'spec.md')),
163
128
  hasViewpoint: exists(path.join(req, 'test-viewpoint.md')),
164
- // An id-less draft has nothing to accept: only the missing-yardstick step speaks for it.
165
- viewpointIsAiDraft: viewpointFileIsAiDraft(path.join(req, 'test-viewpoint.md'))
166
- && readViewpointDeclaration(path.join(req, 'test-viewpoint.md')) !== null,
167
129
  hasContract: exists(contractPath),
168
130
  // A contract WITHOUT `flows:` can only be scored per phase, which is a materially weaker
169
131
  // claim — so it is part of the state, not a detail.
170
- hasFlowInventory: /^\s*flows:\s*$/m.test(contractText),
132
+ hasFlowInventory: /^\s*flows:\s*$/m.test(readIfExists(contractPath)),
171
133
  scenarioCount: countScenarios(unitDir, unit),
172
134
  hasSelectors: selectorFiles.length > 0,
173
135
  // A scaffolded selector file exists but resolves nothing; treating it as "done" is what
174
136
  // makes a run look further along than it is.
175
137
  selectorsArePlaceholder: selectorFiles.length > 0 && !selectorTexts.some(hasResolvedSelector),
176
- compiled, hasResults, hasDeliverable,
138
+ compiled: isCompiled(projectRoot, unit),
139
+ hasResults: resultFiles.length > 0,
140
+ failedCount: countFailedResults(resultFiles),
141
+ hasDeliverable: hasDeliverableFor(projectRoot, slug),
177
142
  assetsDrift: (() => {
178
143
  const d = checkAssetsDrift(projectRoot);
179
144
  return d && d.recordedVersion !== d.runningVersion
@@ -188,140 +153,24 @@ export function readUnitState(
188
153
  viewpointBaselineStatus: baseline.status,
189
154
  }
190
155
  : undefined,
156
+ ...(notCounted ? { auditNotCounted: notCounted } : {}),
191
157
  steps: [],
192
158
  };
159
+ let contract: ContractFacts | undefined;
160
+ if (state.scenarioCount > 0) state.contract = (contract = readContractFacts(projectRoot, unit, unitDir, opts.gitSnapshot)).summary;
161
+ try {
162
+ state.testCases = testCaseStates(projectRoot, unit, { unitDir, auditFindings: state.audit?.findings ?? [] })
163
+ .map((tc) => (contract?.cases.has(tc.id) ? { ...tc, contract: contract.cases.get(tc.id) } : tc));
164
+ } catch { /* an unparseable .feature — the unit-level nodes still answer, as before test-case state */ }
193
165
  state.steps = deriveSteps(state);
194
166
  return state;
195
167
  }
196
168
 
197
- /** The finding codes worth naming in a next step — each maps to a specific repair. */
198
- const REPAIRABLE = [
199
- 'FLOW-CONTRACT-MISSING', 'FLOW-INVENTORY-MISSING', 'FLOW-UNCOVERED', 'FLOW-UNDECLARED',
200
- 'FLOW-PHASE-MISFILED', 'FLOW-GUARANTEE-MISSING', 'FLOW-OUTCOME-UNPROVEN', 'CONTINUITY-ONE-SIDED',
201
- 'ORACLE-URL-ONLY',
202
- 'SPEC-RESTATED-UNVERIFIED', 'VIEWPOINT-GESTURE-SUBSTITUTED', 'SPEC-UNCOVERED', 'SPEC-CLAUSE-UNCOVERED',
203
- 'TRIGGER-UNCOVERED', 'PERMISSION-PAIR-MISSING', 'VISIBILITY-PAIR-MISSING',
204
- 'VIEWPOINT-ITEM-MISSING', 'MANUAL-CODE-MISSING', 'MANUAL-AUTOMATABLE', 'DEPTH-DEFERRED',
205
- 'UI-INVENTORY-MISSING', 'UI-INVENTORY-INCOMPLETE', 'UI-ITEM-UNCOVERED',
206
- ];
207
-
208
169
  /**
209
- * The ordered answer. Earliest unmet precondition first, so the list reads as a path rather than
210
- * a menu — and a `blocked` step names what to resolve instead of pretending it can run.
170
+ * The ordered answer — earliest unmet precondition first, so the list reads as a path rather than a
171
+ * menu. Evaluated over the internal node graph (src/graph, OES-10.1): each former if/return branch
172
+ * is one node, and an open blocking node cuts everything after it, exactly as the `return`s did.
211
173
  */
212
- export function deriveSteps(s: UnitState): NextStep[] {
213
- const out: NextStep[] = [];
214
- const design = s.kind === 'api' ? `/sungen:create-test ${s.unit}` : `/sungen:create-test ${s.unit}`;
215
-
216
- if (!s.hasSpec && !s.hasViewpoint) {
217
- out.push({
218
- kind: 'blocked',
219
- command: `write qa/${s.kind === 'screen' ? 'screens' : s.kind === 'flow' ? 'flows' : 'api'}/${s.unit}/requirements/spec.md`,
220
- because: 'the unit has neither a spec nor a test-viewpoint, so there is nothing to generate FROM — generation without a source invents behaviour',
221
- });
222
- return out;
223
- }
224
- // Stale AI assets come FIRST, because they invalidate the advice below: a HARD RULE added to
225
- // `create-test` reaches nobody until `sungen update` runs, so the run that follows will repeat
226
- // whatever the old instructions said. Upgrading the package alone does not refresh them, and the
227
- // existing warning is one grey stderr line among a command's whole output (#620).
228
- if (s.assetsDrift) {
229
- out.push({
230
- kind: 'do',
231
- command: 'sungen update',
232
- because: `this project's AI commands/skills were written by sungen ${s.assetsDrift.recordedVersion} and you are running ${s.assetsDrift.runningVersion} — upgrading the package does NOT refresh them, so any rule added since ${s.assetsDrift.recordedVersion} is not in effect for the next run`,
233
- });
234
- }
235
- // The yardstick. `atomicLedger` and `traceability` are measured against test-viewpoint.md and
236
- // four sensors read it, so its absence is not cosmetic — and it can go missing from a unit that
237
- // already HAS a spec (a run deleted it), which the "no source at all" branch above never sees.
238
- if (!s.hasViewpoint) {
239
- out.push({
240
- kind: 'blocked',
241
- command: s.kind === 'flow'
242
- ? `sungen add-flow --flow ${s.unit} --path <start-url> # repairs the missing scaffold; never overwrites`
243
- : `write qa/screens/${s.unit}/requirements/test-viewpoint.md`,
244
- because: 'requirements/test-viewpoint.md is missing — it is the yardstick `atomicLedger` and `traceability` are measured against, and four sensors read it, so the audit reports VIEWPOINT-MISSING and those axes are excluded. A flow contract does not substitute: it declares the use case, the viewpoint declares the claims',
245
- });
246
- }
247
- if (s.kind === 'flow' && !s.hasContract) {
248
- out.push({
249
- kind: 'blocked',
250
- command: `author requirements/flow-contract.yaml, then ${design}`,
251
- because: 'a flow with no contract is scored as a generic screen against page-type themes a journey cannot have (FLOW-CONTRACT-MISSING)',
252
- });
253
- return out;
254
- }
255
- // Before any generation: the AI drafts the viewpoint and audits it BEFORE it writes scenarios, so
256
- // this is exactly where a draft would otherwise be accepted by the process that wrote it.
257
- if (s.viewpointIsAiDraft) {
258
- out.push({
259
- kind: 'decide',
260
- command: `sungen audit --screen ${s.unit} --accept-viewpoint`,
261
- because: 'test-viewpoint.md is marked `drafted-by: ai` — nobody has reviewed it, so the ledger and traceability axes are held as unverified. A QA reviews the claims (adds what matters, deletes what does not), then accepts; the command records the baseline and removes the marker. A decision, not a step: an agent presents it and does not run it',
262
- });
263
- }
264
- if (s.scenarioCount === 0) {
265
- out.push({ kind: 'do', command: design, because: 'no scenarios exist yet' });
266
- return out;
267
- }
268
- if (s.kind === 'flow' && !s.hasFlowInventory) {
269
- out.push({
270
- kind: 'do',
271
- command: `add \`flows:\` to requirements/flow-contract.yaml, then sungen audit --screen ${s.unit}`,
272
- because: 'without the inventory, coverage is measured per PHASE — and a phase counts as covered as soon as one scenario carries it, so the number cannot tell you a flow is missing',
273
- });
274
- }
275
- if (!s.audit) {
276
- out.push({ kind: 'do', command: `sungen audit --screen ${s.unit}`, because: 'the suite has never been measured' });
277
- return out;
278
- }
279
- if (s.audit.viewpointBaselineStatus === 'changed' && !s.viewpointIsAiDraft) { // the draft's own decide step is already above
280
- out.push({
281
- kind: 'decide',
282
- command: `sungen audit --screen ${s.unit} --accept-viewpoint`,
283
- because: 'test-viewpoint.md changed since the accepted baseline, so the ledger and traceability axes are not evidence until a QA confirms the new declaration. A decision, not a step: an agent presents it and does not run it — accepting the yardstick you just wrote makes both axes read 100% by construction',
284
- });
285
- }
286
- const repair = s.audit.findings
287
- .map((f) => f.split(':')[0].trim())
288
- .filter((code) => REPAIRABLE.includes(code));
289
- if (repair.length > 0) {
290
- out.push({
291
- kind: 'do',
292
- command: `repair, then sungen audit --screen ${s.unit}`,
293
- because: `${repair.length} finding(s) name a specific repair: ${[...new Set(repair)].slice(0, 4).join(', ')}`,
294
- });
295
- }
296
- if (s.audit.gateStatus === 'FAIL') {
297
- out.push({
298
- kind: 'blocked',
299
- command: `repair the gate, then sungen audit --screen ${s.unit}`,
300
- because: `the viewpoint gate is FAIL at ${s.audit.overall}/10 — running tests against a design that fails its own gate measures the wrong thing`,
301
- });
302
- return out;
303
- }
304
- if (s.kind !== 'api' && (!s.hasSelectors || s.selectorsArePlaceholder)) {
305
- out.push({
306
- kind: 'do',
307
- command: `/sungen:run-test ${s.unit}`,
308
- because: s.hasSelectors
309
- ? 'the selector file is still a placeholder, so nothing resolves against a live page'
310
- : 'no selectors exist yet — run-test generates them from the live page, compiles and auto-fixes',
311
- });
312
- return out;
313
- }
314
- if (!s.compiled) {
315
- out.push({ kind: 'do', command: `sungen generate --${s.kind === 'flow' ? 'flow' : 'screen'} ${s.unit}`, because: 'the suite has not been compiled to a spec yet' });
316
- return out;
317
- }
318
- if (!s.hasResults) {
319
- out.push({ kind: 'do', command: `/sungen:run-test ${s.unit}`, because: 'the compiled spec has never been run, so every case is Pending' });
320
- return out;
321
- }
322
- if (!s.hasDeliverable) {
323
- out.push({ kind: 'do', command: `/sungen:delivery ${s.unit}`, because: 'results exist but have not been exported to the Test Case & Coverage Matrix' });
324
- }
325
- out.push({ kind: 'optional', command: `/sungen:create-test ${s.unit}`, because: 'extend coverage — the next tier, or the flows the inventory still lists as pending' });
326
- return out;
174
+ export function deriveSteps(s: UnitState, opts: EvaluateOptions = {}): NextStep[] {
175
+ return evaluateGraph(CORE_NODES, s, s.testCases, opts);
327
176
  }
@@ -8,7 +8,6 @@
8
8
  import * as fs from 'fs';
9
9
  import { GherkinParser, ParsedScenario, ParsedStep } from '../generators/gherkin-parser';
10
10
  import { readTextFile, readViewpointText } from './read-text';
11
- import { parsePriority, toEntryPriority } from './viewpoint-priority';
12
11
  import { featureFilesFor } from './unit-paths';
13
12
 
14
13
  export type Priority = 'high' | 'normal' | 'low' | 'unknown';
@@ -16,7 +15,7 @@ export type Priority = 'high' | 'normal' | 'low' | 'unknown';
16
15
  export interface ViewpointEntry {
17
16
  id: string; // e.g. VP-DATA-CONSISTENCY
18
17
  priority: 'High' | 'Medium' | 'Low' | 'Unknown';
19
- /** The declared priority word as written (`critical` · `high` · `medium` · `med` · `normal` · `low` ·
18
+ /** The declared priority word as written (`critical` · `high` · `medium` · `normal` · `low` ·
20
19
  * `deferred` · `skip`, which also stands for skipped / n/a / none / not applicable), kept because `priority` folds several of them together and the
21
20
  * PRIORITY-CONTRADICTED check needs them apart. Absent when no priority was declared. */
22
21
  priorityWord?: string;
@@ -26,14 +25,14 @@ export interface ViewpointEntry {
26
25
 
27
26
  /**
28
27
  * Whole SECTIONS that declare something ABOUT the checklist rather than listing claims or
29
- * viewpoints — known issues, spec gaps, traceability indexes, references and appendices, changelogs. Shared by the atomic
28
+ * viewpoints — known issues, traceability indexes, references, changelogs. Shared by the atomic
30
29
  * ledger (their rows are not claims to prove, #630) and the viewpoint-overview parser (an id
31
30
  * listed there is a reference, not a declaration, #833). `UI Patterns Identified` is the author's
32
31
  * pick of WHICH sungen-viewpoint patterns apply — a `Skip` row there is not a claim to cover (#841).
33
32
  * A `How to run` / `Procedure` section — that exact heading, optionally naming one id — is a manual
34
33
  * check's steps, not claims of its own (#855); `How to test the login flow` stays a normal section.
35
34
  */
36
- export const NON_DECLARATION_SECTION = /^(?:(?:ui patterns?(?: identified)?|(?:how to (?:run|test|reproduce|verify)|(?:manual )?procedures?)(?:\s+(?:vp|fl)-[^\s:]+)?)\s*:?$|(?:known issues?|open questions?|spec gaps?|appendi(?:x|ces)|phụ lục|deferred|out of scope|viewpoint grouping|traceability|metadata|scope|journey phases?|revision history|references?|sources?|changelog)\b)/i;
35
+ export const NON_DECLARATION_SECTION = /^(?:(?:ui patterns?(?: identified)?|(?:how to (?:run|test|reproduce|verify)|(?:manual )?procedures?)(?:\s+(?:vp|fl)-[^\s:]+)?)\s*:?$|(?:known issues?|open questions?|deferred|out of scope|viewpoint grouping|traceability|metadata|scope|journey phases?|revision history|references?|sources?|changelog)\b)/i;
37
36
 
38
37
  /**
39
38
  * Every word a viewpoint row may declare as its priority — ONE list for the overview parser, the
@@ -41,7 +40,7 @@ export const NON_DECLARATION_SECTION = /^(?:(?:ui patterns?(?: identified)?|(?:h
41
40
  * `Skip` that the `sungen add` / `add-flow` scaffolds themselves suggest (#853). `deferred` and the
42
41
  * not-applicable words are declarations as well: such a row is not a claim to cover.
43
42
  */
44
- export const PRIORITY_WORDS = 'critical|high|medium|med|normal|low|deferred|skip(?:ped)?|n\\/a|none|not applicable';
43
+ export const PRIORITY_WORDS = 'critical|high|medium|normal|low|deferred|skip(?:ped)?|n\\/a|none|not applicable';
45
44
  /** "Declared not applicable" — folded to `skip` so every consumer checks one word. */
46
45
  const NOT_APPLICABLE = /^(?:skip(?:ped)?|n\/a|none|not applicable)$/i;
47
46
 
@@ -55,7 +54,7 @@ const PRIORITY_HEADER = /^(?:priority|pri|level|severity|優先度?|độ ưu ti
55
54
  function priorityOf(cell: string): { priority: ViewpointEntry['priority']; priorityWord?: string } {
56
55
  const raw = cell.match(PRIORITY_WORD)?.[1].toLowerCase();
57
56
  const word = raw && NOT_APPLICABLE.test(raw) ? 'skip' : raw;
58
- const priority = toEntryPriority(parsePriority(cell));
57
+ const priority = /high/i.test(cell) ? 'High' : /medium/i.test(cell) ? 'Medium' : /low/i.test(cell) ? 'Low' : 'Unknown';
59
58
  return word ? { priority, priorityWord: word } : { priority };
60
59
  }
61
60
 
@@ -64,9 +63,6 @@ export interface ScenarioInfo {
64
63
  vpCode?: string; // VP-CART-001 style code in the scenario title
65
64
  category?: string; // CART, LIST, VAL, ... (from the code)
66
65
  priority: Priority;
67
- /** The priority tag as written, lower-cased, without `@` — keeps `critical` / `medium` / `med`, which
68
- * `priority` has no slot for, so PRIORITY-CONTRADICTED can fold it like the declared word (#861). */
69
- priorityTag?: string;
70
66
  manual: boolean;
71
67
  thenCount: number;
72
68
  hasDataAssertion: boolean; // a Then asserts {{data}} / contains / match data
@@ -83,6 +79,7 @@ export interface ScenarioInfo {
83
79
  deferredToFlow?: boolean; // @deferred:flow — owned by a flow, not automated on this screen (H6)
84
80
  ownedByFlow?: string; // @owned-by:<flow> — the flow that owns this deferred scenario (H6)
85
81
  featureManual?: boolean; // its Feature is tagged @manual — codegen skips the whole file (#835)
82
+ handWritten?: boolean; // @free / @impl:code — counted, never compiled (isHandWritten, DOS-14.8)
86
83
  /** Ordered steps with their resolved bucket (And/But inherit) — flow handoff analysis (#569). */
87
84
  /** `arg` = the step's data table, normalised (#817) — absent when the step has none. */
88
85
  steps?: Array<{ bucket: 'given' | 'when' | 'then'; text: string; arg?: string }>;
@@ -332,9 +329,6 @@ function classifyScenario(sc: ParsedScenario): ScenarioInfo {
332
329
  const requiresCaps = tags.filter((t) => /^@requires:/i.test(t)).map((t) => t.slice('@requires:'.length).trim().toLowerCase()).filter(Boolean);
333
330
  let priority: Priority = 'unknown';
334
331
  for (const t of tags) if (PRIORITY_TAGS[t]) priority = PRIORITY_TAGS[t];
335
- // Deliberately wider than `priority` (every priority word, any case): only PRIORITY-CONTRADICTED reads
336
- // it, so `@critical` / `@High` are judged there without moving what select-by-ids or the score see.
337
- const priorityTag = [...tags].reverse().find((t) => /^@(?:critical|high|medium|med|normal|low)$/i.test(t))?.slice(1).toLowerCase();
338
332
 
339
333
  const { vpCode, category } = vpCodeOf(sc.name);
340
334
  // Project-scheme ID: the leading token of the title (VP0-001 / MS-HP-001 / VP-LIST-001).
@@ -386,7 +380,6 @@ function classifyScenario(sc: ParsedScenario): ScenarioInfo {
386
380
  vpCode,
387
381
  category,
388
382
  priority,
389
- priorityTag,
390
383
  manual,
391
384
  thenCount,
392
385
  hasDataAssertion: hasData,
@@ -412,9 +405,26 @@ export function loadScenarios(featurePath: string): ScenarioInfo[] {
412
405
  const feature = parser.parseFeatureFile(featurePath);
413
406
  // Kept apart from `manual` so the audit's accounting is unchanged; only `select` reads it.
414
407
  const featureManual = (feature.tags || []).some((t: string) => /^@manual\b/i.test(t)) || undefined;
408
+ // A derived `@proposed` scenario (sungen contract derive, DOS-14.8) is not counted until QA approves it;
409
+ // an approved `@free` / `@impl:code` one IS counted, but never compiled (`handWritten`).
410
+ const tagsOf = (s: { tags?: string[] }): string[] => [...(feature.tags || []), ...(s.tags || [])];
415
411
  return (feature.scenarios || [])
416
- .filter((s) => !s.stepsName && !s.hookType) // skip @steps/@hook blocks
417
- .map((s) => ({ ...classifyScenario(withBackground(s, feature.background)), sourceFile: featurePath, featureManual }));
412
+ .filter((s) => !s.stepsName && !s.hookType && !tagsOf(s).some((t) => PROPOSED_TAG.test(t))) // skip @steps/@hook blocks and unapproved proposals
413
+ .map((s) => ({
414
+ ...classifyScenario(withBackground(s, feature.background)), sourceFile: featurePath, featureManual,
415
+ handWritten: isHandWritten(tagsOf(s), featurePath) || undefined,
416
+ }));
417
+ }
418
+
419
+ const PROPOSED_TAG = /^@proposed$/i;
420
+
421
+ /**
422
+ * Is a scenario implemented by HAND-WRITTEN code rather than compiled (DOS-14.2, 14.8)? `@free`,
423
+ * `@impl:code`, a derived `@proposed`, or anything in a derived `*.free.feature`. The one predicate
424
+ * codegen (never compiles these), script-check (never expects a compiled twin) and the harness share.
425
+ */
426
+ export function isHandWritten(tags: readonly string[], featureFile?: string): boolean {
427
+ return (!!featureFile && featureFile.endsWith('.free.feature')) || tags.some((t) => /^@(?:free|impl:code|proposed)$/i.test(t));
418
428
  }
419
429
 
420
430
  /**
@@ -18,6 +18,8 @@ import * as os from 'os';
18
18
  import { loadUnitScenarios, ScenarioInfo } from './parse';
19
19
  import { featureFilesFor } from './unit-paths';
20
20
  import { readTextFile } from './read-text';
21
+ import { CATALOG_GATE_RULES } from './gates/resolve-rule';
22
+ import { evaluateGateTerms } from './gates/gate-terms';
21
23
 
22
24
  export interface ScriptCheckResult {
23
25
  screen: string;
@@ -340,7 +342,8 @@ function findSpecs(dir: string, name: string, kind: UnitKind): string[] {
340
342
  export async function runScriptCheck(screenDir: string, screenName: string, kind: UnitKind): Promise<ScriptCheckResult> {
341
343
  const featureFiles = featureFilesFor(screenDir, screenName);
342
344
  const scenarios = loadUnitScenarios(screenDir, screenName);
343
- const automated = scenarios.filter((s) => !s.manual);
345
+ // Hand-written (@free / @impl:code) scenarios are proven by their traces, not compiled — no twin expected.
346
+ const automated = scenarios.filter((s) => !s.manual && !s.handWritten);
344
347
  const manual = scenarios.filter((s) => s.manual);
345
348
 
346
349
  const committedSpecs = findSpecs(path.join(process.cwd(), 'specs', 'generated'), screenName, kind);
@@ -388,9 +391,10 @@ export async function runScriptCheck(screenDir: string, screenName: string, kind
388
391
  // failed regenerate degrades check C to its heuristic instead of crashing it.
389
392
  let stepTrace: Map<string, string[]> | undefined;
390
393
  if (committedSpec) {
394
+ let tmp: string | undefined;
391
395
  try {
392
396
  const { CodeGenerator } = require('../generators/test-generator/code-generator');
393
- const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'sungen-scriptcheck-'));
397
+ tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'sungen-scriptcheck-'));
394
398
  const qaSourceDir = path.join(process.cwd(), 'qa', kind === 'flow' ? 'flows' : kind === 'api' ? 'api' : 'screens');
395
399
  // api units derive their unit id (api/<area>) from the feature path — like `generate --api`;
396
400
  // screen/flow pass screenName + flowMode explicitly (unchanged → byte-identical regenerate).
@@ -428,9 +432,11 @@ export async function runScriptCheck(screenDir: string, screenName: string, kind
428
432
  if (drift === 'drift') {
429
433
  findings.push('DRIFT: committed spec differs from a fresh regenerate → spec was hand-edited or the .feature changed without `sungen generate`. The test code no longer reflects the Gherkin.');
430
434
  }
431
- fs.rmSync(tmp, { recursive: true, force: true });
432
435
  } catch (e) {
433
436
  findings.push(`Drift check skipped (regenerate failed): ${e instanceof Error ? e.message : e}`);
437
+ } finally {
438
+ // Removed on every path: a throwing regenerate used to leave one sungen-scriptcheck-* dir per call.
439
+ if (tmp) fs.rmSync(tmp, { recursive: true, force: true });
434
440
  }
435
441
  }
436
442
 
@@ -446,7 +452,16 @@ export async function runScriptCheck(screenDir: string, screenName: string, kind
446
452
  }
447
453
  const bypass = assertionlessTests.length > 0 || hollowSteps.length > 0;
448
454
 
449
- const ok = !!committedSpec && countMatch && missingInSpec.length === 0 && extraInSpec.length === 0 && drift === 'in-sync' && !bypass;
455
+ // Every term is a hard rule (the #387 drift family): no gate-override can lower one, so the
456
+ // catalog alone decides (OES-11.3).
457
+ const faithful = evaluateGateTerms([
458
+ { rule: 'script.no-spec', holds: !!committedSpec },
459
+ { rule: 'script.count-mismatch', holds: countMatch },
460
+ { rule: 'script.missing-in-spec', holds: missingInSpec.length === 0 },
461
+ { rule: 'script.extra-in-spec', holds: extraInSpec.length === 0 },
462
+ { rule: 'script.drift', holds: drift === 'in-sync' },
463
+ { rule: 'script.bypass', holds: !bypass },
464
+ ], CATALOG_GATE_RULES);
450
465
 
451
466
  return {
452
467
  screen: screenName,
@@ -462,7 +477,7 @@ export async function runScriptCheck(screenDir: string, screenName: string, kind
462
477
  assertionlessTests,
463
478
  hollowSteps,
464
479
  bypass,
465
- status: ok ? 'OK' : 'FAIL',
480
+ status: faithful.pass ? 'OK' : 'FAIL',
466
481
  findings,
467
482
  };
468
483
  }