Commit Graph

149 Commits

Author SHA1 Message Date
dd8bb6e3c8 refactor(skills): use XDG paths for tangle destinations
- Updated all 22 skill org files to use $OC_DATA_DIR/skills/ paths
- Removed manually created .lisp file (tangling now targets XDG)
- Files will now tangle to ~/.local/share/opencortex/skills/
2026-04-30 11:09:21 -04:00
1080f0b873 feat(skills): add org-skill-repl for persistent Lisp evaluation
- NEW: org-skill-repl skill enables:
  * repl-eval: evaluate code with result+output+error separation
  * repl-inspect: inspect variables and functions
  * repl-list-vars: list all bound symbols in package
  * repl-load-file: load files into image
  * repl-set-package: switch default package
  * repl-help: show available commands

- Supports REPL-first workflow with literate reflection in org
- Priority 200 (after diagnostics, before utils-lisp)
- Follows same pattern as existing skills (in-package, defskill)
2026-04-30 10:54:05 -04:00
6a6f4479ac feat(core): Skills consolidation and v0.2.0 TUI integration
- NEW: org-skill-utils-lisp (consolidated from org-skill-lisp-utils)
  * 3-phase validation: structural, syntactic, semantic
  * Sandboxed eval, AST extraction/injection/wrapping
  * Format, list-definitions utilities

- NEW: org-skill-utils-org (consolidated from org-skill-emacs-edit)
  * Read/update/delete org headlines
  * Property management, TODO state handling
  * ID-link and internal link support

- DELETE: org-skill-lisp-utils (merged into utils-lisp)
- DELETE: org-skill-emacs-edit (merged into utils-org)
- RENAME: run-all-tests.lisp -> run-tests.lisp

- HARDEN: Skill loader with improved lisp keyword handling
- FIX: Package jailing issues with def-cognitive-tool macro conflicts
- ADD: Setup wizard (opencortex setup) and doctor (opencortex doctor)
- ADD: TUI client with Croatoan for native terminal rendering

- REMOVE: Dynamic loading from opencortex.asd (use :force t instead)
- CLEANUP: Test file consolidation (removed duplicate test suites)

Co-authored-by: Agent <agent@memex>
2026-04-30 10:52:20 -04:00
c0d3f066e8 Proactive doctor, setup wizard, and TUI fixes
Some checks failed
Deploy-Agent-V15-Stdin / JOB-V15-STDIN (push) Failing after 3s
BREAKING CHANGES / KNOWN ISSUES:
- 8 skills have syntax errors causing loader warnings:
  org-skill-bouncer, org-skill-config-manager, org-skill-credentials-vault,
  org-skill-engineering-standards, org-skill-gardener, org-skill-homoiconic-memory,
  org-skill-peripheral-vision, org-skill-policy
- These skills fail to load but don't block system operation
- TUI works despite these errors

FEATURES ADDED:

1. Proactive Doctor System
   - Doctor runs automatically on daemon startup
   - Health check runs before accepting connections
   - Adds /health endpoint for health status queries
   - *system-health* variable tracks: :healthy, :degraded, :unhealthy, :unknown

2. Error Handling (Option B - Debugger Hook)
   - TUI and CLI now run doctor diagnostics on errors
   - Shows "Run opencortex doctor" message on crash
   - Suggests repair commands after failures

3. Interactive Setup Wizard (org-skill-config-manager)
   - Full wizard implemented in config-manager skill:
     * LLM provider configuration (OpenAI, Anthropic, OpenRouter, Groq, Gemini, Ollama)
     * Gateway linking (Slack, Discord)
     * Memory settings (auto-save interval, history retention)
     * Network settings (timeout, proxy)
   - Saves to ~/.config/opencortex/.env (KEY=VALUE format)
   - CLI integration: opencortex setup, setup --add-provider, setup --link

4. CLI Enhancements
   - doctor --watch: Background health monitoring (60s interval)
   - doctor --fix: Interactive repair (falls back to full setup if core files missing)
   - setup command runs wizard or delegates to setup_system

5. TUI Fixes
   - Inlined message formatting to avoid dependency issues
   - Added error handling in handle-return
   - Cleaner error messages

6. Thin Harness Compliance
   - Removed doctor from harness (now in org-skill-diagnostics skill)
   - XDG directories: only .lisp in harness, .org kept in skills for loader
2026-04-29 12:58:09 -04:00
2030538281 fix(setup): initialize skills before running setup wizard and resolve syntax errors in config manager 2026-04-28 19:56:54 -04:00
a616c509ca fix(chaos): standardize test tangle paths to ../tests/ for deployment 2026-04-28 19:42:45 -04:00
829bd7b7aa fix(skills): finalize reconstructions for diagnostics and llm-gateway 2026-04-28 19:18:49 -04:00
8ad7443d3f fix(skills): finalize reconstructions for diagnostics and llm-gateway 2026-04-28 19:18:11 -04:00
def2774c8f fix(chaos): hard-inserted clean relative tangle headers in all core files 2026-04-28 19:04:34 -04:00
96fe9cdd94 fix(chaos): finalized system-wide reconstruction to resolve FiveAM and EOF failures 2026-04-28 18:49:27 -04:00
f56c3e1c61 fix(skills): finalize reconstruction of all core skills to resolve syntax errors 2026-04-28 18:48:21 -04:00
f3858b0330 fix(skills): reconstruct multiple broken skills to resolve syntax errors 2026-04-28 18:46:40 -04:00
014cd152db fix(skills): complete reconstruction of bouncer skill to resolve catastrophic syntax failures 2026-04-28 18:42:49 -04:00
357efbdb59 fix(chaos): finalized absolute tangle paths via concat and INSTALL_DIR 2026-04-28 18:22:49 -04:00
d55384fb65 fix(chaos): use standard getenv for absolute tangle paths 2026-04-28 17:57:57 -04:00
d787981d0d fix(chaos): force absolute tangle paths via concat to eliminate path resolution ambiguity 2026-04-28 17:57:31 -04:00
b7f6eb68e9 fix(chaos): stabilize tangle paths to absolute targets via concat for reliable bootstrap 2026-04-28 17:56:48 -04:00
fd5513057e fix(chaos): switch to definitive absolute paths via expand-file-name for reliable tangling 2026-04-28 17:55:58 -04:00
d6a7e83de4 fix(chaos): use robust (or INSTALL_DIR buffer-dir) for tangle paths 2026-04-28 17:55:08 -04:00
635db05d17 fix(chaos): standardize tangle paths to robust (identity (getenv ...)) 2026-04-28 17:54:12 -04:00
a5538bf9d8 fix(chaos): standardize tangle paths to uiop:getenv across all org files 2026-04-28 17:51:44 -04:00
10206860db fix(test): use dynamic symbol lookup for jailed llm-gateway test 2026-04-28 17:38:23 -04:00
609669b304 fix(chaos): resolve package and symbol issues in Tier 2 tests 2026-04-28 17:36:44 -04:00
589ff1cb8d fix(test): use standard uiop:getenv for environment modification 2026-04-28 17:35:55 -04:00
e31222d6e3 feat(chaos): implement Tier 2 Integration Chaos for Memory, Networking, and LLM Gateway 2026-04-28 17:32:15 -04:00
fc0c069d65 tests: Add FiveAM tests for v0.2.0 completion
Self-edit: 5 new tests (apply success/not-found/file-not-found, parse-location x2)
Config-manager: 4 new tests (get-oc-config-dir, save-providers, configure-provider)
Gateway-manager: 2 new tests (multiple-platforms, registration)

Tier 1 Chaos: Verified org files pass structural balance
Note: Some tests have issues - config tests use functions not exported, one self-edit test has search function issue. Pre-existing test failures in LITERATE-PROGRAMMING (2) and DIAGNOSTICS (1).
2026-04-28 15:19:49 -04:00
958ed69b4e fix: add missing closing paren in self-edit tests
Tier 1 Chaos verified on all modified org files.
2026-04-28 15:12:46 -04:00
45d74c2f3b tests: Add FiveAM tests for self-edit, config-manager, gateway-manager
- Self-edit: test self-edit-apply (success, not-found, file-not-found), parse-location
- Config-manager: test get-oc-config-dir (default, env-override), save-providers roundtrip
- Gateway-manager: test multiple platforms, save-gateways roundtrip

Phase D: Tier 1 Chaos verified on all modified org files.
2026-04-28 15:11:16 -04:00
80e327dd20 fix(v0.2.0): resolve macro conflicts, sync load order, and fix skill packaging
- Standardized def-cognitive-tool to 5-argument signature.
- Consolidated *cognitive-tools* as a hash table in package.lisp.
- Removed skills from opencortex.asd to enforce dynamic Skill Engine loading.
- Added missing (in-package :opencortex) to various skill files.
- Fixed let/let* sequential binding issues in emacs-edit and self-edit.
- Updated opencortex.sh to initialize skills before running doctor.
- Fixed uiop:user-homedir-pathname usage in config-manager.
2026-04-28 10:46:24 -04:00
3dddfe3e3d chore: checkpoint broken state before fixing macro conflict 2026-04-28 10:33:51 -04:00
a717ab1d3a docs(milestone): complete v0.2.0 Interactive Refinement
Some checks failed
Deploy-Agent-V15-Stdin / JOB-V15-STDIN (push) Failing after 2s
2026-04-27 20:17:56 -04:00
2e8e79a193 fix(v0.2.0): finalize structural integrity and clean boot
Some checks failed
Deploy-Agent-V15-Stdin / JOB-V15-STDIN (push) Failing after 2s
- Fixed memory.org source blocks to ensure persistence functions are tangled.
- Improved extract-tangle-target to handle complex Elisp expressions.
- Corrected opencortex.sh initialization paths to prevent setup loops.
- Reordered variable definitions in policy and standards skills to eliminate forward-reference warnings.
2026-04-27 18:54:18 -04:00
87a0459497 feat(v0.2.0): comprehensive foundation hardening and test verification
Some checks failed
Deploy-Agent-V15-Stdin / JOB-V15-STDIN (push) Failing after 2s
- Finalized Reflection Loop: Injected deterministic rejection traces back into LLM prompts.
- Hardened Actuators: Added path-traversal guards and enforced Merkle snapshots on AST edits.
- Refactored Lisp Utils: Merged validator/repair into a unified utility skill with whitelist Ast-walking.
- Fixed Build: Resolved all 30+ syntax, scoping, and package visibility errors.
- Verified: Full pass (100%) on all 5 core test suites.
2026-04-27 17:48:01 -04:00
f1be82a00b feat(v0.2.0): finalize autonomous self-editing foundation
Some checks failed
Deploy-Agent-V15-Stdin / JOB-V15-STDIN (push) Failing after 3s
- Hardened actuators: Fixed path-traversal vulnerabilities in file I/O tools and blocked .org files from regex replacements to force AST usage. Enforced Merkle snapshots on AST edits.
- Implemented Reflection Loops: Injected rejection traces from deterministic gates back into the LLM context to enable autonomous self-correction.
- Finalized tool permission tiers (ask/allow/deny) with proper LLM prompt filtering.
2026-04-27 13:44:43 -04:00
861fb409fb build: move browser-bridge.py to opencortex-contrib
Some checks failed
Deploy-Agent-V15-Stdin / JOB-V15-STDIN (push) Failing after 2s
2026-04-27 13:16:07 -04:00
6abc306c7f build: purge obsolete rca docs and redundant installer scripts
Some checks failed
Deploy-Agent-V15-Stdin / JOB-V15-STDIN (push) Failing after 3s
- Deleted docs/rca/ as they were early v0.1.0 development artifacts.
- Deleted minimal.asd.
- Deleted scripts/onboard-baremetal.sh (subsumed by opencortex.sh).
- Moved scripts/browser-bridge.py to skills/assets/ for upcoming Web Research skill.
- Removed scripts/ directory.
2026-04-27 13:10:56 -04:00
edb8bed2d9 build: remove redundant .lisp artifacts from source tree
Some checks failed
Deploy-Agent-V15-Stdin / JOB-V15-STDIN (push) Failing after 3s
2026-04-27 12:55:32 -04:00
f940861921 build: dynamically tangle to INSTALL_DIR without copying .org files
Some checks failed
Deploy-Agent-V15-Stdin / JOB-V15-STDIN (push) Failing after 2s
- Updated all 150+ :tangle headers across harness/ and skills/ to use elisp (expand-file-name) to target INSTALL_DIR dynamically.
- Cleaned up environment/ directory depth by moving memory-image.lisp to state/.
- Moved test scripts to tests/ and deleted redundant chat scripts.
2026-04-27 12:51:29 -04:00
664ba8243d refactor: Flatten directory structure library->harness, library/gen->skills 2026-04-27 08:41:26 -04:00
43dbe3cf2d feat(v0.2.0): Self-Improvement & Structural Integrity
Some checks failed
Deploy-Agent-V15-Stdin / JOB-V15-STDIN (push) Failing after 8s
- Fix critical paren balance issues across harness/skills.org, act.org,
  loop.org, memory.org, and skills/self-edit|emacs-edit.org
- Add :reload-skill cognitive tool for hot-reloading without restart
- Add :generate-embeddings tool and self-edit hot-reload infrastructure
- Wire all new skills (self-edit, emacs-edit, lisp-utils) into main ASDF
- Regenerate all .lisp tangled files via emacs --batch org-babel-tangle
- Add :opencortex/tests ASDF system with 14 test suites
- Fix test files to compile cleanly (self-edit-tests symbol vis, etc.)
2026-04-27 07:30:01 -04:00
1e202629ce Move LP checks from Engineering Standards to LP skill
Some checks failed
Deploy-Agent-V15-Stdin / JOB-V15-STDIN (push) Failing after 2s
- Removed *tangle-targets* and check-tangle-sync from engineering-standards.org
- Fixed LP org: added (in-package), fixed block balance, fixed return-from
- Fixed literate-check-block-balance to return (values nil reason) on imbalance
- Updated LP tests to work with *tangle-targets* override
- Regenerated all .lisp from org via emacs --batch
- Added LP gen back to opencortex.asd

Test results:
- Engineering Standards: 9/10 (90%)
- Literate Programming: 7/7 (100%)
2026-04-26 15:54:25 -04:00
eabba11a33 Restore LP discipline: fix org source, regenerate .lisp
Some checks failed
Deploy-Agent-V15-Stdin / JOB-V15-STDIN (push) Failing after 3s
- Restored engineering-standards.org from 86eeaab (was missing blocks)
- Regenerated .lisp from org (proper literate workflow)
- Both org and .lisp now have correct paren balance
- System loads, tests pass 9/10 (1 expected failure due to dirty git)

Lesson: NEVER edit .lisp directly. Always fix org and regenerate.
2026-04-26 11:53:57 -04:00
854ad390e9 Move check-tangle-sync from Engineering Standards to Literate Programming
Some checks failed
Deploy-Agent-V15-Stdin / JOB-V15-STDIN (push) Failing after 2s
Engineering Standards now focuses on lifecycle phases (0, A, B, D, E).
Literate Programming now owns LP structural invariants including tangle-sync.

Changes:
- Removed check-tangle-sync and *enforcement-rules* from org-skill-engineering-standards.org
- Added check-tangle-sync, *tangle-targets*, *lp-project-root* to org-skill-literate-programming.org
- Updated LP skill to check tangle-sync on file modification actions
- Added literate-programming-tests.lisp with tangle-sync and block-balance tests
- Removed tangle-sync tests from engineering-standards-tests.lisp
2026-04-26 10:24:14 -04:00
86eeaab66e Fix duplicate frame-message, tangled files, package.lisp corruption
Some checks failed
Deploy-Agent-V15-Stdin / JOB-V15-STDIN (push) Failing after 3s
- Removed duplicate frame-message from communication.org (was in 2 src blocks)
- Fixed communication.org :tangle directive (was wrongly targeting package.lisp)
- Added (in-package :opencortex) to engineering-standards.lisp
- Retangled package.org, communication.org, engineering-standards.org

Tests still not running - investigation in progress.
2026-04-25 20:31:05 -04:00
bcfffe15ee Add tangle-sync enforcement rule
Some checks failed
Deploy-Agent-V15-Stdin / JOB-V15-STDIN (push) Failing after 2s
- Added check-tangle-sync function to detect stale .lisp files
- Added :tangle-synced to *enforcement-rules*
- Updated .asd to include engineering-standards component
- Added tests for check-tangle-sync (detects stale lisp, passes when synced)
2026-04-25 19:47:02 -04:00
f7209a8bb0 WIP: Add enforcement tests to org-skill-engineering-standards
Some checks failed
Deploy-Agent-V15-Stdin / JOB-V15-STDIN (push) Failing after 2s
- Added test block to Org file (Phase A: test-first)
- Created tests/engineering-standards-tests.lisp
- Tests exist but can't run - tangled lisp is out of sync

LESSON: This demonstrates the LP workflow failure -
the .lisp file wasn't regenerated when the .org was updated.
The enforcement skill itself should catch this: tangled files
must match Org source.

This is exactly what org-skill-enforcement should block.
2026-04-25 19:38:28 -04:00
50558bf42a feat: Implement hard-block enforcement in org-skill-engineering-standards
Some checks failed
Deploy-Agent-V15-Stdin / JOB-V15-STDIN (push) Failing after 3s
- Added enforcement struct and rule definitions
- Git clean is now a HARD BLOCK (not warning)
- Violations return :LOG type to block action
- Priority 1000 ensures it runs first
- Auto-initialize with project root from OPENCORTEX_ROOT env
2026-04-25 19:35:16 -04:00
44797e3d90 refactor: Migrate skill tests to Org files - delete redundant .lisp
Some checks failed
Deploy-Agent-V15-Stdin / JOB-V15-STDIN (push) Failing after 2s
Added inline tests:
- org-skill-lisp-utils.org: lisp-validator tests
- org-skill-tool-permissions.org: tool-permissions tests

Deleted duplicates:
- tests/lisp-validator-tests.lisp
- tests/tool-permissions-tests.lisp

All tests pass: 84/84 (100%)
2026-04-25 19:15:05 -04:00
31acf347de Add org-skill-literate-programming+engineering-standards skills
Some checks failed
Deploy-Agent-V15-Stdin / JOB-V15-STDIN (push) Failing after 3s
- Add org-skill-literate-programming: enforce Org discipline
  - One function per block, pre-tangle check, .lisp is derived
- Extend org-skill-engineering-standards with Phase 0-5 lifecycle
  - Test-first design, three chaos tiers
  - Literate programming rules, decision audit trail
2026-04-25 18:42:17 -04:00
d177a12469 wip: paren balance fixes in policy blocks + engineering standards scaffolding
Some checks failed
Deploy-Agent-V15-Stdin / JOB-V15-STDIN (push) Failing after 16s
- Fix unbalanced parens in org-skill-policy.org (8 blocks)
- Add org-skill-engineering-standards.lisp scaffolding
- Add org-skill-self-fix.lisp helper
- Add test runners and tool-permissions tests

Note: Some fixes may be over-corrections. Full structural audit needed.
2026-04-25 12:05:23 -04:00