Skip to content

feat(wiki): PR-A — wiki scaffold (~/.memtomem-wiki, mm wiki init/list, ADR-0008)#622

Merged
memtomem merged 2 commits intomainfrom
feat/wiki-layer-pr-a
Apr 30, 2026
Merged

feat(wiki): PR-A — wiki scaffold (~/.memtomem-wiki, mm wiki init/list, ADR-0008)#622
memtomem merged 2 commits intomainfrom
feat/wiki-layer-pr-a

Conversation

@memtomem
Copy link
Copy Markdown
Owner

Roadmap

ADR-0008 introduces a 5-PR wiki layer on top of the existing context-gateway router (ADR-0001). This PR is PR-A — scaffolding only; the wiki is purely additive at this stage.

PR Surface Status
A (this) Wiki repo + mm wiki init/list + ADR-0008 here
B mm context install + lockfile + concurrency next
C Override resolution + mm wiki <type> override queued
D mm context update/install --all/status, dirty detection queued
E Web UI mirror queued

In scope (PR-A)

  • ~/.memtomem-wiki/ directory convention + initial git repo layout
  • WikiStore — init scratch, init from git URL, list, current_commit, exists
  • mm wiki init [--from <git-url>] and mm wiki list [--type skills|agents|commands]
  • ADR-0008 with the four invariants the rest of the layer rests on
  • MEMTOMEM_WIKI_PATH env override (for tests + advanced users)

Out of scope (deferred)

  • mm context install/update/status and lockfile schema → PR-B
  • Override resolution and OVERRIDE_FORMATS matrix → PR-C
  • Dirty-edit detection (--force, .bak), --all UX → PR-D
  • Web UI surface (web/routes/wiki.py) → PR-E
  • Section-level override merge → v2
  • Cursor / Copilot override slots → v2 (runtime surface too thin in v1)
  • settings.json in wiki → permanent NO (host-scope mutation trust boundary)

ADR-0008 invariants

The four rules every later PR upholds:

  1. Self-containment of project canonical<project>/.memtomem/ works without the wiki present (CI machines, archives, machines without the wiki).
  2. Explicit conflict surface — local edits to project canonical after install must trigger refuse + --force + .bak (enforced in PR-D).
  3. Wiki is optional, project is authoritative — wiki absence breaks only mm wiki * and mm context install/update/status; existing fan-out runs unchanged.
  4. Override is full-file replacement (v1) — no section-level merge; override files bypass auto-conversion as a byte copy.

Verification

  • 28 unit tests pass (tests/test_wiki_store.py, tests/test_wiki_cmd.py):
    scratch init / clone init / idempotency refusal / non-empty refusal / asset listing (sort, type filter, hidden exclusion) / WikiNotFound graceful surface
  • ruff check + ruff format --check clean across 220 src files
  • mm --help shows wiki in command list; mm wiki --help, mm wiki init --help, mm wiki list --help all resolve

Test plan

  • Unit tests: uv run pytest packages/memtomem/tests/test_wiki_store.py packages/memtomem/tests/test_wiki_cmd.py -v
  • Lint: uv run ruff check packages/memtomem/src && uv run ruff format --check packages/memtomem/src
  • CLI smoke: uv run mm wiki --help, uv run mm wiki init --help, uv run mm wiki list --help
  • Top-level registration: uv run mm --help shows wiki

Follow-up PRs

  • PR-B — snapshot install + lockfile + concurrency (next)
  • PR-C — override resolution
  • PR-D — update / status / dirty detection / --all
  • PR-E — Web UI mirror

🤖 Generated with Claude Code

pandas-studio and others added 2 commits April 30, 2026 22:35
…-0008 PR-A)

Add the global wiki layer foundation that ADR-0008 specifies: a git
repository at ~/.memtomem-wiki/ that holds vendor-neutral skills,
agents, and commands, ready to be cherry-pick-deployed into projects
by mm context install (PR-B).

PR-A surface only:

- WikiStore (init scratch, init --from <git-url>, list, current_commit)
- mm wiki init [--from <git-url>] and mm wiki list CLI commands
- ADR-0008 with the four invariants the rest of the layer rests on
  (self-containment, explicit conflict surface, optional wiki, full-file
  override)

Project canonical (.memtomem/) and the existing fan-out are untouched —
the wiki is purely additive at this stage. Tests exercise scratch init,
clone init, layout, idempotency, asset listing (sort, filter, hidden
exclusion), and the WikiNotFound graceful-degradation surface.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…ract)

Address review findings on PR #622:

- Drop "(PR-C+)" hint from `mm wiki init` output and the same forward
  references from module docstrings. Per feedback_deictic_pr_references.md
  these rot once the referenced PRs ship and leave readers wondering
  why a current verb is labelled future.

- Trim _README_TEMPLATE to v1-truthful content. The README is shipped to
  disk at init time and persists in the user's wiki repo, so referencing
  unimplemented commands (`mm wiki skill edit`, `mm context install`)
  would rot worse than CLI hints. Now points to the project README and
  ADR-0008.

- Pin lockfile SHA contract in ADR-0008: wiki_commit stores the full
  40-character SHA, display surfaces may abbreviate. Keeps PR-B's
  lockfile schema unambiguous and avoids abbreviation collisions across
  projects that share a wiki. Update example JSON to use a recognisably
  full-length SHA.

- Fix `current_commit()` docstring — git rev-parse HEAD always returns
  full 40-char hex; the prior "short or full per git config" was wrong.

- Fix `test_at_default_falls_back_to_home` — it was comparing against
  the module-level constant DEFAULT_WIKI_PATH (computed at module load
  from the same Path.home() call the function under test uses), so it
  was a tautology. Now compares against Path.home() / ".memtomem-wiki"
  directly, so a regression in env-resolution logic would actually
  surface.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@memtomem memtomem merged commit 135ab7e into main Apr 30, 2026
7 checks passed
@memtomem memtomem deleted the feat/wiki-layer-pr-a branch April 30, 2026 13:58
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants