feat: add install manifest/lock for MAP-managed provider surfaces (#313)#330
Conversation
Implements a scan-based install manifest written to .map/mapify.lock.json during mapify init (Claude and Codex providers). The manifest records every MAP-managed file with its template_hash, content_hash, management_mode (fenced/full/hooks-merge), and committed flag. Adds mapify check-installed command that compares the current tree against the manifest and reports missing, drifted, and orphaned managed files. - src/mapify_cli/install_manifest.py: ManifestEntry, InstallManifest, CheckResult dataclasses; build_manifest (scan-based), write_manifest, read_manifest, check_installed functions - src/mapify_cli/__init__.py: write manifest step in init command; new check-installed command with exit codes 0/1/2 - tests/test_install_manifest.py: 28 tests covering VC1-VC9 Local-only files (settings.local.json, symlinks) are excluded from the committed manifest. No absolute paths or secrets are stored. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HZ3wHDow49xBGUwWFPH2mD
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis PR adds a MAP-owned install manifest/lock system for provider-managed files. A new ChangesInstall Manifest Feature
Estimated code review effort: 3 (Moderate) | ~30 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant CLI as mapify_cli
participant InstallManifest as install_manifest
participant Disk
User->>CLI: mapify init
CLI->>InstallManifest: build_manifest(project_path, provider, version)
InstallManifest->>Disk: scan provider files, hash content
Disk-->>InstallManifest: file contents
InstallManifest-->>CLI: InstallManifest entries
CLI->>InstallManifest: write_manifest(project_path, manifest)
InstallManifest->>Disk: write .map/mapify.lock.json
User->>CLI: mapify check-installed
CLI->>InstallManifest: read_manifest(project_path)
InstallManifest->>Disk: read .map/mapify.lock.json
Disk-->>InstallManifest: manifest data or None
CLI->>InstallManifest: check_installed(project_path)
InstallManifest->>Disk: scan and hash current files
InstallManifest-->>CLI: CheckResult
CLI-->>User: report + exit code
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Closes #313.
Implements a scan-based install manifest written to
.map/mapify.lock.jsonduringmapify initfor both Claude and Codex providers. Adds amapify check-installedcommand that compares the current installed tree against the manifest.What changed
New module:
src/mapify_cli/install_manifest.pyManifestEntrydataclass: dest (relative POSIX path), content_hash, template_hash, management_mode (fenced/full/hooks-merge), committed, mapify_version, installed_atInstallManifestdataclass: mapify_version, provider, installed_at, entriesbuild_manifest(project_path, provider, version)— scan-based: walks the provider's known install directories and collects all files carryingMAP-MANAGEDmetadata; no changes to existing install functions requiredwrite_manifest/read_manifest— persist and load.map/mapify.lock.jsoncheck_installed(project_path)→CheckResult(missing, orphaned, drifted, ok)src/mapify_cli/__init__.pymanifeststep ininitcommand: writes the lock after all provider files are installedmapify check-installed [project_path]command with exit codes 0 (ok), 1 (issues found), 2 (no manifest)tests/test_install_manifest.py— 28 tests covering VC1–VC9:hooks.json→hooks-mergemode)read_manifestedge cases (missing/corrupt/wrong-type).claude/settings.local.json, symlinks)Design decisions
MAP-MANAGEDmetadata after install completes. No changes to the 10+create_*functions.settings.local.json(statusline, machine-specific) is not recorded.AGENTS.mdsymlink toCLAUDE.mdis not followed.hooks.jsonhandled separately: Codex hooks.json uses a custom merge without MAP metadata; recorded withmanagement_mode="hooks-merge".Test plan
uv run pytest tests/test_install_manifest.py -v— 28/28 passuv run make check— all 3284 tests pass, ruff + mypy + check-render cleanuv run python -m pyright src/mapify_cli/install_manifest.py src/mapify_cli/__init__.py— 0 errorsGenerated by Claude Code
Summary by CodeRabbit
New Features
mapify check-installedto verify whether installed files match the recorded state, with clear exit codes for success, missing setup, and detected issues.mapify initnow saves an install manifest after setup so installed files can be tracked later.Bug Fixes