- tui/bridge: live seam to the runtime serve surface (Go front door :8377 proxying the core sidecar :8376); polls /v1/status + /v1/conversation, converts to boundary messages (status_snapshot added via the GENERATOR, both sides regenerated), pure DeriveFrom renders; every display entry names its source msg_id — deleting the source deletes the display (no-sim tests) - Identity line: honest runtime token (connecting/connected/feed/ disconnected/off); honest OFFLINE + serve_unreachable when the runtime is down — verified live by main session - Boundary protocol: 8 message types now; Rust crate round-trips green - 26 tui packages green; 12 new bridge tests + 2 wiring, red-first (caught: disconnected-seed mapping, post-shutdown poll append, 80-col identity clipping) - Known-thin live surface (honest): status counters + role/content window; no msg_ids from the running sidecar yet (older than the record type), no events/tasks endpoints — next wave extends the serve side
101 lines
3.3 KiB
Python
101 lines
3.3 KiB
Python
"""Admission dispatch for wave I1 (runtime bridge wiring).
|
|
|
|
classify + activate + admit (the headless scaffolding entry law,
|
|
tests/test_construction_admission.py pattern): the runtime-bridge
|
|
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 = (
|
|
"wire the native TUI to the live rebased runtime: a tui/bridge package "
|
|
"speaking the rune serve /v1 surface, converting serve artifacts into "
|
|
"the frozen boundary message vocabulary (status_snapshot added via the "
|
|
"generator), feeding the face chain (SeedEvent + rail entries) with "
|
|
"honest connection states only"
|
|
)
|
|
AFFECTED = [
|
|
"schemas/boundary/v1/status_snapshot.schema.json",
|
|
"schemas/boundary/corpus/status_snapshot-001.json",
|
|
"tui/bridge/bridge.go",
|
|
"tui/bridge/client.go",
|
|
"tui/bridge/convert.go",
|
|
"tui/bridge/protocol_test.go",
|
|
"tui/bridge/bridge_test.go",
|
|
"tui/bridge/nosim_test.go",
|
|
"tui/cmd/rune-tui/main.go",
|
|
"tui/cmd/rune-tui/main_test.go",
|
|
]
|
|
|
|
|
|
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-I1-runtime-bridge",
|
|
"objective": OBJECTIVE,
|
|
"origin": "worker",
|
|
"project": "rune",
|
|
"task_ref": "wave-I1-runtime-bridge",
|
|
"affected_surface": AFFECTED,
|
|
"evidence_refs": [
|
|
"src/go/rune-entry/serve.go",
|
|
"src/rune/core_server.py",
|
|
"tui/boundary/gen/boundary_gen.go",
|
|
],
|
|
}
|
|
act = cact.activate(md, need=need, scaffold=scaffold,
|
|
builder="wave-I1-runtime-bridge")
|
|
print("activated:", act.get("activated"), act.get("mode"))
|
|
|
|
env = cadm.admit(
|
|
act,
|
|
objective=OBJECTIVE,
|
|
builder="wave-I1-runtime-bridge",
|
|
affected_surface=AFFECTED,
|
|
evidence_refs=need["evidence_refs"],
|
|
origin="worker",
|
|
task_ref="wave-I1-runtime-bridge",
|
|
expected_new_entities=[
|
|
"tui/bridge (package)",
|
|
"schemas/boundary/v1/status_snapshot.schema.json",
|
|
],
|
|
expected_runtime_effects=[
|
|
"rune-tui identity line reflects live serve connection state",
|
|
"rail feed carries runtime entries traced to boundary msg_ids",
|
|
],
|
|
verification_obligations=[
|
|
"go test ./... in tui/ green",
|
|
"unified_check --members go_suite green",
|
|
],
|
|
approval_ref="user:wave-I1-runtime-bridge dispatch",
|
|
contract_id="ADMIT-wave-I1-runtime-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())
|