Skip to content

feat: use the full template tree as canonical payload#35

Merged
dapi merged 8 commits into
mainfrom
codex/gh-29
Jul 24, 2026
Merged

feat: use the full template tree as canonical payload#35
dapi merged 8 commits into
mainfrom
codex/gh-29

Conversation

@dapi

@dapi dapi commented Jul 24, 2026

Copy link
Copy Markdown
Owner

Summary

  • define one name-agnostic path model for the complete tracked template/ tree and use its inverse in push
  • install and update dotfiles, nested paths, and executable files while rejecting symlinks and unsupported Git entries
  • record canonical files in the ownership lock, detect content/mode drift, and migrate legacy ownership conservatively
  • make doctor recognize the whole canonical root and defer template-owned agent files to the lock drift contract
  • update CLI help, README, architecture, push design, and regression coverage

Migration and safety

Legacy memory-bank-template/ and memory-bank/ source roots remain accepted.
Matching or otherwise unmodified legacy files are promoted to canonical
managed ownership; downstream customization is preserved, and concurrent
upstream/downstream changes remain conflicts. Lock paths cannot target Git
metadata or the lock itself.

Verification

  • GOCACHE=/private/tmp/memory-bank-cli-gh29-race2 go test -count=1 -race ./...
  • GOCACHE=/private/tmp/memory-bank-cli-gh29-vet2 go vet ./...
  • E2E_BINARY=/private/tmp/memory-bank-cli-gh29 E2E_WORK_ROOT=/private/tmp/memory-bank-cli-gh29-e2e bash scripts/e2e-init-update.sh (27 scenarios passed)
  • /private/tmp/memory-bank-cli-gh29 lint --repo-root .
  • post-merge-with-main: GOCACHE=/private/tmp/memory-bank-cli-gh29-postmerge go test -count=1 ./...
  • post-merge-with-main: GOCACHE=/private/tmp/memory-bank-cli-gh29-postmerge-vet go vet ./...

Closes neither issue automatically; GH-29 remains open for human review.

@dapi

dapi commented Jul 24, 2026

Copy link
Copy Markdown
Owner Author

Ревью: блокирующее замечание

internal/ownership/update.go:474: canonical template/ теперь отображается в любой repository-relative путь, но перед планированием не запрещаются Git metadata paths. Например, отслеживаемый upstream-файл template/.git/hooks/post-commit попадает в source как .git/hooks/post-commit; при init отсутствующий hook будет создан внутри .git downstream-репозитория. После этого lock также содержит недопустимый .git/... path и следующий ReadLock его отвергнет. Проверка в readLockSnapshot происходит только после записи и ограничивается первым компонентом, поэтому она не предотвращает mutation.

Нужно отклонять .git на любом компоненте пути до buildPlan/любых мутаций и покрыть template/.git/hooks/..., а также вложенный worktree вроде memory-bank/.repo/.git/....

@dapi

dapi commented Jul 24, 2026

Copy link
Copy Markdown
Owner Author

Конфликт с main разрешён в 37ba914.

Также устранено замечание ревью: canonical payload теперь отклоняет .git в любом компоненте пути до планирования мутаций; добавлен regression-тест.

Проверка: go test -count=1 ./....

@dapi
dapi marked this pull request as ready for review July 24, 2026 19:09
@dapi
dapi merged commit 15aed5f into main Jul 24, 2026
4 checks passed
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