carlos / platform Public

Ledger · demo-moved-capability

Human

<task-notification> <task-id>biomy00ht</task-id> <tool-use-id>toolu_01JJaPqsvAujbmwByD1YzWfc</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/22215d20-2b53-4378-8426-ae55e2362d13/tasks/biomy00ht.output</output-file> <status>completed</status> <summary>Background command "cat &gt; $TMPDIR/diag.txt &lt;&lt;'EOF' From agent-start-demo-3 controller. Diagnosis of "no edge advertises demo-moved-v1". Everything was read-only. I read host.env and journals over SSM on sophie, leo and demo box-1, and control/edges/* and status/boxes/* from the dev bucket. Nothing was changed. There are two causes. One is a code fault (A). The other is a missing setting, but setting it changes edge behaviour (B). A third item is env the group members will need. A. CODE FAULT, edges file (sophie, leo). The moved capability can never get in. - internal/host/edgesfile.go:1211 computes edgesFileCapabilities(os.Getenv) once, when the loop starts. :1226 freezes it as baseCaps. Each pass (:1289) re-adds only the offline and db-read capabilities to baseCaps. - edgesfile.go:211 adds demo-moved-v1 only if armedDemoMovedReader is already true. - That flag is set later, inside fastConvergeLoop (agent.go:3538), after its deploy store and key setup. edgesFileLoop starts concurrently (agent.go:1053 vs 1025). - The journals show "edges file loop armed" in the same second as "change index armed" (sophie 02:08:33, leo 02:16:11). The edges loop wins the race, so the capability stays out for the life of the process. - control/edges/sophie-knitting.json and leo-climbing.json carry demo-claim-seed-v1 but not demo-moved-v1. Their CARLOS_CHANGE_INDEX=read and CARLOS_DEMO_DOMAIN=dev.trycarlos.com are both fine. - Fix: recompute the moved capability on every pass. Add `if movedCapable(os.Getenv) { caps = append(caps, MovedCapability) }` beside :1289, the same way withOfflineCapability is applied, and drop it from the frozen baseCaps. Needs a test where the reader arms after the loop starts. This is a release change (v0.34.11). A restart alone will not reliably fix it, because the race is lost each time. B. HEARTBEAT (status/boxes metrics). The edge readiness check needs PLATFORM_APPS_DOMAIN. - internal/edge/demo_moved.go:16-18: DemoMovedReady requires staticPub, a valid Demo.Domain AND a valid e.appsDomain. e.appsDomain comes from PLATFORM_APPS_DOMAIN (edge/cookiescope.go:69-70). - No dev box sets it. sophie's status metrics capabilities are ['demo-claim-seed-v1'] only. - The console requires both the heartbeat and the edges-file capability (console/demo_claim_moved.go:45-48). - Option B1, config: set PLATFORM_APPS_DOMAIN=&lt;the dev console's apps domain&gt; in host.env on every edge (sophie, leo, dennis) and in the group SSM env. It can ride a restart. But on the edge it also turns on apps-domain wildcard cert handling and warming (edge.go:4713, :4726) and cookie scoping (cookiescope.go:132). Check that with 8a3d302 first. - Option B2, code, which I recommend: drop the e.appsDomain requirement from DemoMovedReady, and make the edge's MovedDomains check (demo_moved.go:31) accept any valid one-label app host. The console already derives and signs the target from its own AppsDomain (demo_claim_moved.go). A small change that can ride with A in v0.34.11. C. HA group members (g-f848…, g-ffc9…). They also publish edges files, and readiness checks every edges file. - They currently lack demo-claim-seed-v1, and after A they would also lack demo-moved-v1. - Their group SSM env needs CARLOS_DEMO_CLAIM=1, CARLOS_DEMO_DOMAIN=dev.trycarlos.com, CARLOS_CHANGE_INDEX=read, plus PLATFORM_APPS_DOMAIN if you take B1. Not a fault: demo box-1 has CARLOS_FLEET=demo. A fleet box never arms the change index (changeindex.go:57-60) and publishes no edges file (edgesfile.go:1172), so it is correctly absent from the edges snapshot. It reports the moved capability on the demo stream instead (demo_serving.go:76-79, which needs only the registry and release key). Summary: claims cannot turn on until A is released. With B2 in the same release, no new env is needed on the platform boxes. The group members still need the env in C. I can build A+B2 on a short branch the same way as the last one if you say go. EOF paseo send 39e7acfa "$(cat $TMPDIR/diag.txt)" 2&gt;&amp;1 | tail -1; rm $TMPDIR/diag.txt" completed (exit code 0)</summary> </task-notification>

Human

<paseo-system version="1" kind="agent-message" source-agent-id="39e7acfa-a56a-470b-8ef5-70de5c57a6f2" message-id="18465c40-0186-40e0-a29f-8facfa4faf2d" source-agent-title="agent /start demo program controller"> From 39e7acfa: one addition to demo-moved-capability (8a3d302&apos;s ruling). HA group members serve only their named pool (hapair on dev, ha on the US flagship), never shared or demo traffic, and they get no demo env. So claim readiness must count only edges that can serve demo traffic: shared-pool, public-ingress edges. Group/named-pool members are excluded from the claim-seed, moved and seeds-protocol/prev-slot checks (demoClaimSeedReady, demo_claim_moved.go, and wherever else every edges file is required). Use the existing signal that marks an edge as named-pool or group-only. Don&apos;t invent a new one. If there&apos;s none in the edges file, tell me before adding one. Tests: a named-pool edge without the capabilities doesn&apos;t block readiness, and a shared edge without them still does. Ask the reviewer to check that no edge that can actually serve a demo or claimed destination is excluded. Same landing rules; send me the sha. </paseo-system>

Human

<task-notification> <task-id>bdos188nw</task-id> <tool-use-id>toolu_01AS9ucHPe2HsoR7H7mCpRb8</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/22215d20-2b53-4378-8426-ae55e2362d13/tasks/bdos188nw.output</output-file> <status>completed</status> <summary>Background command "paseo send 39e7acfa "demo-moved-capability: building A + B2 + the shared-pool scope now (Astra). Signal used for scope: edgesfile ServesSharedPool (json serves_shared_pool, internal/edgesfile/snapshot.go:64-69). Dev publishes false on the group members and true on sophie. My ruling: exclude an edge from the claim checks only when serves_shared_pool is explicitly false. Absent (an older writer) still counts, so it fails closed. I am NOT using accepts_inbound, because a shared-pool box without public ingress can still host a claimed destination. Readiness also requires at least one counted edge. Will send the sha after review and green CI." 2&gt;&amp;1 | tail -1" completed (exit code 0)</summary> </task-notification>

Human

<task-notification> <task-id>bj1h1lks4</task-id> <tool-use-id>toolu_01LgEzeZpkUqJMm147PzHteb</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/22215d20-2b53-4378-8426-ae55e2362d13/tasks/bj1h1lks4.output</output-file> <status>completed</status> <summary>Background command "S=$HOME/.cache/agent-start-demo-3-moved; until [ -f $S/done ]; do sleep 30; done; tail -1 $S/log" completed (exit code 0)</summary> </task-notification>

Human

<task-notification> <task-id>bespiyicu</task-id> <tool-use-id>toolu_014p92rTNQXZP9Z7b28f7GS3</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/22215d20-2b53-4378-8426-ae55e2362d13/tasks/bespiyicu.output</output-file> <status>completed</status> <summary>Background command "sleep 60; until ! amadan ci status carlos/platform -branch demo-moved-capability 2&gt;&amp;1 | head -1 | grep -q 'running\|queued\|pending'; do sleep 60; done; amadan ci status carlos/platform -branch demo-moved-capability 2&gt;&amp;1 | head -3" completed (exit code 0)</summary> </task-notification>

Human

<task-notification> <task-id>a580c1b57f4854ccf</task-id> <tool-use-id>toolu_0123Wa44EqVUagoNo9t9YAGN</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/22215d20-2b53-4378-8426-ae55e2362d13/tasks/a580c1b57f4854ccf.output</output-file> <status>completed</status> <summary>Agent "Review demo-moved-capability" 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>## Review of demo-moved-capability at tip 5a08b7f4 (round 1 of 3) I found no P1 and no P2, so under the stopping rules this review stops here. Three P3s go on the follow-up list. The focused tests pass, run with the default Go cache: `internal/democlaim`, `internal/edge -run TestDemoMoved`, `internal/host -run TestDemoMoved`, `internal/console -run 'TestDemoClaim(Readiness|Seed|Moved)|TestDemoMoved|TestSeedRegionReady'`, and `internal/provision -run 'TestPlan14RootReadCensus|TestCensusScopeIsTheRootBinary'`. ### 1. B2: relaxed target check - **Who writes the snapshot.** The `demo_moved_snapshot` row (registry.go:4567-4597) is written only by `installDemoMoved` (host/demo_moved.go:60-84). That function is fed from the bucket's `control/demo-moved.json` (demo_moved.go:45-58) and from the demo stream (demo_jobs.go:535-536). Before the compare-and-swap it verifies the wire with `VerifyMoved(pub, wire)` and checks monotonicity against the verified previous wire. - **The edge verifies again before serving.** It does not trust the agent's check. `loadDemoMoved` (edge/demo_moved.go:20-46) re-runs `VerifyMoved(e.staticPub, wire)` on every `Reload` (edge.go:858). `staticPub` is `CARLOS_RELEASE_PUBKEY` (edge.go:4841-4857, 614-616). - It drops the whole snapshot if any row fails `MovedEdgeDomains`. - It keeps the monotonic check against what it already held. - Only then does it `Store` the map. - `serveDemoMoved` reads only that map (lines 51-56), so nothing unsigned or partly verified reaches it. A bad pubkey length makes `VerifyMoved` fail. - **What the relaxation widens.** Nothing for an attacker without the signing key. `SignMoved` has one caller, the console (demo_claim_moved.go:138), and that path still applies `MovedDomains(appsDomain)` and `TargetHost == apexHost(acct, app)` (lines 119, and transfer.go:659). - The prefix `carlos demo moved v1\n` contains a space and a newline, so the other release-key signers, which sign raw base64, cannot produce a matching message. - The target is constrained by `ValidDomain` to `[a-z0-9-.]` and is only placed in an html/template `href`. The edge never fetches or follows it. - The new test signs malformed payloads directly, so it really exercises the receiver's check (port, path, scheme, uppercase, demo-domain target, two labels, unsigned, wrong key). - **An edge with no demo domain still serves nothing.** `MovedEdgeDomains` returns false when `!ValidDomain(demoDomain)`, so nothing is stored. `serveDemoMoved` also gates on `demoHost`, which needs `ValidHost(host, e.demo.Domain)` (demo.go:140-142). `DemoMovedReady` still needs the key and a valid demo domain. ### 2. C: shared-pool filter - **Which boxes count.** - `serves_shared_pool` comes from `poolServed(cfg.Pools, "")` (reconcile.go:3471-3488 via edgesfile.go:1098-1110). That is the same config `edgesFileServedPools` uses (1413-1426), so a named-pool box that also serves `""` publishes true and counts. - Older writers that omit the field count (`nil`). - A box publishing false cannot mint an ordinary instance, so it can never host the claimed destination. - **Other regions.** dennis-style boxes in another region still face the protocol, rollback, floor and heartbeat loops, which are not region-filtered (demo_claim_seed.go:53-66, 79-81). The region-filtered check is in `seedRegionReadyForEdges`. - **Demo fleet boxes.** These publish no edges file and are already covered by the source worker's stream readiness, `ready.MovedCapability` (demo_serving.go:76-78, demo_claim_transfer.go:49, demo_claim_ready.go:61). - **The helper is the only rule, applied everywhere.** `demoClaimEdge` (demo_claim_ready.go:14-16) is applied at all four readiness loops over edges files: demo_claim_moved.go:48, demo_claim_seed.go:41, 53 and 79, and through seedfloor.go:77. Each loop requires at least one counted edge. Ordinary seed operations pass `nil` and keep the region-wide scope, and the test asserts this. ### 3. A: per-pass capability The capability needs all four of: a valid `CARLOS_DEMO_DOMAIN`, `CARLOS_CHANGE_INDEX=read`, `armedChangeWatch != nil` and `armedDemoMovedReader` (edgesfile.go:214-221). The reader flag is set only after the watch exists and the reader is built (agent.go:3535-3538). So the capability cannot be advertised before both are armed. `baseCaps` is cloned and not changed. ### Findings - **P3. The test does not cover the loop wiring.** - Where: internal/host/demo_moved_test.go:100-146, against edgesfile.go:1296. - Scenario: `TestDemoMovedRequiresWatch` tests `withDemoMovedCapability` directly. If the call were hoisted back above the `for now := range tick.C` loop, so it is computed once at start, every test would still pass. So "arming after loop start" is not tested at the loop. - Fix: add a source-shape guard like haplacement_wiring_test.go:44 that asserts the call sits inside the loop, or drive one loop pass after arming. - Fault family: published capabilities must reflect live armed state. - **P3. Arming alone does not make a rewrite due.** - Where: edgesfile.go:1286-1296. - Scenario: `dueWithRole` keys on the registry fingerprint and role, not on capabilities. A reader that arms after start is advertised only on the next timed pass (5-6 min) or the next registry change. This matches how offline-move-1 and db-read-1 behave today, so it is not a regression. - Fix, optional: fold the capability set into the change key. - Fault family: same as above. - **P3. "Serves the shared pool" stands in for "receives demo-host traffic".** - Where: demo_claim_ready.go:14-16. - Scenario: a named-pool-only edge that has `CARLOS_DEMO_DOMAIN` set but no armed reader, and that receives demo-domain traffic, would show no notice after the source is purged. This is a lost notice, not a trust breach. An edge without a demo domain cannot serve demo routes at all (`demoRouteOK` needs `demoHost`, demo.go:154). I could not settle from the repo whether dev's HA members receive demo traffic. - Fix, as a follow-up: publish demo-domain participation in the edges file and filter on that, or note the assumption in the comment. - Fault family: readiness set must equal serving set. ### 4. Census (card: docs/superpowers/notes/census-proposal-demo-moved-capability.md) The card has 0 units with a new disposition and 3 envelopes re-pinned. The seal is unchanged (`ebeaa693…` → `ebeaa693…`), and the census tests pass at the tip. - **Envelope `internal/democlaim`: APPROVED.** The only change is the new `MovedEdgeDomains` (moved.go:109-121), a pure check that reads nothing. It loosens the target suffix check, but root relies on the signature, which is unchanged in `VerifyMoved` (63-78). The target only ever becomes an `href` and is never opened or followed. - **Envelope `internal/edge`: APPROVED.** `DemoMovedReady` drops the apps-domain requirement but keeps the key and demo-domain checks. `loadDemoMoved` keeps its registry read, signature verification, monotonic check and fail-closed handling of the whole snapshot (demo_moved.go:16-46). There is no new read, and nothing a tenant, app or agent writes gains any power. - **Envelope `internal/host`: APPROVED.** `withDemoMovedCapability` reads the existing env and atomic flags (edgesfile.go:214-221). `edgesFileLoop` now calls it once per pass (1296). There is no new filesystem, registry or network read, and the publication destination is unchanged. ### Verdicts - **Code: READY** at 5a08b7f4. The three P3s go on the follow-up list. - **Census: APPROVED** at 5a08b7f4 for all three envelopes.</result> <usage><subagent_tokens>104442</subagent_tokens><tool_uses>36</tool_uses><duration_ms>482707</duration_ms></usage> </task-notification>