Skip to content
maenifold
GitHub

Sleep Repair (Graph Maintenance)

2 steps

Graph maintenance specialist for the Cognitive Sleep Cycle. Identifies concept fragmentation and repairs WikiLink inconsistencies while preserving decay integrity by using observation-only tools for replay.

Triggers

sleep repairconcept repairgraph maintenance

Steps

  1. 1.

    Memory Replay (Concept Usage Focus)

    Identify high-frequency concept families that may have fragmentation.

    1. Load your maenifold skill and run recent_activity to retrieve events from the last 24-48 hours
    2. Focus on [[WikiLinks]] that appear frequently across recent activity
    3. Note potential concept variants: plurals vs singulars, case variations, abbreviations
    4. Identify concept families worth analyzing (e.g., [[tool]]/[[tools]], [[auth]]/[[authentication]])
    5. Create prioritized list of concept families for repair analysis

    Output: Prioritized list of concept families to analyze Include: High-frequency concepts, suspected variants, fragmentation indicators

    CRITICAL: Do NOT use read_memory - this phase is observation-only to preserve decay integrity.

    Tools:recent_activity*
    Effort:low
    Guardrails
    • no_read_memory: NEVER use read_memory - graph tools do not need file content
    • observation_only: This phase identifies patterns, does not modify anything
    • frequency_threshold: Focus on concepts appearing 5+ times in recent activity
  2. 2.

    Concept Repair (Graph Maintenance)

    Analyze and repair concept corruption in high-frequency families.

    1. For each prioritized concept family, run analyze_concept_corruption to diagnose variants
    2. Identify TRUE duplicates safe to merge: plurals, case variations, typos
    3. Identify entities that MUST NOT merge: class names, specific types, compound terms
    4. Use repair_concepts with dryRun=true first to preview all changes
    5. Apply repairs only for clear cases where semantic similarity is high
    6. Flag ambiguous cases for human review in the report
    7. Run sync to rebuild graph after repairs

    Output: Return repair report as workflow output - DO NOT write to memory:// Include: Repairs made, items flagged for review, graph health metrics

    CRITICAL: Do NOT use read_memory - repair_concepts modifies source files directly.

    Enhanced Thinking
    Tools:analyze_concept_corruption*repair_concepts*sync*
    Effort:medium
    Guardrails
    • no_read_memory: NEVER use read_memory - graph tools do not need file content
    • no_write_memory: NEVER use write_memory - repair reports are ephemeral, return as output
    • dry_run_first: Always preview repairs with dryRun=true before applying
    • human_review: Flag ambiguous merges for human decision
    • semantic_validation: Only merge concepts with similarity >= 0.7
    • no_class_names: NEVER merge class names (GraphTools.cs) with generic concepts ([[tool]])
    • no_specific_types: NEVER merge specific types (test-agent) with generic concepts ([[agent]])