stateless-replicas-2-placement
No handoff yet. An agent working here writes one with amadan branch handoff, so that whoever picks the branch up next — a person, or another agent on another machine — can start without reading the whole history.
Recently
<task-notification> <task-id>brukk7tdu</task-id> <tool-use-id>toolu_015Zr9B6b6mEAFowpkoUiLcS</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/7c5a7d70-0e28-42b9-896c-5d73b2d2a05d/tasks/brukk7tdu.output</output-file> <status>completed</status> <summary>Background command "Wait for main's CI on the Plan 2 squash" completed (exit code 0)</summary> </task-notification>
<task-notification> <task-id>b9g5kh4gz</task-id> <tool-use-id>toolu_01EiAxVppWnBdn6QNBVzWpLm</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/7c5a7d70-0e28-42b9-896c-5d73b2d2a05d/tasks/b9g5kh4gz.output</output-file> <status>completed</status> <summary>Background command "Wait for CI on 1c96ee8e" completed (exit code 0)</summary> </task-notification>
<task-notification> <task-id>a54bd228154e0c314</task-id> <tool-use-id>toolu_01Sux37HDnmmK9VkwadEq4ot</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/7c5a7d70-0e28-42b9-896c-5d73b2d2a05d/tasks/a54bd228154e0c314.output</output-file> <status>completed</status> <summary>Agent "Census + resolution check merge 4" finished</summary> <note>A task-notification fires each time this agent stops with no live background children of its own. The user can send it another message and resume it, so the same task-id may notify more than once.</note> <result>### Resolution findings The merge is clean. I found nothing wrong. - **Conflicts.** - `approved_stateless_replicas_copy_test.go:12` keeps all 16 SR-2 built entries, all SR-1 entries and main's `SR-1-C14`. - `internal/activator/cmdunit.go:466-473` keeps main's `writeLaunch`, then the branch's `if rt.FleetBoxes != "" { runExecGate(ctx) }`, then main's `askTenantAdmission(ctx)` before Cmd/TTY dispatch. Main's `admissionContext` and its first `tenantStartRefusal` survive unchanged. - **Diff equivalence.** The merge base is f18da984, not 9b8b2c50; I compared against f18da984. For every file, the changed lines in `git diff f18da984 e9cd5fc7` are identical to those in `git diff 38cda89e 1c96ee8e`, with these exceptions: - The copy list, which also gains `SR-1-C14`. - The overlay, card and chain line, which carry the new seal and claims. - `TestReplicaCommandRechecksAdmissionAfterAssignment`, a test added only in the merge (`internal/activator/stateless_assignment_test.go`). - `internal/host/replica_retirement_unreachable_test.go` and `replicacoordinator_test.go`, both test-only. The second now calls the real `api.retired` instead of a made-up `retire-ack` endpoint. - No production file differs. - **Retirement ACK.** - `replicacoordinator.go:95-102`: transport errors, HTTP 5xx and replies without `X-Carlos-Version` all return `ErrConsoleUnreachable` before any decode or fencing. Only a marked console reply that isn't 200, 408 or 429 returns `ErrFenced` (`:116`). - `replicaplacement.go:121-122`: `done = err == nil || errors.Is(err, ErrFenced)`. So unreachable is never treated as done; it backs off at `:138-140`. - `retired` posts to `/coordinator` with `op: retired` (`:152-158`). That path is covered by main's tunnel forwarding of `/api/fleet/replicas/`. - `observe` (`replicacoordinator.go:152`) only logs the state change and records it in a map. - **Wiring order.** `runAgent` binds admission at `agent.go:599`, before the replica worker at `:696`. The worker makes console calls only. Launches still go through the gated activator. ### Census table The chain at 1c96ee8e is main's 83 lines byte-for-byte and in order, plus one line, `plan14-root-reads-stateless-replicas-2.tsv 59c08916…`, last. Its parent is main's last overlay, `stateless-coordinator-route` (7974cb07…). For each unit I counted read sites by kind and checked merged = 38cda89 + the branch's approved delta. All five match exactly. | unit | class | verdict | reason (file:line) | |---|---|---|---| | `internal/host/agent.go` `fastTick` | legacy (body) | APPROVE | `agent.go:3001`. Adds only the replica worker `tick()` signal ahead of main's box-role reader. Sites: 1 `registry:Host` on main, branch and merge. No new path or input. | | `internal/host/agent.go` `runAgent` | authority B,C,D,F | APPROVE | `agent.go:243`, worker at `:696` after admission at `:599`. Sites equal main's (one `whole:Route`, because main moved the boot `List` into `runWorkerBootPassAfterAdmission` at `:832`). The branch adds no read. It uses the operator unit env `CARLOS_TUNNEL_URL`/`TOKEN` and the data dir, already approved. Nothing tenant-writable is opened. | | `internal/activator/activator.go` `Service.doWakeOnce` | legacy | APPROVE | `activator.go:2773`. Pure `ErrFenced` refusal on `rt.FleetBoxes`. Main's p3a admission checks are kept. Sites: main + 1 `registry:FleetBoxes`. No path, store or exec. | | `internal/activator/cmd.go` `Service.RunCmd` | legacy | APPROVE | `cmd.go:972`. The exec-gate wrapper around `askExecGate` and `CheckReplicaAssignment` follows main's `tenantStartRefusal`. Sites: main + `FleetBoxes` + 1 `whole:Route`, the same delta e9cd5fc7 approved. | | `internal/activator/cmdunit.go` `ExecBackend.StartCmd` | legacy | APPROVE | `cmdunit.go:466-473`. The gate is rechecked, then admission, then dispatch. Sites: main + 1 `registry:FleetBoxes`. No new path or credential. | - **Record writes.** No inventory entry was re-digested and none needed to be. `stateless_placement_census_test.go` is unchanged by the merge. Main changed no record-write census file or inventoried writer since f18da984, and the existing keyed, CAS'd and locked entries are carried as approved. - **Focused tests.** I ran `TestPlan14RootReadCensus` and `TestPlan9B8RecordWriteCensus` with `TMPDIR=$TMPDIR`. Both pass. Census: APPROVED at 1c96ee8e. Seal `59c0891618b9befae27ebe04d0a67b08c7f7658bca9f1c78bf6d05eb7a708e82`. ### Verdict **Ready to land?** Yes. Two conditions first: CI must be green on 1c96ee8e, which nothing has run on yet, and someone must accept the 21 host test failures, which fail the same way on unmodified main.</result> <usage><subagent_tokens>78706</subagent_tokens><tool_uses>27</tool_uses><duration_ms>270760</duration_ms></usage> </task-notification>
<task-notification> <task-id>bd4qc7qeh</task-id> <tool-use-id>toolu_01BpxqwG3vBMhjVMsz2GLioa</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/7c5a7d70-0e28-42b9-896c-5d73b2d2a05d/tasks/bd4qc7qeh.output</output-file> <status>completed</status> <summary>Background command "Wait for Plan 2's merge" completed (exit code 0)</summary> </task-notification>
<paseo-system version="1" kind="agent-message" source-agent-id="78223e69-0073-4772-bcd6-25641b472a31" message-id="ca9e8434-ab3b-42fa-ab4e-c824e0e0b61f" source-agent-title="Region HA P3a dev rollout (executing approved card)"> Region HA P3a dev window OPEN now (2026-11-04 ~07:50Z), executor 78223e6. Sequence: dev-only release v0.34.1 from main 38cda89 (dev boxes, then dev console), then the dev ingress NLB apply (new resources only), then CARLOS_GROUP_ADMISSION opt-in on leo then sophie with attended carlos-edge restarts (about 20-40 s of 503 + Retry-After on non-exempt tenant routes per box; the dev console is exempt but blips 1-2 s), then a short restart drill on each box. DEV CHANNEL FROZEN until I post "P3a window closed" on #421: please do not cut/promote any dev release, roll, restart carlos-edge, or edit host.env on sophie or leo until then. Log: ~/.cache/region-ha-next/p3a-log.md. Reply via paseo send 78223e6 if you have something in flight on dev. No action needed otherwise. </paseo-system>
<task-notification> <task-id>a6fe475fd15707786</task-id> <tool-use-id>toolu_01CKWQBPqKopVsMuvL6kpohp</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/7c5a7d70-0e28-42b9-896c-5d73b2d2a05d/tasks/a6fe475fd15707786.output</output-file> <status>completed</status> <summary>Agent "Plan 1 dev smoke (stateless)" finished</summary> <note>A task-notification fires each time this agent stops with no live background children of its own. The user can send it another message and resume it, so the same task-id may notify more than once.</note> <result>**PARTIAL.** The stateless runtime works on an ordinary platform box. On a customer fleet box, where every rootfs app on dev has to run, a `--stateless` release never deploys. | Step | Result | What happened | |---|---|---| | 1. Stateful version | PASS | Fleet rootfs app s1 and box binary app b1 both served and wrote SQLite. Each had a database file, Litestream copies in S3 and a `lock.json` lease. | | 2. `--stateless` version | FAIL on fleet, PASS on box | **Fleet r10r box-1:** s2 never took over. Every 15 s the box logs `release attempt onto s2 abandoned: replicas: fenced`, so s1 kept serving and the instance read "rolling out" for 14 minutes. **dennis-stenciling:** b2 served, confirmed by a GET with `x-carlos-version: b2` and no `--db` argument. | | 3. Nothing stateful in use (box) | PASS | No `CARLOS_DB` in the process environment and nothing holds the database files. Litestream stopped, and `lock.json` was removed and not taken again. The old database bytes were identical at 01:14 and 01:19. | | 4. Exercises | PARTIAL | `carlos run` passed, and so did an interactive session (`run -it`, Ctrl-D, exit 0). Workers were not tested: binary apps have none and the fleet copy never started. `carlos restart` was refused for a box that isn't the console's box, so I killed the smoke app's own process instead; it came back on the next request, still stateless. The failed release was a build that fails its health check (binary apps have no release command); the deploy stopped and b2 kept serving. | | 5. Refusals | PASS | The v0.34.0 CLI has no `--copies` flag. The Plan 2 CLI, built from this branch into scratch and since deleted, got `not found: check --account and --app, and that your token's address is a member` because the v0.34.0 console has no copies route. No other app changed. | | 6. Cleanup | PASS | Both instances deleted and both apps trashed (purge 2026-12-04). Both hosts now answer 503 and no smoke processes are left. Scratch is deleted except the evidence file. Parked data dirs, empty slices and S3 prefixes stay until the purge, as for other trashed apps. | **Departures from the brief:** - An unregioned box app can't be made on dev: every new app gets a region, and IE is HA. So the box half ran in region uk (dennis-stenciling). - Rootfs apps can only run on fleets, so the rootfs half ran on fleet r10r box-1. - Both apps used a small Go program I wrote, because no existing Rails sample boots without a database. - All box evidence was gathered read-only over SSM, apart from killing the smoke app's own process. **Findings:** - **F1 (blocker):** A fleet box asks the console for its coordinator lease by posting to the tunnel host (`CARLOS_TUNNEL_URL` + `/api/fleet/replicas/...`; `internal/host/agent.go:605`, `internal/host/replicacoordinator.go:81`). On that hostname the edge only forwards `/store/` to the console. Everything else goes to the tunnel hub, which answers 404 (`internal/edge/edge.go` around 1917-1928). The box treats the 404 as `replicas.ErrFenced`. A test POST supports this: the tunnel host's 404 lacks the `x-carlos-version` header the console sends, and the console box (sophie-knitting) logged nothing. So no stateless rootfs app can deploy on v0.34.0, though the old build keeps serving. The fix is to forward that path on the tunnel host to the console, or give the box the console's address, plus a test that goes through the real edge. - **F1b:** The stuck rollout tells the owner nothing. Logs repeat "starting build s2" and the list says "rolling out", with no failure or reason. - **F2:** `carlos restart --host` only works for instances on the console's box. This predates stateless replicas. - **F3:** `apps set --size small` on a fleet app was refused by checking dennis-stenciling's memory, a box the app can't run on. - **F4:** `apps create --place fleet/...` printed "Region: Dublin (IE), from your timezone". - **F5:** `instances list` shows a database size for the stateless instance; it is counting the old stateful files. - **F6:** The copies refusal reads as a wrong app or account name rather than "this console doesn't support copies yet". - **F7:** A "wake failed: its build could not be installed" line was logged before the first install finished. **Not covered until F1 is fixed:** stateless workers, a release command succeeding and failing, an always-on restart with no request, and the rootfs stateful-to-stateless switch. **Incident:** a mistyped shell step overwrote `go.mod` in the stateless-replicas-2 worktree. I restored it straight away with `git checkout -- go.mod` and the worktree is clean. Nothing was committed or pushed. Evidence file: `/home/paulca/.cache/sr-plan1-smoke/evidence.md`</result> <usage><subagent_tokens>194943</subagent_tokens><tool_uses>105</tool_uses><duration_ms>1394425</duration_ms></usage> </task-notification>
<paseo-system version="1" kind="agent-message" source-agent-id="335399d5-3ec5-4e92-ae37-08e6aaae74c8" message-id="c27c80ed-e990-4116-a70a-4fc854dcf3f0"> v0.34.0 is on every dev box and the dev console since 21:06:21Z (2026-11-03); Plan 1 dev smoke may run. Note (release agent, 00:58Z 11-04): carlos system status also shows a third box-1 row on canary at build 2fd703c6, 'behind -> v0.34.0', not part of this roll; if the console's floor check counts it, a stateless ship on canary may be refused until it updates. </paseo-system>
<task-notification> <task-id>bslva0ias</task-id> <tool-use-id>toolu_01FweW8qhg6YykXRo6mn1YEv</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/7c5a7d70-0e28-42b9-896c-5d73b2d2a05d/tasks/bslva0ias.output</output-file> <status>completed</status> <summary>Background command "Push, note re-seal on #280, wait for CI" completed (exit code 0)</summary> </task-notification>
<task-notification> <task-id>bk329bifb</task-id> <tool-use-id>toolu_01CDMHDWRL22rqt41cixsLSu</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/7c5a7d70-0e28-42b9-896c-5d73b2d2a05d/tasks/bk329bifb.output</output-file> <status>completed</status> <summary>Background command "Wait for merge 3" completed (exit code 0)</summary> </task-notification>
<task-notification> <task-id>a5b6e6fef2a4cd7ce</task-id> <tool-use-id>toolu_01XH8DPpPJZNzhw9eDwrdKxA</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/7c5a7d70-0e28-42b9-896c-5d73b2d2a05d/tasks/a5b6e6fef2a4cd7ce.output</output-file> <status>completed</status> <summary>Agent "Census review merge 2 (#280)" finished</summary> <note>A task-notification fires each time this agent stops with no live background children of its own. The user can send it another message and resume it, so the same task-id may notify more than once.</note> <result>| unit | class | verdict | reason (file:line) | |---|---|---|---| | chain `plan14-root-reads-chain.tsv` | chain | APPROVE | Every line of origin/main 6be08467 is kept byte for byte and in order: dropping the last line gives exactly main's file. `agent-start-demo-1.tsv` (6ef1e3bc…) is parent, the same bytes as on main. `stateless-replicas-2.tsv` 51b40fb5… is last (chain.tsv:80-81). | | `internal/host/agent.go` `runAgent` | body (authority) | APPROVE | A three-way merge of the function against base 0b3098cb gives exactly the merged body: main's demo wiring plus the branch's worker. No new read; still 6 sites. | | `internal/registry/registry.go` `Registry.Fingerprint` | body (legacy) | APPROVE | The union of both sides' columns in one SELECT, with the scan in the same order (registry.go:3972, 3996). The replica hash runs only when a replica field is set, and the demo hash stays main's. Same SQL on the box's own registry. | | `internal/registry/registry.go` `upsertRoute` | body (legacy) | APPROVE | Clean three-way union. Main's demo descriptor/owner guard and the branch's same-owner set-preservation CASE lines are both in the one statement. No new query. | | `internal/registry/registry.go` `routeArgs`, `scanRoute` | reads | APPROVE | 77 columns: routeCols has 77 names and `routeColCount = 77` (registry.go:1110, 1113). Args and scan follow routeCols order: replica columns, then demo columns (registry.go:1132, 1707). Data comes only from the box's own registry. | | `internal/registry/replicas.go` `Registry.setReplicaAssignment` | new (legacy) | APPROVE | The only merge change is an added `rt.IsDemo()` refusal (replicas.go:87). That is stricter, and it reads a column already in the row. | | `internal/registry/replicas.go` `Route.ValidReplicaProjection` | new (legacy) | APPROVE | Adds `!t.IsDemo()` (replicas.go:36). Stricter, no new input. | | `internal/registry/forward.go` `Registry.PutForward` | reads | APPROVE | Clean three-way union of main's demo fields and the branch's replica fields. No new read source. | | `internal/activator/activator.go` `Service.doWakeOnce` | reads | APPROVE | Clean three-way union. FleetBoxes is the only replica read, and it was already approved. | | `internal/activator/wakeidentity.go` `Service.currentWakeRoute` | reads | APPROVE | Main's demo identity check sits after the record read and before the replica branch (wakeidentity.go:248). The replica path also refuses demo rows and demo records (wakeidentity.go:252). The record source `f.Record` is unchanged, and the early return keeps main's behaviour for unassigned routes. Demo records are never turned into stateless instances. | | `internal/activator/wakeidentity.go` `leaseRouteChanged` | reads | APPROVE | Both fences are kept: replica set/revision/incarnation, and demo descriptor (wakeidentity.go:112-115). Both compare only registry rows. | | `internal/provision/forward.go` `forwardRowFor` | sites (legacy) | APPROVE | Main added this function. The merge adds `projectReplicaAssignment` next to main's `stampDemoRoute` (forward.go:43-44). It copies only from the record it is given; no external read. A record with both demo and replica fields is refused at the shape gates (demo_policy.go:15, replicaassignment.go:47). | | `internal/provision/forward.go` `forwardCurrent` | reads | APPROVE | Equality is the union of main's demo terms and the branch's replica terms. It still requires `InertForward()` (forward.go:55). | | `internal/provision/reconcile.go` `RouteFor` | sites (authority) | APPROVE | Projection and stamping are kept side by side (reconcile.go:605-606). Paths are still derived from the host, not read from the record. | | `internal/provision/reconcile.go` `convergeOwned` | reads | APPROVE | Main's demo guard stays first. It now also refuses a demo record with a replica assignment or an existing FleetBoxes value (reconcile.go:892), which accounts for the read count going from ×3 to ×4. The branch's typed seed/set/clear calls follow, unchanged. | | `internal/provision/reconcile.go` `Reconcile` | reads | APPROVE | In the retire loop, both sides' `continue` guards are kept: the branch's replica guards, then main's demo retain at reconcile.go:2405. They only keep rows. Everything else auto-merges with no new read. | | `@coverage` envelopes (activator, host, provision, registry, release) | envelope | APPROVE | I diffed 6be08467→35f932b9 against the approved 0b3098cb→f96b76e9, excluding tests and testdata. host and release are identical, so their envelopes moved only because of main's own changes. activator, provision and registry differ only by the demo-refusal lines cited above, the column unions and comments. That includes `SetRecordRegion`'s replica refusal and `validateDemoRecord` refusing an assignment (demo_policy.go:15). | | `@fields` | other | APPROVE | Only main's DemoExpiresAt, DemoHost, DemoID and DemoLifetime are added. | | record-write: `Reconcile` (dd8f231f…) | key-site | APPROVE | Same keys (ParseRecordKey, RecordKey, `instances`). The only addition is the demo retain `continue`; no new writer. | | record-write: `Server.reconcileReplicaFleet` (d0af3968…) | key-site | APPROVE | Adds only an early return for the configured demo fleet (replicaplacement.go:332). Writes still go through `placeReplicaRecord`, under the same app/fleet locks and ETag. | | record-write: `Server.registerCLIRoutes` (c98f3780…) | key-site | APPROVE | Main's version plus the branch's single person-only copies route (`svcrole.Set{}`). No record writer added. | | record-write: `Server.createRecordMarkedLocked` (635e680f…) | record-writer | APPROVE | The branch's entry now targets main's locked helper instead of bringing back the removed wrapper entry (demo_census_test.go:9). The helper is main's body plus the copies name lock and admission, both placed after the demo reservation and before marks or `CreateRecord`, and it returns the admitted record (hostsused.go:658-694). The wrapper still takes the app lock, then the hostname lock (hostsused.go:651-655). | | record-write: `Server.createRecordWithLifetimeLocked` (6aa90509…) | key-site | APPROVE | Copies name lock, then main's demo reservation, then the existing lifetime check before copies admission, all before allocation (lifetimes_create.go:64-). | | record-write: field preservation | — | APPROVE | `SetRecordReplicaAssignment` is keyed by identity, holds `WithAppMutation`, and is fenced by RecordSeq and revision through `updateRecord`, a whole-record read-modify-write (replicaassignment.go:73-). `WriteRecord` runs both `replicaFieldsFixed` and `demoFixed`, before and after sequencing (record_sequence.go:143-146, 174), so main's demo fields survive the branch's replica writers. Demo records are refused at replica admission (replicaassignment.go:47). | No root read now opens, runs, queries or follows a path or input that a tenant, app or box agent can create, write or name. Every merge-touched unit combines two already-approved bodies (main's demo half and the branch's replica half), and the resolutions only add refusals. I re-ran `go test ./internal/provision -run 'TestPlan14RootReadCensus$|TestPlan9B8RecordWriteCensus$'` at 35f932b9 and it passed. I made no changes; the worktree is clean and my scratch files are removed. Census: APPROVED at 35f932b9. Seal 6ef1e3bc1dbacd5b548b1cbfe3a6d37bd5f701e03969feef2736212ee11713df → 51b40fb5e2478f2023bd5f50faa87691273bc0cc70e6d63dbb5ec4f68a8c98ff.</result> <usage><subagent_tokens>125723</subagent_tokens><tool_uses>42</tool_uses><duration_ms>365293</duration_ms></usage> </task-notification>
<task-notification> <task-id>aa4d99c645ccdf748</task-id> <tool-use-id>toolu_015myENFr7u4Yb9uFLLoQd9R</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/7c5a7d70-0e28-42b9-896c-5d73b2d2a05d/tasks/aa4d99c645ccdf748.output</output-file> <status>completed</status> <summary>Agent "Review merge 2 resolution" finished</summary> <note>A task-notification fires each time this agent stops with no live background children of its own. The user can send it another message and resume it, so the same task-id may notify more than once.</note> <result>### Findings **Critical:** none. **Important:** none. **Minor** - `internal/registry/registry.go:4298-4306`: the comment on `snapshotWhenSetCols` keeps the branch's wording plus "and demo identity strings". Main's rewritten wording ("Default values digest exactly as before these columns existed…") was dropped. The meaning survives in the branch text, so this is documentation only. Fix: optional. - `internal/activator/wakeidentity.go:112-115`: in `leaseRouteChanged`, the replica-field case now comes before main's demo-descriptor case. A row whose replica and demo fields both change returns the bare `errRouteChangedUnderLease` rather than main's demo message. That can only happen on a mixed row, which is refused anyway. Fix: none needed. - `internal/console/appcopies.go:128-135`: for counts above one, `copiesRefusal` now also runs `demoMutationRefusal`, which reads the store (`AppLife`). If that read fails, the caller gets a 503 DEMO-CHECK-FAILED. It never runs at count 1, so apps that don't use copies are unaffected. Fix: none needed. ### Checked and clean Method: I took each side's `-U0` changed lines (from merge base `0b3098cb` to each parent) and compared them against the merge's diff from the other parent, for all 22 files both sides touched. - **No differences at all (0/0):** `activator/activator.go`, `console/apicli.go`, `apiinstanceseed.go`, `apiinstances.go`, `authcli.go`, `fleetbox.go`, `fleetrelabel.go`, `fleets.go`, `lifetimes_create.go`, `server.go`, `recordcreators_guard_test.go`, `host/agent.go`, `registry/forward.go`. - **`activator/wakeidentity.go`:** both lease fences are kept. The demo record check now runs before the replica block, and the replica block also refuses demo routes and records. For a demo route (no `FleetBoxes`, no assignment), the path from lease to single-box recheck matches main exactly. - **`activator/activator.go` (unchanged against both sides):** the branch's `FleetBoxes != "" → ErrFenced` check runs before `Acquire` and only fires when a set is present, so it never touches demo wakes. Main's `localDemoLease` check, `restoreDemoLocal` and escrow's `IsDemo` exclusion are intact. Demo wakes also require `Hibernate`, and set rows require it off, so the two can't overlap. - **`console/hostsused.go`:** main's wrapper/locked-helper split is kept. The copies name lock, demo reservation and then copies check all run before the regional/first-kind/owned rechecks, the mark and `CreateRecord`. The helper returns `&rec`. The name lock does nothing for the demo publisher, which carries no copies admission, so there is no deadlock. - **`console/lifetimes_create.go`:** name lock, then demo reservation, then lifetime check, then copies check, all before `admit` and allocation. - **`console/store.go`:** the rebuild carries `copies_configured`, `copies_dirty` and `demo_id`, and keeps the lifetime mint expression. - **`provision/forward.go`, `provision.go`, `reconcile.go`:** - Both stamping functions run (`projectReplicaAssignment`, then `stampDemoRoute`). - `forwardCurrent` compares both families of fields. - `Record` carries both `Demo` and `ReplicaAssignment`. - `convergeOwned` refuses mixed demo/set state before any replica convergence. - In the retire loop, the branch's guards only `continue`, so main's skip for demo rows on fleet workers still applies. - **`registry/registry.go`:** - `routeCols`, `routeColCount` (77), `scanRoute` and `routeArgs` all match in order. - The `Upsert` conflict arm keeps main's `demo_*=excluded` assignments and its immutability WHERE guard, plus the branch's keep-when-zero CASEs. - The route fingerprint hashes `demo=` and `replicas=` only when they are set. - The snapshot fingerprint hashes `demo_id/host/lifetime` only when set, `demo_expires_at` only when non-zero, and `copies` and `replica_revision` in the pair set. - **Census files:** - `plan9_b8_census_test.go`: the placement inventory is layered on `demoWriteCensusInventory`. - `plan14-root-reads-chain.tsv`: main's lines are kept and the placement overlay is regenerated last. - Five record-write digests were refreshed, each with a merge note. - **Changes the merge added beyond the conflicts:** - `appcopies.go`: refuses demo app, account and fleet for counts above one, and refuses demo records. - `copiespublication.go`: refuses `rec.Demo` and the demo fleet's region. - `replicaplacement.go`: the placement pass skips the demo fleet. - `replicaassignment.go`: the shape check refuses `Demo`. - `demo_policy.go`: refuses `ReplicaAssignment`. - `registry/replicas.go`: `ValidReplicaProjection` and `setReplicaAssignment` refuse `IsDemo`. - None of these change anything when copies are 1 and there is no assignment. - **Replica writers vs demo columns:** `setReplicaAssignment` and `ClearReplicaAssignment` are targeted UPDATEs that leave the `demo_*` columns alone. `ReplaceReplicaAssignment` requires `next.ValidReplicaProjection()`, which now refuses demo rows. Nothing drops demo columns. - **Q2, reachability:** today these demo refusals are a backstop. Demo apps already hit `demoMutationRefusal` on every non-GET door before any copies route, and `ReplicaApps` needs an explicit count above one. The backstop does cover a demo fleet when demo admission is off, and an ordinary multi-copy app later placed onto the demo fleet. - **Q5, inertness:** with no copies config and no assignment, every new guard is gated on a count above one, a non-empty `FleetBoxes`, a non-nil `ReplicaAssignment` or `Demo`. Both fingerprints hash nothing extra. Behaviour matches main `6be08467`. - **Q6, test waits:** the test edits are `stateless_assignment_test.go` (two new cases), `TestCopiesRefusesDemoAppsAndFleets`, `TestReplicaPlacementSkipsDemoFleet`, `TestReplicaAssignmentRefusesDemo`, `TestReplicaAssignmentRefusesDemoRoute`, and two signature changes in the demo tests. None waits, polls or sleeps. - **Focused run:** I ran `go test ./internal/registry ./internal/provision -run 'TestReplicaAssignmentRefusesDemo|TestPlan9B8RecordWriteCensus|TestPlan14RootReadCensus'`, and both packages passed. The Go cache was writable. ### Verdict **Merge resolution:** Clean. It is a correct union: nothing from either side is dropped, demo records and fleets are kept out of replica sets at every layer, and apps that don't use copies behave as on main.</result> <usage><subagent_tokens>110897</subagent_tokens><tool_uses>21</tool_uses><duration_ms>206806</duration_ms></usage> </task-notification>