Skip to content

v0.7.3 — output contract (no-op runs cannot be DONE)

Choose a tag to compare

@xenups xenups released this 14 Nov 19:46
· 8 commits to main since this release
66484a1

Why

A passing verification suite proves the tree still works; it never proves the
worker did its job. Observed in a real governed run (delegated review task):
the worker changed nothing, the workspace stayed at the baseline tree, every
pre-existing test passed, and Asha sealed the run as DONE.

What changed

New asha/governance/output_contract.py turns the task's declared expectation
into a record that acceptance must satisfy before a run may be DONE:

declaration requirement
writes: [...] (or output_kind: changes) at least one declared write changed; temporary/unrelated files do not count
required_artifacts: [...] (or output_kind: artifact) each path exists, is non-empty, and was created/modified during this run
no_change_reason: "..." (or output_kind: no_change) nothing changed and the reason says why that is correct
nothing declared (uncontracted) legacy task: it must still change something, so silence is never success

Enforcement lives in collect_worker_evidence — the single collection path the
DAG and the single-worker/MCP routes share — so both refuse identically.

A refused run still seals its honest record (writes_observed, the contract
record, diff, checks), but:

  • state: FAILED, reason: output_contract_not_satisfied:<why>
  • validation_status: FAIL, verification_status: OUTPUT_CONTRACT_NOT_SATISFIED
  • ready_to_push: false; no fabricated success anywhere

An unproven acceptance keeps its own, more specific refusal (acceptance_failed).

asha_dispatch_task accepts the same three fields, so one declaration
vocabulary covers dispatch and run --spec.

Tests

tests/test_output_contract.py — 16 tests covering the contract rules and the
required scenarios: real change, no change with green tests, unrelated temp
file, untracked source file, deletion, report written, report printed but not
written, empty report, explicit no-op, missing/empty artifact, non-zero exit,
and DAG/single-worker parity.

Fixtures that rely on an intentionally unchanged tree now declare it, and
test_k61_codegraph's slice bound moves 114000 → 116000 by the measured
114572 (stub-dominated, target body unchanged), with the reason recorded.

Measured locally: 1468 passed, 33 failed, 3 skipped vs baseline
1452 passed, 33 failed, 3 skipped at abaa010 — same failure set, +16 tests.

Version: 0.7.3.