@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
@@ -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