diff --git a/inbox/flight-plan-chat-fix.org b/inbox/flight-plan-chat-fix.org deleted file mode 100644 index d540dd3..0000000 --- a/inbox/flight-plan-chat-fix.org +++ /dev/null @@ -1,18 +0,0 @@ -* Flight Plan: Fix Chat Skill Parsing -:PROPERTIES: -:STATUS: FINISHED -:END: - -** Analyst Phase -The Chat skill currently tells the LLM to output Org-mode subtrees, but the =org-agent= kernel evaluates LLM output via =read-from-string=. This expects a valid s-expression, specifically a Common Lisp property list (plist) that targets an Emacs actuator with an =:insert-at-end= action. We must explicitly mandate that the LLM wraps its conversational output in this plist. - -** Coder Phase -- [X] Create =inbox/flight-plan-chat-fix.org= (this file). -- [X] Update =notes/org-skill-chat.org= to instruct the LLM to return exactly: =(:target :emacs :payload (:action :insert-at-end :buffer "*org-agent-chat*" :text "..."))= -- [X] Fix tangle paths to root-relative =../projects/...= - -** Tester Phase -- [X] Tangle the file via =emacs --batch=. -- [X] Perform syntax check with SBCL. -- [X] Verified that =projects/org-skill-chat/src/chat-logic.lisp= is correctly generated and valid. -- [ ] User to reload skill and test in Emacs. \ No newline at end of file diff --git a/inbox/flight-plan-neuro-microkernel.org b/inbox/flight-plan-neuro-microkernel.org new file mode 100644 index 0000000..296e649 --- /dev/null +++ b/inbox/flight-plan-neuro-microkernel.org @@ -0,0 +1,30 @@ +#+TITLE: Flight Plan: Neuro Microkernel Architecture +#+DATE: 2026-04-07 +#+FILETAGS: :plan:architecture:neuro:microkernel:psf: + +* Overview +Decouple HTTP request logic from the core neuro kernel (`neuro.lisp`) and migrate it into modular, hot-loadable provider skills (`org-skill-provider-*`). This ensures absolute modular sovereignty. + +* Phase A: Demand (PRD) +- Current state: `neuro.lisp` contains HTTP logic for Groq, OpenRouter, and Gemini. +- Problem: The core kernel is bloated and tightly coupled to external API volatility. +- Solution: Move HTTP logic to `org-skill-provider-*` modules. The kernel's `ask-neuro` becomes a pure interface. + +* Phase C: Success (Quality - Analyst Phase) +- **TDD Requirement:** Create `projects/org-agent/tests/neuro-test.lisp` containing assertions for the new `ask-neuro` contract. +- The tests MUST be executed and PROVE failure before any code is modified. +- Tests will assert that: + 1. `ask-neuro` fails gracefully when the `*neuro-backends*` registry is empty. + 2. `ask-neuro` succeeds when a mock provider is registered and correctly delegates the prompt to the mock function. + +* Phase D: Build (Engineering - Coder Phase) +- Strip `execute-openrouter-request`, `execute-groq-request`, and `execute-gemini-request` from `projects/org-agent/docs/README.org`. +- Draft `notes/org-skill-provider-openrouter.org`. +- Draft `notes/org-skill-provider-groq.org`. +- Draft `notes/org-skill-provider-gemini.org`. +- Tangle updated `README.org` and new skills. + +* Phase E: Chaos (Chaos Phase - Final Verification) +- Hot-load the refactored core and new provider skills. +- Run `neuro-test.lisp` and PROVE it passes. +- Inject a complex chat stimulus and monitor `org-agent-repl.log` for successful autonomous execution. diff --git a/system/flight-plan-chat-ui-fix.org b/system/flight-plan-chat-ui-fix.org deleted file mode 100644 index b4845c7..0000000 --- a/system/flight-plan-chat-ui-fix.org +++ /dev/null @@ -1,23 +0,0 @@ -* Flight Plan: Chat UI Refinement & Preamble Suppression -:PROPERTIES: -:STATUS: IN-PROGRESS -:END: - -** Analyst Phase -The user is seeing the agent's meta-commentary (e.g., "Okay, I've inserted...") and the "Thinking..." status block is not being removed. This is because: -1. The LLM prompt is not strict enough about forbidding explanations. -2. The Emacs =:insert-at-end= actuator blindly appends without checking for the previous status message. - -** Coder Phase -- [X] Create =inbox/flight-plan-chat-ui-fix.org= (this file). -- [ ] Update =projects/org-agent/src/org-agent.el= to replace "Thinking..." lines. -- [ ] Update =notes/org-skill-chat.org= to suppress conversational preamble. -- [ ] Tangle and restart. - -** Tester Phase -1. Tangle all modified files. -2. Restart the daemon. -3. Reload =org-agent.el= in Emacs. -4. Test chat and verify: - - "Thinking..." is replaced by the response. - - No "Okay, I've inserted..." preamble appears. diff --git a/system/flight-plan-clean-build.org b/system/flight-plan-clean-build.org deleted file mode 100644 index 82a010f..0000000 --- a/system/flight-plan-clean-build.org +++ /dev/null @@ -1,48 +0,0 @@ -#+TITLE: Flight Plan: Verified Clean Build & LLM Test -#+AUTHOR: Gemini CLI -#+DATE: 2026-04-01 -#+FILETAGS: :psf:build:qa: -#+STARTUP: content - -* Overview -This flight plan defines the strict, step-by-step protocol for escaping the Lisp caching trap, properly tangling the literate source, and verifying the live OpenRouter connection. - -*Rule:* The agent MUST check off each step and verify its success output BEFORE proceeding to the next step. No chained commands. - -* Phase A: Purge & Verify (The Scientist) -** DONE 1. Nuke the Lisp Cache -- Action: Delete =~/.cache/common-lisp/= to destroy all stale =.fasl= binaries. -- Verification: The directory must not exist. -- Result: *SUCCESS: Cache purged.* - -** DONE 2. Verify Literate Source Syntax -- Action: Read the =get-embedding= and =execute-openrouter-request= functions in =docs/README.org=. -- Verification: Ensure there are no unmatched parentheses or syntax errors that would break the Emacs tangling process. -- Result: *SUCCESS: Syntax verified (no unmatched parentheses found).* - -* Phase B: Tangle & Audit (The Coder) -** TODO 3. Tangle the Literate Source -- Action: Run =emacs --batch --eval '(require (quote ob-tangle))' --eval '(org-babel-tangle-file "~/memex/projects/org-agent/docs/README.org")'= -- Verification: The command must exit with code 0 and report that blocks were tangled. - -** TODO 4. Audit the Physical Lisp Files -- Action: Read =src/embedding.lisp= and =src/core.lisp=. -- Verification: Confirm that the text on disk physically matches the fixes made in =README.org= (e.g., =get-embedding= is correct, =start-daemon= skips whitespace). - -* Phase C: Quality Gate (The Tester) -** TODO 5. Run the Lisp Test Suite -- Action: Execute =sbcl --non-interactive --eval "(asdf:test-system :org-agent)"= -- Verification: All 13 cognitive tests must pass. If any fail, STOP and return to Phase A. - -** TODO 6. Compile the Sovereign Binary -- Action: Run the manual =sb-ext:save-lisp-and-die= build script. -- Verification: The binary is generated without fatal compiler errors. - -* Phase D: Live Execution (The Sovereign) -** TODO 7. Clean Restart -- Action: Kill all stale =org-agent-server= processes and start the new binary in the background. -- Verification: The log shows =org-agent Kernel Booted Successfully= and =Daemon Listening=. - -** TODO 8. Live Model Discovery Test -- Action: Send =@agent list models= via Emacs batch script. -- Verification: The daemon log shows the generated Org-mode table of OpenRouter models. diff --git a/system/flight-plan-emacs-bridge.org b/system/flight-plan-emacs-bridge.org deleted file mode 100644 index b1f861e..0000000 --- a/system/flight-plan-emacs-bridge.org +++ /dev/null @@ -1,23 +0,0 @@ -* Flight Plan: Emacs OACP Outbound Bridge -:PROPERTIES: -:STATUS: IN-PROGRESS -:END: - -** Analyst Phase -The current =org-agent= kernel is a "one-way" sensory system. It receives stimuli from Emacs via OACP but lacks the physical plumbing to send responses back over the same socket. To fix this, we must: -1. Modify the kernel (literately) to pass the client TCP stream through the cognitive loop. -2. Implement the =skill-emacs-bridge= logic to capture this stream and perform framed OACP writes. -3. Update the =skill-chat= to utilize the new bridge. - -** Coder Phase -- [X] Create =inbox/flight-plan-emacs-bridge.org= (this file). -- [ ] Update =projects/org-agent/docs/README.org= (Literate Kernel) with the stream-passing hook. -- [ ] Update =notes/org-skill-emacs-bridge.org= to implement the OACP outbound writer. -- [ ] Tangle the updated files. -- [ ] Rebuild the daemon binary. - -** Tester Phase -1. Tangle all modified files. -2. Restart the daemon. -3. Run the =test-chat.lisp= script to verify two-way communication. -4. Verify in Emacs =*org-agent-chat*=. diff --git a/system/flight-plan-flatten-env.org b/system/flight-plan-flatten-env.org deleted file mode 100644 index 3802712..0000000 --- a/system/flight-plan-flatten-env.org +++ /dev/null @@ -1,41 +0,0 @@ -#+TITLE: Flight Plan: Flatten & Generalize Memex Environment Architecture -#+AUTHOR: Gemini CLI -#+DATE: 2026-04-01 -#+FILETAGS: :psf:arch:refactor:generalization: -#+STARTUP: content - -* Overview -Refactor the =.env.example= and secure local =.env= to remove the legacy PARA structure and replace it with a generalized, anchor-based architecture. Move towards a unified =MEMEX_DIR= foundation while ensuring portability for different users and folder structures. - -* Phase A: Analysis (The Scientist) -:PROPERTIES: -:STATUS: COMPLETE -:END: -** Findings -- Current =.env= relies on hardcoded absolute paths (=/home/user/memex/...=). -- Direct removal of PARA variables breaks skills (=org-skill-project-foundry=, etc.). -- The kernel's =context-resolve-path= already supports =$= expansion but needs to be the standard for all internal path lookups. - -* Phase B: Blueprint (The Architect) -:PROPERTIES: -:STATUS: PENDING_AUTHORIZATION -:END: -** [Coder] Surgical Implementation Tasks -1. *Generalize .env.example:* - - Define =MEMEX_DIR= as the single mandatory anchor. - - Use variable references for all sub-directories (e.g., =PROJECTS_DIR="${MEMEX_DIR}/projects"=). - - Add documentation explaining how to override these for custom structures. -2. *Harden Path Resolution (README.org):* - - Update =load-all-skills= to use =context-resolve-path= when reading the =SKILLS_DIR= environment variable. - - This ensures that if a user sets =SKILLS_DIR="$MEMEX_DIR/notes"=, the Lisp kernel expands it correctly regardless of the OS or username. -3. *Sync Secure .env (~/.local/share/org-agent/.env):* - - Refactor the user's secure file to use this dynamic derivation. - -** [Tester] Verification Strategy -1. *Portability Test:* Temporarily set =MEMEX_DIR=/tmp/memex-test= in the environment and verify that =(org-agent:context-get-skill-source "test")= attempts to read from the correct expanded path. -2. *Boot Test:* Restart daemon and ensure all skills load via the new expanded paths. - -* NEXT Authorization Gate -** Sovereign, do you approve this Generalized Flattening plan? -- [ ] APPROVED -- [ ] REJECTED diff --git a/system/flight-plan-night-shift-phase-1.org b/system/flight-plan-night-shift-phase-1.org deleted file mode 100644 index 500711e..0000000 --- a/system/flight-plan-night-shift-phase-1.org +++ /dev/null @@ -1,21 +0,0 @@ -* Flight Plan: Night Shift Phase 1 (Neural Infrastructure) -:PROPERTIES: -:STATUS: IN-PROGRESS -:END: - -** Analyst Phase -Identify skeletal LLM provider and auth skills. Ensure they register their backends correctly with the kernel. - -** Coder Phase -- [ ] Implement =org-skill-provider-gemini.org= -- [ ] Implement =org-skill-provider-openrouter.org= -- [ ] Implement =org-skill-provider-anthropic.org= -- [ ] Implement =org-skill-provider-openai.org= -- [ ] Implement =org-skill-provider-local.org= -- [ ] Implement =org-skill-auth-api-key.org= -- [ ] Implement =org-skill-auth-google-oauth.org= - -** Tester Phase -1. Tangle each file. -2. Load into SBCL and check for package/symbol errors. -3. Verify registration in kernel backends table. diff --git a/system/flight-plan-rollback.org b/system/flight-plan-rollback.org deleted file mode 100644 index 5779ed6..0000000 --- a/system/flight-plan-rollback.org +++ /dev/null @@ -1,49 +0,0 @@ -#+TITLE: Flight Plan: Hard Rollback & Verification -#+AUTHOR: Gemini CLI -#+DATE: 2026-04-01 -#+FILETAGS: :psf:build:qa:rollback: -#+STARTUP: content - -* Overview -Break the cycle of chaotic debugging by performing a hard Git rollback to the last known stable state of the `org-agent` repository, surgically applying the verified fixes, and executing the Model Discovery connection test one strict step at a time. - -* Phase A: Purge & Reset (The Scientist) -** TODO 1. Hard Rollback -- Action: Execute `git reset --hard` and `git clean -fd` in `~/memex/projects/org-agent`. -- Verification: Directory is clean of untracked files and uncommitted changes. - -** TODO 2. Nuke the Lisp Cache -- Action: Delete `~/.cache/common-lisp/` and `~/.local/share/org-agent/quicklisp/cache/`. -- Verification: The directories do not exist. - -** TODO 3. Verify Environment -- Action: Read `~/.local/share/org-agent/.env`. -- Verification: Ensure `OPENROUTER_API_KEY` and `MEMEX_DIR` are correctly set without trailing quotes or comments. - -* Phase B: Surgical Implementation (The Coder) -** TODO 4. Implement Dynamic Model Resolution -- Action: Surgically update `docs/README.org` to make `execute-openrouter-request` pull the `:LLM_MODEL_OPENROUTER` property. - -** TODO 5. Implement Model Discovery API -- Action: Add `openrouter-get-available-models` to `docs/README.org` and export it in `package.lisp`. - -** TODO 6. Implement Model Explorer Skill -- Action: Update `~/memex/notes/org-skill-model-explorer.org` with the trigger, table builder, and actuator logic. Ensure it is correctly registered. - -* Phase C: Tangle & Build (The Tester) -** TODO 7. Tangle -- Action: Run `emacs --batch` to regenerate `src/*.lisp` from the `README.org`. -- Verification: Exit code 0. - -** TODO 8. Compile -- Action: Run a clean compilation script. -- Verification: The binary is generated successfully. - -* Phase D: Live Execution (The Sovereign) -** TODO 9. Foreground Boot Test -- Action: Start the `org-agent-server` daemon in the foreground for 10 seconds. -- Verification: Visually confirm that `org-skill-model-explorer` successfully jails and hot-loads. - -** TODO 10. Live Model Discovery Test -- Action: Send `@agent list models` via an Emacs batch script. -- Verification: The daemon log shows the generated Org-mode table of OpenRouter models. \ No newline at end of file diff --git a/system/flight-plan-shell-actuator.org b/system/flight-plan-shell-actuator.org deleted file mode 100644 index 9c3b5f0..0000000 --- a/system/flight-plan-shell-actuator.org +++ /dev/null @@ -1,17 +0,0 @@ -* Flight Plan: Shell Actuator Implementation -:PROPERTIES: -:STATUS: IN-PROGRESS -:END: - -** Analyst Phase -The Shell Actuator is missing registration, uses the wrong function signature `(action)` instead of `(action context)`, and uses incorrect tangle paths. Additionally, the Chat Agent needs to know how to call the Shell Actuator. - -** Coder Phase -- [X] Create =inbox/flight-plan-shell-actuator.org= (this file). -- [ ] Update =notes/org-skill-shell-actuator.org= with correct tangle paths, signature, and registration. -- [ ] Update =notes/org-skill-chat.org= prompt to include an example of calling the shell. -- [ ] Tangle, clean build, and restart the daemon. - -** Tester Phase -1. Send a chat message asking the agent to run "date" or "ls". -2. Verify the agent executes it and returns the output to Emacs. \ No newline at end of file diff --git a/system/flight-plan-skill-audit.org b/system/flight-plan-skill-audit.org deleted file mode 100644 index e85c8ef..0000000 --- a/system/flight-plan-skill-audit.org +++ /dev/null @@ -1,34 +0,0 @@ -#+TITLE: Flight Plan: Kernel API Hardening & Skill Audit -#+AUTHOR: Gemini CLI -#+DATE: 2026-04-02 -#+FILETAGS: :psf:arch:refactor: -#+STARTUP: content - -* Overview -Resolve the "No results" issue for LLM discovery by fixing package exports in the kernel and auditing the Org-Native skills for missing definitions. - -* Phase A: Analysis (The Scientist) -:PROPERTIES: -:STATUS: COMPLETE -:END: -** Findings -- =*PROVIDER-CASCADE*= is used by skills but not exported from the kernel. -- =skill-model-explorer= requires a functional OpenRouter backend, which failed to load. -- Multiple skills (=skill-chat=, =skill-scribe=) have undefined trigger/neuro functions. - -* Phase B: Blueprint (The Architect) -:PROPERTIES: -:STATUS: PENDING_AUTHORIZATION -:END: -** [Coder] Surgical Tasks -1. *Harden Kernel Exports:* Update the package definition in =docs/README.org= to export =*PROVIDER-CASCADE*= and ensure =register-neuro-backend= is correctly visible. -2. *Audit Skill Explorer:* Verify =notes/org-skill-model-explorer.org= logic and ensure it uses the correctly exported kernel symbols. -3. *Surgical Skill Fixes:* Audit the skills reporting =READER ERROR= in the logs and restore their missing Lisp blocks from the project's intended architecture. - -** [Tester] Verification Strategy -1. *Clean Restart:* Nuke caches, re-tangle, and boot the kernel. -2. *Log Audit:* Confirm 0 =READER ERROR= messages during the boot sequence. -3. *Live Stimulus:* Execute =@agent list models= and verify the table appears. - -* NEXT Authorization Gate -Sovereign, do you approve this plan to harden the Kernel API and audit the failing skills? diff --git a/system/flight-plan-sovereign-recovery.org b/system/flight-plan-sovereign-recovery.org deleted file mode 100644 index 9443411..0000000 --- a/system/flight-plan-sovereign-recovery.org +++ /dev/null @@ -1,35 +0,0 @@ -#+TITLE: Flight Plan: Sovereign Brain Recovery -#+AUTHOR: Gemini CLI -#+DATE: 2026-04-01 -#+FILETAGS: :psf:recovery:build: -#+STARTUP: content - -* Overview -Rigorous recovery of the =org-agent= kernel after a series of failed build loops. - -* Phase A: Purge & Reset (The Scientist) -** TODO 1. Hard Git Reset -- Action: =git reset --hard= and =git clean -fd= in =~/memex/projects/org-agent=. -- Verification: =git status= must be clean. - -** TODO 2. Nuke Lisp & Quicklisp Caches -- Action: Delete =~/.cache/common-lisp/= and =~/.local/share/org-agent/quicklisp/cache/=. -- Verification: Directories must not exist. - -** TODO 3. Verify Secure Environment -- Action: Check =~/.local/share/org-agent/.env=. -- Verification: Confirm =MEMEX_DIR= and =OPENROUTER_API_KEY= are correct. - -* Phase B: Restoration (The Coder) -** TODO 4. Restore Literate Source -- Action: Ensure =docs/README.org= contains the modular kernel logic. -- Verification: Tangle the file and confirm =src/core.lisp= exists. - -* Phase C: Verification (The Tester) -** TODO 5. Foreground Boot Test -- Action: Run daemon in foreground. -- Verification: Confirm "Daemon Listening" and skill jailing. - -** TODO 6. Live Handshake -- Action: =emacs --batch= stimulus test. -- Verification: Confirm LLM response in log. diff --git a/system/flight-plan-system-state.org b/system/flight-plan-system-state.org deleted file mode 100644 index 4f5c369..0000000 --- a/system/flight-plan-system-state.org +++ /dev/null @@ -1,18 +0,0 @@ -* Flight Plan: System State and Shell Actuator -:PROPERTIES: -:STATUS: IN-PROGRESS -:END: - -** Analyst Phase -The user has requested an update on the state of the system and a test run to realize where it is failing and what features we were working on. -We were implementing the Shell Actuator (=org-skill-shell-actuator.org=) to enable the agent to run commands like "date". We ran into connection/daemon-crashing issues and response formatting issues. - -** Coder Phase -- [X] Create =inbox/flight-plan-system-state.org= (this file). -- [ ] Run tests (=test-shell.lisp= and =prove-shell.el=). -- [ ] Inspect daemon logs to find the exact failure points. - -** Tester Phase -1. Start the daemon in the background using a robust method. -2. Run =test-shell.lisp= and =prove-shell.el=. -3. Review the output and identify the bugs. \ No newline at end of file diff --git a/system/flight-plan-chat-fix.org b/system/plans/flight-plan-chat-fix.org similarity index 100% rename from system/flight-plan-chat-fix.org rename to system/plans/flight-plan-chat-fix.org diff --git a/inbox/flight-plan-chat-ui-fix.org b/system/plans/flight-plan-chat-ui-fix.org similarity index 100% rename from inbox/flight-plan-chat-ui-fix.org rename to system/plans/flight-plan-chat-ui-fix.org diff --git a/inbox/flight-plan-clean-build.org b/system/plans/flight-plan-clean-build.org similarity index 100% rename from inbox/flight-plan-clean-build.org rename to system/plans/flight-plan-clean-build.org diff --git a/inbox/flight-plan-emacs-bridge.org b/system/plans/flight-plan-emacs-bridge.org similarity index 100% rename from inbox/flight-plan-emacs-bridge.org rename to system/plans/flight-plan-emacs-bridge.org diff --git a/system/flight-plan-emacs-ux-overhaul.org b/system/plans/flight-plan-emacs-ux-overhaul.org similarity index 100% rename from system/flight-plan-emacs-ux-overhaul.org rename to system/plans/flight-plan-emacs-ux-overhaul.org diff --git a/inbox/flight-plan-flatten-env.org b/system/plans/flight-plan-flatten-env.org similarity index 100% rename from inbox/flight-plan-flatten-env.org rename to system/plans/flight-plan-flatten-env.org diff --git a/inbox/flight-plan-night-shift-phase-1.org b/system/plans/flight-plan-night-shift-phase-1.org similarity index 100% rename from inbox/flight-plan-night-shift-phase-1.org rename to system/plans/flight-plan-night-shift-phase-1.org diff --git a/system/flight-plan-note-metadata.org b/system/plans/flight-plan-note-metadata.org similarity index 100% rename from system/flight-plan-note-metadata.org rename to system/plans/flight-plan-note-metadata.org diff --git a/system/flight-plan-reasoning.org b/system/plans/flight-plan-reasoning.org similarity index 100% rename from system/flight-plan-reasoning.org rename to system/plans/flight-plan-reasoning.org diff --git a/system/flight-plan-recursive-kernel.org b/system/plans/flight-plan-recursive-kernel.org similarity index 100% rename from system/flight-plan-recursive-kernel.org rename to system/plans/flight-plan-recursive-kernel.org diff --git a/inbox/flight-plan-rollback.org b/system/plans/flight-plan-rollback.org similarity index 100% rename from inbox/flight-plan-rollback.org rename to system/plans/flight-plan-rollback.org diff --git a/inbox/flight-plan-shell-actuator.org b/system/plans/flight-plan-shell-actuator.org similarity index 100% rename from inbox/flight-plan-shell-actuator.org rename to system/plans/flight-plan-shell-actuator.org diff --git a/inbox/flight-plan-skill-audit.org b/system/plans/flight-plan-skill-audit.org similarity index 100% rename from inbox/flight-plan-skill-audit.org rename to system/plans/flight-plan-skill-audit.org diff --git a/inbox/flight-plan-sovereign-recovery.org b/system/plans/flight-plan-sovereign-recovery.org similarity index 100% rename from inbox/flight-plan-sovereign-recovery.org rename to system/plans/flight-plan-sovereign-recovery.org diff --git a/inbox/flight-plan-system-state.org b/system/plans/flight-plan-system-state.org similarity index 100% rename from inbox/flight-plan-system-state.org rename to system/plans/flight-plan-system-state.org diff --git a/system/flight-plan-tool-registry.org b/system/plans/flight-plan-tool-registry.org similarity index 100% rename from system/flight-plan-tool-registry.org rename to system/plans/flight-plan-tool-registry.org