tui/settings/: models/devices/notifications/limits/themes render from + submit to the canonical config owner (two-method Owner seam); no defaults, no cache, no persistence — pending drafts only. Invalid/ conflicting values fail VISIBLY (owner reason verbatim, drafts retained, atomic refuses). No-local-authority proven THREE ways: recording-owner seam, reflect sweep, go/parser import allowlist (no os/io = no side-write can exist). 11 tests red-first; toggle vocabulary pinned equal to tui/alerts. Main-session verify: green + race clean own run.
101 lines
3.3 KiB
Python
101 lines
3.3 KiB
Python
"""Admission dispatch for the settings-surfaces wave (task 5.4).
|
|
|
|
classify + activate + admit (the headless scaffolding entry law,
|
|
scripts/admit_wave_i1_runtime_bridge.py pattern): the five settings
|
|
surfaces as a new tui/settings package 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 = (
|
|
"build the task-5.4 settings surfaces into the native TUI: a new "
|
|
"tui/settings package (models, devices, notifications, limits, "
|
|
"themes — platform-general) that renders from and submits to the "
|
|
"canonical config owner with NO TUI-local authority — the package "
|
|
"holds no defaults, no cache and no persistence; settings "
|
|
"round-trip get→render→change→submit→get, per-channel toggle "
|
|
"wiring, invalid/conflicting values fail visibly (never silently "
|
|
"clamped), restart persistence honest (every render reads live "
|
|
"state), and a frozen no-local-authority conformance test proving "
|
|
"no write path outside the Owner API shape"
|
|
)
|
|
AFFECTED = [
|
|
"tui/settings/settings.go",
|
|
"tui/settings/config.go",
|
|
"tui/settings/render.go",
|
|
"tui/settings/settings_test.go",
|
|
"tui/settings/conformance_test.go",
|
|
"tui/settings/README.md",
|
|
]
|
|
|
|
|
|
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-settings-surfaces",
|
|
"objective": OBJECTIVE,
|
|
"origin": "worker",
|
|
"project": "rune",
|
|
"task_ref": "wave-settings",
|
|
"affected_surface": AFFECTED,
|
|
"evidence_refs": [
|
|
"docs/openspec/changes/add-native-rune-tui/tasks.md",
|
|
"tui/alerts/alerts.go",
|
|
],
|
|
}
|
|
act = cact.activate(md, need=need, scaffold=scaffold,
|
|
builder="wave-settings")
|
|
print("activated:", act.get("activated"), act.get("mode"))
|
|
|
|
env = cadm.admit(
|
|
act,
|
|
objective=OBJECTIVE,
|
|
builder="wave-settings",
|
|
affected_surface=AFFECTED,
|
|
evidence_refs=need["evidence_refs"],
|
|
origin="worker",
|
|
task_ref="wave-settings",
|
|
expected_new_entities=[
|
|
"tui/settings (package)",
|
|
],
|
|
expected_runtime_effects=[
|
|
"no runtime effects — groundwork package, unwired (face "
|
|
"wiring is a main-session resource)",
|
|
],
|
|
verification_obligations=[
|
|
"go test ./settings/ in tui/ green",
|
|
"gofmt + go vet clean on tui/settings",
|
|
],
|
|
approval_ref="user:wave-settings dispatch",
|
|
contract_id="ADMIT-wave-settings",
|
|
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())
|