repo-layout: lay the repo out by machine (2/2) #6
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "impl/repo-layout-2-restructure"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Slice 2/2 of the repo-layout track (spec
docs/superpowers/specs/2026-11-05-repo-layout-design.md, plandocs/superpowers/plans/2026-11-05-repo-layout/slice-2-restructure.md).What moved and why
The tree now shows what runs where (spec D1):
vps/andnixos/each hold one directory per stack that machineruns, plus the machine's caddy (
vps/caddy/,nixos/caddy/, which wascaddy-nixed/). The stalesetup.shandsync.share now underbackup/, with a README saying they are stale.git mv, sogit log --followkeeps each file's history.name:to its current project name, so the move keeps the same containers, volumesand networks;
nixos/caddykeepscaddy-nixed;/srv/selfhosted/<stack>mounts are now relative, so they follow the stack;.gitignoreis rewritten for the new paths, so live state stays ignored.AGENTS.mdSetup now also fails when areverse_proxyupstream isn't a stack on the same machine, unless
<machine>/caddy/external-upstreamslists it (todaymysite). This catches a Caddy block left in the wrong machine's Caddyfile after a move.nixos/plane/loses the microVM/host switch andmicrovm.env. ThemicroVM's Plane is retired (
RETIRED.md).AGENTS.md, the network guide,BACKLOG.md, the ente spec (clarification 1, folded), therepo-layout spec (D10 check; clarification 1) and the docs index now use the new paths. There is also a
one-time move guide,
docs/guides/moving-to-the-machine-layout.md.BACKLOG.mdNext has the move as a step waiting on the user.After the merge (the user)
Nothing is deployed. On the VPS and on the NixOS host, follow
docs/guides/moving-to-the-machine-layout.md.It covers stopping each stack,
git pull, moving the untracked state, starting the stacks again and the URLs tocheck. When both machines are done, tell an agent: it deletes the guide, and the ente plan starts. The
nixedrepo's comments that name the old paths are a
BACKLOG.mditem.Early output: the branch's tree
find vps nixos -mindepth 1 -maxdepth 2 -type d | sort, the same directories astree -L 2 -d vps nixos.Compare it with the spec's Target tree:
Instructions changed
Every rule this PR removes or rewrites, and where it now lives:
AGENTS.mdNever commit secrets: the ignored list dropsbackup/(now tracked scripts) and addsnixos/plane/backup/; same bullet.AGENTS.mdSetup: the check command also checks eachreverse_proxyupstream against its own machine's stacksor
<machine>/caddy/external-upstreams(new rule, same section, with a note on the one form it reads); After amerge now says "a change under
vps/ornixos/" (rewritten, same place).AGENTS.mdProject in brief: new rules: the tree is the source of truth for what runs where; a moved stackmoves with
git mvin the same commit as its Caddy block and DNS record; a stopped one is deleted with aRETIRED.mdrow.plane/directory": dropped on purpose (spec D8);"
caddy-nixed/is the deployment config … new services go there by default": rewritten as "nixos/is thedefault for new stacks" (
AGENTS.mdProject in brief table and the guide); the microVM as a migration targetfor
extra_records: dropped (it hosts no stacks,RETIRED.md); new: each<machine>/caddyproxies only to itsown machine's stacks.
nixos/plane/README.md: the microVM/host switch (PLANE_MACHINE): dropped (D8); replaced by a guard: off thehost,
lib.shrefuses unless the caller setsPLANE_DATA(andAPP_DOMAIN) for a test run.Checks
D1–D11 as the plan words them all pass, as does the check command (exit 0, in bash and zsh, plus D6's three
negative runs) and
sync-agents.py --check(exit 0). Each task got a subagent review. Task 2.4's review foundthree two-machine comments left in
restore.shandbackup.sh; they were fixed in round 1.🤖 Generated with Claude Code
WIP: repo-layout: lay the repo out by machine (2/2)to repo-layout: lay the repo out by machine (2/2)Local review round (two reviewer subagents, whole branch a800f94..df4d167).
BACKLOG.mdline. Minor:BACKLOG.mdsays~/ente-vps(it is/root/ente-vps); the guide's deletion is two backlog items, and thenixedcomments line is due now; the ente line'sdocs/handoffs/pointer is right only after the post-merge handoff; the slice-2 handoff names no check; the plan's clarification summary omits the move-guide exclusion;nixos/spliit/README.mdstill mentions the microVM. Sign-off check clean;sync-agents.py --check: exit 0.226e755replaced it; its volume ispostgres-data, notpgdata); the host clone path~/repos/selfhostedis hard-coded (guide and the ente spec's Deployment);nixos/plane/lib.shlost its machine guard, so a test run in the microVM would use the host's livedata-nixed. Minor:/root/ente-vpsand a re-run guard on the copy;mv mywebsiteafter a collision; ownership of the VPS clone and a post-pull tree check; a cron/timer warning forsetup.sh/sync.sh;move_state's nested|| return 1; the checker only readshttp://upstreams; podman-compose andname:(no change); the earlier trailer/newline minors (moot).All findings are fixed in this PR, except the checker's
http://-only form, which gets a note, and the moot ones.Checks: the AGENTS.md Setup check command: exit 0
Review round addressed (fixes
e19b3f7,a7eb954,76df1da; the scoped re-review's minorseee95e9):Methodology
a7eb954); the trailer blank line and the trailing newlines are moot (squash, harmless)./root/ente-vpsin the guide andBACKLOG.md(76df1da).nixedcomments line moved to Next with the new paths (76df1da).docs/handoffs/handoff names the ente plan's start condition (onmainafter the merge).76df1da).76df1da).nixos/spliit/README.mdpoints to the network guide's test recipe (76df1da).Correctness
docker inspect), stopped with its ownacbff43file, copied with it, andrm -rfwaits for/ping;postgres-datareplacespgdata, in the repo-layout spec through a folded clarification (a7eb954,76df1da).$clone; the ente spec's Deployment says the same through a clarification (a7eb954,76df1da).lib.shrefuses off the host unless the caller setsPLANE_DATAandAPP_DOMAIN, which win overnixed.env's;data_absfor absolute paths (e19b3f7,eee95e9).4–8. Fixed in the guide (
a7eb954).reverse_proxy http://name:port) is written in Setup (76df1da).podman volume lsdiff in the host steps (a7eb954).Re-review (scoped, d87ccd0..76df1da): every finding fixed; 4 new Minor (a re-run's expected
No such object, a guard before the ente copy,APP_DOMAINrequired off the host,plane-proxy's fixed name): fixed ineee95e9.Checks: the AGENTS.md Setup check command: exit 0