New module device-pairing (library + thin shell): 6-digit one-use expiring pairing (reuse/expiry refuse loudly; revoke disconnects + denies old credentials); measured-only inventory (stale + measured-absent excluded; contradicting self-reports surface UNVERIFIED, never flip eligibility); roles desktop-coordinator/laptop-worker/phone-control (never executes) with reasons citing evidence or constraint; actor-tagged schema-versioned drafts surviving disconnect (reconnect syncs canonical first; command-like bodies inert-proposal); forge selection explicit (never inferred; base-revision change halts for owner; idempotent re-correlation). Four frozen fixtures red-first; race-clean. Main-session verify: green own run.
113 lines
4.1 KiB
Python
113 lines
4.1 KiB
Python
"""Admission dispatch for wave device-pairing (spec 1.3b device/forge
|
|
routing).
|
|
|
|
classify + activate + admit (the headless scaffolding entry law,
|
|
tests/test_construction_admission.py pattern): the device-pairing Go
|
|
module 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 = (
|
|
"spec 1.3b device/forge routing as a NEW src/go module "
|
|
"(library + thin shell): short one-time pairing codes that refuse "
|
|
"reuse/expiry loudly, truthful resource inventory where measured "
|
|
"evidence is the only eligibility source and contradicting "
|
|
"self-reports surface UNVERIFIED, desktop-default placement with "
|
|
"phone-control/laptop-worker roles, offline drafts that survive "
|
|
"disconnect and never auto-send on reconnect, and explicit "
|
|
"Gitea/GitHub forge selection with recorded correlation (never "
|
|
"inferred)"
|
|
)
|
|
AFFECTED = [
|
|
"src/go/device-pairing/go.mod",
|
|
"src/go/device-pairing/main.go",
|
|
"src/go/device-pairing/internal/pairing/pairing.go",
|
|
"src/go/device-pairing/internal/pairing/inventory.go",
|
|
"src/go/device-pairing/internal/pairing/routing.go",
|
|
"src/go/device-pairing/internal/pairing/forge.go",
|
|
"src/go/device-pairing/internal/pairing/drafts.go",
|
|
"src/go/device-pairing/internal/pairing/store.go",
|
|
"src/go/device-pairing/internal/pairing/cli.go",
|
|
"src/go/device-pairing/internal/pairing/frozen_test.go",
|
|
"src/go/device-pairing/internal/pairing/pairing_test.go",
|
|
"src/go/device-pairing/internal/pairing/cli_test.go",
|
|
"scripts/admit_wave_device_pairing.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-device-pairing",
|
|
"objective": OBJECTIVE,
|
|
"origin": "worker",
|
|
"project": "rune",
|
|
"task_ref": "wave-device-pairing",
|
|
"affected_surface": AFFECTED,
|
|
"evidence_refs": [
|
|
"docs/openspec/changes/add-native-rune-tui/specs/"
|
|
"tools-providers-devices/spec.md",
|
|
"docs/openspec/changes/add-native-rune-tui/tasks.md",
|
|
"scripts/admit_wave_i1_runtime_bridge.py",
|
|
],
|
|
}
|
|
act = cact.activate(md, need=need, scaffold=scaffold,
|
|
builder="wave-device-pairing")
|
|
print("activated:", act.get("activated"), act.get("mode"))
|
|
|
|
env = cadm.admit(
|
|
act,
|
|
objective=OBJECTIVE,
|
|
builder="wave-device-pairing",
|
|
affected_surface=AFFECTED,
|
|
evidence_refs=need["evidence_refs"],
|
|
origin="worker",
|
|
task_ref="wave-device-pairing",
|
|
expected_new_entities=[
|
|
"src/go/device-pairing (Go module)",
|
|
"scripts/admit_wave_device_pairing.py",
|
|
],
|
|
expected_runtime_effects=[
|
|
"pairing ceremony usable through the device-pairing shell "
|
|
"(issue/redeem/revoke/list/history)",
|
|
"routing decisions carry reasons citing measured evidence or "
|
|
"the binding constraint",
|
|
"forge correlations recorded only through explicit selection",
|
|
],
|
|
verification_obligations=[
|
|
"go test ./... in src/go/device-pairing green",
|
|
"unified_check --members src_go_suite green",
|
|
],
|
|
approval_ref="user:wave-device-pairing dispatch",
|
|
contract_id="ADMIT-wave-device-pairing",
|
|
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())
|