CHORE: Prepare for lisp-repair implementation
This commit is contained in:
40
docs/rca/rca-self-fix-loop.org
Normal file
40
docs/rca/rca-self-fix-loop.org
Normal file
@@ -0,0 +1,40 @@
|
||||
#+TITLE: Root Cause Analysis: Autonomous Self-Fix Loop Verification
|
||||
#+DATE: 2026-04-11
|
||||
#+FILETAGS: :rca:self-fix:autonomy:testing:
|
||||
|
||||
* Executive Summary
|
||||
Verified the autonomous repair capability of the `Self-Fix Agent`. The system successfully detected a deliberate type error in a secondary skill, initiated a repair request, and programmatically patched the source code via the `:repair-file` tool.
|
||||
|
||||
* 1. Issue: Self-Fix Mechanism Verification
|
||||
** Symptoms
|
||||
Manual verification was required to prove that `org-skill-self-fix` could transition from "Thinking" about a bug to "Acting" on the file system.
|
||||
** Root Cause
|
||||
N/A (Deliberate test injection).
|
||||
** Resolution
|
||||
Created `self-fix-tests.lisp` which:
|
||||
1. Generates `org-skill-broken-math.org` with a `(+ 1 "two")` bug.
|
||||
2. Triggers the bug to produce a `PIPELINE CRASH`.
|
||||
3. Injects a `:repair-request` stimulus.
|
||||
4. Executes `self-fix-apply` to replace the bug with `(+ 1 2)`.
|
||||
5. Verifies the file content and successful hot-reload.
|
||||
|
||||
* 2. Side-Issue: ASDF Configuration Fragility
|
||||
** Symptoms
|
||||
Repeated `LOAD-SYSTEM-DEFINITION-ERROR` and "unmatched close parenthesis" errors during test integration.
|
||||
** Root Cause
|
||||
Complexity in the `:components` nesting of `org-agent.asd` led to repeated syntax errors when using automated editing tools. The deep nesting made manual paren counting prone to "off-by-one" errors.
|
||||
** Resolution
|
||||
Refactored `org-agent.asd` to use a **Flat Component Structure**.
|
||||
- *Before:* `:components ((:module "src" :components (...)))`
|
||||
- *After:* `:components ((:file "src/package") ...)`
|
||||
This eliminates unnecessary nesting levels and drastically reduces the surface area for syntax errors.
|
||||
|
||||
* 3. PSF Mandate Alignment
|
||||
** Invariant Check
|
||||
- *Lisp Machine Sovereignty:* Verification utilized hot-reloading (`load-skill-from-org`) without restarting the SBCL image.
|
||||
- *Literate Programming:* Updated `org-skill-self-fix.org` to match the finalized `self-fix.lisp` logic.
|
||||
- *Institutional Memory:* This RCA documents the decision to flatten the `.asd` structure to prevent future "Parenthesis Hell" incidents.
|
||||
|
||||
* 4. Permanent Learnings
|
||||
- **Flatten Configuration:** Keep `defsystem` definitions as flat as possible. The overhead of `:module` blocks often outweighs their organizational benefit in a neurosymbolic environment where agents frequently edit these files.
|
||||
- **Mocking System 1:** For verifying *loop mechanics*, mocking LLM responses is essential to ensure test determinism, while integration tests can use live LLM calls.
|
||||
48
docs/rca/rca-task-orchestrator.org
Normal file
48
docs/rca/rca-task-orchestrator.org
Normal file
@@ -0,0 +1,48 @@
|
||||
#+TITLE: Root Cause Analysis: Consolidation VI - Task Orchestrator Implementation
|
||||
#+DATE: 2026-04-11
|
||||
#+FILETAGS: :rca:orchestrator:consensus:integrity:
|
||||
|
||||
* Executive Summary
|
||||
The implementation of Consolidation VI (Task Orchestrator) aimed to introduce parallel multi-backend consensus, GTD task integrity, and delegation. During the build, a critical dependency failure was identified in the `safety-harness` module.
|
||||
|
||||
* 1. Issue: Undefined `SAFETY-HARNESS-VALIDATE`
|
||||
** Symptoms
|
||||
Existing `SAFETY-SUITE` tests failed with `#<UNDEFINED-FUNCTION SAFETY-HARNESS-VALIDATE>`.
|
||||
** Root Cause
|
||||
The function `safety-harness-validate` was exported in `package.lisp` but never actually defined in `safety-harness.lisp`. Only the internal recursive walker `safety-harness-ast-walk` existed. This represents a "Hollow Export" bug where the interface was designed but the implementation was truncated or skipped in a previous session.
|
||||
** Resolution
|
||||
Defined `safety-harness-validate` as a wrapper around `read-from-string` and `safety-harness-ast-walk`.
|
||||
|
||||
* 2. Design Decision: Deliberate Consensus
|
||||
** Requirement
|
||||
Multi-backend support to reduce hallucinations and increase reliability.
|
||||
** Solution
|
||||
Implemented `bt:make-thread` parallel queries in `ask-neuro`.
|
||||
** Trade-off
|
||||
Selected "Majority Rules" over "First-to-Finish".
|
||||
- *Pros:* Higher accuracy, mathematically consistent.
|
||||
- *Cons:* Slower (latency limited by the slowest provider).
|
||||
** Invariant Alignment
|
||||
Aligns with PSF Mandate 4 (Radical Transparency) and Invariant 2 (Technical Mastery) by ensuring decisions are auditable and consistent across multiple brains.
|
||||
|
||||
* 3. Design Decision: Task Integrity Gate
|
||||
** Requirement
|
||||
Prevent illegal GTD state transitions.
|
||||
** Solution
|
||||
Added `task-integrity-check` in `symbolic.lisp`.
|
||||
** Invariant Alignment
|
||||
Enforces the "High-Integrity Memory" mandate by ensuring the Org-mode AST remains semantically valid according to GTD rules (e.g., no orphaned active tasks).
|
||||
|
||||
* 4. PSF Mandate Violations during Session (Corrected)
|
||||
** Violations
|
||||
1. Editing without prior commit.
|
||||
2. Direct `.lisp` edits vs Literate Org tangling.
|
||||
3. Multi-function edits per block.
|
||||
** Correction
|
||||
1. Performed a retrospective commit.
|
||||
2. Synchronized `neurosymbolic.org` and `core.org` with source code.
|
||||
3. Refactored the Markdown flight plan into an Org-mode flight plan.
|
||||
|
||||
* 5. Permanent Learnings
|
||||
- *Check Exports:* Always verify that symbols exported in `package.lisp` have a corresponding definition in the literate source.
|
||||
- *Strict PSF Mode:* Enable a pre-save hook or agent check to ensure all edits are performed within `#+begin_src` blocks in Literate Org files to avoid synchronization debt.
|
||||
Reference in New Issue
Block a user