|
| 1 | +--- |
| 2 | +"@objectstack/spec": patch |
| 3 | +--- |
| 4 | + |
| 5 | +chore(spec): govern the four `RestServerConfig` sub-objects in the liveness ledger (#14369) |
| 6 | + |
| 7 | +The `liveness/` ledgers ship inside this package's npm tarball (they are named in |
| 8 | +`files`), so this is a published-data change even though no runtime behaviour |
| 9 | +moves, no schema key changes spelling, and `packages/spec/src/api/rest-server.zod.ts` |
| 10 | +is not edited at all. |
| 11 | + |
| 12 | +Four new ledger files — `crud_endpoints.json`, `metadata_endpoints.json`, |
| 13 | +`batch_endpoints.json`, `route_generation.json` — classify all 32 authorable |
| 14 | +properties of `CrudEndpointsConfigSchema`, `MetadataEndpointsConfigSchema`, |
| 15 | +`BatchEndpointsConfigSchema` and `RouteGenerationConfigSchema`, the four |
| 16 | +`RestServerConfig` sub-objects a host writes when it constructs the REST server. |
| 17 | +They are enrolled through the gate's `SPEC_ONLY_SCHEMAS` override, the route |
| 18 | +`query` / `qa` / `manifest` already take: server configuration is neither a |
| 19 | +metadata item nor a request body nor a manifest, so no registry has ever held it |
| 20 | +and no ratchet rooted in one could ask who reads it. |
| 21 | + |
| 22 | +Seventeen properties are `live` with a symbol-anchored consumer and a producer |
| 23 | +pointer at the normalizer that threads the authored value into `this.config`. |
| 24 | +Fifteen are `dead` — the ten keys the census filed with this card measured, with |
| 25 | +the two container keys (`crud.patterns`, `routes.overrides`) expanded into a row |
| 26 | +per member. `routes` is dead entire: `excludeObjects: ['sys_log']` excludes |
| 27 | +nothing and `nameTransform: 'plural'` still mounts every route under the raw |
| 28 | +object name. `metadata.endpoints.schema` and `batch.operations.upsertMany` are |
| 29 | +switches for routes that were never built — no path ending in `/schema` is |
| 30 | +mounted anywhere in `packages/rest/src`, and the protocol has no `upsertManyData` |
| 31 | +counterpart to its three sibling batch methods. |
| 32 | + |
| 33 | +What this records, and what it deliberately does not. #11984 made |
| 34 | +`RestServer.normalizeConfig` PARSE and CONSUME these four sub-objects instead of |
| 35 | +casting them, so an out-of-enum or out-of-range value is now refused at |
| 36 | +construction. That settles accept/reject and nothing else: executing a declared |
| 37 | +contract does not give a key a consumer. No key is removed, enforced, deprecated |
| 38 | +or re-described here. The enforce-or-remove call per dead key (ADR-0049) is a |
| 39 | +follow-up on the human floor — the enforce route is a feature per key, and |
| 40 | +`routes.excludeObjects` is advertised in `RestServerConfigSchema`'s own |
| 41 | +`@example`, which makes its removal a capability retirement rather than a cleanup. |
| 42 | + |
| 43 | +Rooted on the four sub-schemas rather than on `RestServerConfigSchema` itself, |
| 44 | +which is measurement rather than taste: the ledger walk drills exactly ONE level, |
| 45 | +so with the whole config as the root the sub-objects would BE the drilled level |
| 46 | +and `metadata.endpoints.schema` / `batch.operations.upsertMany` would have no row |
| 47 | +of their own — their container's blanket `live` (three of four members gate a real |
| 48 | +route mount) silently covering a dead key, which is the #4956 shape in the file |
| 49 | +written to end it. `RestApiConfigSchema` (the fifth sub-object, `api`) is not |
| 50 | +enrolled: its consumption seam is still validate-only and is the subject of its |
| 51 | +own card, so a census of it would record a half that is about to move. |
| 52 | + |
| 53 | +<!-- adr-0087: not-required (no-migration-prescription) Nothing authorable is removed, renamed or re-described: this change adds ledger rows and a gate enrolment, and every key it classifies keeps the exact spelling, type, default and describe() it had. There is no source for `objectstack migrate meta` to rewrite, because no author's config becomes invalid or becomes valid as a result. --> |
0 commit comments