Skip to content

Self-healing scaffolding: create agent files on first request, not just activation #408

@chubes4

Description

@chubes4

Problem

Data Machine only creates agent files (SOUL.md, USER.md, MEMORY.md) during the WordPress activation hook (register_activation_hook). If the plugin is deployed via file replacement (e.g. homeboy deploy, rsync, git pull) without triggering WP activation, the scaffolding never runs.

Context

During Extra Chill VPS migration, DM was deployed via Homeboy. The plugin was marked active in the database but activation hooks never fired, so the datamachine-files/agent/ directory and default agent files were never created. Had to manually deactivate/reactivate to trigger scaffolding.

Proposed Solution

Add a self-healing check: on any request that touches agent files (API, CLI, or chat), verify the scaffolding directory exists. If not, create it with default templates. This is more robust than relying solely on activation hooks, since plugins can become active through many paths (deploy tools, database manipulation, wp plugin activate, etc.).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions