docs(events): the step editor and event templates — MODULE_API 1.13.0
The contract half of website feat/event-step-editor (Rust PLAN_REDESIGNS §2): MODULE_API.md §1.1/§2.4 gain registerEventTemplates, a param's duration, a lease's example and an option's note; EVENTS.md §F (the note), §I (what the 1.13.0 editor settled) and the API surface (the templates route, draftAhead). PLAN_REDESIGNS §2.8 records the core half as built and the Module-uo proof. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
This commit is contained in:
@@ -1103,6 +1103,10 @@ visible warning rather than blocking the form. For module-uo it is answered enti
|
||||
atlas — offline, with the shard down. Without it the authoring UI in [§I](#i--admin-ui-authoring-and-the-calendar)
|
||||
is a JSON editor with better fonts.
|
||||
|
||||
**A row may carry a `note`** (MODULE_API 1.13.0): a sentence, at most 300 characters, that the editor
|
||||
shows under the field while that row is the chosen value — advice such as *"9 of 41 linked players
|
||||
have used this kit up"*. It is never a rule; the save path does not read it.
|
||||
|
||||
### Integration Kit
|
||||
|
||||
A fifth chapter, obeying the kit's own rule — teach and link out, re-specify nothing. The four things
|
||||
@@ -1342,6 +1346,43 @@ sent a term — so the one screen that picks a spawner was picking from a 2,000-
|
||||
`searchable`, never the length of the answer: inferring it from a short list reads correctly right
|
||||
up until the same source is a dropdown on one shard and a search box on another.
|
||||
|
||||
### What the step editor settled at MODULE_API 1.13.0
|
||||
|
||||
The first Rust player walk (`modules/rust/PLAN_FIXES.md` U-3–U-6, F11) found the Phase 13 form
|
||||
honest and hard to use, and `modules/rust/PLAN_REDESIGNS.md` §2 reworked it. Core-only and
|
||||
game-agnostic: Module-uo's steps get the new controls and nothing else.
|
||||
|
||||
- **A field is the thing it does.** No ` · int` tag and no bare asterisk; a required field says so in
|
||||
words, under itself and in the save's list, only once a save has been tried with it empty.
|
||||
- **A boolean is a toggle when required and three buttons — Not set, Yes, No — when optional**
|
||||
(Rust D334). The Phase 13 reason for a three-way control stands: "not set" is the action's own
|
||||
default, and a two-state control posts `false` for every field nobody touched.
|
||||
- **A choice of two or three is a row of buttons**, whether a lease's `values` or a source that
|
||||
answered with that few. The free-text box goes only while the source has answered and the value is
|
||||
one of its choices, so the §F rule — a source that cannot answer leaves a text box — still holds.
|
||||
- **`core.lease` is drawn as the chosen lease.** Picked by its label, then the value as the lease's
|
||||
type with its range or `values` and its own `example`, the target as a picker over the lease's
|
||||
`target.source` (`core.lease`'s own `target` param has no source, on purpose), and the minutes
|
||||
with the lease's longest hold beside them. The params written are still `core.lease`'s.
|
||||
- **A timed step keeps its run open** (U-6). A held thing is given back at teardown, when the RUN
|
||||
ends, so a 10-minute lease in a one-phase event with no advance rule lasted a second. A param
|
||||
that is a length of time says so (`duration: 'minutes'`). Adding or lengthening a timed step in a
|
||||
phase with no advance rule gives the phase `after: <the longest hold>`, on screen; a rule the
|
||||
author chose is never overwritten. Under any phase whose run can end sooner than its longest hold
|
||||
— counting every later phase's `after`, and nothing for a phase that waits on the game — the
|
||||
editor says when the hold is given back.
|
||||
- **Start asks when the draft is ahead** (U-5). A run is pinned to the published version, so an
|
||||
edit saved and not published did not run, silently. The definition read the editor loads carries
|
||||
`draftAhead` — the working spec compared with the published one as data, key order ignored — and
|
||||
the start dialog then asks: **Publish and start**, or **Start version N**, the published one. It
|
||||
does not choose: publishing moves scheduled occurrences too.
|
||||
- **A new event may start from a template** (Rust D192). A module's `registerEventTemplates` entry
|
||||
offers a few inputs; core checks them, the module builds a plan, core validates it as a spec and
|
||||
the editor opens it as an unsaved draft (`POST /admin/events/catalog/templates/:templateId`).
|
||||
Nothing records which template made a definition, and the runner never sees one.
|
||||
- **Core's own examples name no game** (Rust PLAN_REDESIGNS §0.9): `core.lease` offered
|
||||
`uo.rate.skillgain` and the announcements spoke of Britain and Cove to every deployment.
|
||||
|
||||
### Four affordances worth building in from the start
|
||||
|
||||
- **Dry run.** *(Built, Phase 6.)* Materialise the steps, dispatch each with `verify: true`, report what *would* happen
|
||||
@@ -1854,7 +1895,7 @@ no URL moved.
|
||||
| Route | Gate | |
|
||||
| --- | --- | --- |
|
||||
| `GET /admin/events` | staff | definitions, state, next occurrence, health |
|
||||
| `GET /admin/events/:id` | staff | one definition, working spec included — what the editor reads |
|
||||
| `GET /admin/events/:id` | staff | one definition, working spec included — what the editor reads. With **`draftAhead`** (MODULE_API 1.13.0): whether the working spec differs from the published version, so the start dialog can ask which to run. `PUT` and `publish` answer with it too |
|
||||
| `POST /admin/events` | admin, editor | create a draft |
|
||||
| `PUT /admin/events/:id` | admin, editor | edit the draft spec |
|
||||
| `POST /admin/events/:id/publish` | admin | snapshot a version and go `ready` |
|
||||
@@ -1871,6 +1912,7 @@ no URL moved.
|
||||
| `POST /admin/events/runs/:runId/steps/:stepId/skip\|retry\|confirm` | admin, moderator | Phase 3. `confirm` resolves a GM cue step; `retry` re-queues the step a paused run is stopped at and resumes it |
|
||||
| `POST /admin/events/runs/:runId/cleanup` | admin | re-run cleanup over unreverted resources (Phase 8). **`admin` rather than admin+moderator, unlike the seven live controls beside it**: this is not incident response, it asks core to write to the world again, which §K puts in the same row as the world-changing actions themselves. Legal on a TERMINAL run only — a run still in flight has a ledger that is still growing. It is the only thing that clears `revert_attempts`, and it answers **200 whatever it found**, for the dry run's reason: some resources may still be out there, and a 4xx would make that indistinguishable from a bad run id |
|
||||
| `GET /admin/events/catalog` | staff | registered actions, param schemas, risk classes, budget dimensions — and, since Phase 5, the **trigger** catalog and condition operators the advance form renders. Phase 7 added `budgets`, `leases` and `optionSources`: the other three registrations of the module contract, served beside the actions because the step editor needs all four to draw ONE step, and four requests to draw one form would be four chances to render half of it. Served here rather than borrowed from `/admin/engagement/triggers` because that route is `adminOnly` while a definition is authored by `admin` **and** `editor` |
|
||||
| `POST /admin/events/catalog/templates/:templateId` | admin, editor | **fill an event template in** (MODULE_API 1.13.0) — the body's `inputs` are checked against the template, the module builds a plan and core validates it as a spec. The answer is a `draft` (`title`, `summary`, `spec`) and **nothing is written**: the editor opens it and the author saves it through `POST /admin/events`. `400` for refused inputs, `404` for an unknown template, `502` when the module fails or builds a plan core cannot accept |
|
||||
| `GET /admin/events/catalog/options/:sourceId` | staff | **the values behind a param's `source`** (Phase 7) — resolved by the module that registered it, on its own request rather than inside the catalog, because a source can be slow or down and must not take the catalog with it. A refusal is a **`200` with `ok: false` and a `reason`**, deliberately: the field degrades to free text with a warning rather than the form breaking |
|
||||
| `GET /admin/events/series` | staff | the arcs a definition may belong to |
|
||||
| `POST /admin/events/series` | admin, editor | create an arc (Phase 4) |
|
||||
|
||||
Reference in New Issue
Block a user