| new file mode 100644 |
| index 000000000..cf052a245 |
| --- /dev/null |
| +++ b/docs/superpowers/notes/census-agent-start-demo-1-claims.md |
| @@ -0,0 +1,96 @@ |
| +# Recovered Task 9 CLAIMS from the generated agent-start-demo-1 overlay. |
| +# Original TMPDIR/task9-77jHY5 scratch was removed at Task 9 cleanup. |
| +internal/activator/activator.go:Service.doWakeOnce Reads IsDemo and demo admission/capability state; chooses local lease retention, skips seed upload and sidecar selection. Existing stop and under-lease ordering retained. |
| +internal/activator/backend_exec.go:ExecBackend.HasSidecar Reads IsDemo and returns false before the sidecar env stat. |
| +internal/activator/backend_exec.go:ExecBackend.Restore Reads IsDemo before seed/HA/replica restore and dispatches marked routes to restoreDemoLocal. |
| +internal/activator/backend_exec.go:ExecBackend.Seed Reads IsDemo and refuses before seed work. |
| +internal/activator/backend_exec.go:ExecBackend.SeedExe Reads IsDemo and refuses before staged seed verification or execution. |
| +internal/activator/demo_durability.go:ExecBackend.restoreDemoLocal Agent-process unit. Reads the regular local DB and bounded demo-init-pending proof through instancefs, assignment marker and superseded evidence. Writes pending state durably before metadata GET/PUT; only confirmed remote absence grants retry proof bound to demo ID and assignment. Resumes interrupted initialization, then durably removes pending state before permitting start. No replica or snapshot reads. |
| +internal/activator/demo_durability.go:Service.demoWakeRefusal Reads claims mode, existing hook/identity capability and configured FleetWake fields; refuses unsupported demo wake paths before work. |
| +internal/activator/demo_durability.go:demoDataShape Reads route descriptor and durability/runtime/assignment fields and current time; calls exported demo.ValidateBinding for structure, not signed-policy authority. |
| +internal/activator/demo_durability.go:demoRecordMatches Compares the already-read record descriptor, identity, placement and durable shape with the route. |
| +internal/activator/demo_durability.go:retainDatabase Reads IsDemo and the optional localDemoLease capability; ordinary replication interval selection unchanged. |
| +internal/activator/escrow.go:ExecBackend.escrowEligibleAt Reads IsDemo and excludes marked routes before escrow eligibility. |
| +internal/activator/hafiles.go:ExecBackend.openHostFiles Reads IsDemo and refuses before opening the HA files store/publisher. |
| +internal/activator/hasecrets.go:ExecBackend.haHostNow Reads IsDemo and local shape before remembered HA state or record queries. |
| +internal/activator/hawake.go:ExecBackend.acquireClassified Reads demo shape/layout and takes the existing legacy renewing lease for demos; never falls through to HA acquisition. |
| +internal/activator/hawake.go:ExecBackend.isHA Reads IsDemo and local shape; demos do not read HA lifetime/record state. |
| +internal/activator/rootfsdb.go:ExecBackend.PlaceRootfsDB Retains rootfs-only admission and delegates the existing placement reads to placeEmptyDB. |
| +internal/activator/rootfsdb.go:ExecBackend.placeEmptyDB Moved placeholder implementation: same nested path checks, private empty SQLite creation, no-follow temp opens, identity/content reads and no-replacement rename; now shared by demo initialization. |
| +internal/activator/size.go:SizedLimit Reads Route.IsDemo before ordinary size selection; returns the existing small table row for any demo marker. |
| +internal/activator/stateless.go:Service.storageMode Reads IsDemo and the resolved storage declaration on every return; refuses demo stateless transitions without changing ordinary declaration reads. |
| +internal/activator/wakeidentity.go:Service.currentWakeRoute Agent-process unit. Compares demo identity/shape whenever either the route or its already-read record carries demo identity; refuses mismatches before restore or replication. No extra record request. |
| +internal/activator/wakeidentity.go:leaseRouteChanged Agent-process unit. Compares DemoID, DemoHost, DemoLifetime and DemoExpiresAt in the existing under-lease route reread; any change refuses the wake before restore. No additional I/O. |
| +internal/demobuild/bundle.go:checkBundle Reads no-follow manifest/version/files, stat ownership/modes/link counts and directory inventory; hashes exact bytes and compares the module lock digest. |
| +internal/demobuild/job.go:NewJobID Newly root-reachable; reads crypto/rand, not a path. |
| +internal/demobuild/lock.go:ReadLock Newly root-reachable; reads and validates the supplied bounded lock reader. |
| +internal/demobuild/purge.go:Worker.PurgeDemo Reads root-owned seen/job-ID marker and scratch existence; checks demo/box/job binding before existing stop/cgroup/unmount cleanup. Fix round 1: also requires the job marker host to match the purge host; no new file reads. |
| +internal/demobuild/runner.go:Run Consumes only its private root-prepared invocation, proves stop, then no-follow reads bounded diagnostics/output beneath that job. |
| +internal/demobuild/runner.go:ValidateOutput Reads bounded bytes, ELF header/program headers and computes their SHA-256; never executes output. |
| +internal/demobuild/security_linux.go:mountedAt Reads fixed /proc/self/mountinfo; uncertainty prevents deletion. |
| +internal/demobuild/security_linux.go:verifyWorkMount Reads filesystem type/capacity and mount presence for a root-derived work path. |
| +internal/demobuild/source.go:ValidateSource Newly root-reachable Task 2 unit; reads bounded compressed/archive/source bytes and the trusted lock; validates without extracting or executing. |
| +internal/demobuild/stdlib_linux_arm64.txt:external Embedded Go 1.26.10 linux-arm64 standard-library import allowlist generated from the pinned toolchain; trusted validation data, not tenant input. |
| +internal/demobuild/toolchain.lock.json:external Embedded Rastrillo v0.30.2 dependency closure with Go pin and module hashes; operator-generated lock constrains submitted source and bundle verification. No fetched lock. |
| +internal/demobuild/unit.go:Worker.assertUnit Reads effective sandbox, resource, environment and bind properties; missing or mismatched properties refuse compiler start. |
| +internal/demobuild/unit.go:Worker.prepareUnit Cleanup now has its own five-second context; stop, empty-cgroup and unmount gates remain unchanged. |
| +internal/demobuild/unit.go:Worker.recover Enumerates root state; processes validated job/attempt names only and retains unrelated files. |
| +internal/demobuild/unit.go:emptyBuildCgroup Reads only the derived cgroup.events path; absent directory or populated 0 proves termination. |
| +internal/demobuild/unit.go:var systemctl Executes fixed /usr/bin/systemctl with a scrubbed fixed environment and bounded output; callers supply platform-derived unit names and fixed operations for offline build supervision. |
| +internal/demobuild/worker.go:NewWorker Wires existing root-owned recovery into cleanup retry; existing bundle/root reads unchanged. |
| +internal/demobuild/worker.go:Worker.Build Holds the build/purge read lock through cleanup; existing bounded source read remains. |
| +internal/demobuild/worker.go:Worker.expireMarkers Checks that corresponding job scratch is absent before removing an expired ownership marker. |
| +internal/domains/reconcile.go:firstReadyUpstream Reads IsDemo on the already-listed routes and refuses an automatic canonical/canary source for that app. |
| +internal/edge/demo.go:Edge.demoRouteOK Reads route identity, demo descriptor, placement, runtime, paths, assignment and current time; refuses unsupported/mismatched/expired demo routes and ordinary routes on the reserved fleet/account. |
| +internal/edge/demo.go:Edge.filterDemoRoutes Reads the already-listed routes and constructed upstream map; prevents aliases, prefix overrides and unmarked socket-sharing routes from reaching demos. |
| +internal/edge/demo.go:Edge.lookupDemoAware Reads the current map and config; reserved names require an exact eligible route rather than a catch-all. |
| +internal/edge/edge.go:Edge.Reload Checks demo route eligibility and filters the final folded map using the existing registry listing; no new registry or store query. |
| +internal/edge/edge.go:RunWithActivatorReady Logs the combined explicit wildcard parents through demoWildcardDomains; no new watcher or read loop. |
| +internal/edge/wildcard.go:newWildcardFromEnv Includes the configured demo domain in the existing wildcard manager's explicit parent input. |
| +internal/host/agent.go:runAgent Passes the existing registry, data store and hibernation prefix into the demo worker; no alternate data store. |
| +internal/host/bootstrap.go:bootstrapWith Uses demo settings from the existing host.env parser; refuses malformed demo config and installs the fixed template drop-ins. |
| +internal/host/claimstop_run.go:RunInstanceControl Wires demo registry views and existing root release/adoption guard into instance control. |
| +internal/host/claimstop_run.go:instanceDemoPurgeGuard Uses existing root release/census state and adopt-pass lock before root deletion. |
| +internal/host/claimunit.go:claimUnitContent Demo-only ReadWritePaths for instance data/runtime, staged files and root release lock; ordinary rendering unchanged. |
| +internal/host/claimunit.go:readClaimUnitSettings Reads worker/concurrency/toolchain settings from the existing host.env parser; requires box mode and refuses claims coexistence. |
| +internal/host/demo_cleanup.go:demoWorker.retireDemo Agent reads signed receipt, matching tombstone and registry binding; holds route, invokes root, acknowledges and removes only its remote initialization marker. |
| +internal/host/demo_jobs.go:demoWorker.pickupHTTP Reads a bounded console pickup response; no bucket write or caller-selected execution input. |
| +internal/host/demo_policy.go:demoDisabledFor Reads startup box configuration and the activator-held Route.IsDemo marker in memory, then the existing disabled-route predicate. Refuses a marked ordinary-box route without querying the registry. |
| +internal/host/demo_policy.go:demoPolicyHook Returns the original hook unchanged outside explicit demo mode, including nil: no registry read or new spawn refusal. In demo mode reads the route by host and the existing verified policy cache before the original hook. |
| +internal/host/demo_policy.go:demoRouteGate Reads startup box/claims configuration and the caller-held route plus existing verified policy cache. Covers backend acquisition/probe preparation through ConfigGate without a new registry or bucket read. |
| +internal/host/demo_policy.go:installDemoUnitsIn Reads the same fixed drop-in files in demo mode. Outside demo mode removes the same two fixed managed filenames; ENOENT is silent, other removal errors are logged and retried next pass without aborting ordinary installation or skipping the second file. Successful removal still signals daemon-reload. Enabled-demo read/write failures still refuse. |
| +internal/host/demo_units/demo.conf:external Retains read-only /run and /var tmpfs overlays and all network/size restrictions. Resets InaccessiblePaths and restates /etc/carlos -/run/carlos-control so the hidden control directory need not exist during namespace setup; /etc/carlos remains required. No new source or bind. |
| +internal/host/systemapply.go:systemApplier.installUnits Renders the staged build slice against live root host configuration; preserves it when settings cannot be parsed. |
| +internal/host/systemunits.go:ensureSystemUnits Body unchanged; consumes the enlarged embedded file list through the existing root installer. |
| +internal/host/units/carlos-demo-build@.service:external New dynamic-UID compiler execution path with fixed argv, root-derived mounts, no network and bounded resources/termination. |
| +internal/host/units/carlos-demo-builds.slice:external New aggregate compiler budget; inert until a build service uses it. |
| +internal/instancectl/demo_build.go:Client.DemoBuildReadiness Reads bounded root readiness and verifies capability, slots, digest and service build identity. |
| +internal/instancectl/demo_cleanup.go:Server.purgeDemoWithJobs Checks root config and current registry identity/hold; reads derived unit/cgroup/exe/drop-in state, stops and proves emptiness before no-follow removal. Fix round 1: passes the descriptor host to the root build-scratch cleaner; same registry, cgroup and derived path reads. |
| +internal/instancectl/demo_policy.go:Server.demoCgroup Reads memory.max, cpu.weight, cpu.max and io.weight beneath root cgroupfs using platform-generated slice/unit names; checks both slice and unit before reporting started. |
| +internal/instancectl/demo_policy.go:Server.demoHandler Serializes demo starts with purge and refuses missing/non-demo/held current routes. |
| +internal/instancectl/demo_versions.go:Server.purgeDemoVersions Derives account/app from root config and host; reads registry/live/generation pins and staged entries; deletes only unreferenced demo app files. Fix round 1: logs and skips ENOENT resolving another live link; other errors still refuse, same pin and symlink reads. |
| +internal/instancectl/gen.go:Server.handleParent Reads fixed DemoBox and clamps the existing parent memory writer to small. |
| +internal/instancectl/rootfs.go:Server.runRootfsProbe Reads DemoBox and refuses before preparing or launching a rootfs probe; ordinary probe behavior unchanged. |
| +internal/instancectl/server.go:runWithClaim Wires root-owned demo config and existing fixed paths into the service. |
| +internal/instancectl/server.go:type Server Adds fixed demo configuration, registry views, derived runtime root, synchronization and purge guard. |
| +internal/instancectl/size.go:Server.handleSize Reads fixed DemoBox and clamps the existing live CPU/IO writer to small. |
| +internal/provision/demo_policy.go:PolicyCache.AssertDemoRoute Reads route identity/runtime/placement, box configuration and verified cache entry under its mutex; refuses absent/expired/mismatched policy with no store request. |
| +internal/provision/demo_policy.go:stampDemoRoute Copies public descriptor fields from the already-read record into the route; no new external read. |
| +internal/provision/forward.go:forwardCurrent Reads the four demo route fields when deciding whether the forward row needs rewriting. |
| +internal/provision/forward.go:forwardRowFor Copies the public descriptor into a forward row; no new external read. |
| +internal/provision/reconcile.go:Reconcile Keeps local demo rows for signed cleanup instead of deleting the binding on record absence or trash; normal/hub paths unchanged. |
| +internal/provision/reconcile.go:RouteFor Reads the record descriptor, carries it onto the route, and gives demos nested paths; no new external read. |
| +internal/provision/reconcile.go:convergeOwned Compares existing route descriptor to record descriptor before any ordinary convergence; refuses identity loss or change. |
| +internal/provision/reconcile.go:shapeMismatch Compares all four demo identity fields before adoption, including partial or removed identity. |
| +internal/registry/demo.go:Route.IsDemo Reads all four public descriptor columns; a partial descriptor remains marked and cannot select ordinary activation. |
| +internal/registry/forward.go:Registry.PutForward Reads and carries the four demo fields in the existing forward INSERT; the guarded conflict SQL refuses downgrade or identity change. |
| +internal/registry/forward.go:var putForwardSQL Adds the same descriptor-preservation guard to the existing forward statement; no new SQL read source. |
| +internal/registry/registry.go:Registry.Fingerprint Existing SELECT reads four more demo columns; only a marked row adds them to the hash, so ordinary hashes remain unchanged. |
| +internal/registry/registry.go:Registry.SnapshotFingerprint Includes demo identity only when nonzero; preserves ordinary snapshot digests. Same registry query, no new OS read. |
| +internal/registry/registry.go:routeArgs Reads the four additive demo fields for the existing route INSERT binding. |
| +internal/registry/registry.go:scanRoute Reads the four additive demo columns in the existing row scan. |
| +internal/registry/registry.go:upsertRoute Existing SQL now compares all four demo columns plus account/app to refuse downgrade or identity change, including partial markers; no new query. |
| +# Delta copy pass, 2026-11-03: after removing approved-string draft markers, |
| +# make census-card reports only the internal/demobuild source envelope. |
| +# internal/demobuild/diagnostics.go changed its approval comment in 3247de43; |
| +# copy text and comments only, no new reads. No changed reader needs a new claim. |