Skip to content

FIX-2479 s5: resource and task names in workforce and shift-manager - #4931

Merged
jhoffner merged 15 commits into
mainfrom
fix/FIX-2479-s5-workforce-shift-manager
Nov 8, 2026
Merged

jhoffner merged 15 commits into
mainfrom
fix/FIX-2479-s5-workforce-shift-manager

Conversation

@jhoffner

@jhoffner jhoffner commented Nov 8, 2026

Copy link
Copy Markdown
Collaborator

Stacked on #4930 (FIX-2479 s4, harness-manager). This PR's base is fix/FIX-2479-s4-harness-manager; GitHub rebases it onto main when #4930 merges. Not ready to merge while its base is not main.

The problem

Workforce still exported names that said row for stored data: a worker, a project, the inventory's worker, a subscription, a message in the log, an error report. It also used row for the usage query's answer and for a coordinator round's tasks. Shift-manager's board read model was BoardRow. Eleven workforce errors and tool descriptions said row for a resource (#71–#81).

What this does

  • Names. Every use in the tree moves with them, including the teammates lab's adapter and five goals.

    Old New
    WorkerRow, workerRowSchema WorkerResourceState, workerResourceStateSchema
    parseWorkerRow → { row } parseWorkerResourceState → { worker }
    StandardWorkerRow, standardWorkerRowSchema, standardWorkerRow() StandardWorkerResourceState, standardWorkerResourceStateSchema, standardWorkerResourceState()
    ProjectRow, projectRowSchema ProjectResourceState, projectResourceStateSchema
    projectRowsAccessor, projectRowsAt (not exported) projectResourcesAccessor, projectResourcesAt
    WorkerInventoryRow, workerInventoryRowSchema WorkerInventoryResourceState, workerInventoryResourceStateSchema
    SubscriptionRow, subscriptionRowSchema, subscriptionRowKey SubscriptionResourceState, subscriptionResourceStateSchema, subscriptionResourceKey
    WorkerMessageRow, workerMessageRowSchema (root and /browser) WorkerMessageResourceState, workerMessageResourceStateSchema
    MessageChainRow, messageChainRowSchema (not exported) MessageChainResourceState, messageChainResourceStateSchema
    WorkerUsageRow (and its two internal schemas) WorkerUsageView (workerUsageViewSchema, workerSourceSpendSchema)
    ReportRow, reportRowSchema ReportResourceState, reportResourceStateSchema
    RoundRows, roundRowsOf (not exported) RoundTasks, roundTasksOf
    shift-manager BoardRow, toBoardRow BoardTaskView, toBoardTaskView
    shift-manager allRows, openRows, toMessageRows allTasks, openTasks, toMessages

    Same pattern as s1–s4: *ResourceState for stored data, *View for a read model (as in HarnessUsageView, TaskView). ToolRow and the rendered list rows stay. None of the new names is retired in goals/**/rules.mjs or docs/contributing/glossary.mjs.

  • Messages feat(thought-fabric): implement working memory (FIX-199) #71–perf: reduce server response latency and improve perceived performance #81 say resource: "the worker resources could not be written", "declares no project resources", "a document seeds a resource". Only the noun changes. feat(devtool): Redesign stream view for chat-first readability (FIX-278) #78 reads "a resource seeds stored state that then becomes the source", because "a resource seeds a resource" says nothing.

  • Changeset .changeset/resource-names.md: workforce added at minor, its rows in the rename table, workforce added to the message rule's coverage line, and the Docs line names each renamed root export for packages/workforce/README.md and the published messaging-workers page.

What's asked of you

Check the new names. As in s4, picking each noun was a judgement call.

Parts worth reviewing closely

  1. parseWorkerResourceState answers { worker } now, not { row }. The return shape is part of the export, and { row } kept the retired word. Its two callers are in workforce.
  2. BoardTaskView rather than BoardTask. The teammates lab already has its own BoardTask. The read model follows TaskView. ConversationBoards.rows and the local row variables are unchanged: they aren't on this sub-PR's list.
  3. Local types left alone. The teammates lab's own WorkerRow interface, claude-code-style's ProjectRow, and the goals' local BoardRow/ProjectRow/WorkerRow are declared in those files and aren't workforce exports. The rule's whole-tree turn will rule on them.

Verification

  • Tests: workforce 1829 passed (161 files), including inventory-binder.test.ts on the reworded Docs site navigation structure #74. Shift-manager 714 passed and 5 skipped (81 files), with dist-client built first so command.test runs. teammates lab 261 passed.
  • Typecheck (turbo, workforce and shift-manager plus their dependents: claude-code-style, goals, kitchen-sink, teammates): 33/33 tasks passed.
  • node scripts/check-root-exports.mjs origin/main: PASS. The renamed workforce roots pass only because the changeset names them for the README, as intended. node scripts/check-retired-terms.mjs: PASS. node goals/workforce-coordination/runs-on-one-task/sweep.mjs: PASS.
  • Review: I reviewed it myself in one pass, the way s4 was reviewed. I found no unintended renames: each change matches the rename table, and the workforce-local allRows/openRows in devtool and the goals are untouched. I fixed the doc comments on the renamed declarations that still said row.

Spec: SPEC · DECISIONS · Linear FIX-2479 · below in the stack: #4930


Generated by Claude Code

…as task (red)

Red before the change: the parse path and the row read return kind "row",
newOwnHolds does not exist, the DevTool's waitPrompt shows an answered
"task" question, and the Inbox lists the stored hold as "row".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011UNkLD7mJaky2QRikkQ8Z4
…task

Where a name said row for a task it says task: TaskDecision, TaskWritten,
ticketClaimsTask, HandedOverTaskError, createTaskDispatch (blocks/dispatch-task),
TaskDispatchOptions, TaskTruth/taskTruthOf, RefiledTask, isOpenTask,
InboxTaskInput, TaskViewInput, TaskView/taskView (inbox/task-view),
TaskViewStatus. RowHold is OwnHold (ownHoldSchema, isOwnHold, openOwnHolds,
newOwnHolds, OwnHoldSource): the task's own hold, beside a run's mirrored stop.

D1: a task's own hold is written source.kind "task". A stored "row" reads as
"task" through withCurrentHoldMarker, at the hold schema's parse and at the
collection's row read (both backings cast stored rows rather than parse them),
so no reader branches on "row". refuseWithOpenHold follows; OwnerRunRefusal
"no_row" is "no_resource". The DevTool reads a hold on its stop's marker.

Messages #35-#69 say task. Changeset appended.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011UNkLD7mJaky2QRikkQ8Z4
…that don't parse

Review fold: inboxItems and taskView take the caller's rows as given, so a
replayed stream item or a raw read still carrying "row" lost its question.
openUserHolds reads each hold through withCurrentHoldMarker first (red shown
by the new inbox test before the change). Task-view prose follows the rename.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011UNkLD7mJaky2QRikkQ8Z4
…s kept shapes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011UNkLD7mJaky2QRikkQ8Z4
…ch options name

Codex review (P2): pullRequestWait compared source.kind === "task" on holds a
screen hands it unparsed (a replayed pre-upgrade task-change item), so a wait
stored as "row" lost its PR-open line. isOwnHold and isExternalHold now read a
hold through withCurrentHoldMarker and take an unparsed hold's shape, so
openHolds, holdActorOf and externalHoldOf do too; pullRequestWait and the
Inbox read call the predicate instead of comparing the word. Red shown by the
new harness-manager and external-wait tests before the change.

RowDispatchOptions is CreateTaskDispatchOptions, not TaskDispatchOptions: that
name is one FIX-2083 retired (the runs-on-one-task sweep refused it).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011UNkLD7mJaky2QRikkQ8Z4
Renames the harness-manager exports that said row or state for a read model,
a resource or a lifecycle: HarnessReadinessView (and its schema),
HarnessUsageView, HarnessUsageWindowView, PullRequestRecordResourceState,
PullRequestWaitInput, PlaceStatus (and placeStatusSchema), and the internal
RunRecordWrite and sessionTask. The stored place `state` field stays (D2).

Rewords app-visible messages #19-#34: task where the row was the board's
task, run record or resource elsewhere, including the scripted coder's steps
and commit message. The changeset lists the renames and names the README.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011UNkLD7mJaky2QRikkQ8Z4
…d-hold' into fix/FIX-2479-s4-harness-manager
Renames the workforce exports that said row for a resource: WorkerResourceState
(and workerResourceStateSchema, parseWorkerResourceState answering { worker }),
StandardWorkerResourceState, ProjectResourceState, WorkerInventoryResourceState,
SubscriptionResourceState, WorkerMessageResourceState, ReportResourceState, the
internal MessageChainResourceState, projectResourcesAccessor/At and
subscriptionResourceKey; WorkerUsageView for the usage query's answer and
RoundTasks for a coordinator round's tasks. Shift-manager's board read model is
BoardTaskView (toBoardTaskView, allTasks, openTasks) and toMessages; ToolRow and
the rendered rows stay.

Rewords app-visible messages #71-#81 to say resource. The changeset lists the
renames and names packages/workforce/README.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011UNkLD7mJaky2QRikkQ8Z4
@vercel

vercel Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
flow-state-dev-docs Ready Ready Preview Nov 8, 2026 2:27pm UTC
2 Skipped Deployments
Project Deployment Actions Updated
flow-state-dev-ui Ignored Ignored Preview Nov 8, 2026 2:27pm UTC
flow-state-dev-build-site Skipped Skipped Nov 8, 2026 2:27pm UTC

Request Review

@linear-code

linear-code Bot commented Nov 8, 2026

Copy link
Copy Markdown

FIX-2479

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-08T14:23:43.356576Z 1277561 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

jhoffner commented Nov 8, 2026

Copy link
Copy Markdown
Collaborator Author

Second-look / architecture review

Mechanical rename, consistent with s1–s4. Approach is sound; no better shape for the rename itself. One real defect and a few smaller notes.

Should fix

  1. Over-eager rename of a UI component — packages/shift-manager/src/surfaces/Roster.tsx:67 and :275. The local React component WorkerRow (a rendered roster row, which the PR description says "stays") became WorkerResourceState. It renders a row; it does not hold stored data, so it now reads as a type and collides conceptually with the WorkerResourceState exported from workforce. Revert to WorkerRow (or name it for what it shows, e.g. RosterEntry). Likely a find-and-replace that matched the old workforce type name. Worth grepping the other touched shift-manager/lab/goals files for the same: any WorkerRow/ProjectRow that was a local component or interface and not the workforce export.

Worth considering

  1. Leftover row in the renamed read model's call sites. BoardTaskView values are still bound to row/rows throughout shift-manager (derive.ts, reads.ts, Tasks/Inbox surfaces, ~all tests, plus ConversationBoards.rows). The PR scopes this out, so fine, but the type is now BoardTaskView while every variable and parameter next to it says row. If the whole-tree turn doesn't cover locals, this stays the most visible leftover. Treat as follow-up, not a blocker.
  2. toMessages (shift-manager/lib/messages.ts) returns WorkerMessageResourceState[] but is named as if it returned a generic message list, and the local accumulator is still rows. toWorkerMessages would avoid confusion with the many other message types in the app. Minor.
  3. WorkerUsageView vs *ResourceState. The split (stored data vs read model) is a good rule, but WorkerUsageView also changes WorkerUsageRow consumers in a public export. Confirm the changeset's Docs line lists it (it appears to); no code change needed.

Architecture

No refactor opportunity worth taking here. The rename table is the right unit of work, and folding in deeper restructuring (e.g. merging messages/log-row.ts naming with the resource-state naming) would blur a stacked-PR rename. Leave it.

Checked and fine

Base is still fix/FIX-2479-s4-harness-manager, so hold merge until #4930 lands, as the description already says.


Generated by Claude Code

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Mechanism check (advisory, never blocks)

Rows from docs/mechanisms/mechanisms.yaml · labels: mechanism-overlap

New export Package Mechanism
parseWorkerResourceState @flow-state-dev/workforce workforce
  • Touches subscriptions and worker-messages, which the list marks as overlapping: A delivery lands as a worker message (sendServiceMessage shares sendMessage's budget-free tail), but from a service, addressed by the subscription row, never by the roster.

@github-actions github-actions Bot added the mechanism-overlap Touches overlapping mechanisms, or a new name reads like an existing job (advisory) label Nov 8, 2026
Comment thread .changeset/resource-names.md Resolved
messageChainResourceStateSchema and projectResourcesAccessor have no
consumers outside their own modules, so they stop being exported. The
roster's rendered list line keeps its *Row name and no longer shadows
workforce's WorkerResourceState type.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011UNkLD7mJaky2QRikkQ8Z4
…9) into s5

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011UNkLD7mJaky2QRikkQ8Z4
@gitar-bot

gitar-bot Bot commented Nov 8, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 2 closed / 2 findings

🔴 High risk · Renaming exported workforce and shift-manager types and functions without aliases breaks downstream imports and could prevent dependent applications from building.

Renames workforce and shift-manager stored-data and read-model exports from *Row to *ResourceState or *View names, with matching messages and changeset updates. Roster's list-row component was renamed to WorkerResourceState, which was resolved this session. No issues found.

✅ 2 closed
✅ Quality: Roster's list-row component renamed to WorkerResourceState

📄 packages/shift-manager/src/surfaces/Roster.tsx:67 📄 packages/shift-manager/src/surfaces/Roster.tsx:275
In Roster.tsx the local React component WorkerRow, which draws one worker's line in the roster list, was renamed to WorkerResourceState. It has nothing to do with stored resource state. Its props are a derived WorkerState, gaps and own. The PR description says rendered list row names stay as they are. The new name also matches workforce's exported WorkerResourceState type, which makes the code misleading. Fix: put the name back to WorkerRow, or use a UI name such as WorkerLine.

Closed: Quality: Workforce README still documents the retired row names

📄 .changeset/resource-names.md:69-83
The changeset says packages/workforce/README.md now uses the new names (WorkerResourceState/workerResourceStateSchema/parseWorkerResourceState answering { worker }, WorkerInventoryResourceState, SubscriptionResourceState, WorkerMessageResourceState, WorkerUsageView, …). The README wasn't touched, though. It still lists workerRowSchema / parseWorkerRow(value), WorkerInventoryRow / workerInventoryRowSchema, subscriptionRowSchema, workerMessageRowSchema / WorkerMessageRow (root and /browser), and Output { workers: WorkerUsageRow[] }. None of these is exported any more, since the rename keeps no aliases. Anyone who follows the README gets import errors, and the release note describes a docs update that hasn't happened (BP-034, BP-003). Fix: update every README occurrence in this PR, or remove the README claim from the changeset.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@jhoffner
jhoffner added this pull request to the merge queue Nov 8, 2026
Merged via the queue into main with commit 8e0b121 Nov 8, 2026
24 checks passed
Base automatically changed from fix/FIX-2479-s4-harness-manager to main November 8, 2026 14:41
@jhoffner
jhoffner deleted the fix/FIX-2479-s5-workforce-shift-manager branch November 8, 2026 14:41

This branch was successfully deployed

1 active deployment
Preview – flow-state-dev-docs — c0f61f91 Deployed Nov 8, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mechanism-overlap Touches overlapping mechanisms, or a new name reads like an existing job (advisory)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants