@kontourai/flow-agents 3.0.0 → 3.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 (131) hide show
  1. package/.github/workflows/ci.yml +8 -0
  2. package/CHANGELOG.md +15 -0
  3. package/CONTEXT.md +67 -1
  4. package/README.md +4 -0
  5. package/build/src/cli/assignment-provider.d.ts +143 -0
  6. package/build/src/cli/assignment-provider.js +106 -49
  7. package/build/src/cli/workflow-sidecar.d.ts +2 -2
  8. package/build/src/cli/workflow-sidecar.js +392 -35
  9. package/build/src/lib/flow-resolver.d.ts +12 -6
  10. package/build/src/lib/flow-resolver.js +30 -14
  11. package/build/src/tools/validate-source-tree.js +2 -1
  12. package/context/contracts/assignment-provider-contract.md +9 -0
  13. package/context/contracts/probe-docs-write-contract.md +187 -0
  14. package/context/scripts/hooks/config-protection.js +14 -1
  15. package/context/scripts/hooks/lib/config-protection-remedies.js +9 -0
  16. package/context/scripts/hooks/stop-goal-fit.js +4 -2
  17. package/context/scripts/hooks/workflow-steering.js +42 -0
  18. package/docs/adr/0001-flow-agents-consumes-flow.md +2 -0
  19. package/docs/adr/0002-flow-kits-as-extension-unit.md +2 -0
  20. package/docs/adr/0003-flow-agents-coordinates-kits-and-adapters.md +2 -0
  21. package/docs/adr/0004-gates-expect-surface-claims.md +2 -0
  22. package/docs/adr/0005-kubernetes-inspired-resource-contracts.md +2 -0
  23. package/docs/adr/0006-typescript-first-source-policy.md +2 -0
  24. package/docs/adr/0007-flow-skill-kit-tool-boundary.md +2 -0
  25. package/docs/adr/0007-skill-audit.md +2 -0
  26. package/docs/adr/0008-kit-operation-boundary.md +2 -0
  27. package/docs/adr/0009-canonical-hook-core-kit-boundary.md +2 -0
  28. package/docs/adr/0010-workflow-trust-state-as-hachure-bundle.md +2 -0
  29. package/docs/adr/0011-mcp-posture.md +2 -0
  30. package/docs/adr/0012-agent-coordination-as-liveness-claims.md +2 -0
  31. package/docs/adr/0013-context-lifecycle.md +2 -0
  32. package/docs/adr/0014-core-vs-domain-kit-boundary.md +2 -0
  33. package/docs/adr/0015-flow-flow-agents-boundary-reconciliation.md +2 -0
  34. package/docs/adr/0016-three-hard-boundary-model.md +2 -0
  35. package/docs/adr/0017-anti-gaming-trust-security-model.md +2 -0
  36. package/docs/adr/0018-freeze-local-shell-heuristics.md +2 -0
  37. package/docs/adr/0019-kit-dependency-ownership.md +2 -0
  38. package/docs/adr/0020-trust-reconcile-manifest-and-claim-classification.md +2 -0
  39. package/docs/adr/0021-assignment-leases-and-stale-claim-takeover.md +3 -1
  40. package/docs/adr/0022-fail-closed-delivery-reconciliation-with-governed-exemptions.md +2 -0
  41. package/docs/adr/README.md +49 -0
  42. package/docs/adr/index.md +34 -0
  43. package/docs/decisions/agent-coordination.md +20 -0
  44. package/docs/decisions/anti-gaming-trust-security.md +20 -0
  45. package/docs/decisions/context-lifecycle.md +18 -0
  46. package/docs/decisions/core-domain-kit-boundary.md +18 -0
  47. package/docs/decisions/flow-flow-agents-boundary.md +18 -0
  48. package/docs/decisions/flow-kit.md +20 -0
  49. package/docs/decisions/flow-skill-kit-tool-boundary.md +20 -0
  50. package/docs/decisions/graph-knowledge-provider.md +63 -0
  51. package/docs/decisions/hook-core-kit-boundary.md +18 -0
  52. package/docs/decisions/index.md +19 -0
  53. package/docs/decisions/kit-dependency-ownership.md +18 -0
  54. package/docs/decisions/kit-operation-boundary.md +18 -0
  55. package/docs/decisions/knowledge-promote-sub-flow.md +59 -0
  56. package/docs/decisions/kontour-resource-contract.md +18 -0
  57. package/docs/decisions/mcp-posture.md +18 -0
  58. package/docs/decisions/three-hard-boundary-model.md +18 -0
  59. package/docs/decisions/trust-reconcile.md +20 -0
  60. package/docs/decisions/typescript-source-policy.md +48 -0
  61. package/docs/decisions/workflow-enforcement.md +18 -0
  62. package/docs/decisions/workflow-trust-state.md +20 -0
  63. package/docs/fixture-ownership.md +1 -1
  64. package/docs/workflow-usage-guide.md +1 -1
  65. package/evals/ci/run-baseline.sh +4 -0
  66. package/evals/fixtures/assignment-provider/hostile-effective-state.json +11 -0
  67. package/evals/integration/test_current_json_per_actor.sh +516 -0
  68. package/evals/integration/test_ensure_session_ownership_guard.sh +435 -0
  69. package/evals/integration/test_gate_lockdown.sh +10 -0
  70. package/evals/integration/test_pull_work_liveness_preflight.sh +6 -1
  71. package/evals/integration/test_workflow_sidecar_writer.sh +12 -3
  72. package/evals/run.sh +4 -0
  73. package/evals/static/test_knowledge_providers.sh +13 -4
  74. package/evals/static/test_workflow_skills.sh +15 -2
  75. package/kits/builder/skills/deliver/SKILL.md +17 -0
  76. package/kits/builder/skills/design-probe/SKILL.md +37 -0
  77. package/kits/builder/skills/pickup-probe/SKILL.md +4 -4
  78. package/kits/knowledge/adapters/default-store/index.js +92 -4
  79. package/kits/knowledge/adapters/obsidian-store/index.js +69 -4
  80. package/kits/knowledge/adapters/shared/codec.js +141 -0
  81. package/kits/knowledge/docs/README.md +121 -2
  82. package/kits/knowledge/docs/store-contract.md +112 -4
  83. package/kits/knowledge/evals/contract-suite/suite.test.js +176 -0
  84. package/kits/knowledge/flows/promote.flow.json +84 -0
  85. package/kits/knowledge/kit.json +15 -0
  86. package/kits/knowledge/promote/distill.js +96 -0
  87. package/kits/knowledge/promote/fixtures/contradiction-registry/CONTEXT.md +7 -0
  88. package/kits/knowledge/promote/fixtures/contradiction-registry/docs/decisions/cache-eviction-policy.md +12 -0
  89. package/kits/knowledge/promote/fixtures/contradiction-registry/docs/decisions/cache-eviction.md +12 -0
  90. package/kits/knowledge/promote/fixtures/repo/CONTEXT.md +11 -0
  91. package/kits/knowledge/promote/fixtures/repo/docs/decisions/index.md +9 -0
  92. package/kits/knowledge/promote/fixtures/repo/docs/decisions/liveness-claim.md +12 -0
  93. package/kits/knowledge/promote/fixtures/session/acceptance.json +9 -0
  94. package/kits/knowledge/promote/fixtures/session/agents/tool-planner/events.jsonl +1 -0
  95. package/kits/knowledge/promote/fixtures/session/agents/tool-verifier/events.jsonl +1 -0
  96. package/kits/knowledge/promote/fixtures/session/agents/tool-worker-1-1/events.jsonl +1 -0
  97. package/kits/knowledge/promote/fixtures/session/kontourai-flow-agents-287--deliver.md +47 -0
  98. package/kits/knowledge/promote/fixtures/session/learning.json +35 -0
  99. package/kits/knowledge/promote/fixtures/session/state.json +19 -0
  100. package/kits/knowledge/promote/health.js +137 -0
  101. package/kits/knowledge/promote/index.js +176 -0
  102. package/kits/knowledge/promote/ingest.js +103 -0
  103. package/kits/knowledge/promote/lib.js +132 -0
  104. package/kits/knowledge/promote/link.js +84 -0
  105. package/kits/knowledge/promote/promote.test.js +174 -0
  106. package/kits/knowledge/providers/conformance/suite.test.js +18 -0
  107. package/kits/knowledge/providers/index.js +1 -0
  108. package/kits/knowledge/providers/neo4j/connection.js +121 -0
  109. package/kits/knowledge/providers/neo4j/cypher.js +190 -0
  110. package/kits/knowledge/providers/neo4j/fake-driver.js +123 -0
  111. package/kits/knowledge/providers/neo4j/fixtures/spike-ground-truth.json +29 -0
  112. package/kits/knowledge/providers/neo4j/graph-queries.js +210 -0
  113. package/kits/knowledge/providers/neo4j/index.js +280 -0
  114. package/kits/knowledge/providers/neo4j/integration.test.js +122 -0
  115. package/kits/knowledge/providers/neo4j/neo4j.test.js +219 -0
  116. package/kits/knowledge/providers/neo4j/sync.js +235 -0
  117. package/package.json +4 -2
  118. package/scripts/README.md +1 -0
  119. package/scripts/freeze-adrs.mjs +364 -0
  120. package/scripts/hooks/config-protection.js +14 -1
  121. package/scripts/hooks/evidence-capture.js +4 -1
  122. package/scripts/hooks/lib/config-protection-remedies.js +9 -0
  123. package/scripts/hooks/lib/current-pointer.js +123 -0
  124. package/scripts/hooks/lib/liveness-heartbeat.js +75 -35
  125. package/scripts/hooks/stop-goal-fit.js +4 -2
  126. package/scripts/hooks/workflow-steering.js +42 -0
  127. package/scripts/statusline/flow-agents-statusline.js +3 -1
  128. package/src/cli/assignment-provider.ts +137 -55
  129. package/src/cli/workflow-sidecar.ts +430 -33
  130. package/src/lib/flow-resolver.ts +35 -14
  131. package/src/tools/validate-source-tree.ts +2 -1
@@ -2,6 +2,8 @@
2
2
  title: "ADR 0018: Freeze the Local Shell-Parsing Heuristics; Route New Enforcement to the CI Anchor"
3
3
  ---
4
4
 
5
+ > **FROZEN — immutable history.** Superseding/current decisions live in [`docs/decisions/`](../decisions/index.md). Do not edit.
6
+
5
7
  # ADR 0018: Freeze the Local Shell-Parsing Heuristics; Route New Enforcement to the CI Anchor
6
8
 
7
9
  Status: Accepted
@@ -2,6 +2,8 @@
2
2
  title: "ADR 0019: Kit Dependency Ownership"
3
3
  ---
4
4
 
5
+ > **FROZEN — immutable history.** Superseding/current decisions live in [`docs/decisions/`](../decisions/index.md). Do not edit.
6
+
5
7
  # ADR 0019: Kit Dependency Ownership
6
8
 
7
9
  **Date:** 2026-07-01
@@ -2,6 +2,8 @@
2
2
  title: "ADR 0020: Trust-Reconcile Manifest, Claim Classification, and Waivers"
3
3
  ---
4
4
 
5
+ > **FROZEN — immutable history.** Superseding/current decisions live in [`docs/decisions/`](../decisions/index.md). Do not edit.
6
+
5
7
  # ADR 0020: Trust-Reconcile Manifest, Claim Classification, and Waivers
6
8
 
7
9
  Status: Accepted
@@ -2,6 +2,8 @@
2
2
  title: "ADR 0021: Assignment Leases and Stale-Claim Takeover"
3
3
  ---
4
4
 
5
+ > **FROZEN — immutable history.** Superseding/current decisions live in [`docs/decisions/`](../decisions/index.md). Do not edit.
6
+
5
7
  # ADR 0021: Assignment Leases and Stale-Claim Takeover
6
8
 
7
9
  **Date:** 2026-07-02
@@ -98,7 +100,7 @@ Five touchpoints, one policy:
98
100
  |---|---|---|
99
101
  | `workflow-steering.js`, every turn | read | one-line liveness digest; "superseded" interrupt for the held subject |
100
102
  | `pull-work` | read + write | exclude held; claim (liveness + provider) on selection |
101
- | `ensure-session` / pickup | read + write | refuse entry to a session dir under a fresh other-actor claim; supersede-then-enter if stale |
103
+ | `ensure-session` / pickup | read + write | refuse entry to a session dir under a fresh other-actor claim; supersede-then-enter if stale (**implemented by #291**) |
102
104
  | `advance-state` + tool activity | write | heartbeat rides existing writes; no bespoke timer |
103
105
  | **publish (push / PR / merge)** | **read, blocking** | **verify-hold**: hard-stop if not the fresh, non-superseded holder |
104
106
 
@@ -2,6 +2,8 @@
2
2
  title: "ADR 0022: Fail-Closed Delivery Reconciliation with Governed Exemptions"
3
3
  ---
4
4
 
5
+ > **FROZEN — immutable history.** Superseding/current decisions live in [`docs/decisions/`](../decisions/index.md). Do not edit.
6
+
5
7
  # ADR 0022: Fail-Closed Delivery Reconciliation with Governed Exemptions
6
8
 
7
9
  **Date:** 2026-07-02
@@ -0,0 +1,49 @@
1
+ ---
2
+ title: ADR Directory (Frozen)
3
+ ---
4
+
5
+ # Architecture Decision Records — FROZEN
6
+
7
+ **This directory is frozen immutable history. Do not add ADR 0023, and do not
8
+ edit the numbered ADRs here** (each carries a `FROZEN — immutable history.`
9
+ banner). The numbered `docs/adr/NNNN-*.md` files are preserved as provenance for
10
+ the decisions that shaped Flow Agents; their subjects have been carried forward
11
+ into the topic-keyed decision registry.
12
+
13
+ See [`index.md`](./index.md) for the generated list of frozen ADRs.
14
+
15
+ ## Where decisions live now
16
+
17
+ New and superseding decisions are recorded as **topic-keyed living decision
18
+ records** under [`docs/decisions/`](../decisions/index.md), one file per decision
19
+ **subject** (a noun from the `CONTEXT.md` glossary), never as a new numbered ADR.
20
+
21
+ - Contract: [`context/contracts/decision-registry-contract.md`](../../context/contracts/decision-registry-contract.md)
22
+ — the normative rules for topic slugs, frontmatter, evidence, and supersession.
23
+ - Frontmatter schema: `schemas/decision-record.schema.json`.
24
+ - Validate + regenerate the index: `npm run check:decisions` /
25
+ `npm run gen:decisions-index`.
26
+ - Glossary: [`../decisions/decision-records.md`](../decisions/decision-records.md)
27
+ explains the registry model; `CONTEXT.md`'s **Decision Records** / **Decision
28
+ Registry** terms are the vocabulary.
29
+
30
+ ## How to record a decision
31
+
32
+ 1. Consult [`../decisions/index.md`](../decisions/index.md) to decide
33
+ **revise-vs-create**: if the subject already has a topic file, edit it
34
+ (supersession is an edit); otherwise create `docs/decisions/<subject-slug>.md`
35
+ using a subject noun from `CONTEXT.md` (add the term first if absent).
36
+ 2. Fill the frontmatter (`status`, `subject`, `decided`, `evidence[]`) per the
37
+ registry contract, then run `npm run gen:decisions-index` and
38
+ `npm run check:decisions`.
39
+ 3. Each frozen ADR whose subject you are ratifying is already linked from its
40
+ `needs-decision` stub's `evidence[]`; flip that stub's `status` to `current`
41
+ and add rationale rather than starting a new file.
42
+
43
+ Agent **probes** (`design-probe`, `pickup-probe`) author decision records
44
+ directly per
45
+ [`context/contracts/probe-docs-write-contract.md`](../../context/contracts/probe-docs-write-contract.md)
46
+ (issue [#311](https://github.com/kontourai/flow-agents/issues/311)): each
47
+ crystallized understanding emits a `CONTEXT.md` vocabulary delta, a
48
+ `docs/decisions/<slug>.md` decision delta (revise-vs-create against the index),
49
+ and a transcript-provenance link back to the Probe's session artifact.
@@ -0,0 +1,34 @@
1
+ ---
2
+ title: ADR Index
3
+ ---
4
+
5
+ # ADR Index
6
+
7
+ Generated by `node scripts/freeze-adrs.mjs` (`npm run freeze:adrs`). Do not edit by hand.
8
+ Numbered ADRs below are FROZEN immutable history (see the banner on each file). Current and superseding decisions live in [docs/decisions/](../decisions/index.md); a frozen ADR's subject is carried forward there as a `needs-decision` stub or a ratified decision.
9
+
10
+ | Number | Title | Date | Link |
11
+ | --- | --- | --- | --- |
12
+ | 0001 | Flow Agents Consumes Flow For Workflow Enforcement | 2026-05-24 | [0001-flow-agents-consumes-flow.md](./0001-flow-agents-consumes-flow.md) |
13
+ | 0002 | Flow Kits As The Extension Unit | unknown | [0002-flow-kits-as-extension-unit.md](./0002-flow-kits-as-extension-unit.md) |
14
+ | 0003 | Flow Agents Coordinates Kits And Adapters | unknown | [0003-flow-agents-coordinates-kits-and-adapters.md](./0003-flow-agents-coordinates-kits-and-adapters.md) |
15
+ | 0004 | Gates Expect Hachure Trust Bundles | 2026-06-26 | [0004-gates-expect-surface-claims.md](./0004-gates-expect-surface-claims.md) |
16
+ | 0005 | Kubernetes-Inspired Kontour Resource Contracts | 2026-05-27 | [0005-kubernetes-inspired-resource-contracts.md](./0005-kubernetes-inspired-resource-contracts.md) |
17
+ | 0006 | TypeScript-First Source Policy | 2026-05-31 | [0006-typescript-first-source-policy.md](./0006-typescript-first-source-policy.md) |
18
+ | 0007 | Flow / Skill / Kit / Tool Boundary | 2026-06-15 | [0007-flow-skill-kit-tool-boundary.md](./0007-flow-skill-kit-tool-boundary.md) |
19
+ | 0007 | Skill Audit: Flow / Skill / Kit / Tool Boundary | 2026-06-15 | [0007-skill-audit.md](./0007-skill-audit.md) |
20
+ | 0008 | Kit Operation Boundary | 2026-06-15 | [0008-kit-operation-boundary.md](./0008-kit-operation-boundary.md) |
21
+ | 0009 | Canonical Hook Core/Kit Boundary | 2026-06-23 | [0009-canonical-hook-core-kit-boundary.md](./0009-canonical-hook-core-kit-boundary.md) |
22
+ | 0010 | Workflow Trust State as a Hachure Trust Bundle | 2026-06-23 | [0010-workflow-trust-state-as-hachure-bundle.md](./0010-workflow-trust-state-as-hachure-bundle.md) |
23
+ | 0011 | MCP Posture | 2026-06-24 | [0011-mcp-posture.md](./0011-mcp-posture.md) |
24
+ | 0012 | Agent Coordination as Hachure Liveness Claims | 2026-06-24 | [0012-agent-coordination-as-liveness-claims.md](./0012-agent-coordination-as-liveness-claims.md) |
25
+ | 0013 | Context Lifecycle | 2026-06-25 | [0013-context-lifecycle.md](./0013-context-lifecycle.md) |
26
+ | 0014 | Flow Agents core vs domain kits | 2026-06-25 | [0014-core-vs-domain-kit-boundary.md](./0014-core-vs-domain-kit-boundary.md) |
27
+ | 0015 | Flow / Flow Agents Boundary Reconciliation | 2026-06-25 | [0015-flow-flow-agents-boundary-reconciliation.md](./0015-flow-flow-agents-boundary-reconciliation.md) |
28
+ | 0016 | The Three-Hard-Boundary Model — a FlowDefinition-Driven, Kit-Agnostic Core | 2026-06-26 | [0016-three-hard-boundary-model.md](./0016-three-hard-boundary-model.md) |
29
+ | 0017 | The Anti-Gaming Trust Security Model — Layered Defense + External CI Anchor | unknown | [0017-anti-gaming-trust-security-model.md](./0017-anti-gaming-trust-security-model.md) |
30
+ | 0018 | Freeze the Local Shell-Parsing Heuristics; Route New Enforcement to the CI Anchor | unknown | [0018-freeze-local-shell-heuristics.md](./0018-freeze-local-shell-heuristics.md) |
31
+ | 0019 | Kit Dependency Ownership | 2026-07-01 | [0019-kit-dependency-ownership.md](./0019-kit-dependency-ownership.md) |
32
+ | 0020 | Trust-Reconcile Manifest, Claim Classification, and Waivers | unknown | [0020-trust-reconcile-manifest-and-claim-classification.md](./0020-trust-reconcile-manifest-and-claim-classification.md) |
33
+ | 0021 | Assignment Leases and Stale-Claim Takeover | 2026-07-02 | [0021-assignment-leases-and-stale-claim-takeover.md](./0021-assignment-leases-and-stale-claim-takeover.md) |
34
+ | 0022 | Fail-Closed Delivery Reconciliation with Governed Exemptions | 2026-07-02 | [0022-fail-closed-delivery-reconciliation-with-governed-exemptions.md](./0022-fail-closed-delivery-reconciliation-with-governed-exemptions.md) |
@@ -0,0 +1,20 @@
1
+ ---
2
+ status: needs-decision
3
+ subject: Agent coordination
4
+ decided: 2026-07-03
5
+ evidence:
6
+ - kind: adr
7
+ ref: docs/adr/0012-agent-coordination-as-liveness-claims.md
8
+ - kind: adr
9
+ ref: docs/adr/0021-assignment-leases-and-stale-claim-takeover.md
10
+ ---
11
+ # Agent coordination
12
+
13
+ This subject has provenance in frozen ADR history ([0012-agent-coordination-as-liveness-claims.md](../adr/0012-agent-coordination-as-liveness-claims.md), [0021-assignment-leases-and-stale-claim-takeover.md](../adr/0021-assignment-leases-and-stale-claim-takeover.md)) but no living
14
+ decision has been ratified yet under the topic-keyed decision registry
15
+ (`context/contracts/decision-registry-contract.md`). This stub records that the
16
+ subject is open and links the frozen ADR(s) as provenance; it is not a decision.
17
+
18
+ When a living decision is ratified for agent coordination, update this
19
+ file's `status` to `current`, add rationale, and keep the `adr` evidence
20
+ links as provenance for the history that led here.
@@ -0,0 +1,20 @@
1
+ ---
2
+ status: needs-decision
3
+ subject: Anti-gaming trust security
4
+ decided: 2026-07-03
5
+ evidence:
6
+ - kind: adr
7
+ ref: docs/adr/0017-anti-gaming-trust-security-model.md
8
+ - kind: adr
9
+ ref: docs/adr/0018-freeze-local-shell-heuristics.md
10
+ ---
11
+ # Anti-gaming trust security
12
+
13
+ This subject has provenance in frozen ADR history ([0017-anti-gaming-trust-security-model.md](../adr/0017-anti-gaming-trust-security-model.md), [0018-freeze-local-shell-heuristics.md](../adr/0018-freeze-local-shell-heuristics.md)) but no living
14
+ decision has been ratified yet under the topic-keyed decision registry
15
+ (`context/contracts/decision-registry-contract.md`). This stub records that the
16
+ subject is open and links the frozen ADR(s) as provenance; it is not a decision.
17
+
18
+ When a living decision is ratified for Anti-gaming trust security, update this
19
+ file's `status` to `current`, add rationale, and keep the `adr` evidence
20
+ links as provenance for the history that led here.
@@ -0,0 +1,18 @@
1
+ ---
2
+ status: needs-decision
3
+ subject: Context lifecycle
4
+ decided: 2026-07-03
5
+ evidence:
6
+ - kind: adr
7
+ ref: docs/adr/0013-context-lifecycle.md
8
+ ---
9
+ # Context lifecycle
10
+
11
+ This subject has provenance in frozen ADR history ([0013-context-lifecycle.md](../adr/0013-context-lifecycle.md)) but no living
12
+ decision has been ratified yet under the topic-keyed decision registry
13
+ (`context/contracts/decision-registry-contract.md`). This stub records that the
14
+ subject is open and links the frozen ADR(s) as provenance; it is not a decision.
15
+
16
+ When a living decision is ratified for context lifecycle, update this
17
+ file's `status` to `current`, add rationale, and keep the `adr` evidence
18
+ links as provenance for the history that led here.
@@ -0,0 +1,18 @@
1
+ ---
2
+ status: needs-decision
3
+ subject: Core vs domain kit boundary
4
+ decided: 2026-07-03
5
+ evidence:
6
+ - kind: adr
7
+ ref: docs/adr/0014-core-vs-domain-kit-boundary.md
8
+ ---
9
+ # Core vs domain kit boundary
10
+
11
+ This subject has provenance in frozen ADR history ([0014-core-vs-domain-kit-boundary.md](../adr/0014-core-vs-domain-kit-boundary.md)) but no living
12
+ decision has been ratified yet under the topic-keyed decision registry
13
+ (`context/contracts/decision-registry-contract.md`). This stub records that the
14
+ subject is open and links the frozen ADR(s) as provenance; it is not a decision.
15
+
16
+ When a living decision is ratified for core vs domain kit boundary, update this
17
+ file's `status` to `current`, add rationale, and keep the `adr` evidence
18
+ links as provenance for the history that led here.
@@ -0,0 +1,18 @@
1
+ ---
2
+ status: needs-decision
3
+ subject: Flow / Flow Agents boundary
4
+ decided: 2026-07-03
5
+ evidence:
6
+ - kind: adr
7
+ ref: docs/adr/0015-flow-flow-agents-boundary-reconciliation.md
8
+ ---
9
+ # Flow / Flow Agents boundary
10
+
11
+ This subject has provenance in frozen ADR history ([0015-flow-flow-agents-boundary-reconciliation.md](../adr/0015-flow-flow-agents-boundary-reconciliation.md)) but no living
12
+ decision has been ratified yet under the topic-keyed decision registry
13
+ (`context/contracts/decision-registry-contract.md`). This stub records that the
14
+ subject is open and links the frozen ADR(s) as provenance; it is not a decision.
15
+
16
+ When a living decision is ratified for flow / flow agents boundary, update this
17
+ file's `status` to `current`, add rationale, and keep the `adr` evidence
18
+ links as provenance for the history that led here.
@@ -0,0 +1,20 @@
1
+ ---
2
+ status: needs-decision
3
+ subject: Flow Kit
4
+ decided: 2026-07-03
5
+ evidence:
6
+ - kind: adr
7
+ ref: docs/adr/0002-flow-kits-as-extension-unit.md
8
+ - kind: adr
9
+ ref: docs/adr/0003-flow-agents-coordinates-kits-and-adapters.md
10
+ ---
11
+ # Flow Kit
12
+
13
+ This subject has provenance in frozen ADR history ([0002-flow-kits-as-extension-unit.md](../adr/0002-flow-kits-as-extension-unit.md), [0003-flow-agents-coordinates-kits-and-adapters.md](../adr/0003-flow-agents-coordinates-kits-and-adapters.md)) but no living
14
+ decision has been ratified yet under the topic-keyed decision registry
15
+ (`context/contracts/decision-registry-contract.md`). This stub records that the
16
+ subject is open and links the frozen ADR(s) as provenance; it is not a decision.
17
+
18
+ When a living decision is ratified for flow kit, update this
19
+ file's `status` to `current`, add rationale, and keep the `adr` evidence
20
+ links as provenance for the history that led here.
@@ -0,0 +1,20 @@
1
+ ---
2
+ status: needs-decision
3
+ subject: Flow / Skill / Kit / Tool boundary
4
+ decided: 2026-07-03
5
+ evidence:
6
+ - kind: adr
7
+ ref: docs/adr/0007-flow-skill-kit-tool-boundary.md
8
+ - kind: adr
9
+ ref: docs/adr/0007-skill-audit.md
10
+ ---
11
+ # Flow / Skill / Kit / Tool boundary
12
+
13
+ This subject has provenance in frozen ADR history ([0007-flow-skill-kit-tool-boundary.md](../adr/0007-flow-skill-kit-tool-boundary.md), [0007-skill-audit.md](../adr/0007-skill-audit.md)) but no living
14
+ decision has been ratified yet under the topic-keyed decision registry
15
+ (`context/contracts/decision-registry-contract.md`). This stub records that the
16
+ subject is open and links the frozen ADR(s) as provenance; it is not a decision.
17
+
18
+ When a living decision is ratified for flow / skill / kit / tool boundary, update this
19
+ file's `status` to `current`, add rationale, and keep the `adr` evidence
20
+ links as provenance for the history that led here.
@@ -0,0 +1,63 @@
1
+ ---
2
+ status: current
3
+ subject: Graph knowledge provider
4
+ decided: 2026-07-03
5
+ evidence:
6
+ - kind: issue
7
+ ref: https://github.com/kontourai/flow-agents/issues/327
8
+ - kind: doc
9
+ ref: docs/spikes/graph-provider-2026-07.md
10
+ - kind: doc
11
+ ref: context/contracts/knowledge-store-contract.md
12
+ - kind: adr
13
+ ref: docs/decisions/knowledge-store-provider.md
14
+ ---
15
+
16
+ # Graph knowledge provider
17
+
18
+ The Knowledge Kit ships a `neo4j` knowledge-store provider: a real, queryable
19
+ graph implementation of the #317 read interface, synced from the file/work-item
20
+ providers. It is the OWNER'S OPT-IN personal default — the file providers remain
21
+ the portfolio default. This decision explicitly overrides the #318 spike's
22
+ defer-as-default verdict at the owner's request ("I still want the graph
23
+ implementation even if it's not the default — it can be my default").
24
+
25
+ ## Decision
26
+
27
+ - **Engine: Neo4j Community 5 over Docker.** The #318 spike compared Neo4j and
28
+ Kuzu; Kuzu was abandoned upstream (Oct 2025, repo archived), so Neo4j — actively
29
+ maintained, with the Browser for human exploration and the portable Cypher
30
+ baseline — is the engine when a graph is used. Kuzu, Aura/hosted, and
31
+ graph-as-primary-storage are non-goals.
32
+ - **The graph is a materialized VIEW, never an authority.** File stores stay the
33
+ source of truth. A `sync` command reuses the #317 providers as READERS (no
34
+ forked extractors) and MERGEs their combined graph into Neo4j idempotently
35
+ (content-keyed hash guard: a re-sync of unchanged stores reports zero writes),
36
+ recording a snapshot digest + timestamp. The write side is proposals-only, like
37
+ every other provider — the graph never bypasses the human-curated stores.
38
+ - **Connection by reference, never hardcoded.** Credentials resolve from
39
+ `NEO4J_URI` / `NEO4J_USER` / `NEO4J_PASSWORD` (this repo does not consume
40
+ `@kontourai/datum` yet, so we follow the existing env-reference precedent; a
41
+ future datum adoption resolves the same three names without touching call
42
+ sites).
43
+ - **Cypher-backed query/health verbs when selected.** The five canonical spike
44
+ queries (transitive blocker closure, contradiction candidates, node-type-aware
45
+ orphans, duplicate candidates WITH 5-char stemming, shortest path) run as live
46
+ Cypher when a Neo4j is reachable and fall back to a portable JS spelling
47
+ (same answers) otherwise. The stemming lesson is preserved: exact title tokens
48
+ missed the traverse#14~#8 duplicate; stemming catches it.
49
+ - **Never a hard dependency.** `neo4j-driver` is an optionalDependency, lazily
50
+ imported. A missing driver OR an unreachable server degrades to the file
51
+ providers with a single clear message. CI has no Neo4j: unit tests + the
52
+ conformance suite run against an injected fake driver; the live integration
53
+ test is gated on `NEO4J_URI` (or a detected Docker Neo4j) and skips loudly.
54
+ - **Selection is config-driven, default file.** `KNOWLEDGE_PROVIDER=neo4j`
55
+ (repo/user-level) opts in; anything else stays on the file providers. See the
56
+ README "Graph provider (opt-in)" section for the owner path.
57
+
58
+ ## Consequences
59
+
60
+ The one-off spike wins (a missing blocker edge, ADR-0007 contradiction, the
61
+ near-duplicate canary trio) become a standing capability without forcing graph
62
+ ops on any repo or workflow that does not opt in. The provider passes the same
63
+ #317 conformance suite as the file providers on its read side.
@@ -0,0 +1,18 @@
1
+ ---
2
+ status: needs-decision
3
+ subject: Hook core/kit boundary
4
+ decided: 2026-07-03
5
+ evidence:
6
+ - kind: adr
7
+ ref: docs/adr/0009-canonical-hook-core-kit-boundary.md
8
+ ---
9
+ # Hook core/kit boundary
10
+
11
+ This subject has provenance in frozen ADR history ([0009-canonical-hook-core-kit-boundary.md](../adr/0009-canonical-hook-core-kit-boundary.md)) but no living
12
+ decision has been ratified yet under the topic-keyed decision registry
13
+ (`context/contracts/decision-registry-contract.md`). This stub records that the
14
+ subject is open and links the frozen ADR(s) as provenance; it is not a decision.
15
+
16
+ When a living decision is ratified for hook core/kit boundary, update this
17
+ file's `status` to `current`, add rationale, and keep the `adr` evidence
18
+ links as provenance for the history that led here.
@@ -10,8 +10,27 @@ Numbered ADRs under `docs/adr/` are frozen history and are not listed here.
10
10
 
11
11
  | Topic | Status | Decision |
12
12
  | --- | --- | --- |
13
+ | [agent-coordination](./agent-coordination.md) | needs-decision | Agent coordination |
14
+ | [anti-gaming-trust-security](./anti-gaming-trust-security.md) | needs-decision | Anti-gaming trust security |
15
+ | [context-lifecycle](./context-lifecycle.md) | needs-decision | Context lifecycle |
16
+ | [core-domain-kit-boundary](./core-domain-kit-boundary.md) | needs-decision | Core vs domain kit boundary |
13
17
  | [decision-records](./decision-records.md) | current | Decision records |
18
+ | [flow-flow-agents-boundary](./flow-flow-agents-boundary.md) | needs-decision | Flow / Flow Agents boundary |
19
+ | [flow-kit](./flow-kit.md) | needs-decision | Flow Kit |
20
+ | [flow-skill-kit-tool-boundary](./flow-skill-kit-tool-boundary.md) | needs-decision | Flow / Skill / Kit / Tool boundary |
21
+ | [graph-knowledge-provider](./graph-knowledge-provider.md) | current | Graph knowledge provider |
22
+ | [hook-core-kit-boundary](./hook-core-kit-boundary.md) | needs-decision | Hook core/kit boundary |
23
+ | [kit-dependency-ownership](./kit-dependency-ownership.md) | needs-decision | Kit dependency ownership |
24
+ | [kit-operation-boundary](./kit-operation-boundary.md) | needs-decision | Kit operation boundary |
25
+ | [knowledge-promote-sub-flow](./knowledge-promote-sub-flow.md) | current | Knowledge promote sub-flow |
14
26
  | [knowledge-store-provider](./knowledge-store-provider.md) | current | Knowledge store provider |
27
+ | [kontour-resource-contract](./kontour-resource-contract.md) | needs-decision | Kontour Resource Contract |
28
+ | [mcp-posture](./mcp-posture.md) | needs-decision | MCP posture |
15
29
  | [model-routing](./model-routing.md) | current | Model routing |
16
30
  | [promotion-gate](./promotion-gate.md) | current | Promotion gate |
17
31
  | [standing-directives](./standing-directives.md) | current | Standing directives |
32
+ | [three-hard-boundary-model](./three-hard-boundary-model.md) | needs-decision | Three-hard-boundary model |
33
+ | [trust-reconcile](./trust-reconcile.md) | needs-decision | Trust-reconcile and delivery reconciliation |
34
+ | [typescript-source-policy](./typescript-source-policy.md) | current | TypeScript-first source policy |
35
+ | [workflow-enforcement](./workflow-enforcement.md) | needs-decision | Workflow Enforcement |
36
+ | [workflow-trust-state](./workflow-trust-state.md) | needs-decision | Workflow trust state |
@@ -0,0 +1,18 @@
1
+ ---
2
+ status: needs-decision
3
+ subject: Kit dependency ownership
4
+ decided: 2026-07-03
5
+ evidence:
6
+ - kind: adr
7
+ ref: docs/adr/0019-kit-dependency-ownership.md
8
+ ---
9
+ # Kit dependency ownership
10
+
11
+ This subject has provenance in frozen ADR history ([0019-kit-dependency-ownership.md](../adr/0019-kit-dependency-ownership.md)) but no living
12
+ decision has been ratified yet under the topic-keyed decision registry
13
+ (`context/contracts/decision-registry-contract.md`). This stub records that the
14
+ subject is open and links the frozen ADR(s) as provenance; it is not a decision.
15
+
16
+ When a living decision is ratified for kit dependency ownership, update this
17
+ file's `status` to `current`, add rationale, and keep the `adr` evidence
18
+ links as provenance for the history that led here.
@@ -0,0 +1,18 @@
1
+ ---
2
+ status: needs-decision
3
+ subject: Kit operation boundary
4
+ decided: 2026-07-03
5
+ evidence:
6
+ - kind: adr
7
+ ref: docs/adr/0008-kit-operation-boundary.md
8
+ ---
9
+ # Kit operation boundary
10
+
11
+ This subject has provenance in frozen ADR history ([0008-kit-operation-boundary.md](../adr/0008-kit-operation-boundary.md)) but no living
12
+ decision has been ratified yet under the topic-keyed decision registry
13
+ (`context/contracts/decision-registry-contract.md`). This stub records that the
14
+ subject is open and links the frozen ADR(s) as provenance; it is not a decision.
15
+
16
+ When a living decision is ratified for kit operation boundary, update this
17
+ file's `status` to `current`, add rationale, and keep the `adr` evidence
18
+ links as provenance for the history that led here.
@@ -0,0 +1,59 @@
1
+ ---
2
+ status: current
3
+ subject: Knowledge promote sub-flow
4
+ decided: 2026-07-03
5
+ evidence:
6
+ - kind: issue
7
+ ref: https://github.com/kontourai/flow-agents/issues/313
8
+ - kind: doc
9
+ ref: context/contracts/knowledge-store-contract.md
10
+ - kind: doc
11
+ ref: context/contracts/decision-registry-contract.md
12
+ - kind: session-archive
13
+ ref: .kontourai/flow-agents/decision-registry-shape/decision-registry-shape--idea-to-backlog.md
14
+ ---
15
+
16
+ # Knowledge promote sub-flow
17
+
18
+ Session promotion runs through a Knowledge Kit FlowDefinition
19
+ (`kits/knowledge/flows/promote.flow.json`, id `knowledge.promote`) with four
20
+ steps — **ingest → distill → link → health** — so promotion quality stops
21
+ depending on which agent did it. This is the first codebase-facing Knowledge Kit
22
+ flow and the first "flow within a flow".
23
+
24
+ ## Decision
25
+
26
+ - **Four steps.** *ingest* reads a completed session dir (read-only) for its
27
+ plan/evidence/critique/learnings/transcripts; *distill* produces DRAFT deltas —
28
+ decision-registry topic files (validated against
29
+ `schemas/decision-record.schema.json` before proposing), CONTEXT.md vocabulary
30
+ additions, and `docs/learnings` entries; *link* attaches provenance (PR, merge
31
+ SHA, session-archive path, touched topics) as `evidence[]` refs; *health* runs
32
+ contradiction detection over the topic files.
33
+ - **Built on the #317 provider interface, not a forked reader.** Health reads the
34
+ registry through the git-repo knowledge-store provider and reuses the
35
+ provider-agnostic `duplicate-detection` verb: two topics with overlapping
36
+ subject nouns and divergent content are a contradiction. The report names BOTH
37
+ topics; a **merge-repair PROPOSAL** (schema-valid, `status: "proposed"`) names a
38
+ merge target. Merge-repair is a proposal, never an auto-edit.
39
+ - **Proposals-only (R4).** The sub-flow NEVER writes docs directly. Every output
40
+ lands under `<session>/proposals/`; the promote step's human/agent applies the
41
+ drafts it accepts. A filesystem diff during a run shows zero writes outside the
42
+ session/proposal dir.
43
+ - **Composition.** `knowledge.promote` is a true composable FlowDefinition — a
44
+ parent step can `uses_flow: "knowledge.promote"` and the resolver resolves its
45
+ gates (it `exports` every gate claim). It is invoked standalone AND from the
46
+ Builder promote step. The builder edge is a **documented composition** (the
47
+ deliver skill's promote step names it as the assisted path) rather than a nested
48
+ builder gate, because #312's `promote` CLI — not a flow gate — is the recording
49
+ mechanism, and the sub-flow's outputs are proposals a human/agent applies.
50
+
51
+ ## Rationale
52
+
53
+ Knowledge Kit had the verbs (capture, compile, link, health) pointed at personal
54
+ knowledge; the codebase was the missing consumer. Promotion (once gated by #312)
55
+ still relied on ad-hoc judgement about WHAT to promote. Making the promote step
56
+ run a Knowledge Kit pipeline over the session artifacts gives the codebase its
57
+ knowledge use case as a composable sub-flow, while proposals-only discipline and
58
+ the shared #317 provider interface keep it from forking a second reader or writing
59
+ into a human-curated store.
@@ -0,0 +1,18 @@
1
+ ---
2
+ status: needs-decision
3
+ subject: Kontour Resource Contract
4
+ decided: 2026-07-03
5
+ evidence:
6
+ - kind: adr
7
+ ref: docs/adr/0005-kubernetes-inspired-resource-contracts.md
8
+ ---
9
+ # Kontour Resource Contract
10
+
11
+ This subject has provenance in frozen ADR history ([0005-kubernetes-inspired-resource-contracts.md](../adr/0005-kubernetes-inspired-resource-contracts.md)) but no living
12
+ decision has been ratified yet under the topic-keyed decision registry
13
+ (`context/contracts/decision-registry-contract.md`). This stub records that the
14
+ subject is open and links the frozen ADR(s) as provenance; it is not a decision.
15
+
16
+ When a living decision is ratified for kontour resource contract, update this
17
+ file's `status` to `current`, add rationale, and keep the `adr` evidence
18
+ links as provenance for the history that led here.
@@ -0,0 +1,18 @@
1
+ ---
2
+ status: needs-decision
3
+ subject: MCP posture
4
+ decided: 2026-07-03
5
+ evidence:
6
+ - kind: adr
7
+ ref: docs/adr/0011-mcp-posture.md
8
+ ---
9
+ # MCP posture
10
+
11
+ This subject has provenance in frozen ADR history ([0011-mcp-posture.md](../adr/0011-mcp-posture.md)) but no living
12
+ decision has been ratified yet under the topic-keyed decision registry
13
+ (`context/contracts/decision-registry-contract.md`). This stub records that the
14
+ subject is open and links the frozen ADR(s) as provenance; it is not a decision.
15
+
16
+ When a living decision is ratified for MCP posture, update this
17
+ file's `status` to `current`, add rationale, and keep the `adr` evidence
18
+ links as provenance for the history that led here.
@@ -0,0 +1,18 @@
1
+ ---
2
+ status: needs-decision
3
+ subject: Three-hard-boundary model
4
+ decided: 2026-07-03
5
+ evidence:
6
+ - kind: adr
7
+ ref: docs/adr/0016-three-hard-boundary-model.md
8
+ ---
9
+ # Three-hard-boundary model
10
+
11
+ This subject has provenance in frozen ADR history ([0016-three-hard-boundary-model.md](../adr/0016-three-hard-boundary-model.md)) but no living
12
+ decision has been ratified yet under the topic-keyed decision registry
13
+ (`context/contracts/decision-registry-contract.md`). This stub records that the
14
+ subject is open and links the frozen ADR(s) as provenance; it is not a decision.
15
+
16
+ When a living decision is ratified for Three-hard-boundary model, update this
17
+ file's `status` to `current`, add rationale, and keep the `adr` evidence
18
+ links as provenance for the history that led here.
@@ -0,0 +1,20 @@
1
+ ---
2
+ status: needs-decision
3
+ subject: Trust-reconcile and delivery reconciliation
4
+ decided: 2026-07-03
5
+ evidence:
6
+ - kind: adr
7
+ ref: docs/adr/0020-trust-reconcile-manifest-and-claim-classification.md
8
+ - kind: adr
9
+ ref: docs/adr/0022-fail-closed-delivery-reconciliation-with-governed-exemptions.md
10
+ ---
11
+ # Trust-reconcile and delivery reconciliation
12
+
13
+ This subject has provenance in frozen ADR history ([0020-trust-reconcile-manifest-and-claim-classification.md](../adr/0020-trust-reconcile-manifest-and-claim-classification.md), [0022-fail-closed-delivery-reconciliation-with-governed-exemptions.md](../adr/0022-fail-closed-delivery-reconciliation-with-governed-exemptions.md)) but no living
14
+ decision has been ratified yet under the topic-keyed decision registry
15
+ (`context/contracts/decision-registry-contract.md`). This stub records that the
16
+ subject is open and links the frozen ADR(s) as provenance; it is not a decision.
17
+
18
+ When a living decision is ratified for Trust-reconcile and delivery reconciliation, update this
19
+ file's `status` to `current`, add rationale, and keep the `adr` evidence
20
+ links as provenance for the history that led here.
@@ -0,0 +1,48 @@
1
+ ---
2
+ status: current
3
+ subject: TypeScript-first source policy
4
+ decided: 2026-07-04
5
+ evidence:
6
+ - kind: adr
7
+ ref: docs/adr/0006-typescript-first-source-policy.md
8
+ - kind: session-archive
9
+ ref: .kontourai/flow-agents/kontourai-flow-agents-311/kontourai-flow-agents-311--deliver.md
10
+ - kind: issue
11
+ ref: https://github.com/kontourai/flow-agents/issues/311
12
+ ---
13
+
14
+ # TypeScript-first source policy
15
+
16
+ Kontour product and runtime source defaults to TypeScript across Flow, Flow
17
+ Agents, Surface, Veritas, and `kontourai.io`. New durable product code, runtime
18
+ adapters, package APIs, CLI behavior, workflow orchestration, hooks, provider
19
+ bridges, and shared contracts are authored in TypeScript by default in
20
+ repositories that are TypeScript-enabled or migrating toward TypeScript.
21
+
22
+ ## Decision
23
+
24
+ - TypeScript-enabled repositories expose a typecheck or build validation that
25
+ proves the authored TypeScript surface compiles, and CI runs that validation
26
+ before code is treated as releasable.
27
+ - Narrow JavaScript/MJS/CJS exceptions remain acceptable: package/tool
28
+ configuration that expects JS/MJS, generated docs/site assets, thin
29
+ shell-adjacent launchers, fixtures/examples/tests following existing local
30
+ convention, and historical archived/vendored/generated artifacts that are not
31
+ edited as active source. Exceptions stay narrow — expanding product/runtime
32
+ behavior in JS/MJS is a deliberate exception or routed into a migration plan.
33
+ - Repositories with nontrivial non-TypeScript runtime source track staged
34
+ migration through repo-specific issues rather than being grandfathered as
35
+ permanent direction (see the original inventory and linked migration issues
36
+ in the frozen ADR below).
37
+
38
+ ## Rationale
39
+
40
+ Cross-repo shared source, contracts, adapters, and workflow tooling need a
41
+ consistent default language, or new work deepens fragmentation and turns every
42
+ existing non-TypeScript file into an implicit permanent exception. This is a
43
+ purely technical, already-settled call: the frozen ADR below made the decision
44
+ on 2026-05-31 and it has not changed. This entry upgrades the ADR-freeze
45
+ cutover's `needs-decision` stub for this subject (issue #314) to a living
46
+ decision — nothing new is decided here beyond recording that the frozen ADR's
47
+ call still stands, per the Probe docs-write contract's worked example
48
+ (`context/contracts/probe-docs-write-contract.md`).