Sole model-visible representation (every sent byte traces to admitted broker blocks; hidden post-broker appenders fail closed); sole memory contributor path (frozen six-contributor set, rogue emitters caught); single selection API (source-tag allowlist, bypass + tamper fail closed, abstention/degradation proven); no future-memory API reserved (repository classes require named cross-module consumers); auto-detect of new memory_/context_/graph_ modules. 20/20 red-first (rogue contributor mutated 3 tests red, reverted clean). Flagged: K15's continuity contributor is unwired — wiring wave amends the allowlist with a named consumer.
111 lines
4.3 KiB
Python
111 lines
4.3 KiB
Python
"""Admission dispatch for wave K16 memory-invariant (openspec task 3.5).
|
|
|
|
classify + activate + admit (the headless scaffolding entry law,
|
|
scripts/admit_wave_graph_projection.py pattern): the frozen memory-
|
|
invariant regression suite 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 = (
|
|
"memory-invariant regression suite (openspec add-native-rune-tui task "
|
|
"3.5, I-R2-017): frozen tests keeping the live ContextBroker invariant "
|
|
"— sole model-visible representation (every sent byte traces to an "
|
|
"admitted block; hidden post-broker appenders fail closed), sole "
|
|
"memory contributor path (frozen six-contributor set; the abolished "
|
|
"parallel paths stay absent), single selection API with fail-closed "
|
|
"abstention and degradation fields (source-tag allowlist; bypass "
|
|
"fails closed), NO future-memory API reserved, and repository-contract "
|
|
"expansion requiring a named live consumer (consumerless repository "
|
|
"APIs asserted ABSENT). Built against K15-as-landed (memory_continuity "
|
|
"runtime, commit 0b64597c) with the named gap that the continuity "
|
|
"operator wiring has NOT landed: its road fails closed until the "
|
|
"frozen allowlist is amended with a named consumer"
|
|
)
|
|
AFFECTED = [
|
|
"tests/test_memory_invariant_regression.py",
|
|
"scripts/admit_wave_memory_invariant.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-k16-invariant",
|
|
"objective": OBJECTIVE,
|
|
"origin": "worker",
|
|
"project": "rune",
|
|
"task_ref": "wave-k16-invariant",
|
|
"affected_surface": AFFECTED,
|
|
"evidence_refs": [
|
|
"docs/openspec/changes/add-native-rune-tui/tasks.md",
|
|
"docs/openspec/changes/add-native-rune-tui/specs/memory-context-continuity/spec.md",
|
|
"docs/openspec/changes/add-native-rune-tui/specs/future-seam-registry/spec.md",
|
|
"src/rune/context_broker.py",
|
|
"src/rune/memory_selector.py",
|
|
"src/rune/memory_continuity.py",
|
|
"src/rune/rune_operator.py",
|
|
"config/v1_authority_map.json",
|
|
],
|
|
}
|
|
act = cact.activate(md, need=need, scaffold=scaffold,
|
|
builder="wave-k16-invariant")
|
|
print("activated:", act.get("activated"), act.get("mode"))
|
|
|
|
env = cadm.admit(
|
|
act,
|
|
objective=OBJECTIVE,
|
|
builder="wave-k16-invariant",
|
|
affected_surface=AFFECTED,
|
|
evidence_refs=need["evidence_refs"],
|
|
origin="worker",
|
|
task_ref="wave-k16-invariant",
|
|
expected_new_entities=[
|
|
"tests/test_memory_invariant_regression.py",
|
|
"scripts/admit_wave_memory_invariant.py",
|
|
],
|
|
expected_runtime_effects=[
|
|
"second model-visible memory path or selection-API bypass fails the suite closed",
|
|
"consumerless repository APIs in the memory path fail the suite (absence asserted)",
|
|
"unwired K15 continuity road fails closed until the frozen allowlist is amended",
|
|
],
|
|
verification_obligations=[
|
|
"pytest tests/test_memory_invariant_regression.py green",
|
|
"pytest tests/test_context_broker.py green (no neighbor regression)",
|
|
],
|
|
regression_obligations=[
|
|
"tests/test_memory_invariant_regression.py stays frozen; amendments require a named live consumer",
|
|
],
|
|
approval_ref="user:wave-K16-invariant dispatch",
|
|
contract_id="ADMIT-wave-k16-invariant",
|
|
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())
|