feat(init): seed store project on init + nag unwired repos on four surfaces - #48
Merged
Conversation
…rfaces
The memory link is per-repo, but nothing told the user that. `install.sh`
wires only the repo it runs in, so every other project silently remembers
nothing — a failure with no symptom, which is the worst kind to ship to a
new user.
Worse, the documented fix didn't work. In a repo that had never saved
memory, `link_project_memory` found no `<store>/projects/<name>/` and
returned `("skip", "no store project dir yet")` — so `okfmem init` was a
silent no-op in exactly the case the step exists for. It now seeds that
directory (starter `MEMORY.md` + `STATE.md`, never overwriting) and links
it, so a fresh repo wires up in one command.
With the fix real, make the instruction unmissable. All four surfaces
share one read-only probe, `okfmem init --project-link-state`, so they
can't drift and none of them re-derives the encoded project path by hand
(`encode_root` encodes the drive colon on Windows; the skill's old
`sed 's|/|-|g'` was wrong there).
- memory_init.py: `_seed_store_project`, `project_link_state` probe
(linked | unlinked | not-a-repo | no-claude), `--project-link-state`
dispatched before the store-shape check so an unconfigured box answers
instead of exiting 2
- install.sh / install.ps1: ruled banner naming the repo actually wired,
plus a step counter replacing hardcoded numbering that skipped 1
- memory_pull.py: SessionStart reminder when the repo is unlinked,
printed even under `--quiet` — SessionStart is the only okfmem surface
that fires in a repo the user never ran init in, and its stdout reaches
the agent. Stop-hook stdout is invisible on exit 0, so it stays silent.
- skills/okfmem, skills/okfmem-save: probe first, lead with the fix
- README.md: per-repo setup section
Refs #3
Owner
Author
Windows verification — closes the open
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The memory link is per-repo, and nothing said so.
install.shwires only the repo it runs in, so every other project silently remembered nothing — a failure with no symptom.Worse, the documented fix was broken: in a repo that had never saved memory,
link_project_memoryfound no<store>/projects/<name>/and returned("skip", "no store project dir yet"), makingokfmem inita silent no-op in exactly the case the step exists for. It now seeds that dir (starterMEMORY.md+STATE.md, never overwriting an existing file) and links it — a fresh repo wires up in one command.With the fix real, the instruction is now unmissable on four surfaces, all sharing one read-only probe so they can't drift:
install.sh/install.ps1memory_pull.py)--quiet/okfmemstatus; leads the summary with the fix/okfmem-saveTwo deliberate choices worth review:
--quiet. SessionStart is the only okfmem surface that fires in a repo the user never raninitin, and its stdout reaches the agent as context. A silent unlinked repo is precisely the failure the notice exists to catch, so--quietsuppresses the pull line but not this one (documented in the flag's help text). Fail-open contract preserved —unlinked_repo_noticenever raises, exit code unchanged.The probe also removes a real Windows bug:
/okfmem-savederived the encoded project path withsed 's|/|-|g', butencode_rootencodes the drive colon (C:\→C--). No surface re-derives that path now.Rung-1 discipline: the probe is read-only and never prompts; seeding is additive, inside the user's own store, and only for the repo they explicitly ran
initin.--dry-runwrites nothing.Refs #3
Test plan
python3 scripts/check-leaks.pyexits 0 — "scanned 62 tracked files, no leaks"python3 -m pytest -q— 209 passed, 1 skippedruff checkclean on all changed filesbash -n install.shOKlinked okfmemin-repo,not-a-repooutsideinstall.ps1not parse-checked locally — nopwshon this machine. Verified pure ASCII (grep -nP '[^\x00-\x7F]'clean, per the BOM-less-cp1252 hazard). Windows CI is the first real parse check; worth an extra eye on that job.Provenance
Code implementation via: Claude Opus 4.8 (1M context), high effort
Verification: local test suite + leak gate green; CI
verifypending