feat: Phase 1 — layered memory loading and /init command#23
feat: Phase 1 — layered memory loading and /init command#23GoDiao wants to merge 2 commits intoLiuMengxuan04:mainfrom
Conversation
|
This looks like a solid implementation of Phase 1. The layering logic, deduplication, and capacity limits all align well with the earlier design. I also like the idempotent The test coverage looks comprehensive as well, especially around hierarchy, dedup, and truncation. No blocking issues from my side. One small thing to consider later (non-blocking): we might want to expose some minimal debug visibility (e.g. which files were loaded) even before the Otherwise, LGTM. We might be a bit slower to merge over the May Day holiday, but we'll batch-review and merge PRs during that time. |
- Add src/memory.ts: 3-layer instruction file loading (global, ancestors, cwd), 6 filename candidates, dedup, capacity limits (8K/20K) - Add src/init.ts: /init command bootstraps .mini-code/, .gitignore, MINI.md with auto-detected stack - Refactor src/prompt.ts to delegate instruction loading to loadMemory() - Add tests: 19 memory tests + 12 init tests (all passing) - Update docs: ARCHITECTURE, README, ROADMAP (EN + ZH)
|
Thanks for the review. I've addressed the debug visibility suggestion — at startup, MiniCode now shows a one-line memory diagnostics entry listing all loaded instruction files with their paths, line counts, and first-line preview. Ready for merge whenever you're back from the holiday. |
|
$(cat <<'EOF' |
Summary
Phase 1 of the layered memory system, implementing instruction file loading and project bootstrapping. Closes P1 item #5 (Layered memory loading) on the roadmap.
Changes
Core:
src/memory.ts— 3-layer hierarchical instruction file loading:~/.mini-code/MINI.mdor~/.mini-code/CLAUDE.md)MINI.md,MINI.local.md,.mini-code/MINI.md,CLAUDE.md,CLAUDE.local.md,.claude/CLAUDE.mdCore:
src/init.ts—/initcommand for project bootstrapping:.mini-code/directory.gitignore(idempotent, no duplication)MINI.mdtemplate with auto-detected stack:Refactor:
src/prompt.ts— replaced hardcoded 2-file loading withloadMemory()delegation, dropping ~25 lines of boilerplate.Test plan
tsc --noEmitcleanPhase 2 (next PR)
The following follow-ups will be addressed in a separate PR:
@pathinclude resolution.mini-code/rules/*.mdauto-discovery/memorycommand to inspect loaded files