ouroboros/tests/_delivery_candidate_shared.py
Anton Razzhigaev a776639fcb feat(v6.66.0): honest mutation attribution, attributed staging, environment-correct Python, auditable Skill Review history, and a drift-proof operator review wrapper
Operator phase 2 of the owner-approved 6.65-6.67 release cycle. The physical
mutation lease/holder subsystem was deliberately descoped by the owner:
attribution is evidence-only (root-task baseline, terminal candidate snapshot,
attributed commit staging, projection into acceptance/review evidence, no
structural outcome veto). Ships the surface-aware Python interpreter resolver,
auditable Skill Review rounds/history, the single task-tree disposition
authority with cancel-wins, the SSOT operator review wrapper with typed exit
codes, the parallel hermetic pytest preflight, and the chronic red-CI
light-model test fix.

Review: advisory=skipped (prompt-size cap, non-blocking), triad
fable-5/gpt-5.6-sol/gemini-3.5-flash all responded, scope fable-5 responded,
aggregate PASSED (run 20260716T221730Z, $16.38). Full non-serial+serial pytest
green; ruff -F clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 22:25:04 +00:00

61 lines
1.8 KiB
Python

from __future__ import annotations
def write_child(
tmp_path,
child_id: str = "child1",
status: str = "completed",
**fields,
):
"""Write the canonical child-result fixture shared by delivery tests."""
from ouroboros.task_results import write_task_result
return write_task_result(
tmp_path,
child_id,
status,
parent_task_id="parent1",
root_task_id="parent1",
delegation_role="subagent",
result="full child result",
trace_summary="trace",
artifact_status="ready",
artifacts=[{"kind": "report", "name": "report.md", "sha256": "a" * 64}],
**fields,
)
def write_confirmed_disposition_fixture(
tmp_path,
*,
child_id: str = "child1",
disposition: str,
rationale: str,
):
"""Append the authoritative task-tree row used by loop/outcome unit tests."""
from ouroboros.task_status import load_effective_task_result
from ouroboros.task_tree_ledger import tree_ledger_append
from ouroboros.tools.join_ledger import _child_result_sha256
child = load_effective_task_result(tmp_path, child_id)
result_sha256 = _child_result_sha256(child)
root_task_id = str(child.get("root_task_id") or "parent1")
parent_task_id = str(child.get("parent_task_id") or "parent1")
written = tree_ledger_append(
root_task_id,
"decision",
rationale,
task_id=parent_task_id,
role="orchestrator",
payload={
"type": "child_result_disposition",
"child_task_id": child_id,
"disposition": disposition,
"child_result_sha256": result_sha256,
},
allow_child_result_disposition=True,
data_root=tmp_path,
)
assert written.startswith("OK:")
return load_effective_task_result(tmp_path, child_id)