Repository navigation
FIX-2320: the harness session flow and the scripted harness move to harness-manager; the Teammates divider stays on screen - #4265
Conversation
- Kitchen Sink's harness session flow moves into @flow-state-dev/harness-manager as harnessSessionFlow. The host supplies where sessions work (workspace) and the harness block (agent). Kitchen Sink keeps its worktrees and goal controls as wiring around the package flow. - The devteam scripted harness moves into harness-manager as harnessStub. The workforce-specific MCP read is now the caller's mcpUses option. - The Teammates lab divider no longer drops out while the newest turn has no history mark yet: it reads the latest turn that has one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DME8pzA4e4Rc7fRLGsYavW
…k reads as a retired term Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DME8pzA4e4Rc7fRLGsYavW
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
|
from: fsd-claude @codex review Unsure about:
Generated by Claude Code |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Mechanism check (advisory, never blocks)Rows from
|
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
… session flow and the stub Docs-editor pass: the stub's MCP notice says where it shows and what a missing mcpUses does; a refused conversation says how to recover; state.turns says what it holds and what it is for; the example passes detached: true, as Kitchen Sink does; the feed list says it is the session flow's own set. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DME8pzA4e4Rc7fRLGsYavW
There was a problem hiding this comment.
Simplify / layering review (FIX-2320)
Verdict: The move of the interactive harness session flow and scripted stub into @flow-state-dev/harness-manager is the cleaner direction for this repo. Kitchen Sink becomes ~90 lines of host wiring (workspace + goal controls), goals/shift-manager/devteam stop importing app-local paths, and behavior is lifted rather than rewritten. I do not see a materially simpler approach that still fixes the layering leak without either duplicating the flow or spinning up a second package.
Did the approach go too far?
Mostly no — with one packaging trade-off to name explicitly.
| Alternative | Why I would not prefer it here |
|---|---|
Leave the full defineFlow in Kitchen Sink, extract types only |
Goals and shift-manager already needed the stub and session semantics; the leak would remain. |
New @flow-state-dev/harness-session package |
Cleaner semver story long term, but extra package overhead while the session factory and manager already share workspace PR backstop patterns. Reasonable follow-up if more hosts ship harness modes, not task-board workers. |
Push session flow into core |
Wrong layer: steering, serverOwned session fields, turn records, and branch PR backstop are host/flow policy, not core contracts. |
Where complexity did increase: harness-manager now exports two related but distinct products — the task-board manager (HarnessFeeds, slot for supervised runs) and the interactive session factory (HarnessSessionFeeds, long-lived person ↔ harness chat). The index.ts section headers help; the README still reads manager-first for most of the file. That is documentation/naming debt, not a reason to revert the extract.
What landed well
HarnessSessionWorkspaceinjection — host owns worktree/repo; flow owns conversation binding, steering, turn records, PR backstop. Matches the "second app would need this too" test.harnessStubconsolidation — one scripted slot for goals, DevTeam, and package tests instead of scattered copies.- Teammates divider (
windowReadOf) — orthogonal to harness layering, but a good simplification: filter to turns that actually have ahistoryStart, keep the previous mark while the newest turn is still starting, plus focused unit tests. Worth keeping in this PR.
Optional follow-ups (not blocking)
These are suggestions, not merge gates:
harnessSessionFeeds+ defaultharnessSteering()— exporting feed construction with a default steering instance is a footgun if a host hand-rollsdefineFlowand wiressteerto a different instance thanonSteerable.harnessSessionFlowdoes the right thing; consider JSDoc "useharnessSessionFlow" or a subpath export for advanced hosts.- Two feed interfaces in one package (
HarnessFeedsvsHarnessSessionFeeds) — drift risk; shift-manager already aliases locally. A sharedharness-contract.tsor clearer public names would help future readers. - Kitchen Sink
workspace.branch—readHarnessWorkspace()is consulted again afterrepository()already validatedok; tiny duplicate work per turn-end branch resolution. - Package tests — several harness-manager specs still use inline fake harness handlers; migrating slot tests to
harnessStub().slotwhere appropriate would eat duplication the PR introduced at the product layer but not yet in tests. failureWordsOfcast — repeated(handle as { failureMessage?: unknown }); a core-typed optional field or helper would dedupe (upstream, not introduced by this move).
Performance
No material regressions from the move: same turn-end existsSync + recordBranchPullRequests, same bounded withTurn sort, stub pause remains timer-based.
Net: behavior-preserving extract with clearer ownership. Approve.
Sent by Cursor Automation: Review For Best Approach
There was a problem hiding this comment.
Code Snob — already tight. No POC. Head 63f07933bdf436a542f764a5aa44d77b0ae62810.
I read the move, not the import churn:
packages/harness-manager/src/session-flow.tsandapps/kitchen-sink/lib/harness-session-flow.tspackages/harness-manager/src/harness-stub.tsagainst the old devteam stubpackages/harness-manager/test/session-flow.spec.tsagainst the deleted title testlabs/teammates/src/adapter.ts(windowReadOf) andlabs/teammates/test/window-read.test.ts- the new README sections, the index exports, and the three mode call sites
A rewrite does not shrink this contract:
- The kitchen-sink file is one conditional per goal control.
cwdandworktreesharemain-checkout; a helper is the same length.resumehas to call the package feed first soaskedis still recorded, which this PR already changed on purpose. harnessStub'smcpUsesand the one-methodHarnessStubMcpToolsare what drops the workforce import. Defaulting the capability inside the stub puts that import back.windowReadOfis a filter plus a reduce. The secondhistoryStartcheck is the narrowing; a type-predicate filter is longer. The five tests matchwindow-mark.test.ts.- The session-flow spec's session literal is there because
createCheckrefuses a session with no model andrunActiontakes no initial state.testFlowwould add a devDependency to delete that one line. The two branch tests are the newbranch: nullseam. - Schemas moved with the flow, names have no aliases, and
harness-worktree.ts/ the hard-codedhistorySummaryname are the follow-ups this PR already split off.
Left those alone.
Sent by Cursor Automation: Code Snob


The problem
Three pieces of framework code live where a second app can't reach them:
apps/kitchen-sink/lib. Another app that wants a coding chat has to copy it.harness-stub.mts). Fifteen goals and ten Shift Manager tests import it out of the devteam team's folder by a relative path.What this does
harnessSessionFlowis now in@flow-state-dev/harness-manager. The host gives it two things: where each session works (workspace:provision,locate,branch) and the harness block (agent). The flow does the rest, the same as before. Kitchen Sink'slib/harness-session-flow.tsis now wiring: its per-session worktrees, and its goal controls, each wrapped around one feed.harnessStubis now in@flow-state-dev/harness-manager. The only devteam-specific part was the workforce capability that the MCP notice reads through. That is now the caller's option (mcpUses), so harness-manager takes no workforce dependency.What's asked of you
Nothing here is yours to decide. The new harness-manager surface (
harnessSessionFlow, its schema,harnessStub) is the move Jake approved in epic FIX-2316: "move the Kitchen Sink harness-session flow to package level, move the devteam harness stub out of devteam".Parts worth reviewing closely
apps/kitchen-sink/lib/harness-session-flow.ts).no-resumenow hands the harnessnullafter the package records the bound id asasked. Before,askedwas recorded asnull. The goal legs still fail (the harness starts a new conversation), but the turn record differs under the control.no-backstopis nowworkspace.branchreturningnull.mcpUseson the stub (packages/harness-manager/src/harness-stub.ts). It is held only when the slot is handedmcpTools, which is the old conditional. Three callers relay MCP servers and now pass it:teams/devteam/harness.mts,test/mcp-servers.test.ts, and the error-reporter goal. A caller that relays MCP servers and leaves it out gets no notice.sourceare nowharness-stubandharness-manager/stub(they weredevforce-lab-…). No test or goal reads either.Not here, as follow-ups:
lib/harness-worktree.ts(per-session git worktrees) fails the Kitchen Sink test too: a second app would need it. I left it in the app because the flow takes it asworkspace. Moving it is a separate, small change."historySummary"because core does not export the default name. Fixing that adds core surface.FIX-2320 · epic FIX-2316 · draft, merges when Jake approves
How to review this — altitude, what's in scope, what's deliberately unsettled
Engineering calls
@flow-state-dev/workspace, which depends on core.@flow-state-dev/testingcan't hold the stub: workforce dev-depends on testing, so a workforce import there makes a cycle. harness-manager already owns "the harness as a slot". A new package would be a new mechanism.titleOf,MODEL_REQUIREDandFAILED_OUTCOME_ERRORare nowharnessSessionTitle,HARNESS_SESSION_MODEL_REQUIREDandHARNESS_SESSION_FAILED_OUTCOME.HarnessFeedsis nowHarnessSessionFeeds, because the manager already exports aHarnessFeeds. There are no aliases: every import site moved.lib/harness-turn.tskeeps the page helpers and imports the types withimport type, so it stays browser-safe.harnessoption is now typed by the Lab's ownHarnessFeeds, not by borrowingHarnessStub["slot"].harness-managerrow'sjobnow names both, and itsbuiltOnaddsharness-steering. The classifier maps the new exports to that row by directory, so it proposes no new row. Builds on:harness-manager,harness-steering,coding-harness,workspace.windowMarkOf.Everything else
Verification
labs/teammates/test/window-read.test.ts. With the extractedwindowReadOfstill using the old logic, "stays on the last turn that read one while the newest has no mark yet" failed:expected {} to deeply equal { historyStart: 'r3' }. It passes after the fix.packages/harness-manager/test/session-flow.spec.tstakes over Kitchen Sink's title test and adds the turn-end check. Withif (branch === null) return;removed, the no-branch case fails.node scripts/check-mechanism-anchors.mjs,node --test scripts/mechanisms.test.mjs,node scripts/validate-changeset-refs.mjs,node scripts/check-retired-terms.mjs, eslint on the changed sources, and the pre-push hook.labs/teammates/test/screen.test.tsx("shows a coding run as plain steps") times out when other suites run at the same time. I ran it against main'sadapter.tsand it failed there as well. It doesn't usewindowReadOf. Shift Manager'stask-screen.test.tsxand Kitchen Sink'scodex-session.test.tstimed out the same way under load, and both pass when run alone.Prose changed (for a docs-editor pass):
packages/harness-manager/README.md(new "A scripted harness for checks" and "A harness as a session" sections, plus the export-surface line),packages/shift-manager/teams/devteam/README.md(one line),apps/kitchen-sink/CLAUDE.md(one layout bullet), and the changeset.Changeset:
@flow-state-dev/harness-managerminor (new public exports).https://claude.ai/code/session_01DME8pzA4e4Rc7fRLGsYavW
Generated by Claude Code