Architecture Overview¶
OTerminus processes each request through a layered local pipeline:
- direct command detection
- ambiguity guardrails
- capability routing
- planner proposal generation
- structured parsing/rendering preference
- validation + policy gating
- preview + confirmation
- execution + audit logging
The architecture is built for deterministic control surfaces around LLM output, not free-form shell execution. The model never executes commands directly; it can only propose JSON that OTerminus parses, validates, previews, and confirms.
Proposal mode model¶
OTerminus has two supported first-class proposal modes:
- Structured mode is the preferred normal path. A proposal carries
command_familyplus typedarguments; Python validates those arguments and renders the final command string andargvdeterministically. Use this path whenever a capability has structured support. - Experimental mode is a constrained fallback for single-command text that is allowed by the registry but not yet safely represented by structured arguments. It remains subject to shell-shape checks, allowlists, policy gates, preview, and stronger confirmation. It is not a shortcut around capability or renderer design.
Legacy "mode": "raw" payloads may be accepted only as internal parse-boundary compatibility and
are normalized before downstream handling. Raw is not a public or architectural proposal mode.
Architecture invariants¶
- The model never executes commands directly.
- Structured mode is preferred for supported capabilities.
- Experimental mode is constrained and higher-friction.
- Validator and policy decisions are authoritative for every proposal.
- User confirmation is required before execution.
- Direct commands still go through validation, policy checks, preview, and confirmation.
Key modules¶
cli.py: orchestration, REPL, one-shot flowdirect_commands.py: direct command detectionambiguity.py: inspect-first ambiguity blockingrouter.py: deterministic route category classificationplanner.py: LLM JSON proposal parse + normalizationstructured_commands.py: typed structured argument schemas + deterministic renderingvalidator.py: shape checks, allowlist enforcement, policy checksexecutor.py: subprocess execution pluscd/clearbuilt-insaudit.py: local JSONL lifecycle loggingcommands/*: modular capability packs and command specs
See request lifecycle for end-to-end flow.