Repository navigation
Conversation
…, secret scan, store grant Fake credential-shaped strings are assembled at runtime, so the source holds no token-shaped text. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On the existing machine --prepare registers the new machine (roster entry, own ledger actor, owner's hosts/writes_as), refusing an actor another machine writes as or a registry file that does not parse, and writes one mode-600 bundle: snapshot with the private registry plus the gitignored local files, scanned for secrets first. On the new machine join runs init --from-snapshot, lands the local files with local_files_sync.py's WHOLE/MERGE rules (read from the install when present, never overwriting a file the machine has), registers it there too, writes ~/.datacore/identity.env, and joins the credential store only after the owner grants access store-side (prints the key and steps, waits). Ends with identity, branch, clean-space and doctor checks and a to-do summary. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #15 (base
fix/second-machine-from-snapshot).One command makes a new machine a mirror of an existing Datacore install: the same person, the same access, so sessions there behave the same. It automates the manual second-machine steps from the 2026-10-23 install test.
On the existing machine:
datacore join --prepare <new-machine>infrastructure.yaml: kind workstation, ssh alias, its own ledger actor) and to the owner principal'shosts/writes_asinprincipals.yaml. Comments are kept, and backups go to~/.datacore/state/.~/.datacore/join/<name>.join.yaml). It holds the snapshot with the private registry, plus the gitignored local files:.datacore/config/*.local.yaml,manifest.local.yaml,install.yamlroles and everyCLAUDE.local.md. Every carried file and the bundle itself are scanned for secrets; a hit names the file and line, never the value, and stops before anything changes.--dry-runchecks everything and writes nothing.On the new machine:
datacore join <bundle>init --from-snapshot(or restore onto an existing install), then moves any detached clone back onto its branch..datacore/lib/local_files_sync.py, read from the install when present (a built-in copy otherwise). It never overwrites a file the machine already has. Roster files gain only the allowed keys they lack, andinstall.yamlroles only for spaces the machine has. A file the repo would commit is refused.~/.datacore/identity.env(DATACORE_ACTOR=<actor>). It refuses before any change when this machine already declares another actor, or when the bundle's roster or this machine's roster does not parse.instances/<new>.yaml, push, authorise the key), then waits; exit 2 means it cannot wait, and a rerun continues. Only after that does it clone the store and runscripts/install.sh,creds syncandcreds doctor, reporting counts and failing ids only. It never commits or pushes to the store.datacore doctoris green. Then a summary of what is done and what the owner still has to do.Tests
bun test: 227 pass, 0 fail (30 new intests/join.test.ts, using real git repos). They include the refusal cases: actor collision, the source's own actor, a taken name, unparsable registry (prepare, dry run, and join on both the bundle's and the machine's copy), an existing identity, existing files not overwritten, the secret scan of the bundle, and the store never being written.tsc --noEmit: clean.local_files_sync.py, 23 files were collected, there were 0 secret hits, and--prepare --dry-runplanned the registration and left the registry md5 unchanged with no bundle written.Not covered
The real
initDatacoreinside join (the tests swap in a stand-in), ssh to a real store host, the defaultcredsbinary, the Enter-to-continue wait (needs a TTY), and Windows.🤖 Generated with Claude Code