Architecture overview
Contributor guide · Domain language
Omnigrex separates durable Workflow coordination from runtime-specific agent execution. GitHub holds human-readable work and review artifacts; PostgreSQL holds the operational ledger, jobs, identities, and mutation/recovery state.
GitHub webhooks -> durable intake -> Workflow coordination -> Agent Turn ^ | | | v vGitHub Apps <- trusted MCP capabilities <- scoped gateway <- Pi runtime | Docker or Microsandbox backendMain boundaries
Section titled “Main boundaries”| Area | Responsibility |
|---|---|
cmd/omnigrex/ | Process composition, lifecycle, and operational commands |
internal/workflow/, internal/workflowaction/ | Code-defined Stage graph, state transitions, and durable effects |
internal/store/ | PostgreSQL ledger, jobs, leases, and forward-only migrations |
internal/github/ | Apps, webhook intake, reads, and external mutations |
internal/agentturn/ | Preparation, execution, settlement, and recovery |
internal/runtime/ | Runtime Profiles, Sessions, Pi adapter, and backend contracts/implementations |
internal/mcp/ | Scoped capability authorization and trusted mutation handling |
internal/workspace/ | Repository preparation, captures, and publication |
agent/pi/ | Owned non-root runner, configuration/resource boundary, and fixtures |
.omnigrex/team/ | Repository Agent Profiles for Omnigrex dogfooding |
A Work Item has a Workflow and bounded Workflow Attempts. Stage Assignments select durable Agent Participants with their own Agent Sessions and immutable Runtime Profiles. An Execution Backend creates disposable environments; it does not own the business Workflow or durable conversation identity. Repository code runs without GitHub credentials and reaches business capabilities through authenticated, scoped MCP.
Publication-derived MCP reads
Section titled “Publication-derived MCP reads”Turn token authority and mutation expected-head fences remain immutable. Developer PR metadata, reviews/threads, checks, and Actions diagnostics instead use a separate read target derived from successful publication/open-PR mutations in the exact live Turn/epoch ledger. The target advances after each durable publication and can include the PR opened during that Turn; it never follows an unrelated external push. Acknowledged ancestor replays contribute ordered evidence unless publication recovery has already bound a verified starting head. Each publication is validated against its own expected head; only a matching predecessor advances the read target. Other fully validated historical rows leave the target unchanged, including older publications replayed after verified preparation repaired an existing Change Proposal to a later head. Reviewer reads, Issue reads, handoff lookup, and mutation actions retain their original targeting rules. See decision 0038 (GitHub) for the authority boundary.
Collection responses identify the queried commit even when empty: get_check_runs retains {head_sha, check_runs} and extends it with bounded required-CI evidence and target provenance, list_pull_request_reviews returns {head_sha, reviews}, and list_review_threads returns {head_sha, threads}.
PR metadata identifies it in head.sha; existing CI diagnostic responses retain their head metadata.
These collection tools previously returned bare arrays; consumers must read the named collection field.
Read the decisions behind a change
Section titled “Read the decisions behind a change”- Visible versus execution state (GitHub).
- Orchestrator-owned Session control (GitHub).
- MCP-mediated capabilities (GitHub).
- Independent GitHub App identities (GitHub) and operation-selected credentials (GitHub).
- Code-defined Workflow Definitions (GitHub) and Stage Assignments versus Participants (GitHub).
- Execution backend boundary (GitHub) and Pi adapter (GitHub).
- Repository Profile discovery (GitHub) and working-checkout skills (GitHub).
Use the decision index (GitHub) for status and supersession, and plans (GitHub) for accepted intent and delivery evidence. Historical OpenCode/ACP designs do not describe the current Pi-only runtime.
