T10: gate review and first compression pass
All four gate criteria met. False Adaptation Rate 0/7 with 12 of 13 mechanical mutations absorbed. 178 tests pass. TD-WP-0002 finished. Fitness loop closed via F-0003: actor isolation was a property of scenarios written to expose it, not of runs. Actors now carry an automatic private marker and the runner examines all of them on every scenario, with two permanent regressions behind it. Compression - six abstractions removed, each declared and never used: Verdict.SUSPICIOUS (a verdict no oracle could emit), Step.expect_refusal, ActorIsolationError, World.seed, EvidencePack.latest, Trajectory.method. F-0008: Temperature may be redundant. Crystallization was built without it ever being consulted; measured stability of realization did the work, and is observed rather than declared. Gated for removal alongside energy.py. INTENT_CHANGED and REALIZATION_FAILED had never run. Both now have purpose-built cases and a test that fails if a seventh outcome is added without one. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Assistant: claude-code Assistant-Model: opus Assistant-Process: 1629012@bnt-lap001 Assistant-Session: 78d4fb13-8a1e-474b-87a3-9b9261c49a39
This commit is contained in:
parent
4f4219d8f7
commit
1b9860a8ee
40 changed files with 1074 additions and 46 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -94,6 +94,23 @@ def check_actor_isolation(
|
|||
return violations
|
||||
|
||||
|
||||
def check_isolation_was_examined(pack: Mapping[str, Any]) -> list[str]:
|
||||
"""Every run must carry a verdict on actor isolation — F-0003, resolved.
|
||||
|
||||
Before this existed, isolation was only observable in scenarios written to
|
||||
expose it: a run in which every actor shared one memory store produced
|
||||
evidence indistinguishable from a correct one. Actors now carry an automatic
|
||||
private marker and the runner examines them on every scenario, so the absence
|
||||
of this observation is itself a failure.
|
||||
"""
|
||||
for obs in _observations(pack):
|
||||
if obs["kind"] != "actor_isolation":
|
||||
continue
|
||||
violations = obs["data"].get("violations") or []
|
||||
return [f"actor isolation violated: {v}" for v in violations]
|
||||
return ["this run did not examine actor isolation at all"]
|
||||
|
||||
|
||||
# --- td://self/oracle-independence ---------------------------------------
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ from tests.selfverification.checks import (
|
|||
check_actor_isolation,
|
||||
check_evidence_supports_every_verdict,
|
||||
check_intent_independence,
|
||||
check_isolation_was_examined,
|
||||
check_no_actor_collected_judgment,
|
||||
check_runs_agree,
|
||||
check_verdicts_follow_from_judgment_evidence,
|
||||
|
|
@ -186,3 +187,35 @@ def test_unrecorded_provenance_is_caught():
|
|||
tampered = copy.deepcopy(pack)
|
||||
tampered["provenance_index"] = {}
|
||||
assert check_intent_independence(tampered)
|
||||
|
||||
|
||||
# --- F-0003 resolution: isolation observed on every run -------------------
|
||||
|
||||
|
||||
def test_an_unexamined_run_is_caught():
|
||||
"""A run that never looked at isolation must not read as isolated."""
|
||||
pack, _, _ = run_and_serialize()
|
||||
tampered = copy.deepcopy(pack)
|
||||
tampered["observations"] = [
|
||||
o for o in tampered["observations"] if o["kind"] != "actor_isolation"
|
||||
]
|
||||
assert check_isolation_was_examined(tampered)
|
||||
|
||||
|
||||
def test_a_leak_is_caught_without_the_test_planting_anything():
|
||||
"""The regression F-0003 leaves behind.
|
||||
|
||||
No secrets seeded by the harness, no scenario written to expose isolation.
|
||||
An actor holding another's automatic marker is caught by the ordinary run.
|
||||
"""
|
||||
from testdriver import Oracle, Runner
|
||||
from scenarios.alice_bob_carol import build
|
||||
|
||||
world, driver, observer, asset, oracle = build()
|
||||
world.cast["bob"].remember("overheard", world.cast["alice"].canary)
|
||||
result = Runner(world, driver, observer, oracle).run(asset)
|
||||
pack = json.loads(result.evidence.to_json())
|
||||
|
||||
violations = check_isolation_was_examined(pack)
|
||||
assert violations
|
||||
assert "holds the private marker of 'alice'" in violations[0]
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ from tests.selfverification.checks import (
|
|||
check_actor_isolation,
|
||||
check_evidence_supports_every_verdict,
|
||||
check_intent_independence,
|
||||
check_isolation_was_examined,
|
||||
check_no_actor_collected_judgment,
|
||||
check_runs_agree,
|
||||
check_verdicts_follow_from_judgment_evidence,
|
||||
|
|
@ -56,6 +57,14 @@ def test_actor_isolation():
|
|||
assert check_actor_isolation(pack, SECRETS, memories) == []
|
||||
|
||||
|
||||
@pytest.mark.parametrize("mutations", [(), ("M15",), ("M01",)])
|
||||
def test_every_run_examines_isolation(mutations):
|
||||
"""F-0003 resolved: isolation is now a property of runs, not of scenarios
|
||||
written to expose it. No canaries need be planted by the test."""
|
||||
pack, _, _ = run_and_serialize(*mutations)
|
||||
assert check_isolation_was_examined(pack) == []
|
||||
|
||||
|
||||
# --- td://self/oracle-independence ---------------------------------------
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue