Repository navigation
fix(goals): it-groups-workstreams reads the EM and accepts either lead (FIX-1977) - #3349
Conversation
…d for asks (FIX-1977) FIX-1920 added a general lead to the DevTeam tree, so the goal's setup, which wanted exactly one worker on a lead flow, threw before any leg ran. The HTTP legs now open under the EM (the one lead on the em flow, as the boot picks it), and a workstream opened by asking the project coordinator may be led by any lead the tree declares, since the coordinator picks one by fit. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J5pp7HBcj3QV34at1z7H1n
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: 1e17061a-af98-412a-ad41-87dd7eca17bd) |
Second look + architecture passVerdict: the approach is right. No competing shape worth the cost, and nothing here needs a refactor. Two small optional nits. Is there a better approach? I considered three alternatives and none beats this one.
Architecture / refactor opportunity: none to take here. The change is small and reads the tree at run time instead of hardcoding names, which is the right direction. Pulling anything wider into this fix would break the "every changed line traces to the issue" rule. Optional nits (not blocking):
Check on the evidence: the controls each fail at their own signal, which is what shows the leg still bites. One gap: the green run only shows the entries were led by a declared lead. If the coordinator happens to pick the EM every time, the "either lead" path is never exercised. That's fine for this fix, because the check is membership, not distribution. It's worth knowing the new branch is covered by logic rather than by an observed general-lead run. Nothing blocking from me. Generated by Claude Code |
There was a problem hiding this comment.
Code Snob — already tight on 7574626ba. No POC.
Read goals/shift-manager/it-groups-workstreams-under-their-projects/run.mts (leadsOf, readSetup, the entries check, the outsider and race opens) and goal.md (Input, the entries bullet, the 2026-10-14 log row). Compared the EM read in packages/shift-manager/teams/devteam/fsdev.config.mts and host.mts, and listLeads / leadsWorkstreams in packages/workforce/src/projects/.
leadsOf is the filter this goal already had, plus the count of leads on em. That count is what the outsider and race legs open under (setup.lead at the two openWorkstream calls). The entries leg checks setup.leads. Those are two values, and the return is both of them. A loop that pushes ids and counts EMs in one pass is longer than the two filters. setup.leads.join appears in the failure and the evidence line; a local for that string is an extra line.
The function comment repeats the Setup comment. Putting it back to one line leaves the check, the error, the evidence string, and the goal.md bullets the same size. The file-header wrap is the same two sentences.
Left as recorded on the PR: the entries leg still requires a declared lead, leadsOf stays in this goal, and Setup.lead stays the field name.
Sent by Cursor Automation: Code Snob
There was a problem hiding this comment.
The goal broke because FIX-1920 added a second declared lead while this harness still required exactly one. The fix is appropriately small: keep the EM as the oracle for boot-aligned HTTP opens (race, outsider) and only relax the entries leg so coordinator-chosen leads are allowed.
Simpler paths considered
| Approach | Verdict |
|---|---|
| Re-tighten DevTeam to one lead | Fights FIX-1920; wrong product direction |
| Force the coordinator to always pick the EM in the goal | Hides the real listLeads → pick → openWorkstream behavior the entries leg is meant to grade |
Derive allowed lead ids from a runtime listLeads call in readSetup |
Closer to production truth and avoids duplicating eligibility rules, but needs a coordinator session and more wiring than this ~25-line fix |
Export a shared declared-roster / leadProblem helper from @flow-state-dev/workforce |
Best long-term DRY; out of scope for a goal-only unblock |
I don't see a materially cleaner fix without widening scope. Inline notes are naming and drift hygiene, not blockers.
Sent by Cursor Automation: Review For Best Approach
|
@codex review |
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. |
|
Codex Review: Didn't find any major issues. Another round soon, please! 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". |


Requested by Jake · project thread
Before:
goals/shift-manager/it-groups-workstreams-under-their-projectsstopped in setup on main (7739ad25), in green and in every control: "the tree declares 2 workers that can lead a workstream (general-lead, eng.em), not one". The goal assumed the DevTeam tree has exactly one lead.After: green passes and every control fails at its own signal again.
The product change was intended: #3263 (FIX-1920) added a general lead and lets the coordinator pick a lead by fit. So the goal was stale, not the product. It now reads two things from the tree: every worker that can lead (on
agentorem, listing delegates), and the EM (the one onem, as the profile's boot finds it).How:
Evidence (on
7739ad25+ this change; local, real model for entries and cos):GOAL_LEG=cos): FAIL at cospnpm --filter @flow-state-dev/goals typecheckandguard:control-shapepass. No changeset: goals is private.Fixes FIX-1977. Unblocks FIX-1797.
🤖 Generated with Claude Code
https://claude.ai/code/session_01J5pp7HBcj3QV34at1z7H1n
Generated by Claude Code
Note
Low Risk
Changes are limited to private goal test scripts and documentation; no production Shift Manager or workforce behavior is modified.
Overview
Updates the it-groups-workstreams-under-their-projects goal so it matches DevTeam after FIX-1920 added a second lead-capable worker (general lead plus EM). Setup no longer errors when the tree reports two leads instead of one.
run.mtsreplaces the single-leadleadOf()helper withleadsOf(), which returns every delegate-listing worker onagent/emflows and still pins the EM (emflow) assetup.leadfor boot-style HTTP opens (outsider and race legs). The entries leg now asserts each opened workstream is led by any declared lead, not only the EM, since the project coordinator may choose either. Evidence strings and comments follow the same wording.goal.mddocuments multiple leads, coordinator-chosen assignment for Stream asks, EM for boot/HTTP legs, and adds a 2026-10-14 verdict log row for FIX-1977.Reviewed by Cursor Bugbot for commit 7574626. Configure here.

Confidence Score: 5/5
This PR appears safe to merge.Summary
This fixes a goal that stopped during setup after the DevTeam gained a second lead.
Reviews (1) · Last reviewed commit: "fix(goals): it-groups-workstreams reads ..." · Reviewed by Greptile