@kontourai/flow-agents 4.0.0 → 4.1.0

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 (451) hide show
  1. package/.github/workflows/ci.yml +8 -0
  2. package/CHANGELOG.md +27 -0
  3. package/CONTEXT.md +5 -0
  4. package/agents/tool-security-reviewer.json +1 -1
  5. package/build/src/cli/init.js +35 -3
  6. package/build/src/cli/kit.js +95 -2
  7. package/build/src/cli/pull-work-provider.js +7 -1
  8. package/build/src/cli/validate-workflow-artifacts.js +53 -0
  9. package/build/src/cli/workflow.js +5 -1
  10. package/build/src/flow-kit/provision.d.ts +23 -0
  11. package/build/src/flow-kit/provision.js +99 -0
  12. package/build/src/flow-kit/validate.d.ts +52 -0
  13. package/build/src/flow-kit/validate.js +214 -9
  14. package/build/src/runtime-adapters.js +1 -1
  15. package/context/contracts/execution-contract.md +30 -1
  16. package/context/contracts/review-contract.md +4 -0
  17. package/context/contracts/trigger-guards.md +73 -0
  18. package/context/settings/backlog-provider-settings.json +1 -1
  19. package/context/settings/workspace-backlog-provider-settings.example.json +1 -1
  20. package/dist/base/build/package.json +1 -1
  21. package/dist/base/build/src/cli/init.js +35 -3
  22. package/dist/base/build/src/cli/kit.js +95 -2
  23. package/dist/base/build/src/cli/pull-work-provider.js +7 -1
  24. package/dist/base/build/src/cli/validate-workflow-artifacts.js +53 -0
  25. package/dist/base/build/src/cli/workflow.js +5 -1
  26. package/dist/base/build/src/flow-kit/provision.d.ts +23 -0
  27. package/dist/base/build/src/flow-kit/provision.js +99 -0
  28. package/dist/base/build/src/flow-kit/validate.d.ts +52 -0
  29. package/dist/base/build/src/flow-kit/validate.js +214 -9
  30. package/dist/base/build/src/runtime-adapters.js +1 -1
  31. package/dist/base/context/contracts/execution-contract.md +30 -1
  32. package/dist/base/context/contracts/review-contract.md +4 -0
  33. package/dist/base/context/contracts/trigger-guards.md +73 -0
  34. package/dist/base/context/settings/backlog-provider-settings.json +1 -1
  35. package/dist/base/context/settings/workspace-backlog-provider-settings.example.json +1 -1
  36. package/dist/base/docs/adr/0023-kit-provisioning.md +47 -0
  37. package/dist/base/docs/adr/index.md +1 -0
  38. package/dist/base/docs/architecture-engine-and-kits.md +17 -0
  39. package/dist/base/docs/context-map.md +3 -0
  40. package/dist/base/docs/decisions/backlog-readiness-source.md +89 -0
  41. package/dist/base/docs/decisions/index.md +1 -0
  42. package/dist/base/docs/developer-architecture.md +3 -3
  43. package/dist/base/docs/flow-kit-repository-contract.md +34 -3
  44. package/dist/base/docs/kit-authoring-guide.md +1 -1
  45. package/dist/base/docs/veritas-integration.md +12 -0
  46. package/dist/base/evals/ci/run-baseline.sh +4 -0
  47. package/dist/base/evals/integration/test_kit_provisioning.sh +112 -0
  48. package/dist/base/evals/integration/test_pull_work_provider.sh +18 -0
  49. package/dist/base/evals/integration/test_veritas_governance_kit.sh +256 -0
  50. package/dist/base/evals/integration/test_workflow_artifacts.sh +257 -0
  51. package/dist/base/evals/static/test_package.sh +6 -0
  52. package/dist/base/evals/static/test_workflow_skills.sh +16 -0
  53. package/dist/base/install.sh +1 -1
  54. package/dist/base/kits/builder/flows/publish-learn.flow.json +9 -1
  55. package/dist/base/kits/builder/skills/execute-plan/SKILL.md +4 -3
  56. package/dist/base/kits/builder/skills/pull-work/SKILL.md +12 -0
  57. package/dist/base/kits/builder/skills/review-work/SKILL.md +11 -0
  58. package/dist/base/kits/veritas-governance/adapter/readiness-to-trust-bundle.mjs +19 -20
  59. package/dist/base/kits/veritas-governance/assets/starter-hooks/githooks/post-commit +13 -0
  60. package/dist/base/kits/veritas-governance/assets/starter-hooks/githooks/pre-push +13 -0
  61. package/dist/base/kits/veritas-governance/assets/starter-standards/veritas/GOVERNANCE.md +23 -0
  62. package/dist/base/kits/veritas-governance/assets/starter-standards/veritas/README.md +58 -0
  63. package/dist/base/kits/veritas-governance/assets/starter-standards/veritas/authority/default.authority-settings.json +30 -0
  64. package/dist/base/kits/veritas-governance/assets/starter-standards/veritas/repo-map.json +115 -0
  65. package/dist/base/kits/veritas-governance/assets/starter-standards/veritas/repo-standards/default.repo-standards.json +54 -0
  66. package/dist/base/kits/veritas-governance/assets/starter-standards/veritas.claims.json +179 -0
  67. package/dist/base/kits/veritas-governance/docs/README.md +141 -10
  68. package/dist/base/kits/veritas-governance/fixtures/standards-authoring/approved.trust-bundle.json +74 -0
  69. package/dist/base/kits/veritas-governance/fixtures/standards-authoring/not-approved.trust-bundle.json +74 -0
  70. package/dist/base/kits/veritas-governance/flows/standards-authoring.flow.json +35 -0
  71. package/dist/base/kits/veritas-governance/kit.json +65 -0
  72. package/dist/base/kits/veritas-governance/skills/consult-standards/SKILL.md +73 -0
  73. package/dist/base/kits/veritas-governance/skills/standards-authoring/SKILL.md +87 -0
  74. package/dist/base/schemas/backlog-provider-settings.schema.json +1 -1
  75. package/dist/base/schemas/workflow-waves.schema.json +347 -0
  76. package/dist/base/scripts/check-layer-boundary.mjs +98 -0
  77. package/dist/catalog.json +2 -0
  78. package/dist/claude-code/.claude/agents/tool-security-reviewer.md +2 -1
  79. package/dist/claude-code/.claude/skills/consult-standards/SKILL.md +73 -0
  80. package/dist/claude-code/.claude/skills/execute-plan/SKILL.md +4 -3
  81. package/dist/claude-code/.claude/skills/pull-work/SKILL.md +12 -0
  82. package/dist/claude-code/.claude/skills/review-work/SKILL.md +11 -0
  83. package/dist/claude-code/.claude/skills/standards-authoring/SKILL.md +87 -0
  84. package/dist/claude-code/build/package.json +1 -1
  85. package/dist/claude-code/build/src/cli/init.js +35 -3
  86. package/dist/claude-code/build/src/cli/kit.js +95 -2
  87. package/dist/claude-code/build/src/cli/pull-work-provider.js +7 -1
  88. package/dist/claude-code/build/src/cli/validate-workflow-artifacts.js +53 -0
  89. package/dist/claude-code/build/src/cli/workflow.js +5 -1
  90. package/dist/claude-code/build/src/flow-kit/provision.d.ts +23 -0
  91. package/dist/claude-code/build/src/flow-kit/provision.js +99 -0
  92. package/dist/claude-code/build/src/flow-kit/validate.d.ts +52 -0
  93. package/dist/claude-code/build/src/flow-kit/validate.js +214 -9
  94. package/dist/claude-code/build/src/runtime-adapters.js +1 -1
  95. package/dist/claude-code/context/contracts/execution-contract.md +30 -1
  96. package/dist/claude-code/context/contracts/review-contract.md +4 -0
  97. package/dist/claude-code/context/contracts/trigger-guards.md +73 -0
  98. package/dist/claude-code/context/settings/backlog-provider-settings.json +1 -1
  99. package/dist/claude-code/context/settings/workspace-backlog-provider-settings.example.json +1 -1
  100. package/dist/claude-code/docs/adr/0023-kit-provisioning.md +47 -0
  101. package/dist/claude-code/docs/adr/index.md +1 -0
  102. package/dist/claude-code/docs/architecture-engine-and-kits.md +17 -0
  103. package/dist/claude-code/docs/context-map.md +3 -0
  104. package/dist/claude-code/docs/decisions/backlog-readiness-source.md +89 -0
  105. package/dist/claude-code/docs/decisions/index.md +1 -0
  106. package/dist/claude-code/docs/developer-architecture.md +3 -3
  107. package/dist/claude-code/docs/flow-kit-repository-contract.md +34 -3
  108. package/dist/claude-code/docs/kit-authoring-guide.md +1 -1
  109. package/dist/claude-code/docs/veritas-integration.md +12 -0
  110. package/dist/claude-code/evals/ci/run-baseline.sh +4 -0
  111. package/dist/claude-code/evals/integration/test_kit_provisioning.sh +112 -0
  112. package/dist/claude-code/evals/integration/test_pull_work_provider.sh +18 -0
  113. package/dist/claude-code/evals/integration/test_veritas_governance_kit.sh +256 -0
  114. package/dist/claude-code/evals/integration/test_workflow_artifacts.sh +257 -0
  115. package/dist/claude-code/evals/static/test_package.sh +6 -0
  116. package/dist/claude-code/evals/static/test_workflow_skills.sh +16 -0
  117. package/dist/claude-code/install.sh +1 -1
  118. package/dist/claude-code/kits/builder/flows/publish-learn.flow.json +9 -1
  119. package/dist/claude-code/kits/builder/skills/execute-plan/SKILL.md +4 -3
  120. package/dist/claude-code/kits/builder/skills/pull-work/SKILL.md +12 -0
  121. package/dist/claude-code/kits/builder/skills/review-work/SKILL.md +11 -0
  122. package/dist/claude-code/kits/veritas-governance/adapter/readiness-to-trust-bundle.mjs +19 -20
  123. package/dist/claude-code/kits/veritas-governance/assets/starter-hooks/githooks/post-commit +13 -0
  124. package/dist/claude-code/kits/veritas-governance/assets/starter-hooks/githooks/pre-push +13 -0
  125. package/dist/claude-code/kits/veritas-governance/assets/starter-standards/veritas/GOVERNANCE.md +23 -0
  126. package/dist/claude-code/kits/veritas-governance/assets/starter-standards/veritas/README.md +58 -0
  127. package/dist/claude-code/kits/veritas-governance/assets/starter-standards/veritas/authority/default.authority-settings.json +30 -0
  128. package/dist/claude-code/kits/veritas-governance/assets/starter-standards/veritas/repo-map.json +115 -0
  129. package/dist/claude-code/kits/veritas-governance/assets/starter-standards/veritas/repo-standards/default.repo-standards.json +54 -0
  130. package/dist/claude-code/kits/veritas-governance/assets/starter-standards/veritas.claims.json +179 -0
  131. package/dist/claude-code/kits/veritas-governance/docs/README.md +141 -10
  132. package/dist/claude-code/kits/veritas-governance/fixtures/standards-authoring/approved.trust-bundle.json +74 -0
  133. package/dist/claude-code/kits/veritas-governance/fixtures/standards-authoring/not-approved.trust-bundle.json +74 -0
  134. package/dist/claude-code/kits/veritas-governance/flows/standards-authoring.flow.json +35 -0
  135. package/dist/claude-code/kits/veritas-governance/kit.json +65 -0
  136. package/dist/claude-code/kits/veritas-governance/skills/consult-standards/SKILL.md +73 -0
  137. package/dist/claude-code/kits/veritas-governance/skills/standards-authoring/SKILL.md +87 -0
  138. package/dist/claude-code/schemas/backlog-provider-settings.schema.json +1 -1
  139. package/dist/claude-code/schemas/workflow-waves.schema.json +347 -0
  140. package/dist/claude-code/scripts/check-layer-boundary.mjs +98 -0
  141. package/dist/codex/.agents/skills/builder-shape/context/contracts/execution-contract.md +30 -1
  142. package/dist/codex/.agents/skills/consult-standards/SKILL.md +73 -0
  143. package/dist/codex/.agents/skills/deliver/context/contracts/execution-contract.md +30 -1
  144. package/dist/codex/.agents/skills/design-probe/context/contracts/execution-contract.md +30 -1
  145. package/dist/codex/.agents/skills/execute-plan/SKILL.md +4 -3
  146. package/dist/codex/.agents/skills/execute-plan/context/contracts/execution-contract.md +30 -1
  147. package/dist/codex/.agents/skills/fix-bug/context/contracts/execution-contract.md +30 -1
  148. package/dist/codex/.agents/skills/idea-to-backlog/context/contracts/execution-contract.md +30 -1
  149. package/dist/codex/.agents/skills/plan-work/context/contracts/execution-contract.md +30 -1
  150. package/dist/codex/.agents/skills/pull-work/SKILL.md +12 -0
  151. package/dist/codex/.agents/skills/pull-work/context/contracts/execution-contract.md +30 -1
  152. package/dist/codex/.agents/skills/review-work/SKILL.md +11 -0
  153. package/dist/codex/.agents/skills/review-work/context/contracts/execution-contract.md +30 -1
  154. package/dist/codex/.agents/skills/standards-authoring/SKILL.md +87 -0
  155. package/dist/codex/.agents/skills/tdd-workflow/context/contracts/execution-contract.md +30 -1
  156. package/dist/codex/.agents/skills/verify-work/context/contracts/execution-contract.md +30 -1
  157. package/dist/codex/.codex/agents/tool-security-reviewer.toml +1 -1
  158. package/dist/codex/build/package.json +1 -1
  159. package/dist/codex/build/src/cli/init.js +35 -3
  160. package/dist/codex/build/src/cli/kit.js +95 -2
  161. package/dist/codex/build/src/cli/pull-work-provider.js +7 -1
  162. package/dist/codex/build/src/cli/validate-workflow-artifacts.js +53 -0
  163. package/dist/codex/build/src/cli/workflow.js +5 -1
  164. package/dist/codex/build/src/flow-kit/provision.d.ts +23 -0
  165. package/dist/codex/build/src/flow-kit/provision.js +99 -0
  166. package/dist/codex/build/src/flow-kit/validate.d.ts +52 -0
  167. package/dist/codex/build/src/flow-kit/validate.js +214 -9
  168. package/dist/codex/build/src/runtime-adapters.js +1 -1
  169. package/dist/codex/context/contracts/execution-contract.md +30 -1
  170. package/dist/codex/context/contracts/review-contract.md +4 -0
  171. package/dist/codex/context/contracts/trigger-guards.md +73 -0
  172. package/dist/codex/context/settings/backlog-provider-settings.json +1 -1
  173. package/dist/codex/context/settings/workspace-backlog-provider-settings.example.json +1 -1
  174. package/dist/codex/docs/adr/0023-kit-provisioning.md +47 -0
  175. package/dist/codex/docs/adr/index.md +1 -0
  176. package/dist/codex/docs/architecture-engine-and-kits.md +17 -0
  177. package/dist/codex/docs/context-map.md +3 -0
  178. package/dist/codex/docs/decisions/backlog-readiness-source.md +89 -0
  179. package/dist/codex/docs/decisions/index.md +1 -0
  180. package/dist/codex/docs/developer-architecture.md +3 -3
  181. package/dist/codex/docs/flow-kit-repository-contract.md +34 -3
  182. package/dist/codex/docs/kit-authoring-guide.md +1 -1
  183. package/dist/codex/docs/veritas-integration.md +12 -0
  184. package/dist/codex/evals/ci/run-baseline.sh +4 -0
  185. package/dist/codex/evals/integration/test_kit_provisioning.sh +112 -0
  186. package/dist/codex/evals/integration/test_pull_work_provider.sh +18 -0
  187. package/dist/codex/evals/integration/test_veritas_governance_kit.sh +256 -0
  188. package/dist/codex/evals/integration/test_workflow_artifacts.sh +257 -0
  189. package/dist/codex/evals/static/test_package.sh +6 -0
  190. package/dist/codex/evals/static/test_workflow_skills.sh +16 -0
  191. package/dist/codex/install.sh +1 -1
  192. package/dist/codex/kits/builder/flows/publish-learn.flow.json +9 -1
  193. package/dist/codex/kits/builder/skills/execute-plan/SKILL.md +4 -3
  194. package/dist/codex/kits/builder/skills/pull-work/SKILL.md +12 -0
  195. package/dist/codex/kits/builder/skills/review-work/SKILL.md +11 -0
  196. package/dist/codex/kits/veritas-governance/adapter/readiness-to-trust-bundle.mjs +19 -20
  197. package/dist/codex/kits/veritas-governance/assets/starter-hooks/githooks/post-commit +13 -0
  198. package/dist/codex/kits/veritas-governance/assets/starter-hooks/githooks/pre-push +13 -0
  199. package/dist/codex/kits/veritas-governance/assets/starter-standards/veritas/GOVERNANCE.md +23 -0
  200. package/dist/codex/kits/veritas-governance/assets/starter-standards/veritas/README.md +58 -0
  201. package/dist/codex/kits/veritas-governance/assets/starter-standards/veritas/authority/default.authority-settings.json +30 -0
  202. package/dist/codex/kits/veritas-governance/assets/starter-standards/veritas/repo-map.json +115 -0
  203. package/dist/codex/kits/veritas-governance/assets/starter-standards/veritas/repo-standards/default.repo-standards.json +54 -0
  204. package/dist/codex/kits/veritas-governance/assets/starter-standards/veritas.claims.json +179 -0
  205. package/dist/codex/kits/veritas-governance/docs/README.md +141 -10
  206. package/dist/codex/kits/veritas-governance/fixtures/standards-authoring/approved.trust-bundle.json +74 -0
  207. package/dist/codex/kits/veritas-governance/fixtures/standards-authoring/not-approved.trust-bundle.json +74 -0
  208. package/dist/codex/kits/veritas-governance/flows/standards-authoring.flow.json +35 -0
  209. package/dist/codex/kits/veritas-governance/kit.json +65 -0
  210. package/dist/codex/kits/veritas-governance/skills/consult-standards/SKILL.md +73 -0
  211. package/dist/codex/kits/veritas-governance/skills/standards-authoring/SKILL.md +87 -0
  212. package/dist/codex/schemas/backlog-provider-settings.schema.json +1 -1
  213. package/dist/codex/schemas/workflow-waves.schema.json +347 -0
  214. package/dist/codex/scripts/check-layer-boundary.mjs +98 -0
  215. package/dist/kiro/agents/tool-security-reviewer.json +1 -1
  216. package/dist/kiro/build/package.json +1 -1
  217. package/dist/kiro/build/src/cli/init.js +35 -3
  218. package/dist/kiro/build/src/cli/kit.js +95 -2
  219. package/dist/kiro/build/src/cli/pull-work-provider.js +7 -1
  220. package/dist/kiro/build/src/cli/validate-workflow-artifacts.js +53 -0
  221. package/dist/kiro/build/src/cli/workflow.js +5 -1
  222. package/dist/kiro/build/src/flow-kit/provision.d.ts +23 -0
  223. package/dist/kiro/build/src/flow-kit/provision.js +99 -0
  224. package/dist/kiro/build/src/flow-kit/validate.d.ts +52 -0
  225. package/dist/kiro/build/src/flow-kit/validate.js +214 -9
  226. package/dist/kiro/build/src/runtime-adapters.js +1 -1
  227. package/dist/kiro/context/contracts/execution-contract.md +30 -1
  228. package/dist/kiro/context/contracts/review-contract.md +4 -0
  229. package/dist/kiro/context/contracts/trigger-guards.md +73 -0
  230. package/dist/kiro/context/settings/backlog-provider-settings.json +1 -1
  231. package/dist/kiro/context/settings/workspace-backlog-provider-settings.example.json +1 -1
  232. package/dist/kiro/docs/adr/0023-kit-provisioning.md +47 -0
  233. package/dist/kiro/docs/adr/index.md +1 -0
  234. package/dist/kiro/docs/architecture-engine-and-kits.md +17 -0
  235. package/dist/kiro/docs/context-map.md +3 -0
  236. package/dist/kiro/docs/decisions/backlog-readiness-source.md +89 -0
  237. package/dist/kiro/docs/decisions/index.md +1 -0
  238. package/dist/kiro/docs/developer-architecture.md +3 -3
  239. package/dist/kiro/docs/flow-kit-repository-contract.md +34 -3
  240. package/dist/kiro/docs/kit-authoring-guide.md +1 -1
  241. package/dist/kiro/docs/veritas-integration.md +12 -0
  242. package/dist/kiro/evals/ci/run-baseline.sh +4 -0
  243. package/dist/kiro/evals/integration/test_kit_provisioning.sh +112 -0
  244. package/dist/kiro/evals/integration/test_pull_work_provider.sh +18 -0
  245. package/dist/kiro/evals/integration/test_veritas_governance_kit.sh +256 -0
  246. package/dist/kiro/evals/integration/test_workflow_artifacts.sh +257 -0
  247. package/dist/kiro/evals/static/test_package.sh +6 -0
  248. package/dist/kiro/evals/static/test_workflow_skills.sh +16 -0
  249. package/dist/kiro/install.sh +1 -1
  250. package/dist/kiro/kits/builder/flows/publish-learn.flow.json +9 -1
  251. package/dist/kiro/kits/builder/skills/execute-plan/SKILL.md +4 -3
  252. package/dist/kiro/kits/builder/skills/pull-work/SKILL.md +12 -0
  253. package/dist/kiro/kits/builder/skills/review-work/SKILL.md +11 -0
  254. package/dist/kiro/kits/veritas-governance/adapter/readiness-to-trust-bundle.mjs +19 -20
  255. package/dist/kiro/kits/veritas-governance/assets/starter-hooks/githooks/post-commit +13 -0
  256. package/dist/kiro/kits/veritas-governance/assets/starter-hooks/githooks/pre-push +13 -0
  257. package/dist/kiro/kits/veritas-governance/assets/starter-standards/veritas/GOVERNANCE.md +23 -0
  258. package/dist/kiro/kits/veritas-governance/assets/starter-standards/veritas/README.md +58 -0
  259. package/dist/kiro/kits/veritas-governance/assets/starter-standards/veritas/authority/default.authority-settings.json +30 -0
  260. package/dist/kiro/kits/veritas-governance/assets/starter-standards/veritas/repo-map.json +115 -0
  261. package/dist/kiro/kits/veritas-governance/assets/starter-standards/veritas/repo-standards/default.repo-standards.json +54 -0
  262. package/dist/kiro/kits/veritas-governance/assets/starter-standards/veritas.claims.json +179 -0
  263. package/dist/kiro/kits/veritas-governance/docs/README.md +141 -10
  264. package/dist/kiro/kits/veritas-governance/fixtures/standards-authoring/approved.trust-bundle.json +74 -0
  265. package/dist/kiro/kits/veritas-governance/fixtures/standards-authoring/not-approved.trust-bundle.json +74 -0
  266. package/dist/kiro/kits/veritas-governance/flows/standards-authoring.flow.json +35 -0
  267. package/dist/kiro/kits/veritas-governance/kit.json +65 -0
  268. package/dist/kiro/kits/veritas-governance/skills/consult-standards/SKILL.md +73 -0
  269. package/dist/kiro/kits/veritas-governance/skills/standards-authoring/SKILL.md +87 -0
  270. package/dist/kiro/schemas/backlog-provider-settings.schema.json +1 -1
  271. package/dist/kiro/schemas/workflow-waves.schema.json +347 -0
  272. package/dist/kiro/scripts/check-layer-boundary.mjs +98 -0
  273. package/dist/opencode/.opencode/agents/tool-security-reviewer.md +2 -1
  274. package/dist/opencode/.opencode/skills/consult-standards/SKILL.md +73 -0
  275. package/dist/opencode/.opencode/skills/execute-plan/SKILL.md +4 -3
  276. package/dist/opencode/.opencode/skills/pull-work/SKILL.md +12 -0
  277. package/dist/opencode/.opencode/skills/review-work/SKILL.md +11 -0
  278. package/dist/opencode/.opencode/skills/standards-authoring/SKILL.md +87 -0
  279. package/dist/opencode/build/package.json +1 -1
  280. package/dist/opencode/build/src/cli/init.js +35 -3
  281. package/dist/opencode/build/src/cli/kit.js +95 -2
  282. package/dist/opencode/build/src/cli/pull-work-provider.js +7 -1
  283. package/dist/opencode/build/src/cli/validate-workflow-artifacts.js +53 -0
  284. package/dist/opencode/build/src/cli/workflow.js +5 -1
  285. package/dist/opencode/build/src/flow-kit/provision.d.ts +23 -0
  286. package/dist/opencode/build/src/flow-kit/provision.js +99 -0
  287. package/dist/opencode/build/src/flow-kit/validate.d.ts +52 -0
  288. package/dist/opencode/build/src/flow-kit/validate.js +214 -9
  289. package/dist/opencode/build/src/runtime-adapters.js +1 -1
  290. package/dist/opencode/context/contracts/execution-contract.md +30 -1
  291. package/dist/opencode/context/contracts/review-contract.md +4 -0
  292. package/dist/opencode/context/contracts/trigger-guards.md +73 -0
  293. package/dist/opencode/context/settings/backlog-provider-settings.json +1 -1
  294. package/dist/opencode/context/settings/workspace-backlog-provider-settings.example.json +1 -1
  295. package/dist/opencode/docs/adr/0023-kit-provisioning.md +47 -0
  296. package/dist/opencode/docs/adr/index.md +1 -0
  297. package/dist/opencode/docs/architecture-engine-and-kits.md +17 -0
  298. package/dist/opencode/docs/context-map.md +3 -0
  299. package/dist/opencode/docs/decisions/backlog-readiness-source.md +89 -0
  300. package/dist/opencode/docs/decisions/index.md +1 -0
  301. package/dist/opencode/docs/developer-architecture.md +3 -3
  302. package/dist/opencode/docs/flow-kit-repository-contract.md +34 -3
  303. package/dist/opencode/docs/kit-authoring-guide.md +1 -1
  304. package/dist/opencode/docs/veritas-integration.md +12 -0
  305. package/dist/opencode/evals/ci/run-baseline.sh +4 -0
  306. package/dist/opencode/evals/integration/test_kit_provisioning.sh +112 -0
  307. package/dist/opencode/evals/integration/test_pull_work_provider.sh +18 -0
  308. package/dist/opencode/evals/integration/test_veritas_governance_kit.sh +256 -0
  309. package/dist/opencode/evals/integration/test_workflow_artifacts.sh +257 -0
  310. package/dist/opencode/evals/static/test_package.sh +6 -0
  311. package/dist/opencode/evals/static/test_workflow_skills.sh +16 -0
  312. package/dist/opencode/install.sh +1 -1
  313. package/dist/opencode/kits/builder/flows/publish-learn.flow.json +9 -1
  314. package/dist/opencode/kits/builder/skills/execute-plan/SKILL.md +4 -3
  315. package/dist/opencode/kits/builder/skills/pull-work/SKILL.md +12 -0
  316. package/dist/opencode/kits/builder/skills/review-work/SKILL.md +11 -0
  317. package/dist/opencode/kits/veritas-governance/adapter/readiness-to-trust-bundle.mjs +19 -20
  318. package/dist/opencode/kits/veritas-governance/assets/starter-hooks/githooks/post-commit +13 -0
  319. package/dist/opencode/kits/veritas-governance/assets/starter-hooks/githooks/pre-push +13 -0
  320. package/dist/opencode/kits/veritas-governance/assets/starter-standards/veritas/GOVERNANCE.md +23 -0
  321. package/dist/opencode/kits/veritas-governance/assets/starter-standards/veritas/README.md +58 -0
  322. package/dist/opencode/kits/veritas-governance/assets/starter-standards/veritas/authority/default.authority-settings.json +30 -0
  323. package/dist/opencode/kits/veritas-governance/assets/starter-standards/veritas/repo-map.json +115 -0
  324. package/dist/opencode/kits/veritas-governance/assets/starter-standards/veritas/repo-standards/default.repo-standards.json +54 -0
  325. package/dist/opencode/kits/veritas-governance/assets/starter-standards/veritas.claims.json +179 -0
  326. package/dist/opencode/kits/veritas-governance/docs/README.md +141 -10
  327. package/dist/opencode/kits/veritas-governance/fixtures/standards-authoring/approved.trust-bundle.json +74 -0
  328. package/dist/opencode/kits/veritas-governance/fixtures/standards-authoring/not-approved.trust-bundle.json +74 -0
  329. package/dist/opencode/kits/veritas-governance/flows/standards-authoring.flow.json +35 -0
  330. package/dist/opencode/kits/veritas-governance/kit.json +65 -0
  331. package/dist/opencode/kits/veritas-governance/skills/consult-standards/SKILL.md +73 -0
  332. package/dist/opencode/kits/veritas-governance/skills/standards-authoring/SKILL.md +87 -0
  333. package/dist/opencode/schemas/backlog-provider-settings.schema.json +1 -1
  334. package/dist/opencode/schemas/workflow-waves.schema.json +347 -0
  335. package/dist/opencode/scripts/check-layer-boundary.mjs +98 -0
  336. package/dist/pi/.pi/skills/consult-standards/SKILL.md +73 -0
  337. package/dist/pi/.pi/skills/execute-plan/SKILL.md +4 -3
  338. package/dist/pi/.pi/skills/pull-work/SKILL.md +12 -0
  339. package/dist/pi/.pi/skills/review-work/SKILL.md +11 -0
  340. package/dist/pi/.pi/skills/standards-authoring/SKILL.md +87 -0
  341. package/dist/pi/build/package.json +1 -1
  342. package/dist/pi/build/src/cli/init.js +35 -3
  343. package/dist/pi/build/src/cli/kit.js +95 -2
  344. package/dist/pi/build/src/cli/pull-work-provider.js +7 -1
  345. package/dist/pi/build/src/cli/validate-workflow-artifacts.js +53 -0
  346. package/dist/pi/build/src/cli/workflow.js +5 -1
  347. package/dist/pi/build/src/flow-kit/provision.d.ts +23 -0
  348. package/dist/pi/build/src/flow-kit/provision.js +99 -0
  349. package/dist/pi/build/src/flow-kit/validate.d.ts +52 -0
  350. package/dist/pi/build/src/flow-kit/validate.js +214 -9
  351. package/dist/pi/build/src/runtime-adapters.js +1 -1
  352. package/dist/pi/context/contracts/execution-contract.md +30 -1
  353. package/dist/pi/context/contracts/review-contract.md +4 -0
  354. package/dist/pi/context/contracts/trigger-guards.md +73 -0
  355. package/dist/pi/context/settings/backlog-provider-settings.json +1 -1
  356. package/dist/pi/context/settings/workspace-backlog-provider-settings.example.json +1 -1
  357. package/dist/pi/docs/adr/0023-kit-provisioning.md +47 -0
  358. package/dist/pi/docs/adr/index.md +1 -0
  359. package/dist/pi/docs/architecture-engine-and-kits.md +17 -0
  360. package/dist/pi/docs/context-map.md +3 -0
  361. package/dist/pi/docs/decisions/backlog-readiness-source.md +89 -0
  362. package/dist/pi/docs/decisions/index.md +1 -0
  363. package/dist/pi/docs/developer-architecture.md +3 -3
  364. package/dist/pi/docs/flow-kit-repository-contract.md +34 -3
  365. package/dist/pi/docs/kit-authoring-guide.md +1 -1
  366. package/dist/pi/docs/veritas-integration.md +12 -0
  367. package/dist/pi/evals/ci/run-baseline.sh +4 -0
  368. package/dist/pi/evals/integration/test_kit_provisioning.sh +112 -0
  369. package/dist/pi/evals/integration/test_pull_work_provider.sh +18 -0
  370. package/dist/pi/evals/integration/test_veritas_governance_kit.sh +256 -0
  371. package/dist/pi/evals/integration/test_workflow_artifacts.sh +257 -0
  372. package/dist/pi/evals/static/test_package.sh +6 -0
  373. package/dist/pi/evals/static/test_workflow_skills.sh +16 -0
  374. package/dist/pi/install.sh +1 -1
  375. package/dist/pi/kits/builder/flows/publish-learn.flow.json +9 -1
  376. package/dist/pi/kits/builder/skills/execute-plan/SKILL.md +4 -3
  377. package/dist/pi/kits/builder/skills/pull-work/SKILL.md +12 -0
  378. package/dist/pi/kits/builder/skills/review-work/SKILL.md +11 -0
  379. package/dist/pi/kits/veritas-governance/adapter/readiness-to-trust-bundle.mjs +19 -20
  380. package/dist/pi/kits/veritas-governance/assets/starter-hooks/githooks/post-commit +13 -0
  381. package/dist/pi/kits/veritas-governance/assets/starter-hooks/githooks/pre-push +13 -0
  382. package/dist/pi/kits/veritas-governance/assets/starter-standards/veritas/GOVERNANCE.md +23 -0
  383. package/dist/pi/kits/veritas-governance/assets/starter-standards/veritas/README.md +58 -0
  384. package/dist/pi/kits/veritas-governance/assets/starter-standards/veritas/authority/default.authority-settings.json +30 -0
  385. package/dist/pi/kits/veritas-governance/assets/starter-standards/veritas/repo-map.json +115 -0
  386. package/dist/pi/kits/veritas-governance/assets/starter-standards/veritas/repo-standards/default.repo-standards.json +54 -0
  387. package/dist/pi/kits/veritas-governance/assets/starter-standards/veritas.claims.json +179 -0
  388. package/dist/pi/kits/veritas-governance/docs/README.md +141 -10
  389. package/dist/pi/kits/veritas-governance/fixtures/standards-authoring/approved.trust-bundle.json +74 -0
  390. package/dist/pi/kits/veritas-governance/fixtures/standards-authoring/not-approved.trust-bundle.json +74 -0
  391. package/dist/pi/kits/veritas-governance/flows/standards-authoring.flow.json +35 -0
  392. package/dist/pi/kits/veritas-governance/kit.json +65 -0
  393. package/dist/pi/kits/veritas-governance/skills/consult-standards/SKILL.md +73 -0
  394. package/dist/pi/kits/veritas-governance/skills/standards-authoring/SKILL.md +87 -0
  395. package/dist/pi/schemas/backlog-provider-settings.schema.json +1 -1
  396. package/dist/pi/schemas/workflow-waves.schema.json +347 -0
  397. package/dist/pi/scripts/check-layer-boundary.mjs +98 -0
  398. package/docs/adr/0023-kit-provisioning.md +47 -0
  399. package/docs/adr/index.md +1 -0
  400. package/docs/architecture-engine-and-kits.md +17 -0
  401. package/docs/context-map.md +3 -0
  402. package/docs/decisions/backlog-readiness-source.md +89 -0
  403. package/docs/decisions/index.md +1 -0
  404. package/docs/developer-architecture.md +3 -3
  405. package/docs/flow-kit-repository-contract.md +34 -3
  406. package/docs/kit-authoring-guide.md +1 -1
  407. package/docs/veritas-integration.md +12 -0
  408. package/evals/ci/run-baseline.sh +4 -0
  409. package/evals/integration/test_kit_provisioning.sh +112 -0
  410. package/evals/integration/test_pull_work_provider.sh +18 -0
  411. package/evals/integration/test_veritas_governance_kit.sh +256 -0
  412. package/evals/integration/test_workflow_artifacts.sh +257 -0
  413. package/evals/static/test_package.sh +6 -0
  414. package/evals/static/test_workflow_skills.sh +16 -0
  415. package/kits/builder/flows/publish-learn.flow.json +9 -1
  416. package/kits/builder/skills/execute-plan/SKILL.md +4 -3
  417. package/kits/builder/skills/pull-work/SKILL.md +12 -0
  418. package/kits/builder/skills/review-work/SKILL.md +11 -0
  419. package/kits/veritas-governance/adapter/readiness-to-trust-bundle.mjs +19 -20
  420. package/kits/veritas-governance/assets/starter-hooks/githooks/post-commit +13 -0
  421. package/kits/veritas-governance/assets/starter-hooks/githooks/pre-push +13 -0
  422. package/kits/veritas-governance/assets/starter-standards/veritas/GOVERNANCE.md +23 -0
  423. package/kits/veritas-governance/assets/starter-standards/veritas/README.md +58 -0
  424. package/kits/veritas-governance/assets/starter-standards/veritas/authority/default.authority-settings.json +30 -0
  425. package/kits/veritas-governance/assets/starter-standards/veritas/repo-map.json +115 -0
  426. package/kits/veritas-governance/assets/starter-standards/veritas/repo-standards/default.repo-standards.json +54 -0
  427. package/kits/veritas-governance/assets/starter-standards/veritas.claims.json +179 -0
  428. package/kits/veritas-governance/docs/README.md +141 -10
  429. package/kits/veritas-governance/fixtures/standards-authoring/approved.trust-bundle.json +74 -0
  430. package/kits/veritas-governance/fixtures/standards-authoring/not-approved.trust-bundle.json +74 -0
  431. package/kits/veritas-governance/flows/standards-authoring.flow.json +35 -0
  432. package/kits/veritas-governance/kit.json +65 -0
  433. package/kits/veritas-governance/skills/consult-standards/SKILL.md +73 -0
  434. package/kits/veritas-governance/skills/standards-authoring/SKILL.md +87 -0
  435. package/package.json +2 -1
  436. package/schemas/backlog-provider-settings.schema.json +1 -1
  437. package/schemas/workflow-waves.schema.json +347 -0
  438. package/scripts/check-layer-boundary.mjs +98 -0
  439. package/src/cli/builder-flow-runtime.test.mjs +86 -0
  440. package/src/cli/flow-resolver-composition.test.mjs +20 -1
  441. package/src/cli/init.ts +31 -3
  442. package/src/cli/kit-metadata-security.test.mjs +163 -1
  443. package/src/cli/kit-provisioning.test.mjs +122 -0
  444. package/src/cli/kit.ts +83 -2
  445. package/src/cli/pull-work-provider.ts +7 -1
  446. package/src/cli/validate-waves.test.mjs +134 -0
  447. package/src/cli/validate-workflow-artifacts.ts +47 -0
  448. package/src/cli/workflow.ts +7 -1
  449. package/src/flow-kit/provision.ts +118 -0
  450. package/src/flow-kit/validate.ts +233 -10
  451. package/src/runtime-adapters.ts +1 -1
@@ -0,0 +1,347 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://flow-agents.dev/schemas/workflow-waves.schema.json",
4
+ "title": "Flow Agents Workflow Waves",
5
+ "description": "Fan-out wave manifest for a workflow session. Each wave declares its expected workers (M) before dispatch; every worker lands exactly one terminal status record; the orchestrator reconciles worker_results against expected_workers at wave close and records an explicit 'N of M reported' reconciliation. A worker that never reported is recorded as not_reported — visible data, never silently absorbed. This sidecar is additive: a session without waves.json declares no fan-out and is unaffected.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "schema_version",
10
+ "task_slug",
11
+ "waves"
12
+ ],
13
+ "$defs": {
14
+ "evidence_ref": {
15
+ "type": "object",
16
+ "additionalProperties": false,
17
+ "required": [
18
+ "kind"
19
+ ],
20
+ "properties": {
21
+ "kind": {
22
+ "type": "string",
23
+ "enum": [
24
+ "source",
25
+ "command",
26
+ "artifact",
27
+ "provider",
28
+ "external"
29
+ ]
30
+ },
31
+ "url": {
32
+ "type": "string",
33
+ "minLength": 1
34
+ },
35
+ "file": {
36
+ "type": "string",
37
+ "minLength": 1
38
+ },
39
+ "line_start": {
40
+ "type": "integer",
41
+ "minimum": 1
42
+ },
43
+ "line_end": {
44
+ "type": "integer",
45
+ "minimum": 1
46
+ },
47
+ "excerpt": {
48
+ "type": "string",
49
+ "minLength": 1
50
+ },
51
+ "summary": {
52
+ "type": "string",
53
+ "minLength": 1
54
+ }
55
+ },
56
+ "allOf": [
57
+ {
58
+ "if": {
59
+ "type": "object",
60
+ "properties": {
61
+ "kind": {
62
+ "const": "source"
63
+ }
64
+ },
65
+ "required": [
66
+ "kind"
67
+ ]
68
+ },
69
+ "then": {
70
+ "required": [
71
+ "file",
72
+ "line_start",
73
+ "line_end",
74
+ "excerpt"
75
+ ]
76
+ }
77
+ },
78
+ {
79
+ "if": {
80
+ "type": "object",
81
+ "properties": {
82
+ "kind": {
83
+ "const": "artifact"
84
+ }
85
+ },
86
+ "required": [
87
+ "kind"
88
+ ]
89
+ },
90
+ "then": {
91
+ "allOf": [
92
+ {
93
+ "anyOf": [
94
+ {
95
+ "type": "object",
96
+ "required": [
97
+ "file"
98
+ ]
99
+ },
100
+ {
101
+ "type": "object",
102
+ "required": [
103
+ "url"
104
+ ]
105
+ }
106
+ ]
107
+ },
108
+ {
109
+ "anyOf": [
110
+ {
111
+ "type": "object",
112
+ "required": [
113
+ "summary"
114
+ ]
115
+ },
116
+ {
117
+ "type": "object",
118
+ "required": [
119
+ "excerpt"
120
+ ]
121
+ }
122
+ ]
123
+ }
124
+ ]
125
+ }
126
+ },
127
+ {
128
+ "if": {
129
+ "type": "object",
130
+ "properties": {
131
+ "kind": {
132
+ "const": "command"
133
+ }
134
+ },
135
+ "required": [
136
+ "kind"
137
+ ]
138
+ },
139
+ "then": {
140
+ "anyOf": [
141
+ {
142
+ "type": "object",
143
+ "required": [
144
+ "excerpt"
145
+ ]
146
+ },
147
+ {
148
+ "type": "object",
149
+ "required": [
150
+ "summary"
151
+ ]
152
+ },
153
+ {
154
+ "type": "object",
155
+ "required": [
156
+ "url"
157
+ ]
158
+ }
159
+ ]
160
+ }
161
+ },
162
+ {
163
+ "if": {
164
+ "type": "object",
165
+ "properties": {
166
+ "kind": {
167
+ "enum": [
168
+ "provider",
169
+ "external"
170
+ ]
171
+ }
172
+ },
173
+ "required": [
174
+ "kind"
175
+ ]
176
+ },
177
+ "then": {
178
+ "required": [
179
+ "url"
180
+ ]
181
+ }
182
+ }
183
+ ]
184
+ },
185
+ "expected_worker": {
186
+ "type": "object",
187
+ "additionalProperties": false,
188
+ "required": [
189
+ "worker_id",
190
+ "task"
191
+ ],
192
+ "properties": {
193
+ "worker_id": {
194
+ "type": "string",
195
+ "minLength": 1
196
+ },
197
+ "task": {
198
+ "type": "string",
199
+ "minLength": 1
200
+ },
201
+ "role": {
202
+ "type": "string",
203
+ "minLength": 1
204
+ },
205
+ "owned_files": {
206
+ "type": "array",
207
+ "items": {
208
+ "type": "string",
209
+ "minLength": 1
210
+ }
211
+ }
212
+ }
213
+ },
214
+ "worker_result": {
215
+ "type": "object",
216
+ "additionalProperties": false,
217
+ "required": [
218
+ "worker_id",
219
+ "status",
220
+ "summary",
221
+ "recorded_at"
222
+ ],
223
+ "properties": {
224
+ "worker_id": {
225
+ "type": "string",
226
+ "minLength": 1
227
+ },
228
+ "status": {
229
+ "type": "string",
230
+ "enum": [
231
+ "completed",
232
+ "failed",
233
+ "blocked",
234
+ "not_reported"
235
+ ]
236
+ },
237
+ "summary": {
238
+ "type": "string",
239
+ "minLength": 1
240
+ },
241
+ "recorded_at": {
242
+ "type": "string",
243
+ "format": "date-time"
244
+ },
245
+ "evidence_refs": {
246
+ "type": "array",
247
+ "items": {
248
+ "$ref": "#/$defs/evidence_ref"
249
+ }
250
+ }
251
+ }
252
+ },
253
+ "reconciliation": {
254
+ "type": "object",
255
+ "additionalProperties": false,
256
+ "required": [
257
+ "status",
258
+ "expected_count",
259
+ "reported_count",
260
+ "summary",
261
+ "reconciled_at"
262
+ ],
263
+ "properties": {
264
+ "status": {
265
+ "type": "string",
266
+ "enum": [
267
+ "complete",
268
+ "incomplete"
269
+ ]
270
+ },
271
+ "expected_count": {
272
+ "type": "integer",
273
+ "minimum": 0
274
+ },
275
+ "reported_count": {
276
+ "type": "integer",
277
+ "minimum": 0
278
+ },
279
+ "summary": {
280
+ "type": "string",
281
+ "minLength": 1
282
+ },
283
+ "reconciled_at": {
284
+ "type": "string",
285
+ "format": "date-time"
286
+ }
287
+ }
288
+ },
289
+ "wave": {
290
+ "type": "object",
291
+ "additionalProperties": false,
292
+ "required": [
293
+ "wave_id",
294
+ "step",
295
+ "declared_at",
296
+ "expected_workers"
297
+ ],
298
+ "properties": {
299
+ "wave_id": {
300
+ "type": "string",
301
+ "minLength": 1
302
+ },
303
+ "step": {
304
+ "type": "string",
305
+ "minLength": 1
306
+ },
307
+ "declared_at": {
308
+ "type": "string",
309
+ "format": "date-time"
310
+ },
311
+ "expected_workers": {
312
+ "type": "array",
313
+ "minItems": 1,
314
+ "items": {
315
+ "$ref": "#/$defs/expected_worker"
316
+ }
317
+ },
318
+ "worker_results": {
319
+ "type": "array",
320
+ "items": {
321
+ "$ref": "#/$defs/worker_result"
322
+ }
323
+ },
324
+ "reconciliation": {
325
+ "$ref": "#/$defs/reconciliation"
326
+ }
327
+ }
328
+ }
329
+ },
330
+ "properties": {
331
+ "schema_version": {
332
+ "type": "string",
333
+ "const": "1.0"
334
+ },
335
+ "task_slug": {
336
+ "type": "string",
337
+ "minLength": 1
338
+ },
339
+ "waves": {
340
+ "type": "array",
341
+ "minItems": 1,
342
+ "items": {
343
+ "$ref": "#/$defs/wave"
344
+ }
345
+ }
346
+ }
347
+ }
@@ -0,0 +1,98 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * check-layer-boundary — kit/engine layer-doctrine ratchet.
4
+ *
5
+ * Doctrine (veritas docs/architecture/engine-surface-seam.md, Invariant 3; ADR 0008/0016):
6
+ * kits distribute by copy/activate/CLI and consume a product engine via CLI + artifacts, NEVER
7
+ * as an npm library import. A kit that `import`s the veritas evaluation engine would fork the
8
+ * layer boundary — the kit must wrap the engine's CLI, not link its code. This is the executable
9
+ * enforcement of that invariant (flow-agents#651).
10
+ *
11
+ * FAILS if any tracked file under kits/ imports `@kontourai/veritas` (or its `/engine` subpath),
12
+ * or if any kit.json declares it as a dependency. The kit's trust-bundle adapter may import
13
+ * `@kontourai/surface` (the open trust format, Layer 3) — that is the sanctioned channel and is
14
+ * NOT matched here. No allowlist: the count is zero today and must stay zero.
15
+ *
16
+ * Not a violation (and not matched — import-syntax-scoped): the many descriptive strings naming
17
+ * "@kontourai/veritas" in kit.json descriptions, docs, and recorded CLI-output fixtures are prose
18
+ * and data, not code imports.
19
+ */
20
+ import { execFileSync } from "node:child_process";
21
+ import { readFileSync } from "node:fs";
22
+
23
+ // Match import/require/dynamic-import of the veritas package (root or /engine subpath) only, so
24
+ // prose/fixture mentions of the package name can never trip it — only an actual code link does.
25
+ const PKG = String.raw`@kontourai/veritas(?:/[A-Za-z0-9_./-]+)?`;
26
+ const IMPORT_PATTERNS = [
27
+ new RegExp(String.raw`from\s+['"](?:${PKG})['"]`),
28
+ new RegExp(String.raw`require(?:\.resolve)?\(\s*['"](?:${PKG})['"]\s*\)`),
29
+ new RegExp(String.raw`import\(\s*['"](?:${PKG})['"]\s*\)`),
30
+ ];
31
+ const SOURCE_EXT = /\.(ts|tsx|mjs|cjs|js|jsx)$/;
32
+
33
+ // Strip comments so an import-SHAPED example inside a doc comment (e.g. a JSDoc `* import ...`
34
+ // line) is not a false positive. A real import statement never starts a line with `//` or `*`,
35
+ // so this only removes prose, never a genuine dependency edge. (Line-scoped — not a full parser;
36
+ // a package name inside a string literal remains matchable, which is intentional.)
37
+ function codeOnly(line) {
38
+ const trimmed = line.trimStart();
39
+ if (trimmed.startsWith("//") || trimmed.startsWith("*") || trimmed.startsWith("/*")) return "";
40
+ return line.replace(/\/\*.*?\*\//g, "").replace(/\/\/.*$/, "");
41
+ }
42
+
43
+ function trackedFiles(dir) {
44
+ return execFileSync("git", ["ls-files", dir], { encoding: "utf8" })
45
+ .split("\n")
46
+ .map((line) => line.trim())
47
+ .filter(Boolean);
48
+ }
49
+
50
+ const violations = [];
51
+
52
+ // 1. Source imports under kits/.
53
+ for (const file of trackedFiles("kits").filter((f) => SOURCE_EXT.test(f))) {
54
+ let text;
55
+ try {
56
+ text = readFileSync(file, "utf8");
57
+ } catch {
58
+ continue;
59
+ }
60
+ text.split("\n").forEach((line, index) => {
61
+ if (IMPORT_PATTERNS.some((re) => re.test(codeOnly(line)))) {
62
+ violations.push(`${file}:${index + 1} imports @kontourai/veritas — kits wrap the engine via CLI, not as a library`);
63
+ }
64
+ });
65
+ }
66
+
67
+ // 2. kit.json dependency declarations.
68
+ for (const file of trackedFiles("kits").filter((f) => f.endsWith("kit.json"))) {
69
+ let manifest;
70
+ try {
71
+ manifest = JSON.parse(readFileSync(file, "utf8"));
72
+ } catch {
73
+ continue;
74
+ }
75
+ for (const field of ["dependencies", "devDependencies", "optionalDependencies", "peerDependencies"]) {
76
+ const decl = manifest[field];
77
+ if (decl && typeof decl === "object" && !Array.isArray(decl)) {
78
+ for (const name of ["@kontourai/veritas"]) {
79
+ if (Object.prototype.hasOwnProperty.call(decl, name)) {
80
+ violations.push(`${file} ${field}.${name} — a kit must not declare the engine as an npm dependency`);
81
+ }
82
+ }
83
+ }
84
+ }
85
+ }
86
+
87
+ if (violations.length) {
88
+ console.error("[check-layer-boundary] FAILED — a kit imports/depends on the veritas engine as a library (engine/surface seam, Invariant 3):");
89
+ for (const v of violations) console.error(` ${v}`);
90
+ console.error(
91
+ "\nKits distribute by copy/activate/CLI and consume the engine via its CLI + recorded artifacts,\n" +
92
+ "never as an npm library import. The trust-bundle adapter may import @kontourai/surface (the open\n" +
93
+ "trust format); it must not import @kontourai/veritas. See veritas docs/architecture/engine-surface-seam.md.",
94
+ );
95
+ process.exitCode = 1;
96
+ } else {
97
+ console.log("[check-layer-boundary] OK — no kit imports or declares the veritas engine as a library.");
98
+ }
@@ -0,0 +1,73 @@
1
+ ---
2
+ name: "consult-standards"
3
+ description: "Get just-in-time Veritas governance guidance for a file or work area before editing it: run `veritas explain --file <path>` (or `--work-area <id>`) to see the governance excerpt, the Repo Standards rules that apply, their do/don't/examples, and the latest recorded surface status — then edit within those rules. Use before changing a governed repo's files, or when you want to know what standards apply to a path. Pull-based guidance; it does not block (the PreToolUse hook is the enforcement gate)."
4
+ ---
5
+
6
+ # Consult Standards
7
+
8
+ Before you edit a file in a Veritas-governed repo, ask Veritas what applies to it. `veritas
9
+ explain` projects the repo's governance excerpt + the Repo Standards rules matching that file (or
10
+ work area) + their latest surface status into one just-in-time briefing — so you edit *within* the
11
+ rules instead of discovering a violation only when the PreToolUse hook blocks the write.
12
+
13
+ **This skill wraps the `veritas` CLI. It reimplements no rule evaluation** — `veritas explain`
14
+ does the matching and projection; the skill only tells you when and how to ask.
15
+
16
+ ## When to use this
17
+
18
+ - **Before editing** a file in a repo that has a `.veritas/` governance config — especially a
19
+ file under a governed work area, or one you haven't touched before.
20
+ - **When you want to know what standards apply** to a path or area without reading every rule in
21
+ `.veritas/repo-standards/` yourself.
22
+ - Not a gate: this is **pull-based** guidance you invoke. Enforcement is separate and automatic —
23
+ the Veritas PreToolUse hook (engine-side; installed via the kit's governance hooks) evaluates
24
+ and can *block* a non-conforming write whether or not you consulted first. Consulting first
25
+ means you shape the edit to pass, rather than getting blocked and retrying.
26
+
27
+ ## How to consult
28
+
29
+ ```bash
30
+ # For a specific file you're about to change:
31
+ veritas explain --file src/path/to/file.ts
32
+
33
+ # For a whole work area (a Repo Map graph node id):
34
+ veritas explain --work-area <work-area-id>
35
+
36
+ # Or pass a bare selector (auto-classified as a rule id, a file path if it contains '/', or a work-area token):
37
+ veritas explain src/path/to/file.ts
38
+ ```
39
+
40
+ `veritas explain` prints a **`Veritas JIT Context`** briefing:
41
+
42
+ - **`Governance:`** — the leading lines of `.veritas/GOVERNANCE.md` (the repo's terse governance rules).
43
+ - One block per **matching rule**: `Rule` / `Kind` / `Enforcement Level` (`Require` / `Guide` / …) /
44
+ `Summary` / `Do` / `Do not` / `Good` / `Bad` / `Context`.
45
+ - **`Surface status:`** — the latest recorded status for that rule from the evidence artifacts
46
+ (e.g. `verified`), plus any `Surface fault:` transparency-gap lines.
47
+
48
+ Read the matching rules, honor their `Do`/`Do not`, and keep the change inside the work area's
49
+ guidance. `No matching requirement found.` means no additional Repo Standard applies to that path
50
+ — proceed normally, it is not an error.
51
+
52
+ ## Source of truth
53
+
54
+ `veritas explain` is a *projection* of the repo's own governance config. When you want the raw
55
+ standards rather than the filtered view, read them directly — they are the source `explain` reads:
56
+
57
+ - `.veritas/GOVERNANCE.md` — the terse agent-facing governance rules.
58
+ - `.veritas/repo-standards/*.json` — the Repo Standards (each rule's `summary` / `mustDo` /
59
+ `mustNotDo` / `exampleGood` / `exampleBad` / `contextLinks`).
60
+ - `.veritas/repo-map.json` — the work-area graph `--work-area` selects against.
61
+
62
+ ## Contract
63
+
64
+ - **Read-only advisory.** This skill runs `veritas explain`, which reads config and evidence and
65
+ writes nothing. It never gates, never blocks, never attaches evidence, and has no pass/fail
66
+ verdict — it surfaces guidance, full stop. Enforcement stays the PreToolUse hook (engine-side).
67
+ - **No MCP server.** Just-in-time guidance here is agent-invoked CLI (`veritas explain`), not a
68
+ standing MCP service. Per the flow-agents MCP posture (ADR 0011), MCP never carries the gate and
69
+ enforcement stays hooks; this skill is the deliberate agent-pull replacement for a guidance
70
+ server, not a new server.
71
+ - **Wraps the engine; reimplements nothing.** All rule matching, governance projection, and
72
+ surface-status lookup live in `@kontourai/veritas` (`veritas explain` / `src/explain.mjs`). The
73
+ skill adds no evaluation logic.
@@ -11,7 +11,7 @@ Implement an approved plan while preserving scope, traceability, and recovery co
11
11
 
12
12
  - **Role:** canonical Builder build-step producer and standalone execution primitive.
13
13
  - **Binding:** `builder.build` step `execute`.
14
- - **Produces:** the active session execution report (`<slug>--deliver.md`), `state.json`, and `implementation-scope` for an active matching run.
14
+ - **Produces:** the active session execution report (`<slug>--deliver.md`), `state.json`, the wave manifest (`waves.json`) for delegated waves, and `implementation-scope` for an active matching run.
15
15
  - **Standalone no-run behavior:** execute the supplied plan and return execution evidence. Do not start a Builder run, record Builder evidence, or imply that an inactive Builder flow advanced.
16
16
 
17
17
  ## Model Routing
@@ -33,8 +33,8 @@ Use `RepositoryAdapter` for repository, target revision, worktree, and changed-f
33
33
 
34
34
  1. Read the plan. Return it to `plan-work` when it lacks a Definition Of Done, stable acceptance criteria, task mapping, sandbox boundary, or usable execution scope.
35
35
  2. Before delegation, compare the current target revision with the plan's base through `RepositoryAdapter`. Re-ground the plan when changed scope intersects its assumptions; record missing confirmation as `NOT_VERIFIED` rather than treating it as fresh.
36
- 3. Give each worker its bounded task, owned files, relevant acceptance IDs, required evidence, sandbox/worktree constraints, rollback conditions, and plan reference.
37
- 4. Run safe independent tasks concurrently and dependent tasks in order. Between waves, collect results, resolve conflicts, and update the execution record with completed work, remaining work, changed files, and supported acceptance criteria.
36
+ 3. Before dispatching a wave that delegates work, declare it in the session's wave manifest (`waves.json`, schema `schemas/workflow-waves.schema.json`): `wave_id`, owning step, and one `expected_workers` entry per worker, so the expected worker count (M) exists before any result arrives. Then give each worker its bounded task, owned files, relevant acceptance IDs, required evidence, sandbox/worktree constraints, rollback conditions, and plan reference.
37
+ 4. Run safe independent tasks concurrently and dependent tasks in order. Between waves, reconcile results against the wave manifest — never collect from memory or prose. Every declared worker must land exactly one terminal status record (`completed`, `failed`, or `blocked`). Record each declared worker that has no terminal record as `not_reported` — never silently absorb a missing worker — then record the wave's `reconciliation` with an explicit "N of M reported" summary naming the `not_reported` workers (for example "2 of 3 reported; worker-3 not_reported"). Treat the wave as complete only when N equals M; an incomplete wave is visible data that routes to re-dispatch, a blocker, or an explicit accepted gap. After reconciliation, resolve conflicts and update the execution record with completed work, remaining work, changed files, and supported acceptance criteria.
38
38
  5. For UI tasks, include the applicable frontend design guidance in the worker instruction.
39
39
  6. When implementation completes, record scope integrity: changed files, accepted deviations, task-to-criterion traceability, evidence, and outstanding gaps. Hand off to report-only review and verification; do not treat implementation as verification.
40
40
  7. Reconcile the execution report and `state.json` with the active session artifact directory.
@@ -49,6 +49,7 @@ The execution record must identify:
49
49
  - each completed task and its supported `AC*` identifiers
50
50
  - changed files and any scope deviation with approval or route-back reason
51
51
  - worker evidence, conflicts, rollback notes, remaining work, and next action
52
+ - per-wave reconciliation against the manifest: "N of M reported" and any `not_reported` workers with their recovery route
52
53
  - current revision comparison and re-grounding decision
53
54
 
54
55
  ## Active Builder Evidence
@@ -32,6 +32,18 @@ Select ready backlog work and prepare a bounded handoff without implementing it.
32
32
 
33
33
  An optional GitHub adapter may implement these interfaces. Do not require GitHub issue numbers, labels, Projects, pull requests, `gh`, or provider-native dependency APIs.
34
34
 
35
+ ### Readiness Source Integrity
36
+
37
+ A configured `BoardProvider` is the canonical Backlog Readiness Source
38
+ (`docs/decisions/backlog-readiness-source.md`). When the configured board
39
+ yields zero ready items or cannot be read, record the provider warning
40
+ (`zero_ready_items`, or the read failure) in the pull-work artifact and route
41
+ to triage/intake for an explicit readiness decision. Never silently
42
+ substitute `WorkItemProvider` issue-level listing for board-driven selection:
43
+ a deliberate issue-listing pass must carry the `board_provider_bypassed`
44
+ warning it received into the artifact, with the reason the board was
45
+ bypassed.
46
+
35
47
  ## Model Routing
36
48
 
37
49
  For board scans, WIP assessment, dependency joins, and selection bookkeeping, resolve `delegate-mechanical` from `.datum/config.json`. If unavailable, inherit the session model and record the fallback.
@@ -58,6 +58,17 @@ fallback or escalation in the critique artifact.
58
58
  security-policy changes.
59
59
  - `tool-dependencies-updater` for dependency-manifest, lockfile, or dependency-tooling changes.
60
60
  - A configured domain or policy reviewer when the repository requires one.
61
+
62
+ When review fans out to delegated reviewer lanes, declare the fan-out in the
63
+ session's wave manifest (`waves.json`, schema
64
+ `schemas/workflow-waves.schema.json`, step `review`) with one
65
+ `expected_workers` entry per reviewer lane before dispatch. Reconcile against
66
+ that manifest at collection — "N of M reported" — instead of collecting from
67
+ memory: every declared reviewer lands exactly one terminal status record;
68
+ record a reviewer that never reports as `not_reported` in the manifest —
69
+ never silently absorb it — and carry that lane into the critique as
70
+ `not_verified` with the missing report named. A missing reviewer is never a
71
+ clean lane.
61
72
  3. Use repository-provided scanners and checks when applicable. Do not install
62
73
  a scanner, silently substitute a different one, or mark an unavailable
63
74
  required lane clean; record the lane as `NOT_VERIFIED` with the missing
@@ -0,0 +1,87 @@
1
+ ---
2
+ name: "standards-authoring"
3
+ description: "Author or update a repo's Veritas Repo Standards through the kit's standards-authoring flow: run `veritas init --explore`/`--guided` to derive a proposed starter set (project name, repo-shape-adaptive Repo Map nodes, evidence-check inference, and the AGENTS.md/CLAUDE.md governance-block splice), surface it for human approval, then `veritas init --apply` once a human-approved standards-authoring-approval trust.bundle claim satisfies the flow's human-approval gate. Use when adopting Veritas governance in a repo or re-deriving standards after its shape changes — beyond the static starter set `kit provision` scaffolds."
4
+ ---
5
+
6
+ # Standards Authoring
7
+
8
+ Derive a repo's Veritas Repo Standards, get a human to approve them, then write them — the
9
+ authoring UX `veritas init` provides, driven through the kit's `standards-authoring` flow so
10
+ the write is human-gated.
11
+
12
+ **Veritas does the derivation and the write; this skill only invokes the `veritas` CLI and
13
+ surfaces its recommendation for approval.** No standards evaluation, derivation, or splice
14
+ logic is reimplemented here (kit non-goal: never fork or reimplement Veritas).
15
+
16
+ ## When to use this vs. `kit provision`
17
+
18
+ - **`flow-agents kit provision veritas-governance`** copies a *static* starter `.veritas/` set
19
+ (placeholder project name, generic nodes) — fastest path to a repo that runs
20
+ `veritas readiness`. See the kit README's "Scaffolding starter standards".
21
+ - **This skill** runs Veritas's *adaptive* authoring: it derives the project name, Repo Map
22
+ work-area nodes, and evidence-check command from the actual repo, and splices the governance
23
+ block into existing `AGENTS.md`/`CLAUDE.md` — the per-repo work a verbatim file copy cannot
24
+ do. Use it to author standards for real, or to re-derive after the repo's shape changes.
25
+
26
+ ## Flow binding
27
+
28
+ This skill documents how to drive `flows/standards-authoring.flow.json` — a two-step
29
+ **agentless-gate** flow `propose -> apply` with one gate (the kit declares no
30
+ `flow_step_actions`; like `exemption-issuance`, the human produces the gate's approval bundle
31
+ out of band, and this skill is the operator's runbook, not a step-bound action):
32
+
33
+ - `human-approval-gate` (on `apply`) requires a **verified** `standards-authoring-approval`
34
+ trust.bundle claim (`subjectType: "repo-governance-change"`) before the apply write is
35
+ flow-sanctioned.
36
+
37
+ As with `exemption-issuance`'s `human-approval-gate`, "human-approved" is an **operating
38
+ convention** the gate's claim encodes, not a structural human-only guarantee — Flow's schema
39
+ does not distinguish a human-authored bundle from an agent-authored one (see the kit README's
40
+ "Human-approval evidence: what is and is not enforced"). The gate adds a named claim, a
41
+ documented sequence, and an audit trail on top of the same mitigation `veritas init --apply`
42
+ already carries (it refuses to overwrite existing standards without `--force`).
43
+
44
+ ## Sequence
45
+
46
+ ```bash
47
+ # 1. PROPOSE — derive a recommendation without writing anything.
48
+ veritas init --explore
49
+ # (or `veritas init --guided --answers <answers.json>` for owner Q&A)
50
+ # -> writes a hash-pinned recommendation artifact (schema_version, project_name,
51
+ # repo_insights, artifact_payloads incl. AGENTS.md/CLAUDE.md governance blocks,
52
+ # artifact_hashes, recommended_repo_map/standards/authority, owner_questions,
53
+ # reasoning_summary, apply_command). Nothing under .veritas/ is written yet.
54
+
55
+ # 2. APPROVE — a human reviews the recommendation (its reasoning_summary and owner_questions),
56
+ # then authors a Hachure trust.bundle asserting the approval:
57
+ # claimType: "standards-authoring-approval", subjectType: "repo-governance-change",
58
+ # status: "verified".
59
+ flow init
60
+ flow start kits/veritas-governance/flows/standards-authoring.flow.json --run-id authoring
61
+ flow attach-evidence authoring --gate human-approval-gate --file approval.bundle --bundle
62
+ flow evaluate authoring --gate human-approval-gate --exit-code
63
+ # exit 0 once the approval claim is verified; exit 1 (block) otherwise.
64
+
65
+ # 3. APPLY — only after the gate passes, write the approved recommendation.
66
+ veritas init --apply --plan <path-to-recommendation-artifact>
67
+ # -> validates each artifact_hashes[path] === sha256(payload) (tamper/staleness check
68
+ # between propose and apply), refuses to overwrite existing starter files without
69
+ # --force, then writes .veritas/* and splices the governance block into the selected
70
+ # instruction files.
71
+ ```
72
+
73
+ ## Contract
74
+
75
+ - **Wraps the `veritas` CLI; reimplements nothing.** Project-name derivation, adaptive Repo Map
76
+ nodes, evidence-check inference, and the governance-block splice all live inside `veritas`
77
+ (`veritas init` / `src/bootstrap/*` / `src/governance.mjs`). This skill invokes and surfaces;
78
+ it does not compute standards.
79
+ - **The write is human-gated by convention, not structurally.** The flow's
80
+ `standards-authoring-approval` claim is the sign-off record; anyone who can
81
+ `flow attach-evidence --bundle` a conforming claim satisfies it. Read a passing gate as "a
82
+ verified approval claim of the right shape was attached," not as proof a human attached it.
83
+ - **`veritas init --apply` is create-safe by default:** it refuses to overwrite existing
84
+ `.veritas/` standards without `--force`. Re-authoring an already-governed repo is therefore an
85
+ explicit, opt-in action — the skill never silently replaces standards.
86
+ - **No engine dependency, no evaluation.** Nothing here runs or reimplements `veritas readiness`;
87
+ that stays the `readiness-check` flow's concern.