feat(factory): software factory pipeline — ready-for-agent → scope → team spawn → implement#222
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Review limit reached
More reviews will be available in 13 minutes and 11 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more credits in the billing tab to continue. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (12)
📝 WalkthroughWalkthroughThis PR introduces the ready-for-agent issue dispatch workflow: a new issue band classification, heuristic-based repo detection and team-size suggestion utilities, a dual-agent spawning mechanism, UI enhancements to the Attention Inbox component, and a backend board-steward automation persona. The changes span IPC infrastructure for remote file writes, classification logic, team composition, and end-to-end testing fixtures. ChangesReady-for-agent issue dispatch and team spawning
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…team spawn → implement Adds the complete software factory pipeline so issues marked `ready-for-agent` flow automatically through scoping, team spawning, and implementation: - writeRemoteFile IPC: renderer/agents can now create/update Linear issues - ready-for-agent 4th band in Attention Inbox (expanded by default) - spawnTeamForIssue: spawns codex-impl + claude-review pairs with task prompts - issue-scoping module: detectRepo, suggestTeamSize, labelIssueWithRepo - board-steward persona: proactive agent that watches and drives the pipeline Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
7d0652f to
1d396d2
Compare
|
Implemented two fixes:
Addressed comments
Advisory Notes
Local validation passed:
|
There was a problem hiding this comment.
Actionable comments posted: 8
🧹 Nitpick comments (1)
src/renderer/src/lib/issue-scoping.test.ts (1)
4-16: ⚡ Quick winAdd regression cases for keyword-boundary collisions and
suggestTeamSize.This suite only covers the happy-path
detectRepobranches. Please add cases provingbuilddoes not scoreui,prefix cleanupdoes not hitfix, and direct coverage for the 200/2000-length and keyword branches insuggestTeamSize; those are the branches most likely to drift.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/renderer/src/lib/issue-scoping.test.ts` around lines 4 - 16, Add tests to cover keyword-boundary collisions and suggestTeamSize edge cases: add a detectRepo test ensuring the keyword "build" does not falsely match the "ui" repo (e.g., title/body containing "build" adjacent to other words), another detectRepo test ensuring "prefix cleanup" does not match the "fix" repo, and tests exercising suggestTeamSize's branches (one with ~200 chars and one with ~2000 chars plus a case triggering keyword-based sizing). Use the existing test file's describe('detectRepo') context and reference the detectRepo and suggestTeamSize functions so that the new tests assert null or expected sizes for those specific inputs.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.agentworkforce/workforce/personas/board-steward.json:
- Around line 22-24: The persona currently sets "permissions": { "mode":
"bypassPermissions" } which grants full tool authority; replace this with a
scoped, least-privilege permission object for the board-steward persona that
enumerates only the actions it needs (e.g., writeback:issues or writeback:tasks,
messaging:send, spawn:agent or spawn:subtask, dispatch:workflow) instead of
bypassPermissions; update the "permissions" entry to list a "mode": "scoped" (or
remove mode) and a "scopes" array containing the exact capabilities (writeback,
messaging, spawn, dispatch) required for its writebacks and dispatch actions so
the persona cannot perform any other tool operations.
- Line 13: The persona's description claims it "spawns codex-impl +
claude-review agent pairs" but the operational steps only post messages/DMs and
contain no spawn action; either implement an actual spawn call to the dispatcher
(e.g., invoke the system's spawnAgentTeam or createAgentPair API with parameters
for codex-impl and claude-review where the persona posts the work) in the
persona's operational steps, or change the "description" field to explicitly
state "triage + announce" (remove "spawns" language) so the contract matches the
implemented behavior; update the JSON key "description" and the persona's
operational steps that currently send messages/DMs so they either call the
dispatcher API or reflect the narrowed scope.
- Line 25: Change the processed-issues contract used by the Board Steward
(currently /tmp/board-steward-processed.json referenced in Core Loop step 2 and
step 10) from a simple JSON array of IDs to an append-only JSON array of
structured records (e.g., { "id": "<issue-id>", "state":
"dispatched|failed|retrying|done", "attempts": N, "lastError": "...", "retry":
true/false, "ts": "<iso>" }); update the "skip any issue whose ID appears" check
to instead skip only when the latest record for that issue has state
"dispatched" or "done", and on failures append a new record with state "failed"
or "retrying" and increment attempts so retries are allowed per the retry flag;
ensure writeback logic that appends records after each dispatch attempt and
reading logic picks the latest record per issue to determine eligibility.
In `@src/main/integrations.ts`:
- Around line 1119-1121: writeRemoteFile is using the read-only handle from
withIntegrationRemoteHandle (which currently pulls
getIntegrationRemoteReaderHandle with scope relayfile:fs:read:/**) and so
client().writeFile can be rejected; change writeRemoteFile to obtain/construct a
writer handle with write scope (relayfile:fs:write:* or the specific path scope)
instead of the reader handle—either add a new getIntegrationRemoteWriterHandle
and a corresponding withIntegrationRemoteWriterHandle helper, or extend
withIntegrationRemoteHandle to accept a scope/mode parameter and pass the write
scope when calling client().writeFile so the call is authorized.
In `@src/renderer/src/components/issues/AttentionInbox.tsx`:
- Around line 573-586: handleSpawnTeam currently calls
useProjectStore.getState().getActiveProject() which can point to a different
project than the one displayed; change it to resolve the project using the
component's resolvedProjectId (instead of getActiveProject()) before calling
spawnTeamForIssue, and if no project is found for resolvedProjectId fail visibly
(e.g. setNavNotice or throw an error) rather than silently returning; update
references inside handleSpawnTeam (project variable) and ensure
spawnTeamForIssue is passed the resolved project.
In `@src/renderer/src/lib/ipc-mock.ts`:
- Around line 1087-1091: The mock writeRemoteFile implementation is too strict
because it JSON.parses every content string; update the writeRemoteFile async
function to store the raw content string into mockRemoteFiles using the
normalized key (use normalizeMockRemotePath(remotePath) and
mockRemoteFiles[normalized] = content) instead of JSON.parse(content) so the
mock matches the production IPC contract that accepts arbitrary string content;
keep the existing console.log and function signature unchanged.
In `@src/renderer/src/lib/issue-scoping.ts`:
- Around line 13-15: The current substring matching (keywords.filter(kw =>
text.includes(kw))) in detectRepo/REPO_KEYWORDS leads to false positives;
replace it with token-aware matching by normalizing text (lowercase, remove
punctuation), splitting into tokens (e.g., /\w+/) or using word-boundary regexes
(\\bkeyword\\b) and then counting token matches per repo; update the scoring
logic where keywords.filter(...) is used (including the similar logic at lines
31-34) so it only increments for whole-token matches and handles multi-word
keywords consistently.
In `@src/renderer/src/lib/spawn-agent.ts`:
- Around line 130-155: spawnTeamForIssue can leave partial state on failure;
make the operation idempotent by using deterministic agent names and atomic
existence checks plus cleanup on abort: before calling spawnProjectAgent, derive
deterministic names (e.g., `${composition.issueIdentifier}-impl` and `-review`)
and check a shared registry/locker (or call spawnProjectAgent in a mode that
returns existing agent if present) so repeated calls return the same
implName/reviewName instead of creating `-2` variants; if any step after
creating an agent fails (e.g., second spawn or pear.broker.sendMessage), perform
compensating cleanup (delete the newly created agent or rollback registry entry)
or persist the mapping atomically so retries see the created pair; update
spawnProjectAgent callers here to use existence-returning/spawn-or-get behavior
and ensure pear.broker.sendMessage failures trigger the cleanup/rollback path.
---
Nitpick comments:
In `@src/renderer/src/lib/issue-scoping.test.ts`:
- Around line 4-16: Add tests to cover keyword-boundary collisions and
suggestTeamSize edge cases: add a detectRepo test ensuring the keyword "build"
does not falsely match the "ui" repo (e.g., title/body containing "build"
adjacent to other words), another detectRepo test ensuring "prefix cleanup" does
not match the "fix" repo, and tests exercising suggestTeamSize's branches (one
with ~200 chars and one with ~2000 chars plus a case triggering keyword-based
sizing). Use the existing test file's describe('detectRepo') context and
reference the detectRepo and suggestTeamSize functions so that the new tests
assert null or expected sizes for those specific inputs.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: a58eb30b-6dcd-4c6d-9bae-9cc59dfc9983
📒 Files selected for processing (12)
.agentworkforce/workforce/personas/board-steward.jsonsrc/main/integrations.test.tssrc/main/integrations.tssrc/main/ipc-handlers.tssrc/preload/index.tssrc/renderer/src/components/issues/AttentionInbox.tsxsrc/renderer/src/lib/ipc-mock.tssrc/renderer/src/lib/issue-scoping.test.tssrc/renderer/src/lib/issue-scoping.tssrc/renderer/src/lib/spawn-agent.tssrc/renderer/src/stores/issues-store.tssrc/shared/types/ipc.ts
|
✅ pr-reviewer applied fixes — committed and pushed Implemented fixes for the validated PR findings. Addressed comments
Advisory Notes
ValidationPassed locally: Could not fully reproduce the macOS packaging CI job on this Linux runner. |
|
Reviewed PR #222 against Addressed Comments
Advisory Notes
Local verification run:
I’m not printing |
…line # Conflicts: # src/renderer/src/components/issues/AttentionInbox.tsx
Install @agentworkforce/persona-linear-dispatcher and @agentworkforce/persona-repo-router, and append both to the personas:refresh npm script so all personas stay current via one command. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
board-steward overlaps with the linear-dispatcher + repo-router pair — both poll ready-for-agent Linear issues and spawn impl/review teams, so running them together double-dispatches. Keep linear-dispatcher (board watcher) + repo-router (per-issue routing) as the single dispatch path. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ive PTY emulation Rounds 1-5 of rendering hardening each closed one corruption *creation* vector, but the class has a nastier property: diff-painting TUIs (Claude Code) skip cells they believe unchanged, so a single grid divergence (e.g. an xterm reflow scroll during a width resize that PTY-side emulators don't perform) is preserved and amplified by every subsequent repaint — stacked prompt panels, stale glyphs bleeding through the spaces of new rows. The broker daemon already maintains the authoritative screen (the attach snapshot / dump-pty emulation, which renders the same byte stream correctly). This adds the missing convergence mechanism: a quiet-time reconciler that compares the xterm viewport against the broker's plain snapshot and repaints from the self-framing ansi snapshot on confirmed divergence. - broker.snapshotTerminal: side-effect-free snapshot read (no input-stream reset, no delivery-mode writes), wedge-recovery wrapped like getPending, degrades to null on every failure. - terminal-reconciler.ts: gating invariants — quiet window, visible window (hidden windows stall the rAF chunk flush), no outstanding predictions, activity-serial recheck across fetches plus a forced staged-chunk flush before the write (a chunk racing the fetch may already be inside the snapshot), exact dimension match, confirm-on-two-checks, repair rate limit. Repairs route through the echo router so they order behind queued engine writes and repair the engine model too. - Repair telemetry: '[terminal] viewport diverged from broker screen' — a firing reconciler is the tripwire that a new creation vector exists. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…dy; repair installed persona skill paths (#223) * feat(factory): software factory pipeline — ready-for-agent → scope → team spawn → implement Adds the complete software factory pipeline so issues marked `ready-for-agent` flow automatically through scoping, team spawning, and implementation: - writeRemoteFile IPC: renderer/agents can now create/update Linear issues - ready-for-agent 4th band in Attention Inbox (expanded by default) - spawnTeamForIssue: spawns codex-impl + claude-review pairs with task prompts - issue-scoping module: detectRepo, suggestTeamSize, labelIssueWithRepo - board-steward persona: proactive agent that watches and drives the pipeline Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * chore: apply pr-reviewer fixes for #222 * chore: apply pr-reviewer fixes for #222 * chore: add linear-dispatcher + repo-router personas to refresh script Install @agentworkforce/persona-linear-dispatcher and @agentworkforce/persona-repo-router, and append both to the personas:refresh npm script so all personas stay current via one command. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * chore: remove board-steward persona board-steward overlaps with the linear-dispatcher + repo-router pair — both poll ready-for-agent Linear issues and spawn impl/review teams, so running them together double-dispatches. Keep linear-dispatcher (board watcher) + repo-router (per-issue routing) as the single dispatch path. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix(broker): fail fast when a persona worker exits before harness-ready; repair installed persona skill paths A workforce CLI that dies during setup (e.g. a failed skill install calls process.exit) previously burned the entire 120s PERSONA_HARNESS_READY_TIMEOUT_MS before surfacing an error. The harness-ready wait now rejects as soon as the worker is gone: it watches agent_exit/agent_exited/agent_released events and runs a 2s listAgents liveness poll as a catch-all for exits that slip past the event stream (e.g. between spawn and subscription). Also repairs the installed linear-dispatcher and repo-router personas, which carried raw `./skills/*.md` sources from an installer version without skill-asset support. The cp for those paths resolved against the project root, failed, aborted every spawn, and kept the workforce skill cache marker from being written — forcing a full prpm re-download on each attempt. Skill files now live under __assets/<id>/skills/ with sources rewritten to the convention the fixed installer emits (AgentWorkforce/workforce#226). Do not re-run personas:refresh until a CLI with that fix is published and the agentworkforce dep is bumped — npx prefers the local 3.0.52 binary, which would regenerate the broken JSONs. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: agent-relay-code[bot] <agent-relay-code[bot]@users.noreply.github.com>
…TCH contract - issues-store: load authoritative workflow states from /linear/states and send only the mutable stateId in the writeback payload (the adapter schema is additionalProperties:false; identity/state/team would be rejected) - ipc-mock: add the /linear/states resource and emulate the adapter's PATCH merge semantics for canonical issue records so state moves persist in mock - AttentionInbox: consume the store-provided workflow states Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Summary
ready-for-agent4th band in Attention Inbox — issues with that status/label surface between "Needs you" and "In motion", expanded by default, with repo detection badges and a live Spawn Team buttonspawnTeamForIssue()— spawns coordinated codex-impl + claude-review pairs with task prompts referencing the issue, wired to the Spawn Team buttonissue-scopingmodule —detectRepo()keyword-scores issue text to detect repo (relay/pear/workforce),suggestTeamSize()estimates complexity,labelIssueWithRepo()writes the label via writeRemoteFileboard-stewardpersona — proactive agent that watches forready-for-agentissues, auto-scopes them, spawns teams, and moves cards through the pipelineThe Pipeline
Test plan
npm run build:web— verify mock ready-for-agent issues appear in the new Inbox band with repo badgestsc -p tsconfig.web.json --noEmitpasses (renderer gate)ready-for-agentlabel → confirm it appears in the correct bandboard-stewardpersona from Spawn Agent dialog → confirm it's discoverable🤖 Generated with Claude Code