census: plans 4c (units decision overlay, census-propose card)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4 files changed,
+79
−0
docs/superpowers/notes/census-proposal-plans-4c-box-throttle.md+45 −0internal/provision/testdata/plan14-root-reads-chain.tsv+2 −0internal/provision/testdata/plan14-root-reads-plans-4c-box-throttle.tsv+17 −0internal/provision/testdata/plan14-root-reads-plans-4c-units.tsv+15 −0
diff --git a/docs/superpowers/notes/census-proposal-plans-4c-box-throttle.md b/docs/superpowers/notes/census-proposal-plans-4c-box-throttle.md| new file mode 100644 |
| index 000000000..aab2351f0 |
| --- /dev/null |
| +++ b/docs/superpowers/notes/census-proposal-plans-4c-box-throttle.md |
| @@ -0,0 +1,45 @@ |
| +# Census approval: plans-4c-box-throttle |
| + |
| +Ruling `census-ruling-plans-4c-box-throttle`. Every change below keeps the disposition it already has, so it needs an approval, not a decision. |
| + |
| +| unit | change | read sites | what changed | |
| +|---|---|---|---| |
| +| `internal/activator/activator.go` `type Service` | body | unchanged (0) | gains the maxRunFor hook field beside idleFor (plans 4c). No read added. | |
| +| `internal/console/store.go` `Store.migrate` | body | unchanged (2) | adds the additive account_plans.throttle column (plans 4c). No read added. | |
| +| `internal/edge/edge.go` `Edge.ServeHTTP` | body | unchanged (22) | calls planThrottleAdmit before the rate limit on the serving path, and on an upgrade planUpgradeAdmit plus trackUpgrade (plans 4c); the new reads live in those units (plans-4c-units decision). The same read sites here. | |
| +| `internal/host/agent.go` `runAgent` | body | unchanged (5) | arms svc.SetMaxRunFor(planMaxRunFor) beside SetIdleFor, and e.SetPlanThrottleFor(planThrottleFor) plus the planAwakeThrottled close hook beside SetRateCeilingFor (plans 4c). No read added. | |
| +| `internal/host/plans_pass.go` `plansPass` | body | unchanged (3) | keeps each account's published throttle from its limits record in the cache beside its limits, and tells planAwakeThrottled when an account first becomes awake-throttled (plans 4c). The same bucket objects; no read added. | |
| +| `internal/activator/activator.go` `Service.sweepOnce` | sites | +whole:Route | after the worker max_run branch, stops a non-worker entry past the plans continuous-awake ceiling (maxRunFor, passed the row), busy or not, never mid-command (plans 4c). One more whole-row read: the row handed to the hook, as idleFor already is. | |
| + |
| +Envelopes re-pinned: `internal/activator`, `internal/console`, `internal/edge`, `internal/host`, `internal/plans`. |
| + |
| +Review: a model from the other family than the author reads the branch's diff against main on the amadan.net remote (`origin` or `amadan`, whichever points at amadan.net) and gives a verdict for every unit and every re-pinned envelope above. For a unit, compare the change with its recorded disposition and basis below; for an envelope, read every changed function in the package and what it reaches. Escalate if the change lets root open, run, query or follow anything it did not before from a path or input a tenant, an app or a box agent can create, write or name; if it weakens a check, refusal, validation, argument or environment the basis relies on; or if the diff cannot settle either. Otherwise approve. Record each verdict on #280 with the tip. An escalation goes to the census owner as a decision. |
| + |
| +Recorded dispositions, which each change must still satisfy: |
| + |
| +- `internal/activator/activator.go` `type Service`: authority, task B,C,D,F,J4. Basis: rev3=PROPOSED-seed; existing activator lifecycle and due-wake state plus owned seed exclusion and incarnation-keyed diagnostics; normal refusal and preparation ordering remain authoritative; PROPOSED-plans-2-box-limits adds the idleFor hook field, which only narrows idle windows |
| +- `internal/console/store.go` `Store.migrate`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J4;basis=root-input;rev3=PROPOSED-email-signin;identity=the console (cmd/console serve under console.service, user carlos-console);basis=adds the sessions.method column (default keymail, the backfill) and calls migrateEmailSignin; SQLite DDL on CONSOLE_DB; the existing site moves;rev3=census-ruling-plans-4-notices-grace;basis=calls migratePlanGrace last, which creates the console's own plan_cap_state table (plans 4a). No read added here; the new store units are the plans-4a-store decision. |
| +- `internal/edge/edge.go` `Edge.ServeHTTP`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-seeded-instances;basis=the edge inside the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): main's body with the import gate checked after the door's scope and a gated row left out of the response cache; serving only;rev3=census-ruling-edge-request-records;basis=one more call in the observer defer, observeRecords(up.route, ...), passing on the route the defer already holds; no new kind of read;rev3=census-ruling-design-edge-rate-limit-358;basis=calls rateAdmit twice, and an admitted request holds a slot on both paths: on the upgrade path before the activator or proxy (the handshake holds its slot through slotWriter, given back at the first final answer or at the reverse proxy's hijack on a 101, so an open WebSocket is not counted; released by a defer), and on the ordinary path after the response-cache check and before the activator and proxy (an admitted request holds a slot through slotWriter, released by a defer); a refusal is a 429 written there and returns; the upgrade path's comment now names slotWriter as its one wrapper; one comment on the door mark reworded; read sites unchanged (22: main's 21 plus edge-request-records' observeRecords pass of the route), offsets moved; no read added |
| +- `internal/host/agent.go` `runAgent`: authority, task B,C,D,F. Basis: rev3=census-ruling-seeded-instances;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): main's body with wireSeedPlacement called in the activator start's Configure step, before armMovesPass, and the startup sweep's result stored for the import rollback in Recover; read sites unchanged, offsets moved; main's B,C,D,F authority retained PROPOSED E46: captured claim selection and root journal mutation; root RPC outside service host exclusion; SQL/route data never grants root authority. Executing identity: service controller; root for inventory/retirement callbacks.;rev3=PROPOSED-325;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=passes the agent's log sink to armRunsPass; reads unchanged;rev3=census-ruling-db-region-forward-1;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=arms the db-reads loop (armDBReads) beside armRunsPass in the activator start's Configure step; reads unchanged, offsets moved; main's authority retained;rev3=PROPOSED-s3-change-index;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=arms the change index (armChangeIndex) and starts the record view's backstop loop before the loops that read through it, and hands the edge the watch loader (edge.WithChangeWatch); read sites unchanged at the same offsets;rev3=census-ruling-edge-request-records;basis=builds the edge request recorder against the existing log sink and data dir (newRequestRecorder, passed os.Getenv and time.Now) and starts reqrecLoop on a minute ticker; no read added;rev3=census-ruling-design-edge-rate-limit-358;basis=arms the edge's plan rate-ceiling hook, e.SetRateCeilingFor(planRateCeilingFor), right after EnableUsage; read sites unchanged (5), offsets moved; no read added |
| +- `internal/host/plans_pass.go` `plansPass`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=PROPOSED-plans-2-box-limits;basis=root-route; the agent's plans pass, serialised by its own mutex, reads its own routes' accounts and two bucket objects (the plans marker, each account's limits record) into a cache; planIdleFor only narrows the activator's idle window. No root decision. |
| +- `internal/activator/activator.go` `Service.sweepOnce`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=PROPOSED-seed;basis=census-ruling-FS-R6; registry remains legacy; PROPOSED-plans-2-box-limits: the sweep also narrows an entry's idle window to its account's plan idle through the SetIdleFor hook (never lengthens it; always-on workers and held probe entries are untouched; the hibernate, inflight and held-for-tick guards are unchanged). |
| + |
| +Seal: `e451c4d675d99778e80da0b4e175d568e72276d11041f84fcfd53d3bf25ebaaa` → `fa9363ccd028415b3286ac5367fc50594c218b9c0cb3cef9dd10fd49d1059717`. |
| + |
| +Overlay: `internal/provision/testdata/plan14-root-reads-plans-4c-box-throttle.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`. |
| + |
| +## Decision (hand-written, census-ruling-plans-4c-units) |
| + |
| +The plan throttle adds seven new units. Each is a new unit, so each is a decision. They have their own overlay, `internal/provision/testdata/plan14-root-reads-plans-4c-units.tsv`, chained just before this one (seal → `e451c4d6…`). Each is classed `legacy`/`accepted-legacy`, the same way as its sibling: |
| + |
| +| unit | sibling | what it does | |
| +|---|---|---| |
| +| `internal/console/accountplans.go` `Store.SetAccountThrottle` | `Store.SetAccountPlan` (J4) | stores the account's throttle on its own `account_plans` row and bumps the revision | |
| +| `internal/edge/planthrottle.go` `Edge.planThrottleOf` | `Edge.rateAdmit` | asks the throttle hook about an instance row; door, hop and tunnel callers are exempt | |
| +| `Edge.planThrottleAdmit` | `Edge.rateAdmit` | spends a token of the account's in-memory bucket; returns the rate limit's 429 | |
| +| `Edge.planUpgradeAdmit` | `Edge.rateAdmit` | refuses a new upgrade for an awake-throttled account | |
| +| `Edge.trackUpgrade` | `Edge.rateAdmit` | registers an upgrade under its account so it can be closed | |
| +| `internal/host/plans_pass.go` `planThrottleFor` | `planRateCeilingFor` | returns the account's published throttle while it is in force | |
| +| `planMaxRunFor` | `planIdleFor` | 15 minutes for an awake-throttled instance, else 0 | |
| + |
| +Every one of them only slows, shortens or closes what the account itself runs. None reads a path or value a tenant can name, and none grants anything. |
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv| index 57f37ea6e..169b87182 100644 |
| --- a/internal/provision/testdata/plan14-root-reads-chain.tsv |
| +++ b/internal/provision/testdata/plan14-root-reads-chain.tsv |
| @@ -25,3 +25,5 @@ plan14-root-reads-design-edge-rate-limit-358-decisions.tsv a067dcd9e32e6be2b7dd9 |
| plan14-root-reads-design-edge-rate-limit-358.tsv 0c4eabfe38e12b098285bdeb5ceb0b16e5333928f5b02e160a6b16b5fd9ce1e0 |
| plan14-root-reads-plans-4b-after-grace.tsv 0c4eabfe38e12b098285bdeb5ceb0b16e5333928f5b02e160a6b16b5fd9ce1e0 |
| plan14-root-reads-certwarm-wake.tsv 91204fcbc484343c03bd5ae69e3084055bc519a5b317e2ae3dc49880080764e2 |
| +plan14-root-reads-plans-4c-units.tsv e451c4d675d99778e80da0b4e175d568e72276d11041f84fcfd53d3bf25ebaaa |
| +plan14-root-reads-plans-4c-box-throttle.tsv fa9363ccd028415b3286ac5367fc50594c218b9c0cb3cef9dd10fd49d1059717 |
diff --git a/internal/provision/testdata/plan14-root-reads-plans-4c-box-throttle.tsv b/internal/provision/testdata/plan14-root-reads-plans-4c-box-throttle.tsv| new file mode 100644 |
| index 000000000..ba61b0bcd |
| --- /dev/null |
| +++ b/internal/provision/testdata/plan14-root-reads-plans-4c-box-throttle.tsv |
| @@ -0,0 +1,17 @@ |
| +# Census overlay plans-4c-box-throttle, written by census-propose (#369). census-ruling-plans-4c-box-throttle, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-plans-4c-box-throttle.md. |
| +# 5 body, 1 sites, 5 envelope: each changed unit re-frozen at its existing disposition with its claim appended. |
| +@legacy 46b871d05b4fb6fb8407e654f710bfb7b8cc4eff4d2437ba590868af7153825b internal/console/store.go Store.migrate legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=PROPOSED-email-signin;identity=the console (cmd/console serve under console.service, user carlos-console);basis=adds the sessions.method column (default keymail, the backfill) and calls migrateEmailSignin; SQLite DDL on CONSOLE_DB; the existing site moves;rev3=census-ruling-plans-4-notices-grace;basis=calls migratePlanGrace last, which creates the console's own plan_cap_state table (plans 4a). No read added here; the new store units are the plans-4a-store decision.;rev3=census-ruling-plans-4c-box-throttle;basis=adds the additive account_plans.throttle column (plans 4c). No read added. file:Exec@12017,file:Exec@18238 a976387d28e2b337252ca60039236a457fb99efedb6dda8c377ae30810618969 |
| +@legacy a05f00ade662b8e2faf3000592c1843452161a3f7f160a52278b19f195654fc3 internal/edge/edge.go Edge.ServeHTTP legacy accepted-legacy accepted-legacy;rev3=census-ruling-seeded-instances;basis=the edge inside the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): main's body with the import gate checked after the door's scope and a gated row left out of the response cache; serving only;rev3=census-ruling-edge-request-records;basis=one more call in the observer defer, observeRecords(up.route, ...), passing on the route the defer already holds; no new kind of read;rev3=census-ruling-design-edge-rate-limit-358;basis=calls rateAdmit twice, and an admitted request holds a slot on both paths: on the upgrade path before the activator or proxy (the handshake holds its slot through slotWriter, given back at the first final answer or at the reverse proxy's hijack on a 101, so an open WebSocket is not counted; released by a defer), and on the ordinary path after the response-cache check and before the activator and proxy (an admitted request holds a slot through slotWriter, released by a defer); a refusal is a 429 written there and returns; the upgrade path's comment now names slotWriter as its one wrapper; one comment on the door mark reworded; read sites unchanged (22: main's 21 plus edge-request-records' observeRecords pass of the route), offsets moved; no read added;rev3=census-ruling-plans-4c-box-throttle;basis=calls planThrottleAdmit before the rate limit on the serving path, and on an upgrade planUpgradeAdmit plus trackUpgrade (plans 4c); the new reads live in those units (plans-4c-units decision). The same read sites here. registry:Gate@13604,registry:Gate@13664,registry:Gate@13722,registry:Host@13707,registry:ImportGate@17599,registry:Kind@11787,registry:Kind@17570,whole:Route@10017,whole:Route@11790,whole:Route@12348,whole:Route@12443,whole:Route@12519,whole:Route@12563,whole:Route@13607,whole:Route@13667,whole:Route@13710,whole:Route@13725,whole:Route@15358,whole:Route@17573,whole:Route@17602,whole:Route@19483,whole:Route@9805 6c87faf01fddd84a6c42d74cf87a6d67bd03f47775a36d588c37bc26d85952f8 |
| +@legacy 1c79743a0774549ee9a2cd99a5352366846efb032c6bdd3ee78eafdaca75eb94 internal/host/plans_pass.go plansPass legacy accepted-legacy accepted-legacy;rev3=PROPOSED-plans-2-box-limits;basis=root-route; the agent's plans pass, serialised by its own mutex, reads its own routes' accounts and two bucket objects (the plans marker, each account's limits record) into a cache; planIdleFor only narrows the activator's idle window. No root decision.;rev3=census-ruling-plans-4c-box-throttle;basis=keeps each account's published throttle from its limits record in the cache beside its limits, and tells planAwakeThrottled when an account first becomes awake-throttled (plans 4c). The same bucket objects; no read added. registry:Kind@817,whole:Route@803,whole:Route@886 dddd6f55b1b502736e025bafffeffdbfabaa65b81b23e5534ff780f70490e3f6 |
| +@legacy f5f1bad6c12be3fc763f539b57a17f9076ff3770b5c09f4bc360bbfd17b51990 internal/activator/activator.go Service.sweepOnce legacy accepted-legacy accepted-legacy;rev3=PROPOSED-seed;basis=census-ruling-FS-R6; registry remains legacy; PROPOSED-plans-2-box-limits: the sweep also narrows an entry's idle window to its account's plan idle through the SetIdleFor hook (never lengthens it; always-on workers and held probe entries are untouched; the hibernate, inflight and held-for-tick guards are unchanged).;rev3=census-ruling-plans-4c-box-throttle;basis=after the worker max_run branch, stops a non-worker entry past the plans continuous-awake ceiling (maxRunFor, passed the row), busy or not, never mid-command (plans 4c). One more whole-row read: the row handed to the hook, as idleFor already is. registry:Hibernate@12971,registry:Hibernate@22142,registry:Hibernate@5124,registry:Hibernate@6794,registry:Hibernate@9319,registry:Host@22211,registry:Host@22269,registry:Host@22641,registry:Host@22734,registry:Host@23469,registry:Host@23551,registry:Host@24616,registry:Host@24795,registry:Host@24844,registry:NextDue@23424,registry:Status@22158,whole:Route@10074,whole:Route@12973,whole:Route@14906,whole:Route@16616,whole:Route@16806,whole:Route@17099,whole:Route@17271,whole:Route@17418,whole:Route@21629,whole:Route@23138,whole:Route@23478,whole:Route@23485,whole:Route@24431,whole:Route@24828,whole:Route@5126,whole:Route@6796,whole:Route@7230,whole:Route@9321 3180204acfaf05f0798b0e22bc2eda7e64b0375a4b1c1b62a09cd5c64fa7dab8 |
| +internal/activator/activator.go type Service authority B,C,D,F,J4 rev3=PROPOSED-seed; existing activator lifecycle and due-wake state plus owned seed exclusion and incarnation-keyed diagnostics; normal refusal and preparation ordering remain authoritative; PROPOSED-plans-2-box-limits adds the idleFor hook field, which only narrows idle windows;rev3=census-ruling-plans-4c-box-throttle;basis=gains the maxRunFor hook field beside idleFor (plans 4c). No read added. 88d6649cac4f1bc814ca926fb5e50fa0e6188b5b0c0ff5d13c0322d905aaa5ae |
| +internal/console/store.go Store.migrate legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=PROPOSED-email-signin;identity=the console (cmd/console serve under console.service, user carlos-console);basis=adds the sessions.method column (default keymail, the backfill) and calls migrateEmailSignin; SQLite DDL on CONSOLE_DB; the existing site moves;rev3=census-ruling-plans-4-notices-grace;basis=calls migratePlanGrace last, which creates the console's own plan_cap_state table (plans 4a). No read added here; the new store units are the plans-4a-store decision.;rev3=census-ruling-plans-4c-box-throttle;basis=adds the additive account_plans.throttle column (plans 4c). No read added. file:Exec@12017,file:Exec@18238 a976387d28e2b337252ca60039236a457fb99efedb6dda8c377ae30810618969 |
| +internal/edge/edge.go Edge.ServeHTTP legacy accepted-legacy accepted-legacy;rev3=census-ruling-seeded-instances;basis=the edge inside the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): main's body with the import gate checked after the door's scope and a gated row left out of the response cache; serving only;rev3=census-ruling-edge-request-records;basis=one more call in the observer defer, observeRecords(up.route, ...), passing on the route the defer already holds; no new kind of read;rev3=census-ruling-design-edge-rate-limit-358;basis=calls rateAdmit twice, and an admitted request holds a slot on both paths: on the upgrade path before the activator or proxy (the handshake holds its slot through slotWriter, given back at the first final answer or at the reverse proxy's hijack on a 101, so an open WebSocket is not counted; released by a defer), and on the ordinary path after the response-cache check and before the activator and proxy (an admitted request holds a slot through slotWriter, released by a defer); a refusal is a 429 written there and returns; the upgrade path's comment now names slotWriter as its one wrapper; one comment on the door mark reworded; read sites unchanged (22: main's 21 plus edge-request-records' observeRecords pass of the route), offsets moved; no read added;rev3=census-ruling-plans-4c-box-throttle;basis=calls planThrottleAdmit before the rate limit on the serving path, and on an upgrade planUpgradeAdmit plus trackUpgrade (plans 4c); the new reads live in those units (plans-4c-units decision). The same read sites here. registry:Gate@13604,registry:Gate@13664,registry:Gate@13722,registry:Host@13707,registry:ImportGate@17599,registry:Kind@11787,registry:Kind@17570,whole:Route@10017,whole:Route@11790,whole:Route@12348,whole:Route@12443,whole:Route@12519,whole:Route@12563,whole:Route@13607,whole:Route@13667,whole:Route@13710,whole:Route@13725,whole:Route@15358,whole:Route@17573,whole:Route@17602,whole:Route@19483,whole:Route@9805 6c87faf01fddd84a6c42d74cf87a6d67bd03f47775a36d588c37bc26d85952f8 |
| +internal/host/agent.go runAgent authority B,C,D,F rev3=census-ruling-seeded-instances;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): main's body with wireSeedPlacement called in the activator start's Configure step, before armMovesPass, and the startup sweep's result stored for the import rollback in Recover; read sites unchanged, offsets moved; main's B,C,D,F authority retained PROPOSED E46: captured claim selection and root journal mutation; root RPC outside service host exclusion; SQL/route data never grants root authority. Executing identity: service controller; root for inventory/retirement callbacks.;rev3=PROPOSED-325;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=passes the agent's log sink to armRunsPass; reads unchanged;rev3=census-ruling-db-region-forward-1;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=arms the db-reads loop (armDBReads) beside armRunsPass in the activator start's Configure step; reads unchanged, offsets moved; main's authority retained;rev3=PROPOSED-s3-change-index;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=arms the change index (armChangeIndex) and starts the record view's backstop loop before the loops that read through it, and hands the edge the watch loader (edge.WithChangeWatch); read sites unchanged at the same offsets;rev3=census-ruling-edge-request-records;basis=builds the edge request recorder against the existing log sink and data dir (newRequestRecorder, passed os.Getenv and time.Now) and starts reqrecLoop on a minute ticker; no read added;rev3=census-ruling-design-edge-rate-limit-358;basis=arms the edge's plan rate-ceiling hook, e.SetRateCeilingFor(planRateCeilingFor), right after EnableUsage; read sites unchanged (5), offsets moved; no read added;rev3=census-ruling-plans-4c-box-throttle;basis=arms svc.SetMaxRunFor(planMaxRunFor) beside SetIdleFor, and e.SetPlanThrottleFor(planThrottleFor) plus the planAwakeThrottled close hook beside SetRateCeilingFor (plans 4c). No read added. file:Exec@13802,file:Open@731,registry:App@10065,whole:Route@10057,whole:Route@23594 31c63c6150eb0d0099692257dcd7c46dd637cfbb6967ec76d552e461d229d038 |
| +internal/host/plans_pass.go plansPass legacy accepted-legacy accepted-legacy;rev3=PROPOSED-plans-2-box-limits;basis=root-route; the agent's plans pass, serialised by its own mutex, reads its own routes' accounts and two bucket objects (the plans marker, each account's limits record) into a cache; planIdleFor only narrows the activator's idle window. No root decision.;rev3=census-ruling-plans-4c-box-throttle;basis=keeps each account's published throttle from its limits record in the cache beside its limits, and tells planAwakeThrottled when an account first becomes awake-throttled (plans 4c). The same bucket objects; no read added. registry:Kind@817,whole:Route@803,whole:Route@886 dddd6f55b1b502736e025bafffeffdbfabaa65b81b23e5534ff780f70490e3f6 |
| +internal/activator/activator.go Service.sweepOnce legacy accepted-legacy accepted-legacy;rev3=PROPOSED-seed;basis=census-ruling-FS-R6; registry remains legacy; PROPOSED-plans-2-box-limits: the sweep also narrows an entry's idle window to its account's plan idle through the SetIdleFor hook (never lengthens it; always-on workers and held probe entries are untouched; the hibernate, inflight and held-for-tick guards are unchanged).;rev3=census-ruling-plans-4c-box-throttle;basis=after the worker max_run branch, stops a non-worker entry past the plans continuous-awake ceiling (maxRunFor, passed the row), busy or not, never mid-command (plans 4c). One more whole-row read: the row handed to the hook, as idleFor already is. registry:Hibernate@12971,registry:Hibernate@22142,registry:Hibernate@5124,registry:Hibernate@6794,registry:Hibernate@9319,registry:Host@22211,registry:Host@22269,registry:Host@22641,registry:Host@22734,registry:Host@23469,registry:Host@23551,registry:Host@24616,registry:Host@24795,registry:Host@24844,registry:NextDue@23424,registry:Status@22158,whole:Route@10074,whole:Route@12973,whole:Route@14906,whole:Route@16616,whole:Route@16806,whole:Route@17099,whole:Route@17271,whole:Route@17418,whole:Route@21629,whole:Route@23138,whole:Route@23478,whole:Route@23485,whole:Route@24431,whole:Route@24828,whole:Route@5126,whole:Route@6796,whole:Route@7230,whole:Route@9321 3180204acfaf05f0798b0e22bc2eda7e64b0375a4b1c1b62a09cd5c64fa7dab8 |
| +@coverage internal/activator 16c5cfa55eaf72198f6185406e0ab6fa95d7a9d9006cd89c87e28650b1992a6b |
| +@coverage internal/console 939232f35c7eb28793b6fbcc1a4c1c117f402f677960221e9af22df6e520465f |
| +@coverage internal/edge 102520ba4fa6783f2a0e2d9c9f86eadf28af677e630b8fd87a3bd4f461f71848 |
| +@coverage internal/host 9abbe344d6e32a02113775d7b9d9b69f354e76c26f689b52fdf7e599711cafbb |
| +@coverage internal/plans 69df5bdee2fff4d10a8ff01ba7d102f54ae1f9693fec3ac40506b80fb9805768 |
diff --git a/internal/provision/testdata/plan14-root-reads-plans-4c-units.tsv b/internal/provision/testdata/plan14-root-reads-plans-4c-units.tsv| new file mode 100644 |
| index 000000000..c3798a6d7 |
| --- /dev/null |
| +++ b/internal/provision/testdata/plan14-root-reads-plans-4c-units.tsv |
| @@ -0,0 +1,15 @@ |
| +# Census overlay plans-4c-units, written by hand: seven new units of the plan throttle (plans 4c), a decision. census-ruling-plans-4c-units; the card is docs/superpowers/notes/census-proposal-plans-4c-box-throttle.md. |
| +@legacy 9cff55a799d0e60ca9f87136ddacce145d9e906a708308e5241515caa81da999 internal/console/accountplans.go Store.SetAccountThrottle legacy accepted-legacy accepted-legacy;rev3=census-ruling-plans-4c-units;basis=root-input; console SQL on its own account_plans table, as its store siblings (J4); stores the account's plan throttle and bumps the revision the publish pass reads (plans 4c). file:Exec@259 ef845d77170669b221e19a6494f5a8f587ee966ae25425e2e7ff2912b0f29a5c |
| +@legacy 02fcb5127315bd985e99f0bee840a9e12a2a0782991461f467e3d9e92ec3bef5 internal/edge/planthrottle.go Edge.planThrottleAdmit legacy accepted-legacy accepted-legacy;rev3=census-ruling-plans-4c-units;basis=the edge inside the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos), serving only: spends one token of a throttled account's shared in-memory bucket keyed 'plan:'+release.RouteAccount(row) and writes the rate limit's 429; logs the row's host, throttled. Grants nothing (plans 4c). registry:Host@409,registry:Host@464,whole:Route@281,whole:Route@412,whole:Route@467 5e637b4c2c1bce9bef3df42a31ae13dac49f7d33a97f8b53aca334ab359c8bc9 |
| +@legacy 3d4c8b3684fb3838dadeaffe82b3f2bef7df3da18c572bfbf247f2b6016b494d internal/edge/planthrottle.go Edge.planThrottleOf legacy accepted-legacy accepted-legacy;rev3=census-ruling-plans-4c-units;basis=the edge inside the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos), serving only: asks the plan throttle hook (planThrottleFor, passed the row) whether an instance row's account is slowed down; door, hop-door and tunnel callers exempt as from the rate limit; reads only the row's kind (plans 4c). registry:Kind@129,whole:Route@132,whole:Route@353 0158379953353dcd65e108eb8168e55cb8fe4171ebc7ba1d63cb41b7999a2bd9 |
| +@legacy a854df0790e8b62dfb52b78adb349c9d929d0909612b49dbdca77fc8239c4403 internal/edge/planthrottle.go Edge.planUpgradeAdmit legacy accepted-legacy accepted-legacy;rev3=census-ruling-plans-4c-units;basis=the edge inside the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos), serving only: refuses a new upgrade for an awake-throttled account's instance row (the rate limit's 429), else planThrottleAdmit; logs the row's host (plans 4c). registry:Host@190,registry:Host@246,whole:Route@193,whole:Route@249 de8ab2d42da5e5f20f531d147cb1ac2322b132b29c97de45a80f75ede0695f97 |
| +@legacy e17a31415335ebc7adf91536b3fb3e721aa897edadf007d978659de9f8161cfe internal/edge/planthrottle.go Edge.trackUpgrade legacy accepted-legacy accepted-legacy;rev3=census-ruling-plans-4c-units;basis=the edge inside the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos), serving only: while a throttle hook is armed, wraps an instance row's upgrade request in a cancellable context registered under release.RouteAccount(row), so CloseAccountUpgrades can end it; reads only the row's kind (plans 4c). registry:Kind@120,whole:Route@123,whole:Route@208 6fa02cc9d7d09daa94d0d6d725d9852916d2ae52fdcbf41ffe44b492d6e40723 |
| +@legacy 5d88c05d4629f5bff8e2112acef89aa4aede8b28276bd324ce8307f43333c691 internal/host/plans_pass.go planMaxRunFor legacy accepted-legacy accepted-legacy;rev3=census-ruling-plans-4c-units;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos), as a hook armed in runAgent: planIdleFor's and planRateCeilingFor's twin, it reads the row's account (release.RouteAccount) and kind and the plans pass's in-memory cache; returns 15 minutes for an awake-throttled account's instance row, else 0, for the activator's continuous-awake ceiling. Only shortens; no root decision (plans 4c). whole:Route@84 66bab854b4d55d69b14dc3220bf42842e925054872848aff7644c1d0fd611256 |
| +@legacy 9e520471c29c0912e5b15071f0ea959411cc6f5d25970eb0c60ac948a9e2e387 internal/host/plans_pass.go planThrottleFor legacy accepted-legacy accepted-legacy;rev3=census-ruling-plans-4c-units;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos), as a hook armed in runAgent: planIdleFor's and planRateCeilingFor's twin, it reads the row's account (release.RouteAccount) and kind and the plans pass's in-memory cache; returns the account's published throttle while it is in force, for instance rows only. Only slows; no root decision (plans 4c). registry:Kind@69,whole:Route@256 e9d8aae73b5736f9d097d672e58442da5fbe993abf89d0747f12d4708fa22516 |
| +internal/console/accountplans.go Store.SetAccountThrottle legacy accepted-legacy accepted-legacy;rev3=census-ruling-plans-4c-units;basis=root-input; console SQL on its own account_plans table, as its store siblings (J4); stores the account's plan throttle and bumps the revision the publish pass reads (plans 4c). file:Exec@259 ef845d77170669b221e19a6494f5a8f587ee966ae25425e2e7ff2912b0f29a5c |
| +internal/edge/planthrottle.go Edge.planThrottleAdmit legacy accepted-legacy accepted-legacy;rev3=census-ruling-plans-4c-units;basis=the edge inside the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos), serving only: spends one token of a throttled account's shared in-memory bucket keyed 'plan:'+release.RouteAccount(row) and writes the rate limit's 429; logs the row's host, throttled. Grants nothing (plans 4c). registry:Host@409,registry:Host@464,whole:Route@281,whole:Route@412,whole:Route@467 5e637b4c2c1bce9bef3df42a31ae13dac49f7d33a97f8b53aca334ab359c8bc9 |
| +internal/edge/planthrottle.go Edge.planThrottleOf legacy accepted-legacy accepted-legacy;rev3=census-ruling-plans-4c-units;basis=the edge inside the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos), serving only: asks the plan throttle hook (planThrottleFor, passed the row) whether an instance row's account is slowed down; door, hop-door and tunnel callers exempt as from the rate limit; reads only the row's kind (plans 4c). registry:Kind@129,whole:Route@132,whole:Route@353 0158379953353dcd65e108eb8168e55cb8fe4171ebc7ba1d63cb41b7999a2bd9 |
| +internal/edge/planthrottle.go Edge.planUpgradeAdmit legacy accepted-legacy accepted-legacy;rev3=census-ruling-plans-4c-units;basis=the edge inside the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos), serving only: refuses a new upgrade for an awake-throttled account's instance row (the rate limit's 429), else planThrottleAdmit; logs the row's host (plans 4c). registry:Host@190,registry:Host@246,whole:Route@193,whole:Route@249 de8ab2d42da5e5f20f531d147cb1ac2322b132b29c97de45a80f75ede0695f97 |
| +internal/edge/planthrottle.go Edge.trackUpgrade legacy accepted-legacy accepted-legacy;rev3=census-ruling-plans-4c-units;basis=the edge inside the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos), serving only: while a throttle hook is armed, wraps an instance row's upgrade request in a cancellable context registered under release.RouteAccount(row), so CloseAccountUpgrades can end it; reads only the row's kind (plans 4c). registry:Kind@120,whole:Route@123,whole:Route@208 6fa02cc9d7d09daa94d0d6d725d9852916d2ae52fdcbf41ffe44b492d6e40723 |
| +internal/host/plans_pass.go planMaxRunFor legacy accepted-legacy accepted-legacy;rev3=census-ruling-plans-4c-units;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos), as a hook armed in runAgent: planIdleFor's and planRateCeilingFor's twin, it reads the row's account (release.RouteAccount) and kind and the plans pass's in-memory cache; returns 15 minutes for an awake-throttled account's instance row, else 0, for the activator's continuous-awake ceiling. Only shortens; no root decision (plans 4c). whole:Route@84 66bab854b4d55d69b14dc3220bf42842e925054872848aff7644c1d0fd611256 |
| +internal/host/plans_pass.go planThrottleFor legacy accepted-legacy accepted-legacy;rev3=census-ruling-plans-4c-units;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos), as a hook armed in runAgent: planIdleFor's and planRateCeilingFor's twin, it reads the row's account (release.RouteAccount) and kind and the plans pass's in-memory cache; returns the account's published throttle while it is in force, for instance rows only. Only slows; no root decision (plans 4c). registry:Kind@69,whole:Route@256 e9d8aae73b5736f9d097d672e58442da5fbe993abf89d0747f12d4708fa22516 |