@kontourai/flow-agents 3.6.0 → 3.8.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 (96) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/build/src/builder-flow-run-adapter.d.ts +22 -2
  3. package/build/src/builder-flow-run-adapter.js +93 -28
  4. package/build/src/builder-flow-runtime.d.ts +8 -3
  5. package/build/src/builder-flow-runtime.js +407 -51
  6. package/build/src/cli/assignment-provider.d.ts +4 -7
  7. package/build/src/cli/assignment-provider.js +80 -14
  8. package/build/src/cli/builder-run.js +14 -18
  9. package/build/src/cli/workflow-sidecar.d.ts +28 -4
  10. package/build/src/cli/workflow-sidecar.js +825 -103
  11. package/build/src/cli/workflow.js +301 -43
  12. package/build/src/flow-kit/validate.d.ts +17 -0
  13. package/build/src/flow-kit/validate.js +340 -2
  14. package/build/src/index.js +5 -5
  15. package/build/src/lib/observed-command.d.ts +7 -0
  16. package/build/src/lib/observed-command.js +100 -0
  17. package/build/src/tools/build-universal-bundles.js +53 -3
  18. package/build/src/tools/generate-context-map.js +5 -3
  19. package/context/scripts/hooks/lib/kit-catalog.js +1 -1
  20. package/context/scripts/hooks/stop-goal-fit.js +78 -9
  21. package/docs/context-map.md +22 -20
  22. package/docs/developer-architecture.md +1 -1
  23. package/docs/getting-started.md +9 -1
  24. package/docs/public-workflow-cli.md +76 -7
  25. package/docs/skills-map.md +51 -27
  26. package/docs/spec/builder-flow-runtime.md +75 -40
  27. package/docs/workflow-usage-guide.md +109 -42
  28. package/evals/fixtures/hook-influence/cases.json +2 -2
  29. package/evals/integration/test_builder_entry_enforcement.sh +52 -41
  30. package/evals/integration/test_builder_step_producers.sh +330 -6
  31. package/evals/integration/test_bundle_install.sh +318 -65
  32. package/evals/integration/test_bundle_lifecycle.sh +4 -6
  33. package/evals/integration/test_critique_supersession_roundtrip.sh +21 -8
  34. package/evals/integration/test_current_json_per_actor.sh +12 -0
  35. package/evals/integration/test_dual_emit_flow_step.sh +62 -43
  36. package/evals/integration/test_flowdef_session_activation.sh +145 -25
  37. package/evals/integration/test_flowdef_session_history_preservation.sh +23 -21
  38. package/evals/integration/test_gate_lockdown.sh +3 -5
  39. package/evals/integration/test_goal_fit_hook.sh +60 -2
  40. package/evals/integration/test_install_merge.sh +18 -8
  41. package/evals/integration/test_liveness_verdict.sh +14 -17
  42. package/evals/integration/test_phase_map_and_gate_claim.sh +63 -38
  43. package/evals/integration/test_public_workflow_cli.sh +334 -14
  44. package/evals/integration/test_pull_work_liveness_preflight.sh +22 -66
  45. package/evals/integration/test_sidecar_field_preservation.sh +36 -11
  46. package/evals/integration/test_workflow_sidecar_writer.sh +277 -44
  47. package/evals/integration/test_workflow_steering_hook.sh +15 -38
  48. package/evals/run.sh +2 -0
  49. package/evals/static/test_builder_skill_coherence.sh +247 -0
  50. package/evals/static/test_library_exports.sh +5 -2
  51. package/evals/static/test_universal_bundles.sh +44 -1
  52. package/evals/static/test_workflow_skills.sh +13 -325
  53. package/kits/builder/flows/build.flow.json +22 -0
  54. package/kits/builder/flows/shape.flow.json +9 -9
  55. package/kits/builder/kit.json +70 -16
  56. package/kits/builder/skills/builder-shape/SKILL.md +75 -75
  57. package/kits/builder/skills/continue-work/SKILL.md +45 -106
  58. package/kits/builder/skills/deliver/SKILL.md +96 -442
  59. package/kits/builder/skills/design-probe/SKILL.md +40 -139
  60. package/kits/builder/skills/evidence-gate/SKILL.md +59 -201
  61. package/kits/builder/skills/execute-plan/SKILL.md +54 -125
  62. package/kits/builder/skills/fix-bug/SKILL.md +42 -132
  63. package/kits/builder/skills/gate-review/SKILL.md +60 -211
  64. package/kits/builder/skills/idea-to-backlog/SKILL.md +63 -244
  65. package/kits/builder/skills/learning-review/SKILL.md +63 -170
  66. package/kits/builder/skills/pickup-probe/SKILL.md +54 -111
  67. package/kits/builder/skills/plan-work/SKILL.md +51 -185
  68. package/kits/builder/skills/pull-work/SKILL.md +136 -485
  69. package/kits/builder/skills/release-readiness/SKILL.md +66 -107
  70. package/kits/builder/skills/review-work/SKILL.md +89 -176
  71. package/kits/builder/skills/tdd-workflow/SKILL.md +53 -147
  72. package/kits/builder/skills/verify-work/SKILL.md +101 -113
  73. package/package.json +2 -2
  74. package/packaging/README.md +1 -1
  75. package/scripts/README.md +1 -1
  76. package/scripts/hooks/lib/kit-catalog.js +1 -1
  77. package/scripts/hooks/stop-goal-fit.js +78 -9
  78. package/scripts/install-codex-home.sh +63 -23
  79. package/scripts/install-owned-files.js +18 -2
  80. package/src/builder-flow-run-adapter.ts +118 -32
  81. package/src/builder-flow-runtime.ts +426 -64
  82. package/src/cli/assignment-provider-lock.test.mjs +83 -0
  83. package/src/cli/assignment-provider.ts +75 -14
  84. package/src/cli/builder-flow-run-adapter.test.mjs +4 -2
  85. package/src/cli/builder-flow-runtime.test.mjs +436 -18
  86. package/src/cli/builder-run.ts +3 -9
  87. package/src/cli/kit-metadata-security.test.mjs +232 -6
  88. package/src/cli/public-api.test.mjs +15 -0
  89. package/src/cli/workflow-sidecar-execution-proof.test.mjs +90 -0
  90. package/src/cli/workflow-sidecar.ts +746 -103
  91. package/src/cli/workflow.ts +288 -41
  92. package/src/flow-kit/validate.ts +320 -2
  93. package/src/index.ts +6 -5
  94. package/src/lib/observed-command.ts +96 -0
  95. package/src/tools/build-universal-bundles.ts +51 -3
  96. package/src/tools/generate-context-map.ts +5 -3
@@ -1759,6 +1759,37 @@ function hasSidecarPresence(artifactDir) {
1759
1759
  return fs.existsSync(path.join(artifactDir, 'state.json')) || fs.existsSync(path.join(artifactDir, 'trust.bundle'));
1760
1760
  }
1761
1761
 
1762
+ function canonicalFlowState(root, artifactDir) {
1763
+ if (!artifactDir) return { state: null, error: null };
1764
+ const slug = path.basename(artifactDir);
1765
+ if (!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(slug)) return { state: null, error: 'canonical Flow run slug is malformed' };
1766
+ const runDir = path.join(root, '.kontourai', 'flow', 'runs', slug);
1767
+ const components = [
1768
+ path.join(root, '.kontourai'),
1769
+ path.join(root, '.kontourai', 'flow'),
1770
+ path.join(root, '.kontourai', 'flow', 'runs'),
1771
+ runDir,
1772
+ ];
1773
+ try {
1774
+ for (const component of components) {
1775
+ const stat = fs.lstatSync(component);
1776
+ if (stat.isSymbolicLink() || !stat.isDirectory()) return { state: null, error: `canonical Flow run has an unsafe parent component: ${component}` };
1777
+ }
1778
+ const file = path.join(runDir, 'state.json');
1779
+ const stat = fs.lstatSync(file);
1780
+ if (stat.isSymbolicLink() || !stat.isFile()) return { state: null, error: 'canonical Flow state must be a non-symlink regular file' };
1781
+ const state = JSON.parse(fs.readFileSync(file, 'utf8'));
1782
+ if (!state || typeof state !== 'object' || Array.isArray(state)
1783
+ || typeof state.status !== 'string' || !state.status.trim()
1784
+ || typeof state.current_step !== 'string' || !state.current_step.trim()) {
1785
+ return { state: null, error: 'canonical Flow state is malformed' };
1786
+ }
1787
+ return { state, error: null };
1788
+ } catch (error) {
1789
+ return { state: null, error: `canonical Flow state is unavailable or malformed: ${safeOneLine(error && error.message || error, 120)}` };
1790
+ }
1791
+ }
1792
+
1762
1793
  // WS8 (AC10a): when current.json names a slug whose session directory does NOT exist,
1763
1794
  // return that slug so analyze() can log the staleness rather than silently falling back to
1764
1795
  // a global mtime scan that could resurface an abandoned/never-real session as active.
@@ -1871,7 +1902,7 @@ function missingBundleOrStateSignal(artifactDir, activeFlowStep) {
1871
1902
  //
1872
1903
  // Both are used in analyze() for blocking decisions AND in run() for the AC2
1873
1904
  // MAX_BLOCKS hard-block guard (preventing auto-release of hard blocks).
1874
- const HARD_BLOCK = /contradicts evidence\.json|caught false-completion|evidence verdict:|evidence check .+ status:|critique status|critique open|required sidecar is missing|command-log integrity check FAILED|gate misconfiguration:|exit-code-laundered|NOT_VERIFIED \(ambiguous\)/;
1905
+ const HARD_BLOCK = /contradicts evidence\.json|caught false-completion|evidence verdict:|evidence check .+ status:|critique status|critique open|required sidecar is missing|command-log integrity check FAILED|gate misconfiguration:|exit-code-laundered|NOT_VERIFIED \(ambiguous\)|canonical Flow (?:run remains active|state is unsafe or malformed)/;
1875
1906
  // FULL_BLOCK adds: workflow-state hygiene, surface-unavailable fail-closed, missing log.
1876
1907
  const FULL_BLOCK = /status:|Definition Of Done|Goal Fit|sidecar validation:|contradicts evidence\.json|workflow state|evidence verdict|evidence check|NOT_VERIFIED gap|critique status|critique open|next action|caught false-completion|NOT_VERIFIED —|command-log integrity check FAILED|gate misconfiguration:|surface unavailable —|expected capture log is missing|exit-code-laundered|malformed-evidence|NOT_VERIFIED \(ambiguous\)/;
1877
1908
 
@@ -1897,7 +1928,31 @@ async function analyze(root, now = Date.now()) {
1897
1928
  artifacts = artifacts.filter(a => a && hasSidecarPresence(path.dirname(a.file)));
1898
1929
  }
1899
1930
 
1900
- if (artifacts.length === 0) return { warnings: [], blocking: false, latestArtifactDir: null };
1931
+ const scopedCanonicalFlow = canonicalFlowState(root, scoped);
1932
+ const scopedState = scoped ? readJsonFile(path.join(scoped, 'state.json')) : null;
1933
+ const scopedProjectedActive = Boolean(scopedState && scopedState.flow_run && normalizedStatus(scopedState.flow_run.status) === 'active');
1934
+ if (scopedProjectedActive && scopedCanonicalFlow.error) {
1935
+ return {
1936
+ warnings: [`workflow state: canonical Flow state is unsafe or malformed for the active scoped session: ${scopedCanonicalFlow.error}. Resolve the canonical run before stopping.`],
1937
+ blocking: true,
1938
+ activeFlowRun: true,
1939
+ latestArtifactDir: scoped,
1940
+ gatePrefix: '[stop-gate]',
1941
+ };
1942
+ }
1943
+ if (artifacts.length === 0) {
1944
+ if (normalizedStatus(scopedCanonicalFlow.state?.status) === 'active') {
1945
+ const activeStep = safeOneLine(scopedCanonicalFlow.state.current_step || 'unknown', 80);
1946
+ return {
1947
+ warnings: [`workflow state: canonical Flow run remains active at step ${activeStep}; complete or explicitly cancel the run before stopping.`],
1948
+ blocking: true,
1949
+ activeFlowRun: true,
1950
+ latestArtifactDir: scoped,
1951
+ gatePrefix: '[stop-gate]',
1952
+ };
1953
+ }
1954
+ return { warnings: [], blocking: false, activeFlowRun: false, latestArtifactDir: null };
1955
+ }
1901
1956
 
1902
1957
  const latest = artifacts[0];
1903
1958
  const latestArtifactDir = path.dirname(latest.file);
@@ -1965,14 +2020,25 @@ async function analyze(root, now = Date.now()) {
1965
2020
  // Use module-scope HARD_BLOCK / FULL_BLOCK (defined above analyze()).
1966
2021
  // pre-execution/terminal tasks: only HARD_BLOCK signals cause a block.
1967
2022
  // execution-onward tasks: FULL_BLOCK signals cause a block.
1968
- const activeFlowRun = gateState && gateState.flow_run && normalizedStatus(gateState.flow_run.status) === 'active';
2023
+ const canonicalFlow = canonicalFlowState(root, latestArtifactDir);
2024
+ const activeProjectedFlow = gateState && gateState.flow_run && normalizedStatus(gateState.flow_run.status) === 'active';
2025
+ const unsafeActiveCanonical = Boolean(activeProjectedFlow && canonicalFlow.error);
2026
+ if (unsafeActiveCanonical) {
2027
+ warnings.push(`workflow state: canonical Flow state is unsafe or malformed for the active scoped session: ${canonicalFlow.error}. Resolve the canonical run before stopping.`);
2028
+ }
2029
+ const activeFlowRun = normalizedStatus(canonicalFlow.state?.status) === 'active'
2030
+ || (gateState && gateState.flow_run && normalizedStatus(gateState.flow_run.status) === 'active');
2031
+ if (activeFlowRun && !warnings.some(w => /canonical Flow run remains active/.test(w))) {
2032
+ const activeStep = safeOneLine(canonicalFlow.state?.current_step || gateState?.flow_run?.current_step || 'unknown', 80);
2033
+ warnings.push(`workflow state: canonical Flow run remains active at step ${activeStep}; complete or explicitly cancel the run before stopping.`);
2034
+ }
1969
2035
  const blockRe = ((preExecution && !activeFlowRun) || terminal) ? HARD_BLOCK : FULL_BLOCK;
1970
- const blocking = warnings.some(w => {
2036
+ const blocking = activeFlowRun || warnings.some(w => {
1971
2037
  // Capture cross-reference warn-mode notes never block (operator opted out).
1972
2038
  if (/\[backstop in warn mode — not blocking\]/.test(w)) return false;
1973
2039
  return blockRe.test(w);
1974
2040
  });
1975
- return { warnings, blocking, preExecution, gatePrefix: gateLabel(activeFlowStep), latestArtifactDir };
2041
+ return { warnings, blocking, activeFlowRun, preExecution, gatePrefix: gateLabel(activeFlowStep), latestArtifactDir };
1976
2042
  }
1977
2043
 
1978
2044
  /**
@@ -2220,8 +2286,9 @@ function releaseOnNonTerminalStop(root, artifactDir) {
2220
2286
 
2221
2287
  const state = readJsonFile(path.join(artifactDir, 'state.json'));
2222
2288
  if (!state) return; // AC5: no state.json — nothing to gate a release decision on.
2223
- if (state.flow_run && normalizedStatus(state.flow_run.status) === 'active') {
2224
- process.stderr.write(`[Hook] Goal Fit: stop-hook release skipped for active Flow run "${safeOneLine(state.flow_run.run_id || state.task_slug || 'unknown', 80)}"; continuation remains governed by Flow state.\n`);
2289
+ const canonicalFlow = canonicalFlowState(root, artifactDir);
2290
+ if (normalizedStatus(canonicalFlow.state?.status) === 'active' || (state.flow_run && normalizedStatus(state.flow_run.status) === 'active')) {
2291
+ process.stderr.write(`[Hook] Goal Fit: stop-hook release skipped for active Flow run "${safeOneLine(state.flow_run?.run_id || state.task_slug || path.basename(artifactDir), 80)}"; continuation remains governed by Flow state.\n`);
2225
2292
  return;
2226
2293
  }
2227
2294
 
@@ -2367,7 +2434,7 @@ async function run(rawInput) {
2367
2434
  // with runtime-constructed paths or by modifying the warning
2368
2435
  // text so the hash changes. The real anchor is external (signed checkpoints + human
2369
2436
  // review). This raises the cost of the burn-through-the-counter escape vector.
2370
- const isHardBlock = result.warnings.some(w => {
2437
+ const isHardBlock = result.activeFlowRun || result.warnings.some(w => {
2371
2438
  if (/\[backstop in warn mode — not blocking\]/.test(w)) return false;
2372
2439
  return HARD_BLOCK.test(w);
2373
2440
  });
@@ -2375,7 +2442,9 @@ async function run(rawInput) {
2375
2442
  // Do NOT clear the streak — keep accumulating so the same hard block stays visible.
2376
2443
  return {
2377
2444
  stdout: rawInput,
2378
- stderr: `${message}\n${gatePrefix} max-blocks reached but the block is a caught false-completion / integrity failure — not auto-releasing; requires a real fix or operator override.`,
2445
+ stderr: result.activeFlowRun
2446
+ ? `${message}\n${gatePrefix} max-blocks reached but canonical Flow remains active — not auto-releasing; complete or explicitly cancel the run.`
2447
+ : `${message}\n${gatePrefix} max-blocks reached but the block is a caught false-completion / integrity failure — not auto-releasing; requires a real fix or operator override.`,
2379
2448
  exitCode: 2,
2380
2449
  };
2381
2450
  }
@@ -40,8 +40,10 @@ Generated by `npm run context-map`. Regenerate after changing agents, skills, sc
40
40
  | Static suite | bash evals/run.sh static |
41
41
  | Integration suite | bash evals/run.sh integration |
42
42
  | Workflow artifacts | npm run workflow:validate-artifacts -- --require-sidecars --require-critique .kontourai/flow-agents/<slug> |
43
- | Workflow sidecars | npm run workflow:sidecar -- --help |
44
- | Claim lookup | npm run workflow:sidecar -- claim <id> <dir> |
43
+ | Workflow control | flow-agents workflow --help |
44
+ | Workflow status | flow-agents workflow status --session-dir .kontourai/flow-agents/<slug> --json |
45
+ | Workflow critique | flow-agents workflow critique --session-dir .kontourai/flow-agents/<slug> --verdict <pass|fail|not_verified> --summary <text> |
46
+ | Workflow verification | flow-agents workflow evidence --session-dir .kontourai/flow-agents/<slug> --expectation tests-evidence --status <pass|fail|not_verified> --command "bash evals/static/test_builder_skill_coherence.sh" --criterion-json '{"id":"AC-1","status":"pass","evidence_refs":[{"kind":"command","excerpt":"bash evals/static/test_builder_skill_coherence.sh","summary":"Exact substantive command run for AC-1."}]}' --evidence-ref-json '{"kind":"artifact","file":".kontourai/flow-agents/<slug>/<slug>--plan-work.md","summary":"Reviewable criterion mapping."}' |
45
47
  | Context map drift | npm run context-map:check |
46
48
  | Bundle build | npm run build:bundles |
47
49
  | Skill drift check | flow-agents skill-drift-check |
@@ -66,26 +68,26 @@ Machine-readable workflow state lives beside Markdown artifacts in `.kontourai/f
66
68
  | workflow-release.schema.json | Flow Agents Workflow Release Readiness | https://flow-agents.dev/schemas/workflow-release.schema.json |
67
69
  | workflow-state.schema.json | Flow Agents Workflow State | https://flow-agents.dev/schemas/workflow-state.schema.json |
68
70
 
69
- Primary tools: `npm run workflow:sidecar`, `npm run workflow:validate-artifacts`, `scripts/hooks/stop-goal-fit.js`, and `scripts/hooks/workflow-steering.js`.
71
+ Primary tools: public `flow-agents workflow`, `trust.bundle`, artifact validation, `scripts/hooks/stop-goal-fit.js`, and `scripts/hooks/workflow-steering.js`. The package-internal writer is not an agent or consumer interface.
70
72
 
71
73
  ## Workflow Skills
72
74
 
73
75
  | Skill | Source | When To Load |
74
76
  | --- | --- | --- |
75
- | continue-work | kits/builder/skills/continue-work/SKILL.md | Advance a multi-slice work item to its next increment via a fresh-context handoff. Use when one or more slices of a multi-slice issue have landed and the next undone slice should be built. Routes the next slice through pull-work + pickup... |
76
- | deliver | kits/builder/skills/deliver/SKILL.md | Delivery workflow selected work to delivered code. Ensures pull-work + pickup-probe preflight, then chains plan-work execute-plan review-work verify-work → loop on failure without requiring user interaction between cleanly determ... |
77
- | evidence-gate | kits/builder/skills/evidence-gate/SKILL.md | Evaluate whether completed work is trustworthy enough for human review, merge, or release. Use after implementation, verify-work, provider checks, CI, or remediation to map acceptance criteria to evidence, inspect scope integrity, classi... |
78
- | execute-plan | kits/builder/skills/execute-plan/SKILL.md | Parallel execution primitive plan artifact path to implemented code via tool-worker (x4). Reads plan directly. Updates session file between waves. |
79
- | fix-bug | kits/builder/skills/fix-bug/SKILL.md | Bug fix orchestrator diagnose plan-work execute-plan → review-work verify-work loop. Diagnosis phase is unique to bugs, then chains the same primitives. |
80
- | gate-review | kits/builder/skills/gate-review/SKILL.md | Enumerate gate fires and suspected misses from the session's Hachure trust.bundle, classify each as correct/false_block/missed_block using Surface's resolveInquiry to produce canonical InquiryRecords, route findings to learning-review, a... |
81
- | idea-to-backlog | kits/builder/skills/idea-to-backlog/SKILL.md | Turn raw product or technical ideas into shaped, prioritized, executable GitHub issue backlog. Use for idea intake, ideation, product shaping, spike/prototype decisions, PRD-like feature briefs, prioritization, and backlog creation befor... |
82
- | learning-review | kits/builder/skills/learning-review/SKILL.md | Capture post-merge, post-deploy, or post-incident learnings and feed them back into backlog, workflow skills, tests, docs, or knowledge. Use after release readiness, post-deploy checks, retrospectives, failed gates, or repeated workflow... |
83
- | plan-work | kits/builder/skills/plan-work/SKILL.md | Code planning primitive goal + directory to structured execution plan. Delegates to tool-planner. No resume, no ideation. |
84
- | pull-work | kits/builder/skills/pull-work/SKILL.md | Select ready GitHub issues from the executable backlog and prepare them for implementation. Use when choosing what to work on next, reviewing a kanban-style issue board, enforcing WIP limits, grouping issues, deciding worktree isolation,... |
85
- | release-readiness | kits/builder/skills/release-readiness/SKILL.md | Decide whether evidence-backed work is ready to merge, release, deploy, or hold. Use after evidence-gate PASS, before merge/release/deploy, and for post-deploy verification planning. |
86
- | review-work | kits/builder/skills/review-work/SKILL.md | Review primitive - run report-only code, security, dependency, architecture/standards, and IaC/policy critique before verification; records findings through the critique artifact/sink, currently critique.json locally. |
87
- | tdd-workflow | kits/builder/skills/tdd-workflow/SKILL.md | Test-driven development RED → GREEN → REFACTOR with git checkpoints. Wraps plan-work execute-plan review-work verify-work with test-first constraints and coverage gates. |
88
- | verify-work | kits/builder/skills/verify-work/SKILL.md | Verification primitive session file path to structured evidence verdict via tool-verifier + tool-playwright. Reads acceptance criteria from plan artifact. |
77
+ | continue-work | kits/builder/skills/continue-work/SKILL.md | Explicit Builder Kit continuation extension. Prepares a fresh-context handoff for the next unfinished increment of a multi-slice Work Item. |
78
+ | deliver | kits/builder/skills/deliver/SKILL.md | Builder Kit build entrypoint. Starts or continues a selected Work Item through builder.build by composing the build primitives without owning their step evidence. |
79
+ | evidence-gate | kits/builder/skills/evidence-gate/SKILL.md | Assess whether verification evidence and scope integrity support merge review. Produces a confidence report and Builder merge-readiness evidence. |
80
+ | execute-plan | kits/builder/skills/execute-plan/SKILL.md | Execution primitive that turns a structured plan into implemented scope through tool-worker delegation. |
81
+ | fix-bug | kits/builder/skills/fix-bug/SKILL.md | Bug-fix profile for builder.build. Adds disciplined diagnosis and regression-focused verification without replacing the build primitives. |
82
+ | gate-review | kits/builder/skills/gate-review/SKILL.md | Explicit advisory extension for reviewing apparent workflow gate blocks or misses from a completed trust bundle. |
83
+ | idea-to-backlog | kits/builder/skills/idea-to-backlog/SKILL.md | Turn raw product or technical ideas into a shaped, prioritized, provider-neutral executable backlog before implementation starts. |
84
+ | learning-review | kits/builder/skills/learning-review/SKILL.md | Capture delivery decisions, outcomes, and routed follow-up. Records Builder publish-learn learning evidence in trust.bundle. |
85
+ | plan-work | kits/builder/skills/plan-work/SKILL.md | Code planning primitive that turns a goal and directory into a structured implementation plan. |
86
+ | pull-work | kits/builder/skills/pull-work/SKILL.md | Select ready provider-backed work and prepare a bounded implementation handoff. |
87
+ | release-readiness | kits/builder/skills/release-readiness/SKILL.md | Make a provider-neutral merge, release, deploy, or hold decision. Records Builder publish-learn CI merge-readiness in trust.bundle. |
88
+ | review-work | kits/builder/skills/review-work/SKILL.md | Report-only critique before Builder verification. Records a critique slice through the public workflow interface without claiming Flow completion. |
89
+ | tdd-workflow | kits/builder/skills/tdd-workflow/SKILL.md | Test-first profile for builder.build. Requires observable RED, GREEN, and appropriate REFACTOR evidence through the standard build primitives. |
90
+ | verify-work | kits/builder/skills/verify-work/SKILL.md | Report-only acceptance verification. Records command-backed Builder verification evidence in trust.bundle when bound to an active run. |
89
91
 
90
92
  ## Support Skills
91
93
 
@@ -93,14 +95,14 @@ Primary tools: `npm run workflow:sidecar`, `npm run workflow:validate-artifacts`
93
95
  | --- | --- | --- |
94
96
  | agentic-engineering | skills/agentic-engineering/SKILL.md | Eval-first execution, task decomposition, and cost-aware model routing for AI-driven development workflows. |
95
97
  | browser-test | skills/browser-test/SKILL.md | Headless browser automation via Playwright — screenshots, accessibility checks, form filling, UI testing, DOM inspection. |
96
- | builder-shape | kits/builder/skills/builder-shape/SKILL.md | Invoke Builder Kit shape from a raw idea or the current conversation context without requiring the user to name idea-to-backlog. Delegates shaping to idea-to-backlog, records the Builder Kit Flow Definition link, and stops at the backlog... |
98
+ | builder-shape | kits/builder/skills/builder-shape/SKILL.md | Builder Kit shaping entrypoint. Turns a raw idea into a provider-neutral, reviewable backlog proposal and stops before build selection unless the user explicitly continues. |
97
99
  | dependency-update | skills/dependency-update/SKILL.md | Analyze and upgrade project dependencies — latest versions, security vulnerabilities, actionable update plan across all package managers. |
98
- | design-probe | kits/builder/skills/design-probe/SKILL.md | Generic one-question-at-a-time design probing interview for turning unclear goals, designs, or workflow states into shared understanding before planning or execution. |
100
+ | design-probe | kits/builder/skills/design-probe/SKILL.md | Generic one-question-at-a-time design probe for turning unclear goals, designs, and handoffs into shared understanding. |
99
101
  | eval-rebuild | skills/eval-rebuild/SKILL.md | Project-specific build and install commands for the eval feedback loop. Injected into eval-builder agent. Replace this skill for different build systems. |
100
102
  | exemption-usage-review | kits/veritas-governance/skills/exemption-usage-review/SKILL.md | Periodic audit of standing delivery/DECLARED no-agent-delivery exemptions (ADR 0022 §3): lists every current exemption's scope, reason, approver, and age since declared_at, flags entries overdue for owner re-confirmation against a config... |
101
103
  | github-cli | skills/github-cli/SKILL.md | Interact with GitHub via gh CLI — PRs, issues, repos, releases, workflows, gists. |
102
104
  | knowledge-capture | kits/knowledge/skills/knowledge-capture/SKILL.md | Save durable knowledge, lightweight pointers, user corrections, decisions, lessons, relationship context, or source references into the knowledge base. Use when the user says save, remember, capture, file this, bookmark context, or when... |
103
- | pickup-probe | kits/builder/skills/pickup-probe/SKILL.md | Builder Kit work-item/docs/provider-grounded Probe specialization used at the design-probe flow step before plan-work. |
105
+ | pickup-probe | kits/builder/skills/pickup-probe/SKILL.md | Provider-grounded pickup probe used at the Builder design-probe step before planning. |
104
106
  | search-first | skills/search-first/SKILL.md | Research-before-coding workflow. Search for existing tools, libraries, and patterns before writing custom code. |
105
107
 
106
108
  ## Agents
@@ -108,7 +108,7 @@ flowchart TB
108
108
 
109
109
  **Current state:** The durable handoff surface is a pair of human-readable Markdown artifacts and machine-readable JSON sidecars under `.kontourai/flow-agents/<slug>/`. Verification, critique, release, and learning records are explicit artifacts rather than hidden chat memory.
110
110
 
111
- **Programmatic API (for native hosts):** The canonical sidecar writer/validator is importable as a library, not only via the `flow-agents-workflow-sidecar` CLI. A host that records workflow evidence natively should import the package root rather than reimplement validated read / merge / write:
111
+ **Programmatic API (for native hosts):** The canonical Builder runtime and sidecar writer/validator remain importable from the package root so a native host does not reimplement validated workflow mutation. Agent-facing Kit guidance uses the public `flow-agents workflow` command so gate ownership, assignment checks, command observation, and projection happen through one portable interface:
112
112
 
113
113
  ```js
114
114
  import {
@@ -30,7 +30,15 @@ For a normal Codex global install, target the Codex home instead of a project wo
30
30
  npx @kontourai/flow-agents init --runtime codex --global --activate-kits --yes
31
31
  ```
32
32
 
33
- That installs into `CODEX_HOME` when it is set, otherwise `~/.codex`. Use `--dest /path/to/codex-home` only when you need an explicit override for an isolated install, CI fixture, or test.
33
+ That splits installation by ownership: Codex-only runtime assets go into `CODEX_HOME` when set (otherwise `~/.codex`), while portable skills go into Codex's documented user catalog at `$HOME/.agents/skills`. A repository bundle install similarly exposes skills at `<repo>/.agents/skills`.
34
+
35
+ Pass a positional runtime destination and `--skills-dir PATH` when both roots must be isolated, or set `FLOW_AGENTS_SKILLS_DIR` for headless environments:
36
+
37
+ ```bash
38
+ bash scripts/install-codex-home.sh /tmp/codex-home --skills-dir /tmp/agents/skills
39
+ ```
40
+
41
+ Installer output reports both destinations. Reinstall preserves unknown user skills and migrates only unchanged Flow Agents-owned files from the former `CODEX_HOME/skills` layout; modified legacy content is retained. Flow Agents intentionally does not create a compatibility symlink because the Codex runtime home must not own or mask a universal user catalog, and the installer refuses to write through symlinked destinations.
34
42
 
35
43
  Keep generated Codex base config lean. Put profile-specific model, provider, and approval settings in separate `<profile>.config.toml` files and select them with `codex --profile <name>`.
36
44
 
@@ -13,26 +13,93 @@ flow_agents() (
13
13
  root=$(mktemp -d) || exit 1
14
14
  trap 'rm -rf "$root"' EXIT HUP INT TERM
15
15
  npm exec --yes --prefix "$root" \
16
- --package=@kontourai/flow-agents@3.5.0 -- flow-agents "$@"
16
+ --package=@kontourai/flow-agents@3.6.0 -- flow-agents "$@"
17
17
  )
18
18
 
19
19
  flow_agents workflow start \
20
20
  --flow builder.build \
21
- --work-item owner/repository#123
21
+ --work-item provider:work-item-123 \
22
+ --assignment-provider example-provider \
23
+ --effective-state-json .kontourai/flow-agents/provider-assignment.json
22
24
 
23
25
  flow_agents workflow status --json
24
26
 
25
27
  flow_agents workflow evidence \
28
+ --session-dir .kontourai/flow-agents/example \
26
29
  --expectation implementation-plan \
27
30
  --status pass \
28
31
  --summary "Implementation plan recorded." \
29
- --evidence-ref-json '{"kind":"artifact","file":".kontourai/flow-agents/example/example--plan.md"}'
32
+ --evidence-ref-json '{"kind":"artifact","file":".kontourai/flow-agents/example/example--plan-work.md","summary":"Reviewed implementation plan with Definition Of Done and task-to-criterion mapping."}' \
33
+ --evidence-ref-json '{"kind":"artifact","file":".kontourai/flow-agents/example/acceptance.json","summary":"Stable acceptance criteria and required evidence."}' \
34
+ --evidence-ref-json '{"kind":"artifact","file":".kontourai/flow-agents/example/handoff.json","summary":"Execution handoff and next action."}'
35
+
36
+ flow_agents workflow critique \
37
+ --session-dir .kontourai/flow-agents/example \
38
+ --verdict pass \
39
+ --summary "Report-only review found no blocking findings." \
40
+ --artifact-ref ".kontourai/flow-agents/example/example--deliver.md" \
41
+ --lane-json '{"id":"code-review","status":"pass","summary":"The delivered implementation was reviewed.","evidence_refs":[{"kind":"artifact","file":".kontourai/flow-agents/example/example--deliver.md","summary":"Reviewed delivery report and changed scope."}]}'
42
+ ```
43
+
44
+ `builder.build` accepts the stable, human-readable Work Item reference emitted by the selected
45
+ provider adapter. Flow Agents persists that exact reference as the run subject; it does not infer
46
+ provider identity from a GitHub-shaped string. Pass the resolved `--assignment-provider`; non-local
47
+ providers also pass their standard assignment status result through `--effective-state-json`.
48
+ Flow Agents verifies that the current actor is the confirmed holder, retains that provider result
49
+ as selected-work evidence, and creates a local runtime lease mirror for atomic session mutation.
50
+ A direct local request can resume an existing bound session, but the public CLI does not invent a
51
+ provider or create an unresolvable local binding.
52
+
53
+ `builder.shape` uses a caller-supplied, safe slug. Derive it from a selected
54
+ title using lowercase ASCII words separated by single hyphens. Never inject raw
55
+ request text into a shell command or use it as a slug:
56
+
57
+ ```bash
58
+ flow_agents workflow start --flow builder.shape \
59
+ --task-slug onboarding-alerts \
60
+ --summary "Shape onboarding alerts into independently actionable slices."
61
+ flow_agents workflow status --session-dir .kontourai/flow-agents/onboarding-alerts --json
62
+ ```
63
+
64
+ For `tests-evidence`, supply one criterion object for every accepted criterion
65
+ and one or more substantive commands that were actually run. Repeat `--command`
66
+ when criteria require different checks. Every command needs a matching
67
+ top-level command reference, and every passing criterion must cite at least one
68
+ of those exact commands. A passing observation must also report a positive executed-test or
69
+ assertion count; a successful zero-test run is rejected. Do not use placeholders such as `true`
70
+ or a version command as behavior proof:
71
+
72
+ ```bash
73
+ flow_agents workflow evidence \
74
+ --session-dir .kontourai/flow-agents/example \
75
+ --expectation tests-evidence \
76
+ --status pass \
77
+ --command "npm test" \
78
+ --summary "The project test command passed for the implemented criterion." \
79
+ --evidence-ref-json '{"kind":"command","excerpt":"npm test","summary":"Exact substantive project test command recorded for this verification result."}' \
80
+ --criterion-json '{"id":"<criterion-id>","status":"pass","evidence_refs":[{"kind":"command","excerpt":"npm test","summary":"Exact substantive project test command run for this criterion."}]}' \
81
+ --evidence-ref-json '{"kind":"artifact","file":".kontourai/flow-agents/example/example--plan-work.md","summary":"Accepted criterion and verification mapping."}'
30
82
  ```
31
83
 
32
84
  The public lifecycle verbs are `pause`, `resume`, `release`, `cancel`, and `archive`. Pause,
33
- resume, and release require the current assignment actor and an explicit reason. Cancel and
85
+ resume, and release require the current assignment actor and an explicit reason. `critique`
86
+ records the `clean-critique` claim but does not independently attach it to Flow or advance a gate. Cancel and
34
87
  archive require a signed user/operator authorization file. Flow owns the canonical run
35
88
  transition; Flow Agents validates assignment and request binding and projects the resulting run.
89
+ Critique derives reviewer identity from the calling runtime actor. An active
90
+ implementation assignment is required, and its actor cannot review its own
91
+ work; the delegated reviewer invokes the command directly under a distinct
92
+ identity. The public interface does not accept a caller-selected reviewer
93
+ label. Every critique includes an explicit verdict, at least one substantive
94
+ `--lane-json`, and local reviewed `--artifact-ref` values. Passing critiques
95
+ require every lane to pass; reviewed files and the workspace snapshot are
96
+ hashed into the stored review target so later implementation changes invalidate
97
+ stale clean critiques.
98
+
99
+ Current local runtime actor IDs provide coordination-level separation, not a
100
+ cryptographic identity guarantee. A policy that requires externally attested
101
+ reviewer identity must keep that assurance `NOT_VERIFIED` until the runtime
102
+ supplies a trusted delegation credential.
36
103
 
37
104
  ```bash
38
105
  flow_agents workflow pause --reason "Waiting for a decision"
@@ -43,7 +110,8 @@ flow_agents workflow archive --authorization-file archive.json
43
110
  ```
44
111
 
45
112
  `workflow status` is read-only. It reads the actor-scoped current-session pointer, the projected
46
- state, and the canonical Flow run without rewriting either store.
113
+ state, and the canonical Flow run without rewriting either store. Its `next_action` is freshly
114
+ derived from the canonical run, so a stale sidecar projection cannot misdirect recovery.
47
115
 
48
116
  ## Compatibility Doctor
49
117
 
@@ -59,5 +127,6 @@ Flow runtime and definition, workflow-state schema, and trust-bundle schema. Inc
59
127
  missing installed components produce a nonzero exit and an exact, version-pinned `init` command
60
128
  that preserves the recorded runtime and active Kits.
61
129
 
62
- The `flow-agents-workflow-sidecar` binary is deprecated and retained only while package-internal
63
- callers migrate. New consumer guidance must use `flow-agents workflow`.
130
+ The package may use lower-level writer modules internally. They are not a
131
+ supported consumer or skill surface. Consumer guidance and Builder skills use
132
+ `flow-agents workflow` exclusively.
@@ -8,13 +8,39 @@ This map groups the current skills by the user journey they support. The Builder
8
8
 
9
9
  For practical operator instructions and copy/paste prompts, see https://github.com/kontourai/flow-agents/blob/main/docs/workflow-usage-guide.md. For the shared cross-distribution contracts behind the workflow artifacts and gates, see https://github.com/kontourai/flow-agents/blob/main/docs/workflow-shared-contracts.md.
10
10
 
11
+ ## Builder Skill Roles
12
+
13
+ `kits/builder/kit.json` is the machine-readable source for skill activation.
14
+ Flow Definitions own step order, gates, route-backs, and trust expectations;
15
+ the role matrix only maps each skill to that Flow-owned behavior.
16
+
17
+ | Role | Skills | Activation |
18
+ | --- | --- | --- |
19
+ | Entrypoint | `builder-shape`, `deliver` | User selects the Builder product workflow; the skill coordinates but owns no step evidence. |
20
+ | Profile | `fix-bug`, `tdd-workflow` | Explicit workflow variant; never selected as an automatic step action. |
21
+ | Step producer | `idea-to-backlog`, `pull-work`, `pickup-probe`, `plan-work`, `execute-plan`, `review-work`, `verify-work`, `evidence-gate`, `release-readiness`, `learning-review` | Activated only for its declared Flow step; publishes only its declared expectations. |
22
+ | Shared primitive | `design-probe` | Reused interview behavior with no Builder expectation ownership. |
23
+ | Extension | `continue-work`, `gate-review` | Explicit continuation or retrospective operation outside automatic step actions. |
24
+
25
+ Within the active `verify` step, `review-work` owns `clean-critique`: it records
26
+ a report-only critique slice in `trust.bundle`. `verify-work` owns
27
+ `acceptance-criteria`, `tests-evidence`, and applicable `policy-compliance`
28
+ through command-backed behavior evidence. Use the public `flow-agents workflow`
29
+ CLI for run status, evidence, and critique; skills must not call the
30
+ package-internal writer directly.
31
+
32
+ `builder.build` accepts exactly two public Work Item reference forms:
33
+ `provider:id` and `owner/repo#numeric-id`. The latter is the GitHub-compatible
34
+ adapter form; GitHub remains an optional adapter example. Do not invent
35
+ arbitrary reference formats.
36
+
11
37
  - `builder-shape`: product-level Builder Kit shape invocation that guides `idea-to-backlog` without requiring the user to name the primitive, links `kits/builder/flows/shape.flow.json`, and stops at the backlog gate unless issue sync is explicit.
12
- - `idea-to-backlog`: discovery, idea separation, thinnest meaningful slice, shaping, prioritization, and executable GitHub issue creation.
38
+ - `idea-to-backlog`: discovery, idea separation, thinnest meaningful slice, shaping, prioritization, and executable provider-backed work items; GitHub is an optional adapter.
13
39
  - `pull-work`: dynamic backlog selection, grouping/dependency checks, WIP awareness, worktree decision, and execution handoff; in Builder Kit build, every selected item or justified group needs fresh pickup Probe evidence before planning.
14
40
  - `design-probe`: generic one-question-at-a-time probing interview; Builder Kit uses this step before planning when the build flow needs shared understanding or a pickup decision.
15
41
  - `pickup-probe`: Builder Kit specialization of `design-probe` for selected work items; records scope, provider state, WIP/conflict scans, risks, decisions, unresolved questions, accepted gaps, and planning readiness.
16
42
  - `plan-work` / `execute-plan` / `deliver`: Definition Of Done, execution orchestration, and local delivery closure.
17
- - `continue-work`: advance a multi-slice work item to its next increment via a fresh-context handoff; restores the durable record (resume surface), derives the next undone slice from the issue plus merged PRs, and routes that slice **through** `pull-work` + `pickup-probe` (never around the gate) before handing off fresh per ADR 0013.
43
+ - `continue-work`: advance a multi-slice work item to its next increment via an ephemeral fresh-context handoff; derives the next undone slice from the Work Item plus completed changes, then routes it **through** `pull-work` + `pickup-probe` before handing off fresh per ADR 0013.
18
44
  - `review-work`: report-only critique for quality, security triggers, architecture fit, and standards findings.
19
45
  - `verify-work`: behavior evidence mapped to acceptance criteria and Goal Fit.
20
46
  - `evidence-gate`: trust assessment for completed work: acceptance evidence, integrity checks, CI confidence, and next step.
@@ -35,7 +61,7 @@ flowchart LR
35
61
  Publish[publish-change<br/>commit / push / PR / CI]
36
62
  Release[release-readiness<br/>merge / release / deploy / docs decision]
37
63
  Learn[learning-review<br/>route follow-ups]
38
- Backlog[(GitHub issues)]
64
+ Backlog[(Provider-backed work items)]
39
65
 
40
66
  Idea --> Shape --> Backlog --> Pickup --> Probe --> Build --> Review --> Verify --> GoalFit --> Trust --> Publish --> Release --> Learn
41
67
  Probe -->|not needed| Build
@@ -58,8 +84,8 @@ The operating model now has first-class coverage from idea intake through truste
58
84
  - Design probing is a generic skill named `design-probe`; in the Builder Kit build flow the step is still named `design-probe`, and the `pickup-probe` specialization records selected-work readiness before planning. `decision_gap` route-backs return there for missing pickup/planning decisions.
59
85
  - Product-level Builder Kit build may guide `pull-work -> design-probe / pickup-probe -> plan-work`; direct primitives still stop at their own gates and report the expected next step.
60
86
  - Broad continuation language does not carry across newly selected work after merge. Queue inspection is allowed, but planning the next item requires a fresh pickup Probe record.
61
- - Critique is owned by `review-work` and persisted in `critique.json`.
62
- - Verification is owned by `verify-work` and persisted in `evidence.json`.
87
+ - Critique is owned by `review-work` as `clean-critique`, recorded directly by a delegated reviewer whose runtime identity differs from the active implementation actor, and stored through public `workflow critique` in its `trust.bundle` slice before verification.
88
+ - Verification is owned by `verify-work` as `acceptance-criteria`, `tests-evidence`, and applicable `policy-compliance`, recorded as command-backed `trust.bundle` evidence with one criterion JSON record for every accepted criterion.
63
89
  - Trust evidence is assessed by `evidence-gate`; it decides whether completed work has enough proof and integrity to publish or continue fixing.
64
90
  - Publishing verified changes is the bridge between evidence and release readiness: commit the verified diff, push the branch, open or update the PR, and collect PR/CI evidence.
65
91
  - Merge/release/deploy decisioning is owned by `release-readiness` after the publish-change gate.
@@ -80,18 +106,18 @@ This view shows how each phase is composed. The left rail is the durable phase s
80
106
  <div class="phase-step"><span>01</span><strong>Discovery & shaping</strong></div>
81
107
  <div class="phase-lanes">
82
108
  <section class="phase-lane phase-lane--primary"><h3>Primary</h3><p><code>builder-shape</code> <code>idea-to-backlog</code></p></section>
83
- <section class="phase-lane"><h3>Support</h3><p><code>search-first</code> <code>explore</code> <code>frontend-design</code> <code>github-cli</code> <code>knowledge-capture</code></p></section>
109
+ <section class="phase-lane"><h3>Support</h3><p><code>search-first</code> <code>explore</code> <code>frontend-design</code> optional <code>github-cli</code> adapter <code>knowledge-capture</code></p></section>
84
110
  <section class="phase-lane"><h3>Nested sections / future primitives</h3><p>intake/dedupe, separate ideas, thinnest meaningful slice, opportunity review, explore options, <code>shape-work</code>, prioritize work, sync executable backlog</p></section>
85
- <section class="phase-lane phase-lane--gate"><h3>Gate & artifact</h3><p>Idea, slice, shape, and backlog gates. Writes shaped briefs and GitHub issue links in <code>.kontourai/flow-agents/&lt;slug&gt;/</code>.</p></section>
111
+ <section class="phase-lane phase-lane--gate"><h3>Gate & artifact</h3><p>Idea, slice, shape, and backlog gates. Writes shaped briefs and provider work-item refs in <code>.kontourai/flow-agents/&lt;slug&gt;/</code>.</p></section>
86
112
  </div>
87
113
  </article>
88
114
  <article class="phase-row">
89
115
  <div class="phase-step"><span>02</span><strong>Backlog pickup</strong></div>
90
116
  <div class="phase-lanes">
91
117
  <section class="phase-lane phase-lane--primary"><h3>Primary</h3><p><code>pull-work</code></p></section>
92
- <section class="phase-lane"><h3>Support</h3><p><code>github-cli</code></p></section>
118
+ <section class="phase-lane"><h3>Support</h3><p>optional <code>github-cli</code> adapter</p></section>
93
119
  <section class="phase-lane"><h3>Nested sections / future primitives</h3><p>board snapshot, WIP check, grouping/dependency check, pickup Probe decision, worktree decision, <code>plan-work</code> handoff</p></section>
94
- <section class="phase-lane phase-lane--gate"><h3>Gate & artifact</h3><p>Pickup gate and pickup Probe handoff. Writes selected issues, blockers, bundle justification, provider state, accepted gaps, worktree policy, expected modified files, conflict risks, and handoff notes.</p></section>
120
+ <section class="phase-lane phase-lane--gate"><h3>Gate & artifact</h3><p>Pickup gate and pickup Probe handoff. Writes selected work items, blockers, bundle justification, provider state, accepted gaps, worktree policy, expected modified files, conflict risks, and handoff notes.</p></section>
95
121
  </div>
96
122
  </article>
97
123
  <article class="phase-row">
@@ -107,9 +133,9 @@ This view shows how each phase is composed. The left rail is the durable phase s
107
133
  <div class="phase-step"><span>04</span><strong>Evidence & release</strong></div>
108
134
  <div class="phase-lanes">
109
135
  <section class="phase-lane phase-lane--primary"><h3>Primary</h3><p><code>evidence-gate</code> <code>release-readiness</code></p></section>
110
- <section class="phase-lane"><h3>Support</h3><p><code>github-cli</code> <code>eval-rebuild</code></p></section>
136
+ <section class="phase-lane"><h3>Support</h3><p>optional <code>github-cli</code> adapter <code>eval-rebuild</code></p></section>
111
137
  <section class="phase-lane"><h3>Nested sections / future primitives</h3><p>criteria-to-evidence map, CI confidence, <code>scope-and-integrity-check</code>, publish-change, rollback review, observability review, post-deploy plan, final acceptance docs, remediate-ci</p></section>
112
- <section class="phase-lane phase-lane--gate"><h3>Gate & artifact</h3><p>Evidence, publish-change, release, and docs gates. Writes confidence, integrity, commit/branch/PR/CI links, release scope, risk, rollback, deploy-readiness decisions, and durable documentation links.</p></section>
138
+ <section class="phase-lane phase-lane--gate"><h3>Gate & artifact</h3><p>Evidence, publish-change, release, and docs gates. Writes confidence, integrity, commit/branch/provider-change/CI links, release scope, risk, rollback, deploy-readiness decisions, and durable documentation links.</p></section>
113
139
  </div>
114
140
  </article>
115
141
  <article class="phase-row">
@@ -125,10 +151,10 @@ This view shows how each phase is composed. The left rail is the durable phase s
125
151
 
126
152
  | Phase | Primary workflow skill | Supporting skills | Nested sections / future primitive candidates |
127
153
  | --- | --- | --- | --- |
128
- | Idea discovery and shaping | `builder-shape`, `idea-to-backlog` | `search-first`, `explore`, `frontend-design`, `github-cli`, `knowledge-capture` | intake/dedupe, separate ideas, thinnest meaningful slice, opportunity review, explore options, shape work, prioritize work, sync executable backlog |
129
- | Backlog pickup | `pull-work` | `github-cli` | board snapshot, WIP check, grouping/dependency check, Probe decision, worktree decision, handoff |
154
+ | Idea discovery and shaping | `builder-shape`, `idea-to-backlog` | `search-first`, `explore`, `frontend-design`, optional `github-cli` adapter, `knowledge-capture` | intake/dedupe, separate ideas, thinnest meaningful slice, opportunity review, explore options, shape work, prioritize work, sync executable backlog |
155
+ | Backlog pickup | `pull-work` | optional `github-cli` adapter | board snapshot, WIP check, grouping/dependency check, Probe decision, worktree decision, handoff |
130
156
  | Execution planning and build | `design-probe`, `pickup-probe`, `plan-work`, `execute-plan`, `review-work`, `verify-work` | `feedback-loop`, `browser-test`, `deliver`, `fix-bug`, `tdd-workflow` | Probe notes, Builder Kit Probe record, Definition Of Done, execution plan, parallel waves, implementation session state, critique report, verification report, Goal Fit Gate |
131
- | Evidence and release confidence | `evidence-gate`, `release-readiness` | `github-cli`, `eval-rebuild` | criteria-to-evidence map, CI confidence, scope/integrity check, publish-change, rollback review, observability review, final acceptance docs, post-deploy plan |
157
+ | Evidence and release confidence | `evidence-gate`, `release-readiness` | optional `github-cli` adapter, `eval-rebuild` | criteria-to-evidence map, CI confidence, scope/integrity check, publish-change, rollback review, observability review, final acceptance docs, post-deploy plan |
132
158
  | Learning and improvement | `learning-review` | `knowledge-capture`, `idea-to-backlog`, `eval-rebuild` | facts vs interpretation, docs promotion review, follow-up routing, knowledge updates, eval/skill/backlog improvements |
133
159
 
134
160
  The highest-leverage future extractions are likely `shape-work`, `test-map`, `scope-and-integrity-check`, and `remediate-ci`. They are still nested because their behavior is present, but not yet large enough to need separate activation contracts.
@@ -137,28 +163,26 @@ The highest-leverage future extractions are likely `shape-work`, `test-map`, `sc
137
163
 
138
164
  Each workflow phase ends with an explicit gate and durable artifact:
139
165
 
140
- - `builder-shape` invokes Builder Kit shape, delegates to `idea-to-backlog`, links `kits/builder/flows/shape.flow.json`, and writes the standard `.kontourai/flow-agents/<slug>/<slug>--idea-to-backlog.md` artifact.
141
- - `idea-to-backlog` writes `.kontourai/flow-agents/<slug>/<slug>--idea-to-backlog.md` and produces shaped briefs plus GitHub issue links.
142
- - `pull-work` writes `.kontourai/flow-agents/<slug>/<slug>--pull-work.md` with selected issues, WIP notes, blockers, pickup Probe decisions or accepted gaps, worktree decision, expected modified files, conflict risks, and a `plan-work` handoff.
143
- - `plan-work` and `deliver` write `.kontourai/flow-agents/<slug>/<slug>--*.md` artifacts with `Definition Of Done`, `Goal Fit Gate`, and `Final Acceptance` sections.
144
- - `review-work` writes reviewer artifacts when available and updates `critique.json` with quality, security, architecture, standards, and resolution state.
145
- - `verify-work` writes verification artifacts and updates `evidence.json` with behavior evidence mapped to acceptance criteria.
146
- - `evidence-gate` writes `.kontourai/flow-agents/<slug>/<slug>--evidence-gate.md` with acceptance evidence, CI summary, integrity report, verdict, and next step.
147
- - `release-readiness` writes `.kontourai/flow-agents/<slug>/<slug>--release-readiness.md` with release scope, evidence reference, risk review, operational plan, rollback plan, observability plan, post-deploy checks, and decision.
148
- - `learning-review` writes `.kontourai/flow-agents/<slug>/<slug>--learning-review.md` with outcomes, evidence, decisions, gaps, follow-ups, knowledge updates, and verdict.
166
+ - `builder-shape` selects a safe-slugged public shape run and delegates to `idea-to-backlog`.
167
+ - `idea-to-backlog` owns `<slug>--idea-to-backlog.md` and the `builder.shape` slices in `trust.bundle`.
168
+ - `pull-work` and `pickup-probe` own the selected-work and Probe sections of `<slug>--pull-work.md` plus their `trust.bundle` slices.
169
+ - `plan-work` owns `<slug>--plan-work.md`, `acceptance.json`, `handoff.json`, and its `trust.bundle` plan slice; `execute-plan` owns the session execution report, `state.json`, and its scope slice.
170
+ - `review-work` records report-only critique through public `workflow critique` and owns `clean-critique`.
171
+ - `verify-work` records command-backed `acceptance-criteria`, `tests-evidence`, and applicable `policy-compliance` evidence in `trust.bundle`.
172
+ - `evidence-gate` owns `<slug>--evidence-gate.md`; `release-readiness` owns `release.json`; `learning-review` owns `learning.json`; each also records its declared `trust.bundle` slice.
149
173
 
150
174
  Core gates:
151
175
 
152
176
  - Idea Gate: raw input is deduped, classified, and routed.
153
177
  - Slice Gate: each candidate has one outcome, one thinnest meaningful slice, and explicit split/bundle/dependency reasoning.
154
178
  - Shape Gate: scope, non-goals, risk, rollout notes, and acceptance criteria are stable enough.
155
- - Backlog Gate: GitHub issues represent executable or near-executable work.
179
+ - Backlog Gate: provider-backed work items represent executable or near-executable work; GitHub issues are an optional adapter example.
156
180
  - Pickup Gate: selected work is ready, WIP is acceptable, and worktree policy is recorded.
157
181
  - Review Gate: report-only reviewers have no open blocking findings, or findings are explicitly accepted/deferred/false positive.
158
182
  - Verification Gate: implementation evidence exists from local, automated, browser, or runtime checks.
159
183
  - Goal Fit Gate: the original user outcome is satisfied, gaps are explicit, and local/project/global scope is clear.
160
184
  - Evidence Gate: acceptance criteria are mapped to falsifiable evidence and scope integrity is checked.
161
- - Publish Change Gate: verified changes are committed, pushed, represented by a PR or explicit no-PR decision, and PR checks/CI are linked.
185
+ - Publish Change Gate: verified changes are committed, pushed, represented by a provider change record or explicit no-provider-change decision, and available provider checks/CI are linked.
162
186
  - Release Gate: CI, docs, rollout, rollback, observability, and owner concerns are addressed for the risk class.
163
187
  - Docs Gate: accepted planning artifacts are archived and promoted into durable docs when useful.
164
188
  - Learning Gate: failures and recurring patterns are routed to tests, evals, skills, backlog, or knowledge capture.
@@ -169,7 +193,7 @@ Core gates:
169
193
  flowchart LR
170
194
  Idea[Idea / vague goal]
171
195
  BacklogSkill[idea-to-backlog]
172
- Issue[Executable GitHub issue]
196
+ Issue[Executable provider-backed work item]
173
197
  Pull[pull-work]
174
198
  Probe[design-probe]
175
199
  Worktree[worktree decision]
@@ -203,7 +227,7 @@ Workflow evals are layered to match this map:
203
227
 
204
228
  - Static contract evals guard non-negotiable skill boundaries.
205
229
  - Behavioral activation evals check that agents choose the right workflow and stop at gates.
206
- - Artifact quality evals inspect durable session artifacts and GitHub issue drafts.
230
+ - Artifact quality evals inspect durable session artifacts and provider work-item drafts; GitHub is an optional adapter example.
207
231
  - Adversarial evals exercise premature coding, vague issues, missing CI, weakened tests, and prototype promotion risks.
208
232
  - End-to-end evals cover `idea-to-backlog -> pull-work -> design-probe -> plan-work -> execute-plan -> review-work -> verify-work -> goal-fit -> evidence-gate` selectively.
209
233