Skip to content

Give each work-queue Claim its full worker-finalizer verification budget - #79334

Merged
elefthei merged 4 commits into
mainfrom
work-queue-finalizer-verification-budget
Nov 19, 2026
Merged

elefthei merged 4 commits into
mainfrom
work-queue-finalizer-verification-budget

Conversation

@elefthei

@elefthei elefthei commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

The work-queue worker's own finalizer in safe_outputs could start after its delivery-verification deadline and make zero attempts, leaving a verifiable Claim delivery_pending. This gives each Claim its full worker-finalizer verification budget after ledger loading and the native-run check.

Problem

Smoke Work Queue Worker run 41657791793 failed in "Process Safe Outputs" with One or more Claim deliveries remain unverified… and work_queue_outcome=delivery_pending; run 42171469229 has the same signature. The Claim (effect_contract: none, no safe-output messages) would have verified on its first attempt.

Step First ledger load Then
Reconcile work queue claim 6m01s publishes Completion (work.completion_at)
Process Safe Outputs 6m09s finalizeWorkerResults starts 378 s after Completion

With the default reconciliation.deadline_ms: 300000, the remaining budget was negative, the verification loop never ran, and the manager failed the step.

Loads are slow because verifyCheckpointGitHistory re-verifies every checkpoint generation with one full ledger replay each (about 3 new generations a day), and its in-memory caches die with each github-script step, so one job pays that cost twice. Later daily runs pass only because the ledger is currently short; the cost grows every day.

Changes

Finalizer budget (finish_work_queue_claim.cjs)

  • When the original worker finalizes its own run, each Claim gets a separate verification window starting after that Claim's ledger reload and native-run check. Slow preflight work and earlier Claims do not consume its window.
  • The active worker deliberately retries verification after the Completion deadline, but cannot publish DeliveryFailure without terminal native-run evidence. Failure exhaustion, maintenance recovery, and missing-verifier expiry remain anchored at Completion.
  • Claim results report every verifier call in attempts, including a successful call whose proof is later discarded after a controls change. Manager diagnostics include that count.

Cache-integrity review resolution (03907c09)

  • Removed the cross-step disk verification cache, its compiler opt-in, generated environment variables, and cache-specific tests/docs.
  • Queue contents and checkpoint proofs are not loaded from a runner cache file. Only the existing process-local caches remain, and fresh clients verify authoritative Git data.
  • This PR no longer claims cross-step ledger-load speedups or changes generated workflow locks.

Connector CI repair (connectors_imports_test.go)

  • Select the named Linear review example rather than the first unrelated aw wrap fragment in the connector documentation.

Docs: per-Claim delivery-verification semantics in work-queue-specification.md, plus a patch changeset.

Review notes

  • Protocol. Replay already accepts a Result after deadline_ms and deadline-gates only DeliveryFailure; replay and exhaustion rules are unchanged. While its own run is active, the worker can publish only a verified Result. Maintenance still uses the original Completion deadline.
  • Security. Removing the disk cache addresses same-UID cache tampering, malformed cached ledgers, predictable temporary files, and disclosure of full ledger contents through shared runner mounts. No replacement disk cache or weaker trust check was introduced.
  • Reviewer threat warning. The detector verdict flagged the framework security-policy text as an actor interpolation; the quoted policy is present in actions/setup/md/xpia.md. It reported secret_leak: false and malicious_patch: false. This is separate from the valid cache-integrity finding addressed by removing the disk cache; no detector or security policy was disabled.

Validation

  • Current HEAD: aaf521f799cab14f4a5d050bc8068725198f816b.
  • CI at this HEAD: 106 successful checks, 14 skipped, no failed or pending checks in the inspected snapshot.
  • Local verification at this HEAD: npm --prefix actions/setup/js run test:js -- --no-file-parallelism finish_work_queue_claim.test.cjs safe_output_routing_parity.test.cjs work_queue_store.test.cjs work_queue_git_transport.test.cjs — 250 tests passed across 4 files (46.56 s).
  • Regression coverage includes slow initial and per-member ledger reads, slow native-run readback, separate windows for batched Claims, unchanged maintenance expiry, and nonzero attempt diagnostics for discarded proofs.
  • No workflow was manually dispatched for this PR.

… verification within a job

The worker's own trusted finalizer now measures its delivery-verification
budget from the later of Completion and the moment it holds the verified
ledger, so a slow ledger load in safe_outputs no longer leaves a verifiable
Claim delivery_pending with zero attempts. While its own run is active it
publishes only a verified Result; DeliveryFailure exhaustion, maintenance
recovery and missing-verifier expiry stay anchored at the original
Completion. Claim delivery diagnostics report the attempt count.

Trusted steps of one work-queue job reuse ledger checkpoint verification
through a private ${RUNNER_TEMP}/gh-aw/work-queue-verification.json that
compiled safe-output jobs opt into with GH_AW_WORK_QUEUE_VERIFICATION_CACHE.
Reuse is limited to Git transport for the same repository and branch; every
read still re-advertises the ref with its own credential, and shared, linked,
foreign or malformed cache files are ignored.

make recompile also refreshes the two LangGraph lock files that predate the
TMPDIR exclusion from #79277.
@elefthei
elefthei marked this pull request as ready for review November 19, 2026 20:10
Copilot AI adaptive review requested due to automatic review settings November 19, 2026 20:10
@github-actions

github-actions Bot commented Nov 19, 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 · copilot · routed: haiku55 xhigh · ~8 AIC · ⌖ ~2 AIC · ⊞ 6.7K · ◷

@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Specification Reviewer completed successfully!

PR Specification Reviewer

Outcome: reported_action

The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken.

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

Generated by PR Specification Reviewer for #79334 · copilot · gpt56 · ~3 AIC · ⌖ ~2 AIC · ⊞ 1.7K · ◷

@github-actions

github-actions Bot commented Nov 19, 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 by Ponytail Reviewer for #79334 · codex · routed: gpt61 medium · ~6 AIC · ⌖ ~1 AIC · ⊞ 185 · ◷

@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

Caution

agentic threat detected
Threat detection flagged this output in warn mode. Manual review is REQUIRED before any follow-up automation.

Details

Potential security threats were detected in the agent output. Detected threat types: prompt injection.

Review the workflow run logs for details.

PR Code Quality Reviewer

Outcome: reported_action

The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken.

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

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt56 · ~3 AIC · ⌖ ~2 AIC · ⊞ 1.6K · ◷

@github-actions

github-actions Bot commented Nov 19, 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.

🧪 Test quality analysis by Test Quality Sentinel · copilot · routed: haiku55 xhigh · ~1 AIC · ⌖ ~2 AIC · ⊞ 7.3K · ◷

Comment thread actions/setup/js/work_queue_store.cjs Resolved
@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (spec-review-history)
{"id":"ldg-d68a09dc-77c5-4645-a381-80bb196cc689","parents":[],"payload":{"id":"ldg-403f7d5f-f23a-4af2-af00-2912e4fe44ab","operation":"append","value":{"finding_count":0,"head_sha":"6ed26916d20da02926585f21f64da1c5dea656b6","outcome":"aligned"}},"sha":"sha256:17733b330b0ff535d5f10348e83eefa7ce472212047585f6c90ab974fe259612","timestamp":"2026-11-19T20:18:51.818Z","type":"ledger_append","version":1}
History

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

Caution

agentic threat detected
Threat detection flagged this output in warn mode. Manual review is REQUIRED before any follow-up automation.

Details

Potential security threats were detected in the agent output. Detected threat types: prompt injection.

Review the workflow run logs for details.

Found one blocking cache-integrity issue: the job-scoped verification cache can be rewritten by same-UID untrusted steps, and cache hits skip re-reading the Git blob. The inline comment explains how this can allow forged queue contents to bypass verification. Static review only; tests were not run per review instructions.

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

Comment thread actions/setup/js/work_queue_store.cjs Resolved
@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (review-history)
{"id":"ldg-d421c964-6ab5-437e-8ba0-0eb9ac0d2547","parents":[],"payload":{"id":"ldg-3c34aa59-4af6-4e7b-9caa-d29a584e0088","operation":"append","value":{"finding_count":1,"head_sha":"6ed26916d20da02926585f21f64da1c5dea656b6","outcome":"findings"}},"sha":"sha256:9e8f13794de0989c7722f0874753c490c280b8320bd47ae1377fdfd68f00e41d","timestamp":"2026-11-19T20:20:16.853Z","type":"ledger_append","version":1}
History

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

Skills-Based Review 🧠

Applied /diagnosing-bugs and /tdd. Requesting changes because the new finalizer budget can still be consumed by reloads that happen before verification starts.

📋 Key Themes & Highlights

Key Themes

  • Budget anchor is set too early: ledgerReadyAt is captured before the per-member ledger reload and native-run fetch, so their elapsed time is charged against the worker's verification budget.
  • Test gap: the slow-load test delays only the initial read, so it does not cover the per-member reload that the fix targets.
  • Unflagged behavior change: one terminal-evidence test now expects the verifier to run max_attempts times where it previously expected no calls.
  • Low-severity hardening: the verification-cache temp file name is predictable.

Positive Highlights

  • ✅ The job-scoped verification cache is validated on load (owner, mode, nlink, O_NOFOLLOW, size, schema) and written atomically.
  • ✅ Maintenance keeps the Completion-anchored window, and its tests now use the dispatcher context.
  • ✅ The attempts diagnostic and the GH_AW_WORK_QUEUE_VERIFICATION_CACHE env var are small, targeted changes.

Limitation: I could not run the JS test suites. npm ci in actions/setup/js failed with a self-signed certificate error from the package proxy, so the findings above come from static analysis of the diff and source. The anchor concern should be confirmed by a test that delays the per-member reload.

@copilot please address the review comments above.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~8 AIC · ⌖ ~2 AIC · ⊞ 6.7K
Comment /matt to run again

Comment thread actions/setup/js/work_queue_store.cjs Resolved

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.

🟡 Changes recommended

Malformed optional caches can fail jobs instead of falling back to Git, while shared finalizer deadlines can skip later Claims and attempt counts can report zero despite verification having run.

3 open issues
What changed in this PR

This PR improves gh-aw work-queue finalization by preventing slow initial ledger verification from consuming the worker’s delivery-verification window. It also reuses verified ledger state across trusted steps in the same job.

Changes:

  • Adjust the worker finalizer’s verification budget and add attempt counts to failure diagnostics.
  • Add an opt-in, job-scoped Git verification cache and enable it in generated workflows.
  • Extend regression tests, update the protocol specification, and add patch release notes.
File Description
pkg/​workflow/​compiler_safe_outputs_envvars.go Enable caching in work-queue safe-output jobs.
docs/​src/​content/​docs/​specs/​work-queue-specification.md Document verification windows and cache rules.
actions/​setup/​js/​work_queue_store.cjs Persist and reuse verified heads and checkpoint proofs.
actions/​setup/​js/​work_queue_git_transport.test.cjs Cover cache reuse, rejection, and head extension.
actions/​setup/​js/​safe_output_routing_parity.test.cjs Update expected attempt-count diagnostics.
actions/​setup/​js/​safe_output_handler_manager.cjs Include attempts in delivery failure messages.
actions/​setup/​js/​finish_work_queue_claim.test.cjs Cover slow loads and maintenance deadlines.
actions/​setup/​js/​finish_work_queue_claim.cjs Adjust worker budgets and expose attempt counts.
.github/​workflows/​smoke-work-queue.lock.yml Enable job-scoped verification caching.
.github/​workflows/​smoke-work-queue-worker.lock.yml Enable job-scoped verification caching.
.github/​workflows/​smoke-work-queue-monitor.lock.yml Enable job-scoped verification caching.
.github/​workflows/​smoke-work-queue-dispatcher.lock.yml Enable job-scoped verification caching.
.github/​workflows/​smoke-langgraph.lock.yml Refresh runtime temporary-variable exclusions.
.github/​workflows/​repo-tree-map.lock.yml Enable job-scoped verification caching.
.github/​workflows/​eslint-refiner.lock.yml Enable job-scoped verification caching.
.github/​workflows/​eslint-monster.lock.yml Enable job-scoped verification caching.
.github/​workflows/​eslint-miner.lock.yml Enable job-scoped verification caching.
.github/​workflows/​eslint-factory-dispatcher.lock.yml Enable job-scoped verification caching.
.github/​workflows/​engine-conformance-pydantic-ai.lock.yml Enable job-scoped verification caching.
.github/​workflows/​engine-conformance-pi.lock.yml Enable job-scoped verification caching.
.github/​workflows/​engine-conformance-opencode.lock.yml Enable job-scoped verification caching.
.github/​workflows/​engine-conformance-mini-swe-agent.lock.yml Enable job-scoped verification caching.
.github/​workflows/​engine-conformance-langgraph.lock.yml Enable caching and refresh temporary-variable exclusions.
.github/​workflows/​engine-conformance-kiro.lock.yml Enable job-scoped verification caching.
.github/​workflows/​engine-conformance-goose.lock.yml Enable job-scoped verification caching.
.github/​workflows/​engine-conformance-gemini.lock.yml Enable job-scoped verification caching.
.github/​workflows/​engine-conformance-factory.lock.yml Enable job-scoped verification caching.
.github/​workflows/​engine-conformance-dispatcher.lock.yml Enable job-scoped verification caching.
.github/​workflows/​engine-conformance-deepseek-harness.lock.yml Enable job-scoped verification caching.
.github/​workflows/​engine-conformance-cursor.lock.yml Enable job-scoped verification caching.
.github/​workflows/​engine-conformance-crush.lock.yml Enable job-scoped verification caching.
.github/​workflows/​engine-conformance-copilot.lock.yml Enable job-scoped verification caching.
.github/​workflows/​engine-conformance-codex.lock.yml Enable job-scoped verification caching.
.github/​workflows/​engine-conformance-claude.lock.yml Enable job-scoped verification caching.
.github/​workflows/​engine-conformance-aider.lock.yml Enable job-scoped verification caching.
.github/​workflows/​engine-conformance-agy.lock.yml Enable job-scoped verification caching.
.github/​workflows/​deep-report.lock.yml Enable job-scoped verification caching.
.github/​workflows/​daily-work-queues-report.lock.yml Enable job-scoped verification caching.
.github/​workflows/​daily-token-consumption-report.lock.yml Enable job-scoped verification caching.
.github/​workflows/​daily-team-evolution-insights.lock.yml Enable job-scoped verification caching.
.github/​workflows/​daily-secrets-analysis.lock.yml Enable job-scoped verification caching.
.github/​workflows/​daily-report-dispatcher.lock.yml Enable job-scoped verification caching.
.github/​workflows/​daily-repo-chronicle.lock.yml Enable job-scoped verification caching.
.github/​workflows/​daily-regulatory.lock.yml Enable job-scoped verification caching.
.github/​workflows/​daily-observability-report.lock.yml Enable job-scoped verification caching.
.github/​workflows/​daily-issues-report.lock.yml Enable job-scoped verification caching.
.github/​workflows/​daily-firewall-report.lock.yml Enable job-scoped verification caching.
.github/​workflows/​daily-evals-report.lock.yml Enable job-scoped verification caching.
.github/​workflows/​daily-compiler-quality.lock.yml Enable job-scoped verification caching.
.github/​workflows/​artifacts-summary.lock.yml Enable job-scoped verification caching.
.changeset/​fix-work-queue-finalizer-verification-budget.md Describe the patch and recompilation requirement.

Review effort: Max (adaptive)

Comment thread actions/setup/js/work_queue_store.cjs Resolved
@github-actions

Copy link
Copy Markdown
Contributor

Excellent work on the work-queue finalization improvements! 🎯

This PR is well-aligned with the project's core agentic workflows focus:

✅ Clear problem statement — You've detailed the timeout issue in "Process Safe Outputs" with concrete examples and timings.

✅ Comprehensive solution — The dual approach (finalizer budget + job-scoped verification cache) is well-reasoned, with security considerations clearly addressed in the Review notes section.

✅ Strong validation — Impressive test coverage across finish_work_queue_claim, safe_output_routing_parity, and work_queue_git_transport suites. Live performance data (67.7s → 1.95s) is compelling.

✅ Protocol safety — The review notes thoughtfully address the trust boundary for the cache file and explain why the longer deadline window cannot produce late failures.

The PR is in great shape and ready for core team review. After merge, monitoring the first scheduled Smoke Work Queue Worker run to confirm the validation logs should be straightforward.

Generated by ✅ Contribution Check · copilot · routed: haiku55 xhigh · ~18 AIC · ⌖ ~2 AIC · ⊞ 5.4K · ◷

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot

🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Review (actions/setup/js/work_queue_store.cjs:266): address unresolved feedback - Review comment
  3. Review (actions/setup/js/work_queue_store.cjs:290): address unresolved feedback - Review comment
  4. Review (actions/setup/js/finish_work_queue_claim.test.cjs:1388): address unresolved feedback - Review comment
  5. Review (actions/setup/js/finish_work_queue_claim.test.cjs:1345): address unresolved feedback - Review comment
  6. Review (actions/setup/js/finish_work_queue_claim.cjs:413): address unresolved feedback - Review comment
  7. Review (actions/setup/js/finish_work_queue_claim.cjs:352): address unresolved feedback - Review comment
  8. Review (actions/setup/js/finish_work_queue_claim.cjs:521): address unresolved feedback - Review comment
  9. Review (actions/setup/js/work_queue_store.cjs:266): address unresolved feedback - Review comment

Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering.

Structured data
{
  "completed_task": 0,
  "head": "6ed26916d20da02926585f21f64da1c5dea656b6",
  "kind": "requested",
  "schema_version": "1",
  "state": "bdb31ecf77595e6abde182d99e0e8465f05d3b2bdbc4250458b034e39f5c6ae5",
  "work": [
    "13b9e0d47c65e6137513f2aa36364d488bc8f9796eb97a7254ff786aaf4e10ea",
    "2fa7f8fe5b16a0bb5cbb24260ea70503b4ec1f6af2d7cc4b9697dd2966de7c92",
    "45eacbd945a9f22cdf612905f5135a883b614de80b76d61e10fae3ae81d16d14",
    "7e3ca58e7a6eec0ea0a27dc160aaaa9b392ff855e01c50357e61e93de56db9b3",
    "c281f29ebc66d1980ca5eeeb696823f7e07c4dd298eb1173f757355ecb5fbb47",
    "ccf8992ca62a5ab62cd024108a90d6e992070fe4a5c8a51d32f333df3f07986b",
    "ed06a5a5d68b2cf2a60b1c5eb1406a76f6c30d5308b846ec80dc663dd85ca470",
    "fed289866868337a85576cafd77d966cbc4df3816a4e108941fe5fd7fdc127fb"
  ],
  "workflow": "pr-sous-chef"
}

Generated by 👨🍳 PR Sous Chef · pi · routed: haiku55 xhigh · ~2 AIC · ⌖ ~2 AIC · ⊞ 7K · ◷
Comment /souschef to run again

Copilot AI commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

@copilot

🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:...

Merged main into the PR branch in 831221e4 and addressed the eight linked threads in 03907c09. The disk cache was removed; each Claim now gets its own verifier window. The pre-PR gate and all 249 targeted tests passed. No workflow was manually dispatched.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot

🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Fix failing check Offline connector conformance (FAILURE): Check run.

Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering.

Structured data
{
  "completed_task": 0,
  "head": "03907c09a1d94aeb86beac4ffb89a2ed8bc96849",
  "kind": "requested",
  "schema_version": "1",
  "state": "9846de9d21e781aa1702c6d28acf3e2df28532f3ab83245eddecee54c5e6fc05",
  "work": [
    "8b8e96afa57abc9c0b1273828ac899c27c0a396da52d9fa477a1de8b83e81d0b"
  ],
  "workflow": "pr-sous-chef"
}

Generated by 👨🍳 PR Sous Chef · pi · routed: haiku55 xhigh · ~2 AIC · ⌖ ~2 AIC · ⊞ 7K · ◷
Comment /souschef to run again

Copilot AI commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

@copilot

🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:...

Fixed in aaf521f. The connector conformance test now compiles the named Linear example instead of picking up an unrelated Markdown fragment. The offline connector tests and full pre-PR gate passed locally. make merge-main confirmed the branch already includes the latest main; no workflow was manually dispatched or retried.

@elefthei elefthei changed the title Give work-queue finalizer a full verification budget and reuse ledger verification within a job Give each work-queue Claim its full worker-finalizer verification budget Nov 19, 2026
@elefthei
elefthei dismissed stale reviews from github-actions[bot] and github-actions[bot] November 19, 2026 22:58

Addressed in 03907c0: removed the cross-step disk verification cache and its opt-in. Verified authoritative Git reads and process-local caches at aaf521f; 250 focused tests pass. All related threads are answered and resolved; PR metadata corrected.

@elefthei
elefthei merged commit f71c2dc into main Nov 19, 2026
136 checks passed
@elefthei
elefthei deleted the work-queue-finalizer-verification-budget branch November 19, 2026 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants