Personal_AI_Infrastructure icon indicating copy to clipboard operation
Personal_AI_Infrastructure copied to clipboard

v5.0.0: schema-v1 DA migration leaves legacy USER/DA_IDENTITY.md references in CLAUDE.md, system prompt, install detect, and Algorithm docs

Open brycemagera opened this issue 6 months ago • 1 comments

Summary

The schema-v1 DA migration (registry-based DA identity at USER/DA/<primary>/DA_IDENTITY.md, documented in PAI/DOCUMENTATION/Pulse/DaSubsystem.md) is partially landed in v5.0.0:

  • ✅ Schema-v1 directory scaffolding ships (USER/DA/_example/, USER/DA/_presets.yaml, USER/DA/README.md)
  • ✅ Tools/DAInterview.ts produces schema-v1 outputs (after #1215 lands)
  • ✅ Pulse Assistant runtime modules reference schema-v1 (covered by #1206)
  • ✅ PostCompact hook Tier 2 will resolve via _registry.yaml (after #1216 lands)
  • ❌ The user-facing wiring still references the legacy flat path USER/DA_IDENTITY.md

After /interview runs, the legacy USER/DA_IDENTITY.md becomes a deprecated: true stub redirecting to the new path — but the rest of the system still imports the stub, not the live identity.

Catalog of remaining legacy references

In Releases/v5.0.0/.claude/:

File Line(s) Reference Effect
CLAUDE.md 7 @PAI/USER/DA_IDENTITY.md Session-start @-import resolves to deprecated stub post-/interview
PAI/PAI_SYSTEM_PROMPT.md 24 Your name, voice, and personality live in USER/DA_IDENTITY.md Constitutional doc points at deprecated path
PAI/PAI_SYSTEM_PROMPT.md 110 | Identity, voice, principal/DA persona | PAI/USER/PRINCIPAL_IDENTITY.md, PAI/USER/DA_IDENTITY.md | Routing table points at deprecated path
PAI/PAI-Install/engine/detect.ts 165, 171, 172 PAI/USER/DA_IDENTITY.md and .yaml Install detection scans legacy path only
PAI/ALGORITHM/v5.7.0.md 645 algorithm spec routing table | identity | ... USER/DA_IDENTITY.md |
PAI/ALGORITHM/v6.0.0.md 524 same same
PAI/ALGORITHM/v6.1.0.md 529 same same
PAI/ALGORITHM/v6.2.0.md 575 same same
PAI/ALGORITHM/v6.3.0.md 604 same (current Algorithm) same
PAI/PULSE/Observability/observability.ts 2471 comment cosmetic
.claude/ISA.md 87 {{PRINCIPAL_NAME}}'s DA \{{DA_FULL_NAME}}` is configured at `USER/DA_IDENTITY.md`` Setup template pointer is stale

Reproduce the wiring problem

git clone https://github.com/danielmiessler/Personal_AI_Infrastructure
cd Personal_AI_Infrastructure/Releases/v5.0.0/.claude
grep -n "USER/DA_IDENTITY" CLAUDE.md PAI/PAI_SYSTEM_PROMPT.md PAI/PAI-Install/engine/detect.ts PAI/ALGORITHM/v6.3.0.md

vs. what schema-v1 actually produces (from DaSubsystem.md line 262 migration table):

PAI/USER/DA_IDENTITY.md → PAI/USER/DA/your-da/DA_IDENTITY.md (generated)

Design question (blocking before any sweep PR)

Two viable approaches; want to confirm direction before sending changes:

Option A — install-time substitution. /interview and the install wizard rewrite CLAUDE.md and any other user-facing files to substitute <primary> with the chosen DA slug. The repo's templates can keep using a placeholder (e.g. @PAI/USER/DA/{{DA_SLUG}}/DA_IDENTITY.md). Already the pattern for {{DA_NAME}} / {{PRINCIPAL_NAME}} in CLAUDE.md.

  • Pros: zero runtime cost; works with Claude Code's native @-import; transparent to users.
  • Cons: requires /interview (or installer) to know about every file with the substitution.

Option B — runtime resolution. Files use a stable abstract path; tooling resolves it. E.g. RestoreContext.hook.ts reads _registry.yaml (which #1216 does for Tier 2). CLAUDE.md can't do this directly because Claude Code's @-import is literal — would need a wrapper file like USER/DA_IDENTITY.md that re-exports the active DA's content. Possibly a generated symlink.

  • Pros: rename DA freely without rewriting files; single source of truth.
  • Cons: extra indirection layer; symlink approach has portability concerns; runtime cost for every read.

Recommendation: Option A. Substitution is already how {{DA_NAME}} works in CLAUDE.md. Adding {{DA_SLUG}} (or reusing the lowercased name) into the install-time rewrite path keeps the model consistent and Claude Code's @-import works as-is. The hook fix in #1216 stays as a fallback layer (registry resolution) so post-/interview rename of a DA still works.

Out of scope

  • DA Pulse Assistant runtime — covered by #1206
  • DAInterview non-interactive — covered by #1215
  • PostCompact hook registry resolution — covered by #1216
  • MigrateDAIdentity.ts — tracked in #1202
  • Multi-DA delegation — tracked in #1203
  • ConfigRenderer — tracked in #1204
  • USER/PROJECTS/PROJECTS.md migration — tracked in #1133
  • Algorithm doc rewrites for path references — would split into a separate PR after design is locked, since each Algorithm version doc has its own constraints

Proposed next step

Confirm Option A vs B; I'll send the sweep PR(s) accordingly. Happy to break it up into:

  1. CLAUDE.md template rewrite + installer substitution wiring
  2. PAI_SYSTEM_PROMPT.md path updates
  3. PAI-Install/engine/detect.ts schema-v1 detection (probe USER/DA/_registry.yaml first, fall back to legacy)
  4. Algorithm v6.3.0 doc path update (current version only — older versions can stay stamped to their era)

…or land them as one PR if you prefer.

Environment

PAI v5.0.0, main branch (commit at time of filing).

brycemagera avatar May 08 '26 20:05 brycemagera

Hey @brycemagera, thank you for the PR and the work that went into it.

We're changing how LifeOS ships: from a full ~/.claude directory you run as-is, to a skill installed by an agentic installer that has your own AI integrate the pieces into your setup. That reworks the parts of the codebase this change touches, so it won't apply cleanly to where we're headed.

We're closing it for that reason, not because the idea was wrong. If the need still stands against the new model, we'd love a fresh PR once it lands. Thanks again for contributing.

danielmiessler avatar Jun 21 '26 03:06 danielmiessler