ifURI docs

Current architecture

Status: 2026-06-28.

This page is the public map of the ifURI / urirun system. The detailed implementation architecture lives in if-uri/urirun docs/ARCHITECTURE.md.

System shape

urirun is the small URI runtime. It accepts a URI, a registry-backed command, or a natural-language flow, diagnoses where every step can run, executes through the correct transport, and returns a portable JSON result.

The current architecture is split into installable owners:

OwnerResponsibility
urirunlightweight hub runtime, CLI, policy, registry discovery and compatibility shims
urirun-contractroute contracts, effect class, reversibility, JSON Schema, TypeScript and conformance gates
urirun-connector-routerpre-dispatch routing diagnosis for host, node and service targets
urirun-flowflow model, planner normalization, thin driver, verification, rollback and recovery
urirun-connector-*domain capabilities such as kvm://, fs://, ocr://, llm://, github://
urirun-service-*long-running applications such as chat/dashboard, scanner and android/webpage node
urirun-widgetslive widget render helpers, service views and HTML/SVG/JS widget surfaces
urirun-artifactsartifact URI surface and descriptors for final files/results
urirun-nodenode/mesh package boundary; currently a meta-package while the real source is still being split

The rule is one source of truth per kernel. Old import paths can remain as compatibility shims, but they should re-export the owning package instead of shipping a second implementation.

Execution path

prompt / CLI / API
  -> route registry and target selection
  -> flow planning or loaded flow
  -> router diagnosis and plan acceptance
  -> node, service or connector execution
  -> contract-shaped result
  -> verification, artifact/widget/log
  -> recovery nextIntent on failure

Before an autonomous action runs, urirun-connector-router should know whether the route runs on the host, a selected node:*, a service:*, or is blocked by a missing connector, unreachable transport or unsafe command. The router exposes both plan/query/diagnose and plan/query/accept: LLM, recall or heuristics may propose candidate flows, but the same deterministic acceptance gate decides whether a plan can execute.

Desktop environment analysis is part of the pre-action path. For screenshot and UI prompts the system grounds the plan in display/query/info, env/query/profile, twin://*/env/query/inventory, route ownership and Digital Twin memory. Contracts can declare env-enum domains such as monitor -> env:monitors.id; the flow selection gate resolves explicit values, single-option defaults, fingerprint-keyed preferences, or emits typed needs-selection. On GNOME/Wayland multi-monitor hosts, KVM captures all monitors through Mutter RecordArea and returns monitor metadata plus the captured image dimensions, so the chat artifact describes the actual surface.

URI as the stable contract boundary

ifURI has two translations around the same URI:

The contract is the shared invariant across both translations. A URI such as kvm://host/cdp/page/command/navigate is not only an RPC name: the same contract guards generated code, effect class (query vs command), optional inverse and the wire envelope returned by host, node or service execution.

Object model

Current refactor direction

The hub is being reduced to the minimal runtime and compatibility layer. New work should move domain behavior into connector packages, long-running UI/process behavior into service packages, live rendering into urirun-widgets, and route behavior into urirun-contract.

Immediate architectural risks:

More detail