diff --git a/boot-sequence-plan.md b/boot-sequence-plan.md new file mode 100644 index 0000000..4b2d63e --- /dev/null +++ b/boot-sequence-plan.md @@ -0,0 +1,36 @@ +# Implementation Plan: The Micro-Loader (Boot Sequence Refactor) + +## Objective +Consolidate and harden the kernel's skill-loading logic into a stateful "Micro-Loader." This improves boot reliability, provides clear error reporting for malformed skills, and centralizes all capability management within the `skills` module. + +## Key Files & Context +- **Target:** `projects/org-agent/literate/skills.org` (Consolidating logic here). +- **Target:** `projects/org-agent/literate/core.org` (Moving `load-all-skills` out of here). +- **Mandate:** Syntax Pre-flight and Dependency Assertion. + +## Implementation Steps + +### 1. Define the Skill Catalog +- Introduce `*skill-catalog*` in `skills.lisp` to track metadata and load status for every skill file found in `SKILLS_DIR`. +- Statuses: `:discovered`, `:loading`, `:ready`, `:failed`. + +### 2. Refactor `load-skill-from-org` (Harden) +- **Syntax Check:** Invoke `validate-lisp-syntax` before evaluation. +- **Dependency Check:** If `#+DEPENDS_ON` refers to a skill that failed or is missing, mark this skill as `:failed` immediately with a clear error. +- **Detailed Logging:** Record the specific reason for failure (syntax, timeout, runtime error) in the catalog. + +### 3. Implement `initialize-all-skills` (The Orchestrator) +- Move the directory scanning and loop logic from `core.lisp` into `skills.lisp`. +- This function will: + 1. Scan `SKILLS_DIR`. + 2. Populate the catalog. + 3. Run the topological sort. + 4. Execute the load loop with timeouts. + 5. Print a final "Boot Summary" report. + +### 4. Simplify Kernel Boot +- Update `start-daemon` in `core.lisp` to call `(initialize-all-skills)` instead of the old `load-all-skills`. + +## Phase E: Chaos (Verification) +- **Integrity Test:** Add a test that verifies `initialize-all-skills` correctly identifies a missing dependency and prevents the dependent skill from attempting to load. +- **Report Test:** Verify that the skill catalog correctly reflects the status of loaded vs. failed skills. diff --git a/gtd.org b/gtd.org index bd221dd..a785ced 100644 --- a/gtd.org +++ b/gtd.org @@ -15,6 +15,160 @@ :ID: gtd-projects :END: +** NEXT Org-agent v1.0 +:PROPERTIES: +:ID: proj-org-agent-v1-0 +:PSF-STATE: D: BUILD +:CREATED: [2026-03-09 Mon 14:23] +:END: +Org-agent: A Neurosymbolic AI Agent. + +*** PHASE: FOUNDATION (Complete) +**** DONE Draft Swank/Socket communication protocol between CL and Emacs +:PROPERTIES: +:CREATED: [2026-03-22 Sun 14:00] +:ASSIGNED: Agent +:END: +**** DONE Implement core Perceive-Think-Act loop in Common Lisp +:PROPERTIES: +:CREATED: [2026-03-22 Sun 14:00] +:ASSIGNED: Agent +:END: +**** DONE Implement Persistent Object-Store for Org entities in CL +:PROPERTIES: +:CREATED: [2026-03-22 Sun 16:30] +:ASSIGNED: Agent +:END: +**** DONE Implement LLM Connector (System 1) in CL Daemon +:PROPERTIES: +:CREATED: [2026-03-22 Sun 17:30] +:ASSIGNED: Agent +:END: +**** DONE Design System 2 Heuristics (Lisp logic over Object Store) +:PROPERTIES: +:CREATED: [2026-03-22 Sun 17:30] +:END: +**** DONE Achieve Phase 3: The Self-Editing Kernel +:PROPERTIES: +:CREATED: [2026-03-23 Mon 16:30] +:END: +- Jailing & Sandboxing implemented +- Org-Native Skill Standard established +- Telemetry & Introspection API active + +*** PHASE: THE SOVEREIGN BOUNDARY (Core vs Skills Refactor) +:PROPERTIES: +:ID: proj-sovereign-boundary +:END: +Slim down the org-agent microkernel by moving non-essential cognitive functions to hot-reloadable user-space skills. + +**** DONE Extract LLM Provider Routing to a Skill (neuro.lisp) +**** TODO Extract Vector Embedding Algorithms to a Skill (embedding.lisp) +**** TODO Extract Sparse Tree Context Pruning Strategies to a Skill (context.lisp) +**** TODO Implement `org-skill-peripheral-vision` (Moving embedding logic out of core) +**** TODO Implement Privacy-Aware Background Indexer (Local hashes for @personal, Semantic for others) +**** TODO Decouple Transport from Protocol (True Actuator-Agnosticism in protocol.lisp) +**** TODO Implement OACP Schema Validation (Prevent reader macro injection in protocol.lisp) +**** TODO Implement Pluggable OACP Integrity Hashing (Core interface, Skill-based algorithms) +**** TODO Implement OACP Backpressure Handling (Queue bounds and BUSY frames in protocol.lisp) +**** TODO Implement Cognitive Loop "Rut" Recovery (Dynamic Escalation in org-skill-safety-harness) +**** TODO Implement Asynchronous Event Bus for Telemetry (core.lisp) +**** TODO Implement Memory Eviction and Lazy Loading (LRU Cache in object-store.lisp) +**** DONE Implement Native Lisp Merkle-Tree Versioning (Short-term undo buffer in object-store.lisp) +**** DONE Performance: Implement Copy-on-Write (CoW) or Persistent Data Structures for Object Store +**** DONE Feature: Implement Latent Reflection (Proactive Gardening) using heartbeat idle cycles +**** DONE Simplification: Refactor Cognitive Loop into a Unified Reactive Signal Pipeline +**** DONE Resilience: Implement Micro-Rollbacks for the Immune System +**** DONE Implement `org-skill-memory-archivist` (Long-term IPFS checkpointing and P2P sync) +**** DONE Implement True Lisp Sandboxing (eval-safe mechanism in core and policy in skills) +**** DONE Decouple Vendor Logic from System 1 (Move Google/Anthropic/OpenAI to Skills) +**** DONE Component IV: Comprehensive Core Skill Audit (Review all 39 skills) +**** DONE Consolidation I: Unified LLM Gateway (Anthropic, Gemini, Groq, OpenAI, etc.) +**** DONE Consolidation II: Credentials Vault (Secure Enclave & Masked Logging) +**** DONE Consolidation III: Homoiconic Memory (Unified Grammar, Bridge, & ID Generation) +**** DONE Consolidation IV: State Persistence Layer (Unified Local & IPFS Checkpointing) +**** DONE Consolidation V: Event Orchestrator (Unified Cron, Hooks, & Cognitive Routing) +**** DONE Consolidation VI: Task Orchestrator (Task Integrity, Delegation, & Consensus) + CLOSED: [2026-04-11 Sat 13:45] + :PROPERTIES: + :ID: task-orchestrator-consolidation + :END: + - Implemented Parallel Multi-Backend Consensus in neuro.lisp. + - Implemented Task Integrity (GTD semantics) in symbolic.lisp. + - Integrated Consensus Gate and Delegation hooks in core.lisp. + - Verified with new task-orchestrator-tests.lisp. +**** TODO Implement `org-skill-lisp-repair` (Self-correcting syntax gate for System 2) +**** TODO Implement `org-skill-formal-verification` (Prove safety of high-impact actions) + +*** PHASE: SYSTEM 2 REFINEMENT +**** NEXT Verify Autonomous Self-Fix Loop +:PROPERTIES: +:CREATED: [2026-03-23 Mon 16:30] +:END: +Trigger a deliberate error and ensure `skill-self-fix` repairs the code. +**** TODO Implement "Planning Mode" (System 2 Bouncer) for Complex Actions +:PROPERTIES: +:CREATED: [2026-04-01 Wed 17:00] +:ASSIGNED: Agent +:END: +**** TODO Implement Authorization Gate (OACP) for "Planning Mode" +:PROPERTIES: +:CREATED: [2026-04-01 Wed 17:00] +:ASSIGNED: Agent +:END: + +*** TRACK: INTELLIGENCE & ACTUATION (The Engines) +**** TODO Verify provider-anthropic skill +**** TODO Verify provider-gemini skill +**** TODO Verify provider-groq skill +**** TODO Verify provider-ollama skill +**** TODO Verify provider-openai skill +**** TODO Verify provider-openrouter skill +**** TODO Verify org-skill-shell-actuator formal safety harnesses +**** TODO Implement Skill Graph Visualizer in Web Dashboard +**** TODO Build Playwright-Python Bridge for high-fidelity browsing + +*** TRACK: COMMUNICATION & INTERFACES +**** TODO Implement org-skill-gateway-telegram +**** TODO Implement org-skill-gateway-signal +**** TODO Implement org-skill-gateway-matrix + +*** TRACK: DEPLOYMENT & INFRASTRUCTURE +**** TODO Create Dockerfile and docker-compose.yml for containerized setup +**** TODO Create Bare Metal installation scripts/playbooks +**** TODO Create LXC (Linux Containers) template/guide +**** TODO Create VM Vagrantfiles/Cloud-init configs + +*** TRACK: COMMUNITY & DOCS +**** TODO Write Quickstart Guide +**** TODO Write Skill Creation Guide +**** TODO Write Architecture Deep-Dive +**** TODO Clean up GitHub repository structure and add CI/CD +**** TODO Create Marketing Material (Landing page copy, diagrams) +**** TODO Draft Release Plan checklist + +*** SUB-PROJECT: THE BOOT SEQUENCE (skills.lisp) +:PROPERTIES: +:ID: proj-skill-boot-sequence +:END: +**** TODO Refactor `skills.lisp` into a Micro-Loader (Core) +**** TODO Implement Topological Sort based on `#+DEPENDS_ON:` tags +**** TODO Enforce `org-skill-agent` as the mandatory Gateway Skill (Loaded first) +**** TODO Formalize the "Minimal Boot Set" (Router, Vision, Steward, Actuator) +**** TODO Implement Skill Capability Negotiation (Pre-flight tool check) +**** TODO Add Resource Jailing (Timeouts and Memory Quotas for Skills) + +*** SUB-PROJECT: COGNITIVE BENCHMARKING (Claw-Code Distillation) +:PROPERTIES: +:ID: proj-claw-code-benchmarking +:END: +**** TODO Map Claw-Code Tool-Use Protocol (How it handles multi-tool steps) +**** TODO Distill Claw-Code File Editing Techniques (Surgical diffing vs overwriting) +**** TODO Analyze Claw-Code History Pruning (How it stays within context limits) +**** TODO Write a comprehensive Note in notes/ on "Lessons from the Rust Agent Explosion" +**** TODO Implement `org-skill-history-pruner` based on claw-code context checkpointing +**** TODO Implement `org-skill-tool-router` based on claw-code semantic tool selection + ** NEXT PSF Core: Role Automation :PROPERTIES: :ID: proj-psf-core @@ -50,94 +204,6 @@ Drafting the automated behaviors for the PSF loop. - State "DONE" from "TODO" [2026-03-30 Mon 19:30] :END: -** NEXT Refactor: The Sovereign Boundary (Core vs Skills) -:PROPERTIES: -:ID: proj-sovereign-boundary -:PROJECT_PATH: $PROJECTS_DIR/org-agent -:PSF-STATE: A: DEMAND -:END: -Slim down the org-agent microkernel by moving non-essential cognitive functions to hot-reloadable user-space skills. - -*** DONE Extract LLM Provider Routing to a Skill (neuro.lisp) -*** TODO Extract Vector Embedding Algorithms to a Skill (embedding.lisp) -*** TODO Extract Sparse Tree Context Pruning Strategies to a Skill (context.lisp) -*** TODO Implement `org-skill-peripheral-vision` (Moving embedding logic out of core) -*** TODO Implement Privacy-Aware Background Indexer (Local hashes for @personal, Semantic for others) -*** TODO Decouple Transport from Protocol (True Actuator-Agnosticism in protocol.lisp) -*** TODO Implement OACP Schema Validation (Prevent reader macro injection in protocol.lisp) -*** TODO Implement Pluggable OACP Integrity Hashing (Core interface, Skill-based algorithms) -*** TODO Implement OACP Backpressure Handling (Queue bounds and BUSY frames in protocol.lisp) -*** TODO Implement Cognitive Loop "Rut" Recovery (Dynamic Escalation in org-skill-safety-harness) -*** TODO Implement Asynchronous Event Bus for Telemetry (core.lisp) -*** TODO Implement Memory Eviction and Lazy Loading (LRU Cache in object-store.lisp) -*** DONE Implement Native Lisp Merkle-Tree Versioning (Short-term undo buffer in object-store.lisp) - CLOSED: [2026-04-09 Thu 14:45] - :LOGBOOK: - - State "DONE" from "TODO" [2026-04-09 Thu 14:45] - :END: -*** DONE Performance: Implement Copy-on-Write (CoW) or Persistent Data Structures for Object Store - CLOSED: [2026-04-09 Thu 14:46] - :LOGBOOK: - - State "DONE" from "TODO" [2026-04-09 Thu 14:46] - :END: -*** DONE Feature: Implement Latent Reflection (Proactive Gardening) using heartbeat idle cycles - CLOSED: [2026-04-09 Thu 20:15] - :LOGBOOK: - - State "DONE" from "TODO" [2026-04-09 Thu 20:15] - :END: -*** DONE Simplification: Refactor Cognitive Loop into a Unified Reactive Signal Pipeline - CLOSED: [2026-04-09 Thu 15:15] - :LOGBOOK: - - State "DONE" from "TODO" [2026-04-09 Thu 15:15] - :END: -*** DONE Resilience: Implement Micro-Rollbacks for the Immune System - CLOSED: [2026-04-09 Thu 15:36] - :LOGBOOK: - - State "DONE" from "TODO" [2026-04-09 Thu 15:36] - :END: -*** DONE Implement `org-skill-memory-archivist` (Long-term IPFS checkpointing and P2P sync) - CLOSED: [2026-04-09 Thu 15:35] - :LOGBOOK: - - State "DONE" from "TODO" [2026-04-09 Thu 15:35] - :END: -*** DONE Implement True Lisp Sandboxing (eval-safe mechanism in core and policy in skills) - CLOSED: [2026-04-09 Thu 16:28] - :LOGBOOK: - - State "DONE" from "TODO" [2026-04-09 Thu 16:28] - :END: -*** DONE Decouple Vendor Logic from System 1 (Move Google/Anthropic/OpenAI to Skills) -*** TODO Implement `org-skill-lisp-repair` (Self-correcting syntax gate for System 2) -*** TODO Implement `org-skill-formal-verification` (Prove safety of high-impact actions) - -** NEXT Project: Cognitive Benchmarking (Claw-Code Distillation) -:PROPERTIES: -:ID: proj-claw-code-benchmarking -:PROJECT_PATH: $PROJECTS_DIR/benchmarking -:PSF-STATE: A: DEMAND -:END: -Systematically study the `claw-code` (Rust) and leaked Claude Code architectures to improve the `org-agent` kernel and skills. - -*** TODO Map Claw-Code Tool-Use Protocol (How it handles multi-tool steps) -*** TODO Distill Claw-Code File Editing Techniques (Surgical diffing vs overwriting) -*** TODO Analyze Claw-Code History Pruning (How it stays within context limits) -*** TODO Write a comprehensive Note in notes/ on "Lessons from the Rust Agent Explosion" -*** TODO Implement `org-skill-history-pruner` based on claw-code context checkpointing -*** TODO Implement `org-skill-tool-router` based on claw-code semantic tool selection - -** NEXT Project: The Boot Sequence (Refining skills.lisp) -:PROPERTIES: -:ID: proj-skill-boot-sequence -:PSF-STATE: B: BLUEPRINT -:END: -Implement the topological dependency loader and solve the bootstrapping paradox. - -*** TODO Refactor `skills.lisp` into a Micro-Loader (Core) -*** TODO Implement Topological Sort based on `#+DEPENDS_ON:` tags -*** TODO Enforce `org-skill-agent` as the mandatory Gateway Skill (Loaded first) -*** TODO Formalize the "Minimal Boot Set" (Router, Vision, Steward, Actuator) -*** TODO Implement Skill Capability Negotiation (Pre-flight tool check) -*** TODO Add Resource Jailing (Timeouts and Memory Quotas for Skills) - ** Agora: Decentralized Social Network :PROPERTIES: :ID: agora-project @@ -365,102 +431,6 @@ Institutionalizing the virtual software house operating system. :ASSIGNED: Technical Analyst :END: -** Org-agent -:PROPERTIES: -:CREATED: [2026-03-09 Mon 14:23] -:END: - -Org-agent: A Neurosymbolic AI Agent. - -*** DONE Draft Swank/Socket communication protocol between CL and Emacs -:PROPERTIES: -:CREATED: [2026-03-22 Sun 14:00] -:ASSIGNED: Agent -:END: -:LOGBOOK: -- State "DONE" from "TODO" [2026-03-22 Sun 15:00] -:END: - -*** DONE Implement core Perceive-Think-Act loop in Common Lisp -:PROPERTIES: -:CREATED: [2026-03-22 Sun 14:00] -:ASSIGNED: Agent -:END: -:LOGBOOK: -- State "DONE" from "NEXT" [2026-03-22 Sun 16:00] -:END: - -*** DONE Implement Persistent Object-Store for Org entities in CL -:PROPERTIES: -:CREATED: [2026-03-22 Sun 16:30] -:ASSIGNED: Agent -:END: -:LOGBOOK: -- State "DONE" from "TODO" [2026-03-22 Sun 17:15] -:END: - -*** DONE Implement LLM Connector (System 1) in CL Daemon -:PROPERTIES: -:CREATED: [2026-03-22 Sun 17:30] -:ASSIGNED: Agent -:END: -:LOGBOOK: -- State "DONE" from "NEXT" [2026-03-23 Mon 16:30] -:END: - -*** DONE Design System 2 Heuristics (Lisp logic over Object Store) -:PROPERTIES: -:CREATED: [2026-03-22 Sun 17:30] -:END: -:LOGBOOK: -- State "DONE" from "TODO" [2026-03-23 Mon 16:30] -:END: - -*** DONE Achieve Phase 3: The Self-Editing Kernel -:PROPERTIES: -:CREATED: [2026-03-23 Mon 16:30] -:END: -- Jailing & Sandboxing implemented -- Org-Native Skill Standard established -- Telemetry & Introspection API active - -*** NEXT Verify Autonomous Self-Fix Loop -:PROPERTIES: -:CREATED: [2026-03-23 Mon 16:30] -:END: -Trigger a deliberate error and ensure `skill-self-fix` repairs the code. - -*** TODO Implement "Planning Mode" (System 2 Bouncer) for Complex Actions -:PROPERTIES: -:CREATED: [2026-04-01 Wed 17:00] -:ASSIGNED: Agent -:END: -- Modify `decide` in `symbolic.lisp` to intercept core modifications, dependency installations, and configuration changes. -- Transition state to `:PLANNING` instead of executing directly. -- Draft flight plans as Org-mode artifacts in `~/memex/inbox/`. - -*** TODO Implement Authorization Gate (OACP) for "Planning Mode" -:PROPERTIES: -:CREATED: [2026-04-01 Wed 17:00] -:ASSIGNED: Agent -:END: -- Send `:AUTHORIZATION-REQUEST` to Emacs. -- Display Emacs prompt for the Sovereign to review the flight plan. -- Block the cognitive thread until `:AUTHORIZATION-RESPONSE` is received. -- Run automated test suite immediately upon `:APPROVED` action execution. - -*** TODO Implement Skill Graph Visualizer in Web Dashboard -:PROPERTIES: -:CREATED: [2026-03-23 Mon 16:30] -:END: -Convert the flat list to a D3.js or similar graph view. - -*** TODO Build Playwright-Python Bridge for high-fidelity browsing -:PROPERTIES: -:CREATED: [2026-03-23 Mon 16:30] -:END: -Expand `skill-web-research` to handle JS-heavy sites. - ** Lisp Machine Bootstrap :PROPERTIES: :ID: lisp-machine-bootstrap diff --git a/notes/v1-0-skill-audit-track.org b/notes/v1-0-skill-audit-track.org new file mode 100644 index 0000000..8caa915 --- /dev/null +++ b/notes/v1-0-skill-audit-track.org @@ -0,0 +1,168 @@ +#+TITLE: AUDIT: V1.0 Comprehensive Core Skill Audit +#+AUTHOR: Gemini CLI (Agent) +#+DATE: [2026-04-09 Thu] +#+FILETAGS: :audit:kernel:psf: +#+STARTUP: overview + +* Overview +This audit systematically reviews the 39 core skills of the Org-Agent for compliance with the V1.0 standards: +1. **Safety:** Prevention of code injection, proper sandboxing, and actuator safety. +2. **Merkle-Tree Integration:** Proper use of the native Lisp Merkle-Tree versioning for undo/rollback. +3. **Core Invariants:** Adherence to Sovereignty, Mastery, Zero-Bloat, Transparency, and Sustainability. + +* Audit Progress [6/28] +** DONE org-skill-agent.org [X] + - COMPLIANT: Correctly defines and enforces Core Invariants. + - SAFETY: High. Implements baseline symbolic gating. + - MERKLE: N/A (Read-only/Policy only). +** DONE org-skill-llm-gateway.org [X] + - COMPLIANT: Consolidates 6 providers into a single high-integrity gate. + - SAFETY: HIGH. Fixed URL key leaks, standardized headers, and centralized credential masking. + - MERKLE: N/A (Stateless dispatch). +** DONE org-skill-credentials-vault.org [X] + - COMPLIANT: Unified high-security enclave for API keys and cookies. + - SAFETY: HIGH. Mandatory credential masking in logs and secure Object Store persistence. + - MERKLE: COMPLIANT. Setting secrets triggers Merkle snapshots. +** DONE org-skill-homoiconic-memory.org [X] + - COMPLIANT: Unified grammar, bridge, and normalization. + - SAFETY: HIGH. recursive AST walker for ID injection and structural validation. + - MERKLE: COMPLIANT. Normalization occurs during ingest/save, which are Merkle-versioned events. +** DONE org-skill-state-persistence.org [X] + - COMPLIANT: Unified local SBCL image dumps with decentralized IPFS checkpointing. + - SAFETY: HIGH. Implements safe restoration paths and credential masking. + - MERKLE: COMPLIANT. This is the primary persistence layer for the Merkle-Tree object store. +** DONE org-skill-event-orchestrator.org [X] + - COMPLIANT: Unified Cron, Hooks, and Routing into a single central control unit. + - SAFETY: HIGH. Implements error isolation for automated tasks and hooks. + - MERKLE: COMPLIANT. Registering hooks or tasks triggers Merkle snapshots. +** DONE org-skill-cron.org [X] (CONSOLIDATED -> org-skill-event-orchestrator.org) +** DONE org-skill-hook-manager.org [X] (CONSOLIDATED -> org-skill-event-orchestrator.org) +** DONE org-skill-router.org [X] (CONSOLIDATED -> org-skill-event-orchestrator.org) +** DONE org-skill-memory-archivist.org [X] (CONSOLIDATED -> org-skill-state-persistence.org) +** DONE org-skill-object-store-persistence.org [X] (CONSOLIDATED -> org-skill-state-persistence.org) +** DONE org-skill-ast-normalization.org [X] (CONSOLIDATED -> org-skill-homoiconic-memory.org) +** DONE org-skill-org-json-bridge.org [X] (CONSOLIDATED -> org-skill-homoiconic-memory.org) +** DONE org-skill-org-mode.org [X] (CONSOLIDATED -> org-skill-homoiconic-memory.org) +** DONE org-skill-auth-api-key.org [X] (CONSOLIDATED -> org-skill-credentials-vault.org) +** DONE org-skill-auth-google-oauth.org [X] (CONSOLIDATED -> org-skill-credentials-vault.org) +** DONE org-skill-provider-anthropic.org [X] (CONSOLIDATED -> org-skill-llm-gateway.org) +** DONE org-skill-provider-gemini.org [X] (CONSOLIDATED -> org-skill-llm-gateway.org) +** DONE org-skill-provider-groq.org [X] (CONSOLIDATED -> org-skill-llm-gateway.org) +** DONE org-skill-provider-ollama.org [X] (CONSOLIDATED -> org-skill-llm-gateway.org) +** DONE org-skill-provider-openai.org [X] (CONSOLIDATED -> org-skill-llm-gateway.org) +** DONE org-skill-provider-openrouter.org [X] (CONSOLIDATED -> org-skill-llm-gateway.org) +** DONE org-skill-chaos.org [ ] + - STATUS: NON-COMPLIANT (Safety/Sovereignty Violation) + - ISSUE: Lacks an "Active Production" gate to prevent accidental chaos during real work. No Merkle-Tree checkpoints before/after stress tests to allow for full-system rollback. + - SAFETY: MEDIUM (Adversarial by design, but ungated). + - MERKLE: FAILED. +** DONE org-skill-chat.org [ ] + - STATUS: NON-COMPLIANT (Safety/Technical Mastery Violation) + - ISSUE: Uses `read-from-string` on unverified LLM output, risking reader macro injection. No Merkle-Tree integration for chat history persistence or rollbacks. + - SAFETY: LOW (Vulnerable to injection). + - MERKLE: FAILED. +** DONE org-skill-consensus.org [ ] + - STATUS: NON-COMPLIANT (Technical Mastery/Sovereignty Violation) + - ISSUE: Implementation is a "stub" and lacks actual networking, state persistence, or Byzantine fault tolerance as claimed. No Merkle-Tree integration for cross-instance state synchronization. + - SAFETY: LOW (Unverified consensus). + - MERKLE: FAILED. +** DONE org-skill-context-manager.org [ ] + - STATUS: NON-COMPLIANT (Critical Gap) + - ISSUE: No implementation code in Phase D. The skill is only a blueprint. No Merkle-Tree integration for context stack snapshots or rollbacks. + - SAFETY: N/A (Missing). + - MERKLE: FAILED. +** DONE org-skill-delegation.org [ ] + - STATUS: NON-COMPLIANT (Critical Gap) + - ISSUE: No implementation code in Phase D. The skill is only a blueprint. No Merkle-Tree integration for delegation history or state rollbacks. + - SAFETY: N/A (Missing). + - MERKLE: FAILED. +** DONE org-skill-environment-config.org [ ] + - STATUS: NON-COMPLIANT (Safety/Technical Mastery Violation) + - ISSUE: No validation or authorization gating for configuration changes. Direct hash-table modification skips the new Merkle-Tree versioning system in the Object Store. + - SAFETY: MEDIUM (Risk of misconfiguration). + - MERKLE: FAILED. +** DONE org-skill-formal-verification.org [ ] + - STATUS: NON-COMPLIANT (Technical Mastery/Sovereignty Violation) + - ISSUE: Implementation is a "mock" and lacks actual integration with an SMT solver (Z3). No Merkle-Tree integration for recording and rolling back verification results or state. + - SAFETY: LOW (Unverified verification). + - MERKLE: FAILED. +** DONE org-skill-function-calling.org [ ] + - STATUS: NON-COMPLIANT (Critical Gap) + - ISSUE: No implementation code in Phase D. The skill is only a blueprint. No Merkle-Tree integration for recording and rolling back tool-use history or state. + - SAFETY: N/A (Missing). + - MERKLE: FAILED. +** DONE org-skill-inbound-gateway.org [ ] + - STATUS: NON-COMPLIANT (Critical Gap) + - ISSUE: No implementation code in Phase D. The skill is only a blueprint. No Merkle-Tree integration for recording and rolling back inbound message history or state. + - SAFETY: N/A (Missing). + - MERKLE: FAILED. +** DONE org-skill-inbox-processor.org [ ] + - STATUS: NON-COMPLIANT (Safety/Technical Mastery Violation) + - ISSUE: Physical move logic is a "Simulation". No implementation of actual file refactoring. No Merkle-Tree integration for recording or rolling back inbox-related state changes. + - SAFETY: MEDIUM (Simulation only). + - MERKLE: FAILED. +** DONE org-skill-latent-reflection.org [ ] + - STATUS: NON-COMPLIANT (Safety/Technical Mastery Violation) + - ISSUE: No validation or authorization gating for reflected state changes. Random sampling is inefficient. No Merkle-Tree integration for recording or rolling back reflected state changes. + - SAFETY: MEDIUM (Risk of unintended modifications). + - MERKLE: FAILED. +** DONE org-skill-lisp-machine-bootstrap.org [ ] + - STATUS: NON-COMPLIANT (Critical Gap) + - ISSUE: No implementation code in Phase D. The skill is only a blueprint. No Merkle-Tree integration for recording or rolling back bootstrap-related state changes or ISA simulation history. + - SAFETY: N/A (Missing). + - MERKLE: FAILED. +** DONE org-skill-log-aggregator.org [ ] + - STATUS: NON-COMPLIANT (Critical Gap) + - ISSUE: No implementation code in Phase D. The skill is only a blueprint. No Merkle-Tree integration for recording or rolling back log-related state changes or observability history. + - SAFETY: N/A (Missing). + - MERKLE: FAILED. +** DONE org-skill-memex.org [ ] + - STATUS: NON-COMPLIANT (Critical Gap) + - ISSUE: No implementation code in Phase D. The skill is only a blueprint. No Merkle-Tree integration for recording or rolling back memex-related state changes or metadata audits. + - SAFETY: N/A (Missing). + - MERKLE: FAILED. +** DONE org-skill-model-explorer.org [ ] + - STATUS: NON-COMPLIANT (Critical Gap) + - ISSUE: No implementation code or blueprint. The skill is only a title and overview. No Merkle-Tree integration for model discovery or state changes. + - SAFETY: N/A (Missing). + - MERKLE: FAILED. +** DONE org-skill-onboarding.org [ ] + - STATUS: NON-COMPLIANT (Critical Gap) + - ISSUE: No implementation code in Phase D. The skill is only a blueprint. No Merkle-Tree integration for recording or rolling back onboarding-related state changes or environment calibration. + - SAFETY: N/A (Missing). + - MERKLE: FAILED. +** DONE org-skill-safety-harness.org [ ] + - STATUS: NON-COMPLIANT (Safety/Technical Mastery Violation) + - ISSUE: No validation or authorization gate for dynamic symbol registration. No Merkle-Tree integration for recording or rolling back safety-related state changes or verification history. + - SAFETY: HIGH (The core of the system's safety). + - MERKLE: FAILED. +** DONE org-skill-self-fix.org [ ] + - STATUS: NON-COMPLIANT (Safety/Technical Mastery Violation) + - ISSUE: No validation or authorization gate for proposed self-fixes. Fixes are applied directly to files. No Merkle-Tree integration for recording or rolling back self-fix-related state changes or repair history. + - SAFETY: LOW (Risk of unintended/malicious modifications). + - MERKLE: FAILED. +** DONE org-skill-shell-actuator.org [ ] + - STATUS: NON-COMPLIANT (Safety/Sovereignty Violation) + - ISSUE: No validation or authorization gate for synthesized script execution. Script synthesis bypasses the shell whitelist. No Merkle-Tree integration for recording or rolling back shell-related state changes or command history. + - SAFETY: MEDIUM (Whitelisted, but script synthesis is a gap). + - MERKLE: FAILED. +** DONE org-skill-sub-agent-manager.org [ ] + - STATUS: NON-COMPLIANT (Critical Gap) + - ISSUE: No implementation code in Phase D. The skill is only a blueprint. No Merkle-Tree integration for recording or rolling back sub-agent-related state changes or concurrent thoughts. + - SAFETY: N/A (Missing). + - MERKLE: FAILED. +** DONE org-skill-task-integrity.org [ ] + - STATUS: NON-COMPLIANT (Critical Gap) + - ISSUE: No implementation code in Phase D. The skill is only a blueprint. No Merkle-Tree integration for recording or rolling back task-related state changes or transition history. + - SAFETY: N/A (Missing). + - MERKLE: FAILED. +** DONE org-skill-token-accountant.org [ ] + - STATUS: NON-COMPLIANT (Safety/Sovereignty Violation) + - ISSUE: Hot-patches the kernel's core variables (`*provider-cascade*`, `*model-selector-fn*`) directly, bypassing the skill registration system's safety. No Merkle-Tree integration for recording or rolling back provider-related state changes or pain history. + - SAFETY: LOW (Direct kernel mutation). + - MERKLE: FAILED. + +* Findings Log +| Skill | Issue | Priority | Status | +|-------+-------+----------+--------| +| | | | | diff --git a/notes/v1-0-skill-audit.org b/notes/v1-0-skill-audit.org new file mode 100644 index 0000000..ebf0d0a --- /dev/null +++ b/notes/v1-0-skill-audit.org @@ -0,0 +1,111 @@ +#+TITLE: Sovereign OS v1.0 Core Skill Audit Report +#+DATE: [2026-04-09 Thu] +#+AUTHOR: Gemini CLI Agent +#+FILETAGS: :audit:v1-0:sovereign-os:psf: + +* Executive Summary +This audit evaluated all 39 Org files in the =projects/org-agent/skills/= directory against the five core criteria for Sovereign OS v1.0. While the conceptual framework and topological foundations (IDs, System 2 hooks) are largely in place, significant implementation gaps exist in OACP compliance and the transition to Merkle-tree versioning. + +** Overall Statistics +- *Total Skills Scanned:* 39 +- *Topological Integrity:* ~85% (Most files have unique IDs; some depend on name-based strings) +- *System 2 Safety:* ~70% (Hooks exist, but symbolic verification logic is often stubbed) +- *Persistence:* ~20% (Basic object-store interaction exists, but Merkle-tree logic is MISSING) +- *OACP Compliance:* ~5% (Only 2/39 skills use =def-cognitive-tool=) +- *Sovereignty Mandate:* ~95% (High adherence to local-first, Lisp-native primitives) + +* Critical Skill Deep Dive + +** org-skill-agent (The Kernel) +- *Status:* STABLE / MANDATORY +- *Topological Integrity:* PASS (ID: 47425a43-2be0-423c-8509-22592cfe9c9e) +- *GAPS:* + - Missing =def-cognitive-tool= for kernel introspection. + - System 2 (Symbolic) logic is primarily a dispatcher; needs more robust "Moral Compass" invariants implemented in code. + +** org-skill-safety-harness (The Gatekeeper) +- *Status:* FUNCTIONAL / MANDATORY +- *Topological Integrity:* PASS (ID: 98576df2-c496-4e4a-9acb-0bca514a0305) +- *GAPS:* + - Whitelist is comprehensive but needs a mechanism for skills to dynamically (and safely) register their own symbols. + - Missing =def-cognitive-tool= for security telemetry. + +** org-skill-self-fix (The Repair Mechanism) +- *Status:* PARTIAL / EXTENSION +- *Topological Integrity:* PARTIAL (Uses =skill-scientist= string instead of ID in =#+DEPENDS_ON:=) +- *GAPS:* + - Rollback logic depends on "Interactive Steering" snapshots which are not yet fully integrated with the Merkle-tree architecture. + - Missing =def-cognitive-tool=. + +** org-skill-object-store-persistence (The Memory Image) +- *Status:* STUBBED / MANDATORY +- *GAPS:* + - *CRITICAL:* Currently uses simple =maphash= + =print= serialization. Does NOT implement the Merkle-tree versioning/rollback logic requested for v1.0. + - Missing background sync triggers beyond basic heartbeat. + +** org-skill-ast-normalization (The Structure Guardian) +- *Status:* BLUEPRINT-ONLY / MANDATORY +- *GAPS:* + - *CRITICAL:* Implementation is missing. Functions like =ast-normalize-file= and =find-conflicts= are defined in the blueprint but not tangled/implemented. + - No integration with the Object Store for structural change tracking. + +* Categorized Skill Audit + +** Core Mandatory +Foundational skills required for system boot and basic operation. +| Skill | ID | Gaps | +|-------+----+------| +| org-skill-agent | 47425a43... | OACP compliance, deeper System 2 logic | +| org-skill-safety-harness | 98576df2... | Dynamic whitelist registration | +| org-skill-ast-normalization | 1063668a... | Implementation missing (Blueprint only) | +| org-skill-object-store-persistence | e8b500e2... | Missing Merkle-tree/Rollback logic | +| org-skill-lisp-machine-bootstrap | 81e3492e... | Purely research/simulation stage | +| org-skill-auth-api-key | ab7f8ca4... | OACP compliance | +| org-skill-router | 0fb9e9cb... | Complexity classification is basic | +| org-skill-sub-agent-manager | e870d860... | Needs better thread isolation logic | + +** Provider +Interfaces to LLM backends. +| Skill | ID | Gaps | +|-------+----+------| +| org-skill-provider-ollama | f605bf22... | OACP compliance, model discovery | +| org-skill-provider-gemini | 52799ee8... | OACP compliance | +| org-skill-provider-openai | c6cbd603... | OACP compliance | +| org-skill-provider-anthropic | a44d29c6... | OACP compliance | + +** Actuator +Sovereign interfaces for system modification. +| Skill | ID | Gaps | +|-------+----+------| +| org-skill-shell-actuator | 0ae190ec... | Missing fine-grained permissions | +| org-skill-org-mode | f7db1884... | Needs better AST-to-JSON bridge integration | +| org-skill-inbound-gateway | 89ee87e0... | Multi-channel normalization is incomplete | + +** Extension +Feature-rich skills extending the kernel. +| Skill | ID | Gaps | +|-------+----+------| +| org-skill-latent-reflection | latent-reflection | (OACP PASS) Needs more triggers | +| org-skill-memory-archivist | 98923a43... | (OACP PASS) IPFS restore is manual | +| org-skill-self-fix | 65891ce2... | Implementation/Rollback logic | +| org-skill-model-explorer | ae49bb72... | Implementation missing (Overview only) | + +* Global Strategic Gaps + +** 1. Merkle-Tree Implementation (Persistence Gap) +The "Object Store" lacks native Merkle-tree versioning. Current serialization is linear and lacks cryptographic integrity and efficient diffing. This is a priority for Component III. + +** 2. OACP Compliance (Tooling Gap) +95% of skills do not use =def-cognitive-tool=. This means System 1 cannot "discover" these capabilities autonomously; they must be hardcoded in the kernel or prompt, violating the PSF's extensibility mandate. + +** 3. Topological Integrity (Refactoring Gap) +Dependency tracking is inconsistent. Some skills use =id:UUID=, others use =skill-name=. This prevents the Lisp machine from building a proper topological sort of the boot sequence. + +** 4. Implementation Vacuum (Completeness Gap) +Critical skills like =ast-normalization= and =model-explorer= are currently "paper skills" (Blueprint/Overview only) and do not provide live functionality. + +* Recommendations +1. *Upgrade Persistence:* Implement the Merkle-tree logic in the core and update =org-skill-object-store-persistence=. +2. *Enforce OACP:* Refactor all skills to use =def-cognitive-tool= with explicit schemas. +3. *Normalize Dependencies:* Standardize all =#+DEPENDS_ON:= to use UUIDs. +4. *Finish Mandatory Implementation:* Prioritize the =ast-normalization= implementation to ensure system-wide ID integrity. diff --git a/projects/org-agent b/projects/org-agent index 2a99517..393c86c 160000 --- a/projects/org-agent +++ b/projects/org-agent @@ -1 +1 @@ -Subproject commit 2a99517dc8178374aaf9dd9044d018db594f6920 +Subproject commit 393c86c7cf353297ccb61abbb8ae6e89909c6aa0 diff --git a/projects/org-agent-contrib b/projects/org-agent-contrib index a74a73a..59093b1 160000 --- a/projects/org-agent-contrib +++ b/projects/org-agent-contrib @@ -1 +1 @@ -Subproject commit a74a73a1605644d4bec9f7736d5825934174f73c +Subproject commit 59093b16e03afc32066172c22c370fb62cbabc97