Documentation Index
Fetch the complete documentation index at: https://docs.openaeon.ai/llms.txt
Use this file to discover all available pages before exploring further.
Cognitive OS engineering plan
Last updated: 2026-04-12Scope and guardrails
This plan implements the cognitive OS model in incremental, backward compatible steps. Guardrails:- Keep existing
task_plan.*methods functional during migration. - Add fields and events before adding new required behavior.
- Preserve current planner file path compatibility under
.openaeon/planner/<session>.json. - Never let dream summaries replace raw execution records.
- UI redesign visual polish
- Cross host distributed scheduler
- External graph database dependency as a phase 1 requirement
Current baseline
Current gateway supports:task_plan.readtask_plan.approvetask_plan.autopilot.tick- broadcasts:
task_plan.execution.trigger,task_plan.autopilot.status,task_plan.autopilot.spawned,task_plan.execution.recover
.openaeon/planner/<sessionKey>.json
- Stage level checkpoint chain with restore
- Branch model and stage history tree
- Dream and episodic separation
- Verifier gate contract per stage
- Cross task graph indexing
Milestones
M0 protocol and data scaffolding
Goal:- Introduce versioned task runtime envelope and new records without changing behavior.
TaskRuntimeV1schema withtask,stages,branches,checkpoints,dreams,verification.- File layout under
.openaeon/cognitive/while mirroring key fields back to legacy planner payload. - Read path adapter that can hydrate from legacy planner format.
- Existing clients using
task_plan.readkeep working. - New fields appear in response payload under optional keys.
M1 checkpoint and reversible state machine
Goal:- Enable deterministic rollback, retry, branch, restore.
- Checkpoint write on stage boundary.
- Branch record model and
stage_historytree. - Transition engine with explicit commands:
forward|rollback|retry|branch|restore.
- Any completed stage can be restored from disk.
- Retry does not overwrite previous attempt evidence.
- Branch creates a new lineage pointer without mutating source branch.
M2 verifier and role split
Goal:- Enforce verification gate and role owned transitions.
- Verifier result contract: pass fail blocked plus evidence.
- Role marker on each stage transition:
planner|executor|verifier|reflector|memory_manager|orchestrator. - Reflector output contract for failed stages with recommended action.
- Stage completion must include verifier outcome.
- Failed stages emit machine readable remediation advice.
M3 graph memory and model routing
Goal:- Add graph edges and routing policy for reusable cognition.
- Graph node edge append log.
- Retrieval API for decision and evidence lookup by anchor.
- Model profile policy resolved by role, stage type, and risk.
- Decision can be traced to evidence and checkpoint chain.
- Routing policy can be inspected for each stage.
Data contracts
The following interfaces define phase 1 through 3 storage shape.Storage layout
Proposed path layout under workspace:.openaeon/cognitive/tasks/<taskId>/runtime.json.openaeon/cognitive/tasks/<taskId>/checkpoints/<checkpointId>.json.openaeon/cognitive/tasks/<taskId>/dreams/<dreamId>.json.openaeon/cognitive/tasks/<taskId>/graph/edges.jsonl.openaeon/planner/<sessionKey>.json(compat mirror during migration)
- Runtime file is authoritative index.
- Checkpoint and dream records are append only immutable artifacts.
- Graph edges are append only JSONL for cheap writes and replay.
RPC and event plan
Keep existing methods
No breaking changes:task_plan.readtask_plan.approvetask_plan.autopilot.tick
Additive method roadmap
Phase 1:task_plan.transition.applytask_plan.checkpoint.restoretask_plan.branch.createtask_plan.verifier.report
task_plan.dream.distilltask_plan.graph.querytask_plan.model.route.resolve
Additive event roadmap
task_plan.stage.changedtask_plan.checkpoint.createdtask_plan.branch.createdtask_plan.verifier.resulttask_plan.dream.createdtask_plan.graph.updatedtask_plan.transition.rejected
- Include
taskId,stageId,branchId,at. - Include
correlationIdfor request event tracing. - Include
sourcerole or component.
Rollout and migration
Step 1 dual write
- Continue writing legacy planner file.
- Write new runtime and immutable records in parallel.
Step 2 shadow read
- Compare hydrated runtime from legacy and new layout.
- Emit warning if mismatch exceeds threshold.
Step 3 switch primary read
- Read from runtime first.
- Fallback to legacy planner parser.
Step 4 remove mirror dependency
- Keep legacy file for a deprecation window.
- Remove when all clients consume runtime aware fields.
First test batch
Unit tests
- Transition engine validity
- Checkpoint serialization and restore determinism
- Branch derivation lineage
- Dream generator schema and anchor normalization
- Model routing policy selection
Integration tests
- Full stage flow: planning to execution to verification to checkpoint to dream
- Failure flow: verifier fail to reflector advice to retry
- Rollback flow: restore checkpoint and continue on new branch
- Multi task isolation for memory and checkpoint domains
- Gateway unknown method guard for non migrated clients
End to end tests
- User creates task and approves plan
- Autopilot progresses ready todos
- Stage fails and recovery event is emitted
- Operator triggers rollback and branch
- Final summary references checkpoint and dream anchors
Suggested PR slicing
PR 1:- Add runtime schemas and storage adapters
- Add dual write and
task_plan.readoptional payload fields
- Add transition engine and checkpoint restore path
- Add transition and checkpoint events
- Add verifier report contract and stage gate enforcement
- Add reflector recommendation schema
- Add dream distillation pipeline and graph edge append log
- Add graph query endpoint
- Add model routing policy resolver and observability fields
- Add docs and regression test expansion
Operational metrics
Track these counters from M1 onward:- stage transition success rate
- verifier fail rate by stage type
- rollback retry branch frequency
- checkpoint restore success rate
- dream generation latency and token cost
- autopilot dispatch queue depth and stall duration