Skip to content

Event 76 · CP-SYMLINK-RESTORE-01 Part A · scripts/restore-private-symlinks.sh#33

Merged
junjslee merged 1 commit intomasterfrom
event-76-symlink-restore
Apr 29, 2026
Merged

Event 76 · CP-SYMLINK-RESTORE-01 Part A · scripts/restore-private-symlinks.sh#33
junjslee merged 1 commit intomasterfrom
event-76-symlink-restore

Conversation

@junjslee
Copy link
Copy Markdown
Owner

Summary

Second v1.0.1 polish mini-batch CP shipped. Adds scripts/restore-private-symlinks.sh — a small bash utility that recreates the 18 gitignored canonical-path symlinks pointing into ~/episteme-private/.

Trigger. After Events 65/66/71 privatized 18 docs with relative symlinks at gitignored canonical paths, any branch switch or fresh clone wipes the local symlinks because they're not in git history. The friction surfaced mid-Event-74 when git filter-repo recovery left the working tree without symlinks at canonical paths — operator had to manually ln -sf each one. This script closes that loop.

What this ships

scripts/restore-private-symlinks.sh (NEW, executable, 122 lines).

Walks the embedded privatize list:

Event Section Files
65 Forward-vision strategic docs 4
66 Tier 1 (operational) + Tier 2 (positioning) docs 10
71 Operator-profile canonicals 4
Total 18

For each path, verifies the private target exists in $HOME/episteme-private/, computes the correct relative-path prefix (2 levels for docs/, 4 levels for core/memory/global/), and runs ln -sf to create or refresh the symlink.

Properties:

  • Idempotent — skips symlinks that already point at the correct target.
  • Reports — restored / already-correct / missing-private counts.
  • Exit codes0 clean, 1 no private dir (fork users), 2 some private targets missing.
  • Dogfooded locally — 18/18 resolve correctly; idempotency verified by re-run; content reads through symlinks confirmed.

What's deferred

Part B of the CP — SessionStart hook integration in core/hooks/session_context.py that auto-detects missing symlinks (where private targets exist) and prompts to run this script. Estimated ~1 hour. Touches core/hooks/* (post-soak; allowed). Deferred to a later Event for tight scope per the operator's preference for cognitively-bounded sessions.

Verification

  • Script executes cleanly: 18 restored on first run from no-symlinks state
  • Idempotent: re-run shows 18 already-correct, 0 restored
  • All 18 symlinks resolve to real files (verified via ls -la + head content read)
  • Path math correct for both depths (docs/ = ../..; core/memory/global/ = ../../../..)
  • Missing-private path handled cleanly (caught a relative-path bug in v1 of the script during dogfood — fixed before commit)

Soak-invariant

ZERO touches to kernel/* / core/hooks/* / core/blueprints/* / src/episteme/* / tests/* / templates/* / labs/*. Single new file under scripts/ (operator-tooling tier).

v1.0.1 polish queue post-Event-76

  • ✅ CP-RELEASE-PLEASE-CHKPT-FILTER-01 (Event 75)
  • ✅ CP-SYMLINK-RESTORE-01 Part A (this PR)
  • ⏳ CP-SYMLINK-RESTORE-01 Part B (SessionStart hook integration; deferred)
  • ⏳ CP-AUDIT-ACK-01 (~1-2 days)
  • ⏳ CP-EXAMPLES-SCHEMA-PARITY-01 (~1-2 days)

Cross-references

  • Spec source: ~/episteme-private/docs/cp-v1.0.1-polish.md § CP-SYMLINK-RESTORE-01
  • Friction surfaced: Event 74 (~/episteme-private/docs/PROGRESS.md Event 74 entry — filter-repo recovery left missing symlinks)
  • Privatize list authoritative: .gitignore Event 65 / Event 66 / Event 71 sections
  • Audit trail: ~/episteme-private/docs/PROGRESS.md Event 76 entry (private)

…itignored canonical-path symlinks (Event 76)

CP-SYMLINK-RESTORE-01 Part A (v1.0.1 polish mini-batch CP #2).

After Events 65/66/71 privatized 18 docs to ~/episteme-private/ with
relative symlinks at gitignored canonical paths, any branch switch or
fresh clone wipes the local symlinks. Operator was forced to manually
re-ln -sf each path; observed mid-Event-74 when filter-repo recovery
surfaced the missing-symlinks state.

This script walks the privatize list (4 Event-65 forward-vision docs
+ 10 Event-66 Tier-1+2 docs + 4 Event-71 operator-profile canonicals
= 18 total), validates each private target exists, and creates
symlinks with the correct relative path per directory depth (2 levels
for docs/; 4 levels for core/memory/global/).

- Idempotent: skips symlinks already pointing at the correct target
- Reports: restored / already-correct / missing-private counts
- Exit codes: 0 = clean, 1 = no private dir, 2 = some targets missing
- Dogfooded locally: 18/18 resolve correctly, idempotency verified

Soak-protected surfaces touched: ZERO (scripts/-tier only).

Part B (SessionStart hook integration in core/hooks/session_context.py
to auto-detect + auto-run this script) deferred to a later Event.
Splitting Part A and Part B keeps each Event's scope minimal.
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
episteme Building Building Preview Apr 29, 2026 2:27am

@junjslee junjslee merged commit fa0dada into master Apr 29, 2026
5 checks passed
@junjslee junjslee deleted the event-76-symlink-restore branch April 29, 2026 02:31
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.

1 participant