@kontourai/flow-agents 1.1.0 → 1.3.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 (119) hide show
  1. package/.github/workflows/ci.yml +6 -1
  2. package/.github/workflows/kit-gates-demo.yml +6 -2
  3. package/.github/workflows/runtime-compat.yml +5 -2
  4. package/CHANGELOG.md +51 -0
  5. package/CONTRIBUTING.md +30 -0
  6. package/README.md +26 -5
  7. package/agents/dev.json +1 -1
  8. package/agents/tool-planner.json +1 -1
  9. package/build/src/cli/{flow-kit.js → kit.js} +122 -108
  10. package/build/src/cli/validate-source-tree.js +4 -4
  11. package/build/src/cli/workflow-sidecar.js +70 -5
  12. package/build/src/cli.js +3 -3
  13. package/build/src/flow-kit/validate.js +89 -62
  14. package/build/src/tools/build-universal-bundles.js +78 -17
  15. package/build/src/tools/generate-context-map.js +49 -7
  16. package/build/src/tools/validate-source-tree.js +32 -1
  17. package/console.telemetry.json +1 -1
  18. package/docs/adr/0004-gates-expect-surface-claims.md +7 -7
  19. package/docs/adr/0007-flow-skill-kit-tool-boundary.md +169 -0
  20. package/docs/adr/0007-skill-audit.md +112 -0
  21. package/docs/adr/0008-kit-operation-boundary.md +88 -0
  22. package/docs/context-map.md +18 -22
  23. package/docs/flow-kit-repository-contract.md +5 -5
  24. package/docs/getting-started.md +177 -0
  25. package/docs/index.md +19 -8
  26. package/docs/kit-authoring-guide.md +125 -13
  27. package/docs/knowledge-kit.md +2 -2
  28. package/docs/operating-layers.md +2 -2
  29. package/docs/spec/runtime-hook-surface.md +1 -1
  30. package/docs/veritas-integration.md +4 -4
  31. package/docs/vision.md +1 -1
  32. package/docs/workflow-eval-strategy.md +2 -2
  33. package/docs/workflow-usage-guide.md +2 -2
  34. package/evals/acceptance/test_opencode_harness.sh +18 -10
  35. package/evals/acceptance/test_pi_harness.sh +10 -6
  36. package/evals/ci/run-baseline.sh +1 -1
  37. package/evals/fixtures/builder-kit-workflow-state/happy-path.json +2 -2
  38. package/evals/fixtures/builder-kit-workflow-state/mid-work-resume.json +2 -2
  39. package/evals/fixtures/console-learning-projection/artifacts/console-learning-correction/learning.json +1 -1
  40. package/evals/fixtures/flow-kit-repository/mixed-runtime-kit/flows/runtime.flow.json +4 -4
  41. package/evals/fixtures/flow-kit-repository/valid-local-kit/flows/review.flow.json +4 -4
  42. package/evals/fixtures/kit-conformance-levels/k0-flows-only/flows/review.flow.json +4 -4
  43. package/evals/fixtures/kit-conformance-levels/k1-agent-extension/flows/build.flow.json +4 -4
  44. package/evals/fixtures/kit-conformance-levels/k2-with-evals/flows/synthesize.flow.json +4 -4
  45. package/evals/fixtures/kit-conformance-levels/third-party-extension/flows/review.flow.json +4 -4
  46. package/evals/fixtures/pull-work-provider/github-issues.json +5 -5
  47. package/evals/fixtures/surface-trust/accepted-claim-trust-report.json +2 -2
  48. package/evals/fixtures/surface-trust/artifact-absent.json +2 -2
  49. package/evals/fixtures/surface-trust/integrity-mismatch-trust-report.json +2 -2
  50. package/evals/fixtures/surface-trust/missing-authority-trust-report.json +2 -2
  51. package/evals/fixtures/surface-trust/provider-absent.json +2 -2
  52. package/evals/fixtures/surface-trust/rejected-claim-trust-report.json +2 -2
  53. package/evals/fixtures/surface-trust/stale-claim-trust-snapshot.json +2 -2
  54. package/evals/integration/test_activate_npx_context.sh +2 -2
  55. package/evals/integration/test_bundle_install.sh +17 -12
  56. package/evals/integration/test_console_learning_projection.sh +2 -2
  57. package/evals/integration/test_flow_kit_install_git.sh +7 -7
  58. package/evals/integration/test_flow_kit_repository.sh +4 -4
  59. package/evals/integration/test_goal_fit_hook.sh +144 -0
  60. package/evals/integration/test_kit_conformance_levels.sh +56 -2
  61. package/evals/integration/test_local_flow_kit_install.sh +7 -7
  62. package/evals/integration/test_publish_change_helper.sh +1 -1
  63. package/evals/integration/test_pull_work_provider.sh +1 -1
  64. package/evals/integration/test_runtime_adapter_activation.sh +3 -3
  65. package/evals/integration/test_workflow_sidecar_writer.sh +9 -9
  66. package/evals/lib/node.sh +2 -2
  67. package/evals/static/test_package.sh +3 -3
  68. package/evals/static/test_workflow_skills.sh +19 -19
  69. package/integrations/strands/flow_agents_strands/steering.py +1 -1
  70. package/integrations/strands-ts/src/hooks.ts +1 -1
  71. package/kits/builder/flows/build.flow.json +48 -48
  72. package/kits/builder/flows/shape.flow.json +36 -36
  73. package/kits/builder/kit.json +17 -0
  74. package/{skills → kits/builder/skills}/builder-shape/SKILL.md +4 -4
  75. package/{skills → kits/builder/skills}/idea-to-backlog/SKILL.md +1 -1
  76. package/kits/knowledge/adapters/obsidian-store/index.js +137 -26
  77. package/kits/knowledge/evals/contract-suite/suite.test.js +90 -0
  78. package/kits/knowledge/flows/compile.flow.json +12 -12
  79. package/kits/knowledge/flows/consolidate.flow.json +16 -16
  80. package/kits/knowledge/flows/ingest.flow.json +12 -12
  81. package/kits/knowledge/flows/retire.flow.json +16 -16
  82. package/kits/knowledge/flows/store-contract.flow.json +12 -12
  83. package/kits/knowledge/flows/synthesize.flow.json +16 -16
  84. package/kits/knowledge/kit.json +16 -9
  85. package/kits/release-evidence/flows/release-evidence.flow.json +3 -3
  86. package/package.json +11 -5
  87. package/packaging/packs.json +1 -21
  88. package/schemas/workflow-evidence.schema.json +2 -1
  89. package/scripts/README.md +1 -1
  90. package/scripts/hooks/stop-goal-fit.js +66 -18
  91. package/scripts/kit.js +2 -0
  92. package/skills/README.md +23 -0
  93. package/src/cli/{flow-kit.ts → kit.ts} +124 -109
  94. package/src/cli/validate-source-tree.ts +4 -4
  95. package/src/cli/workflow-sidecar.ts +62 -4
  96. package/src/cli.ts +3 -3
  97. package/src/flow-kit/validate.ts +118 -58
  98. package/src/tools/build-universal-bundles.ts +74 -13
  99. package/src/tools/generate-context-map.ts +36 -6
  100. package/src/tools/validate-source-tree.ts +27 -1
  101. package/scripts/flow-kit.js +0 -2
  102. package/skills/context-budget/SKILL.md +0 -40
  103. package/skills/explore/SKILL.md +0 -137
  104. package/skills/feedback-loop/SKILL.md +0 -87
  105. package/skills/frontend-design/SKILL.md +0 -80
  106. /package/{skills → kits/builder/skills}/deliver/SKILL.md +0 -0
  107. /package/{skills → kits/builder/skills}/design-probe/SKILL.md +0 -0
  108. /package/{skills → kits/builder/skills}/evidence-gate/SKILL.md +0 -0
  109. /package/{skills → kits/builder/skills}/execute-plan/SKILL.md +0 -0
  110. /package/{skills → kits/builder/skills}/fix-bug/SKILL.md +0 -0
  111. /package/{skills → kits/builder/skills}/learning-review/SKILL.md +0 -0
  112. /package/{skills → kits/builder/skills}/pickup-probe/SKILL.md +0 -0
  113. /package/{skills → kits/builder/skills}/plan-work/SKILL.md +0 -0
  114. /package/{skills → kits/builder/skills}/pull-work/SKILL.md +0 -0
  115. /package/{skills → kits/builder/skills}/release-readiness/SKILL.md +0 -0
  116. /package/{skills → kits/builder/skills}/review-work/SKILL.md +0 -0
  117. /package/{skills → kits/builder/skills}/tdd-workflow/SKILL.md +0 -0
  118. /package/{skills → kits/builder/skills}/verify-work/SKILL.md +0 -0
  119. /package/{skills → kits/knowledge/skills}/knowledge-capture/SKILL.md +0 -0
@@ -0,0 +1,177 @@
1
+ ---
2
+ title: Builder Kit Quick Start
3
+ ---
4
+
5
+ # Builder Kit Quick Start
6
+
7
+ This guide takes you from nothing to a running, gated build flow in about two minutes. By the end you will have Flow Agents installed in your coding agent's workspace and understand how the Builder Kit's two flows — `builder.shape` and `builder.build` — turn a raw idea into a merged change with evidence.
8
+
9
+ ## 1. Install
10
+
11
+ Run this from any workspace you want to add discipline to:
12
+
13
+ ```bash
14
+ npx @kontourai/flow-agents init --runtime <your-agent> --dest .
15
+ ```
16
+
17
+ Where `--runtime` is one of `claude-code`, `codex`, `kiro`, `opencode`, or `pi`. For a fully unattended install:
18
+
19
+ ```bash
20
+ npx @kontourai/flow-agents init --runtime claude-code --dest . --yes
21
+ npx @kontourai/flow-agents init --runtime codex --dest . --yes
22
+ npx @kontourai/flow-agents init --runtime opencode --dest . --yes
23
+ ```
24
+
25
+ The installer copies agents, skills, context contracts, hook scripts, Kit assets, and the Flow Agents telemetry descriptor into the workspace. The Builder Kit installs automatically. Your agent reads those files at startup; no plugin registry required.
26
+
27
+ **What lands in the workspace:**
28
+
29
+ - `agents/`, `skills/`, `context/` — skill definitions and shared contracts the agent follows
30
+ - `scripts/hooks/` — four canonical policy scripts (steering, quality gate, stop-goal-fit, config protection) wired to the host's native hook surface
31
+ - `kits/builder/` — Builder Kit flows and skills
32
+ - `console.telemetry.json` — telemetry descriptor (writes locally by default)
33
+
34
+ At L2 conformance (Claude Code, Codex, Kiro) all four hooks are active and the stop hook blocks early exits that lack evidence. At L1 (opencode, pi) steering and stop-goal-fit run but without blocking capability; see the [Runtime Hook Surface spec](spec/runtime-hook-surface.html) for the gaps.
35
+
36
+ ## 2. What the Builder Kit gives you
37
+
38
+ The Builder Kit installs two flows:
39
+
40
+ | Flow | ID | What it does |
41
+ |---|---|---|
42
+ | Shape | `builder.shape` | Turns a raw idea into slices and executable work items |
43
+ | Build | `builder.build` | Takes a ready work item through design probe → plan → execute → verify → PR → merge readiness → learn |
44
+
45
+ These are not freeform chat sessions. Each flow has **evidence gates** — named checkpoints that expect specific claims before the next step starts. The agent cannot silently skip a gate; it either satisfies the expectation or the transition is blocked (at L2) or flagged (at L1).
46
+
47
+ **Shape flow gates** (`builder.shape`):
48
+
49
+ - `shape-gate` — problem, outcome, constraints, non-goals, success criteria, and risk are stated
50
+ - `breakdown-gate` — work is split into independently useful slices
51
+ - `file-issues-gate` — each slice becomes a filed work item with enough context to pull later
52
+
53
+ **Build flow gates** (`builder.build`):
54
+
55
+ - `pull-work-gate` — a ready work item is selected with scope and acceptance context
56
+ - `design-probe-gate` — goal fit, blockers, dependencies, and planning readiness are recorded before a plan is written
57
+ - `plan-gate` — the plan names files, changes, acceptance evidence, and sequencing
58
+ - `execute-gate` — changed files are recorded and unrelated work is excluded
59
+ - `verify-gate` — tests or checks have evidence tied to the implementation (up to 3 route-back attempts before blocking)
60
+ - `merge-ready-gate` — scope, evidence, and residual risks support a merge-ready decision
61
+ - `pr-open-gate` — a pull request exists with linked work and verification evidence
62
+ - `merge-ready-ci-gate` — CI and review status support merge
63
+ - `learn-gate` — decisions and delivery learnings are recorded for future work
64
+
65
+ The gate semantics live in [Kontour Flow](https://kontourai.github.io/flow/); Flow Agents compiles them to whatever hook surface your agent exposes.
66
+
67
+ ## 3. A two-minute first run
68
+
69
+ ### Step 1 — Shape an idea
70
+
71
+ In your coding agent, paste this:
72
+
73
+ ```text
74
+ Use Builder Kit shape. I want to add a progress indicator to the CLI output so
75
+ users can see what step the installer is on. Keep it simple — just a step count
76
+ like "[2/5] Copying agents". Shape this into an executable work item and stop
77
+ at the backlog gate.
78
+ ```
79
+
80
+ The agent will run the `builder-shape` / `idea-to-backlog` skill, which:
81
+
82
+ 1. inventories the idea and classifies it
83
+ 2. proposes the thinnest meaningful slice (the step counter) and names what is out of scope
84
+ 3. drafts a shaped work item with a stated outcome, non-goals, acceptance criteria, and a verification expectation
85
+ 4. stops at the `breakdown-gate` and waits for you to confirm before creating GitHub issues
86
+
87
+ You will see the agent write a local artifact at `.flow-agents/<slug>/<slug>--idea-to-backlog.md`. That artifact is the machine-readable input to the next stage — not a summary in the chat window.
88
+
89
+ To continue and file the GitHub issue:
90
+
91
+ ```text
92
+ That looks right. File the GitHub issue and stop.
93
+ ```
94
+
95
+ The agent runs the `file-issues` step, checks the `file-issues-gate`, and stops. You now have a shaped, filed work item that the build flow can pull.
96
+
97
+ ### Step 2 — Build that work item
98
+
99
+ ```text
100
+ Use deliver for the issue you just filed. Pull it, probe the design, plan it,
101
+ implement it, review it, verify it, and stop if any evidence is missing.
102
+ ```
103
+
104
+ The `deliver` skill orchestrates the full `builder.build` flow:
105
+
106
+ 1. **pull-work** — selects the issue, confirms scope and acceptance criteria (`pull-work-gate`)
107
+ 2. **design-probe** — checks goal fit, identifies blockers and dependencies, and records planning readiness before touching a file (`design-probe-gate`)
108
+ 3. **plan-work** — delegates to `tool-planner`, which writes a structured plan artifact naming files, changes, sequencing, and acceptance evidence (`plan-gate`)
109
+ 4. **execute-plan** — fans out to up to four `tool-worker` subagents in parallel waves (`execute-gate`)
110
+ 5. **review-work** — code and optional security review (`critique.json` sidecar)
111
+ 6. **verify-work** — tests and checks with evidence tied to the change; if evidence is missing the verify-gate triggers a route-back (`verify-gate`)
112
+ 7. **release-readiness** — scope, evidence, and risk assessment (`merge-ready-gate`)
113
+ 8. **pull-request** — PR with linked work item and verification evidence (`pr-open-gate`)
114
+
115
+ You can also invoke each skill individually if you want explicit control:
116
+
117
+ ```text
118
+ Use pull-work to select issue #42.
119
+ ```
120
+
121
+ ```text
122
+ Use plan-work on the session artifact from the pull-work step.
123
+ ```
124
+
125
+ ```text
126
+ Use verify-work on the current branch and report what evidence is present.
127
+ ```
128
+
129
+ ### What you observe
130
+
131
+ - **Between each step**, the agent writes a local session sidecar under `.flow-agents/<slug>/` — `state.json`, `acceptance.json`, `evidence.json`, and `handoff.json`. These survive compaction, tab close, or a new session. A future session resumes from recorded state.
132
+ - **At each gate**, the agent either presents the evidence and moves forward, or blocks and explains what is missing. It does not make up a confident summary and proceed.
133
+ - **The stop-goal-fit hook** (at L2) prevents the agent from stopping when evidence is still incomplete — you see a warning or block rather than "all done!" on partial work.
134
+ - **If verify fails**, the verify-gate routes back to execution (or plan, or design-probe, depending on the failure class) and tries again — up to three times before hard-blocking.
135
+
136
+ This is guided, not fully automated. The agent handles the mechanics; you make product decisions. Gates are explicit handoff points, not invisible checkboxes.
137
+
138
+ ## 4. Inspect what you installed
139
+
140
+ After installing, you can inspect the Builder Kit's declared contents:
141
+
142
+ ```bash
143
+ node build/src/cli.js kit inspect kits/builder
144
+ ```
145
+
146
+ (Or, from a global install: `flow-agents kit inspect kits/builder`)
147
+
148
+ This prints the kit id, name, declared flows, skills, and conformance level (K0/K1). It does not require a running agent or active session.
149
+
150
+ To see the raw flow definitions with their gate expectations:
151
+
152
+ ```bash
153
+ cat kits/builder/flows/shape.flow.json
154
+ cat kits/builder/flows/build.flow.json
155
+ ```
156
+
157
+ ## 5. Verify your setup
158
+
159
+ After installing, run the source validation to confirm the workspace is coherent:
160
+
161
+ ```bash
162
+ npm run validate:source
163
+ ```
164
+
165
+ For a full static eval pass (docs layout, legacy-term checks, bundle assertions):
166
+
167
+ ```bash
168
+ npm run eval:static
169
+ ```
170
+
171
+ ## What to read next
172
+
173
+ - [Workflow Usage Guide](workflow-usage-guide.html) — example prompts and expected behavior for every skill and stage
174
+ - [Agent System Guidebook](agent-system-guidebook.html) — how the pieces fit together conceptually
175
+ - [Kit Authoring Guide](kit-authoring-guide.html) — author your own Flow Kit from scratch
176
+ - [Runtime Hook Surface spec](spec/runtime-hook-surface.html) — hook events, conformance levels, and host gaps
177
+ - [Workflow Artifact Lifecycle](workflow-artifact-lifecycle.html) — when to promote local artifacts to durable docs
package/docs/index.md CHANGED
@@ -71,24 +71,31 @@ The same canonical policies wire into agent frameworks as in-process language-na
71
71
 
72
72
  ## Quick Start
73
73
 
74
+ Install into your workspace in one command:
75
+
74
76
  ```bash
75
- npx @kontourai/flow-agents init --dest /path/to/workspace
77
+ npx @kontourai/flow-agents init --runtime <your-agent> --dest .
76
78
  ```
77
79
 
78
- Runtime-specific installs:
80
+ Where `--runtime` is `claude-code`, `codex`, `kiro`, `opencode`, or `pi`. The Builder Kit installs automatically and gives your agent two gated flows: `builder.shape` (idea → slices → filed work items) and `builder.build` (selected work item → design probe → plan → execute → verify → PR → learn).
79
81
 
80
- ```bash
81
- npx @kontourai/flow-agents init --runtime claude-code --dest /path/to/workspace --yes
82
- npx @kontourai/flow-agents init --runtime opencode --dest /path/to/workspace --yes
83
- npx @kontourai/flow-agents init --runtime pi --dest /path/to/workspace --yes
82
+ Ask your agent to shape an idea:
83
+
84
+ ```text
85
+ Use Builder Kit shape. I want to add a progress indicator to the CLI output
86
+ so users can see what step the installer is on. Shape this into an executable
87
+ work item and stop at the backlog gate.
84
88
  ```
85
89
 
86
- Then ask for the workflow you want, in plain language:
90
+ Then build it:
87
91
 
88
92
  ```text
89
- Use deliver for this GitHub issue. Plan it, implement it, review it, verify it, and stop if evidence is missing.
93
+ Use deliver for the issue you just filed. Pull it, probe the design, plan it,
94
+ implement it, verify it, and stop if any evidence is missing.
90
95
  ```
91
96
 
97
+ Each step has an evidence gate. The agent cannot proceed past a gate without the expected evidence — it either presents it or blocks and explains what is missing. See the <a href="getting-started.html">Builder Kit Quick Start</a> for a full two-minute walkthrough with worked examples and an explanation of what you observe at each gate.
98
+
92
99
  For bugs:
93
100
 
94
101
  ```text
@@ -98,6 +105,10 @@ Use fix-bug. Reproduce the problem, diagnose root cause, implement the fix, and
98
105
  ## Explore the docs
99
106
 
100
107
  <div class="doc-grid">
108
+ <a class="doc-card" href="getting-started.html">
109
+ <strong>Builder Kit Quick Start</strong>
110
+ <span>Zero to a running, gated build flow in two minutes: install, shape an idea into a work item, build it through the builder.shape and builder.build flows, and see what the evidence gates do.</span>
111
+ </a>
101
112
  <a class="doc-card" href="workflow-usage-guide.html">
102
113
  <strong>Workflow Usage Guide</strong>
103
114
  <span>Every stage from shaping ideas to learning review, with example prompts and expected behavior.</span>
@@ -74,12 +74,12 @@ A Flow Definition at minimum needs `id`, `version`, `steps`, and `gates`. Steps
74
74
  "expects": [
75
75
  {
76
76
  "id": "review-finding",
77
- "kind": "surface.claim",
77
+ "kind": "trust.bundle",
78
78
  "required": true,
79
79
  "description": "The change was reviewed and findings were recorded.",
80
- "claim": {
81
- "type": "my-kit.review.finding",
82
- "subject": "artifact",
80
+ "bundle_claim": {
81
+ "claimType": "my-kit.review.finding",
82
+ "subjectType": "artifact",
83
83
  "accepted_statuses": ["trusted", "accepted"]
84
84
  }
85
85
  }
@@ -112,7 +112,7 @@ npm run validate:source --
112
112
  Once validation passes, install the kit into a target workspace:
113
113
 
114
114
  ```bash
115
- npx @kontourai/flow-agents flow-kit install-local path/to/my-kit --dest /path/to/workspace
115
+ npx @kontourai/flow-agents kit install path/to/my-kit --dest /path/to/workspace
116
116
  ```
117
117
 
118
118
  `--dest` is the installed Flow Agents bundle root. When omitted the command uses the current directory. From a contributor checkout of this repository, the equivalent form is `npm run flow-kit -- <command>`.
@@ -120,8 +120,8 @@ npx @kontourai/flow-agents flow-kit install-local path/to/my-kit --dest /path/to
120
120
  Confirm the install:
121
121
 
122
122
  ```bash
123
- npx @kontourai/flow-agents flow-kit list --dest /path/to/workspace
124
- npx @kontourai/flow-agents flow-kit status my-kit --dest /path/to/workspace
123
+ npx @kontourai/flow-agents kit list --dest /path/to/workspace
124
+ npx @kontourai/flow-agents kit status my-kit --dest /path/to/workspace
125
125
  ```
126
126
 
127
127
  `list` prints one summary line per installed kit. `status` prints JSON provenance including the SHA256 content hash and `installed` or `missing` state.
@@ -129,7 +129,7 @@ npx @kontourai/flow-agents flow-kit status my-kit --dest /path/to/workspace
129
129
  To replace an existing install after you update the kit source:
130
130
 
131
131
  ```bash
132
- npx @kontourai/flow-agents flow-kit install-local path/to/my-kit --dest /path/to/workspace --update
132
+ npx @kontourai/flow-agents kit install path/to/my-kit --dest /path/to/workspace --update
133
133
  ```
134
134
 
135
135
  ## Activate
@@ -137,7 +137,7 @@ npx @kontourai/flow-agents flow-kit install-local path/to/my-kit --dest /path/to
137
137
  After installing, run activate to write runtime-local files into the workspace:
138
138
 
139
139
  ```bash
140
- npx @kontourai/flow-agents flow-kit activate --dest /path/to/workspace --format json
140
+ npx @kontourai/flow-agents kit activate --dest /path/to/workspace --format json
141
141
  ```
142
142
 
143
143
  The `codex-local` adapter is selected automatically. To activate for Strands, pass `--adapter strands-local`.
@@ -194,7 +194,7 @@ The **container contract** is owned by [Kontour Flow](https://kontourai.github.i
194
194
  - Path rules: all declared paths must be relative, must not contain `..`, and must resolve inside the kit directory.
195
195
  - The **extension model**: unknown top-level fields are consumer extensions; core validation ignores-but-permits them.
196
196
 
197
- Container validation is surfaced in Flow's CLI as `flow validate-kit <kit-dir>`. Flow Agents delegates container validation to Flow when `FLOW_CLI_ROOT` is configured; without it, Flow Agents applies the same rules internally.
197
+ Container validation is surfaced in Flow's CLI as `flow kit validate <kit-dir>`. Flow Agents delegates core container validation to `@kontourai/flow`'s `validateKitContainer` library function; the contract lives once, in Flow.
198
198
 
199
199
  For the authoritative container spec and JSON Schema, see [kontourai/flow#67](https://github.com/kontourai/flow/pull/67) (the spec PR) and the published `schemas/flow-kit-container.schema.json` in the `@kontourai/flow` package.
200
200
 
@@ -270,7 +270,7 @@ Version constraints (e.g. minimum `flow-agents` version) are the only case where
270
270
 
271
271
  ### Evidence layering: Surface and Veritas
272
272
 
273
- Kit gates reference evidence using `"kind": "surface.claim"`. This is **Flow-native vocabulary**: Flow is built on Surface, so Surface claims are the expected evidence substrate at the Flow level. Surface claims are not a Flow Agents coupling.
273
+ Kit gates reference evidence using `"kind": "trust.bundle"` with a `bundle_claim` selector (`claimType`, optional `subjectType`, `accepted_statuses`). This is **Flow-native vocabulary** in the Hachure open trust-bundle format: Flow is built on Surface, so trust bundles are the expected evidence substrate at the Flow level, validated against Hachure's `trust-bundle.schema.json`. They are not a Flow Agents coupling. (Earlier Flow releases used `kind: "surface.claim"` with a `claim` selector; Flow 1.3.0 replaced that with `trust.bundle`, kontourai/flow#84.)
274
274
 
275
275
  Veritas is an **optional claim family** — a developer-repo specialization for evidence that has been through a trust pipeline. Kits may be opinionated about requiring Veritas-class evidence. Builder Kit requiring Veritas-class evidence is the kit's own policy choice, defined by Kontour as the kit author, not a platform requirement. Other kits may not require Veritas at all.
276
276
 
@@ -284,7 +284,7 @@ Layering summary:
284
284
  Use the `inspect` subcommand to derive a kit's conformance level and consumer targets:
285
285
 
286
286
  ```bash
287
- npm run flow-kit -- inspect path/to/my-kit
287
+ npm run kit -- inspect path/to/my-kit
288
288
  ```
289
289
 
290
290
  Output is stable JSON:
@@ -299,7 +299,8 @@ Output is stable JSON:
299
299
  "k2": false
300
300
  },
301
301
  "targets": ["flow", "flow-agents"],
302
- "third_party_extensions": []
302
+ "third_party_extensions": [],
303
+ "trust": "unverified"
303
304
  }
304
305
  ```
305
306
 
@@ -307,6 +308,117 @@ Exit code 0 when the kit is at least K0 (valid core container); exit code 1 when
307
308
 
308
309
  The `inspect` command is read-only and safe to run before install.
309
310
 
311
+ ## Trust axis: who vouches for a kit
312
+
313
+ The **trust axis** is a separate, orthogonal classification from the K-level capability axis. It answers the question "who vouches for this kit?" rather than "what does this kit contain?".
314
+
315
+ ### Two orthogonal axes
316
+
317
+ Every kit carries two independent badges:
318
+
319
+ | Axis | Values | Question answered |
320
+ |---|---|---|
321
+ | **Capability** (K-level) | K0 / K1 / K2 | What does the kit CONTAIN? (derived from assets) |
322
+ | **Trust** | first-party / verified / unverified | WHO vouches for it? (derived from provenance) |
323
+
324
+ A K2 kit can be `unverified`. A K0 kit can be `first-party`. The levels are independent.
325
+
326
+ **Marketplace listing format**: `Works with: Flow (gates-only) | K1 | ✓ First-party`
327
+
328
+ ### Trust levels
329
+
330
+ | Level | Meaning | How it is assigned (v1) |
331
+ |---|---|---|
332
+ | `first-party` | Kontour authored, tested, and ships this kit in the `@kontourai/flow-agents` package. | Kit id is in the internal FIRST_PARTY_KIT_IDS allowlist in `src/flow-kit/validate.ts`. |
333
+ | `verified` | Reserved for a future third-party verification process. | Not yet implemented; the value is reserved but not granted to any kit today. |
334
+ | `unverified` | Default for all kits not explicitly vouched for. | All other kits, including third-party community kits. |
335
+
336
+ `unverified` says nothing about the quality of a kit — it only means Kontour has not vouched for it through one of the above channels.
337
+
338
+ ### First-party kits (v1)
339
+
340
+ The first-party allowlist in v1 contains the kits authored by Kontour and distributed with the flow-agents package:
341
+
342
+ - `builder` — Builder Kit (shape, build, and deliver work)
343
+ - `knowledge` — Knowledge Kit (durable gated knowledge store)
344
+
345
+ Criteria for a kit to be first-party:
346
+ 1. Its directory lives under `kits/` in the `kontourai/flow-agents` repository.
347
+ 2. It is published as part of the `@kontourai/flow-agents` npm package.
348
+ 3. Kontour owns and maintains the kit's content and release lifecycle.
349
+
350
+ Third-party forks, community kits, or kits published under a different npm package are NOT first-party even if they share a similar id. First-party is tied to provenance in this specific repository and package.
351
+
352
+ ### Deferred: verified trust and cryptographic attestation (v2)
353
+
354
+ The `verified` value is reserved for a future verification process. The intended v2 path:
355
+
356
+ - Third-party kit authors can apply for `verified` status.
357
+ - Verification evidence: the kit passes the conformance kit self-certification + a cryptographic signature or Veritas attestation.
358
+ - The [conformance kit](https://github.com/kontourai/flow) and [Veritas claims](veritas-integration.md) are the natural substrate for this attestation layer.
359
+ - The signature or attestation would be checked by `flow-agents kit inspect` at derivation time.
360
+
361
+ v1 deliberately omits the signing/attestation mechanism and the verification process. The `verified` value is reserved so consuming tools can handle it when it arrives without a breaking schema change.
362
+
363
+ ### Inspecting trust
364
+
365
+ The `trust` field appears in `flow-agents kit inspect` output alongside `conformance`:
366
+
367
+ ```bash
368
+ npm run kit -- inspect kits/builder
369
+ ```
370
+
371
+ ```json
372
+ {
373
+ "kit_id": "builder",
374
+ "kit_name": "Builder Kit",
375
+ "conformance": {
376
+ "k0": true,
377
+ "k1": true,
378
+ "k2": false
379
+ },
380
+ "targets": ["flow", "flow-agents"],
381
+ "third_party_extensions": [],
382
+ "trust": "first-party"
383
+ }
384
+ ```
385
+
386
+ A third-party kit inspected before verification:
387
+
388
+ ```json
389
+ {
390
+ "kit_id": "my-custom-kit",
391
+ "kit_name": "My Custom Kit",
392
+ "conformance": {
393
+ "k0": true,
394
+ "k1": true,
395
+ "k2": false
396
+ },
397
+ "targets": ["flow", "flow-agents"],
398
+ "third_party_extensions": [],
399
+ "trust": "unverified"
400
+ }
401
+ ```
402
+
310
403
  ## Direction
311
404
 
312
405
  Flow Kits are designed to be shareable workflow units — authored once, carried across teams and workspaces. The intended growth path is distribution from git remotes and a curated Kontour kit catalog of Kontour-authored kits covering work modes beyond software delivery. Today install is local-path only; remote fetch is explicitly a non-goal in this version.
406
+
407
+ ## Migration: flow-kit → flow-agents kit
408
+
409
+ The standalone `flow-kit` binary was removed in this release. The `flow-agents kit` subcommand is the replacement.
410
+
411
+ | Old command | New command |
412
+ |---|---|
413
+ | `flow-kit install-local <path>` | `flow-agents kit install <path>` |
414
+ | `flow-kit install-git <url>` | `flow-agents kit install <url>` |
415
+ | `flow-kit activate` | `flow-agents kit activate` |
416
+ | `flow-kit inspect <dir>` | `flow-agents kit inspect <dir>` |
417
+ | `flow-kit list` | `flow-agents kit list` |
418
+ | `flow-kit status <id>` | `flow-agents kit status <id>` |
419
+ | `npx @kontourai/flow-agents flow-kit ...` | `npx @kontourai/flow-agents kit ...` |
420
+ | `npm run flow-kit -- ...` | `npm run kit -- ...` |
421
+
422
+ `install-local` and `install-git` are unified into a single `install` command. The source argument auto-detects whether it is a local path or a git URL (http://, https://, git+, ssh://, file://).
423
+
424
+ Running the old `flow-kit` command will produce a "command not found" error from your shell — there is no alias or shim. Update any scripts or CI configurations that call `flow-kit` to use `flow-agents kit`.
@@ -4,7 +4,7 @@ title: Knowledge Kit
4
4
 
5
5
  # Knowledge Kit
6
6
 
7
- The Knowledge Kit is a Flow Kit for durable, gated knowledge storage. It packages a store contract, five pipeline flows, pluggable store adapters, and a parameterized contract test suite — all validated and installed through the standard `flow-kit` path.
7
+ The Knowledge Kit is a Flow Kit for durable, gated knowledge storage. It packages a store contract, five pipeline flows, pluggable store adapters, and a parameterized contract test suite — all validated and installed through the `flow-agents kit` path.
8
8
 
9
9
  ## What it ships
10
10
 
@@ -44,7 +44,7 @@ The vector detector is fail-closed: infrastructure failures throw `EMBED_FAILURE
44
44
 
45
45
  ```bash
46
46
  # Install the kit into a workspace
47
- npx @kontourai/flow-agents flow-kit install-local kits/knowledge --dest /path/to/workspace
47
+ npx @kontourai/flow-agents kit install kits/knowledge --dest /path/to/workspace
48
48
 
49
49
  # Run the contract suite against the default adapter
50
50
  node --test kits/knowledge/evals/contract-suite/suite.test.js
@@ -49,7 +49,7 @@ Governance tools such as Veritas belong at the Evidence boundary. Flow Agents sh
49
49
 
50
50
  ## Flow Kit Coordination
51
51
 
52
- Flow owns Flow Definition semantics: gates use typed `expects` entries, Surface requirements use `kind: "surface.claim"`, and project configuration owns trusted producer mappings plus gate overrides. Flow Agents should author, install, adapt, and control those assets for local runtimes; it should not become the authority source for claim trust or override semantics.
52
+ Flow owns Flow Definition semantics: gates use typed `expects` entries, Surface requirements use `kind: "trust.bundle"` (the Hachure-aligned gate kind), and project configuration owns trusted producer mappings plus gate overrides. Flow Agents should author, install, adapt, and control those assets for local runtimes; it should not become the authority source for claim trust or override semantics.
53
53
 
54
54
  The Kit Catalog is the Flow Agents index of installable Flow Kits. A Flow Kit can contain Flow Definitions, skills, docs, adapters, and evals, but the catalog points at those assets instead of defining gate behavior itself. Builder Kit is the first Kontour-authored kit and proves the path from shaping through build, verification, merge readiness, and learning.
55
55
 
@@ -65,7 +65,7 @@ Builder Kit vocabulary should be used in public and internal guidance:
65
65
  - Builder Kit: the coding/building kit shipped by this repo.
66
66
  - Probe: question-driven design and context challenge step, surfaced as `design-probe`.
67
67
 
68
- Builder Kit evidence gates can reference Surface trust state without naming a provider. A trust-backed gate may attach a TrustReport or Trust Snapshot ref for the relevant Surface claim, while Flow keeps authority over gate evaluation, trusted producer mapping, and route-back behavior. Surface remains the portable trust-state layer, and Veritas remains an optional producer rather than a required Builder Kit dependency.
68
+ Builder Kit evidence gates can reference Surface trust state without naming a provider. A trust-backed gate may attach a Hachure trust.bundle ref for the relevant Surface claim, while Flow keeps authority over gate evaluation, trusted producer mapping, and route-back behavior. Surface remains the portable trust-state layer, and Veritas remains an optional producer rather than a required Builder Kit dependency.
69
69
 
70
70
  ## Placement Rules
71
71
 
@@ -490,7 +490,7 @@ Kit flow activation for Strands workspaces is implemented as a new runtime adapt
490
490
  The CLI command is:
491
491
 
492
492
  ```bash
493
- flow-kit activate --adapter strands-local [--dest DIR] [--source-root DIR]
493
+ flow-agents kit activate --adapter strands-local [--dest DIR] [--source-root DIR]
494
494
  ```
495
495
 
496
496
  This writes activated flow files to `.flow-agents/runtime/strands/flows/<kit-id>/<asset-id>.flow.json` and produces a parity-diagnostic `activation.json` (same schema as codex-local: `schema_version`, `adapter`, `supported_asset_classes`, `generated_runtime_files`, `skipped_assets`, `warnings`, `errors`).
@@ -106,9 +106,9 @@ If Veritas is unavailable and the workflow expected it, record `not_verified` in
106
106
 
107
107
  ## Builder Kit Trust Evidence
108
108
 
109
- Builder Kit gates stay provider-neutral. The Builder Kit Flow Definition names gate expectations as `kind: "surface.claim"` and declares the claim type, subject, accepted statuses, and blocking behavior. It does not name Veritas or any other trust producer.
109
+ Builder Kit gates stay provider-neutral. The Builder Kit Flow Definition names gate expectations as `kind: "trust.bundle"` (the Hachure-aligned gate kind) and declares the claim type, subject, accepted statuses, and blocking behavior. It does not name Veritas or any other trust producer.
110
110
 
111
- When a trust-backed path is configured, Flow Agents may attach a compact Surface-shaped reference to the Builder Kit evidence gate. The reference points at a TrustReport or Trust Snapshot, carries the related gate id, Surface claim type, claim status, artifact ref, integrity summary, authority or trusted-producer summary, subject, and freshness state, and then maps to the normal Flow gate result. Flow owns the gate authority decision, route reason, trusted producer mapping, and accepted gap behavior. Surface owns the portable trust state represented by the Surface claim and the TrustReport / Trust Snapshot. A Probe can request or clarify the evidence needed before planning or before a later Builder Kit gate retries.
111
+ When a trust-backed path is configured, Flow Agents may attach a compact Hachure trust.bundle reference to the Builder Kit evidence gate. The reference uses `artifact_kind: "trust.bundle"` (the Hachure-aligned canonical value), carries the related gate id, domain claim type, claim status, artifact ref, integrity summary, authority or trusted-producer summary, subject, and freshness state, and then maps to the normal Flow gate result. When the `hachure` optional dependency is installed, referenced artifacts are validated against hachure's trust-bundle.schema.json at evidence-recording time. Flow owns the gate authority decision, route reason, trusted producer mapping, and accepted gap behavior. Surface owns the portable trust state represented by the Surface claim and the TrustReport / Trust Snapshot. A Probe can request or clarify the evidence needed before planning or before a later Builder Kit gate retries.
112
112
 
113
113
  Veritas is only one optional producer of those artifacts. A local Veritas readiness run can emit native Veritas evidence and, when configured, point Flow Agents at a Surface-shaped TrustReport or Trust Snapshot. Flow Agents records the reference; it does not copy Veritas rule models, readiness semantics, or provider-native fields into Builder Kit gates.
114
114
 
@@ -116,8 +116,8 @@ Provider and artifact absence are explicit:
116
116
 
117
117
  - If no trust provider is configured, ordinary Builder Kit activation, planning, verification, and evidence gates continue to work through the existing Flow Kit path.
118
118
  - If a trust-backed path was requested but no provider is configured, the trust check records `not_verified` with a clear gap instead of blocking unrelated Builder Kit usage.
119
- - If a provider is configured but the expected TrustReport or Trust Snapshot is absent or unreadable, only the requested trust-backed evidence check records `not_verified`; it does not silently pass and it does not make Veritas mandatory.
120
- - If a TrustReport or Trust Snapshot is present but has a rejected, stale, expired, missing-authority, or integrity-mismatched Surface claim, the Builder Kit evidence gate routes through the normal `fail` or `not_verified` path.
119
+ - If a provider is configured but the expected Hachure trust.bundle artifact is absent or unreadable, only the requested trust-backed evidence check records `not_verified`; it does not silently pass and it does not make Veritas mandatory.
120
+ - If a Hachure trust.bundle artifact is present but has a rejected, stale, expired, missing-authority, or integrity-mismatched claim, the Builder Kit evidence gate routes through the normal `fail` or `not_verified` path.
121
121
 
122
122
  ## Adoption Gate
123
123
 
package/docs/vision.md CHANGED
@@ -20,7 +20,7 @@ One official framework adapter spike exists: `integrations/strands/` is a Python
20
20
 
21
21
  ### What ships today
22
22
 
23
- Kit authoring is shipped. The `kit.json` contract at schema version 1.0 is validated by the `flow-kit` CLI before any install. The [Kit Authoring Guide](kit-authoring-guide.html) walks from an empty directory to a validated, locally installed kit. Two reference kits ship in `kits/`:
23
+ Kit authoring is shipped. The `kit.json` contract at schema version 1.0 is validated by the `flow-agents kit` CLI before any install. The [Kit Authoring Guide](kit-authoring-guide.html) walks from an empty directory to a validated, locally installed kit. Two reference kits ship in `kits/`:
24
24
 
25
25
  **Builder Kit** packages the full `idea → backlog → plan → build → review → verify → evidence → release → learning` pipeline as two flows (`builder.shape`, `builder.build`). It installs automatically.
26
26
 
@@ -6,7 +6,7 @@ title: Workflow Eval Strategy
6
6
 
7
7
  The Builder Kit workflow system now has concrete skill contracts for `idea-to-backlog`, `pull-work`, `plan-work`, `review-work`, `deliver`, `evidence-gate`, `release-readiness`, and `learning-review`, plus shared workflow contracts in `context/contracts/`. Evals should prove both the written contracts and the agent behavior around gates, artifacts, worktrees, Goal Fit, release readiness, final acceptance docs, and learning feedback.
8
8
 
9
- Flow Agents evals prove coordination, install, runtime adapter behavior, and artifact discipline. They should not redefine Flow gate authority: Flow Definitions use typed `expects` entries, Surface claim gates use `kind: "surface.claim"`, and Flow project config owns trusted producer mappings plus gate overrides.
9
+ Flow Agents evals prove coordination, install, runtime adapter behavior, and artifact discipline. They should not redefine Flow gate authority: Flow Definitions use typed `expects` entries, trust-bundle gates use `kind: "trust.bundle"`, and Flow project config owns trusted producer mappings plus gate overrides.
10
10
 
11
11
  ## Goals
12
12
 
@@ -161,7 +161,7 @@ Surface trust artifact attachment is covered by deterministic schema, runtime, a
161
161
  bash evals/integration/test_workflow_sidecar_writer.sh
162
162
  ```
163
163
 
164
- That eval exercises Builder Kit `surface.claim` evidence using provider-neutral TrustReport / Trust Snapshot fixtures for accepted, rejected, stale, missing-authority, integrity-mismatch, provider-absent, and artifact-absent cases. It proves Flow Agents can record compact Surface claim evidence in `evidence.json` and report pass, fail, or `NOT_VERIFIED` gaps without requiring provider-specific fields.
164
+ That eval exercises Builder Kit `trust.bundle` evidence using provider-neutral Hachure trust.bundle fixtures for accepted, rejected, stale, missing-authority, integrity-mismatch, provider-absent, and artifact-absent cases. It proves Flow Agents can record compact Surface claim evidence in `evidence.json` and report pass, fail, or `NOT_VERIFIED` gaps without requiring provider-specific fields.
165
165
 
166
166
  This coverage does not redefine Flow gate authority. Flow Definitions continue to express expectations, Flow project config owns trusted producer mappings and gate overrides, and Flow gate authority remains outside the local report writer. Runtime/provider gaps should be recorded as `NOT_VERIFIED` when a configured Surface claim path cannot be checked; ordinary Builder Kit workflows remain valid when no trust provider or trust artifact is configured.
167
167
 
@@ -6,7 +6,7 @@ title: Workflow Usage Guide
6
6
 
7
7
  This guide shows how to use the Builder Kit workflow skills in normal chats.
8
8
 
9
- > **Which doc do I want?** This page is the *driver's manual* — what to say at each stage and what should happen. If you want the conceptual map first — layers, sidecars, hooks, evidence, and why the system is shaped this way — read the [Agent System Guidebook](agent-system-guidebook.md). For a one-line summary of every skill and gate, use the [Skills Map](skills-map.md). Flow Agents coordinates the local runtime, installs Flow Kits, and records artifacts; Flow owns gate semantics, including typed `expects` entries with `kind: "surface.claim"`, trusted producer config, and gate overrides.
9
+ > **Which doc do I want?** This page is the *driver's manual* — what to say at each stage and what should happen. If you want the conceptual map first — layers, sidecars, hooks, evidence, and why the system is shaped this way — read the [Agent System Guidebook](agent-system-guidebook.md). For a one-line summary of every skill and gate, use the [Skills Map](skills-map.md). Flow Agents coordinates the local runtime, installs Flow Kits, and records artifacts; Flow owns gate semantics, including typed `expects` entries with `kind: "trust.bundle"`, trusted producer config, and gate overrides.
10
10
 
11
11
  The core pattern is:
12
12
 
@@ -43,7 +43,7 @@ Separate these into distinct ideas, use Probe/alignment questions if the outcome
43
43
 
44
44
  Expected behavior:
45
45
 
46
- - delegate shaping to `skills/idea-to-backlog/SKILL.md`
46
+ - delegate shaping to `kits/builder/skills/idea-to-backlog/SKILL.md`
47
47
  - link the artifact to the Builder Kit Flow Definition at `kits/builder/flows/shape.flow.json`
48
48
  - inventory each distinct idea separately
49
49
  - classify each idea
@@ -21,7 +21,7 @@ wait_for_telemetry() {
21
21
  local file="$1"
22
22
  local i=0
23
23
  while [[ $i -lt 150 ]]; do
24
- [[ -s "$file" ]] && return 0
24
+ if [[ -s "$file" ]] && grep -q '"tool.invoke"' "$file" 2>/dev/null && grep -q '"tool.result"' "$file" 2>/dev/null; then return 0; fi
25
25
  sleep 0.1
26
26
  i=$((i + 1))
27
27
  done
@@ -73,23 +73,31 @@ for _attempt in 1 2; do
73
73
  grep -q '"tool.invoke"' "$TMP_WORK/.telemetry/full.jsonl" 2>/dev/null && break
74
74
  done
75
75
 
76
- LATEST_LOG="$(ls -t ~/.local/share/opencode/log/*.log 2>/dev/null | head -1 || true)"
77
- if [[ -n "$LATEST_LOG" ]] && grep -q "plugins/flow-agents.js loading plugin" "$LATEST_LOG" 2>/dev/null; then
78
- _pass "opencode log confirms flow-agents plugin loaded"
76
+ # Confirm load via the plugin's own marker file (written by the FlowAgentsPlugin
77
+ # factory at startup). This replaces grepping opencode's internal
78
+ # "plugins/flow-agents.js loading plugin" message, which opencode 1.17.x dropped
79
+ # and which opencode does not reliably surface to its log file — a stale-assertion
80
+ # false failure (#75). The factory runs regardless of provider, so this load
81
+ # signal is independent of whether a model turn completes.
82
+ if [[ -f "$TMP_WORK/.telemetry/opencode-plugin.loaded" ]]; then
83
+ _pass "flow-agents plugin loaded (factory marker present)"
79
84
  else
80
- _fail "opencode log did not confirm flow-agents plugin loaded"
85
+ _fail "flow-agents plugin did not load (factory marker absent)"
81
86
  fi
82
87
 
83
88
  telemetry_file="$TMP_WORK/.telemetry/full.jsonl"
84
89
  if [[ "$provider_error" -eq 1 ]]; then
85
90
  _skip "opencode telemetry assertions skipped (provider/auth error)"
86
91
  _skip "opencode telemetry tool events skipped (provider/auth error)"
92
+ elif ! wait_for_telemetry "$telemetry_file"; then
93
+ # No telemetry was produced at all — the agent never completed a model turn,
94
+ # expected in a provider-less environment (e.g. CI with no API key). The binary
95
+ # install, bundle, and mechanical hook chain are already covered; skip the
96
+ # live-model-dependent telemetry assertions rather than fail on them.
97
+ _skip "opencode telemetry assertions skipped (no telemetry — agent did not complete a turn, likely no provider)"
98
+ _skip "opencode telemetry tool events skipped (no turn)"
87
99
  else
88
- if wait_for_telemetry "$telemetry_file"; then
89
- _pass "opencode telemetry log was written"
90
- else
91
- _fail "opencode telemetry log was not written"
92
- fi
100
+ _pass "opencode telemetry log was written"
93
101
 
94
102
  if [[ -f "$telemetry_file" ]] && \
95
103
  node -e "