Skip to content

fix: remove 29 dead references from CONTEXT_ROUTING.md#836

Closed
Spirotot wants to merge 1 commit intodanielmiessler:mainfrom
Spirotot:fix/context-routing-dead-links
Closed

fix: remove 29 dead references from CONTEXT_ROUTING.md#836
Spirotot wants to merge 1 commit intodanielmiessler:mainfrom
Spirotot:fix/context-routing-dead-links

Conversation

@Spirotot
Copy link

@Spirotot Spirotot commented Mar 1, 2026

Summary

  • Removes 29 dead file/directory references from CONTEXT_ROUTING.md in v4.0.0 and v4.0.1
  • Consolidates 4 USER sections into one pointing at the README.md indexes that actually ship with the release

Problem

CONTEXT_ROUTING.md references 29 files/directories that don't exist in the v4.0.0+ releases:

Category Dead references Examples
System docs 3 PAISECURITYSYSTEM/, BROWSERAUTOMATION.md, DEPLOYMENT.md
USER identity 10 ABOUTME.md, RESUME.md, CONTACTS.md, etc.
TELOS files 9 MISSION.md, GOALS.md, BELIEFS.md, etc. (only README.md ships)
DA identity 3 DAIDENTITY.md, DAWRITINGSTYLE.md, OUR_STORY.md
Work section 4 FEED.md, HEALTH/, FINANCES/, PROJECTS.md

Each dead reference wastes context tokens during AI context loading — the AI reads the path, attempts to load it, gets a file-not-found error, and moves on. With 29 dead links out of 46 total (63%), a significant portion of the routing table is noise.

Fix

  • Remove all references to non-existent files/directories
  • Consolidate the 4 USER sections (Identity, Telos, DA Identity, Work) into a single "Personal Context" section
  • Point to the README.md indexes that actually ship (USER/README.md, PROJECTS/README.md, BUSINESS/README.md, TELOS/README.md)
  • Applied to both v4.0.0 and v4.0.1 releases

Verification

Validated every remaining path exists in both releases:

OK: PAI/README.md
OK: PAI/PAISYSTEMARCHITECTURE.md
...all 18 paths verified OK

🤖 Generated with Claude Code

CONTEXT_ROUTING.md in v4.0.0 and v4.0.1 references 29 files/directories
that don't exist in the release:
- 3 system docs (PAISECURITYSYSTEM/, BROWSERAUTOMATION.md, DEPLOYMENT.md)
- 10 USER identity files (ABOUTME.md, RESUME.md, etc.)
- 9 TELOS files (only README.md ships)
- 3 DA identity files
- 4 work section files (FEED.md, HEALTH/, FINANCES/, PROJECTS.md)

Dead references waste context tokens and cause unnecessary file-not-found
lookups during AI context loading.

Consolidated 4 USER sections into one pointing at the README.md indexes
that actually ship with the release (USER/, PROJECTS/, BUSINESS/, TELOS/).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jdrolls
Copy link

jdrolls commented Mar 1, 2026

Additional finding: v2/v3 → v4 upgrade strands user content

Just hit this exact issue after upgrading from v3 to v4.0.1. In addition to the dead references this PR fixes, there's a related migration gap worth noting:

The problem: Users who customized their PAI in v2/v3 have populated content at skills/PAI/USER/ (the old canonical location). The v4 upgrade creates a new PAI/USER/ tree with README stubs but doesn't migrate the customized content from the old location. This means:

  1. CONTEXT_ROUTING.md points to PAI/USER/ABOUTME.md (v4 path) → empty/missing
  2. User's actual content sits at skills/PAI/USER/ABOUTME.md (v3 path) → orphaned
  3. Hooks like SecurityValidator that use paiPath('PAI', 'USER', 'PAISECURITYSYSTEM', 'patterns.yaml') silently fall through to defaults because the patterns file is stranded in the old tree

What we did locally:

  • Copied all content from skills/PAI/USER/PAI/USER/ (additive, preserving v4 README stubs)
  • Updated CONTEXT_ROUTING.md to include all actual TELOS files (20 files, not just the 9 from the template)
  • Added 3 PAI System entries that exist but weren't routed (THEFABRICSYSTEM.md, DOCUMENTATIONINDEX.md, SYSTEM_USER_EXTENDABILITY.md)

Suggestion: It might be worth either:

  1. Adding a note to the upgrade docs about manually migrating skills/PAI/USER/PAI/USER/
  2. Or adding a migration step to install.sh that detects and offers to copy existing user content

Great PR — the dead reference cleanup is definitely needed. Just wanted to flag the broader migration issue for anyone else upgrading from v2/v3.

@danielmiessler
Copy link
Owner

Thank you @Spirotot! This cleanup is merged into PAI v4.0.3. Removing the 29 dead references and consolidating to README pointers is exactly the right approach — cleaner and more maintainable.

Fix included in: Releases/v4.0.3

danielmiessler added a commit that referenced this pull request Mar 2, 2026
- #800: Inference.ts JSON array parsing (objects + arrays)
- #836: CONTEXT_ROUTING.md dead reference cleanup (29 refs removed)
- #817: WorldThreatModelHarness $PAI_DIR portability
- #846: User context migration for v2.5/v3.0 upgraders

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
HyggeHacker pushed a commit to HyggeHacker/Personal_AI_Infrastructure that referenced this pull request Mar 2, 2026
…nielmiessler#836, danielmiessler#817, danielmiessler#846)

- PR danielmiessler#800: Inference.ts JSON array parsing (dual-candidate strategy)
- PR danielmiessler#836: CONTEXT_ROUTING.md dead reference cleanup (75→31 lines)
- PR danielmiessler#817: WorldThreatModelHarness $PAI_DIR portability (10 instances)
- PR danielmiessler#846: Installer user context migration (copyMissing + migrateUserContext)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants