UI Contract (Localhost)
UI Contract (Localhost)
Status: informative for v2.3 UI surface.
The localhost UI is an orchestration layer over CLI commands. It must remain contract-compatible with existing CLI and artifact schemas.
API Endpoints
GET /api/healthGET /api/statePOST /api/exec
`POST /api/exec` request
{
"command": "demo",
"args": {}
}Supported args keys:
run_idforregress_initpolicy_pathandintent_pathforpolicy_block_test
All args are validated; unsupported values are rejected with exit_code=6.
Allowed command values:
demoverify_demoreceipt_demoregress_initregress_runpolicy_block_test
Arbitrary command execution is not allowed.
`POST /api/exec` response
{
"ok": true,
"command": "demo",
"argv": ["/path/to/gait", "demo", "--json"],
"exit_code": 0,
"duration_ms": 123,
"stdout": "{...}",
"stderr": "",
"json": {
"ok": true,
"run_id": "run_demo"
}
}Invariants
- UI must call local
gaitbinary, never reimplement policy/verify logic. - UI must preserve exit code and reason visibility.
- UI must not imply execution success on non-
allowpolicy outcomes. - UI must expose controlled-only inputs (no arbitrary command execution path).
- Core artifact contracts remain those defined in
docs/contracts/primitive_contract.md.
`GET /api/state` additions
/api/state includes:
artifacts[]withkey,path,exists,modified_atpolicy_paths[]andintent_paths[]allowlistsdefault_policy_pathanddefault_intent_path