Skip to content

AR-274 route factory implementers by repo label#363

Merged
khaliqgant merged 8 commits into
mainfrom
ar-274-label-dispatch
Jun 15, 2026
Merged

AR-274 route factory implementers by repo label#363
khaliqgant merged 8 commits into
mainfrom
ar-274-label-dispatch

Conversation

@khaliqgant

@khaliqgant khaliqgant commented Jun 15, 2026

Copy link
Copy Markdown
Member

Summary

  • derive factory implementer specs at dispatch time from resolved repo routes: repo labels first, then repos.default when no repo label matches
  • overwrite body/LLM-derived implementer names before spawning so dispatch comments and agents use repo slugs such as ar-267-impl-cloud and ar-267-impl-relayfile
  • rebind the reviewer spec to the first resolved repo route while preserving the one-per-issue <key>-review name
  • fail loud with warning/comment when no repo route can be resolved or when resolved routes exceed triage.maxImplementers

Depends-on: AR-273 (sequencing preference from reviewer; no direct code dependency in this PR).

Verification

  • npx vitest run packages/factory-sdk/src/orchestrator/factory.test.ts packages/factory-sdk/src/config/schema.test.ts
  • npm run typecheck:node

Notes

  • I did not run pear factory --mode live on a scratch Linear issue from this worktree; live Linear verification remains an operator gate before merge.
  • The dispatch comment now uses the spawned label/default-route implementer names, e.g. Implementers: ar-720-impl-cloud, ar-720-impl-relayfile in the regression test.
  • AC Replace ad-hoc parsing with Zod schemas; dedupe shared helpers #4 is amended per reviewer guidance: fail-loud applies when no repo label matches and no repos.default route is configured; otherwise unlabeled/no-match issues dispatch through repos.default as <key>-impl-<default-repo-slug>.

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@khaliqgant, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 13 minutes and 8 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a2e8574b-6063-49fc-9658-c1e115a758a6

📥 Commits

Reviewing files that changed from the base of the PR and between a9c6f3b and 3d9137f.

📒 Files selected for processing (3)
  • packages/factory-sdk/src/cli/fleet.test.ts
  • packages/factory-sdk/src/orchestrator/factory.test.ts
  • packages/factory-sdk/src/orchestrator/factory.ts
📝 Walkthrough

Walkthrough

FactoryLoop.dispatch is updated to compute implementer agent identities from Linear issue repo labels via a new labelDerivedDispatchDecision helper. On routing failure it posts a failure comment and returns a zero-agent result; on success, agent specs, writeback, and the dispatched event all use label-derived identities. Test fixtures and assertions are updated throughout to use the new repo-suffixed agent names (e.g., ar-<issue>-impl-pear).

Changes

Label-derived agent identity routing

Layer / File(s) Summary
Label routing helper types and functions
packages/factory-sdk/src/orchestrator/factory.ts
Adds new types and functions for resolving routes from issue labels: ok/failure resolution, route assignment with deduplication and default-route fallback, implementer spec construction (repo/clonePath/task), failure-comment generation for no-route/too-many-routes/unmapped-label cases, repo slug sanitization, and task text formatting.
Dispatch method wired to label-derived routing
packages/factory-sdk/src/orchestrator/factory.ts
dispatch short-circuits when labelDerivedDispatchDecision returns a failure, logging the context and optionally posting a failure comment to Linear. On success, agent spawning, writeback, dispatch comment, Linear state update, and the emitted dispatched event all use label-derived implementer/reviewer specs.
Test fixtures, config, and core dispatch/identity assertions
packages/factory-sdk/src/orchestrator/factory.test.ts
Test config() adds triage.maxImplementers: 4; the Linear issue fixture adds labels: [{ name: 'pear' }]. Parsing expectations, spawned agent name assertions, release/resume/stop/termination, in-flight/queued checks, live-loop dispatch, reaper/orphan handling, and delivery-event recipient addressing are updated to repo-suffixed agent identities.
Slack routing, dispatch identity, and babysitter tests
packages/factory-sdk/src/orchestrator/factory.test.ts
Adds/adjusts assertions verifying implementer identity derives from repo labels rather than triage implementers; updates Slack question/answer recipients, notification targets, and retry/injection bookkeeping. PR babysitter tests update implementer-exit triggers, spawned babysitter/release identifiers, and legacy completion checks to match repo-suffixed naming.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • AgentWorkforce/pear#248: Modifies the same FactoryLoop.dispatch and runOnce orchestration paths in factory.ts, intersecting directly with the dispatch routing logic changed in this PR.

Poem

🐰 A label named "pear" fell onto the queue,
The factory looked up and knew what to do.
It stamped every agent with -pear at the end,
No more lost routes where the dispatch might bend.
The tests all agreed with a cheerful green light —
Repo-suffixed identities: perfectly right! 🍐

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title directly and concisely summarizes the main change: routing factory implementers by repo label, which is the core objective of the PR.
Description check ✅ Passed The description is well-related to the changeset, providing clear details about deriving implementer specs from repo labels, overwriting agent names, rebinding reviewer specs, and error handling.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ar-274-label-dispatch

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@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: ec624603f8

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

})
if (!dryRun) {
try {
await this.#linear.postComment(liveIssue, 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.

P2 Badge Deduplicate invalid-label comments before posting

When a Ready-for-Agent issue hits this invalid label route, the factory posts the failure comment and returns without recording a dispatch attempt, marking the issue terminal, queuing it, or moving it out of Ready. In runOnce/live replay the same issue will satisfy the same checks again, and the Linear comment writeback itself can produce another change event, so a bad label/no-default or too-many-routes issue can get the same comment posted repeatedly instead of one actionable failure notice.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Addressed in b8e8d3c: the invalid-label failure comment is now deduped by a reason + offending-labels signature — recorded only after a successful post and cleared once the issue dispatches successfully — so a stuck Ready issue (or the comment writeback's own change event) no longer re-posts the same notice each cycle. Added a regression test asserting repeated dispatch posts the comment once.

@agent-relay-code

Copy link
Copy Markdown
Contributor

Findings

  • packages/factory-sdk/src/orchestrator/factory.ts:3358: labelDerivedDispatchDecision() replaces the triage decision with label/default-only routing. That bypasses the existing documented routing chain byLabel -> byProject -> keywordRules -> default still covered in packages/factory-sdk/src/triage/triage.test.ts:55 and documented in packages/factory-sdk/README.md:147. An issue with an unmapped label but a matching project or keyword route will now dispatch to repos.default instead of the project/keyword repo. This is a semantic routing change and should be fixed by the PR author, not auto-edited.

  • packages/factory-sdk/src/orchestrator/factory.ts:3428: label dispatch uses the raw repos.byLabel value as route.repo and looks up clonePaths[repo]. Existing behavior supports bare repo names for GitHub mirror routing (packages/factory-sdk/src/orchestrator/factory.test.ts:1512 uses { pear: "pear" } with only clonePaths["AgentWorkforce/pear"]). A mirrored Linear issue with label pear would dispatch as repo pear with no clone path, falling back to the factory cwd in the fleet client. This needs a semantic normalization decision from the author.

Fixed

  • Updated stale downstream CLI dry-run expectation for the new label-derived implementer name in packages/factory-sdk/src/cli/fleet.test.ts:269.

Addressed comments

  • gemini-code-assist[bot]: raised only a daily quota warning; no code issue to address.
  • coderabbitai[bot]: raised only a review rate-limit warning; no code issue to address.

Verification

  • npx vitest run packages/factory-sdk/src/orchestrator/factory.test.ts passed.
  • npx vitest run packages/factory-sdk/src/cli/fleet.test.ts passed.
  • npm run typecheck:web passed.
  • npm run typecheck:node passed.
  • npm test passed: 122 tests.
  • npx vitest run passed: 54 files, 838 tests.
  • npm run build passed.
  • npm run verify:mcp-resources-drift passed.
  • npm run lint could not be verified locally: full eslint . was killed by the sandbox twice, including with NODE_OPTIONS=--max-old-space-size=4096.

@agent-relay-code

Copy link
Copy Markdown
Contributor

ℹ️ pr-reviewer: review only — no file changes were applied to the PR (nothing to commit after review). The notes below are advisory and were not pushed.

Findings

  1. packages/factory-sdk/src/orchestrator/factory.ts: labelDerivedDispatchDecision discards non-label triage routes. When no repo label matches, it goes directly to defaultRouteAssignment(config), so issues routed by existing repos.byProject or repos.keywordRules are now dispatched to repos.default instead. The existing triage order still supports label -> project -> keyword -> default in heuristic.ts, but dispatch overwrites that decision. This should preserve the already-triaged route when there are no repo labels, and only override when repo labels are actually authoritative.

Addressed Comments

  • No bot or reviewer comments were available in .workforce/context.json; it only contains PR identity/ref metadata.

Validation

  • Ran npx vitest run packages/factory-sdk/src/orchestrator/factory.test.ts: passed, 187 tests.
  • Tried npm run lint: failed because eslint was missing from the existing install.
  • Tried npm ci multiple ways, including --ignore-scripts --no-audit: npm exited -1 with no final error; this sandbox has Node v25.6.0 while CI uses Node 22.
  • No files were edited; git status --short is clean.

Not printing READY because there is a validated behavioral finding and full CI-equivalent validation could not complete here.

@agent-relay-code

Copy link
Copy Markdown
Contributor

⚠️ pr-reviewer did not push — CI was already red for test files the proposed changes also modified, so fixes were withheld for human review. The notes below are advisory and were not pushed.

Blocked files:

packages/factory-sdk/src/cli/fleet.test.ts (already red: checks)

Findings

  • packages/factory-sdk/src/orchestrator/factory.ts:3355: labelDerivedDispatchDecision() now replaces triage routing with label/default-only routing, bypassing the existing byLabel -> byProject -> keywordRules -> default chain documented in packages/factory-sdk/README.md and tested in triage. This is semantic and should be author-fixed.
  • packages/factory-sdk/src/orchestrator/factory.ts:3435: label dispatch uses raw repos.byLabel values as repo keys, so bare repo config like { pear: "pear" } can lose the configured clonePaths["AgentWorkforce/pear"]. This needs an explicit normalization decision.
  • packages/factory-sdk/src/orchestrator/factory.ts:1070: invalid-label dispatch comments can be posted repeatedly because the issue stays Ready and no dispatch attempt/terminal marker is recorded. I did not edit this dispatch/lifecycle behavior per safety instructions.

Fixed

Updated stale downstream CLI dry-run expectation for label-derived implementer naming:
packages/factory-sdk/src/cli/fleet.test.ts:269

Addressed comments

  • gemini-code-assist[bot]: quota warning only; no code issue.
  • coderabbitai[bot]: no actionable review comments; docstring coverage and ESLint install notes are advisory/tooling warnings, no PR code change.
  • chatgpt-codex-connector[bot]: raised repeated invalid-label comments at factory.ts:1070; validated current code, left unchanged because it is dispatch/lifecycle behavior requiring human-authored logic.
  • agent-relay-code[bot]: stale CLI dry-run expectation fixed in packages/factory-sdk/src/cli/fleet.test.ts:269; routing precedence and bare-repo normalization findings validated and left as semantic author work.

Verification

  • npm ci
  • npm run verify:mcp-resources-drift
  • NODE_OPTIONS=--max-old-space-size=4096 npm run lint passed with warnings only
  • npm run typecheck:web
  • npm run typecheck:node
  • npm test
  • npx vitest run packages/factory-sdk/src/orchestrator/factory.test.ts packages/factory-sdk/src/cli/fleet.test.ts
  • npx vitest run passed on rerun; first full run had one local timing miss in a heartbeat test, exact rerun passed
  • npm run build

GitHub still reports the old head checks job as failed until this local fix is pushed and CI reruns, so I am not marking READY.

@agent-relay-code

Copy link
Copy Markdown
Contributor

Findings

  • packages/factory-sdk/src/orchestrator/factory.ts:3360: labelDerivedDispatchDecision() bypasses the existing route precedence byLabel -> byProject -> keywordRules -> default and falls straight to repos.default when labels do not map. That contradicts packages/factory-sdk/src/triage/heuristic.ts:99 and packages/factory-sdk/README.md:147. This is semantic routing behavior, so I did not edit it.

  • packages/factory-sdk/src/orchestrator/factory.ts:3435: label dispatch uses the raw repos.byLabel value as the repo key for clonePaths. Existing coverage at packages/factory-sdk/src/orchestrator/factory.test.ts:1512 shows bare repo values like { pear: "pear" } are supported elsewhere with clone paths keyed by AgentWorkforce/pear; this path would lose the clone path. This needs an explicit author decision.

  • packages/factory-sdk/src/orchestrator/factory.ts:1070: the unresolved inline thread is valid. Invalid-label dispatch posts a Linear comment and returns without moving the issue, recording a terminal attempt, or deduping the notification, so replay/runOnce can post it repeatedly. I did not edit this because it is dispatch/lifecycle behavior.

Addressed comments

  • gemini-code-assist[bot]: quota warning only; no code issue.
  • coderabbitai[bot]: no actionable review comments; docstring coverage and ESLint install notes are tooling/advisory only.
  • chatgpt-codex-connector[bot]: repeated invalid-label comment at packages/factory-sdk/src/orchestrator/factory.ts:1070; valid, left unchanged as lifecycle/dispatch behavior.
  • agent-relay-code[bot] comment 4708864493: routing precedence and bare-repo normalization findings are valid; CLI dry-run expectation is stale at packages/factory-sdk/src/cli/fleet.test.ts:269, but I reverted the mechanical edit because full CI-equivalent verification could not complete in this sandbox.
  • agent-relay-code[bot] comment 4708935122: routing precedence finding is valid and still present at packages/factory-sdk/src/orchestrator/factory.ts:3360.
  • agent-relay-code[bot] comment 4708986502: routing precedence, bare-repo normalization, repeated invalid-label comment, and stale CLI expectation are all valid; no code left changed due verification limits.

Verification

  • npx vitest run packages/factory-sdk/src/cli/fleet.test.ts packages/factory-sdk/src/orchestrator/factory.test.ts passed with the mechanical CLI expectation edit before I reverted it.
  • npm run verify:mcp-resources-drift passed.
  • npm ci failed with exit code -1 and no npm error output under local Node v25.6.0; CI uses Node 22.
  • Full lint/typecheck/test/build could not be completed because the failed install left missing local binaries/packages (eslint, electron-vite, React/Zustand/xterm/happy-dom, etc.).
  • I removed the incomplete node_modules tree and reverted my local file edit.

@agent-relay-code

Copy link
Copy Markdown
Contributor

ℹ️ pr-reviewer: review only — no file changes were applied to the PR (nothing to commit after review). The notes below are advisory and were not pushed.

Findings

  • packages/factory-sdk/src/orchestrator/factory.ts:3360: labelDerivedDispatchDecision() bypasses the existing route precedence byLabel -> byProject -> keywordRules -> default and falls straight to repos.default when labels do not map. That contradicts packages/factory-sdk/src/triage/heuristic.ts:99 and packages/factory-sdk/README.md:147. This is semantic routing behavior, so I did not edit it.

  • packages/factory-sdk/src/orchestrator/factory.ts:3435: label dispatch uses the raw repos.byLabel value as the repo key for clonePaths. Existing coverage at packages/factory-sdk/src/orchestrator/factory.test.ts:1512 shows bare repo values like { pear: "pear" } are supported elsewhere with clone paths keyed by AgentWorkforce/pear; this path would lose the clone path. This needs an explicit author decision.

  • packages/factory-sdk/src/orchestrator/factory.ts:1070: the unresolved inline thread is valid. Invalid-label dispatch posts a Linear comment and returns without moving the issue, recording a terminal attempt, or deduping the notification, so replay/runOnce can post it repeatedly. I did not edit this because it is dispatch/lifecycle behavior.

Addressed comments

  • gemini-code-assist[bot]: quota warning only; no code issue.
  • coderabbitai[bot]: no actionable review comments; docstring coverage and ESLint install notes are tooling/advisory only.
  • chatgpt-codex-connector[bot]: repeated invalid-label comment at packages/factory-sdk/src/orchestrator/factory.ts:1070; valid, left unchanged as lifecycle/dispatch behavior.
  • agent-relay-code[bot] comment 4708864493: routing precedence and bare-repo normalization findings are valid; CLI dry-run expectation is stale at packages/factory-sdk/src/cli/fleet.test.ts:269, but I reverted the mechanical edit because full CI-equivalent verification could not complete in this sandbox.
  • agent-relay-code[bot] comment 4708935122: routing precedence finding is valid and still present at packages/factory-sdk/src/orchestrator/factory.ts:3360.
  • agent-relay-code[bot] comment 4708986502: routing precedence, bare-repo normalization, repeated invalid-label comment, and stale CLI expectation are all valid; no code left changed due verification limits.

Verification

  • npx vitest run packages/factory-sdk/src/cli/fleet.test.ts packages/factory-sdk/src/orchestrator/factory.test.ts passed with the mechanical CLI expectation edit before I reverted it.
  • npm run verify:mcp-resources-drift passed.
  • npm ci failed with exit code -1 and no npm error output under local Node v25.6.0; CI uses Node 22.
  • Full lint/typecheck/test/build could not be completed because the failed install left missing local binaries/packages (eslint, electron-vite, React/Zustand/xterm/happy-dom, etc.).
  • I removed the incomplete node_modules tree and reverted my local file edit.

@agent-relay-code

Copy link
Copy Markdown
Contributor

Findings

  • P1: Dispatch now ignores non-label triage routes.
    factory.ts derives routes only from issue.labels, then falls back to repos.default. Existing config and triage still support repos.byProject and keywordRules (schema.ts, heuristic.ts), so a high-confidence project/keyword/LLM route can now be silently replaced with the default repo at dispatch. This is semantic routing behavior; I did not edit it. Suggested fix: preserve label-derived identities when labels match, but fall back to the already-triaged decision.routes before using repos.default or blocking.

Addressed Comments

  • No bot or reviewer comments were present in .workforce/context.json.

Changes Made

  • Fixed a stale CLI dry-run test expectation for the PR’s new implementer naming contract: fleet.test.ts.

Local Validation

  • npm ci
  • npm run verify:mcp-resources-drift
  • npm run lint passed with existing warnings only
  • npm run typecheck:web
  • npm run typecheck:node
  • npm test
  • npx vitest run
  • npm run build

I did not verify GitHub mergeability or remote check status from GitHub, so I’m not marking this READY.

@agent-relay-code

Copy link
Copy Markdown
Contributor

Findings

  • factory.ts: labelDerivedDispatchDecision() only uses label routes, then falls directly to repos.default. That bypasses the documented and tested precedence byLabel -> byProject -> keywordRules -> default in heuristic.ts and README.md. This is semantic routing behavior, so I left it for an author patch.

  • factory.ts: label dispatch uses raw repos.byLabel values as repo keys for clonePaths. Existing behavior supports bare repo mappings like { pear: "pear" }, but this path would look up clonePaths["pear"] instead of clonePaths["AgentWorkforce/pear"]. Needs an explicit normalization decision.

  • factory.ts: invalid-label/no-route dispatch posts a Linear comment and returns without changing state, recording a terminal attempt, or deduping the notice. Replays or the writeback event itself can post duplicate comments. This is dispatch/lifecycle behavior, so I did not auto-edit it.

Fixed

  • Updated the stale CLI dry-run expectation to the PR’s repo-suffixed implementer name in fleet.test.ts.

Addressed comments

  • gemini-code-assist[bot]: quota warning only; no code issue.
  • coderabbitai[bot]: no actionable review comments; docstring coverage and ESLint install notes are tooling/advisory only.
  • chatgpt-codex-connector: repeated invalid-label comment at factory.ts; valid, left unchanged as lifecycle/dispatch behavior.
  • agent-relay-code[bot] comment 4708986502: stale CLI dry-run expectation fixed in fleet.test.ts; routing precedence, bare-repo normalization, and repeated invalid-label comment findings remain valid semantic/safety items.
  • agent-relay-code[bot] comments 4709042699 and 4709043845: same validated findings; no additional code changes beyond the mechanical CLI expectation update.

Verification

  • npm ci
  • npx vitest run packages/factory-sdk/src/cli/fleet.test.ts packages/factory-sdk/src/orchestrator/factory.test.ts
  • npm run verify:mcp-resources-drift
  • NODE_OPTIONS=--max-old-space-size=4096 npm run lint passed with warnings only
  • npm run typecheck:web
  • npm run typecheck:node
  • npm test
  • npx vitest run
  • npm run build

Not printing READY because validated semantic findings and the unresolved invalid-label thread still need human-authored changes.

@agent-relay-code

Copy link
Copy Markdown
Contributor

Findings

  • P1 factory.ts: labelDerivedDispatchDecision() uses label routes, then falls directly to repos.default. That bypasses existing project and keyword routing still implemented in heuristic.ts. A project/keyword-routed issue can now be silently dispatched to the default repo. Semantic routing change, left for author patch.

  • P2 factory.ts: label dispatch uses raw repos.byLabel values as clonePaths keys. Existing coverage still documents bare repo mappings like { pear: "pear" } with clone paths keyed by AgentWorkforce/pear in factory.test.ts. This path would produce an undefined clone path for that supported shape. Semantic normalization decision, left unchanged.

  • P2 factory.ts: invalid-label/no-route dispatch posts a Linear comment and returns without changing state or recording a terminal/deduped attempt. Replays or the comment writeback event can post the same failure notice repeatedly. This is lifecycle/dispatch behavior, so I did not auto-edit it.

Fixed

  • Updated the stale CLI dry-run expectation to the new repo-suffixed implementer name at fleet.test.ts. This matches the remote CI failure exactly.

Addressed comments

  • gemini-code-assist[bot] comment 4708779759: quota warning only; no code issue.
  • coderabbitai[bot] comment 4708779882: no actionable review comments; docstring coverage and ESLint install warning are advisory/tooling notes.
  • chatgpt-codex-connector inline thread PRRC_kwDORoClls7Lf4sv: repeated invalid-label comments at factory.ts are valid; left unchanged because it is lifecycle/dispatch behavior.
  • agent-relay-code[bot] comment 4709043845: stale CLI expectation fixed at fleet.test.ts; routing precedence, bare-repo clone path, and repeated invalid-label findings remain valid semantic/safety items.
  • agent-relay-code[bot] comment 4709116854: routing precedence finding remains valid at factory.ts; no semantic edit applied.
  • agent-relay-code[bot] comment 4709126035: stale CLI expectation fixed at fleet.test.ts; remaining findings are still valid and left for author changes.

Verification

  • npm ci
  • npx vitest run packages/factory-sdk/src/cli/fleet.test.ts packages/factory-sdk/src/orchestrator/factory.test.ts
  • npm run verify:mcp-resources-drift
  • NODE_OPTIONS=--max-old-space-size=4096 npm run lint passed with existing warnings only
  • npm run typecheck:web
  • npm run typecheck:node
  • npm test
  • npx vitest run
  • npm run build
  • Final npm run verify:mcp-resources-drift

Remote PR metadata reports mergeable, but the current remote CI run is still failed until this local mechanical fix is picked up. I’m not printing READY because the semantic findings and unresolved invalid-label thread still need a human-authored patch.

@agent-relay-code

Copy link
Copy Markdown
Contributor

Findings

  • factory.ts: labelDerivedDispatchDecision() uses only label routes, then falls directly to repos.default. That bypasses existing byProject and keywordRules precedence in heuristic.ts. This is semantic routing behavior, so I left it for an author patch.

  • factory.ts: label dispatch uses the raw repos.byLabel value as the clonePaths key. Existing behavior supports bare repo mappings like { pear: "pear" }, but this path looks up clonePaths["pear"] instead of clonePaths["AgentWorkforce/pear"]. This needs an explicit normalization decision.

  • factory.ts: invalid-label/no-route dispatch posts a Linear comment and returns without changing state, recording a terminal attempt, or deduping the notice. Replays can post duplicate comments. This is dispatch/lifecycle behavior, so I did not auto-edit it.

Fixed

  • Updated the stale CLI dry-run expectation for repo-suffixed implementer names in fleet.test.ts.

Addressed comments

  • gemini-code-assist[bot]: quota warning only; no code issue.
  • coderabbitai[bot]: no actionable review comments; docstring coverage and ESLint install notes are advisory/tooling only.
  • chatgpt-codex-connector[bot]: repeated invalid-label comment at factory.ts; valid, left unchanged as lifecycle/dispatch behavior.
  • agent-relay-code[bot] comments 4708864493, 4708935122, 4708986502, 4709042699, 4709043845, 4709116854, 4709126035: stale CLI dry-run expectation fixed in fleet.test.ts; routing precedence, bare-repo normalization, and duplicate invalid-label comment findings remain valid semantic/safety items.

Verification

Passed locally:

  • npm ci
  • npx vitest run packages/factory-sdk/src/cli/fleet.test.ts packages/factory-sdk/src/orchestrator/factory.test.ts
  • npm run verify:mcp-resources-drift
  • npm run lint with existing warnings only
  • npm run typecheck:web
  • npm run typecheck:node
  • npm test
  • npx vitest run
  • npm run build
  • npm run build:web
  • npx playwright test --config playwright.fidelity.config.ts
  • npx playwright test --config playwright.redraw.config.ts

I did not print READY because the semantic findings still need human-authored changes, and I could not verify macOS packaging or full GitHub mergeability from this sandbox.

@agent-relay-code

Copy link
Copy Markdown
Contributor

No PR-code findings after tracing the label-derived factory dispatch changes.

I made one downstream test-expectation fix: packages/factory-sdk/src/cli/fleet.test.ts now expects ar-77-impl-pear, matching the new label-derived implementer identity.

Addressed comments

  • No bot or reviewer comments were present in the provided .workforce context files.

Validation

Passed:

  • npm run verify:mcp-resources-drift
  • npm run lint with existing warnings only, no errors
  • npm run typecheck
  • npm test
  • npx vitest run
  • npm run build:web
  • npm run build
  • npx playwright install chromium

Failed, apparently unrelated to this factory SDK PR:

  • npx playwright test --config playwright.fidelity.config.ts: 3 terminal renderer timeout/fidelity failures
  • npx playwright test --config playwright.redraw.config.ts: 1 redraw drain timeout failure

I did not modify renderer or terminal code because those failures are outside this PR’s scope and not mechanical fixes.

khaliqgant and others added 5 commits June 15, 2026 19:51
Remove defaultRouteAssignment/repoSlug so an unlabeled or unmapped issue
fails dispatch loudly instead of silently routing to repos.default. Cap
label implementers at MAX_LABEL_IMPLEMENTERS=4 and rebind the reviewer to
the first label route via routeReviewerSpec().

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…74-label-dispatch

# Conflicts:
#	packages/factory-sdk/src/orchestrator/factory.ts
- fleet.test.ts: implementer name is now repo-slug suffixed (ar-77-impl-pear)
  under label routing.
- Dedupe the invalid-label dispatch failure comment by reason+offending-labels
  signature so a stuck Ready issue (or the writeback's own change event) no
  longer re-posts the same notice every cycle; clear on successful dispatch.

Addresses Codex review on PR #363.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Merge origin/main (#360 webhook handler, #362 park completed PRs). The
ar-366 re-dispatch and ar-243 PR-state sweep tests came from main with
pre-label-routing implementer names; under AR-274 label routing the
implementer is repo-slug suffixed (ar-366-impl-pear / ar-243-impl-pear).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@khaliqgant khaliqgant merged commit ad29e08 into main Jun 15, 2026
5 checks passed
@khaliqgant khaliqgant deleted the ar-274-label-dispatch branch June 15, 2026 18:09
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.

1 participant