Files
rune/scripts/admit_wave_k15_cooling.py
T
Nick 38e63273a4 feat(runtime): K15 cooling/rehydration runtime + K12 gateway security
K15 (3.4a): memory_continuity.py — topic foreground/cool/rehydrate
with durable atomic checkpoints (pinned refs + sha256 + open loops);
exact-by-ID (FOUND_VERIFIED/FOUND_UNVERIFIED/SOURCE_CORRUPT/NOT_FOUND_
CONFIRMED); typed memory_status degradation; correction supersession
with verbatim history + audit lineage; right-to-forget wipe (entries,
vectors, FTS, associations, caches, audited); disposable-cache purge
(slower, never amnesiac). 10/10 frozen red-first; authority suites
86/86. Python is the live-path authority (Go broker = parity kernel).

K12 (1.3c): device/gateway security — lost-device exposure report +
key invalidation + queued-command discard; credential rotation; OS
secret-service (freedesktop secret-tool via stdin) + encrypted
AES-GCM fallback; secrets-absent proven structurally (json:'-' fields
+ hex-scan regression gate); 9 new CLI commands. 13 tests red-first,
race-clean. Secrets never touch argv, state files, or CLI output.
2026-10-17 10:14:43 +01:00

125 lines
4.9 KiB
Python

"""Admission dispatch for wave K15 memory cooling/rehydration runtime
(spec 3.4a).
classify + activate + admit (the headless scaffolding entry law,
scripts/admit_wave_history_persistence.py pattern): the cooling/
rehydration runtime on the existing rune project (Python live path — the
Go context-broker kernel's own header keeps the Python class the runtime
authority), 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 = (
"spec 3.4a cooling/rehydration runtime on the live Python memory "
"path: NEW module src/rune/memory_continuity.py as an authoritative "
"seam over memory_store — topic cooling that checkpoints pinned "
"evidence pointers with digests and open loops into durable "
"versioned-schema JSON files before releasing residency (never "
"deleting evidence), verified rehydration that restores a working "
"set only when every pointer resolves and its digest matches "
"(missing evidence = POINTER_BROKEN, tampered = SOURCE_CORRUPT, "
"never fabricated continuity), exact-by-ID reads checked against "
"recorded digests, typed honest memory status "
"(ready/degraded/unavailable with named lanes), owner correction "
"supersession preserving verbatim history with audit-ledger "
"lineage, right-to-forget authorized wipe of the entry plus its "
"derived index/cache/link copies in scope with an audit record, "
"disposable-cache purge that is slower never amnesiac, and working "
"sets surfaced to the model ONLY as ContributionBlocks under the "
"single ContextBroker authority (memory_selector stays the one "
"general selection API)"
)
AFFECTED = [
"src/rune/memory_continuity.py",
"tests/test_memory_continuity.py",
"scripts/admit_wave_k15_cooling.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-k15-cooling",
"objective": OBJECTIVE,
"origin": "worker",
"project": "rune",
"task_ref": "wave-K15-cooling",
"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",
"research/harness-survey/"
"rune-sleight-of-hand-memory-compaction.md",
"src/rune/memory_store.py",
"src/rune/context_broker.py",
],
}
act = cact.activate(md, need=need, scaffold=scaffold,
builder="wave-K15-cooling")
print("activated:", act.get("activated"), act.get("mode"))
env = cadm.admit(
act,
objective=OBJECTIVE,
builder="wave-K15-cooling",
affected_surface=AFFECTED,
evidence_refs=need["evidence_refs"],
origin="worker",
task_ref="wave-K15-cooling",
expected_new_entities=[
"src/rune/memory_continuity.py (Python module)",
"tests/test_memory_continuity.py (frozen red-first suite)",
"scripts/admit_wave_k15_cooling.py",
],
expected_runtime_effects=[
"cooling a topic persists a digest-verified resume checkpoint "
"and releases residency without touching any evidence row",
"rehydration reports FOUND_VERIFIED only when every pinned "
"pointer resolves with a matching digest; missing/tampered "
"evidence surfaces as POINTER_BROKEN/SOURCE_CORRUPT",
"right-to-forget wipes the entry, its derived index/cache and "
"link copies in scope, and records the wipe in the audit "
"ledger; retrieval never resurrects it",
],
verification_obligations=[
"python -m pytest tests/test_memory_continuity.py green "
"(frozen fixtures: exact-by-ID, A→B→A, provider-swap, "
"cache-purge, correction, pointer-liveness)",
"python -m pytest tests/test_context_broker.py "
"tests/test_p1_03_memory_selection.py green (no drift in the "
"authority suites)",
],
approval_ref="user:wave-K15-cooling dispatch",
contract_id="ADMIT-wave-K15-cooling",
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())