@hilbras/omninode 2.0.0-alpha.2 → 2.0.0-alpha.20

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.
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  [![npm downloads](https://img.shields.io/npm/dm/@hilbras/omninode)](https://www.npmjs.com/package/@hilbras/omninode)
6
6
  [![Node.js support](https://img.shields.io/node/v/@hilbras/omninode)](https://www.npmjs.com/package/@hilbras/omninode)
7
7
  [![License: MIT](https://img.shields.io/github/license/Hilbras/OmniNode)](LICENSE)
8
- [![Roadmap phase](https://img.shields.io/badge/phase-0_%2F_11-Foundation-8A2BE2)](docs/DEVELOPMENT_PLAN.md)
8
+ [![v2 progress](https://img.shields.io/badge/v2-20%20%2F%2024%20phases-8A2BE2)](docs/ROADMAP_V2.md)
9
9
 
10
10
  **OmniNode** is a provider-agnostic multi-AI orchestration platform. It coordinates
11
11
  CLI-based AI agents, AI providers, persistent memory, roles, reports and planning
@@ -18,297 +18,171 @@ existing intelligence; it does not try to become another model.
18
18
 
19
19
  ## Status
20
20
 
21
- **v2.0.0-alpha.2 — v2 Phase 2: Execution Reliability** (after Phase 1: architecture & API stabilization) (the v2
22
- roadmap is [docs/ROADMAP_V2.md](docs/ROADMAP_V2.md); the v1 plan is complete:
23
- the
24
- full loop from §28 runs in one command —
25
- `User → project context → memory → research agents → reports → aggregation →
26
- planner → plan → execution → result` — with audit logging, error recovery and
27
- production hardening (see [docs/DEVELOPMENT_PLAN.md](docs/DEVELOPMENT_PLAN.md)
28
- for the plan and [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) for the design).
21
+ **v1.0.0 is feature complete. v2.0.0 — the reliability and interoperability
22
+ release — is in progress**, shipping as tagged prereleases (`v2.0.0-alpha.N`).
29
23
 
30
- ### What changed in v2 Phase 1
31
-
32
- - All local stores now build on one shared `JsonFileStore` (atomic writes,
33
- serialized read-modify-write, schema-versioned files, corruption tolerance)
34
- with a `ProjectStores` facade.
35
- - Dependency direction corrected (adapters no longer import engine modules).
36
- - API surface stabilized and guarded: [API_STABILITY.md](docs/API_STABILITY.md),
37
- [API.md](docs/API.md), [DEPRECATIONS.md](docs/DEPRECATIONS.md).
38
-
39
- ### What's in v1.0
24
+ ### v1.0.0 delivered
40
25
 
41
26
  | Capability | Where |
42
27
  | --- | --- |
43
- | Provider abstraction, custom providers, model discovery | `src/providers/`, `src/registry/` |
44
- | OmniHilbras integration (optional) | `src/providers/omnihilbras/` |
45
- | CLI agents (stdin/arg/protocol), agent registry | `src/agents/` |
46
- | Roles, projects, tasks (lifecycle + retry) | `src/roles/`, `src/tasks/` |
47
- | Pipelines (DAG, parallel, retries, conditions) | `src/pipelines/` |
48
- | Multi-AI research + report aggregation | `src/reports/` |
49
- | Planner layer (model + heuristic) | `src/planner/` |
50
- | Remembera / local memory | `src/memory/` |
51
- | CLI, configuration, security foundations, docs | `src/cli/`, `src/config/`, `docs/` |
52
-
53
- What exists today:
54
-
55
- - Core type contracts: provider, model, agent, role, task, report, pipeline,
56
- protocol, memory (`src/types/`)
57
- - **Provider system** (`src/providers/`, `src/registry/`):
58
- - OpenAI-compatible adapter — works with OpenAI, OpenRouter, local runtimes
59
- (Ollama, LM Studio, vLLM) and custom gateways exposing `/models` and `/chat/completions`
60
- - Model discovery with normalization into the model registry (`provider:model` keys)
61
- - Health checks: connectivity, authentication and server-error classification
62
- - Authentication from environment variables only — keys never touch config files
63
- - Chat completions (`IChatProvider`) — the foundation for the planner phases
64
- - Provider factory mapping config to adapters; `omnihilbras` gets a
65
- dedicated adapter implementing the plan's connect flow —
66
- Connect → Authenticate → Fetch Models → Validate Models → Register
67
- - **Agent system** (`src/agents/`):
68
- - Process adapter: spawns CLI agents as child processes with lifecycle
69
- management — environment, working directory, exit codes, stderr logs,
70
- per-task timeouts (SIGTERM → SIGKILL) and cancellation
71
- - Three input modes: `stdin` (composed task text on stdin), `arg` (prompt as
72
- last argument) and `protocol` (the §21 JSON-lines task protocol —
73
- `TASK`/`ROLE`/`CONTEXT`/`INSTRUCTION` envelopes in, `REPORT`/`COMPLETION`/
74
- `ERROR` messages out, parsed into structured reports)
75
- - Agent factory and registry (`createAgent`, `AgentRegistry`)
76
- - **Roles & tasks** (`src/roles/`, `src/tasks/`):
77
- - `RoleRegistry` with assignment validation — a task can only reference roles
78
- and agents that actually exist
79
- - Task lifecycle (created → queued → running → completed/failed/cancelled)
80
- with transition enforcement
81
- - `TaskEngine` runs tasks through their assigned agent, records structured
82
- results (summary, reports, errors, timestamps)
83
- - `TaskStore` interface with a local-first JSON implementation in
84
- `.omninode/tasks.json` (atomic writes; swap in any backend)
85
- - **Pipeline engine** (`src/pipelines/`):
86
- - Pipelines defined in `omninode.yaml` under `project.pipelines`, validated
87
- before every run (duplicate ids, unknown dependencies, cycles, missing
88
- agents)
89
- - Sequential execution by definition order; explicit `depends_on` unlocks
90
- parallel branches, and research steps fan out to several agents in
91
- parallel (§15)
92
- - Step kinds: `research` (multi-agent fan-out), `collect`, `analyze`,
93
- `plan` (calls a model as `provider:model-id` via the chat layer),
94
- `execute`/`custom` (hand-off to an execution agent)
95
- - Failure handling: retries per step, `on-success`/`on-failure`/`always`
96
- conditions, combined context threaded downstream; every task runs through
97
- the TaskEngine and every run is persisted to `.omninode/pipelines.json`
98
- - **Multi-AI report system** (`src/reports/`):
99
- - Report collection from finished tasks — structured protocol reports pass
100
- through; plain text output is normalized via deterministic extraction
101
- (findings/recommendations/evidence sections, severity guessing)
102
- - Persistence in `.omninode/reports.json` with full source attribution
103
- - Aggregation (§17): duplicate/similar findings merged via deterministic
104
- token-set similarity, sources preserved, highest severity kept
105
- - Combined reports generated automatically at the end of every pipeline run
106
- - **Memory** (`src/memory/`): the §20 loop — before a task runs, relevant
107
- memory is gathered and injected into the agent's context; after it finishes,
108
- the outcome is recorded back. High/critical findings are promoted to
109
- project-level "known problems". Opt in via a `memory:` config section:
110
- - `provider: local` (default) — JSON file at `.omninode/memory.json` with
111
- deterministic keyword/tag relevance scoring, zero dependencies
112
- - `provider: remembera` — the preferred Hilbras memory integration over
113
- HTTP (base URL + `api_key_env_var`); strictly optional, like every
114
- Hilbras component
115
- - Memory failures are best-effort: logged, never fatal to a task
116
- - **Planner layer** (`src/planner/`):
117
- - Typed plan schema (`Plan` with ordered steps, targets, acceptance
118
- criteria, risks, and finding traceability via `sourceFindings`)
119
- - Planner context builder: objective + role + combined findings with
120
- sources + relevant memory + research context
121
- - `ModelPlanner` — asks a chat model (`provider:model-id`) for JSON matching
122
- the plan contract; unparseable output degrades gracefully to the heuristic
123
- fallback
124
- - `HeuristicPlanner` — deterministic, offline plan from recommendations and
125
- significant findings (also the fallback)
126
- - Plans persist to `.omninode/plans.json`; pipeline runs record `planId`
127
- - Configure with `planner: { kind: model | heuristic, model, instruction }`
128
- — never hardcoded to any provider
129
- - **End-to-end workflow** (§28, §27 Phase 9):
130
- - One-command execution via the top-level `run` alias (`omninode run <pipeline> "<objective>"`)
131
- - `omninode status` — full project state overview: providers, agents,
132
- roles, pipelines, task/run/report/plan counts, memory provider + entries
133
- - Pipeline runs persist their objective and a final `resultSummary` (§28 "Result")
134
- - Error recovery: `task retry [--run]` (reset a failed/cancelled task) and
135
- `pipeline retry <run-id>` (re-run a recorded failed run as a new run)
136
- - Full integration test (`tests/e2e.test.ts`) drives the entire §28 workflow
137
- through the real CLI against a local gateway
138
- - Typed error hierarchy (`src/errors/`)
139
- - Leveled logger with pluggable sink (`src/logger/`)
140
- - Configuration system: `omninode.yaml` with `${ENV_VAR}` expansion and strict
141
- validation (`src/config/`)
142
- - CLI: `init`, `provider add/list/test`, `models`, `agent list`, `role list`,
143
- and honest stubs for the phase-dependent commands (`src/cli/`)
144
- - Test infrastructure (Vitest) and CI (GitHub Actions)
145
-
146
- ## Requirements
147
-
148
- - Node.js >= 20
149
-
150
- ## Quick start (from source)
28
+ | Provider abstraction, custom providers, model discovery | [`src/providers/`](src/providers) |
29
+ | OmniHilbras integration (optional) | `src/providers/omnihilbras` |
30
+ | CLI agents (stdin / arg / protocol modes), agent registry | [`src/agents/`](src/agents) |
31
+ | Roles, tasks with lifecycle and retry | `src/roles`, [`src/tasks/`](src/tasks) |
32
+ | Pipelines: DAG scheduling, fan-out research, conditions, retries | [`src/pipelines/`](src/pipelines) |
33
+ | Multi-AI reports with aggregation and conflict detection | [`src/reports/`](src/reports) |
34
+ | Planner (model-backed with heuristic fallback) | [`src/planner/`](src/planner) |
35
+ | Memory (local + Remembera) wired into the task loop | [`src/memory/`](src/memory) |
36
+ | End-to-end workflow in one command | `omninode run <pipeline> "<objective>"` |
37
+ | Audit log, security model, examples, Docker runtime | [`src/audit/`](src/audit), [docs/SECURITY.md](docs/SECURITY.md) |
38
+
39
+ ### v2.0.0 progress (20 of 24 phases)
40
+
41
+ | # | Phase | Outcome |
42
+ | --- | --- | --- |
43
+ | 1 | Architecture & API stabilization | shared persistence base, guarded public API, deprecation policy |
44
+ | 2 | Execution reliability | `unknown` ≠ `failed`, attempts, execution identity, timeouts |
45
+ | 3 | Agent Protocol v2 | versioned, correlated envelopes, malformed input never crashes |
46
+ | 4 | Agent adapter hardening | process-tree cleanup, env policies, output limits, cwd confinement |
47
+ | 5 | Pipeline lifecycle | cancellation, partial/unknown propagation, interrupted-run detection |
48
+ | 6 | Provider infrastructure | model metadata, `connect`/`getModel`, normalized error kinds |
49
+ | 7 | OmniHilbras v2 | gateway metadata, streaming, enforced separation |
50
+ | 8 | Memory v2 | formal contract, categories, budgeted retrieval, `required` policy |
51
+ | 9 | Report system v2 | validated reports, typed evidence, provenance |
52
+ | 10 | Aggregation | agreements, conflicts (both positions preserved), confidence |
53
+ | 11 | Planner v2 | full input, plan validation, structured errors, provider-agnostic |
54
+ | 12 | Persistence | atomic writes, corruption quarantine, schema v2 + migration |
55
+ | 13 | Security hardening | inline-secret refusal, static guards, `security audit` |
56
+ | 14 | Audit & observability | correlated events, JSON logs, `inspect` diagnostics |
57
+ | 15 | CLI v2 | exit codes, `config` group, `pipeline create`, `--json` |
58
+ | 16 | Configuration v2 | precedence, profiles, `OMNINODE_*`, diagnostics |
59
+ | 17 | Testing expansion | explicit failure matrix + regression tests |
60
+ | 18 | Documentation overhaul | complete document set, rewritten README |
61
+ | 19 | API & package quality | curated public surface with CI guards, boundary validation, verified package contents |
62
+ | 20 | Performance & resources | bounded reports/context/audit log, concurrency limits, released handles |
63
+ | 21–24 | Developer experience · CI/CD · migration tooling · final hardening | next: developer experience |
64
+
65
+ The roadmap is [docs/ROADMAP_V2.md](docs/ROADMAP_V2.md); the completed v1 plan is
66
+ [docs/DEVELOPMENT_PLAN.md](docs/DEVELOPMENT_PLAN.md).
151
67
 
152
- ```bash
153
- npm install
154
- npm run build
155
- node dist/cli/index.js --help
68
+ ## Documentation
156
69
 
157
- # Or run from source:
158
- npm run omninode -- --help
159
- ```
70
+ | Document | What it covers |
71
+ | --- | --- |
72
+ | [Configuration](docs/CONFIGURATION.md) | source precedence, profiles, secrets, diagnostics |
73
+ | [CLI](docs/CLI.md) | command groups, output modes, exit codes, recipes |
74
+ | [Agents](docs/AGENTS.md) | registering agents, input modes, process handling, native adapters |
75
+ | [Pipelines](docs/PIPELINES.md) | pipeline definitions, step kinds, scheduling, results |
76
+ | [Agent Protocol v2](docs/PROTOCOL.md) | the interoperability spec external agents implement |
77
+ | [Providers](docs/PROVIDERS.md) | the provider contract, metadata, error normalization |
78
+ | [Memory](docs/MEMORY.md) | the memory contract, categories, retrieval, migration |
79
+ | [Reports](docs/REPORTS.md) | report schema, validation, aggregation, conflicts |
80
+ | [Persistence](docs/PERSISTENCE.md) | storage interfaces, durability, corruption, migration |
81
+ | [Security](docs/SECURITY.md) | secrets, process execution, trust model, sandbox boundary |
82
+ | [Testing](docs/TESTING.md) | the failure matrix and regression-test discipline |
83
+ | [Troubleshooting](docs/TROUBLESHOOTING.md) | symptom → cause → fix |
84
+ | [Migration](docs/MIGRATION.md) | v1 → v2 (compat, storage, config, protocol) |
85
+ | [Contributing](docs/CONTRIBUTING.md) | setup, workflow, release process |
86
+ | [Architecture](docs/ARCHITECTURE.md) | module map, workflow, execution states, audit |
87
+ | [API](docs/API.md) · [API stability](docs/API_STABILITY.md) · [Deprecations](docs/DEPRECATIONS.md) | the public surface and its guarantees |
88
+ | [CHANGELOG](CHANGELOG.md) · [v1 plan](docs/DEVELOPMENT_PLAN.md) · [v2 roadmap](docs/ROADMAP_V2.md) | history and plans |
160
89
 
161
- Start a project:
90
+ ## Roadmap
162
91
 
163
- ```bash
164
- omninode init # writes omninode.yaml in the current directory
92
+ The v1 plan (phases 0–11) is complete and shipped as **v1.0.0** — see
93
+ [docs/DEVELOPMENT_PLAN.md](docs/DEVELOPMENT_PLAN.md). The v2 roadmap
94
+ (24 phases) is in progress — see [docs/ROADMAP_V2.md](docs/ROADMAP_V2.md):
165
95
 
166
- # Register a provider and verify it end to end
167
- omninode provider add --name my-gateway --type openai-compatible \
168
- --base-url https://example.com/v1 --api-key-env-var MY_API_KEY
169
- omninode provider test my-gateway
96
+ | Version | Milestone |
97
+ | --- | --- |
98
+ | v0.1.0 – v0.10.0 | Foundation → end-to-end workflow |
99
+ | **v1.0.0** | Production Release (v1 plan complete) |
100
+ | **v2.0.0-alpha.N** | Reliability & interoperability line (phases 1–18 shipped) |
101
+ | v2.0.0 | Phases 19–24: package quality, performance, DX, CI/CD, migration tooling, final hardening |
170
102
 
171
- # Discover models into the registry
172
- omninode models
173
- omninode models my-gateway --capability chat
103
+ Install prereleases with:
174
104
 
175
- omninode agent list
176
- omninode role list
105
+ ```bash
106
+ npm install -g @hilbras/omninode@next
177
107
  ```
178
108
 
179
- Register and verify a CLI agent (anything executable works — `opencode`,
180
- `kimi`, a custom script):
109
+ Core architectural rule: OmniNode must run successfully with **zero Hilbras
110
+ dependencies**. OmniHilbras and Remembera make it more powerful, but neither is
111
+ required for the core engine.
112
+
113
+ ## Install
181
114
 
182
115
  ```bash
183
- omninode agent add --name opencode --command opencode --input-mode arg
184
- omninode agent test opencode # sends a trivial task over the real adapter
116
+ npm install -g @hilbras/omninode # stable (v1.0.0)
117
+ npm install -g @hilbras/omninode@next # v2 prereleases
185
118
  ```
186
119
 
187
- Create, run and track tasks (the `Project → Task → Role → Agent` chain):
120
+ Or as a library: `npm install @hilbras/omninode`. Node.js 20+.
121
+
122
+ Prefer a container? `docker build -t omninode .` then
123
+ `docker run --rm -v "$PWD:/work" -w /work omninode run my-pipeline "audit the repo"`.
124
+
125
+ ## Quick start
188
126
 
189
127
  ```bash
190
- omninode task create "audit the auth module" --role security-reviewer --agent opencode
191
- omninode task run task-xxxxxx
192
- omninode task status task-xxxxxx
193
- omninode task list
128
+ omninode init # writes omninode.yaml
129
+ omninode provider add --name my-gateway \
130
+ --base-url https://api.example.com/v1 --api-key-env-var MY_API_KEY
131
+ omninode agent add --name researcher --command some-agent --input-mode stdin
194
132
  ```
195
133
 
196
- Orchestrate several AI systems with a pipeline (§14):
134
+ Describe the work as a pipeline — in `omninode.yaml`:
197
135
 
198
136
  ```yaml
199
137
  project:
138
+ memory:
139
+ provider: local # or: remembera
140
+ planner:
141
+ kind: model
142
+ model: my-gateway:chatgpt
200
143
  pipelines:
201
144
  - id: repo-audit
202
145
  steps:
203
- - id: research
146
+ - id: research # independent analyses, run in parallel
204
147
  kind: research
205
- agents: [kimi, gemini, qwen]
206
- - id: plan
148
+ agents: [researcher, second-opinion]
149
+ - id: plan # findings + memory → typed implementation plan
207
150
  kind: plan
208
- model: my-gateway:chatgpt
209
- - id: execute
151
+ - id: execute # hand the plan to an execution agent
210
152
  kind: execute
211
- agent: opencode
153
+ agent: researcher
212
154
  ```
213
155
 
214
- ```bash
215
- omninode pipeline run repo-audit "Audit the authentication module"
216
- omninode report combined # the aggregated intelligence of that run
217
- omninode report show combined-xxx # grouped findings with per-source attribution
218
- omninode plan show plan-xxx # the implementation plan the planner produced
219
- ```
220
-
221
- The planner layer (§18) turns combined intelligence into an ordered,
222
- actionable implementation plan. Configure it once:
223
-
224
- ```yaml
225
- project:
226
- planner:
227
- kind: model # or heuristic for offline planning
228
- model: my-gateway:chatgpt
229
- ```
156
+ …then run the whole loop in one command:
230
157
 
231
158
  ```bash
232
- omninode init
233
- omninode status
234
- omninode run repo-audit "Audit the authentication module" # the whole workflow
235
- omninode pipeline retry run-xxxx # recover a failed run
236
- omninode task retry task-yyyy --run # recover a failed task
159
+ omninode run repo-audit "Audit the authentication module"
237
160
  ```
238
161
 
239
- Persistent memory (§19–§20) — opt in with `memory: { provider: local }` or
240
- `provider: remembera` in `omninode.yaml`:
241
-
242
- ```bash
243
- omninode memory status # provider + entry counts
244
- omninode memory query "authentication jwt" # what the agents will see
245
- omninode memory write "Decision: use rotating JWT secrets" --scope project --tags architecture
246
162
  ```
247
-
248
- See [omninode.yaml.example](omninode.yaml.example) for a full configuration.
249
-
250
- ### Configuration
251
-
252
- OmniNode reads `omninode.yaml` (or `.yml` / `.json`) from the working directory.
253
- Two rules matter:
254
-
255
- 1. **Credentials never live in the file.** Reference environment variables with
256
- `api_key_env_var: MY_API_KEY`; `${VAR}` / `${VAR:-fallback}` references anywhere
257
- in the file are expanded at load time and unset variables abort loading.
258
- 2. **Unknown keys are rejected.** Typos fail loudly instead of being ignored.
259
-
260
- ## Development
261
-
262
- ```bash
263
- npm run build # bundle with tsup (library + CLI)
264
- npm test # run tests once
265
- npm run test:watch # watch mode
266
- npm run lint # eslint
267
- npm run typecheck # tsc --noEmit
268
- npm run format # prettier
163
+ [research] completed
164
+ [plan] completed
165
+ [execute] completed
166
+ reports: 2 structured report(s)
167
+ combined report: combined-m4f2
168
+ plan: plan-a91
169
+ result: Fixed JWT verification and added regression tests.
170
+ Pipeline completed. Run id: run-a91
269
171
  ```
270
172
 
271
- ## Roadmap
272
-
273
- Phases 0–11 are laid out in [docs/DEVELOPMENT_PLAN.md](docs/DEVELOPMENT_PLAN.md):
274
-
275
- | Version | Milestone |
276
- | --- | --- |
277
- | v0.1.0 | Foundation |
278
- | v0.2.0 | Provider System |
279
- | v0.3.0 | OmniHilbras Integration (optional, like every provider) |
280
- | v0.4.0 | Agent System |
281
- | v0.5.0 | Roles & Tasks |
282
- | v0.6.0 | Pipeline Engine |
283
- | v0.7.0 | Multi-AI Reports |
284
- | v0.8.0 | Remembera / Memory |
285
- | v0.9.0 | Planner |
286
- | v0.10.0 | End-to-End Workflow (current) |
287
- | **v1.0.0** | **Production Release — Phases 10 + 11 (current, final)** |
288
-
289
- Core architectural rule: OmniNode must run successfully with **zero Hilbras
290
- dependencies**. OmniHilbras and Remembera make it more powerful, but neither is
291
- required for the core engine.
292
-
293
- ## Documentation
294
-
295
- - [Development plan](docs/DEVELOPMENT_PLAN.md) — the full 12-phase roadmap
296
- - [Architecture](docs/ARCHITECTURE.md) — module map, workflow, local state
297
- - [Security model](docs/SECURITY.md) — secrets, process execution, env isolation, audit log
298
- - [API stability policy](docs/API_STABILITY.md) and [public API inventory](docs/API.md)
299
- - [Deprecations](docs/DEPRECATIONS.md) · [Changelog](CHANGELOG.md) · [v2 roadmap](docs/ROADMAP_V2.md)
300
- - [Example project](examples/demo/) — a runnable end-to-end demo (`./demo.sh`)
301
-
302
- Prefer a container? `docker build -t omninode .` then
303
- `docker run --rm -v "$PWD:/work" -w /work omninode run my-pipeline "audit the repo"`.
304
-
305
- ## Install
173
+ Inspect what happened, in text or JSON:
306
174
 
307
175
  ```bash
308
- npm install -g @hilbras/omninode
176
+ omninode pipeline inspect run-a91
177
+ omninode report combined
178
+ omninode plan show plan-a91
179
+ omninode task inspect task-… --json | jq .
180
+ omninode audit -n 50
309
181
  ```
310
182
 
311
- Or use it as a library: `npm install @hilbras/omninode`.
183
+ Prefer to start from something runnable? [`examples/demo/`](examples/demo/)
184
+ contains a complete project and `./demo.sh` that exercises the full loop with
185
+ agents that need no external tools.
312
186
 
313
187
  ## Connecting OmniHilbras
314
188