Files
rune/scripts/admit_wave_d54_nd_presentation.py
Nick 0498b00c02 feat(tui-motion-law): the MOTION LAW — motionAllowed gate freezes the activity wave, the chat pane's never-animate law is written and asserted append-only (D54 item 1, Gitea #2571, red-first)
- the gate sits on the wave render path in activity.go (around
  waveOffset/snakeWord): closed = frame-frozen strip, the rest idle
  already takes (A5) extended to active states; wired down the face
  chain lanes->rail->promote->tasks and driven from the shell's
  syncActivity (reduced motion closes it)
- chatpane: the written never-animate law (no motion in the reading
  pane; stream append is append-only, never reflows completed blocks)
  asserted by TestAppendNeverReflowsCompletedBlocks on the full
  renderLines stream, styled and plain
- one-animating-region-per-frame documented at the face chain's
  Update loop (Init/heartbeat in cmd/rune-tui/main.go)
- admission door: scripts/admit_wave_d54_nd_presentation.py, contract
  ADMIT-wave-d54-nd-presentation minted (Rule-5)
- go test -race -short ./... in tui/ green; D52's rainbow test
  updated for the gate's default-open constructor
2026-10-23 19:12:48 +01:00

115 lines
4.1 KiB
Python

"""Admission dispatch for wave D54 neurodivergent-presentation.
classify + activate + admit (the headless scaffolding entry law,
scripts/admit_wave_rebase_tui_wiring.py pattern): the D54
neurodivergent-presentation build 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 = (
"implement the neurodivergent-presentation mechanical map "
"(research/factory-nuerodivergent-presentation/synthesis.md, "
"Gitea #2571): the motion law (motionAllowed gate on the activity "
"wave, never-animate law on the chat pane, one-animating-region-"
"per-frame in the face chain), the colour-token law (role enum in "
"tui/themes, one hex per role, contrast >=4.5:1 unit test, Faint-"
"on-dim fix), the spacing law (one blank line between blocks, "
"blocks never merge), summary-first rendering (one-line plain-"
"english summary box for long answers), the calm-mode sensory "
"setting (vivid|calm, default vivid — calm mutes chroma at the "
"token layer and sets motionAllowed false), and the literal-"
"language audit of face strings"
)
AFFECTED = [
"tui/lanes/activity.go",
"tui/chatpane/blocks.go",
"tui/chatpane/chatpane.go",
"tui/chatpane/scroll_test.go",
"tui/settings/config.go",
"tui/settings/settings.go",
"tui/themes/theme.go",
"tui/themes/roles.go",
"tui/cmd/rune-tui/main.go",
"scripts/admit_wave_d54_nd_presentation.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-d54-nd-presentation",
"objective": OBJECTIVE,
"origin": "worker",
"project": "rune",
"task_ref": "wave-d54-nd-presentation",
"affected_surface": AFFECTED,
"evidence_refs": [
"research/factory-nuerodivergent-presentation/synthesis.md",
"tui/lanes/activity.go",
"tui/chatpane/blocks.go",
"tui/chatpane/chatpane.go",
"tui/settings/config.go",
"tui/themes/theme.go",
],
}
act = cact.activate(md, need=need, scaffold=scaffold,
builder="wave-d54-nd-presentation")
print("activated:", act.get("activated"), act.get("mode"))
env = cadm.admit(
act,
objective=OBJECTIVE,
builder="wave-d54-nd-presentation",
affected_surface=AFFECTED,
evidence_refs=need["evidence_refs"],
origin="worker",
task_ref="wave-d54-nd-presentation",
expected_new_entities=[
"the colour-role enum in tui/themes (one hex per role)",
"the sensory (vivid|calm) setting key in the settings store",
"the motion-allowed gate on the activity wave",
],
expected_runtime_effects=[
"calm mode mutes chroma tokens and stops the activity wave; "
"long answers open with a one-line plain-english summary; "
"face strings read literally",
],
verification_obligations=[
"go test -race -short ./... in tui/ green (documented "
"pre-existing PTY boot family aside)",
"go vet + gofmt clean in tui/",
"contrast unit test >=4.5:1 body text, dim tier floor "
"verified (Faint-on-dim breach fixed)",
],
approval_ref="user:D54 dispatch 2026-10-23 (Gitea #2571)",
contract_id="ADMIT-wave-d54-nd-presentation",
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())