@agentikos/omega-os 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +127 -0
  3. package/bin/omega-os.js +48 -0
  4. package/bootstrap/lib/common.sh +73 -0
  5. package/bootstrap/lib/steps.sh +153 -0
  6. package/bootstrap/manifest.example.yaml +45 -0
  7. package/docs/ACCOUNT-AND-BILLING.md +95 -0
  8. package/docs/ARCHITECTURE.md +225 -0
  9. package/docs/AUTONOMOUS-AGENTS.md +128 -0
  10. package/docs/ENGINE-SPEC.md +174 -0
  11. package/docs/INSTALL.md +106 -0
  12. package/docs/MCP-AND-PLUGINS.md +121 -0
  13. package/docs/RUNTIME-PLAN.md +63 -0
  14. package/install.sh +54 -0
  15. package/omega/Agentik_Coding/README.md +21 -0
  16. package/omega/Agentik_Engine/README.md +58 -0
  17. package/omega/Agentik_Engine/omega_engine/__init__.py +58 -0
  18. package/omega/Agentik_Engine/omega_engine/__pycache__/__init__.cpython-313.pyc +0 -0
  19. package/omega/Agentik_Engine/omega_engine/__pycache__/audit.cpython-313.pyc +0 -0
  20. package/omega/Agentik_Engine/omega_engine/__pycache__/audit_arsenal.cpython-313.pyc +0 -0
  21. package/omega/Agentik_Engine/omega_engine/__pycache__/barrier.cpython-313.pyc +0 -0
  22. package/omega/Agentik_Engine/omega_engine/__pycache__/bus.cpython-313.pyc +0 -0
  23. package/omega/Agentik_Engine/omega_engine/__pycache__/cli.cpython-313.pyc +0 -0
  24. package/omega/Agentik_Engine/omega_engine/__pycache__/events.cpython-313.pyc +0 -0
  25. package/omega/Agentik_Engine/omega_engine/__pycache__/executor.cpython-313.pyc +0 -0
  26. package/omega/Agentik_Engine/omega_engine/__pycache__/mission.cpython-313.pyc +0 -0
  27. package/omega/Agentik_Engine/omega_engine/__pycache__/progress.cpython-313.pyc +0 -0
  28. package/omega/Agentik_Engine/omega_engine/__pycache__/project.cpython-313.pyc +0 -0
  29. package/omega/Agentik_Engine/omega_engine/__pycache__/provider.cpython-313.pyc +0 -0
  30. package/omega/Agentik_Engine/omega_engine/__pycache__/reducer.cpython-313.pyc +0 -0
  31. package/omega/Agentik_Engine/omega_engine/__pycache__/report.cpython-313.pyc +0 -0
  32. package/omega/Agentik_Engine/omega_engine/__pycache__/router.cpython-313.pyc +0 -0
  33. package/omega/Agentik_Engine/omega_engine/__pycache__/store.cpython-313.pyc +0 -0
  34. package/omega/Agentik_Engine/omega_engine/__pycache__/supervisor.cpython-313.pyc +0 -0
  35. package/omega/Agentik_Engine/omega_engine/__pycache__/task.cpython-313.pyc +0 -0
  36. package/omega/Agentik_Engine/omega_engine/__pycache__/telegram.cpython-313.pyc +0 -0
  37. package/omega/Agentik_Engine/omega_engine/audit.py +96 -0
  38. package/omega/Agentik_Engine/omega_engine/audit_arsenal.py +314 -0
  39. package/omega/Agentik_Engine/omega_engine/barrier.py +45 -0
  40. package/omega/Agentik_Engine/omega_engine/bus.py +45 -0
  41. package/omega/Agentik_Engine/omega_engine/cli.py +158 -0
  42. package/omega/Agentik_Engine/omega_engine/events.py +60 -0
  43. package/omega/Agentik_Engine/omega_engine/executor.py +167 -0
  44. package/omega/Agentik_Engine/omega_engine/mission.py +145 -0
  45. package/omega/Agentik_Engine/omega_engine/progress.py +75 -0
  46. package/omega/Agentik_Engine/omega_engine/project.py +92 -0
  47. package/omega/Agentik_Engine/omega_engine/provider.py +139 -0
  48. package/omega/Agentik_Engine/omega_engine/reducer.py +76 -0
  49. package/omega/Agentik_Engine/omega_engine/report.py +146 -0
  50. package/omega/Agentik_Engine/omega_engine/router.py +34 -0
  51. package/omega/Agentik_Engine/omega_engine/store.py +97 -0
  52. package/omega/Agentik_Engine/omega_engine/supervisor.py +69 -0
  53. package/omega/Agentik_Engine/omega_engine/task.py +91 -0
  54. package/omega/Agentik_Engine/omega_engine/telegram.py +115 -0
  55. package/omega/Agentik_Engine/pyproject.toml +31 -0
  56. package/omega/Agentik_Engine/tests/__pycache__/test_audit_arsenal.cpython-313.pyc +0 -0
  57. package/omega/Agentik_Engine/tests/__pycache__/test_executor.cpython-313.pyc +0 -0
  58. package/omega/Agentik_Engine/tests/__pycache__/test_mission.cpython-313.pyc +0 -0
  59. package/omega/Agentik_Engine/tests/__pycache__/test_progress.cpython-313.pyc +0 -0
  60. package/omega/Agentik_Engine/tests/__pycache__/test_project.cpython-313.pyc +0 -0
  61. package/omega/Agentik_Engine/tests/__pycache__/test_reducer.cpython-313.pyc +0 -0
  62. package/omega/Agentik_Engine/tests/__pycache__/test_report.cpython-313.pyc +0 -0
  63. package/omega/Agentik_Engine/tests/test_audit_arsenal.py +80 -0
  64. package/omega/Agentik_Engine/tests/test_executor.py +96 -0
  65. package/omega/Agentik_Engine/tests/test_mission.py +64 -0
  66. package/omega/Agentik_Engine/tests/test_progress.py +69 -0
  67. package/omega/Agentik_Engine/tests/test_project.py +61 -0
  68. package/omega/Agentik_Engine/tests/test_reducer.py +144 -0
  69. package/omega/Agentik_Engine/tests/test_report.py +88 -0
  70. package/omega/Agentik_Extra/README.md +37 -0
  71. package/omega/Agentik_Extra/etc/agentik.env.example +19 -0
  72. package/omega/Agentik_Extra/etc/structure.yaml +46 -0
  73. package/omega/Agentik_Orchestration/README.md +43 -0
  74. package/omega/Agentik_Orchestration/autonomous/README.md +29 -0
  75. package/omega/Agentik_Orchestration/autonomous/example-agents.yaml +85 -0
  76. package/omega/Agentik_Orchestration/educators/README.md +55 -0
  77. package/omega/Agentik_Orchestration/topologies/aisb-oracle-worker.yaml +42 -0
  78. package/omega/Agentik_Orchestration/verifier/audit-router.yaml +26 -0
  79. package/omega/Agentik_Providers/README.md +62 -0
  80. package/omega/Agentik_Providers/claude/accounts.example.yaml +28 -0
  81. package/omega/Agentik_Providers/registry.yaml +30 -0
  82. package/omega/Agentik_Runtime/README.md +30 -0
  83. package/omega/Agentik_SSOT/README.md +36 -0
  84. package/omega/Agentik_SSOT/VERSION +1 -0
  85. package/omega/Agentik_SSOT/audits/a11yaudit.yaml +69 -0
  86. package/omega/Agentik_SSOT/audits/apiaudit.yaml +71 -0
  87. package/omega/Agentik_SSOT/audits/automationaudit.yaml +77 -0
  88. package/omega/Agentik_SSOT/audits/codeaudit.yaml +63 -0
  89. package/omega/Agentik_SSOT/audits/copyaudit.yaml +68 -0
  90. package/omega/Agentik_SSOT/audits/dataaudit.yaml +76 -0
  91. package/omega/Agentik_SSOT/audits/debugaudit.yaml +75 -0
  92. package/omega/Agentik_SSOT/audits/dxaudit.yaml +78 -0
  93. package/omega/Agentik_SSOT/audits/featureaudit.yaml +73 -0
  94. package/omega/Agentik_SSOT/audits/flowaudit.yaml +72 -0
  95. package/omega/Agentik_SSOT/audits/logicaudit.yaml +75 -0
  96. package/omega/Agentik_SSOT/audits/motionaudit.yaml +67 -0
  97. package/omega/Agentik_SSOT/audits/perfaudit.yaml +71 -0
  98. package/omega/Agentik_SSOT/audits/refontaudit.yaml +77 -0
  99. package/omega/Agentik_SSOT/audits/retentionaudit.yaml +84 -0
  100. package/omega/Agentik_SSOT/audits/secaudit.yaml +73 -0
  101. package/omega/Agentik_SSOT/audits/seoaudit.yaml +75 -0
  102. package/omega/Agentik_SSOT/audits/uiuxaudit.yaml +61 -0
  103. package/omega/Agentik_SSOT/mcp/mcp-catalog.yaml +136 -0
  104. package/omega/Agentik_SSOT/rules/constitution.md +44 -0
  105. package/omega/Agentik_SSOT/schemas/event.schema.json +45 -0
  106. package/omega/Agentik_SSOT/schemas/task.schema.json +54 -0
  107. package/omega/Agentik_Tools/README.md +42 -0
  108. package/omega/Agentik_Tools/registry.json +15 -0
  109. package/package.json +43 -0
@@ -0,0 +1,225 @@
1
+ # Omega OS — Architecture
2
+
3
+ > The deterministic harness is code. The intelligence is prompted LLM calls.
4
+ > The SSOT is the bridge. This document defines all three.
5
+
6
+ ---
7
+
8
+ ## 1. The problem, and the principle
9
+
10
+ The failure that defines this project: **an agent declares a task finished, you
11
+ test it, it does not work.** "C'est bon, terminé" — and it is not.
12
+
13
+ Three structural defects cause it in file-based orchestration (`workers write a
14
+ done.json`, `the parent scans files`):
15
+
16
+ 1. **Self-declared completion** — the actor with the most incentive to say
17
+ "done" is the one asserting it.
18
+ 2. **Observed, not computed** — the parent *searches* for the state → polling,
19
+ races, missed files, stale reads.
20
+ 3. **The parent can finish before its children** — nothing mechanically
21
+ prevents a parent closing while children still run.
22
+
23
+ **The principle that fixes all three:** completion is not *information an agent
24
+ writes* — it is **a state the engine derives** from observable, immutable facts.
25
+ An invariant computed by the system, never an assertion by an actor.
26
+
27
+ Everything below is the consequence of that one sentence.
28
+
29
+ ---
30
+
31
+ ## 2. Two worlds, cleanly separated
32
+
33
+ | World | What it is | Nature |
34
+ |---|---|---|
35
+ | **The harness** | state, dispatch, lifecycle, scheduling, locks, observability | deterministic **code** — typed, tested |
36
+ | **The intelligence** | classify, plan, write code, audit | non-deterministic **LLM calls** — prompted, graded, verified |
37
+ | **The SSOT** | rules, prompts, skills, schemas the harness injects into LLM calls | the **bridge** between the two |
38
+
39
+ Most agentic systems blend these into one soup of scripts and prompt strings.
40
+ Omega OS keeps them apart: the harness is `Agentik_Engine/` (generic Python that
41
+ knows nothing about "oracles"); the intelligence is provider calls configured by
42
+ `Agentik_Orchestration/`; the SSOT is `Agentik_SSOT/`.
43
+
44
+ ---
45
+
46
+ ## 3. The 8-block rack
47
+
48
+ Omega OS installs as one master folder `~/Omega/` containing eight `Agentik_*`
49
+ blocks. Each block has **one nature, one lifecycle, one owner** — a pluggable
50
+ drawer you can open alone over SSH.
51
+
52
+ ```
53
+ Omega/
54
+ ├── Agentik_SSOT/ TRUTH — git repo, read-only in prod
55
+ ├── Agentik_Engine/ ENGINE — generic Python, business-agnostic
56
+ ├── Agentik_Orchestration/ DEFINITIONS — the logic, not the runtime
57
+ ├── Agentik_Providers/ WIRING — one folder per LLM
58
+ ├── Agentik_Coding/ YOUR WORK — project worktrees
59
+ ├── Agentik_Tools/ EXTERNAL — the "/Applications" folder
60
+ ├── Agentik_Runtime/ LIVE STATE — what is running now
61
+ └── Agentik_Extra/ EPHEMERAL — cache, config, secrets
62
+ ```
63
+
64
+ ### Lifecycle table
65
+
66
+ | Block | Nature | Lifecycle | Git-versioned? |
67
+ |---|---|---|---|
68
+ | `Agentik_SSOT` | the neutral truth | stable, promoted | ✅ dedicated repo |
69
+ | `Agentik_Engine` | the generic mechanics | rarely changes | ✅ dedicated repo |
70
+ | `Agentik_Orchestration` | your business definitions | often changes | ✅ dedicated repo |
71
+ | `Agentik_Providers` | LLM wiring | per-provider | ✅ (except secrets) |
72
+ | `Agentik_Coding` | your work | very fluid | ✅ (each project) |
73
+ | `Agentik_Tools` | third-party installs | installer-managed | ❌ (manifest only) |
74
+ | `Agentik_Runtime` | live state | disposable except `memory.db` | ❌ |
75
+ | `Agentik_Extra` | ephemeral + config | disposable / sensitive | ❌ |
76
+
77
+ > **Note — it is eight blocks.** `Agentik_Extra` is a full block, not an
78
+ > afterthought: it owns config, the structure manifest and the secrets vault,
79
+ > each with its own permission regime.
80
+
81
+ ### Three design decisions worth stating
82
+
83
+ - **Engine ≠ Orchestration.** The engine (reducer, barrier, store) knows nothing
84
+ about AISB or oracles — it executes graphs. *Who* is an oracle and *which*
85
+ topology lives in `Agentik_Orchestration/`. You can redesign all of your
86
+ orchestration logic without touching the engine.
87
+ - **The RAG is split four ways, not dumped in `Tools/`.** A RAG system is not
88
+ one thing. The vector engine + embedding tooling (third-party, installed) →
89
+ `Agentik_Tools/knowledge/`. The index/corpus (derived, mutating state) →
90
+ `Agentik_Runtime/`. The router + strategies (`rag-route`) →
91
+ `Agentik_Orchestration/`. The thresholds + CRAG config → `Agentik_SSOT/`.
92
+ This is the engine≠config≠runtime rule applied to retrieval.
93
+ - **`Agentik_*` prefix + the `Extra` block.** The prefix guarantees the eight
94
+ blocks sort and read together. `Extra/` absorbs all periphery (var, staging,
95
+ etc, secrets) so the master folder stays at exactly eight clean entries.
96
+
97
+ ---
98
+
99
+ ## 4. The orchestration engine (overview)
100
+
101
+ Full spec: [`ENGINE-SPEC.md`](ENGINE-SPEC.md). The essentials:
102
+
103
+ - **Everything is a `Task`.** AISB, oracle, worker, audit — all are `Task`s. The
104
+ only difference is `kind` (`dispatcher` / `executor` / `verifier`).
105
+ - **Event sourcing.** One append-only event log (`Agentik_Runtime/eventlog/`,
106
+ SQLite WAL) is the single source of truth. The state of any task is a *fold*
107
+ (reduction) over its events. Free: audit trail, time-travel debug, no races.
108
+ - **The reducer is pure.** `reduce(state, event) → state`. No agent ever writes
109
+ a state. Illegal transitions raise — they never corrupt.
110
+ - **Structured concurrency.** A `dispatcher` opens a *scope* and spawns children
111
+ *inside* it. The scope cannot become `JOINABLE` until every child is terminal.
112
+ "Parent done when all children done" stops being something you *detect* — it
113
+ becomes a mechanical invariant.
114
+ - **3-phase completion.** `CLAIMED_DONE` → an **independent verifier** → `VERIFIED`
115
+ or `REJECTED`. Only `VERIFIED` counts toward a parent's barrier. A worker's
116
+ declaration is a *request for inspection*, never an ending.
117
+ - **Budget + deadman.** Every task has max-iterations, a wall deadline and a
118
+ heartbeat. No heartbeat → automatic terminal transition. No infinite hangs.
119
+
120
+ ### The completion FSM
121
+
122
+ ```
123
+ PENDING → DISPATCHED → RUNNING → CLAIMED_DONE → VERIFYING → ┬ VERIFIED → COMPLETED
124
+ └ REJECTED → (retry) → FAILED
125
+ Terminal states: { COMPLETED, FAILED }
126
+ ```
127
+
128
+ ---
129
+
130
+ ## 5. The verifier — audits are not a module, they are a transition
131
+
132
+ The audit system **is** the `CLAIMED_DONE → VERIFIED` transition. No task can be
133
+ `VERIFIED` without passing the gate.
134
+
135
+ ```
136
+ worker → CLAIMED_DONE
137
+
138
+
139
+ AUDIT GATE (kind = verifier — independent of the worker)
140
+ ├─ audit router : selects audits by task type
141
+ ├─ concurrent run, semaphore-bounded
142
+ ├─ aggregate score vs threshold
143
+ ├─ ≥ threshold → VERIFIED → counts for the parent barrier
144
+ └─ < threshold → REJECTED → findings re-injected → retry within budget
145
+ ```
146
+
147
+ **The non-negotiable: the gate contains a *runtime* audit.** The verifier does
148
+ not read code and nod — it **runs the real flow**: starts the dev server, hits
149
+ the endpoints, drives the UI path. A task is `VERIFIED` only if the live flow
150
+ passes. This is the single mechanism that kills the lying "done": the ending is
151
+ a fact observed by a third party that *ran the thing*. (This is `validate-live`,
152
+ Layer 5 of the safety mesh.)
153
+
154
+ ---
155
+
156
+ ## 6. Providers — multi-LLM by contract
157
+
158
+ Every LLM sits behind one interface, `AgentProvider` (see
159
+ [`../omega/Agentik_Providers/README.md`](../omega/Agentik_Providers/README.md)).
160
+ The engine talks only to that contract — it never knows whether Claude, GLM or
161
+ OpenAI is behind it. A new provider = one adapter (~200–400 lines) + one line in
162
+ `registry.yaml`. Providers can be assigned **per role** (cheap model for triage,
163
+ Claude for code, a *different* model for audit — a real Popper falsification).
164
+
165
+ ---
166
+
167
+ ## 7. RAG — Corrective RAG as the envelope
168
+
169
+ Retrieval in Omega OS follows the project's own posture (researcher, everything
170
+ audited, runtime truth): **Corrective RAG (CRAG) wraps everything.** Whatever
171
+ inner strategy runs, the CRAG envelope grades the retrieved chunks and
172
+ re-retrieves if quality is low — "check / recheck until 100%" applied to context.
173
+
174
+ - **Inner strategies** — Hybrid (dense + BM25, the default; `memory.db` FTS5 is
175
+ the hybrid base, extended with a vector index), Graph (cross-project,
176
+ relational), Multimodal (screenshots, PDFs, diagrams).
177
+ - **The router** — `rag-route`, an agentic skill that classifies the query and
178
+ picks the inner strategy, exactly as `classify-intent` classifies missions.
179
+ - **Placement** — engine in `Tools/`, corpus in `Runtime/`, router in
180
+ `Orchestration/`, config in `SSOT/` (see §3).
181
+
182
+ ---
183
+
184
+ ## 8. MCP & Claude Code plugins
185
+
186
+ Full reference: [`MCP-AND-PLUGINS.md`](MCP-AND-PLUGINS.md). An MCP is three
187
+ things: the **server binary** (third-party install → `Agentik_Tools/`), the
188
+ **catalog + canonical config** (truth → `Agentik_SSOT/mcp/`, projected to each
189
+ provider by its adapter), and the **secrets** (→ `Agentik_Extra/etc/secrets/`).
190
+ The installer offers a curated catalog — Composio, Higgsfield, filesystem, git,
191
+ GitHub, Notion, Slack, Linear, Playwright, context7 and more, plus the Claude
192
+ Code plugin marketplace — as a checklist (interactive) or a manifest (headless).
193
+
194
+ ---
195
+
196
+ ## 9. Autonomous agents
197
+
198
+ Full reference: [`AUTONOMOUS-AGENTS.md`](AUTONOMOUS-AGENTS.md). Long-running
199
+ autonomous agents (the always-on, channel-bound, self-directed kind) are **not a
200
+ separate subsystem**. An autonomous agent is a `Task`/`Node` with two extra
201
+ fields: `lifecycle = persistent` and a `trigger` (cron / event / webhook /
202
+ channel-message). Same reducer, same join barrier, same audit gate, same MCP and
203
+ skills. They inherit verified completion and the deadman for free. This is what
204
+ makes Omega OS *our* architecture and not Hermes' — one engine, configured.
205
+
206
+ ---
207
+
208
+ ## 10. The educators — the self-improving layer
209
+
210
+ Eight *educators* live in `Agentik_Orchestration/educators/`. Each is a
211
+ generator/compiler: it takes a high-level intention and produces the correct
212
+ artifact **into the SSOT**, under the quality gate. They are the factory floor —
213
+ they read the SSOT + adapters + current best practice and rewrite the system's
214
+ own components. Driven by the learning loop, this is the auto-improvement cycle.
215
+ See [`../omega/Agentik_Orchestration/educators/README.md`](../omega/Agentik_Orchestration/educators/README.md).
216
+
217
+ ---
218
+
219
+ ## 11. Install & always-on
220
+
221
+ The repository **is** the product. Its installer, run on a fresh VPS, creates
222
+ `~/Omega/`, wires the engine, installs MCP servers + plugins, connects a
223
+ Telegram bot + group (topics = `Agentik_Coding` projects), and installs
224
+ `systemd` services so the engine, the Telegram bridge and the autonomous-agent
225
+ supervisor run **24/7**. See [`INSTALL.md`](INSTALL.md).
@@ -0,0 +1,128 @@
1
+ # Omega OS — Autonomous Agents
2
+
3
+ > Long-running, self-directed, channel-bound agents — **as first-class nodes of
4
+ > the one engine**, not a bolted-on subsystem.
5
+
6
+ ---
7
+
8
+ ## 1. The principle
9
+
10
+ Frameworks like Hermes treat autonomous agents as a parallel stack. Omega OS
11
+ does not. An autonomous agent **is a `Task`/`Node`** of the same engine, with
12
+ two extra fields:
13
+
14
+ - `lifecycle: persistent` — it does not end after one mission (vs `ephemeral`).
15
+ - `trigger` — what wakes it: `cron` | `event` | `webhook` | `channel`.
16
+
17
+ Everything else is identical to a mission task: the same reducer, the same join
18
+ barrier, the same audit gate, the same providers, the same MCP servers, the same
19
+ skills. **An autonomous agent inherits verified completion and the deadman for
20
+ free.** This is what makes it *our* architecture — one engine, configured — and
21
+ not a second framework to maintain.
22
+
23
+ A mission task answers *"do this one thing."* An autonomous agent answers
24
+ *"hold this role, indefinitely, and act when your trigger fires."*
25
+
26
+ ---
27
+
28
+ ## 2. What an autonomous agent is
29
+
30
+ A persistent `dispatcher` node with a **charter**. When its trigger fires it
31
+ opens a scope and spawns ephemeral mission tasks *inside* that scope — which run
32
+ through the normal `AISB → Oracle → Worker` topology, verified-completion and
33
+ all. The autonomous agent is the long-lived parent; the missions it launches are
34
+ its ephemeral children.
35
+
36
+ ```
37
+ trigger fires
38
+
39
+
40
+ autonomous agent (persistent dispatcher, bound to a Telegram channel)
41
+ │ opens a scope, spawns a mission
42
+
43
+ AISB → Oracle → Worker → Verifier (ephemeral, normal topology)
44
+
45
+
46
+ scope.joinable → the agent reports to its channel → waits for the next trigger
47
+ ```
48
+
49
+ ---
50
+
51
+ ## 3. The charter
52
+
53
+ Charters live in `Agentik_Orchestration/autonomous/`. One YAML file per agent:
54
+
55
+ ```yaml
56
+ id: support-agent
57
+ role: customer-support
58
+ lifecycle: persistent
59
+ charter: >
60
+ Watch the support channel. Triage every inbound message, draft a reply,
61
+ and for anything requiring a code change, open a mission against the
62
+ relevant project. Never close a thread the customer has not confirmed.
63
+ trigger:
64
+ type: channel
65
+ config: { telegram_topic: 4012 }
66
+ channel:
67
+ telegram_topic: 4012 # where it listens AND reports
68
+ budget:
69
+ max_iterations: 5
70
+ heartbeat_interval_s: 300
71
+ provider: glm # cheap model for triage; missions escalate
72
+ allowed:
73
+ skills: [classify-intent, draft-reply, rag-route]
74
+ mcp: [filesystem, github, linear]
75
+ topologies: [aisb-oracle-worker]
76
+ guardrails:
77
+ may_spawn_missions: true
78
+ may_ship: false # missions it spawns still pass the audit gate
79
+ ```
80
+
81
+ | Field | Meaning |
82
+ |---|---|
83
+ | `trigger` | what wakes the agent — `cron` (schedule), `event` (an event-bus pattern), `webhook` (an HTTP hook), `channel` (a Telegram message) |
84
+ | `channel` | the Telegram topic the agent listens to and reports into |
85
+ | `allowed` | the agent's capability surface — which skills, MCP servers, topologies it may use |
86
+ | `guardrails` | hard limits — may it spawn missions, may it ship |
87
+
88
+ ---
89
+
90
+ ## 4. Triggers
91
+
92
+ | Trigger | Fires when | Example |
93
+ |---|---|---|
94
+ | `cron` | a schedule elapses | a daily metrics-review agent |
95
+ | `event` | the event bus matches a pattern | an agent that reacts to every `task.failed` |
96
+ | `webhook` | an external HTTP call arrives | a CI agent reacting to a GitHub push |
97
+ | `channel` | a message lands in a bound Telegram topic | a support agent |
98
+
99
+ Multiple autonomous agents can coexist, each bound to a different channel, each
100
+ with its own role and management — exactly the "different agents, different
101
+ channels, same access to MCP/skills" you asked for.
102
+
103
+ ---
104
+
105
+ ## 5. The supervisor and persistent agents
106
+
107
+ A persistent agent never reaches a terminal state in normal operation — so the
108
+ deadman's `heartbeat_interval_s` is its liveness contract: a persistent agent
109
+ must emit `task.heartbeat` on schedule. If it goes silent, the supervisor
110
+ restarts it (a persistent agent is *respawned*, not failed). The engine
111
+ distinguishes this by `lifecycle`: `ephemeral` + deadman → `FAILED`;
112
+ `persistent` + deadman → respawn.
113
+
114
+ ---
115
+
116
+ ## 6. Lifecycle
117
+
118
+ - **Register** — drop a charter in `Agentik_Orchestration/autonomous/`, or run
119
+ the installer's `70-autonomous` step.
120
+ - **Run** — the autonomous-agent supervisor (`systemd` service) loads every
121
+ charter and keeps each agent's persistent node alive.
122
+ - **Observe** — `omega status` shows persistent nodes alongside mission tasks;
123
+ each agent also reports into its bound Telegram channel.
124
+ - **Retire** — remove the charter; the supervisor lets the node finish its
125
+ current scope, then stops respawning it.
126
+
127
+ See `Agentik_Orchestration/autonomous/example-agents.yaml` for a charter
128
+ template and two worked examples (a support agent and a growth agent).
@@ -0,0 +1,174 @@
1
+ # Omega OS — Engine Specification
2
+
3
+ > Reference for the `Agentik_Engine/` build-out. The core (`task`, `events`,
4
+ > `reducer`, `barrier`, `store`, `supervisor`) is implemented and tested; `bus`
5
+ > and `router` are specified here.
6
+
7
+ ---
8
+
9
+ ## 1. The 6 founding principles
10
+
11
+ | # | Principle | Effect |
12
+ |---|---|---|
13
+ | 1 | **Event sourcing** | One append-only log of immutable events is the single source of truth. Any task's state = a fold over its events. Free: audit trail, time-travel debug, zero races. |
14
+ | 2 | **Structured concurrency** | A parent owns its children. A parent scope cannot close until every child is terminal. |
15
+ | 3 | **Verified completion** | 3-phase commit: the worker *claims*, an independent verifier *validates*. Only the verified state counts. |
16
+ | 4 | **Topology = data** | The engine knows only `Node`s (`dispatcher`/`executor`/`verifier`) in a DAG. An orchestration is a graph file. |
17
+ | 5 | **Push, not poll** | Tasks emit events; the bus pushes to subscribers. Cron is a cold backstop only. |
18
+ | 6 | **Budget + deadman** | Every task has max-iterations, a wall deadline and a heartbeat. No heartbeat → automatic terminal transition. |
19
+
20
+ ---
21
+
22
+ ## 2. The Task FSM
23
+
24
+ ```
25
+ PENDING → DISPATCHED → RUNNING → CLAIMED_DONE → VERIFYING → ┬ VERIFIED → COMPLETED
26
+ └ REJECTED → (retry) → FAILED
27
+ Terminal states: { COMPLETED, FAILED }
28
+ ```
29
+
30
+ | State | Meaning |
31
+ |---|---|
32
+ | `PENDING` | created, not yet dispatched |
33
+ | `DISPATCHED` | assigned to an executant |
34
+ | `RUNNING` | executing |
35
+ | `CLAIMED_DONE` | the executant *thinks* it finished — **not trusted** |
36
+ | `VERIFYING` | the audit gate is running |
37
+ | `VERIFIED` | ✅ validated by a third party — **the only state that counts for a parent** |
38
+ | `REJECTED` | audits failed → findings re-injected → retry within budget |
39
+ | `COMPLETED` | terminal — success |
40
+ | `FAILED` | terminal — budget exhausted / stall / honest block, with evidence |
41
+
42
+ ### Legal transition table (the reducer)
43
+
44
+ `(state, event) → state`. Anything not listed is illegal and **raises** —
45
+ it never corrupts.
46
+
47
+ | From | Event | To |
48
+ |---|---|---|
49
+ | `None` | `task.created` | `PENDING` |
50
+ | `PENDING` | `task.dispatched` | `DISPATCHED` |
51
+ | `DISPATCHED` | `task.started` | `RUNNING` |
52
+ | `RUNNING` | `task.claimed_done` | `CLAIMED_DONE` |
53
+ | `CLAIMED_DONE` | `task.verifying` | `VERIFYING` |
54
+ | `VERIFYING` | `task.verified` | `VERIFIED` |
55
+ | `VERIFYING` | `task.rejected` | `REJECTED` |
56
+ | `VERIFIED` | `task.completed` | `COMPLETED` |
57
+ | `REJECTED` | `task.dispatched` | `DISPATCHED` (retry) |
58
+ | *any non-terminal* | `task.failed` | `FAILED` (the deadman) |
59
+
60
+ `task.heartbeat` and `scope.joinable` are not task-state transitions: the first
61
+ is a liveness ping, the second is consumed by the barrier.
62
+
63
+ ---
64
+
65
+ ## 3. The reducer — the anti-hallucination core
66
+
67
+ A **pure** function. No agent ever writes a `TaskState`; the engine replays
68
+ events to derive it. The only path to `VERIFIED` is the event `task.verified`,
69
+ and only a `verifier` node may emit that event.
70
+
71
+ ```python
72
+ def reduce(state, event) -> TaskState # one step, raises on illegal moves
73
+ def reduce_task(events) -> TaskState # fold an ordered event stream
74
+ ```
75
+
76
+ This is the mechanical answer to "the agent said done and it wasn't": there is
77
+ no event an executor can emit that reaches `VERIFIED`.
78
+
79
+ ---
80
+
81
+ ## 4. The join barrier — structured concurrency
82
+
83
+ A `dispatcher` owns a **scope**. `scope_status(children_states)` derives:
84
+
85
+ - **RUNNING** — ≥1 child non-terminal → the parent *cannot* close.
86
+ - **PARTIAL** — all children terminal, ≥1 `FAILED`.
87
+ - **JOINABLE** — all children terminal, none `FAILED`.
88
+
89
+ When the last child reaches a terminal state, the engine re-reduces the scope;
90
+ if `JOINABLE`, it emits `scope.joinable` *to the parent*. The parent may only
91
+ move toward `COMPLETED` on receiving that event. **Finishing early is impossible
92
+ by construction.**
93
+
94
+ ### The 3 questions, resolved mechanically
95
+
96
+ - *How does the oracle know its workers finished?* — It does not search. A
97
+ worker reaching `VERIFIED` re-reduces the parent scope; the result is *pushed*.
98
+ - *How does the oracle know its own work is done?* — It is not allowed to
99
+ decide. The barrier computes `JOINABLE`; the oracle transitions only on
100
+ `scope.joinable`.
101
+ - *How does AISB stay informed?* — Same mechanism one level up. AISB is the root
102
+ scope; oracles are its children. Completion propagates up the DAG, level by
103
+ level, automatically.
104
+
105
+ ### The `PARTIAL` policy (spec gap to close)
106
+
107
+ `PARTIAL` is deliberately distinct from `JOINABLE`. The dispatcher's reaction to
108
+ a `PARTIAL` scope is **declared per topology** in
109
+ `Agentik_Orchestration/topologies/<name>.yaml`:
110
+
111
+ ```yaml
112
+ on_partial: retry_failed # retry_failed | accept_partial | fail_up
113
+ ```
114
+
115
+ The engine never hard-codes this.
116
+
117
+ ---
118
+
119
+ ## 5. The audit gate — the verifier
120
+
121
+ The audit system **is** the `CLAIMED_DONE → VERIFYING → VERIFIED/REJECTED`
122
+ transition.
123
+
124
+ ```
125
+ worker → CLAIMED_DONE
126
+ │ (emits task.verifying — a verifier node is spawned)
127
+
128
+ VERIFIER (kind = verifier, independent of the worker)
129
+ ├─ audit router : selects audits by task type
130
+ ├─ concurrent run, semaphore-bounded
131
+ ├─ static audits (lint, types, code review)
132
+ └─ RUNTIME audit (start the server, hit endpoints, drive the UI) ← mandatory
133
+
134
+ ├─ aggregate score ≥ threshold → emit task.verified
135
+ └─ aggregate score < threshold → emit task.rejected (+ findings)
136
+ ```
137
+
138
+ The **runtime audit is non-negotiable**. A task is `VERIFIED` only if the real
139
+ flow ran and passed. Retry loop: `REJECTED → dispatched` is bounded by the
140
+ `Budget` — `max_iterations` retries, then an honest `FAILED` with evidence.
141
+
142
+ ---
143
+
144
+ ## 6. Event schema
145
+
146
+ Every event is immutable: `{ id, task_id, type, ts, payload }`. Stored
147
+ append-only — no UPDATE, no DELETE. See `Agentik_SSOT/schemas/event.schema.json`.
148
+
149
+ Event types: `task.created`, `task.dispatched`, `task.started`,
150
+ `task.claimed_done`, `task.verifying`, `task.verified`, `task.rejected`,
151
+ `task.completed`, `task.failed`, `task.heartbeat`, `scope.joinable`.
152
+
153
+ ---
154
+
155
+ ## 7. Components
156
+
157
+ | Component | Responsibility | Status |
158
+ |---|---|---|
159
+ | Event Store | append-only log, single source of truth — `SQLiteStore` (WAL) | implemented |
160
+ | Reducer | pure `(state, event) → state` | implemented |
161
+ | Barrier | scope status `RUNNING / PARTIAL / JOINABLE` | implemented |
162
+ | Supervisor | deadman / watchdog — stall → `task.failed` | implemented |
163
+ | Bus | push events to subscribers (in-process → Redis pub/sub) | **to build** |
164
+ | Model Router | task → required capability → provider (reason in capabilities, not names) | **to build** |
165
+
166
+ ---
167
+
168
+ ## 8. Store choice
169
+
170
+ **SQLite WAL** — simple, ample for a VPS. The `EventStore` is an interface;
171
+ `RedisStreamStore` can be added later for hundreds of concurrent workers, behind
172
+ the same contract. **Snapshotting** (`Agentik_Runtime/snapshots/`) keeps
173
+ `reduce_task` from replaying the whole log as it grows — needed for scale, not
174
+ for correctness.
@@ -0,0 +1,106 @@
1
+ # Omega OS — Install Guide
2
+
3
+ > One command on a fresh VPS or workstation. Idempotent and resumable.
4
+
5
+ ---
6
+
7
+ ## 1. Requirements
8
+
9
+ - **OS** — Ubuntu 22.04+ (VPS) or macOS 13+ (workstation).
10
+ - **Access** — a non-root user with `sudo` (for system packages only).
11
+ - **Accounts** — a Telegram bot token (from `@BotFather`) and at least one LLM
12
+ provider credential (Claude / GLM / OpenAI). None are shipped; you connect
13
+ your own.
14
+ - Everything else (Python, `uv`, `tmux`, `git`, `sqlite3`, `jq`) is installed by
15
+ the bootstrap.
16
+
17
+ ## 2. Quick start
18
+
19
+ One command:
20
+
21
+ ```bash
22
+ npx @agentikos/omega-os
23
+ ```
24
+
25
+ `npx` fetches the package and hands off to the installer — **interactive** by
26
+ default, walking you through provider setup, the MCP/plugin checklist, and
27
+ Telegram wiring. From a git clone, `bash install.sh` is equivalent.
28
+
29
+ ### Headless install
30
+
31
+ ```bash
32
+ npx @agentikos/omega-os --manifest bootstrap/manifest.example.yaml --non-interactive
33
+ ```
34
+
35
+ Copy `bootstrap/manifest.example.yaml`, fill in your choices (profile, MCP
36
+ selection, Telegram), and the installer runs end-to-end with no prompts — for CI
37
+ or scripted VPS provisioning.
38
+
39
+ ## 3. What it does — the 8 steps
40
+
41
+ | Step | Action |
42
+ |---|---|
43
+ | `00-preflight` | detect OS + package manager; check `git`, disk, user is non-root |
44
+ | `10-system-deps` | install Python 3.11+, `uv`, `tmux`, `git`, `sqlite3`, `jq`, `curl` |
45
+ | `20-structure` | create `~/Omega/` and the 8 `Agentik_*` blocks |
46
+ | `30-engine` | `uv venv` + install `omega-engine`; expose the `omega` CLI |
47
+ | `40-mcp` | MCP / Claude-plugin checklist → install servers, write canonical config |
48
+ | `50-telegram` | prompt for bot token, validate it, wire the bot + forum group |
49
+ | `60-services` | install `systemd` (Linux) / `launchd` (macOS) units — the 24/7 layer |
50
+ | `70-doctor` | run `omega doctor` — validate the deployment |
51
+
52
+ > `70-autonomous` (register autonomous-agent charters) runs inside `60-services`
53
+ > when the profile enables it.
54
+
55
+ ## 4. Idempotent & resumable
56
+
57
+ Each completed step is recorded in `~/Omega/Agentik_Extra/var/.install-state`.
58
+ Re-running `install.sh` **skips completed steps** — if it stopped at step 5/8
59
+ (e.g. a missing Telegram token), fix the cause and re-run; it resumes at step 5.
60
+
61
+ Force a full re-run: `bash install.sh --force`.
62
+
63
+ ## 5. Profiles
64
+
65
+ | Profile | For | Result |
66
+ |---|---|---|
67
+ | `vps` | a headless server | `systemd` services, Telegram bridge, autonomous agents — runs 24/7 |
68
+ | `workstation` | a Mac/Linux laptop | `launchd`, on-demand, no always-on services |
69
+ | `minimal` | CI / containers | engine only, no Telegram, no services |
70
+
71
+ Select with `--profile vps` (default on Linux) or in the manifest.
72
+
73
+ ## 6. The 24/7 layer
74
+
75
+ On the `vps` profile, `60-services` installs three `systemd` user units:
76
+
77
+ - `omega-engine.service` — the orchestration engine + event bus.
78
+ - `omega-telegram.service` — the Telegram bridge (missions in, reports out).
79
+ - `omega-autonomous.service` — the autonomous-agent supervisor.
80
+
81
+ These give Omega OS its "Agent runs 7/7" property: the VPS keeps the engine and
82
+ every autonomous agent alive across reboots.
83
+
84
+ ## 7. Telegram
85
+
86
+ `50-telegram` connects a bot to a Telegram **forum group**. Each project under
87
+ `Agentik_Coding/` maps to a **topic** in that group; replying in a topic routes
88
+ a mission to that project. The same model as the original Omega — one chat
89
+ thread is the whole interface.
90
+
91
+ ## 8. Verify
92
+
93
+ ```bash
94
+ omega doctor # 8-block tree + event store — must print "doctor: PASS"
95
+ omega status # every task and its derived state
96
+ omega version
97
+ ```
98
+
99
+ ## 9. Troubleshooting
100
+
101
+ | Symptom | Fix |
102
+ |---|---|
103
+ | `preflight: running as root` | create and use a non-root `sudo` user |
104
+ | `uv: command not found` after `10` | re-run `install.sh` — step 10 installs `uv` and re-execs the shell |
105
+ | Telegram token rejected | re-check the token from `@BotFather`; re-run — it resumes at `50` |
106
+ | `doctor: FAIL` on a block | the step that builds that block failed — read `Agentik_Extra/var/logs/install.log` |