Skip to content

Frozen task v2: workflow wait and Bridge presence

Task: 1c035fd0-ee2f-42c6-9810-5450ed0c57af, version 2. Execution: acac448d-2e67-4c45-8af7-0d447221c1dc. Repository: h8v6/heyaira; branch: heyaira/1c035fd0. Source and starting base: 1e5f61028a970edf87098e9915e7a438a0e10bc4. The starting worktree was clean; there was no carried candidate. The result SHA is recorded in the execution's RESULT/receipt after the local commit. Working directory for every command below: /Users/jablonskib/HeyAira-agents/.heyaira-worktrees/heyaira/1c035fd0-worker.

Implementation and confidence

The base reader had no Bridge projection, and no workflow_wait tool was registered. The reader now joins the workflow's frozen Bridge identity to its node inside the existing repeatable-read snapshot, uses bridge.presence, and does not expose raw node health. The current offered execution's creation time measures pickup waiting in queued and awaiting_verification; unrelated workflow updates cannot reset that age. Revoked and missing nodes remain readable.

The new read-only tool uses tasks:read, preserves the execution task guard and compact source redaction, and polls every two seconds with a monotonic deadline. Each poll releases its connection before sleeping. Terminal phases return without timing out even when there is no new history. Attention is informational. No dispatch, routing, notification, migration or Bridge implementation changed.

Confidence in the named feature criteria is high: real PostgreSQL regressions and the actual registered MCP tool handlers passed. The tests call the MCP server in process with the auth context, without an HTTP listener. The execution guard uses a real lease-bound credential issued by issue_credential and validated by OAuthProvider.load_access_token. Provider sessions, identities and data are synthetic. This worker report is not independent verification or deployment.

Baseline and fixed regression output

Existing view baseline at the source commit:

command: PYTHONPATH=src python scripts/test_postgres.py tests/test_workflow_view.py -p no:cacheprovider
exit: 0
27 passed in 7.02s
postgres_acceptance=passed: selected tests, zero skipped tests

The final 24 new cases were run with server.py and workflow.py temporarily loaded from the source commit's Git objects; a finally block restored the implementation bytes. No commit history was changed. The final tests had the same content in both runs.

command: PYTHONPATH=src python scripts/test_postgres.py tests/test_workflow_wait.py -p no:cacheprovider --tb=short -s
implementation: source/base commit
exit: 1
E   KeyError: 'bridge'
E   mcp.server.mcpserver.exceptions.ToolError: Unknown tool: workflow_wait
E   KeyError: 'attention'
24 failed in 9.25s

The same command on the final implementation:

exit: 0
..workflow_wait timeout elapsed=5.004s
.workflow_wait event elapsed=2.026s
.....................
24 passed in 15.04s
postgres_acceptance=passed: selected tests, zero skipped tests

Additional checks on the final implementation:

command: PYTHONPATH=src python scripts/test_postgres.py tests/test_workflow_wait.py tests/test_workflow_view.py -p no:cacheprovider --tb=short -s
exit: 0
..workflow_wait timeout elapsed=5.006s
.workflow_wait event elapsed=2.012s
................................................
51 passed in 19.32s
postgres_acceptance=passed: selected tests, zero skipped tests

command: PYTHONPATH=src python -m pytest tests/test_workflow_view.py tests/test_bridge_presence.py tests/test_bridge_unit.py tests/test_execution_public.py tests/test_bridge_transport.py -q -p no:cacheprovider --tb=short
exit: 0
.................................................                        [100%]
49 passed in 5.70s

The extra cases cover terminal phases, scoped redaction, pool release with one connection, source-scope enforcement, identity/node revocation, scheduled sleep, missing/pending nodes, verifier pickup waiting, and enrollment-project joins.

Frozen criterion checklist

The evidence path for each record is this committed file.

criterion_id: K1
method: Targeted pytest test -> passed.
outcome: pass
evidence_path: docs/reports/2026-10-11-workflow-wait-result.md
feedback: Targeted PostgreSQL run exit 0; test_workflow_get_bridge_presence_postgres passes both online-now and offline-five-minutes cases and asserts all five bridge fields.

criterion_id: K2
method: Targeted pytest test -> passed.
outcome: pass
evidence_path: docs/reports/2026-10-11-workflow-wait-result.md
feedback: Targeted PostgreSQL run exit 0; test_workflow_wait_timeout_and_releases_pool returns changed=false, timed_out=true after 5.004 seconds and leaves the sole pool connection available during sleep.

criterion_id: K3
method: Targeted pytest test -> passed.
outcome: pass
evidence_path: docs/reports/2026-10-11-workflow-wait-result.md
feedback: Targeted PostgreSQL run exit 0; test_workflow_wait_observes_event_during_wait returns the appended sequence 2 event, changed=true and timed_out=false after 2.026 seconds.

criterion_id: K4
method: Targeted pytest test -> passed.
outcome: pass
evidence_path: docs/reports/2026-10-11-workflow-wait-result.md
feedback: Targeted PostgreSQL run exit 0; timeout 0 and 51 return invalid_timeout; a real issued execution credential is refused for another task with execution_task_mismatch, and succeeds for its own task.

criterion_id: K5
method: Targeted pytest test -> passed.
outcome: pass
evidence_path: docs/reports/2026-10-11-workflow-wait-result.md
feedback: Targeted PostgreSQL run exit 0; test_workflow_bridge_attention asserts bridge_not_picking_up in both workflow_get and workflow_wait at 301 seconds offline, including verifier pickup; no attention at 299 seconds, online, or running.

criterion_id: K6
method: git diff --name-only <base>..HEAD -> only allowed paths; no file under migrations/.
outcome: pass
evidence_path: docs/reports/2026-10-11-workflow-wait-result.md
feedback: Scope is restricted to the seven files listed below. The exact committed range check and result SHA are recorded in RESULT/receipt after committing. No migration, Bridge code or dependency change.

Scope and local delivery

Only these intended files are staged:

docs/BRIDGE_PROTOCOL.md
docs/reference/mcp-tools.md
docs/reports/2026-10-11-workflow-wait-result.md
src/heyaira/server.py
src/heyaira/workflow.py
tests/test_workflow_view.py
tests/test_workflow_wait.py

git diff --check exited 0 before staging. The exact range check after committing is git diff --name-only 1e5f61028a970edf87098e9915e7a438a0e10bc4..HEAD. Final commit, parent, range output and clean status are checked before task_result. No push, PR, merge, install, deployment or operational mutation was performed.

Observed integration gate blocker outside the frozen paths

The generated manifest must eventually include the new tool and descriptions. K6 excludes contracts/, so this task leaves contracts/mcp-tools.json untouched and preserves the resulting check failures instead of weakening their assertions.

command: PYTHONPATH=src python -m pytest tests/test_mcp_runtime_contract.py tests/test_docs_contract.py -q -p no:cacheprovider --tb=short
exit: 1
FAILED tests/test_mcp_runtime_contract.py::test_live_tool_names_match_checked_in_contract
FAILED tests/test_mcp_runtime_contract.py::test_live_argument_names_match_checked_in_contract
FAILED tests/test_mcp_runtime_contract.py::test_live_required_arguments_match_checked_in_contract
FAILED tests/test_docs_contract.py::test_tool_rows_match_contract
4 failed, 22 passed in 3.55s

command: PYTHONPATH=src python scripts/check_docs_contract.py
exit: 1
contracts/mcp-tools.json is stale; run `python scripts/export_mcp_contract.py`
what: Contract-consistency checks fail because workflow_wait is absent from the generated contracts/mcp-tools.json; that file is outside K6's frozen scope.
who_moves: coordinator
needed: A separately authorized manifest refresh using python scripts/export_mcp_contract.py, followed by rerunning the two contract test files and scripts/check_docs_contract.py.

The frozen feature criteria pass; the broader integration gate does not pass. Full-suite acceptance is left to CI as specified by task v2, and independent verification/publication remain Bridge-owned.