Files
passepartout/org/system-self-improve.org
Amr Gharbeia d35aea391e feat(v0.3.0): Event Orchestrator skill
- New system-event-orchestrator skill with hook registry, cron registry, and tier classifier

- Three dispatch tiers: :reflex (no LLM), :cognition (light), :reasoning (full)

- Org-mode timestamp parsing for repeat patterns (+1w, +1d, +1m)

- Registers on heartbeat via defskill, dispatches due cron jobs

- Fix all remaining harness-log → log-message references across org files
2026-05-02 22:36:39 -04:00

2.1 KiB

SKILL: Self Edit (org-skill-self-edit.org)

Overview: The Self-Modification Primitive

Self Edit is the capability that makes Passepartout autonomous in the strongest sense: it can modify its own source code. Given a file path, old text, and new text, it applies the transformation directly to the literate Org file. Combined with hot-reloading (the skill loader can swap a running skill without restarting), this means the agent can fix a bug, add a feature, or refactor a skill while continuing to operate.

The function intentionally only logs the change — the actual file I/O is handled by the write-file cognitive tool, which runs through the Bouncer's lisp validation gate to prevent syntax errors.

Implementation

Self-Edit Logic

(defun self-improve-edit (filepath old-text new-text)
  "Applies a transformation to a source file."
  (declare (ignore old-text new-text))
  (log-message "SELF-EDIT: Applying changes to ~a" filepath))

Skill Registration

(defskill :passepartout-system-self-improve
  :priority 100
  :trigger (lambda (ctx) (declare (ignore ctx)) nil))

Overview

When a skill file fails to compile or a runtime error occurs, Self Fix attempts to diagnose and repair the issue. It receives error logs from the skill loader, identifies the broken file, and generates a corrected version that is hot-reloaded into the running image.

Implementation

Self-Fix Logic

(defun self-improve-fix (skill-name error-log)
  "Attempts to diagnose and repair a broken skill."
  (declare (ignore error-log))
  (log-message "SELF-FIX: Attempting repair of ~a..." skill-name))

Skill Registration

(defskill :passepartout-system-self-improve
  :priority 100
  :trigger (lambda (ctx) (member (getf ctx :type) '(:LOG :EVENT)))
  :deterministic (lambda (action ctx) (declare (ignore action ctx)) nil))