@kontourai/flow-agents 2.3.0 → 3.0.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 (301) hide show
  1. package/.github/CODEOWNERS +16 -0
  2. package/.github/workflows/ci.yml +44 -0
  3. package/.github/workflows/trust-reconcile.yml +62 -4
  4. package/AGENTS.md +4 -4
  5. package/CHANGELOG.md +62 -0
  6. package/CONTEXT.md +35 -0
  7. package/README.md +9 -3
  8. package/agents/dev.json +1 -1
  9. package/agents/tool-code-reviewer.json +1 -1
  10. package/agents/tool-planner.json +3 -3
  11. package/agents/tool-verifier.json +3 -3
  12. package/build/src/cli/assignment-provider.d.ts +1 -0
  13. package/build/src/cli/assignment-provider.js +748 -0
  14. package/build/src/cli/console-learning-projection.js +3 -2
  15. package/build/src/cli/effective-assignment-provider-settings.d.ts +1 -0
  16. package/build/src/cli/effective-assignment-provider-settings.js +125 -0
  17. package/build/src/cli/init.js +104 -21
  18. package/build/src/cli/kit.js +37 -6
  19. package/build/src/cli/pull-work-provider.js +1 -1
  20. package/build/src/cli/usage-feedback.js +3 -3
  21. package/build/src/cli/validate-hook-influence.js +1 -0
  22. package/build/src/cli/validate-workflow-artifacts.js +27 -7
  23. package/build/src/cli/workflow-artifact-cleanup-audit.js +36 -2
  24. package/build/src/cli/workflow-sidecar.d.ts +14 -7
  25. package/build/src/cli/workflow-sidecar.js +938 -168
  26. package/build/src/cli.js +6 -0
  27. package/build/src/flow-kit/validate.d.ts +23 -0
  28. package/build/src/flow-kit/validate.js +67 -1
  29. package/build/src/index.d.ts +1 -1
  30. package/build/src/index.js +1 -1
  31. package/build/src/lib/flow-resolver.d.ts +6 -4
  32. package/build/src/lib/flow-resolver.js +125 -58
  33. package/build/src/lib/local-artifact-root.d.ts +14 -2
  34. package/build/src/lib/local-artifact-root.js +22 -5
  35. package/build/src/lib/workflow-learning-projection.js +2 -2
  36. package/build/src/runtime-adapters.d.ts +12 -0
  37. package/build/src/runtime-adapters.js +56 -16
  38. package/build/src/tools/build-universal-bundles.js +49 -16
  39. package/build/src/tools/generate-context-map.js +10 -8
  40. package/build/src/tools/validate-source-tree.js +24 -1
  41. package/console.telemetry.json +22 -0
  42. package/context/contracts/artifact-contract.md +40 -7
  43. package/context/contracts/assignment-provider-contract.md +239 -0
  44. package/context/contracts/builder-kit-workflow-state-contract.md +5 -2
  45. package/context/contracts/decision-registry-contract.md +265 -0
  46. package/context/contracts/delivery-contract.md +3 -1
  47. package/context/contracts/execution-contract.md +25 -0
  48. package/context/contracts/governance-adapter-contract.md +2 -0
  49. package/context/contracts/knowledge-store-contract.md +197 -0
  50. package/context/contracts/planning-contract.md +4 -1
  51. package/context/contracts/review-contract.md +7 -3
  52. package/context/contracts/sandbox-policy.md +2 -0
  53. package/context/contracts/standing-directives.md +13 -0
  54. package/context/contracts/verification-contract.md +11 -1
  55. package/context/contracts/work-item-contract.md +3 -1
  56. package/context/deferred/parallelization.md +1 -1
  57. package/context/gate-awareness.md +4 -4
  58. package/context/scripts/git-status.sh +2 -2
  59. package/context/scripts/hooks/config-protection.js +502 -2
  60. package/context/scripts/hooks/lib/config-protection-remedies.js +69 -0
  61. package/context/scripts/hooks/run-hook.js +14 -1
  62. package/context/scripts/hooks/stop-goal-fit.js +1140 -99
  63. package/context/scripts/hooks/workflow-steering.js +212 -6
  64. package/context/settings/assignment-provider-settings.json +33 -0
  65. package/docs/adr/0007-flow-skill-kit-tool-boundary.md +2 -0
  66. package/docs/adr/0015-flow-flow-agents-boundary-reconciliation.md +35 -0
  67. package/docs/adr/0019-kit-dependency-ownership.md +62 -0
  68. package/docs/adr/0020-trust-reconcile-manifest-and-claim-classification.md +290 -0
  69. package/docs/adr/0021-assignment-leases-and-stale-claim-takeover.md +221 -0
  70. package/docs/adr/0022-fail-closed-delivery-reconciliation-with-governed-exemptions.md +463 -0
  71. package/docs/agent-system-guidebook.md +3 -3
  72. package/docs/agent-usage-feedback-loop.md +6 -6
  73. package/docs/context-map.md +10 -7
  74. package/docs/decisions/decision-records.md +57 -0
  75. package/docs/decisions/index.md +17 -0
  76. package/docs/decisions/knowledge-store-provider.md +51 -0
  77. package/docs/decisions/model-routing.md +63 -0
  78. package/docs/decisions/promotion-gate.md +52 -0
  79. package/docs/decisions/standing-directives.md +66 -0
  80. package/docs/developer-architecture.md +1 -1
  81. package/docs/fixture-ownership.md +4 -0
  82. package/docs/flow-kit-repository-contract.md +5 -5
  83. package/docs/getting-started.md +12 -2
  84. package/docs/integrations/harness-install.md +2 -1
  85. package/docs/kit-authoring-guide.md +64 -5
  86. package/docs/knowledge-kit.md +5 -1
  87. package/docs/learnings/2026-07-improvement-program.md +203 -0
  88. package/docs/migrations.md +6 -5
  89. package/docs/north-star.md +2 -2
  90. package/docs/operating-layers.md +4 -3
  91. package/docs/repository-structure.md +5 -5
  92. package/docs/skills-map.md +8 -8
  93. package/docs/spec/runtime-hook-surface.md +19 -15
  94. package/docs/spikes/graph-provider-2026-07.md +155 -0
  95. package/docs/standards-register.md +7 -7
  96. package/docs/trust-anchor-adoption.md +105 -4
  97. package/docs/work-item-adapters.md +1 -1
  98. package/docs/workflow-artifact-lifecycle.md +72 -9
  99. package/docs/workflow-eval-strategy.md +3 -3
  100. package/docs/workflow-shared-contracts.md +3 -2
  101. package/docs/workflow-usage-guide.md +260 -21
  102. package/evals/acceptance/DEMO-false-completion.md +20 -11
  103. package/evals/acceptance/prove-capture-teeth-declared.sh +15 -15
  104. package/evals/acceptance/prove-capture-teeth.sh +11 -11
  105. package/evals/acceptance/test_kiro_harness.sh +1 -1
  106. package/evals/ci/antigaming-suite.sh +5 -0
  107. package/evals/ci/run-baseline.sh +71 -1
  108. package/evals/fixtures/assignment-provider/actor-a.json +6 -0
  109. package/evals/fixtures/assignment-provider/actor-b.json +6 -0
  110. package/evals/fixtures/assignment-provider/github-issue-claimed.json +27 -0
  111. package/evals/fixtures/assignment-provider/github-issue-unassigned.json +7 -0
  112. package/evals/fixtures/assignment-provider/liveness-fresh.json +9 -0
  113. package/evals/fixtures/assignment-provider/liveness-stale.json +9 -0
  114. package/evals/fixtures/flow-kit-repository/invalid-bad-dependency/flows/review.flow.json +26 -0
  115. package/evals/fixtures/flow-kit-repository/invalid-bad-dependency/kit.json +13 -0
  116. package/evals/fixtures/flow-kit-repository/valid-with-dependency/flows/review.flow.json +26 -0
  117. package/evals/fixtures/flow-kit-repository/valid-with-dependency/kit.json +13 -0
  118. package/evals/fixtures/hook-influence/cases.json +32 -0
  119. package/evals/fixtures/pull-work-provider/github-issues.json +6 -6
  120. package/evals/fixtures/trust-reconcile-exploits/fabricated-attestation.json +59 -0
  121. package/evals/fixtures/trust-reconcile-exploits/no-label-bypass.json +36 -0
  122. package/evals/fixtures/trust-reconcile-exploits/skip-assumed-bypass.json +59 -0
  123. package/evals/fixtures/trust-reconcile-exploits/status-misassertion.json +48 -0
  124. package/evals/fixtures/trust-reconcile-exploits/waived-command-check.json +44 -0
  125. package/evals/fixtures/trust-reconcile-mixed-bundle/mixed-bundle.json +159 -0
  126. package/evals/fixtures/trust-reconcile-ws3/ws3-bundle.json +920 -0
  127. package/evals/integration/test_actor_identity.sh +254 -0
  128. package/evals/integration/test_assignment_provider_github.sh +318 -0
  129. package/evals/integration/test_assignment_provider_local_file.sh +222 -0
  130. package/evals/integration/test_builder_step_producers.sh +33 -23
  131. package/evals/integration/test_bundle_install.sh +22 -16
  132. package/evals/integration/test_bundle_lifecycle.sh +11 -11
  133. package/evals/integration/test_captured_fail_reconciliation.sh +50 -50
  134. package/evals/integration/test_checkpoint_signing.sh +43 -0
  135. package/evals/integration/test_claim_lookup.sh +4 -4
  136. package/evals/integration/test_codex_hook_resolution.sh +114 -0
  137. package/evals/integration/test_command_log_concurrency.sh +8 -8
  138. package/evals/integration/test_command_log_fork_classification.sh +3 -3
  139. package/evals/integration/test_command_log_integrity.sh +16 -16
  140. package/evals/integration/test_console_learning_projection.sh +1 -1
  141. package/evals/integration/test_critique_supersession_roundtrip.sh +182 -0
  142. package/evals/integration/test_dual_emit_flow_step.sh +145 -0
  143. package/evals/integration/test_enforcer_expects_driven.sh +12 -12
  144. package/evals/integration/test_evidence_capture_hook.sh +14 -13
  145. package/evals/integration/test_fixture_retirement_audit.sh +2 -2
  146. package/evals/integration/test_flow_agents_statusline.sh +2 -2
  147. package/evals/integration/test_flow_kit_install_git.sh +52 -0
  148. package/evals/integration/test_flow_kit_repository.sh +2 -0
  149. package/evals/integration/test_flowdef_session_activation.sh +6 -6
  150. package/evals/integration/test_flowdef_union_floor_regression.sh +429 -0
  151. package/evals/integration/test_gate_bypass_chain.sh +52 -40
  152. package/evals/integration/test_gate_lockdown.sh +97 -73
  153. package/evals/integration/test_gate_review_inquiry_records.sh +3 -3
  154. package/evals/integration/test_goal_fit_escape_hatch.sh +10 -10
  155. package/evals/integration/test_goal_fit_ghost_session.sh +104 -0
  156. package/evals/integration/test_goal_fit_hook.sh +32 -32
  157. package/evals/integration/test_goal_fit_rederive.sh +9 -9
  158. package/evals/integration/test_hook_category_behaviors.sh +103 -0
  159. package/evals/integration/test_hook_influence_cases.sh +1 -0
  160. package/evals/integration/test_install_merge.sh +262 -1
  161. package/evals/integration/test_kit_identity_trust.sh +6 -6
  162. package/evals/integration/test_liveness_conflict_injection.sh +587 -0
  163. package/evals/integration/test_liveness_heartbeat.sh +677 -0
  164. package/evals/integration/test_liveness_verdict.sh +394 -0
  165. package/evals/integration/test_local_flow_kit_install.sh +15 -0
  166. package/evals/integration/test_phase_map_and_gate_claim.sh +63 -11
  167. package/evals/integration/test_promote_gate.sh +178 -0
  168. package/evals/integration/test_publish_delivery.sh +23 -6
  169. package/evals/integration/test_pull_work_assignment_join.sh +132 -0
  170. package/evals/integration/test_pull_work_liveness_preflight.sh +394 -0
  171. package/evals/integration/test_pull_work_provider.sh +2 -2
  172. package/evals/integration/test_reconcile_soundness.sh +37 -13
  173. package/evals/integration/test_resolvefirststep_security.sh +22 -0
  174. package/evals/integration/test_runtime_adapter_activation.sh +87 -18
  175. package/evals/integration/test_session_resume_roundtrip.sh +147 -0
  176. package/evals/integration/test_sidecar_field_preservation.sh +249 -0
  177. package/evals/integration/test_trust_reconcile.sh +11 -10
  178. package/evals/integration/test_trust_reconcile_manifest.sh +79 -0
  179. package/evals/integration/test_trust_reconcile_mixed_bundle.sh +96 -0
  180. package/evals/integration/test_trust_reconcile_negatives.sh +759 -0
  181. package/evals/integration/test_usage_feedback_global.sh +5 -5
  182. package/evals/integration/test_validate_artifacts_portability.sh +60 -0
  183. package/evals/integration/test_verify_cli.sh +2 -2
  184. package/evals/integration/test_veritas_governance_kit.sh +117 -0
  185. package/evals/integration/test_workflow_artifact_cleanup_audit.sh +26 -1
  186. package/evals/integration/test_workflow_artifacts.sh +33 -0
  187. package/evals/integration/test_workflow_sidecar_writer.sh +802 -74
  188. package/evals/integration/test_workflow_steering_hook.sh +175 -5
  189. package/evals/lib/codex-provider.sh +1 -1
  190. package/evals/lib/node.sh +19 -1
  191. package/evals/run.sh +32 -0
  192. package/evals/static/test_decisions.sh +150 -0
  193. package/evals/static/test_flowdef_codeowners_coverage.sh +62 -0
  194. package/evals/static/test_knowledge_providers.sh +23 -0
  195. package/evals/static/test_package.sh +19 -10
  196. package/evals/static/test_universal_bundles.sh +48 -3
  197. package/evals/static/test_workflow_skills.sh +41 -8
  198. package/kits/builder/flows/build.flow.json +3 -74
  199. package/kits/builder/flows/publish-learn.flow.json +90 -0
  200. package/kits/builder/kit.json +11 -0
  201. package/kits/builder/skills/builder-shape/SKILL.md +1 -1
  202. package/kits/builder/skills/deliver/SKILL.md +32 -11
  203. package/kits/builder/skills/design-probe/SKILL.md +4 -4
  204. package/kits/builder/skills/evidence-gate/SKILL.md +26 -1
  205. package/kits/builder/skills/execute-plan/SKILL.md +2 -2
  206. package/kits/builder/skills/fix-bug/SKILL.md +2 -0
  207. package/kits/builder/skills/gate-review/SKILL.md +6 -6
  208. package/kits/builder/skills/idea-to-backlog/SKILL.md +1 -1
  209. package/kits/builder/skills/learning-review/SKILL.md +7 -7
  210. package/kits/builder/skills/pickup-probe/SKILL.md +5 -4
  211. package/kits/builder/skills/plan-work/SKILL.md +27 -5
  212. package/kits/builder/skills/pull-work/SKILL.md +148 -5
  213. package/kits/builder/skills/release-readiness/SKILL.md +4 -4
  214. package/kits/builder/skills/review-work/SKILL.md +24 -1
  215. package/kits/builder/skills/tdd-workflow/SKILL.md +2 -0
  216. package/kits/builder/skills/verify-work/SKILL.md +8 -1
  217. package/kits/catalog.json +6 -0
  218. package/kits/knowledge/kit.json +35 -0
  219. package/kits/knowledge/providers/conformance/fixtures/git-repo/CONTEXT.md +12 -0
  220. package/kits/knowledge/providers/conformance/fixtures/git-repo/docs/decisions/old-sprocket-shape.md +13 -0
  221. package/kits/knowledge/providers/conformance/fixtures/git-repo/docs/decisions/sprocket-shape.md +14 -0
  222. package/kits/knowledge/providers/conformance/fixtures/git-repo/docs/decisions/widget-format.md +14 -0
  223. package/kits/knowledge/providers/conformance/fixtures/git-repo/docs/learnings/fixture-learning.md +7 -0
  224. package/kits/knowledge/providers/conformance/fixtures/work-item/issues.json +30 -0
  225. package/kits/knowledge/providers/conformance/suite.test.js +125 -0
  226. package/kits/knowledge/providers/git-repo/index.js +236 -0
  227. package/kits/knowledge/providers/health/health-pass.test.js +99 -0
  228. package/kits/knowledge/providers/health/index.js +153 -0
  229. package/kits/knowledge/providers/index.js +24 -0
  230. package/kits/knowledge/providers/lib/model.js +91 -0
  231. package/kits/knowledge/providers/lib/schema-validate.js +119 -0
  232. package/kits/knowledge/providers/markdown-vault/index.js +169 -0
  233. package/kits/knowledge/providers/work-item/index.js +204 -0
  234. package/kits/veritas-governance/adapter/readiness-to-trust-bundle.mjs +178 -0
  235. package/kits/veritas-governance/docs/README.md +75 -0
  236. package/kits/veritas-governance/fixtures/readiness/not-ready.readiness-report.json +4645 -0
  237. package/kits/veritas-governance/fixtures/readiness/ready.readiness-report.json +4403 -0
  238. package/kits/veritas-governance/flows/readiness-check.flow.json +35 -0
  239. package/kits/veritas-governance/kit.json +16 -0
  240. package/package.json +11 -5
  241. package/packaging/README.md +2 -2
  242. package/packaging/conformance/fixtures/config-protection--allow-read-state-json.json +20 -0
  243. package/packaging/conformance/fixtures/config-protection--block-write-state-json.json +20 -0
  244. package/packaging/conformance/fixtures/stop-goal-fit--block-bundle-disputed-claim.json +1 -1
  245. package/packaging/conformance/fixtures/stop-goal-fit--block-capture-contradicts-claimed-pass.json +1 -1
  246. package/packaging/manifest.json +9 -10
  247. package/schemas/assignment-provider-settings.schema.json +125 -0
  248. package/schemas/decision-record.schema.json +109 -0
  249. package/schemas/knowledge/edge.schema.json +54 -0
  250. package/schemas/knowledge/health-report.schema.json +45 -0
  251. package/schemas/knowledge/node.schema.json +49 -0
  252. package/schemas/knowledge/proposal.schema.json +53 -0
  253. package/schemas/workflow-evidence.schema.json +1 -1
  254. package/schemas/workflow-state.schema.json +5 -0
  255. package/scripts/README.md +8 -3
  256. package/scripts/check-content-boundary.cjs +1 -1
  257. package/scripts/check-decisions.cjs +356 -0
  258. package/scripts/ci/derive-claim-status.mjs +74 -0
  259. package/scripts/ci/trust-reconcile.js +957 -103
  260. package/scripts/git-status.sh +2 -2
  261. package/scripts/hooks/claude-telemetry-hook.js +37 -3
  262. package/scripts/hooks/codex-telemetry-hook.js +36 -2
  263. package/scripts/hooks/config-protection.js +102 -30
  264. package/scripts/hooks/evidence-capture.js +3 -3
  265. package/scripts/hooks/lib/actor-identity.js +368 -0
  266. package/scripts/hooks/lib/config-protection-remedies.js +69 -0
  267. package/scripts/hooks/lib/liveness-heartbeat.js +361 -0
  268. package/scripts/hooks/lib/liveness-policy.js +127 -0
  269. package/scripts/hooks/lib/liveness-read.js +105 -12
  270. package/scripts/hooks/lib/liveness-write.js +46 -0
  271. package/scripts/hooks/lib/local-artifact-paths.js +12 -6
  272. package/scripts/hooks/opencode-telemetry-hook.js +27 -1
  273. package/scripts/hooks/pi-telemetry-hook.js +27 -1
  274. package/scripts/hooks/stop-goal-fit.js +157 -26
  275. package/scripts/hooks/workflow-steering.js +77 -3
  276. package/scripts/install-codex-home.sh +138 -38
  277. package/scripts/statusline/flow-agents-statusline.js +2 -2
  278. package/src/cli/assignment-provider.ts +845 -0
  279. package/src/cli/console-learning-projection.ts +3 -2
  280. package/src/cli/effective-assignment-provider-settings.ts +112 -0
  281. package/src/cli/init.ts +101 -21
  282. package/src/cli/kit.ts +37 -6
  283. package/src/cli/public-api.test.mjs +58 -6
  284. package/src/cli/pull-work-provider.ts +1 -1
  285. package/src/cli/trust-bundle-policy-order.test.mjs +87 -0
  286. package/src/cli/usage-feedback.ts +3 -3
  287. package/src/cli/validate-hook-influence.ts +1 -0
  288. package/src/cli/validate-workflow-artifacts.ts +27 -7
  289. package/src/cli/veritas-readiness-adapter.test.mjs +267 -0
  290. package/src/cli/workflow-artifact-cleanup-audit.ts +35 -2
  291. package/src/cli/workflow-sidecar.ts +933 -168
  292. package/src/cli.ts +6 -0
  293. package/src/flow-kit/validate.ts +74 -1
  294. package/src/index.ts +6 -2
  295. package/src/lib/flow-resolver.ts +123 -55
  296. package/src/lib/local-artifact-root.ts +24 -5
  297. package/src/lib/workflow-learning-projection.ts +2 -2
  298. package/src/runtime-adapters.ts +61 -15
  299. package/src/tools/build-universal-bundles.ts +49 -16
  300. package/src/tools/generate-context-map.ts +10 -8
  301. package/src/tools/validate-source-tree.ts +24 -1
@@ -0,0 +1,35 @@
1
+ {
2
+ "id": "veritas-governance.readiness-check",
3
+ "version": "1.0",
4
+ "steps": [
5
+ { "id": "readiness", "next": "gate-check" },
6
+ { "id": "gate-check", "next": null }
7
+ ],
8
+ "gates": {
9
+ "gate-check-gate": {
10
+ "step": "gate-check",
11
+ "expects": [
12
+ {
13
+ "id": "readiness-verdict",
14
+ "kind": "trust.bundle",
15
+ "required": true,
16
+ "description": "A `veritas readiness --check evidence --working-tree` run, projected by the kit adapter (adapter/readiness-to-trust-bundle.mjs) into a Hachure trust.bundle, produced a verified software-readiness-verdict claim for this change.",
17
+ "explore_hint": "Run `veritas readiness --check evidence --working-tree`, project its evidence report with adapter/readiness-to-trust-bundle.mjs, then `flow attach-evidence <run> --gate gate-check-gate --file <bundle> --bundle`.",
18
+ "bundle_claim": {
19
+ "claimType": "software-readiness-verdict",
20
+ "subjectType": "repository-change",
21
+ "accepted_statuses": ["verified"]
22
+ }
23
+ }
24
+ ],
25
+ "on_route_back": {
26
+ "missing_evidence": "gate-check",
27
+ "default": "gate-check"
28
+ },
29
+ "route_back_policy": {
30
+ "max_attempts": 3,
31
+ "on_exceeded": "block"
32
+ }
33
+ }
34
+ }
35
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "schema_version": "1.0",
3
+ "id": "veritas-governance",
4
+ "name": "Veritas Governance Kit",
5
+ "description": "Turns a repo's Veritas-governed Repo Standards into deterministic, agentless gate evidence: a single flow gates a real `veritas readiness` run as a trust.bundle software-readiness-verdict claim. Wraps @kontourai/veritas via CLI invocation and a kit-local trust.bundle adapter; does not fork or reimplement standards evaluation.",
6
+ "flows": [
7
+ {
8
+ "id": "veritas-governance.readiness-check",
9
+ "path": "flows/readiness-check.flow.json",
10
+ "description": "Single-gate agentless flow: requires a verified software-readiness-verdict trust.bundle claim (projected from `veritas readiness --check evidence --working-tree`) before the gate-check step can pass. CI-callable, K0."
11
+ }
12
+ ],
13
+ "docs": [
14
+ { "id": "veritas-governance.readme", "path": "docs/README.md" }
15
+ ]
16
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kontourai/flow-agents",
3
- "version": "2.3.0",
3
+ "version": "3.0.0",
4
4
  "description": "Flow Agents — a Kontour product that applies Flow and Veritas discipline as a portable process layer inside the agent tools you already use: Claude Code, Codex, Kiro, opencode, pi, and GitHub Actions — with framework adapters (AWS Strands preview) on the same policy-engine contract.",
5
5
  "keywords": [
6
6
  "agents",
@@ -91,6 +91,7 @@
91
91
  "!evals/results/",
92
92
  "!**/.DS_Store",
93
93
  "!**/.flow-agents/",
94
+ "!**/.kontourai/",
94
95
  "!**/.surface/",
95
96
  "!**/.telemetry/",
96
97
  "!**/.veritas/",
@@ -109,6 +110,8 @@
109
110
  "workflow:sidecar": "npm run build --silent && node build/src/cli/workflow-sidecar.js",
110
111
  "workflow:validate-artifacts": "npm run build --silent && node build/src/cli/validate-workflow-artifacts.js",
111
112
  "effective-backlog-settings": "npm run build --silent && node build/src/cli.js effective-backlog-settings",
113
+ "assignment-provider": "npm run build --silent && node build/src/cli.js assignment-provider",
114
+ "effective-assignment-provider-settings": "npm run build --silent && node build/src/cli.js effective-assignment-provider-settings",
112
115
  "pull-work-provider": "npm run build --silent && node build/src/cli.js pull-work-provider",
113
116
  "publish-change": "npm run build --silent && node build/src/cli.js publish-change",
114
117
  "promote-workflow-artifact": "npm run build --silent && node build/src/cli.js promote-workflow-artifact",
@@ -126,6 +129,7 @@
126
129
  "eval:static": "bash evals/run.sh static",
127
130
  "eval:integration": "bash evals/run.sh integration",
128
131
  "trust-reconcile-verify": "npm run build && npm run eval:static",
132
+ "trust-reconcile-manifest": "bash evals/ci/run-baseline.sh --manifest-json",
129
133
  "eval:acceptance": "bash evals/run.sh acceptance",
130
134
  "eval:llm": "bash evals/run.sh llm",
131
135
  "eval:llm:codex": "bash evals/run.sh llm dev --runtime codex",
@@ -133,19 +137,21 @@
133
137
  "promptfoo": "PROMPTFOO_CONFIG_DIR=.promptfoo PROMPTFOO_DISABLE_WAL_MODE=true PROMPTFOO_DISABLE_TELEMETRY=true promptfoo",
134
138
  "promptfoo:view": "PROMPTFOO_CONFIG_DIR=.promptfoo PROMPTFOO_DISABLE_WAL_MODE=true PROMPTFOO_DISABLE_TELEMETRY=true promptfoo view",
135
139
  "check:content-boundary": "node scripts/check-content-boundary.cjs",
140
+ "check:decisions": "node scripts/check-decisions.cjs check",
141
+ "gen:decisions-index": "node scripts/check-decisions.cjs gen-index",
136
142
  "prepack": "npm run build --silent && npm run validate:source --",
137
143
  "kit": "npm run build --silent && node build/src/cli.js kit"
138
144
  },
139
145
  "devDependencies": {
140
- "@types/node": "^26.0.1",
146
+ "@types/node": "^26.1.0",
141
147
  "promptfoo": "^0.121.17",
142
148
  "typescript": "^6.0.3"
143
149
  },
144
150
  "dependencies": {
145
- "@kontourai/flow": "~1.4.1"
151
+ "@kontourai/flow": "^2.0.0"
146
152
  },
147
153
  "optionalDependencies": {
148
- "hachure": "^0.5.1",
149
- "@kontourai/surface": "^1.2.0"
154
+ "@kontourai/surface": "^2.0.0",
155
+ "hachure": "^0.9.0"
150
156
  }
151
157
  }
@@ -19,7 +19,7 @@ For the full source/generated/runtime inventory, see [Repository Structure](../d
19
19
 
20
20
  - `dist/kiro/` keeps native Kiro JSON agents and rewrites path-bound config through the install token.
21
21
  - `dist/claude-code/` exports `.claude/agents/*.md` and `.claude/skills/*/SKILL.md`.
22
- - `dist/codex/` exports `.codex/agents/*.toml`, `.codex/skills/*/SKILL.md`, and profile config for `kdev` and its Bedrock variant.
22
+ - `dist/codex/` exports `.codex/agents/*.toml`, `.codex/skills/*/SKILL.md`, and generated profile config for operating intents such as `builder` and `personal`.
23
23
 
24
24
  All targets also receive shared canonical directories where supported: `context/`, `powers/`, `prompts/`, `scripts/`, and `evals/`.
25
25
 
@@ -29,7 +29,7 @@ All targets also receive shared canonical directories where supported: `context/
29
29
 
30
30
  `dist/` is a generated export surface, not the source of truth. Installed runtime directories such as `.codex/` and `.claude/` are also not source. They are created from the generated target bundle and installer scripts. If generated or installed hook config is wrong, fix the canonical source, rebuild `dist/`, and reinstall the runtime config.
31
31
 
32
- Runtime workflow state under `.flow-agents/<slug>/` is local working memory. Packaging should copy canonical workflow contracts and skills, but it should not publish local task artifacts as product source. Durable outcomes must be promoted into docs, source, schemas, or provider records before merge.
32
+ Runtime workflow state under `.kontourai/flow-agents/<slug>/` is local working memory. Packaging should copy canonical workflow contracts and skills, but it should not publish local task artifacts as product source. Durable outcomes must be promoted into docs, source, schemas, or provider records before merge.
33
33
 
34
34
  ## Validation And Build
35
35
 
@@ -0,0 +1,20 @@
1
+ {
2
+ "description": "config-protection allows a read-only tool (Read) on a sidecar state.json — path protection must not block reads",
3
+ "policy_class": "config-protection",
4
+ "canonical_event": "preToolUse",
5
+ "conformance_level": "L2",
6
+ "hook_id": "config-protection",
7
+ "hook_script": "config-protection.js",
8
+ "payload": {
9
+ "hook_event_name": "PreToolUse",
10
+ "tool_name": "Read",
11
+ "tool_input": {
12
+ "path": "/repo/.kontourai/flow-agents/my-slug/state.json"
13
+ }
14
+ },
15
+ "expected": {
16
+ "exit_code": 0,
17
+ "stderr_is_empty": true,
18
+ "stdout_echoes_input": true
19
+ }
20
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "description": "config-protection blocks a Write to a sidecar state.json and routes to the sanctioned sidecar writer (never advising the hook be disabled)",
3
+ "policy_class": "config-protection",
4
+ "canonical_event": "preToolUse",
5
+ "conformance_level": "L2",
6
+ "hook_id": "config-protection",
7
+ "hook_script": "config-protection.js",
8
+ "payload": {
9
+ "hook_event_name": "PreToolUse",
10
+ "tool_name": "Write",
11
+ "tool_input": {
12
+ "path": "/repo/.kontourai/flow-agents/my-slug/state.json"
13
+ }
14
+ },
15
+ "expected": {
16
+ "exit_code": 2,
17
+ "stderr_contains": ["BLOCKED", "advance-state", "Never disable this hook"],
18
+ "stdout_is_empty": true
19
+ }
20
+ }
@@ -13,7 +13,7 @@
13
13
  "AGENTS.md": "# Test Repo\n",
14
14
  ".flow-agents/false-bundle/false-bundle--deliver.md": "# False Bundle\n\nbranch: main\nstatus: delivered\ntype: deliver\n\n## Definition Of Done\n- [x] tests pass\n\n## Goal Fit Gate\n- [x] acceptance verified\n\n### Verdict: PASS\n",
15
15
  ".flow-agents/false-bundle/state.json": "{\"schema_version\":\"1.0\",\"task_slug\":\"false-bundle\",\"status\":\"delivered\",\"phase\":\"done\",\"updated_at\":\"2026-06-23T00:00:00Z\",\"next_action\":{\"status\":\"done\",\"summary\":\"done\"}}",
16
- ".flow-agents/false-bundle/trust.bundle": "{\"schemaVersion\":3,\"source\":\"flow-agents/workflow-sidecar\",\"claims\":[{\"id\":\"c1\",\"subjectId\":\"false-bundle/unit-tests\",\"claimType\":\"workflow.check.command\",\"fieldOrBehavior\":\"unit tests\",\"value\":\"fail\",\"impactLevel\":\"high\",\"status\":\"disputed\",\"createdAt\":\"2026-06-23T00:00:00Z\",\"updatedAt\":\"2026-06-23T00:00:00Z\"}],\"evidence\":[],\"policies\":[],\"events\":[]}"
16
+ ".flow-agents/false-bundle/trust.bundle": "{\"schemaVersion\":5,\"source\":\"flow-agents/workflow-sidecar\",\"claims\":[{\"id\":\"c1\",\"subjectId\":\"false-bundle/unit-tests\",\"claimType\":\"workflow.check.command\",\"fieldOrBehavior\":\"unit tests\",\"value\":\"fail\",\"impactLevel\":\"high\",\"status\":\"disputed\",\"createdAt\":\"2026-06-23T00:00:00Z\",\"updatedAt\":\"2026-06-23T00:00:00Z\"}],\"evidence\":[],\"policies\":[],\"events\":[]}"
17
17
  },
18
18
  "env": {
19
19
  "FLOW_AGENTS_GOAL_FIT_MODE": "block",
@@ -14,7 +14,7 @@
14
14
  ".flow-agents/false-pass/false-pass--deliver.md": "# False Pass\n\nbranch: main\nstatus: delivered\ntype: deliver\n\n## Definition Of Done\n- [x] tests pass\n\n## Goal Fit Gate\n- [x] acceptance verified\n\n### Verdict: PASS\n",
15
15
  ".flow-agents/false-pass/state.json": "{\"schema_version\":\"1.0\",\"task_slug\":\"false-pass\",\"status\":\"delivered\",\"phase\":\"done\",\"updated_at\":\"2026-06-23T00:00:00Z\",\"next_action\":{\"status\":\"done\",\"summary\":\"done\"}}",
16
16
  ".flow-agents/false-pass/command-log.jsonl": "{\"command\":\"npm test\",\"observedResult\":\"fail\",\"exitCode\":1,\"capturedAt\":\"2026-06-23T00:00:00Z\",\"source\":\"postToolUse-capture\"}\n",
17
- ".flow-agents/false-pass/trust.bundle": "{\"schemaVersion\": 3, \"source\": \"flow-agents/workflow-sidecar\", \"claims\": [{\"id\": \"c1\", \"subjectId\": \"false-pass/unit-tests\", \"claimType\": \"workflow.check.command\", \"fieldOrBehavior\": \"unit tests\", \"value\": \"pass\", \"impactLevel\": \"high\", \"status\": \"verified\", \"createdAt\": \"2026-06-23T00:00:00Z\", \"updatedAt\": \"2026-06-23T00:00:00Z\"}], \"evidence\": [{\"id\": \"ev:c1\", \"claimId\": \"c1\", \"evidenceType\": \"test_output\", \"method\": \"validation\", \"sourceRef\": \"false-pass/command-log.jsonl\", \"excerptOrSummary\": \"unit tests\", \"observedAt\": \"2026-06-23T00:00:00Z\", \"collectedBy\": \"flow-agents/workflow-sidecar\", \"passing\": true, \"execution\": {\"runner\": \"bash\", \"label\": \"npm test\", \"isError\": false}}], \"policies\": [], \"events\": [{\"id\": \"evt:c1\", \"claimId\": \"c1\", \"status\": \"verified\", \"actor\": \"flow-agents/workflow-sidecar\", \"method\": \"validation\", \"evidenceIds\": [\"ev:c1\"], \"createdAt\": \"2026-06-23T00:00:00Z\", \"verifiedAt\": \"2026-06-23T00:00:00Z\"}]}"
17
+ ".flow-agents/false-pass/trust.bundle": "{\"schemaVersion\": 5, \"source\": \"flow-agents/workflow-sidecar\", \"claims\": [{\"id\": \"c1\", \"subjectId\": \"false-pass/unit-tests\", \"claimType\": \"workflow.check.command\", \"fieldOrBehavior\": \"unit tests\", \"value\": \"pass\", \"impactLevel\": \"high\", \"status\": \"verified\", \"createdAt\": \"2026-06-23T00:00:00Z\", \"updatedAt\": \"2026-06-23T00:00:00Z\"}], \"evidence\": [{\"id\": \"ev:c1\", \"claimId\": \"c1\", \"evidenceType\": \"test_output\", \"method\": \"validation\", \"sourceRef\": \"false-pass/command-log.jsonl\", \"excerptOrSummary\": \"unit tests\", \"observedAt\": \"2026-06-23T00:00:00Z\", \"collectedBy\": \"flow-agents/workflow-sidecar\", \"passing\": true, \"execution\": {\"runner\": \"bash\", \"label\": \"npm test\", \"isError\": false}}], \"policies\": [], \"events\": [{\"id\": \"evt:c1\", \"claimId\": \"c1\", \"status\": \"verified\", \"actor\": \"flow-agents/workflow-sidecar\", \"method\": \"validation\", \"evidenceIds\": [\"ev:c1\"], \"createdAt\": \"2026-06-23T00:00:00Z\", \"verifiedAt\": \"2026-06-23T00:00:00Z\"}]}"
18
18
  },
19
19
  "env": {
20
20
  "FLOW_AGENTS_GOAL_FIT_MODE": "block",
@@ -25,14 +25,14 @@
25
25
  "install_default": "~/.flow-agents"
26
26
  },
27
27
  "claude_code": {
28
- "task_dir": ".flow-agents",
28
+ "task_dir": ".kontourai/flow-agents",
29
29
  "permissions": {
30
30
  "defaultMode": "auto"
31
31
  },
32
32
  "skipDangerousModePermissionPrompt": true
33
33
  },
34
34
  "codex": {
35
- "task_dir": ".flow-agents",
35
+ "task_dir": ".kontourai/flow-agents",
36
36
  "settings": {
37
37
  "approvals_reviewer": "auto_review"
38
38
  },
@@ -57,22 +57,21 @@
57
57
  "dev"
58
58
  ],
59
59
  "profiles": {
60
- "kdev": {
60
+ "builder": {
61
61
  "model": "gpt-5.5",
62
62
  "model_reasoning_effort": "medium",
63
63
  "approval_policy": "on-request",
64
64
  "sandbox_mode": "workspace-write",
65
65
  "web_search": "cached",
66
- "developer_instructions": "You are operating in Flow Agents dev mode. You write and modify code, validate it works, and deliver clean results. You own the code; specialist tool-* subagents provide bounded context, review, verification, or parallel implementation support. Use deliver for feature work, fix-bug for bug fixes, plan-work for planning, execute-plan for approved plans, review-work for critique, verify-work for evidence collection, search-first for unfamiliar external APIs, and context-budget when context grows. When a workflow skill or shared contract names a delegate, that delegate is a required gate, not an optional optimization: plan-work must delegate to tool-planner, execute-plan to tool-worker, review-work to tool-code-reviewer and conditionally tool-security-reviewer, verify-work to tool-verifier, and browser/UI verification to tool-playwright when those agents are available. Attempt required delegation even in read-only or partially blocked environments; if blocked, report the blocked gate as NOT_VERIFIED or incomplete with evidence instead of replacing it with a local summary. In progress and final reports, name exact delegate ids such as tool-planner, tool-worker, tool-code-reviewer, tool-security-reviewer, tool-verifier, and tool-playwright so text-only evals remain auditable when telemetry is unavailable. In Codex, required specialist delegation must pass the role through the spawn tool, for example agent_type=tool-worker; do not spawn unnamed/default subagents for Flow Agents worker, planner, reviewer, verifier, or Playwright gates."
66
+ "developer_instructions": "You are operating in Flow Agents Builder mode. You write and modify code, validate it works, and deliver clean results. You own the code; specialist tool-* subagents provide bounded context, review, verification, or parallel implementation support. Use deliver for feature work, fix-bug for bug fixes, plan-work for planning, execute-plan for approved plans, review-work for critique, verify-work for evidence collection, search-first for unfamiliar external APIs, and context-budget when context grows. When a workflow skill or shared contract names a delegate, that delegate is a required gate, not an optional optimization: plan-work must delegate to tool-planner, execute-plan to tool-worker, review-work to tool-code-reviewer and conditionally tool-security-reviewer, verify-work to tool-verifier, and browser/UI verification to tool-playwright when those agents are available. Attempt required delegation even in read-only or partially blocked environments; if blocked, report the blocked gate as NOT_VERIFIED or incomplete with evidence instead of replacing it with a local summary. In progress and final reports, name exact delegate ids such as tool-planner, tool-worker, tool-code-reviewer, tool-security-reviewer, tool-verifier, and tool-playwright so text-only evals remain auditable when telemetry is unavailable. In Codex, required specialist delegation must pass the role through the spawn tool, for example agent_type=tool-worker; do not spawn unnamed/default subagents for Flow Agents worker, planner, reviewer, verifier, or Playwright gates."
67
67
  },
68
- "kdev-br": {
69
- "model_provider": "amazon-bedrock",
70
- "model": "amazon.nova-pro-v1:0",
68
+ "personal": {
69
+ "model": "gpt-5.4-mini",
71
70
  "model_reasoning_effort": "medium",
72
71
  "approval_policy": "on-request",
73
72
  "sandbox_mode": "workspace-write",
74
73
  "web_search": "cached",
75
- "developer_instructions": "You are operating in Flow Agents dev mode on Amazon Bedrock. You write and modify code, validate it works, and deliver clean results. You own the code; specialist tool-* subagents provide bounded context, review, verification, or parallel implementation support. Use deliver for feature work, fix-bug for bug fixes, plan-work for planning, execute-plan for approved plans, review-work for critique, verify-work for evidence collection, search-first for unfamiliar external APIs, and context-budget when context grows. When a workflow skill or shared contract names a delegate, that delegate is a required gate, not an optional optimization: plan-work must delegate to tool-planner, execute-plan to tool-worker, review-work to tool-code-reviewer and conditionally tool-security-reviewer, verify-work to tool-verifier, and browser/UI verification to tool-playwright when those agents are available. Attempt required delegation even in read-only or partially blocked environments; if blocked, report the blocked gate as NOT_VERIFIED or incomplete with evidence instead of replacing it with a local summary. In progress and final reports, name exact delegate ids such as tool-planner, tool-worker, tool-code-reviewer, tool-security-reviewer, tool-verifier, and tool-playwright so text-only evals remain auditable when telemetry is unavailable. In Codex, required specialist delegation must pass the role through the spawn tool, for example agent_type=tool-worker; do not spawn unnamed/default subagents for Flow Agents worker, planner, reviewer, verifier, or Playwright gates."
74
+ "developer_instructions": "You are operating in Flow Agents Personal mode for email, knowledge work, research, writing, and lightweight automation. Keep durable notes and decisions easy to recover across sessions. Use knowledge-capture when the user asks you to remember, save, capture, file, or bookmark context, or when a source, decision, relationship detail, or reusable lesson should be indexed. Prefer concise synthesis, explicit source attribution when web research is used, and reversible changes to local files. For software work, switch back to Builder mode or explicitly use the Builder workflow skills so planning, review, and verification gates remain intact."
76
75
  }
77
76
  },
78
77
  "model_providers": {
@@ -223,10 +222,10 @@
223
222
  ]
224
223
  },
225
224
  "opencode": {
226
- "task_dir": ".flow-agents",
225
+ "task_dir": ".kontourai/flow-agents",
227
226
  "default_agent_mode": "subagent"
228
227
  },
229
228
  "pi": {
230
- "task_dir": ".flow-agents"
229
+ "task_dir": ".kontourai/flow-agents"
231
230
  }
232
231
  }
@@ -0,0 +1,125 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://flow-agents.dev/schemas/assignment-provider-settings.schema.json",
4
+ "title": "Flow Agents Assignment Provider Settings",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schema_version"],
8
+ "properties": {
9
+ "$schema": { "type": "string" },
10
+ "schema_version": { "const": "1.0" },
11
+ "defaults": { "$ref": "#/$defs/assignment_settings" },
12
+ "projects": {
13
+ "type": "array",
14
+ "items": { "$ref": "#/$defs/project_assignment_settings" }
15
+ }
16
+ },
17
+ "anyOf": [{ "required": ["defaults"] }, { "required": ["projects"] }],
18
+ "$defs": {
19
+ "project_assignment_settings": {
20
+ "allOf": [
21
+ { "$ref": "#/$defs/assignment_settings" },
22
+ { "type": "object", "required": ["project"] }
23
+ ]
24
+ },
25
+ "assignment_settings": {
26
+ "type": "object",
27
+ "additionalProperties": false,
28
+ "required": ["provider", "policy"],
29
+ "properties": {
30
+ "project": { "$ref": "#/$defs/project_match" },
31
+ "provider": { "$ref": "#/$defs/provider" },
32
+ "policy": { "$ref": "#/$defs/policy" }
33
+ }
34
+ },
35
+ "project_match": {
36
+ "type": "object",
37
+ "additionalProperties": false,
38
+ "required": ["repo"],
39
+ "properties": {
40
+ "repo": { "$ref": "#/$defs/repo" },
41
+ "paths": { "type": "array", "items": { "type": "string", "minLength": 1 } }
42
+ }
43
+ },
44
+ "provider": {
45
+ "oneOf": [
46
+ { "$ref": "#/$defs/github_provider" },
47
+ { "$ref": "#/$defs/local_file_provider" }
48
+ ]
49
+ },
50
+ "github_provider": {
51
+ "type": "object",
52
+ "additionalProperties": false,
53
+ "required": ["kind", "repo", "capabilities"],
54
+ "properties": {
55
+ "kind": { "const": "github" },
56
+ "repo": { "$ref": "#/$defs/repo" },
57
+ "capabilities": { "$ref": "#/$defs/capabilities" }
58
+ }
59
+ },
60
+ "local_file_provider": {
61
+ "type": "object",
62
+ "additionalProperties": false,
63
+ "required": ["kind", "capabilities"],
64
+ "properties": {
65
+ "kind": { "const": "local-file" },
66
+ "capabilities": { "$ref": "#/$defs/capabilities" }
67
+ }
68
+ },
69
+ "policy": {
70
+ "type": "object",
71
+ "additionalProperties": false,
72
+ "required": ["label_name", "claim_comment_marker", "human_assignee_policy"],
73
+ "properties": {
74
+ "label_name": {
75
+ "type": "string",
76
+ "minLength": 1,
77
+ "description": "Label attached to a claimed subject on providers that support labels. Default: \"agent:claimed\"."
78
+ },
79
+ "claim_comment_marker": {
80
+ "type": "string",
81
+ "minLength": 1,
82
+ "description": "Fixed marker used to locate the machine-readable claim comment among human comments. Default: \"<!-- flow-agents:assignment-claim -->\"."
83
+ },
84
+ "human_assignee_policy": { "$ref": "#/$defs/human_assignee_policy" },
85
+ "comment_refresh_on_phase_transition": {
86
+ "type": "boolean",
87
+ "description": "Whether an explicit render-claim/render-supersede call at a phase transition also refreshes the claim comment body. Default: false. No new mechanism; this reuses the same render path already built for claim."
88
+ }
89
+ }
90
+ },
91
+ "human_assignee_policy": {
92
+ "type": "object",
93
+ "additionalProperties": false,
94
+ "required": ["behavior", "idle_threshold_days"],
95
+ "properties": {
96
+ "behavior": {
97
+ "enum": ["ask_first", "never_reclaim"],
98
+ "description": "Default: \"ask_first\". A human assignee is never auto-superseded regardless of this value; this knob only governs whether idle human assignments are ever surfaced for possible reclaim confirmation (ask_first) or left untouched (never_reclaim)."
99
+ },
100
+ "idle_threshold_days": {
101
+ "type": "integer",
102
+ "minimum": 0,
103
+ "description": "Days of no linked activity before an idle human assignment is surfaced for confirmation. Default: 3."
104
+ }
105
+ }
106
+ },
107
+ "capabilities": {
108
+ "type": "array",
109
+ "items": {
110
+ "enum": ["assignees", "labels", "comments"]
111
+ },
112
+ "uniqueItems": true
113
+ },
114
+ "repo": {
115
+ "type": "object",
116
+ "additionalProperties": false,
117
+ "required": ["owner", "name"],
118
+ "properties": {
119
+ "owner": { "type": "string", "minLength": 1 },
120
+ "name": { "type": "string", "minLength": 1 },
121
+ "url": { "type": "string" }
122
+ }
123
+ }
124
+ }
125
+ }
@@ -0,0 +1,109 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://flow-agents.dev/schemas/decision-record.schema.json",
4
+ "title": "Flow Agents Decision Record",
5
+ "description": "YAML frontmatter for a topic-keyed living decision record at docs/decisions/<topic-slug>.md. One file per decision SUBJECT. Supersession is an edit to this file; tombstones (superseded_by / merged_into) point at the slug that carries the current answer. Numbered ADRs under docs/adr are frozen history and are NOT validated by this schema.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": ["status", "subject", "decided", "evidence"],
9
+ "properties": {
10
+ "status": {
11
+ "type": "string",
12
+ "enum": ["current", "superseded", "merged", "needs-decision"],
13
+ "description": "current: this file holds the live answer for its subject. superseded: the subject moved to another topic slug (see superseded_by); this file is a tombstone. merged: the subject was folded into another topic slug (see merged_into); this file is a tombstone. needs-decision: a stub topic that names an open subject with no ratified answer yet (used by ADR freeze tooling, issue #314, to record that a frozen ADR's subject still needs a living decision). A needs-decision stub carries provenance evidence but no live decision body."
14
+ },
15
+ "subject": {
16
+ "type": "string",
17
+ "minLength": 1,
18
+ "description": "The decision SUBJECT, a noun phrase drawn from the repository's CONTEXT.md domain vocabulary. The subject is the topic namespace; if the term is absent from CONTEXT.md, add it there first."
19
+ },
20
+ "decided": {
21
+ "type": "string",
22
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
23
+ "description": "ISO date (YYYY-MM-DD) the current decision was ratified. For needs-decision stubs, the date the stub was recorded."
24
+ },
25
+ "evidence": {
26
+ "type": "array",
27
+ "minItems": 1,
28
+ "description": "Derivation context is LINKED here, never inlined. Each ref points at durable provenance: an issue, a PR, an archived session artifact, or a frozen ADR. Secret-shaped literals are refused.",
29
+ "items": {
30
+ "type": "object",
31
+ "additionalProperties": false,
32
+ "required": ["kind", "ref"],
33
+ "properties": {
34
+ "kind": {
35
+ "type": "string",
36
+ "enum": ["issue", "pr", "commit", "session-archive", "adr", "doc", "url"],
37
+ "description": "issue/pr/commit: a GitHub reference (number, URL, or SHA). session-archive: a path to an archived session artifact under .kontourai/ that was promoted at retirement. adr: a frozen numbered ADR under docs/adr that is provenance for this decision. doc: a repository document path. url: an external permalink."
38
+ },
39
+ "ref": {
40
+ "type": "string",
41
+ "minLength": 1,
42
+ "description": "The reference literal. Must not contain secret-shaped material (access keys, tokens, private keys, JWTs).",
43
+ "not": {
44
+ "pattern": "(AKIA[A-Z0-9]{16}|ASIA[A-Z0-9]{16}|gh[pousr]_[A-Za-z0-9_]{36,}|BEGIN[A-Z ]*PRIVATE KEY|eyJ[A-Za-z0-9_-]{10,}\\.eyJ[A-Za-z0-9_-]{10,}\\.[A-Za-z0-9_-]{10,})"
45
+ }
46
+ }
47
+ }
48
+ }
49
+ },
50
+ "supersedes": {
51
+ "type": "array",
52
+ "description": "Optional. Topic slugs whose subjects this file absorbed (e.g. the surviving file of a merge lists the slugs it merged in). Each item must be a valid topic slug.",
53
+ "items": { "$ref": "#/$defs/slug" }
54
+ },
55
+ "superseded_by": {
56
+ "allOf": [{ "$ref": "#/$defs/slug" }],
57
+ "description": "Present only when status is superseded. The topic slug that now carries the current answer for this subject (the subject was renamed or split to a different topic)."
58
+ },
59
+ "merged_into": {
60
+ "allOf": [{ "$ref": "#/$defs/slug" }],
61
+ "description": "Present only when status is merged. The topic slug this subject was folded into."
62
+ }
63
+ },
64
+ "allOf": [
65
+ {
66
+ "if": { "properties": { "status": { "const": "current" } } },
67
+ "then": {
68
+ "not": {
69
+ "anyOf": [
70
+ { "required": ["superseded_by"] },
71
+ { "required": ["merged_into"] }
72
+ ]
73
+ }
74
+ }
75
+ },
76
+ {
77
+ "if": { "properties": { "status": { "const": "superseded" } } },
78
+ "then": {
79
+ "required": ["superseded_by"],
80
+ "not": { "required": ["merged_into"] }
81
+ }
82
+ },
83
+ {
84
+ "if": { "properties": { "status": { "const": "merged" } } },
85
+ "then": {
86
+ "required": ["merged_into"],
87
+ "not": { "required": ["superseded_by"] }
88
+ }
89
+ },
90
+ {
91
+ "if": { "properties": { "status": { "const": "needs-decision" } } },
92
+ "then": {
93
+ "not": {
94
+ "anyOf": [
95
+ { "required": ["superseded_by"] },
96
+ { "required": ["merged_into"] }
97
+ ]
98
+ }
99
+ }
100
+ }
101
+ ],
102
+ "$defs": {
103
+ "slug": {
104
+ "type": "string",
105
+ "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$",
106
+ "description": "A topic slug: lowercase kebab-case nouns from CONTEXT.md vocabulary. Resolves to docs/decisions/<slug>.md."
107
+ }
108
+ }
109
+ }
@@ -0,0 +1,54 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://flow-agents.dev/schemas/knowledge/edge.schema.json",
4
+ "title": "Knowledge Graph Edge",
5
+ "description": "A typed, directed edge between two nodes. The edge-type vocabulary is CLOSED (unlike node types): supersedes, merged-into, blocks, evidence-of, mentions, relates. Every edge carries provenance. The `to` endpoint MAY reference a node that is not present in the graph (an external or dangling reference); `resolved` records whether the provider expects the target to resolve, which the dependency-link-integrity health verb uses to separate deliberate external refs from broken links.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": ["id", "type", "from", "to", "provenance"],
9
+ "properties": {
10
+ "id": {
11
+ "type": "string",
12
+ "minLength": 1,
13
+ "description": "Provider-scoped stable identifier for the edge."
14
+ },
15
+ "type": {
16
+ "type": "string",
17
+ "enum": ["supersedes", "merged-into", "blocks", "evidence-of", "mentions", "relates"],
18
+ "description": "supersedes: from replaces to. merged-into: from was folded into to. blocks: from must complete before to. evidence-of: from is provenance/evidence for to. mentions: from references to in prose. relates: general undirected-ish association."
19
+ },
20
+ "from": {
21
+ "type": "string",
22
+ "minLength": 1,
23
+ "description": "Source node id."
24
+ },
25
+ "to": {
26
+ "type": "string",
27
+ "minLength": 1,
28
+ "description": "Target node id. MAY be a node id not present in the graph when `resolved` is false (external ref)."
29
+ },
30
+ "resolved": {
31
+ "type": "boolean",
32
+ "description": "true (default when omitted) means the provider expects `to` to resolve to a node in the same graph; a missing target is then a broken link. false means `to` is a deliberate external reference (e.g. evidence-of a PR outside the store) and MUST NOT be flagged as broken."
33
+ },
34
+ "attributes": {
35
+ "type": "object",
36
+ "description": "Provider-specific structured fields for the edge."
37
+ },
38
+ "provenance": { "$ref": "#/$defs/provenance" }
39
+ },
40
+ "$defs": {
41
+ "provenance": {
42
+ "type": "object",
43
+ "additionalProperties": false,
44
+ "required": ["provider", "source", "retrieved_at"],
45
+ "properties": {
46
+ "provider": { "type": "string", "minLength": 1 },
47
+ "source": { "type": "string", "minLength": 1 },
48
+ "locator": { "type": "string" },
49
+ "retrieved_at": { "type": "string", "minLength": 1 },
50
+ "agent": { "type": "string" }
51
+ }
52
+ }
53
+ }
54
+ }
@@ -0,0 +1,45 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://flow-agents.dev/schemas/knowledge/health-report.schema.json",
4
+ "title": "Knowledge Health Report",
5
+ "description": "The schema-valid output of a provider-agnostic health verb (duplicate detection, dependency-link integrity). The same report shape is produced regardless of which provider supplied the graph, which is what lets one health command run identically over vault, git-repo, and work-item.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": ["schema_version", "check", "provider", "generated_at", "summary", "findings"],
9
+ "properties": {
10
+ "schema_version": { "const": "1.0" },
11
+ "check": {
12
+ "type": "string",
13
+ "enum": ["duplicate-detection", "dependency-link-integrity"],
14
+ "description": "Which health verb produced the report."
15
+ },
16
+ "provider": { "type": "string", "minLength": 1, "description": "Provider id the graph was read from." },
17
+ "generated_at": { "type": "string", "minLength": 1 },
18
+ "summary": {
19
+ "type": "object",
20
+ "additionalProperties": false,
21
+ "required": ["nodes_examined", "edges_examined", "finding_count"],
22
+ "properties": {
23
+ "nodes_examined": { "type": "integer" },
24
+ "edges_examined": { "type": "integer" },
25
+ "finding_count": { "type": "integer" }
26
+ }
27
+ },
28
+ "findings": {
29
+ "type": "array",
30
+ "items": {
31
+ "type": "object",
32
+ "additionalProperties": false,
33
+ "required": ["kind", "severity", "message", "evidence"],
34
+ "properties": {
35
+ "kind": { "type": "string", "minLength": 1 },
36
+ "severity": { "type": "string", "enum": ["info", "warning", "error"] },
37
+ "node_ids": { "type": "array", "items": { "type": "string" } },
38
+ "edge_ids": { "type": "array", "items": { "type": "string" } },
39
+ "message": { "type": "string", "minLength": 1 },
40
+ "evidence": { "type": "object" }
41
+ }
42
+ }
43
+ }
44
+ }
45
+ }