Personal_AI_Infrastructure icon indicating copy to clipboard operation
Personal_AI_Infrastructure copied to clipboard

IntegrityMaintenance.ts spawns `skills/_PAI/TOOLS/CreateUpdate.ts` which is excluded from public release — `PAISYSTEMUPDATES` writer silently fails

Open stephtara opened this issue 6 months ago • 1 comments

Summary

In v5.0.0, PAI/TOOLS/IntegrityMaintenance.ts (invoked as a background spawn from hooks/handlers/SystemIntegrity.ts on every Stop event with significant PAI changes) generates a verbose-narrative payload describing the just-completed change, then spawns skills/_PAI/TOOLS/CreateUpdate.ts via --stdin to persist that payload to MEMORY/PAISYSTEMUPDATES/. The spawn target file does not exist in the shipped public release — skills/_PAI/ is a private-skills directory, excluded from publication by hooks/lib/containment-zones.ts. The spawn fails on ENOENT, the writer never persists anything, and PAISYSTEMUPDATES/ is populated only by manual edits.

The pipeline has been in this state across every release from v2.4 through v5.0.0 — the target path was updated over time (skills/System/Tools/ in v2.4 → skills/_SYSTEM/Tools/ in v2.5–v4.0.3 → skills/_PAI/TOOLS/ in v5.0.0) — but the target file has not shipped publicly since v2.3.

Structurally identical to #844 (the MEMORY/RESEARCH/ capture mechanism — documented, wired, never implemented after v2.3, closed 2026-05-01 citing v5 memory redesign).

Evidence

Shipped Releases/v5.0.0/.claude/PAI/TOOLS/IntegrityMaintenance.ts:

Line 112:

const CREATE_UPDATE_SCRIPT = join(PAI_DIR, 'skills/_PAI/TOOLS/CreateUpdate.ts');

Line 853:

const child = spawn('bun', [CREATE_UPDATE_SCRIPT, '--stdin'], { ... });

Target presence after a fresh install:

$ ls ~/.claude/skills/_PAI/TOOLS/CreateUpdate.ts
ls: ~/.claude/skills/_PAI/TOOLS/CreateUpdate.ts: No such file or directory

$ find Releases/v5.0.0 -name 'CreateUpdate*'
# (no output — file not in the public tree)

Cross-version trail:

Release CREATE_UPDATE_SCRIPT target Target shipped?
v2.3 (pipeline not yet introduced) YES — skills/System/Tools/CreateUpdate.ts shipped
v2.4 skills/System/Tools/CreateUpdate.ts NO
v2.5–v4.0.3 skills/_SYSTEM/Tools/CreateUpdate.ts NO (under exclusion zone)
v5.0.0 skills/_PAI/TOOLS/CreateUpdate.ts NO (under exclusion zone)

Documentation that points at the missing tool:

  • Releases/v5.0.0/.claude/PAI/DOCUMENTATION/Memory/MemorySystem.md:137 — "What populates it: Manual via CreateUpdate.ts tool"
  • Releases/v5.0.0/.claude/PAI/DOCUMENTATION/Memory/MemorySystem.md:315 — same line repeated
  • Releases/v5.0.0/.claude/PAI/MEMORY/PAISYSTEMUPDATES/README.md — "The PAIUpgrade skill writes prioritized recommendations here" (verified false: grep -rn PAISYSTEMUPDATES against the shipped PAIUpgrade skill returns zero hits)

Impact

  • Every Stop event with significant PAI changes runs the full pipeline (transcript parse + Inference call generating a verbose narrative) and fails silently at the final write step. Compute is spent; the output is discarded.
  • MEMORY/PAISYSTEMUPDATES/ is documented as the canonical change-history register but receives no automatic writes. Users see an empty (or thinly-populated) directory and either assume PAI is dormant, or build home-grown alternatives (separate change logs, manual files) to fill the gap.
  • Documentation in MemorySystem.md and PAISYSTEMUPDATES/README.md describes the mechanism as functional. A user reading the docs inside a public install cannot tell that the writer is missing.
  • The failure is invisible without inspecting the spawn exit code — no statusline counter, no notification, no log entry surfaces it.

Possible Resolutions

Three plausible directions; only the maintainer can choose:

  1. Publish CreateUpdate.ts to a public path. Move the file (or a public-clean copy) from skills/_PAI/TOOLS/ into a non-underscore location, update the CREATE_UPDATE_SCRIPT constant, and let the existing pipeline run end-to-end.
  2. Replace the pipeline. Retire IntegrityMaintenance.ts + SystemIntegrity.ts + the hook wiring, and ship a leaner mechanism (or accept manual edits as the canonical path). Update MemorySystem.md and PAISYSTEMUPDATES/README.md to match.
  3. Mark deferred and surface the deferral. Keep the wiring, document it as staged behind a planned v6 memory refactor (matching the resolution applied to #844 for MEMORY/RESEARCH/), and add a clear note in MemorySystem.md so readers don't assume the mechanism is live.

No strong preference on direction — happy to file a docs-only PR matching the #844 pattern (Option 3) if that's useful. Options 1 and 2 likely need maintainer guidance on intent before any patch is worth writing.

Reproduction

# Confirm the spawn target is hardcoded in the shipped file
grep -n "CREATE_UPDATE_SCRIPT\|CreateUpdate.ts" ~/.claude/PAI/TOOLS/IntegrityMaintenance.ts

# Confirm the target does not exist after install
ls ~/.claude/skills/_PAI/TOOLS/CreateUpdate.ts 2>&1

# Confirm the public release tree does not contain it either
find Releases/v5.0.0 -name 'CreateUpdate*'

# Confirm the underscore-prefix exclusion zone is encoded
grep -n "private-skills\|skills/_" hooks/lib/containment-zones.ts

Related

  • #844 — structurally identical pattern for MEMORY/RESEARCH/ (closed 2026-05-01 citing v5 memory redesign)
  • #451 — gitignore proposal that mentions CreateUpdate only in passing (tangential)

Versions

  • PAI: 5.0.0
  • IntegrityMaintenance pipeline introduced: v2.4
  • CreateUpdate.ts last shipped publicly: v2.3

Issue written up by my DA, this is a little bit above my github-newbie pay-grade – thanks for your indulgence!

stephtara avatar May 14 '26 16:05 stephtara

Hey @stephtara, 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