1.9 KiB
1.9 KiB
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(Movingload-all-skillsout of here). - Mandate: Syntax Pre-flight and Dependency Assertion.
Implementation Steps
1. Define the Skill Catalog
- Introduce
*skill-catalog*inskills.lispto track metadata and load status for every skill file found inSKILLS_DIR. - Statuses:
:discovered,:loading,:ready,:failed.
2. Refactor load-skill-from-org (Harden)
- Syntax Check: Invoke
validate-lisp-syntaxbefore evaluation. - Dependency Check: If
#+DEPENDS_ONrefers to a skill that failed or is missing, mark this skill as:failedimmediately 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.lispintoskills.lisp. - This function will:
- Scan
SKILLS_DIR. - Populate the catalog.
- Run the topological sort.
- Execute the load loop with timeouts.
- Print a final "Boot Summary" report.
- Scan
4. Simplify Kernel Boot
- Update
start-daemonincore.lispto call(initialize-all-skills)instead of the oldload-all-skills.
Phase E: Chaos (Verification)
- Integrity Test: Add a test that verifies
initialize-all-skillscorrectly 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.