Skip to content

identity.json instinct counts drift from filesystem reality #16

Description

@proofoftom

Summary

.claude/homunculus/identity.json tracks instincts.personal and instincts.inherited as numeric counters, but nothing keeps them in sync with the actual files in .claude/homunculus/instincts/{personal,inherited}/. After spawning observer agents that wrote 80 new instincts, identity.json.instincts.personal stayed at 0 until I manually edited it.

Repro

  1. Spawn an observer agent that writes new instinct files to instincts/personal/
  2. Inspect identity.json after — instincts.personal is unchanged
  3. /homunculus:status reports the wrong count

The agents/observer.md doesn't tell the observer to update identity.json.instincts.personal, only evolution.ready (and only when crossing the cluster threshold).

Why this matters

  • /homunculus:status displays the wrong count
  • /homunculus:evolve's "no clusters yet" path reads from identity.json — could miss real clusters
  • Operators (humans or future agents) can't trust the file as ground truth

Suggested fix

Pick one:

  1. Make the filesystem source of truth. Drop the numeric counts from identity.json. Anything that needs the count does ls instincts/personal/ | wc -l or equivalent. The status/evolve commands already shell out — they can compute on the fly.
  2. Atomic writes via a helper. Provide a scripts/write-instinct.sh (or similar) that writes the file AND updates identity.json in one step. Update agents/observer.md and skills/evolution/ to call it. Counts stay accurate but require discipline from any code path that creates instincts.
  3. PostToolUse hook. When Write lands a file under instincts/personal/, a hook recomputes counts. Self-healing but more moving parts.

(1) is the simplest. The numbers in identity.json are derived data; treating them as authoritative invites drift.

Related

Adjacent to #14 (evolved-capabilities not auto-loaded) — both stem from identity.json being treated as state rather than computed view.

Context

  • Plugin: 2.0.0-alpha
  • Hit while distilling 80 instincts from a 3-month observation backlog

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    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