Files
rune/scripts/admit_wave_thinking_bridge.py

140 lines
5.7 KiB
Python

"""Admission dispatch for the thinking-bridge wave (D43 addendum 6 +
D44, owner directives 2026-10-20): the seven-item bridge/hud/workshop
build plus the D44 folds.
classify + activate + admit (the headless scaffolding entry law,
scripts/admit_wave_scaffold_status_line.py pattern), user-dispatch
approved via 'user:thinking-bridge directive 2026-10-20'.
"""
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 = (
"D43 addendum 6 + D44 build (owner directives 2026-10-20): "
"1) THE THINKING BRIDGE — the thinking animation moves out of the "
"chat pane into its own full-width strip between the panes and the "
"composer; clicking the strip exposes the thought process; the "
"strip exists only while thinking runs (self-extinguishing). "
"2) TIMESTAMPS far-left ALWAYS, same position regardless of sender. "
"3) COMPOSER CURSOR regression — always blinks when waiting for "
"entry. 4) TASKS PANE full workshop: active task's live coding "
"fully visible plus interactive open-task rows (expandable to the "
"D38 ledger detail). 5) SUB-AGENT OPENER in the info bar after the "
"version token, hidden at zero. 6) VERSION v-prefix + OSC 8 "
"hyperlink to the Gitea release with graceful degrade. "
"D44 folds: A) model display in the info bar (local truncated "
"name+size+style-if-applicable+ablation flag; cloud full), "
"B) queue false-positive fix (task-focus enter with nothing "
"running starts immediately), C) queued-work receipt renders in "
"the tasks pane, D) queue steer hotkey. E) the pane doctrine "
"governs all of it. Red-first each; -race; PTY proofs at 110 cols"
)
AFFECTED = [
"tui/lanes/render.go",
"tui/lanes/lanes.go",
"tui/lanes/render_test.go",
"tui/lanes/lanes_test.go",
"tui/chatpane/chatpane.go",
"tui/chatpane/chatpane_test.go",
"tui/tasks/face.go",
"tui/tasks/render.go",
"tui/tasks/workblock.go",
"tui/tasks/workshop.go",
"tui/cmd/rune-tui/main.go",
"tui/cmd/rune-tui/main_test.go",
"src/go/rune-entry/internal/entry/taskqueue.go",
"src/go/rune-entry/internal/entry/taskqueue_test.go",
"scripts/admit_wave_thinking_bridge.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-thinking-bridge",
"objective": OBJECTIVE,
"origin": "worker",
"project": "rune",
"task_ref": "wave-thinking-bridge",
"affected_surface": AFFECTED,
"evidence_refs": [
"docs/architecture/boundary-law.md (D43 addendum 6 + D44)",
"tui/lanes/render.go",
"tui/chatpane/chatpane.go",
"tui/tasks/render.go",
"tui/cmd/rune-tui/main.go",
"src/go/rune-entry/internal/entry/taskqueue.go",
],
}
act = cact.activate(md, need=need, scaffold=scaffold,
builder="wave-thinking-bridge")
print("activated:", act.get("activated"), act.get("mode"))
env = cadm.admit(
act,
objective=OBJECTIVE,
builder="wave-thinking-bridge",
affected_surface=AFFECTED,
evidence_refs=need["evidence_refs"],
origin="worker",
task_ref="wave-thinking-bridge",
expected_new_entities=[
"tui/tasks/workshop.go (the interactive open-task rows "
"layer: expandable ledger detail per task row)",
"scripts/admit_wave_thinking_bridge.py (this contract)",
],
expected_runtime_effects=[
"the thinking animation renders in its own full-width "
"bridge strip between the panes and the composer, only "
"while thinking runs (self-extinguishing), click-exposable",
"timestamps render far-left in a consistent gutter "
"regardless of sender",
"the composer cursor blinks whenever waiting for entry",
"the tasks pane shows the active task's live coding and "
"interactive open-task rows expanding to ledger detail",
"the info bar shows the sub-agent opener after the version "
"token (hidden at zero) and the compacted active model",
"the version renders with a v-prefix and OSC 8 hyperlink "
"to the Gitea release, degrading to plain text",
"task-focus enter with nothing running starts immediately "
"(no queue row, no queued receipt); the queued-work "
"receipt renders in the tasks pane; a hotkey steers the "
"queue (reorder/prioritise/cancel)",
],
verification_obligations=[
"go test ./... in the touched tui packages green (also "
"-race), go build ./... and go vet clean, gofmt clean",
"python-side taskqueue tests green where touched",
"tmux PTY proofs at 110 columns for each face-visible "
"item with the freshly built binary",
],
approval_ref="user:thinking-bridge directive 2026-10-20",
contract_id="ADMIT-wave-thinking-bridge",
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())