2025-10-31 20:45:46 +09:00
|
|
|
|
// Gate‑C Controller (Phase 20.26)
|
|
|
|
|
|
// Responsibility: Provide a thin, stable entry to route MIR(JSON v0)
|
|
|
|
|
|
// through the Ny/Core dispatcher when a wrapper route is needed.
|
|
|
|
|
|
|
2025-11-04 16:33:04 +09:00
|
|
|
|
using selfhost.vm.core.dispatcher as NyVmDispatcher
|
2025-10-31 20:45:46 +09:00
|
|
|
|
|
|
|
|
|
|
static box GateCController {
|
|
|
|
|
|
// route_json/1: String(JSON v0) -> String(last line)
|
|
|
|
|
|
// Contract: returns a printable string (numeric or tag). No side effects.
|
|
|
|
|
|
route_json(j) {
|
|
|
|
|
|
// Delegate to the Core dispatcher runner
|
2025-11-01 07:02:04 +09:00
|
|
|
|
return NyVmDispatcher.run(j)
|
2025-10-31 20:45:46 +09:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-11-01 07:02:04 +09:00
|
|
|
|
static box GateCControllerMain {
|
|
|
|
|
|
main(args) {
|
|
|
|
|
|
if args == null || args.length() == 0 {
|
|
|
|
|
|
print("[gate_c/core] payload missing")
|
|
|
|
|
|
return 1
|
|
|
|
|
|
}
|
|
|
|
|
|
local payload = "" + args.get(0)
|
|
|
|
|
|
local res = GateCController.route_json(payload)
|
|
|
|
|
|
if res != null { print(res) }
|
|
|
|
|
|
return 0
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|