Skip to content

Capacity queue review fixes — worker evidence

Task: 438eeb80-5514-4d06-a8a7-96d19cb24960, frozen version 3. Execution: a4198c95-69d3-4091-a36a-ea5f9e20dfc4. Repository: h8v6/heyaira; branch: heyaira/438eeb80. Source and starting base: 3fa55f9adf2219889b1a19a53fd09c1b2f4dca79. Tested implementation commit: 666ec7a58aea56915fe85f8c120e4d6fd00eb202, whose parent is the source commit. The final evidence commit adds only this report; the result SHA is recorded in the execution's RESULT/receipt.

All commands ran in /Users/jablonskib/HeyAira-agents/.heyaira-worktrees/heyaira/438eeb80-worker. PostgreSQL commands used TMPDIR="$PWD/.work-tmp" for disposable pytest reports inside the authorized workspace. Git commands used the installed /Applications/Xcode.app/Contents/Developer/usr/bin/git directly. No dependencies were installed. Real PostgreSQL and MCP/Bridge ASGI requests were used; Git provider responses and project data were synthetic. No HTTP listener, production mutation, push, PR, merge or deployment was performed. Subagents: none. Independent acceptance remains Bridge's next step.

Cause and change

Migration 059 allowed waiting_capacity, but the shared SQL organization projection raised workflow_phase_unknown for it, including when terminal states looked back to that phase. Migration 059 now replaces the function from 051, adding only that phase to the executing branch. No next-actor or queue/promoter logic changed. Confidence: high, based on the base failure and passing real-database endpoint regressions.

The replacement CHECK is NOT VALID, preserving enforcement on new writes without scanning existing rows for validation. The ordinary partial index remains in the migration transaction. The Locking: comment explicitly states that ACCESS EXCLUSIVE lasts through the index scan and blocks reads and writes; it does not claim NOT VALID removes the index scan. Production row counts and millisecond timing are the frozen task's stated rationale, not a measurement performed by this worker.

The documentation distinguishes admission from promotion, the separate 24-hour queue age, and the execution limit beginning at the first claim.

K1 — task and portfolio reads

Frozen method: python scripts/test_postgres.py <new test> -p no:cacheprovider on 3fa55f9 and on HEAD; RESULT states both outcomes.

Base command (HEAD was 3fa55f9, only the new test file was untracked):

TMPDIR="$PWD/.work-tmp" python scripts/test_postgres.py tests/test_capacity_queue_reads.py -p no:cacheprovider --tb=short --show-capture=no

Exit 1. Actual output: 4 failed in 3.16s. All three read cases failed at task_get with Error executing tool task_get; the fourth was the K2 assertion (True is False). The preceding diagnostic run exposed asyncpg.exceptions.RaiseError: workflow_phase_unknown from task_organization_workflow_stage during live reads. Cancellation used workflow_control with the version read directly from PostgreSQL so that the baseline read defect did not prevent testing the cancelled state.

HEAD command (implementation commit above):

TMPDIR="$PWD/.work-tmp" python scripts/test_postgres.py tests/test_capacity_queue_reads.py -p no:cacheprovider

Exit 0. Actual output:

4 passed in 26.31s
postgres_acceptance=passed: selected tests, zero skipped tests

The three parametrized cases read task_get, task_list, and HTTP portfolio while waiting, after cancellation, and after queue expiry. Stage is executing in each case. Waiting status is todo; terminal status is blocked. HTTP 200, project/total counters and empty workload are asserted: in_progress=0, stuck=2, waiting_for_me=0, workload=0, ideas=0. The expiry case also asserts queue age exceeded.

criterion_id: K1
outcome: pass
evidence_path: docs/reports/2026-10-11-capacity-queue-review-fixes-result.md
feedback: Real PostgreSQL regression: base exit 1 (three read failures); committed implementation exit 0 (four tests passed, zero skipped), including task and portfolio reads after cancellation and expiry.

K2 — migration enforcement and locking

Frozen method: python scripts/test_postgres.py <migration test> -p no:cacheprovider -> passed; read migrations/059_work_capacity_queue.sql.

The same HEAD command above includes test_migration_059_phase_check_is_unvalidated_but_enforced; exit 0, four passed, zero skipped. Its SQL reads pg_constraint and asserts convalidated is False, inserts waiting_capacity successfully, and asserts an unknown-phase INSERT raises CheckViolationError naming task_workflows_phase_check. The base fails with convalidated=True.

Read migrations/059_work_capacity_queue.sql: NOT VALID, no validation statement, CREATE INDEX IF NOT EXISTS, and the transaction-wide locking comment are present. A Python comparison extracted the complete functions from 051 and 059, removed only OR REPLACE and waiting_capacity from the latter, and asserted equality. Exit 0, actual output: projection_matches_051_except_waiting_capacity=true.

criterion_id: K2
outcome: pass
evidence_path: docs/reports/2026-10-11-capacity-queue-review-fixes-result.md
feedback: Migration regression passed on real PostgreSQL: convalidated=false, waiting_capacity INSERT accepted, unknown phase INSERT rejected; Locking comment inspected and complete projection compared with 051.

K3 — existing queue and MCP contracts

Frozen method: python scripts/test_postgres.py tests/test_capacity_queue.py tests/test_mcp_runtime_contract.py -p no:cacheprovider -> passed, 0 skipped.

TMPDIR="$PWD/.work-tmp" python scripts/test_postgres.py tests/test_capacity_queue.py tests/test_mcp_runtime_contract.py -p no:cacheprovider

Base exit 0, actual output: 26 passed in 46.58s and postgres_acceptance=passed: selected tests, zero skipped tests. Committed implementation exit 0, actual output:

26 passed in 116.54s (0:01:56)
postgres_acceptance=passed: selected tests, zero skipped tests
criterion_id: K3
outcome: pass
evidence_path: docs/reports/2026-10-11-capacity-queue-review-fixes-result.md
feedback: Required queue and MCP suites on the committed implementation: exit 0, 26 passed, zero skipped.

K4 — execution documentation

Frozen method: Read the file; PYTHONPATH=src python -m pytest tests/test_docs_contract.py -q -p no:cacheprovider -> passed.

Read the changed execution document and its diff: dispatch admission no longer requires a fresh heartbeat, and both stale unclaimed-offer expiry claims use the separate queue age. The first claim starts execution timing.

PYTHONPATH=src python -m pytest tests/test_docs_contract.py -q -p no:cacheprovider

Committed implementation exit 0, actual output: 10 passed in 25.17s. An earlier precommit run also passed (10 passed in 23.23s).

criterion_id: K4
outcome: pass
evidence_path: docs/reports/2026-10-11-capacity-queue-review-fixes-result.md
feedback: Documentation read and corrected; docs contract exit 0, 10 passed.

K5 — scope and ancestry

Frozen method: git diff --name-only 3fa55f9adf2219889b1a19a53fd09c1b2f4dca79..HEAD; git merge-base --is-ancestor 3fa55f9 HEAD.

On the implementation commit, diff-name command exit 0:

docs/concepts/task-version-execution.md
migrations/059_work_capacity_queue.sql
tests/test_capacity_queue_reads.py

The final evidence commit adds only this report under docs/. git merge-base --is-ancestor 3fa55f9 HEAD: exit 0, no output. git diff --check: exit 0, no output. git diff 3fa55f9adf2219889b1a19a53fd09c1b2f4dca79 --stat before adding this report: three files, 133 insertions, eight deletions. No new migration or Bridge/source runtime change was made.

criterion_id: K5
outcome: pass
evidence_path: docs/reports/2026-10-11-capacity-queue-review-fixes-result.md
feedback: Base ancestry exit 0; diff includes only migration 059, targeted tests and docs. Evidence is also under docs; no new migration.

Execution limitations and additional checks

Initial /usr/bin/git reads emitted denied Xcode cache/FSEvents operations outside the workspace; they completed successfully. Direct installed Git removed that launcher overhead. Git emitted denied reads of the global ignore file, and the first commit emitted a denied packed-refs.lock maintenance write, but the commit succeeded and its SHA and parent were verified. These are execution limitations, not candidate defects.

Preliminary test authoring runs were corrected before the final base run: one cancellation helper attempted the broken task_get, then one used an incorrect tool name. Neither is used as the definitive base demonstration. An attempted shell heredoc was denied before execution; a Python -c rerun applied the intended SQL edit. A test run before that rerun still used the base SQL and reported four failures (4 failed in 1.98s). The first corrected-tree regression passed (4 passed in 22.74s).

No production timing/load measurement, complete repository suite or independent verifier was run by this worker; the frozen checks above are the delivery checks. RESULT/receipt and final Git-state checks are recorded through the execution contract after committing this evidence.

CI continuation — execution 9519bf7e-8a49-4e5d-ab36-df94390e9fe4

The authorized continuation began at carried candidate 69f835e2871400cd08442a37d6e16716bc6896d7, with a clean worktree. The server identity matched the pinned resource, instance and project, and task_get read the exact frozen task version 3 again. Origin was [email protected]:h8v6/heyaira.git, branch heyaira/438eeb80. The reported failed run is https://github.com/h8v6/heyaira/actions/runs/38173945883.

The failed CI step and traceback could not be read:

gh run view 38173945883 --repo h8v6/heyaira --log-failed
exit 1: failed to read configuration: open /Users/jablonskib/.config/gh/config.yml: operation not permitted

curl --fail --silent --show-error --location https://api.github.com/repos/h8v6/heyaira/actions/runs/38173945883/jobs
tool rejection: Network access to "api.github.com" was blocked: domain is not on the allowlist for the current sandbox mode.

No alternate credential, network bypass or installation was attempted. memory_search for the run ID returned no entries. A request for the failing step/traceback was sent through the text clarification tool while local checks continued. No CI repair is claimed without a diagnosed defect.

Local checks on the carried candidate:

  • TMPDIR="$PWD/.work-tmp" python scripts/test_postgres.py tests/test_capacity_queue_reads.py tests/test_org_v1_b2.py -p no:cacheprovider --tb=short --show-capture=no: exit 1, 4 passed, 44 skipped in 16.49s; the four K1/K2 regressions passed, but the B2 listener tests were skipped because listening sockets are not permitted. Harness output: postgres_acceptance=failed: 44 skipped tests. This grouped run is not zero-skip acceptance evidence.
  • TMPDIR="$PWD/.work-tmp" python scripts/test_postgres.py tests/test_capacity_queue.py tests/test_mcp_runtime_contract.py -p no:cacheprovider: exit 0, 26 passed in 13.80s; postgres_acceptance=passed: selected tests, zero skipped tests (K3).
  • PYTHONPATH=src python -m pytest tests/test_docs_contract.py -q -p no:cacheprovider: exit 0, 10 passed in 3.19s (K4).
  • PYTHONPATH=src python scripts/export_mcp_contract.py --check: MCP contract is up to date; PYTHONPATH=src python scripts/check_docs_contract.py: documentation contract passed: 46 MCP tools covered; python scripts/check_product_name.py: Product name check passed: use HeyAira in tracked text files; python scripts/validate_runtime.py: runtime_validation=passed. The command group exited 0; Git launcher cache/FSEvents denials were emitted during the product-name check.
  • TMPDIR="$PWD/.work-tmp" python -m mkdocs build --strict --site-dir .work-tmp/site-docs: exit 0, Documentation built in 1.92 seconds; only INFO notices about unnavigated pages and existing excluded links, plus the installed Material theme's advisory.
  • node --test tests/site-consent.test.cjs tests/design-system-copy.test.cjs ops/cloudflare/server-beat-watchdog/test/*.mjs: exit 0, 57 passed, zero failed or skipped.
  • A focused reproduction of three backup marker tests exited 1 with 3 failed in 1.93s: test_a_statistics_reset_never_repeats_an_earlier_marker and test_the_marker_does_not_depend_on_the_session_time_zone received InsufficientPrivilegeError: permission denied for function pg_stat_reset; test_a_discarded_statistics_epoch_moves_the_marker received the same error for pg_stat_reset_shared. These are missing test-environment privileges, not defects attributable to this candidate; no privileges were changed.
  • TMPDIR="$PWD/.work-tmp" PYTHONPATH=src python -m pytest tests/test_deployment_guard.py::test_required_override_passes_preflight -q -p no:cacheprovider --tb=short --show-capture=no: exit 0, 1 passed in 1.45s.

Source ancestry and carried-candidate ancestry checks both exited 0. The paths relative to 3fa55f9 remained the four scoped paths listed above. The continuation changes only this evidence report; earlier commits, implementation and regression assertions are preserved.

An isolated rerun of the frozen K1/K2 method completed after the grouped diagnostic: TMPDIR="$PWD/.work-tmp" python scripts/test_postgres.py tests/test_capacity_queue_reads.py -p no:cacheprovider exited 0 with 4 passed in 16.54s and postgres_acceptance=passed: selected tests, zero skipped tests. The definitive failure on 3fa55f9 remains recorded above; that source implementation and the regression file are unchanged. Thus the original K1–K5 remain supported, but the additional CI repair requested by this continuation has not been established.

The wider CI reproduction command was:

TMPDIR="$PWD/.work-tmp" python scripts/test_postgres.py --ignore=tests/test_ios_companion_contract.py --deselect=tests/test_workflow_e2e.py::test_workflow_indexed_list_performance_synthetic_tasks -p no:cacheprovider --tb=short --show-capture=no

It reached at least 82% with skips, failures and errors, then the tool reported Unified exec process failed: Network access to "server" was blocked: local/private network addresses are blocked by the sandbox policy. There was no completed summary or process exit code to report. No totals are inferred from partial progress, and this run is not a passing CI gate. The three PostgreSQL permission failures above were reproduced separately with the same harness selecting their three fully qualified node IDs. Other partial failures were not independently diagnosed and must not be claimed to match the linked GitHub run.

Continuation outcome: blocked before a CI code fix (failure_kind: environment). This is an evidence-only checkpoint, not a repaired candidate.

what: CI run 38173945883's failed step/traceback is unavailable: gh config access and api.github.com are denied. Full local CI reproduction is also obstructed by listener restrictions, PostgreSQL statistics-reset privileges and private-host network denial. Named frozen checks pass, but the requested CI repair is unresolved.
who_moves: coordinator, then the Bridge environment operator
needed: provide the failed CI step and sanitized traceback, or re-dispatch with read-only access to those logs; a full CI-equivalent check also requires a prepared listener-capable environment with the test PostgreSQL privileges.
next_step: read the failed step/traceback, reproduce that exact failure, then implement only its authorized scoped correction and rerun the frozen checks.

Subagents: none. No earlier history was rewritten, no tests were weakened, and no production or publication action was taken. The resumed RESULT and receipt identify this checkpoint SHA, this execution ID and the blocker.