Skip to content

Workflow failure classification and acceptance override evidence

Task: 8da69a49-dd7b-4ccf-b6fe-35e541df4d0e, frozen version 15. Execution: 4cad735d-b039-4ad7-a225-2218c8e18d98. Repository: h8v6/heyaira; branch: heyaira/8da69a49. Source and starting/base commit: 93a2eb19b8baf01e2935423ec3e82c2fc3bf7d19. The initial worktree was clean; no carried candidate or unrelated changes. Working directory for all commands: the supplied 8da69a49-worker worktree. Subagents used: none. Independent verification belongs to Bridge.

Change and confidence

Previously, all failed verifier results consumed the same correction budget, even when the required check could not run or conflicted with the execution rules. Results now accept failure_kind (code by default, environment, criterion). Only a verdict whose every failed result is non-code blocks with infra_blocked: kind:criterion_id without offering another execution. The candidate, completed verdict and work count are retained.

workflow_control(action="accept_override", reason) applies existing project admin, binding and version guards, requires a blocked candidate and completed verification, validates a non-blank 1–500-character reason and respects active decision holds. It records actor, reason, candidate and original verdict in the receipt/history/audit, and takes the ordinary done transition to awaiting Bridge publication. It increments the task version once and preserves the failed verdict. No migration is needed: verdict results are already JSONB.

Confidence is high for the changed PostgreSQL transitions and registered MCP handler. Authentication is supplied as a synthetic Actor at the MCP test boundary; actual project role, task version, binding, phase and candidate guards execute against PostgreSQL. Provider sessions and Git artifacts are synthetic. These tests do not claim live provider, GitHub, publication or HTTP authentication coverage.

Regression before the fix

Command (all three runs use the same selection):

PYTHONPATH=src python scripts/test_postgres.py tests/test_workflow_failure_kind.py -k non_code -p no:cacheprovider

The runner creates disposable databases on the prepared local PostgreSQL server, invokes python -m pytest -q --junitxml=<temporary report> ..., rejects skips and drops only the databases it created. DSNs are never printed.

  1. Initial test preparation: exit 2, collection error importing the nonexistent ExecutionEvent; corrected the import to the existing EventInput. This was a test-authoring error, not a product regression.
  2. Unchanged base implementation: exit 1, 3 failed, 19 deselected in 31.47s. Verdict rejected results.*.failure_kind as extra_forbidden.
  3. With only the new result field added, leaving base transition behavior: exit 1, 3 failed, 19 deselected in 18.34s. Every case failed at:
assert w["phase"] == "blocked"
AssertionError: assert 'queued' == 'blocked'

This second reproduction establishes the retry defect independently of schema support. Cases were mixed environment/criterion failures, environment failure with a passing result, and only criterion failures, at work count 1.

The first full candidate run exited 1 (4 failed, 18 passed in 30.20s): three test assertions and the successful override incorrectly treated asyncpg's JSONB string as a dictionary. Explicit JSON decoding fixed the override and the test helpers. That run is not counted as passing evidence.

Final runtime checks (K1, K2, K3)

Command:

PYTHONPATH=src python scripts/test_postgres.py tests/test_workflow_failure_kind.py -p no:cacheprovider

Actual result, exit 0:

31 passed in 76.26s (0:01:16)
postgres_acceptance=passed: selected tests, zero skipped tests
  • K1: six PostgreSQL cases cover the three non-code combinations at work counts 1 and 2. They assert changes_requested then blocked, the exact kind/criterion identifiers in infra_blocked:, no new offered execution, unchanged work count, candidate retention and completed failed verification.
  • K2: four PostgreSQL cases cover mixed environment/code and environment/omitted failures at work counts 1 and 2. They assert a second work offer with pending verification or exactly Correction budget exhausted. A further PostgreSQL case checks that worker non-code reports are validated and forwarded to an independent verifier, which may accept the candidate. Four enum tests cover accepted values/default and reject unknown, empty, null and numeric values.
  • K3: sixteen PostgreSQL cases exercise the registered MCP workflow_control handler: successful admin acceptance and a single version increment; receipt naming override/actor/reason/original failed verdict; preserved verdict; awaiting publication; repeat refusal without duplicate receipt; contributor, missing candidate, queued/running/cancelled/done phase, unfinished verification, stale version and wrong write binding refusal; missing/blank/overlong reason refusal; and accepted one-character and 500-character boundaries.

Documentation and contract (K4)

Read and reviewed docs/agents/skills/verify-bridge-task/SKILL.md and docs/BRIDGE_PROTOCOL.md against the implementation. Both explain failure_kind, evidence-backed environment/criterion classification, infra_blocked, and the audited admin-only override. The tool description exposes the same semantics and its action enum includes accept_override.

Commands and actual results:

python scripts/export_mcp_contract.py
exit 0: wrote contracts/mcp-tools.json

python scripts/export_mcp_contract.py --check
exit 0: MCP contract is up to date

PYTHONPATH=src python -m pytest tests/test_docs_contract.py tests/test_mcp_runtime_contract.py -q -p no:cacheprovider
exit 0: 26 passed in 11.42s

python scripts/check_docs_contract.py
exit 0: documentation contract passed: 46 MCP tools covered

Additional related checks:

PYTHONPATH=src python -m pytest tests/test_workflow_view.py tests/test_bridge_unit.py -q -p no:cacheprovider
exit 0: 37 passed in 37.25s

Scope and local commit (K5)

Intended paths, all within the frozen scope:

contracts/mcp-tools.json
docs/BRIDGE_PROTOCOL.md
docs/agents/skills/verify-bridge-task/SKILL.md
docs/reports/workflow-failure-kind-8da69a49.md
src/heyaira/server.py
src/heyaira/workflow.py
tests/test_workflow_failure_kind.py

Precommit git diff --check exited 0, with no whitespace errors. The staged scope is checked before committing. The frozen postcommit method is:

git diff --name-only 93a2eb19b8baf01e2935423ec3e82c2fc3bf7d19..HEAD

This file is written before the commit. The actual postcommit command result, result SHA, parent and clean-worktree check are recorded in the execution's RESULT/receipt and final criterion report after committing this file.

Execution limits and unrun checks

The default /usr/bin/git launcher encountered sandbox denials creating Xcode cache files. Required Git operations use the existing Bridge-provided task-bin/git binary. Git also warns that the user's global ignore file is unreadable; it does not prevent the required operations.

No continuity_context tool is exposed to this execution. The read work contract v4 explicitly exempts Bridge workers from that startup step; identity was matched and exact task version 15 was read before changes.

The full suite and live MCP HTTP/authentication workflow tests were not run: the full suite belongs to CI, and this sandbox forbids listening sockets. The new PostgreSQL regressions require no listener and ran without skips. No dependencies were installed. No push, PR, merge, deploy or production mutation was performed. RESULT submission is the authorized execution write.

Criterion records

criterion_id: K1
outcome: pass
evidence_path: docs/reports/workflow-failure-kind-8da69a49.md
feedback: PostgreSQL pytest run exited 0, 31 passed and zero skipped; six non-code cases cover work counts 1/2. Field-only base reproduction exited 1 with queued != blocked.

criterion_id: K2
outcome: pass
evidence_path: docs/reports/workflow-failure-kind-8da69a49.md
feedback: Same PostgreSQL run exited 0; four cases preserve correction and exhaustion for explicit/omitted code failures.

criterion_id: K3
outcome: pass
evidence_path: docs/reports/workflow-failure-kind-8da69a49.md
feedback: Same PostgreSQL run exited 0; sixteen cases verify the registered MCP override handler, receipt, attribution, publication state, version and refusal guards.

criterion_id: K4
outcome: pass
evidence_path: docs/reports/workflow-failure-kind-8da69a49.md
feedback: Docs reviewed; contract/runtime pytest exited 0 with 26 passed; export --check and documentation contract check exited 0.

criterion_id: K5
outcome: pass
evidence_path: docs/reports/workflow-failure-kind-8da69a49.md
feedback: All seven intended paths are authorized; postcommit base..HEAD output and SHA are retained in RESULT after this evidence file is committed.