Phase 10 — Neuro-Inspired Agent Intelligence
Features grounded in neuroscience and cognitive architecture research that no other agent framework implements. These create a category-defining moat.
Status: Completed (2026-02-09) Depends on: Phases 1-9 complete Migrations: 0017-0022
Sub-Phases
| Sub-Phase | Name | Depends On | Feature Flag | Migration |
|---|---|---|---|---|
| 10A | Metacognitive Monitoring & Cognitive Backpressure | — | CRUVERO_METACOGNITIVE_ENABLED | 0017 |
| 10B | Attention-Weighted Context Windows | — | CRUVERO_SALIENCE_ENABLED, CRUVERO_CONTEXT_BUDGET_ENABLED | 0018 |
| 10C | Temporal Reasoning | — | CRUVERO_TEMPORAL_REASONING_ENABLED | 0019 |
| 10D | Agent Immune System | — | CRUVERO_IMMUNE_ENABLED | 0020 |
| 10E | Compositional Tool Synthesis | — | — (always available) | — |
| 10F | Federated Agent Identity & Trust | — | CRUVERO_TRUST_ENABLED | 0021 |
| 10G | Execution Provenance Graph | — | CRUVERO_PROVENANCE_ENABLED | 0022 |
| 10H | Agent Playground / Simulation Mode | — | — (test tooling) | — |
| XR | Cross-Cutting Wiring & Documentation | 10A-10H | — | — |
Dependency Graph
10A (Metacognitive) ──┐
10B (Salience/Budget) ├──→ XR (Wiring + Docs)
10C (Temporal) │
10D (Immune) ─────────┤
10E (Composite Tools) ┤
10F (Trust) ──────────┤
10G (Provenance) ─────┤
10H (Playground) ─────┘
Within-phase dependencies:
10A: a → b → c → d (sequential)
10B: a → b → c (sequential)
10C: a → b (sequential, b uses 10B-1 salience if available)
10D: a → b (sequential)
10E: single prompt
10F: single prompt
10G: single prompt
10H: single prompt
Sub-phases 10A-10H are independent of each other and can be built in parallel. Each has optional integration points with other sub-phases (documented in their prompt files) but functions standalone.
XR must be done last — it wires everything into the worker and updates documentation.
Implementation Order (Recommended)
- 10B (Salience) — transparent improvement, no feature flag needed for salience scoring
- 10A (Metacognitive) — highest value; uses 10B context assembler if available
- 10C (Temporal) — uses 10B salience for decay integration
- 10D (Immune) — standalone; integrates with 10A if present
- 10E (Composite Tools) — standalone
- 10F (Trust) — standalone
- 10G (Provenance) — extends existing tracing
- 10H (Playground) — testing infrastructure
- XR (Wiring) — final integration
Files Overview
New Files
| File | Sub-Phase | Purpose |
|---|---|---|
internal/agent/metacognitive.go | 10A | Types, policy, check logic |
internal/agent/context_budget.go | 10B | Token budget allocation |
internal/agent/context_assembler.go | 10B | Dynamic prompt assembly |
internal/agent/deadline.go | 10C | Deadline awareness and pressure |
internal/agent/immune.go | 10D | Anomaly signatures, quarantine |
internal/agent/immune_postgres.go | 10D | ImmunityStore Postgres impl |
internal/agent/provenance.go | 10G | Provenance DAG types and store |
internal/agent/provenance_postgres.go | 10G | ProvenanceStore Postgres impl |
internal/memory/salience.go | 10B | Salience scoring |
internal/memory/interference.go | 10B | Conflict detection |
internal/memory/decay.go | 10C | Temporal freshness decay |
internal/tools/composite.go | 10E | Composite tool pipelines |
internal/tools/contracts.go | 10E | Pre/postcondition contracts |
internal/supervisor/trust.go | 10F | Trust scoring and store |
internal/supervisor/capability.go | 10F | Capability manifests |
internal/supervisor/delegation_chain.go | 10F | Delegation chain tracking |
internal/agenttest/playground.go | 10H | DryRunExecutor |
internal/agenttest/scenario.go | 10H | ScenarioRunner |
internal/agenttest/chaos.go | 10H | ChaosExecutor |
cmd/vaccinate/main.go | 10D | Vaccination CLI |
cmd/compose-tool/main.go | 10E | Composite tool registration CLI |
cmd/agent-capability/main.go | 10F | Capability management CLI |
cmd/provenance-query/main.go | 10G | Provenance query CLI |
cmd/playground/main.go | 10H | Playground CLI |
Modified Files
| File | Sub-Phases | Changes |
|---|---|---|
internal/agent/types.go | 10A, 10C | Add MetacognitivePolicy, TemporalConstraints to AgentConfig |
internal/agent/state.go | 10A, 10C | Add MetacognitiveState, TimeAwareness to AgentState |
internal/agent/workflow.go | 10A, 10B, 10C | Metacognitive check, budget assembly, deadline eval |
internal/agent/activities.go | 10A, 10D, 10G | MetacognitiveCheckActivity, immune hooks, provenance |
internal/agent/decision.go | 10A, 10B | Backpressure prompt injection, budget-aware assembly |
internal/memory/postgres_store.go | 10B, 10C | Salience re-ranking, decay, retrieval tracking |
internal/tools/manager.go | 10D, 10E | Quarantine check, composite execution |
internal/supervisor/workflow.go | 10F | Trust-based delegation |
internal/config/config.go | All | New env vars |
cmd/worker/main.go | XR | Register all new stores and activities |
.env.example | All | New env vars |
Migrations
| Number | Sub-Phase | Tables |
|---|---|---|
| 0017 | — | (reserved, no metacognitive tables needed) |
| 0018 | 10B | memory_facts additions: source_type, retrieval_count, last_retrieved_at |
| 0019 | 10C | memory_facts additions: freshness_half_life, last_verified_at, fact_type |
| 0020 | 10D | anomaly_signatures, tool_quarantine |
| 0021 | 10F | agent_capabilities, agent_trust_scores, delegation_chain |
| 0022 | 10G | provenance_nodes, provenance_edges |
Environment Variables
All new env vars use the CRUVERO_ prefix convention. Full listing in each sub-phase doc and consolidated in PHASE10-XR.md.
Prompt Files
Each sub-phase has a companion -PROMPT.md file containing implementation prompts designed for LLM-assisted coding. Prompts are ordered by dependency within each sub-phase. Load the listed context files before executing each prompt.
- PHASE10A-PROMPT.md — 4 prompts (types → activity → handlers → tests)
- PHASE10B-PROMPT.md — 3 prompts (salience → budget → interference)
- PHASE10C-PROMPT.md — 2 prompts (deadline → decay)
- PHASE10D-PROMPT.md — 2 prompts (immune store → vaccination CLI)
- PHASE10E-PROMPT.md — 1 prompt (composite tools + contracts)
- PHASE10F-PROMPT.md — 1 prompt (trust + capabilities)
- PHASE10G-PROMPT.md — 1 prompt (provenance DAG)
- PHASE10H-PROMPT.md — 1 prompt (playground modes)
- PHASE10-XR-PROMPT.md — 2 prompts (wiring → docs)