CodeRaven · Data Audit

Blueprint store is 78% cross-project contamination

Every one of the 15 registered projects holds architecture blueprints describing other apps. Seven hold nothing else.

2026-07-26 · store: ~/Library/Application Support/Code Raven/Blueprints/ · 317 records audited · resolved
Resolved — 2026-07-26 16:22

251 records deleted; the store now audits clean at 0 foreign. 248 flagged blueprints, 2 orphan project directories, and 3 stray duplicates of shared-lists-server resolved by hand afterwards. 65 blueprints remain, all correctly placed.

Full backup at Blueprints-backup-20260726-162217 (44 MB). Restore with:
rm -rf "…/Code Raven/Blueprints" && mv "…/Blueprints-backup-20260726-162217" "…/Blueprints"

The findings below are preserved as the record of what was wrong. The open question — whether this recurs — is still open; see “Root cause” and re-run audit_blueprints.py after generating a few blueprints.

248
Foreign blueprints
63
Correctly placed
15 / 15
Projects affected
Why this matters beyond tidiness

Blueprints aren't inert documentation. They're injected as session context for Claude and scanned by the maintenance agent for staleness. Right now a Peregrine session can be primed with Keep Sparrow's data model and Hopper's sync layer — as authoritative architecture for the app being worked on.

Per project

Bar shows the foreign share. A dot marks projects with zero correctly-placed blueprints.

ProjectTotalCorrectForeignForeign share
papersedgeapp27027
ToWatch20020
LochLustra19019
Peregrine13012
Photo-Gallery909
PressRaven504
GoodShopperExtension303
Remembird37829
Hopper20416
NoteSparrow371026
SnapSparrow28919
CodeRaven481334
Keep Sparrow19612
Atticus311318

Two unregistered project directories also exist (E351091F…, E81793D1…) holding one file each — orphans from deleted projects.

What the evidence looks like

This isn't inferred from filenames. The blueprints name the wrong app in their own opening lines:

Peregrine/cloud-sync.json
  "Cloud Sync is Hopper's optional, fail-safe backup and cross-device layer…"

Peregrine/ios-app-ui.json
  "…the SwiftUI presentation layer for Keep Sparrow, a local-first
   book-capture app…"

Peregrine/app-shell.json
  "This is the App Shell & Navigation subsystem of Hopper — a Svelte 5
   client-only PWA (NOT the Swift/macOS SnapSparrow app described in the
   stale prior blueprint…)"

That last one is doing something grimly funny: it's a regenerated blueprint correcting a previous mis-association, filed under a third project entirely.

CodeRaven's own directory is the worst offender by volume

34 of its 48 blueprints belong elsewhere — SnapSparrow's design-system, Atticus's room-concept and domain-models, Keep Sparrow's ios-app-ui, NoteSparrow's note-editing, Hopper's cloud-sync. Peregrine's old index.md listed exactly this set, which is how the SnapSparrow and room-* names reached Peregrine in the first place.

Root cause — partly known, partly not

Already diagnosed and fixed in code

BlueprintSubsystemMigration.swift documents it in its own header: "allSubsystems previously fell back to SubsystemCatalog when customSubsystems was empty. That fallback leaked CodeRaven-specific subsystem names into unrelated projects." That explains the names — why every project offered CodeRaven's 11 subsystems.

It does not explain full blueprint content for Keep Sparrow, Hopper and Atticus sitting in other projects' directories. I checked every saveBlueprint call site — all twelve pass an explicit projectId, so there's no obvious active mis-write. Two hypotheses worth testing, neither confirmed:

Distinguishing these matters: if it's historical, deleting is a permanent fix. If it's live, the contamination returns.

Recommended sequence

  1. Quit CodeRaven (currently running as a Debug build, pid 28166). Its in-memory store will rewrite files on next save otherwise.
  2. Back up the whole Blueprints/ directory to a timestamped copy — 248 deletions deserves an undo.
  3. Delete the 248 foreign records (and the 2 orphan directories). The 63 correct ones stay.
  4. Regenerate on demand with /cr-blueprint <subsystem> per project, rather than bulk-regenerating 248 blueprints nobody has asked for yet.
  5. Verify it doesn't recur — generate one blueprint, switch projects, generate another, and re-run this audit script.
Peregrine is already partly handled

Its .claude/context/blueprints/index.md was rewritten earlier today to list only real files, and a genuine persistence blueprint now exists at .claude/blueprints/persistence.json awaiting import. Only the 12 foreign records in its app-data directory remain.

Method & caveats

Script: audit_blueprints.py (in this session's scratchpad). For each stored blueprint it scans overview, keyFiles, entryPoints and gotchas for the names of all 17 registered projects.

The rule is deliberately conservative: a blueprint is flagged only when its owning project's name is entirely absent and another project's name is present. Anything mentioning its own owner passes, even if it also names another project — so Peregrine's prototyping-docs, which legitimately references CodeRaven's review template, would not be flagged.