Skip to content

FIX-2479 s4: resource and task names in harness-manager - #4930

Merged
jhoffner merged 3 commits into
fix/FIX-2479-s3-orchestration-and-holdfrom
fix/FIX-2479-s4-harness-manager
Nov 8, 2026
Merged

jhoffner merged 3 commits into
fix/FIX-2479-s3-orchestration-and-holdfrom
fix/FIX-2479-s4-harness-manager

Conversation

@jhoffner

@jhoffner jhoffner commented Nov 8, 2026

Copy link
Copy Markdown
Collaborator

Stacked on #4926 (FIX-2479 s3, orchestration and the hold marker). This PR's base is fix/FIX-2479-s3-orchestration-and-hold; GitHub rebases it onto main when #4926 merges. Not ready to merge while its base is not main.

The problem

Harness-manager still exported names that said row for things that aren't store rows: a harness's readiness and usage reads, a screen's pull-request record, the task a pull-request wait reads, and State for the place lifecycle. Sixteen of its error and status messages, including the scripted coder's steps and commit message, said row for a task or a run record (#19–#34).

What this does

  • Names. Every use in the tree moves with them: shift-manager, both labs' adapters, the UI registry's readiness component and its two lab copies.

    Old New
    HarnessReadinessRow, harnessReadinessRowSchema HarnessReadinessView, harnessReadinessViewSchema
    HarnessUsageRow, HarnessUsageWindowRow HarnessUsageView, HarnessUsageWindowView
    PullRequestRecordRow PullRequestRecordResourceState
    PullRequestWaitRow PullRequestWaitInput
    PlaceState, placeStateSchema PlaceStatus, placeStatusSchema (the stored state field stays, D2)
    RunRowWrite, sessionRow (not exported) RunRecordWrite, sessionTask

    The pattern follows s1–s3: *View/*Input for read models (as in TaskView, TaskViewInput), *ResourceState for stored data, *Status for a lifecycle.

  • Messages feat(core): merge block-declared resources into flow scope configs #19–feat(core): add decomposer helper factory #34 say task where the row was the board's task, run record for the run record (writeRunRow's target, RunRecordState), and resource for the worktree resource. Only the noun changes.

  • Changeset .changeset/resource-names.md: rows added to the rename table, harness-manager moved patch → minor (breaking renames, pre-1.0), the message rule's coverage line names harness-manager, and the Docs line names each renamed root export for packages/harness-manager/README.md and the published harness-manager page.

What's asked of you

Check the new names. The noun for each one was a judgement call.

Parts worth reviewing closely

  1. "Run record" instead of "resource" for feat(core): merge block-declared resources into flow scope configs  #21, Sequencer container item emission & parent-instance provenance (FIX-8) #24, feat(core): add summarizer helper factory #26, feat(core): implement memoryExtractor helper block #27. Those messages said "the run row" or "the row" for what writeRunRow writes, the run record resource. "Run record" is the package's own name for it (runRecordCollection, RunRecordState). "The run's resource was opened" says less.
  2. The scripted coder (feat(core): implement analyzer helper block factory #31). taskLine now looks for a Task … line and falls back to "a task". Nothing in the tree has ever written the Row … line the old matcher looked for, so it always fell back. The comment now says so. Removing the matcher is a separate cleanup.
  3. readRunRow, openRunRow, writeRunRow keep their names. They aren't on this sub-PR's list. readRunRow is a root export, so say if it should move here.

Verification

  • Tests: harness-manager 540 passed, including claim-board.spec.ts, which matches the reworded feat(core): implement helper.contextReducer for distill/denoise/compress #28 and fails on the old text. Labs: teammates 261 and claude-code-style 260. On the parallel run one claude-code-style test hit the 5s timeout; run alone, entry-lines.test.tsx passed 14/14. ui 383. Shift-manager: 713 passed, and 1 failed (command.test.ts), which needs the built dist-client pages. That failure is the environment, not this change, and the same as on FIX-2479 s3: task names in orchestration, and a task's own hold says task #4926.
  • Typecheck (turbo, harness-manager plus its dependencies and dependents): 43/43 tasks passed, covering shift-manager, both labs, kitchen-sink, goals and integration-tests.
  • node scripts/check-root-exports.mjs origin/main PASS. The renamed exports clear only through the changeset's README mention, as expected. node scripts/check-retired-terms.mjs PASS.
  • review ran as a single pass and found nothing that must change. Folded: the scripted coder's comment.

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


Generated by Claude Code

@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:26pm UTC
2 Skipped Deployments
Project Deployment Actions Updated
flow-state-dev-ui Ignored Ignored Preview Nov 8, 2026 2:26pm UTC
flow-state-dev-build-site Skipped Skipped Nov 8, 2026 2:26pm 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:25:45.244827Z 436ab05 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 pass (PR #4930, FIX-2479 s4)

Read from the diff of the files listed on the PR, not a re-run of the tests. The approach (rename in place, no aliases, *View/*Input/*ResourceState/*Status) is sound and matches s1–s3. Nothing below blocks the rename. These are things to fold or decide while the lines are already being touched.

1. Delete the dead matcher instead of renaming it (scripted-harness.ts)

The PR says nothing has ever written the Row … line, so taskLine always returns "a task". Renaming a function that can only return a constant keeps a fake lookup alive and adds a comment explaining why it is fake. This PR is already editing these exact lines.

  • Replace taskLine(run.prompt) with the literal a task, or drop the line from SCRIPTED-RUN.md.
  • Delete taskLine, plus the run.prompt read if nothing else uses it.
  • Check the file's tests first. If one asserts the SCRIPTED-RUN.md body, update it.

The PR defers this as a "separate cleanup". That cleanup is about 4 lines and cheaper here than as a follow-up that needs its own review. A reviewer shouldn't have to confirm "always falls back" a second time.

2. The rename is incomplete inside the files it touches

Signatures moved, but the prose and locals next to them still say row for things now typed as views, inputs or tasks. This is a half-renamed vocabulary, which is what the s1–s3 checks were trying to prevent. Examples from the diff context:

  • readiness.ts: "Every harness's row", "A ready row answers without…", const rows = new Map<string, HarnessReadinessView>, refusalOf(row: …View), remedyOf(row), rowOf(...). The type is now a View, so rowOf → viewOf and row → view/readiness is the same change.
  • pull-request-wait.ts: pullRequestWait(row: PullRequestWaitInput, …) and keyOfRecord(row: …ResourceState). The parameter names should follow the new types. "when the row names none" (×2 on SessionPullRequest) and "A record row's key" still say row.
  • manager.ts: assertFeatureRowIdentity (its message was changed to "task" in the same hunk) and the comment "A null read means the place has no row".

Suggest a sweep of \brow\b|\brows\b|Row\( across packages/harness-manager/src for names/comments not tied to a stored-shape or writeRunRow-style retained name. Either fix them or list the intentional keepers in the PR body. If the vocabulary check passes with these present, its coverage is narrower than the PR's claim ("Sixteen of its error and status messages" is messages only).

3. writeRunRow / readRunRow / openRunRow should move with this PR

The PR asks whether readRunRow (a root export) should move here, and the answer is yes. After this PR, RunRecordWrite, RunRecordState, runRecordCollection and the message "the run record was opened" all say run record, while the functions that write it say RunRow. That leaves one concept with two names inside a single module (run-record.ts). It also makes the next reader of the messages ("the run record was completed") look for writeRunRecord. Renaming readRunRow later means a second breaking minor on a root export. Doing it here adds nothing to the changeset except three table rows, since the changeset is already minor. If you keep them, say why in run-record.ts and DECISIONS, because the current state looks like an oversight rather than a decision.

4. PullRequestRecordResourceState is the one name that reads as a wrong fit

It's a hand-written structural interface (host?, repository?, number?) describing what a screen holds after reading, optional and nullable throughout, and SessionPullRequest extends it. By the PR's own pattern ("*View/*Input for read models, *ResourceState for stored data"), this is a loose input shape, so PullRequestRecordInput (like PullRequestWaitInput next to it) fits better. If it really mirrors the stored resource, say so in its doc comment and point at the schema it mirrors. Today's comment says "as a screen holds it", which is the read-model sense. Judgment call, low cost either way, but this is the name the PR asks reviewers to check.

5. The state → status split leaves a naming seam

recordedPlace: z.object({ host, state: placeStatusSchema }) and recordPlace(ctx, placeHost, placeState: PlaceStatus) keep state as the field and param while the type is Status. D2 settles the stored field, so I'm not asking to change that. Rename only the non-persisted local (placeState → placeStatus) so the one place where the name is forced (the stored key) is visible as such, rather than spreading placeState through the code.

6. Architecture note (no action asked)

manager.ts is ~4.4k lines, and this rename touches 16 lines across it, including error strings inside harnessManager(). It's not a reason to split in this PR. If a later sub-PR splits the run-record and place-recording helpers into run-record.ts, the vocabulary cleanup in items 2 and 3 would make that move much cleaner. Worth noting for the epic wrap, not here.

Verified as fine


Generated by Claude Code

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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ae3378828e

ℹ️ 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".

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".

return prompt.split("\n").find((line) => line.startsWith("Row ")) ?? "a row";
/** A prompt line naming the task (`Task …`), else "a task". The manager's prompt writes no such line today. */
function taskLine(prompt: string): string {
return prompt.split("\n").find((line) => line.startsWith("Task ")) ?? "a task";

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Update the task-line producer alongside the scripted matcher

Shift Manager's buildWorkerPrompt still emits Row ${run.issue}, phase ${run.phase}, attempt ${run.attempt}. (packages/shift-manager/teams/devteam/phase.mts:103), so its shared scripted harness now always writes the fallback a task into SCRIPTED-RUN.md. For a no-repository project containing a prior saved scripted run, subsequent tasks write identical content instead of a task-specific artifact. The completion check at phase.mts:359–363 rejects that unchanged file fingerprint, causing those tasks to exhaust their retries. Update the prompt producer together with this matcher, or normalize the existing identity-bearing line while preserving its task and attempt information.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed and fixed in 436ab05. Shift Manager's devteam prompt now writes Task <id>, phase <p>, attempt <n>. (phase.mts:103), which is the line the scripted harness reads. The two goal readers that matched the old Row line follow it, and the scripted harness's comment no longer says that no prompt writes the line.

fsd-checkout.test.ts now asserts that the committed SCRIPTED-RUN.md names its task. With the old prompt line it fails with expected 'A scripted run, no model.\n\na task' to match /\nTask \S+, phase …/, and with the fix it passes. The fix is merged up into s5 and s6.


Generated by Claude Code

…arness reads

Codex found the scripted harness now looks for a `Task …` line while Shift
Manager's devteam prompt still wrote `Row …`, so every scripted run wrote
"a task" and a no-repository project's retries all wrote the same file.
The prompt says Task; the two goal readers follow; fsd-checkout asserts the
written file names its task (red with the old prompt line).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011UNkLD7mJaky2QRikkQ8Z4
The answer prompt writes a Task line too, so matching "\nTask " let the
conversation's run commit at once instead of holding. Match the implement
phase's line, the only one that names a phase.

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 1 closed / 1 findings

🔴 High risk · Renaming exported harness-manager types and schemas without aliases breaks existing consumers that import the old public names.

Renames harness-manager's row-named exports and error messages to task, run record, and resource nouns (for example HarnessReadinessRow to HarnessReadinessView, PlaceState to PlaceStatus), with the consumers in shift-manager, both labs, and the UI registry updated to match. The feature-run check now also matches the answer prompt, so the hold is no longer lost. No issues found.

✅ 1 closed
✅ Bug: Feature-run check now also matches the answer prompt, so the hold is lost

📄 packages/shift-manager/test/devteam-shift-coordinator-tasks.test.ts:629 📄 packages/shift-manager/teams/devteam/phase.mts:103 📄 packages/shift-manager/teams/devteam/phase.mts:422
The duringRun stub in this test used to tell the EM's feature run apart from the conversation's run by checking for Row. Only buildWorkerPrompt wrote that line. This commit changes the check to Task, but buildAnswerPrompt (phase.mts:422) already writes Task ${run.issue}, attempt ${run.attempt}. right after a blank line. So the conversation's answer run now matches too: it commits GREETING.md and returns at once instead of waiting on held.

The test can still pass, but it no longer shows that the two runs happen "at once". The conversation's run finishes before the feature row is even filed, which is the property this test exists to check. One fix is to match the line only the implement phase writes, for example / Task \S+, phase /.

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 ffac19e Nov 8, 2026
24 checks passed
@jhoffner
jhoffner deleted the fix/FIX-2479-s4-harness-manager branch November 8, 2026 14:41

This branch was successfully deployed

1 active deployment
Preview – flow-state-dev-docs — 62cf1cd3 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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants