Skip to content

Fix first-use work-queue pool and worker registration - #71787

Merged
pelikhan merged 1 commit into
mainfrom
pelikhan-congenial-fiesta
Oct 25, 2026
Merged

pelikhan merged 1 commit into
mainfrom
pelikhan-congenial-fiesta

Conversation

@pelikhan

Copy link
Copy Markdown
Collaborator

Why

smoke-work-queue was configured and compiled, but its pool and worker were absent from installed Policy. First use failed before admission or launch because automatic pool installation could only reuse already-installed worker authority. Adding a new worker therefore required the manual, quiescent Policy update that first-use installation should avoid.

Approach

  • Extend PoolInstall to add missing worker profiles as well as new pools. Trusted submit/dispatch processing verifies genuinely new workers against the immutable default revision: worker-enabled Markdown source, matching compiled assignment contract, canonical workflow path, singleton repository-scoped authority, and active native registration. config_ref records provenance; it does not grant authority by itself.
  • Preserve installed profiles, pool defaults and economics, deployment history and availability, active Claims, accepted Work, fairness debt, and the Policy epoch. Existing authority cannot be replaced or an unavailable known revision revived through registration. Incompatible changes still require an administrator Policy update on a quiescent queue.
  • Align Go/JavaScript replay and native publication evidence, generated schemas, checkpoint/parity fixtures, the bounded formal model, and smoke/deployment guidance.

Workers, observers, previews, and accepted-request recovery cannot trigger registration. No live queue mutation, workflow dispatch, reset, cancellation, or forced completion was performed.

Validation

  • Full go test ./pkg/workqueue -count=1 passed; focused registration/checkpoint tests passed again after lint-only helper extraction.
  • Queue JavaScript suites: 1,737 tests passed, 3 skipped. Coverage includes first-use registration through admission, Claim, native binding, original-worker completion, and independently verified Result, plus active-state preservation and rejection cases.
  • JavaScript typecheck, generated schema/fixture freshness, and all 11 QueuePoolInstall TLC configurations passed.
  • make fmt, make lint-cjs, make recompile, exact smoke-dispatcher compilation, and workflow drift checks passed. Exact smoke compilation produced no warnings; full-repository compilation retained unrelated warnings.
  • make agent-report-progress passed impacted Go/JS tests but initially failed lint because of shared linter contention and the function-size limit. After helper extraction, make agent-report-progress-no-test completed the remaining formatting, lint, schema, and workflow-drift gates without repeating test-unit.

This publishes the implementation fix, not a production deployment or a claim that historical delivery failures have been repaired.

Verify new workers at the immutable default revision and register additive pool profiles without draining or resetting existing queue state. Keep Go and JavaScript replay, native evidence checks, schemas, checkpoints, formal models and deployment guidance aligned.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@pelikhan
pelikhan marked this pull request as ready for review October 25, 2026 02:25
Copilot AI max review requested due to automatic review settings October 25, 2026 02:26
@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Ponytail Reviewer

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Ponytail Reviewer · gpt56 · ~16 AIC · ⌖ ~7 AIC · ⊞ 14.8K · ◷

Generated by Ponytail Reviewer for #71787

@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Test Quality Sentinel · sonnet50 · ~19 AIC · ⌖ ~16 AIC · ◇ ~7 AIC · ⊞ 12.7K · ◷

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft.

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

Copy link
Copy Markdown
Contributor

✅ Design Decision Gate — ADR Verified

ADR reviewed: ADR-71495: Additive First-Use Pool Installation for AW-Managed Work Queues. This PR revises that ADR on the branch, and the implementation matches the revised decision. 🏗️

Next action: When the design is final, review the ADR and change its status from Draft to Accepted. You can also link it in the PR body for traceability.

📋 Verification Summary

Why the gate ran: The PR adds 262 lines under pkg/, which is over the 100-line threshold. It does not have the implementation label.

ADR completeness: The ADR has Context, Decision, Alternatives Considered (3), and Consequences (Positive, Negative and Neutral).

How the code matches the revised Decision (pool installation can now also add missing worker profiles):

  • pkg/workqueue/replay.go: Installing into an existing pool can only add profiles. The non-profile pool config must stay identical, so economics and allowed_repositories are preserved. Installed profiles cannot be changed or removed. New workers must pass newDefaultWorkerProfile: the canonical .lock.yml path, MaxClaims == 1, no shared keys, Ref == config_ref, and an immutable non-zero revision. This matches the requirements for canonical paths and singleton, repository-scoped authority.
  • pkg/workqueue/provisioning_pool.go: The trusted publisher verifies new worker names against the verified default revision. It then checks for an active configured deployment with a matching compiled logical contract and runs verifyWorkerRouteOnce. This matches the ADR statement that config_ref records provenance but does not grant authority by itself.
  • PoolInstallOperation.ConfigRef (types.go) and the regenerated JSON schemas add the provenance field described in the ADR.
  • The JS replay and publishers (work_queue_pool_install.cjs, work_queue_replay.cjs), checkpoint fixtures, and the QueuePoolInstall.tla model with the new PoolInstallNewWorker* / PoolInstallExistingPool configs match the ADR statement that Go and JS replay, checkpoint parity and the TLA+ model enforce the transition.
  • The revised Negative consequence (live source verification is a publisher obligation; replay enforces only structural provenance) accurately describes the split between provisioning_pool.go and replay.go.

No divergences or uncovered architectural changes found.

🏗️ ADR gate enforced by Design Decision Gate 🏗️ · pi · opus55 · ~24 AIC · ⌖ ~37 AIC · ⊞ 1.9K · ◷
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review: no blocking findings

I found no actionable correctness, security, or performance issue in the changed lines. The specialist pass was unavailable because its file-read invocation was denied; this review is based on the prefetched diff and targeted source inspection. No tests were run, per the static-review instructions.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~3 AIC · ⌖ ~1 AIC · ⊞ 1.6K
Comment /review to run again

@pelikhan
pelikhan merged commit 5428b7e into main Oct 25, 2026
133 of 151 checks passed
@pelikhan
pelikhan deleted the pelikhan-congenial-fiesta branch October 25, 2026 02:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Cross-engine worker authorization and active-state preservation require human review, particularly with unresolved registration failures.

4 open issues
What changed in this PR

This PR extends gh-aw’s work queue so trusted first-use processing can register new workers and install pools without draining existing work.

Changes:

  • Add default-revision worker verification and additive profile registration.
  • Align Go and JavaScript replay, publication checks, schemas, and deployment preservation.
  • Expand tests, formal-model scenarios, fixtures, and operational guidance.
File Description
specs/​work-queue/​transactions.tsp Add optional registration provenance.
specs/​work-queue/​README.md Document registration assumptions and model scenarios.
specs/​work-queue/​QueuePoolInstall.tla Model profile additions and deployment preservation.
specs/​work-queue/​PoolInstallUnauthorized.cfg Set new model parameters for unauthorized publication.
specs/​work-queue/​PoolInstallUnapprovedRoute.cfg Preserve the unapproved-route rejection scenario.
specs/​work-queue/​PoolInstallProducerWitness.cfg Update the producer-installation witness parameters.
specs/​work-queue/​PoolInstallNewWorkerWitness.cfg Add a new-worker registration witness.
specs/​work-queue/​PoolInstallNewWorker.cfg Cover verified registration in a new pool.
specs/​work-queue/​PoolInstallInvalidRoute.cfg Update invalid-route model parameters.
specs/​work-queue/​PoolInstallInvalidProposal.cfg Update invalid-proposal model parameters.
specs/​work-queue/​PoolInstallInvalidPool.cfg Update invalid-pool model parameters.
specs/​work-queue/​PoolInstallExpandedRepositoryAllowlist.cfg Preserve repository-expansion rejection coverage.
specs/​work-queue/​PoolInstallExistingPool.cfg Cover registration in an existing pool.
specs/​work-queue/​PoolInstall.cfg Set baseline registration model parameters.
specs/​work-queue/​fixtures/​generate_prefix.py Generate an additive worker-registration transaction.
specs/​work-queue/​fixtures/​canonical-prefix.json Add registration replay and expected-prefix fixtures.
specs/​work-queue/​check.sh Run the three new model scenarios.
pkg/​workqueue/​types.go Add PoolInstallOperation.ConfigRef.
pkg/​workqueue/​schema/​RequestParameters.json Allow provenance in request parameters.
pkg/​workqueue/​schema/​QueueRequest.json Allow provenance in queue requests.
pkg/​workqueue/​schema/​QueueOperation.json Allow provenance in queue operations.
pkg/​workqueue/​schema/​QueueCommit.json Allow provenance in committed operations.
pkg/​workqueue/​schema/​PoolInstallOperation.json Extend the generated installation schema.
pkg/​workqueue/​schema/​OperationsParameters.json Extend operation-parameter validation.
pkg/​workqueue/​replay.go Support additive profiles and validate authority boundaries.
pkg/​workqueue/​provisioning_pool.go Verify new workers before native publication.
pkg/​workqueue/​pool_install_test.go Cover registration, state preservation, and rejection cases.
pkg/​workqueue/​evidence.go Route installation requests through evidence verification.
pkg/​workqueue/​deployment.go Preserve existing deployment records during initialization.
docs/​src/​content/​docs/​specs/​work-queue-specification.md Specify additive registration and verification requirements.
docs/​src/​content/​docs/​reference/​work-queue.md Update first-use setup and recovery guidance.
docs/​src/​content/​docs/​patterns/​workqueue-ops.md Explain registration without draining existing work.
docs/​adr/​71495-additive-first-use-work-queue-pool-installation.md Record the expanded registration decision and trust boundary.
actions/​setup/​js/​work_queue_replay.cjs Support additive registration in JavaScript replay.
actions/​setup/​js/​work_queue_pool_install.cjs Discover and verify missing worker profiles.
actions/​setup/​js/​work_queue_logging.test.cjs Update recovery-message expectations.
actions/​setup/​js/​work_queue_logging.cjs Explain registration failures and recovery steps.
actions/​setup/​js/​work_queue_dispatch.test.cjs Extend first-use lifecycle and preservation coverage.
actions/​setup/​js/​work_queue_dispatch.cjs Invoke registration during submission and dispatch processing.
actions/​setup/​js/​work_queue_deployment.cjs Retain existing deployment history during initialization.
.github/​workflows/​smoke-work-queue-dispatcher.md Update smoke instructions for first-use registration.
.github/​workflows/​smoke-work-queue-dispatcher.lock.yml Refresh generated body and admission hashes.
.github/​aw/​work-queue.md Update internal registration and preservation guidance.
.changeset/​patch-work-queue-worker-registration.md Add the patch-release note.

Review effort: Max

if (missing.length) throw queueError("work_queue_pool_not_installed", "the requested pool is absent from the installed Policy and no compiled pool proposal is available");
return latest;
}
const targets = poolNames.filter(name => missing.includes(name) || Object.keys(proposal.pools[name]?.profiles ?? {}).some(profile => !Object.hasOwn(latest.projection.policy.pools[name].profiles, profile)));
let configRef;
for (const [poolName, pool] of candidates) {
for (const [name, profile] of Object.entries(pool.profiles)) {
const installed = latest.projection.policy.pools[poolName]?.profiles[name];
Comment thread pkg/workqueue/replay.go
Comment on lines +419 to +420
if _, exists := state.Policy.Pools[install.Pool].Profiles[name]; exists {
continue
/\ publications = 0
/\ installedPools' = IF ExtendExistingPool THEN installedPools
ELSE installedPools \cup {NewPool}
/\ registeredProfiles' = registeredProfiles \cup {"new-worker"}
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.93.4

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.

2 participants