wsr

wsr architecture

Status and ownership

This document separates the current scaffold from the target design. Accepted decisions and unresolved choices live in PLAN.md; this overview does not approve additional choices. The implementation checklist is CHECKLIST.md.

Current scaffold

Current source names such as Vault and Workshop are legacy scaffold identifiers. They do not select production runtimes. Existing dependency edges and crate boundaries are inventory, not requirements for the redesign. The crate maintenance dispositions identify planned pivots, dormant placeholders and archive candidates. Published package descriptions and dependencies can differ from this checkout; cleanup does not rewrite existing releases.

Preserved prototype

Local stash daee0885832df55a9a872037d3ce6741b9e6e72a, labeled codex: preserve local work before syncing origin/main 2026-07-29, preserves implementation absent from this checkout. It includes 25 tracked-file changes and 49 formerly untracked files in third parent 3a40ea7e0d14217e408bd853acc3fedb5fd61313.

The audit identified inspection/planning, workflow IR, snapshots/evidence, a development command backend, webhook verification/deduplication, invocation state, and Checks payload projection. It counted 29 Rust test bodies; these were inspected, not executed. The command backend is not a verified boundary for malicious workloads. GitHub adapter code is not a deployed CI service.

Inspect recovery in isolation before selecting reusable work. Preserve the original stash; do not apply it blindly over the current workspace or infer current support from prototype code.

Target architecture

The local engine executes compiled workflows independently of GitHub’s control plane. Verified cached inputs enable disconnected execution when the workload needs no external service. Approved cache misses use routine acquisition. Changed YAML triggers resolution, not a warning.

flowchart LR
    I[Workflow inputs] --> P[Compile and validate]
    P --> T[Provision tools]
    T --> Q[Schedule jobs]
    Q --> E[Dispatch and execute]
    E --> R[Local results]
    R -.-> C[Optional reporting]

This is a responsibility map. Dynamic conditions/outputs are evaluated at their proper phases, and readiness/capacity is rechecked at dispatch. Policy applies to acquisition and execution; observability spans all phases. Exact APIs and serialization are still open.

Owner Contract and handoff Guide
Configuration/bootstrap Explicit invocation, defaults and verified pins Configuration
Provider compiler Source semantics to canonical model, diagnostics and provenance Providers
Planner/validator Valid structure, dynamic binding, platform/capability/tool requirements Planning
Provisioner Verified dependency closure and private environment readiness Provisioning
Content store Immutable verified objects, leases and atomic publication Cache
Trusted policy Effective acquisition and execution grants Policy
Scheduler/dispatcher Eligible job selection, global admission and supervisor launch Engine
Job supervisor Step lifecycle, state/outputs, services, cancellation and cleanup Engine
Backend Enforced platform/capabilities and bounded process/component execution Backends
Observability Repository-scoped logs/resources and authorized device correlation Observability
Evidence Local result/input/artifact identities and optional signing Evidence
Connector Optional external publication, status and retry Integrations

Workflow and environment compatibility

Signed provider components compile into the provider-neutral model. They terminate at compilation. The core evaluates translated expressions and handles job/step dependencies and outcomes. GHA-specific lowering/state semantics live in wsr-gha. Bun is selected for qualified JavaScript actions, inside an enforced system boundary. QuickJS, automatic action recompilation and WASIX are unselected. A component mapping needs an explicitly compatible artifact.

Runner profiles describe platform/ABI, defaults and available tools. Package catalogs describe exact sources, verification, dependency closure and activation. D-025 preflight preserves setup-action timing and effects. Complete discovery of arbitrary scripts is impossible through YAML parsing alone; supported dynamic requirements and produced-tool policy need explicit contracts.

GHA labels are compatibility requirements, not interchangeable host labels. Initial execution scope remains Linux jobs from macOS/Linux hosts. CPU architecture coverage, Linux environment substrate, WASI/runtime and system outer isolation remain open. Avoiding Docker as a provisioning dependency is the product direction; workloads explicitly requesting container semantics still need a supported container path or a diagnostic. Linux system execution from macOS requires a compatible Linux boundary.

Concurrency and state

D-028 applies a global running-job count policy across repositories, default max-jobs=0 for no count cap. Resource and policy checks remain. Ready queue, blocked dependencies, provisioning and running work have distinct wait reasons. Background service/foreground ownership, queue fairness and crash recovery remain proposals to specify. No crate layout or daemon API is selected by these diagrams.

Jobs retain private mutable workspace/credentials/logs. Authorized state passes between steps through the supervisor. Step outputs feed job output expressions and dependent jobs at defined phases. Shared cache bytes do not grant cross-repository access or execution authority.

Trust and result boundaries

Trusted policy authorizes workflow requests and backends enforce denials. Missing enforcement blocks startup. The explicit broad-access profile requires owner selection; its scope and syntax remain open. No failed step is replayed automatically with wider permissions. See security.

Local results survive connector outages. Optional attestations bind signer claims to identities under an explicit verification policy. Signatures/containment do not establish truthful arbitrary tests. No execution or enforcement path is implemented by this documentation refactor.