docs(events): Phase 6 as built — enablement, caps and mayInvoke #214
Reference in New Issue
Block a user
No description provided.
Delete Branch "docs/events-phase-6"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The docs half of Event System Phase 6. Code: RunicGateway/website#188.
EVENTS.md§D — the two tables arrive.
event_action_settingsandevent_run_budgetmove from "arrive with the phase that gives them a writer" to built, each with the fact that is not obvious from its column list. A missing settings row is not "disabled" — it is the default for the action's risk class, computed rather than stored, and nothing is seeded at boot because registration runs against a dead pool (MODULE_API §2.2), so a seed of one row per registered action would be exactly the write that forbids. A NULL cap is uncapped and still a row, which is what lets the meter count a dimension nothing bounds while a missing row keeps its one meaning: a step spending something its own run's version never priced.event_versionsgainsverified_at/verified_by, with the note on why two writable columns do not break an immutable table — they describe something that happened to the version rather than changing the plan reviewed, which is also why a pass recorded against one stays true for ever.The
refusedrow in the lifecycle table now says what a refusal does, not only what it means: the same disposition a failure takes, and a different status and log kind, so an operator reading a stopped run at two in the morning can tell "raise the cap" from "the shard did not answer" at a glance.§E — a new subsection, Enablement and caps, in front of every dispatch. Where the check sits and why (after the claim, before the dispatch), the retry that does not pay twice and the failure that gets no refund, the partial spend across dimensions that is unwound, the budget seeded from every phase at creation rather than growing as phases are entered, the tightest cap and why
nullnever wins a minimum, and the one place a demoted user's access deliberately is not re-checked. The concurrency row for caps gains Phase 5's lesson applied rather than rediscovered: the guard must stay in theWHERE, because MariaDB evaluates aSETlist left to right.§K — the amendment, and it is the substantive one.
Then
mayInvokeas built: whyusermay be null and what that means, whyrunmay be null and how the cap question changes, why the cap check can write, why the role floor lives in the model rather than in route middleware (the route isadmin, editorand stays that way — which of the two you have to be depends on the body), why an unpriceablecost()is refused rather than free, and the example-pricing stand-in untilregisterEventBudgetslands in Phase 7 — stated with its limit rather than as a design.The shard's own switches are now written down as named and deliberately not duplicated in core: a second copy of that decision could disagree with the shard about whether the shard is accepting writes, and naming the layer is what stops it being re-implemented.
§I, §L, § API surface, § Observability. The switchboard screen and the dry run marked built, each with the thing that makes it more than a form — the board says whether a row is a decision or a default, a cap may only name a dimension the action actually spends, and the run console's meter is shown on finished runs too. §L gains the disabled-action row and the held-occurrence row beside the cap row. The API surface loses two of its three absent routes and gains the note on why findings come back with a 200 and why the whole-plan cost check is the one finding no other path can make. Observability gains the three new log kinds and the run's fourth derived field.
The phase table. P6 ticked.
EVENTS_PLAN.mdPhase 6 marked complete, in the shape Phases 0–5 use: the four org-lead decisions, the two derived calls flagged for review, the three things the build settled, the one thing this phase deliberately cannot demonstrate with a module (
registerEventActionsis Phase 7's seam, so the cap machinery ships with no live consumer — proved by tests and by a rig action reverted before commit), the two defects the live walk found, the verified numbers and the walk itself.Phase 6's own body text corrected in two places where it no longer matched what shipped: the default-off line, and the
WHEREclause, which now carriescap IS NULL. One clause added on what P6 actually contributed to the role split — P3 had already gated every route, so what landed here is the two new routes' gates and the one gate that could not live in middleware.Checked by hand
docshas no CI, so: every anchor this touches resolves (#k--security-modeland#f--the-module-contractwere already in use;#e--runtime-modelis new and takes the same form), and every route, column, env var and file path named here exists on website#188. Diff is 151/23 and 118/2 across the two files with no CRLF artefact, verified against the real content diff rather than--numstatalone.