agentleFS
D-SheyD-Shey/autoharness/.agents/skills/memory-reconciliation/SKILL.md

memory-reconciliation

Skill10 starsChanged todayMITView on GitHub

Audit and reconcile persistent agent memory against ground-truth AST and workspace files

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 0 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use when inspecting, auditing, or pruning persistent SQLite agent memory (.autoharness/memory.db) to detect knowledge drift, orphaned …

    line 9
  2. Very specific:

    Verify referenced symbols against Python AST symbols (ast.parse) collected from existing workspace files.

    line 20
  3. Very specific:

    If --prune-orphans is specified, wrap deletions in an atomic SQLite transaction (SAVEPOINT) to safeguard database consistency without data …

    line 23
  4. Very specific:

    Run pytest tests/test_memory_reconciliation.py and execute autoharness memory reconcile --json.

    line 26

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

memory-reconciliation

When to use

Use when inspecting, auditing, or pruning persistent SQLite agent memory (.autoharness/memory.db) to detect knowledge drift, orphaned file/symbol references, or conflicting lessons after refactorings, deletions, or codebase evolution.

Steps

  1. Open persistent SQLite database (.autoharness/memory.db) via memory.get_memory_db(project_root).
  2. Scan active documents across kinds (ruling, lesson, review, followup, swarm_task).
  3. Differentiate between prescriptive policies and historical review records:
    • For ruling, lesson, and followup: extract referenced file paths and code symbols.
    • For review: verify only that the source task directory (.autoharness/tasks/{task_id}) still exists. Never flag historical critique prose quoting transient tests or external configurations as code drift or orphans.
  4. Extract code references with strict token discipline:
    • Match path tokens while filtering out external URLs and transient tool directories (answers/, runs/, evidence/, .cursor/, .gemini/, .claude/, etc.).
    • Extract code symbols only when explicitly declared in document metadata or formatted in strict backticked identifier syntax (e.g. def name, `class `Name), filtering out Python keywords and prose verbs.
  5. Verify referenced symbols against Python AST symbols (ast.parse) collected from existing workspace files.
  6. Detect prescriptive contradictions by evaluating policy polarity (positive vs negative) on documents sharing multi-token topic overlap or title matches.
  7. Compute drift metrics (valid_count, drifted_count, orphaned_count, drift_rate).
  8. If --prune-orphans is specified, wrap deletions in an atomic SQLite transaction (SAVEPOINT) to safeguard database consistency without data loss.

How to verify

Run pytest tests/test_memory_reconciliation.py and execute autoharness memory reconcile --json.

Facts found here

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.