Omega-Runner Programming Specification
* journal ethics work1. Purpose and Scope
This document specifies a complete programming model that unifies:
- The Ethics(5)/(6) constraint system
- The Python Programming Principles Linter
- A concrete Ω (Omega) runner architecture
- A deterministic, auditable execution model for effectful programs
Our goal is to make execution, sequencing, and responsibility boundaries explicit, eliminating hidden control flow and implicit continuation.
2. Foundational Ontology
Principle: No entity may both decide and act on the same transition.
The system is divided into three disjoint layers:
| Layer | Name | Role |
|---|---|---|
| P | Pure | Describe, compute, enumerate |
| E | Effect | Perform exactly one effect |
| Ω | Omega / Runner | Govern admissibility and sequencing |
These layers may not be collapsed.
3. The Pure Layer (P)
Definition: Pure code computes values and descriptions. It does not interact with the external world.
Allowed:
- Branching
- Loops
- Computation
- Data transformation
- Enumeration of candidates
Forbidden:
- IO of any kind
- Time dependence
- Hidden state
- Side effects
Python requirement:
- Every pure function MUST be decorated with
@pure - Pure functions MUST NOT call IO primitives
4. 4. The Effect Layer (E)
Definition: An effect program realizes exactly one externally visible transition.
An effect program is a blind actuator.
Mandatory properties:
- Exactly one effect per invocation
- Unconditional execution
- Deterministic behavior given inputs
- Immediate termination after execution
Forbidden inside effect programs:
- Loops (
for,while) - Branching (
if,match, ternary) - Boolean logic
- Exception handling
- Retries
- Conditional execution
- Silent no-ops
Python requirement:
- Every effectful function MUST be decorated with
@effect - Effect functions MUST have at most one
return - Returns MUST be non-boolean tagged values
- Effect programs MUST NOT decide continuation
5. The Ω Layer (Runner)
Ω is the governance layer.
Ω:
- Sequences effects
- Decides admissibility
- Maintains history
- Interprets failure
- Enforces idempotence
Ω is explicitly not Ethics-linted.
Ω MUST NOT:
- Perform the effects itself
- Embed effect logic internally
Ω MAY:
- Loop
- Branch
- Retry
- Abort
- Log
- Parallelize
- Apply heuristics or policy
6. Effect Descriptions (ED)
An Effect Description is a pure value describing a possible transition.
Structure (conceptual):
- kind
- arguments
- expected output
Properties:
- Serializable
- Hashable
- Side-effect free
- Non-executing
EDs represent possibility, not action.
7. Candidate Sets and Authorization
- Pure code generates a Candidate Set of EDs
- Ω evaluates each ED via an admissibility function
- Authorized EDs form the Authorized Set
Only authorized EDs may be executed.
8. Ω Admissibility Function
Ω defines a pure function:
Ωadmit(History, ED) → {ADMIT, REJECT(reason)}
Properties:
- Deterministic
- Total
- Side-effect free
- Explicitly reasoned
Admissibility is a first-class concept.
9. Execution Semantics
For each authorized ED:
- Ω invokes the corresponding effect program
- Ω observes termination
- Ω verifies expected artifacts
- Ω records the result in history
Effect programs:
- Cannot observe Ω
- Cannot observe history
- Cannot observe each other
10. Failure Semantics
Effect programs do not handle failure.
Ω classifies outcomes as:
- SUCCESS
- FAILEDEXECUTION
- MISSINGOUTPUT
- CORRUPTOUTPUT
- EXPECTATIONVIOLATION
Recovery and retries are Ω-only responsibilities.
11. History and Auditability
Ω maintains an append-only history ledger.
Each entry includes:
- Effect ID (hash)
- Status
- Timestamp
- Optional checksum
- Optional note
History is immutable and replayable.
12. Idempotence
Each Effect Description has a canonical identity:
id = hash(kind, args, output)
Ω MUST enforce:
- No re-execution of successful IDs
- Explicit handling of duplicates
This guarantees idempotence and replay safety.
13. Programming Principles (Normative)
The following rules are enforced by the linter and are part of this specification.
Function Declaration
- Every function MUST declare exactly one of
@pureor@effect
IO Discipline
- IO is forbidden in pure functions
- IO is permitted only in effect functions or module-level effect context
Control Flow
- Effect functions MUST NOT branch or loop
- Pure functions MAY branch and loop
Returns
- Implicit
Nonereturns are forbidden - Boolean returns are forbidden
- Tagged or structured values are required
Exceptions
try/except/raiseare forbidden- Exceptions constitute hidden control flow
Hidden Control Flow
- Multiple returns in effect functions are forbidden
- Short-circuit logic in effect context is forbidden
14. Module-Level Execution Rule
Effect programs MUST execute their effect at module load time or via a single linear entrypoint.
Definition without execution is invalid.
Invariant: If nothing happened, the runner failed — not the program.
15. CSV → Receipt Example (Abstract)
- Pure phase:
- CSV → Effect Descriptions
- Ω phase:
- Admissibility filtering
- Effect phase:
- One receipt per invocation
- Ω phase:
- Verification and attestation
Batching is externalized by design.
16. Prohibited Anti-Patterns
- “main loops” in effect code
- Silent guards
- Self-retrying programs
- Programs that decide their own continuation
- Mixing description, decision, and execution
17. Key Ethics(6) Invariant
No system component may both authorize and realize the same transition.
Violating this invariant collapses the system back into hidden control flow.
18. Closing Statement
This specification makes Ethics(6) executable without weakening it.
- Theory is preserved
- Responsibility is explicit
- Failure is localized
- Auditability is guaranteed
Ω is no longer implicit.
Ω is now a named, specified, and enforceable component.
19. Elsewhere
19.1. References
19.2. In my garden
Notes that link to this note (AKA backlinks).
