Files
rune/scripts/admit_wave_dep07_gate.py
2026-10-17 11:07:31 +01:00

110 lines
4.1 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""Admission dispatch for the wave-K8-dep07 build (openspec task 0.8).
classify + activate + admit (the headless scaffolding entry law,
tests/test_construction_admission.py pattern): the DEP07 self-change
qualification gate (Sleight G1–G8 / MUST-01–MUST-18) on the existing rune
project, user-dispatch approved.
"""
import json
import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "src"))
from rune import construction_activation as cact # noqa: E402
from rune import construction_admission as cadm # noqa: E402
from rune import construction_mode as cmode # noqa: E402
from rune import scaffold as sc # noqa: E402
ROOT = os.path.join(os.path.dirname(__file__), "..")
OBJECTIVE = (
"DEP07 self-change qualification gate (openspec task 0.8): make "
"Sleight-of-Hand G1-G8 and MUST-01-MUST-18 a fail-closed gate over "
"the EXACT staged self-change generation, with truthful TUI "
"receipts. src/rune/self_change_qualification.py evaluates the full "
"26-row mandatory matrix plus applicable S01-S15 scenario rows via "
"per-row probes bound to ContextBroker, Spine, memory/task "
"checkpoints and the qualification runner; any FAIL/ERROR, missing "
"probe (NOT_RUN), PASS without honest evidence, or waived mandatory "
"row REFUSES activation. Receipts are digest-bound to the staged "
"generation, self-integrity-checked, and verify/forgery-checked; "
"TUI views render UNKNOWN for missing evidence and never claim "
"success. Frozen battery tests/test_self_change_qualification.py "
"proves refusal of non-qualified staged generations and honest "
"receipt evidence"
)
AFFECTED = [
"src/rune/self_change_qualification.py",
"tests/test_self_change_qualification.py",
"scripts/admit_wave_dep07_gate.py",
]
def main() -> int:
store = os.path.join(ROOT, "store", "scaffold")
scaffold = sc.Scaffold(store, "rune")
md = cmode.classify_mode(
OBJECTIVE,
target_project="rune",
project_exists=True,
affected_surface=AFFECTED,
)
print("classified mode:", md.mode)
need = {
"need_id": "need-wave-k8-dep07-gate",
"objective": OBJECTIVE,
"origin": "worker",
"project": "rune",
"task_ref": "wave-K8-dep07",
"affected_surface": AFFECTED,
"evidence_refs": [
"docs/openspec/changes/add-native-rune-tui/tasks.md",
"research/harness-survey/rune-sleight-of-hand-memory-compaction.md",
"research/harness-survey/self-transformation/synthesis.json",
],
}
act = cact.activate(md, need=need, scaffold=scaffold,
builder="wave-K8-dep07")
print("activated:", act.get("activated"), act.get("mode"))
env = cadm.admit(
act,
objective=OBJECTIVE,
builder="wave-K8-dep07",
affected_surface=AFFECTED,
evidence_refs=need["evidence_refs"],
origin="worker",
task_ref="wave-K8-dep07",
expected_new_entities=[
"src/rune/self_change_qualification.py (26-row fail-closed "
"gate, digest-bound honest receipts, TUI views)",
"tests/test_self_change_qualification.py (frozen battery: "
"refusal + honest-evidence laws)",
],
expected_runtime_effects=[
"self-change staged generations activate only through "
"self_change_qualification.activation_gate; non-qualified "
"generations are refused with canonical receipts",
],
verification_obligations=[
"PYTHONPATH=src python -m pytest "
"tests/test_self_change_qualification.py green (18 frozen "
"tests: refusal of failed/missing-evidence/unbacked-PASS/"
"waived-mandatory rows; digest binding; forged/tampered "
"receipt rejection; truthful TUI lines)",
],
approval_ref="user:wave-K8-dep07 dispatch",
contract_id="ADMIT-wave-K8-dep07-gate",
project_store=store,
project_id="rune",
)
print(json.dumps(env, indent=2, default=str)[:2400])
return 0 if env.get("success") else 1
if __name__ == "__main__":
sys.exit(main())