@kontourai/flow-agents 3.6.0 → 3.7.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 (86) hide show
  1. package/CHANGELOG.md +7 -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 +308 -47
  6. package/build/src/cli/assignment-provider.d.ts +4 -7
  7. package/build/src/cli/assignment-provider.js +67 -13
  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 +801 -97
  11. package/build/src/cli/workflow.js +290 -42
  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/generate-context-map.js +5 -3
  18. package/context/scripts/hooks/lib/kit-catalog.js +1 -1
  19. package/context/scripts/hooks/stop-goal-fit.js +78 -9
  20. package/docs/context-map.md +22 -20
  21. package/docs/developer-architecture.md +1 -1
  22. package/docs/public-workflow-cli.md +76 -7
  23. package/docs/skills-map.md +51 -27
  24. package/docs/spec/builder-flow-runtime.md +41 -40
  25. package/docs/workflow-usage-guide.md +109 -42
  26. package/evals/fixtures/hook-influence/cases.json +2 -2
  27. package/evals/integration/test_builder_entry_enforcement.sh +52 -41
  28. package/evals/integration/test_builder_step_producers.sh +297 -6
  29. package/evals/integration/test_bundle_install.sh +212 -63
  30. package/evals/integration/test_critique_supersession_roundtrip.sh +21 -8
  31. package/evals/integration/test_current_json_per_actor.sh +12 -0
  32. package/evals/integration/test_dual_emit_flow_step.sh +62 -43
  33. package/evals/integration/test_flowdef_session_activation.sh +145 -25
  34. package/evals/integration/test_flowdef_session_history_preservation.sh +23 -21
  35. package/evals/integration/test_gate_lockdown.sh +3 -5
  36. package/evals/integration/test_goal_fit_hook.sh +60 -2
  37. package/evals/integration/test_liveness_verdict.sh +14 -17
  38. package/evals/integration/test_phase_map_and_gate_claim.sh +63 -38
  39. package/evals/integration/test_public_workflow_cli.sh +325 -11
  40. package/evals/integration/test_pull_work_liveness_preflight.sh +22 -66
  41. package/evals/integration/test_sidecar_field_preservation.sh +36 -11
  42. package/evals/integration/test_workflow_sidecar_writer.sh +277 -44
  43. package/evals/integration/test_workflow_steering_hook.sh +15 -38
  44. package/evals/run.sh +2 -0
  45. package/evals/static/test_builder_skill_coherence.sh +247 -0
  46. package/evals/static/test_library_exports.sh +5 -2
  47. package/evals/static/test_workflow_skills.sh +13 -325
  48. package/kits/builder/flows/build.flow.json +22 -0
  49. package/kits/builder/flows/shape.flow.json +9 -9
  50. package/kits/builder/kit.json +70 -16
  51. package/kits/builder/skills/builder-shape/SKILL.md +75 -75
  52. package/kits/builder/skills/continue-work/SKILL.md +45 -106
  53. package/kits/builder/skills/deliver/SKILL.md +96 -442
  54. package/kits/builder/skills/design-probe/SKILL.md +40 -139
  55. package/kits/builder/skills/evidence-gate/SKILL.md +59 -201
  56. package/kits/builder/skills/execute-plan/SKILL.md +54 -125
  57. package/kits/builder/skills/fix-bug/SKILL.md +42 -132
  58. package/kits/builder/skills/gate-review/SKILL.md +60 -211
  59. package/kits/builder/skills/idea-to-backlog/SKILL.md +63 -244
  60. package/kits/builder/skills/learning-review/SKILL.md +63 -170
  61. package/kits/builder/skills/pickup-probe/SKILL.md +54 -111
  62. package/kits/builder/skills/plan-work/SKILL.md +51 -185
  63. package/kits/builder/skills/pull-work/SKILL.md +136 -485
  64. package/kits/builder/skills/release-readiness/SKILL.md +66 -107
  65. package/kits/builder/skills/review-work/SKILL.md +89 -176
  66. package/kits/builder/skills/tdd-workflow/SKILL.md +53 -147
  67. package/kits/builder/skills/verify-work/SKILL.md +101 -113
  68. package/package.json +2 -2
  69. package/scripts/hooks/lib/kit-catalog.js +1 -1
  70. package/scripts/hooks/stop-goal-fit.js +78 -9
  71. package/src/builder-flow-run-adapter.ts +118 -32
  72. package/src/builder-flow-runtime.ts +331 -61
  73. package/src/cli/assignment-provider-lock.test.mjs +83 -0
  74. package/src/cli/assignment-provider.ts +62 -13
  75. package/src/cli/builder-flow-run-adapter.test.mjs +4 -2
  76. package/src/cli/builder-flow-runtime.test.mjs +194 -8
  77. package/src/cli/builder-run.ts +3 -9
  78. package/src/cli/kit-metadata-security.test.mjs +232 -6
  79. package/src/cli/public-api.test.mjs +15 -0
  80. package/src/cli/workflow-sidecar-execution-proof.test.mjs +90 -0
  81. package/src/cli/workflow-sidecar.ts +724 -97
  82. package/src/cli/workflow.ts +277 -40
  83. package/src/flow-kit/validate.ts +320 -2
  84. package/src/index.ts +6 -5
  85. package/src/lib/observed-command.ts +96 -0
  86. package/src/tools/generate-context-map.ts +5 -3
@@ -31,7 +31,11 @@ WRITER="workflow-sidecar"
31
31
  TMPDIR_EVAL="$(mktemp -d)"
32
32
  errors=0
33
33
 
34
- cleanup() { rm -rf "$TMPDIR_EVAL"; }
34
+ cleanup() {
35
+ local status=$?
36
+ rm -rf "$TMPDIR_EVAL"
37
+ return "$status"
38
+ }
35
39
  trap cleanup EXIT
36
40
 
37
41
  _pass() { echo " ✓ $1"; }
@@ -46,6 +50,7 @@ SESSION_ROOT="$TMPDIR_EVAL/repo/.kontourai/flow-agents"
46
50
  SLUG="sidecar-field-preservation-sweep"
47
51
  SESSION_DIR="$SESSION_ROOT/$SLUG"
48
52
  STATE="$SESSION_DIR/state.json"
53
+ DELIVER_ARTIFACT="$SESSION_DIR/$SLUG--deliver.md"
49
54
  mkdir -p "$SESSION_ROOT"
50
55
 
51
56
  # ─── Field-identity assertion helpers ────────────────────────────────────────
@@ -58,7 +63,11 @@ mkdir -p "$SESSION_ROOT"
58
63
  # persistent field. No fixture forces a synthetic owner value — that would test a code path that
59
64
  # does not exist today.
60
65
  FIELDS=(branch task_slug repo created_at owner)
61
- declare -A BASELINE
66
+ BASELINE_BRANCH=""
67
+ BASELINE_TASK_SLUG=""
68
+ BASELINE_REPO=""
69
+ BASELINE_CREATED_AT=""
70
+ BASELINE_OWNER=""
62
71
 
63
72
  _field() {
64
73
  local file="$1" field="$2"
@@ -66,19 +75,32 @@ _field() {
66
75
  }
67
76
 
68
77
  _capture_baseline() {
69
- local field
70
- for field in "${FIELDS[@]}"; do
71
- BASELINE["$field"]="$(_field "$STATE" "$field")"
72
- done
78
+ BASELINE_BRANCH="$(_field "$STATE" branch)"
79
+ BASELINE_TASK_SLUG="$(_field "$STATE" task_slug)"
80
+ BASELINE_REPO="$(_field "$STATE" repo)"
81
+ BASELINE_CREATED_AT="$(_field "$STATE" created_at)"
82
+ BASELINE_OWNER="$(_field "$STATE" owner)"
83
+ }
84
+
85
+ _baseline_field() {
86
+ case "$1" in
87
+ branch) printf '%s' "$BASELINE_BRANCH" ;;
88
+ task_slug) printf '%s' "$BASELINE_TASK_SLUG" ;;
89
+ repo) printf '%s' "$BASELINE_REPO" ;;
90
+ created_at) printf '%s' "$BASELINE_CREATED_AT" ;;
91
+ owner) printf '%s' "$BASELINE_OWNER" ;;
92
+ *) return 1 ;;
93
+ esac
73
94
  }
74
95
 
75
96
  _assert_preserved() {
76
97
  local label="$1"
77
- local field actual ok=1
98
+ local field actual expected ok=1
78
99
  for field in "${FIELDS[@]}"; do
79
100
  actual="$(_field "$STATE" "$field")"
80
- if [[ "$actual" != "${BASELINE[$field]}" ]]; then
81
- _fail "$label dropped/changed persistent field '$field': expected '${BASELINE[$field]}' got '$actual'"
101
+ expected="$(_baseline_field "$field")"
102
+ if [[ "$actual" != "$expected" ]]; then
103
+ _fail "$label dropped/changed persistent field '$field': expected '$expected' got '$actual'"
82
104
  ok=0
83
105
  fi
84
106
  done
@@ -113,8 +135,8 @@ if [[ ! -f "$STATE" ]]; then
113
135
  fi
114
136
 
115
137
  _capture_baseline
116
- if [[ "${BASELINE[branch]}" != "agent/sweep-actor/$SLUG" || "${BASELINE[created_at]}" != "$SEED_TS" || "${BASELINE[task_slug]}" != "$SLUG" ]]; then
117
- _fail "sweep setup: seeded baseline did not carry the expected branch/created_at/task_slug (branch=${BASELINE[branch]} created_at=${BASELINE[created_at]} task_slug=${BASELINE[task_slug]})"
138
+ if [[ "$BASELINE_BRANCH" != "agent/sweep-actor/$SLUG" || "$BASELINE_CREATED_AT" != "$SEED_TS" || "$BASELINE_TASK_SLUG" != "$SLUG" ]]; then
139
+ _fail "sweep setup: seeded baseline did not carry the expected branch/created_at/task_slug (branch=$BASELINE_BRANCH created_at=$BASELINE_CREATED_AT task_slug=$BASELINE_TASK_SLUG)"
118
140
  fi
119
141
 
120
142
  # ─── 1. init-plan, run against a BRANCH-LESS plan artifact ───────────────────────────────────
@@ -194,6 +216,8 @@ if flow_agents_node "$WRITER" record-critique "$SESSION_DIR" \
194
216
  --reviewer tool-code-reviewer \
195
217
  --verdict pass \
196
218
  --summary "No blocking findings." \
219
+ --artifact-ref "$PLAN_ARTIFACT" \
220
+ --lane-json "{\"id\":\"code-review\",\"status\":\"pass\",\"summary\":\"Reviewed the field-preservation plan artifact.\",\"evidence_refs\":[{\"kind\":\"artifact\",\"file\":\"$PLAN_ARTIFACT\",\"summary\":\"Reviewed field-preservation plan artifact.\"}]}" \
197
221
  --finding-json '{"id":"sweep-finding","severity":"low","status":"fixed","description":"No blocking issues found during sweep sanity critique."}' \
198
222
  --timestamp "2026-06-20T08:25:00Z" >"$TMPDIR_EVAL/critique.out" 2>"$TMPDIR_EVAL/critique.err"; then
199
223
  _assert_preserved "record-critique"
@@ -211,6 +235,7 @@ fi
211
235
  if flow_agents_node "$WRITER" record-gate-claim "$SESSION_DIR" \
212
236
  --status pass \
213
237
  --summary "Implementation scope recorded for the sweep fixture." \
238
+ --evidence-ref-json "{\"kind\":\"artifact\",\"file\":\"$DELIVER_ARTIFACT\",\"summary\":\"Durable delivery artifact for the field-preservation implementation scope.\"}" \
214
239
  --timestamp "2026-06-20T08:30:00Z" >"$TMPDIR_EVAL/gate-claim.out" 2>"$TMPDIR_EVAL/gate-claim.err"; then
215
240
  _assert_preserved "record-gate-claim"
216
241
  else