Skip to content

feat: add an installer that installs and updates the pack safely - #6

Open
TKontu wants to merge 4 commits into
mainfrom
feat/pack-installer
Open

TKontu wants to merge 4 commits into
mainfrom
feat/pack-installer

Conversation

@TKontu

@TKontu TKontu commented Oct 10, 2026

Copy link
Copy Markdown
Owner

Adoption used to mean copying files by hand, with no way to update them afterwards. As a result, existing adopters' copies have drifted. This PR adds scripts/install.py (standard library only):

python3 path/to/Reconcile-loop/scripts/install.py path/to/project [--claude] [--codex] [--dry-run]
  • It copies the core files: SPEC.md, .agent/commands/, the config example, scripts/round.py, templates/ and the example. The MIT notice goes to .agent/LICENSE. Relative paths are preserved, and .agent-runs/ and HANDOFF.md are added to .gitignore.
  • .agent/pack.lock records the pack version (from git describe), the selected runners and the SHA-256 of each installed file.
  • Running it again from a newer pack is an update:
    • Files that are unmodified relative to the lock are replaced.
    • Locally edited or pre-existing project files are kept, and the new version is written beside them as *.pack-new.
    • Locally deleted files stay deleted.
    • Files dropped from the pack are removed only if unmodified.
  • It refuses a dirty checkout, a target that isn't a repository root, and the pack itself. --dry-run writes nothing.
  • It never writes the project README, AGENTS.md or .agent/config.toml; merging those stays with bootstrap.
  • README and bootstrap now point at the installer, and copying by hand is still supported.

Validation:

  • RED: the 8 new installer tests failed before implementation. Two follow-up behaviors were each added test-first: locally deleted files stay deleted, and --dry-run works on a dirty checkout.
  • GREEN: python3 -m unittest discover -s tests passes (32 tests on this branch). This includes a check that all markdown links resolve inside an installed project. git diff --check is clean.
  • Dry runs against two existing adopters reported 26 files to add in each. Their six project-specific phase wrappers were reported as conflicts to be written as *.pack-new, not overwritten.

Not included: release tags, a template repository, a plugin or a PyPI package. Those can wrap this same installer later. This PR is independent of #5; once #5 merges, its new files are picked up automatically through the glob patterns.

🤖 Generated with Claude Code

Tuomo Vendelin and others added 3 commits October 10, 2026 17:19
scripts/install.py copies the pack into a clean project checkout with
relative paths preserved, records file hashes and the pack version in
.agent/pack.lock, and ignores runtime files. Rerunning from a newer pack
replaces only unmodified files; local edits and pre-existing project
files are kept with the new version written as *.pack-new. Locally
deleted files stay deleted. Runner entry points are opt-in and
remembered; --dry-run previews without writing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	.agent/commands/bootstrap.md
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