Repository navigation
Clarify why the ESLint factory cannot dispatch workers - #67217
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot update the work-queue protocol to automatically provision the work-queue branch when a workqueue produced submits work. (In the safe outputs). Update specs, TLA+, safeoutputs runtime. Treat missing branch as empty. Remove requirement for admin to seed the work-queue. |
There was a problem hiding this comment.
🟡 Changes recommended
The new message incorrectly directs custom-branch users to protect the default branch.
1 open finding
What changed in this PR
Clarifies that absent queue infrastructure blocks ESLint factory worker dispatch and adds regression coverage.
Changes:
- Reports uninitialized queues with administrator guidance.
- Tests that absent queues remain uninitialized without Policy installation.
- Documents required queue protection and Policy provisioning.
| File | Description |
|---|---|
docs/src/content/docs/patterns/linter-factory.md |
Documents provisioning prerequisites. |
actions/setup/js/write_work_queue_snapshot.test.cjs |
Adds absent-queue regression coverage. |
actions/setup/js/write_work_queue_snapshot.cjs |
Improves activation logging. |
🧠 Review effort: Balanced
| configuration.core.setOutput?.("work_queue_origin", canonical(snapshot.origin)); | ||
| configuration.core.info( | ||
| `Work queue activation: ${worker ? `${worker.claims.length} immutable Claims authenticated${staged ? " for staged preview (not bound)" : " and bound"}` : runtime.role === "observer" ? "read-only observer" : "unassigned queue-control context"}; snapshot captured` | ||
| `Work queue activation: ${worker ? `${worker.claims.length} immutable Claims authenticated${staged ? " for staged preview (not bound)" : " and bound"}` : latest.sha === null ? "queue uninitialized; an administrator must protect the work-queue branch and install Policy before workers can be dispatched" : runtime.role === "observer" ? "read-only observer" : "unassigned queue-control context"}; snapshot captured` |
There was a problem hiding this comment.
The activation diagnostic now uses the configured queue branch, defaulting to WORK_QUEUE_BRANCH; the regression test covers a custom branch. Fixed in b58cc77f.
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft. No ADR enforcement needed for PR #67217: the PR does not carry the implementation label (has_implementation_label=false) and has 0 new lines in business logic directories (default_business_additions=0, threshold=100, 3 files changed, no custom .design-gate.yml).
|
|
✅ PR Code Quality Reviewer completed the code quality review. No GitHub write was emitted because safeoutputs review commands returned permission denied from the runtime.
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
|
✅ Ponytail Reviewer completed successfully! Lean already. Ship.
|
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality Sentinel skipped because pre-fetch PR data was unavailable: unable to fetch test file diff
|
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Comment MemoryPeek at saved memory (pr-code-quality-reviewer)Note This comment is managed by comment memory.Expand the saved memory block to view or edit the persistent context for this thread.
|
There was a problem hiding this comment.
Verdict
The new uninitialized-queue path still hard-codes the queue branch name, and the added regression test now cements that assumption instead of catching it.
Blocking theme
Any workflow that uses a non-default queue branch will get operator guidance for the wrong branch when the queue is absent. Because this PR is specifically trying to clarify that failure mode, the coverage needs to assert the configured branch instead of the baked-in work-queue string.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt54 · 36.1 AIC · ⌖ 7.36 AIC · ⊞ 19.6K
Comment /review to run again
| expect(snapshot).toMatchObject({ sha: null, worker: null, role: "dispatcher" }); | ||
| expect(initialize).not.toHaveBeenCalled(); | ||
| expect(readWorkQueueState(loadWorkQueueSnapshot(options.snapshotPath)).queue_state).toBe("uninitialized"); | ||
| expect(options.core.info).toHaveBeenCalledWith(expect.stringContaining("administrator must protect the work-queue branch and install Policy")); |
There was a problem hiding this comment.
This assertion hard-codes work-queue, so the regression test will still pass while the runtime tells operators to protect the wrong branch whenever a workflow uses options.branch.
💡 Assert the configured branch
loadQueue() already accepts options.branch, but this test never sets one and then locks in the literal default branch name. Pass a custom branch (for example "custom-queue") and assert that the info message includes that branch so the test actually catches the runtime bug.
There was a problem hiding this comment.
The absent-queue regression test now sets branch: "custom-queue" and asserts that branch appears in the activation guidance. Fixed in b58cc77f.
Implemented and pushed in |
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /grill-with-docs — this is a small, well-scoped diagnostic + doc clarification. One outstanding issue from the earlier Copilot review (hardcoded branch name) remains unaddressed in the new log line.
📋 Key Themes & Highlights
Key Themes
- Hardcoded branch name: the new
work-queue branchwording in the log message ignores the configurableoptions.branchalready forwarded byloadQueue, repeating a gap flagged in a prior unresolved review comment on the same line. - Regression test is solid: the new
write_work_queue_snapshot.test.cjscase correctly assertsqueue_state: uninitialized, no implicitinitializeWorkQueuecall, and the new log text — good/tddcoverage for this exact scenario. - Docs clarification is accurate and consistent with existing guidance in
deploy-work-queue.md("Protect the queue branch and install Policy"), reinforcing the existing domain vocabulary instead of inventing new terms.
Positive Highlights
- ✅ Test precisely pins both the behavior (
initializenot called) and the new operator-facing message text. - ✅ Docs addition uses existing terminology (
work-queuebranch, Policy,queue_state) rather than introducing new concepts. - ✅ Change is narrowly scoped to the exact failure mode it documents, with no unrelated edits.
No blocking issues; the branch-name hardcoding is worth fixing before merge but isn't a regression introduced by broader scope creep.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet50 · 98.9 AIC · ⌖ 14.5 AIC · ⊞ 10.1K
Comment /matt to run again
| configuration.core.setOutput?.("work_queue_origin", canonical(snapshot.origin)); | ||
| configuration.core.info( | ||
| `Work queue activation: ${worker ? `${worker.claims.length} immutable Claims authenticated${staged ? " for staged preview (not bound)" : " and bound"}` : runtime.role === "observer" ? "read-only observer" : "unassigned queue-control context"}; snapshot captured` | ||
| `Work queue activation: ${worker ? `${worker.claims.length} immutable Claims authenticated${staged ? " for staged preview (not bound)" : " and bound"}` : latest.sha === null ? "queue uninitialized; an administrator must protect the work-queue branch and install Policy before workers can be dispatched" : runtime.role === "observer" ? "read-only observer" : "unassigned queue-control context"}; snapshot captured` |
There was a problem hiding this comment.
[/grill-with-docs] The new log text hardcodes the literal string "work-queue branch", but loadQueue (work_queue_binding.cjs:36) already forwards a configurable options.branch. If a custom branch is ever used, this message will mislead the administrator about which branch to protect.
💡 Suggested fix
Use the actual configured branch name (falling back to the default) when building the message, e.g. thread options.branch || "work-queue" through to the log string instead of the literal text. This keeps the diagnostic accurate for non-default deployments and matches the existing not-yet-addressed review comment on this same line.
@copilot please address this.
There was a problem hiding this comment.
The activation diagnostic now names the configured branch (with WORK_QUEUE_BRANCH as the default). Fixed in b58cc77f.
There was a problem hiding this comment.
Impeccable review (refactor/cleanup — distill)
Reviewed the clarified ESLint-factory activation message and its new regression test / docs addition.
Findings:
- The new
latest.sha === nullbranch in the nested ternary atwrite_work_queue_snapshot.cjsis logically correct and matches the new test and docs wording ("administrator must protect the work-queue branch and install Policy"), consistent with existing deploy-work-queue docs. - Non-blocking: the ternary is now 4 levels deep on one ~417-character line, well past the repo's 240-char
printWidth. Left an inline suggestion to extract a small helper function for readability. - No correctness, security, or test-coverage issues found; the new test covers the exact scenario described in the PR body.
No blocking issues — approving with one optional readability suggestion.
🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · copilot · sonnet50 · 95 AIC · ⌖ 13.1 AIC · ⊞ 8.1K
| configuration.core.setOutput?.("work_queue_origin", canonical(snapshot.origin)); | ||
| configuration.core.info( | ||
| `Work queue activation: ${worker ? `${worker.claims.length} immutable Claims authenticated${staged ? " for staged preview (not bound)" : " and bound"}` : runtime.role === "observer" ? "read-only observer" : "unassigned queue-control context"}; snapshot captured` | ||
| `Work queue activation: ${worker ? `${worker.claims.length} immutable Claims authenticated${staged ? " for staged preview (not bound)" : " and bound"}` : latest.sha === null ? "queue uninitialized; an administrator must protect the work-queue branch and install Policy before workers can be dispatched" : runtime.role === "observer" ? "read-only observer" : "unassigned queue-control context"}; snapshot captured` |
There was a problem hiding this comment.
This nested ternary is hard to parse at a glance, and the resulting template-literal line is ~417 characters (vs. the repo's printWidth: 240 in .prettierrc.json). The logic itself is correct (verified: when worker is falsy and latest.sha === null, the new branch wins before the observer/default branches), but consider extracting the message selection into a small helper function for readability, e.g.:
function activationMessage({ worker, staged, latest, runtime }) {
if (worker) return `${worker.claims.length} immutable Claims authenticated${staged ? " for staged preview (not bound)" : " and bound"}`;
if (latest.sha === null) return "queue uninitialized; an administrator must protect the work-queue branch and install Policy before workers can be dispatched";
if (runtime.role === "observer") return "read-only observer";
return "unassigned queue-control context";
}Non-blocking, but would improve maintainability for future edits to this message.
@copilot please address this.
There was a problem hiding this comment.
Extracted activation message selection into activationMessage; it now also includes the configured queue branch for an absent queue. Fixed in b58cc77f.
|
@copilot address the following outstanding work in one pass:
Push the necessary fixes, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved. Use the pr-finisher skill and stop when only human review or CI remains; do not trigger CI. Sous-chef head: 9e0ba6a
|
…slint-factory-work-queue Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
…slint-factory-work-queue # Conflicts: # actions/setup/js/work_queue_replay.cjs # pkg/workqueue/policy.go Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Merged the latest |
…slint-factory-work-queue Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Merged the latest |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Fixed in |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Fixed in the latest commit: updated the stale assertion to verify automatic bootstrap with compiler-approved Policy and Work, while retaining the guard against choosing or modifying Policy. |
|
@copilot address the following outstanding work in one pass:
Push the necessary fixes, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved. Use the pr-finisher skill and stop when only human review or CI remains; do not trigger CI. Sous-chef head: 708cbbf
|
|
@copilot resolve the merge conflicts on this branch. |
…slint-factory-work-queue # Conflicts: # pkg/workflow/agy_engine_test.go # pkg/workqueue/replay.go Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Merged the latest |

The ESLint factory dispatcher is failing before it can admit work or launch workers. Its
work-queuebranch and installed Policy are missing.Worker execution remains blocked until an authorized administrator provisions the queue.