Skip to content

refactor(director): make workflow coordination host-owned, drop inert classifier - #1040

Merged
TheGreatAxios merged 4 commits into
mainfrom
cl-7919-chat-director-decide-the-shape-for-workflowcoordinator-and
Sep 15, 2026
Merged

TheGreatAxios merged 4 commits into
mainfrom
cl-7919-chat-director-decide-the-shape-for-workflowcoordinator-and

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

Summary

  • Removes workflowCoordinator and taskClassifier from ChatDirectorOptions with decisions recorded
  • Keeps setWorkflowCoordinator as the sole live coordination seam
  • Leaves task-boundary classification as host-free library without director involvement

Verification

  • bun run check passes (lint, typecheck, build, guarded suite: 7385 pass / 0 fail)
  • Setter attach and detach behavior covered by director tests

Fixes CL-7919

@linear-code

linear-code Bot commented Sep 14, 2026

Copy link
Copy Markdown

CL-7919

… from ChatDirectorOptions

Decision:
- workflow coordination is host-owned. WorkflowHost owns the runtime
  lifecycle (start/resume/reset/persist), which is load-bearing, so the
  WorkflowCoordinator instance stays host-owned and reaches the director
  only through the narrow setWorkflowCoordinator live-object seam (the
  only path production ever used; the constructor option had zero
  suppliers). All director consult sites (directive, idle rails, gate,
  handleToolDone) unchanged.
- task-boundary classification is neither a host closure nor native
  director behavior. The taskClassifier seam had zero production
  suppliers (assembleChatAgent funnel never passes it; TUI and exec omit
  it), so the decide()-time new-task path was inert in product and its
  removal keeps TUI behavior byte-identical. The pure classifier
  (classifyTaskBoundary Tier-1 heuristics + caller-supplied Tier-2) stays
  in session/compactor.ts as host-free library.

Rejected:
- tools the director calls (loop-internal automation must not mount
  model-visible surface),
- BaseEnv handles (live non-serializable objects are not config; no new
  env keys),
- moving decide()-time directive/idle/gate rails out of the director
  (they are the loop),
- keeping the constructor option (dead duplicate of the setter blocking
  zero-closure),
- native heuristics-only classification in the director (would newly arm
  new-task envelopes in the TUI),
- native full-LLM-tier classification (decide() has no side-channel
  inference handle; adding one would be a new host closure).

Zero-closure: both closures removed from ChatDirectorOptions. Remaining
closures (onActivateTools, onTasksChange, requestContinuation,
getProviderId, getLiveFleetCount) belong to sibling lanes
CL-7916/7917/7918; this branch merges last (7916->7917->7918->7919).

Tests: migrated tests/unit/workflows-director.test.ts (8 sites) from the
constructor option to setWorkflowCoordinator; replaced the injected-
classifier test with a no-checkpoint normal-infer pin; added setter
attach/detach directive tests. bun run check green (7385 pass, 0 fail).
@TheGreatAxios
TheGreatAxios force-pushed the cl-7919-chat-director-decide-the-shape-for-workflowcoordinator-and branch from 3fa6924 to 48b2d6f Compare September 14, 2026 17:54
…1050)

* fix(director): harden coordinator seam with fallback and validation

* fix(director): guard coordinator step id and empty directive (#1059)
…-decide-the-shape-for-workflowcoordinator-and
@TheGreatAxios
TheGreatAxios merged commit 74384f3 into main Sep 15, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant