|
| 1 | +--- |
| 2 | +'@objectstack/skills': patch |
| 3 | +--- |
| 4 | + |
| 5 | +docs(skills): the objectstack-api entry file becomes a router |
| 6 | + |
| 7 | +Clause-②: no |
| 8 | +Metadata-protocol: none |
| 9 | + |
| 10 | +`skills/objectstack-api/SKILL.md` goes from 21.4 KB to 9.0 KB (438 lines to 151). It now holds six things: four first checks (the installed version wins over the `compatibility` line, and an `apis:` block written before protocol 17 turns live; read the stack's `apis`, its `manifest.namespace` and the object's `apiMethods`; read the contract and never recall a key or a code; verify with `os validate` or `os build` and read a publish rejection), the generated routes, the `apiMethods` primitives and what derives from them, one type-checked declared endpoint, six traps, and a table that says where to go for the rest. No rule's teaching changes. This skill has no hand-written reference file, so no text moved: what left the entry was cut, and this entry says what now answers it. |
| 11 | + |
| 12 | +**What the entry keeps.** The generated routes as one listing (the `data` routes, the two `batch` routes, import and export, the metadata read), with the two request contracts a client gets wrong: the metadata list reads a closed query set and narrows by `?names=`, and an import mapping's entry form, `{ sourceField, targetField, applyOn }`, is the only one that carries `applyOn`. The section `## API Methods (Operations)` keeps its heading and every one of the six authorable primitives, with the eight derived operations and what each derives from. The declared endpoint keeps its example: the path carve-out, `object_operation` with `objectParams`, `cacheTtlSeconds`. The six traps, each a declaration or a call that passes and then answers wrong at run time: `authRequired: false` needs `rateLimit.enabled: true`, because a budget with only `windowMs` / `maxRequests` meters nothing; an app never mounts on `http.server`, handler code runs in a flow's `script` or `connector_action` node, an inbound webhook is a `type: 'api'` flow verified by `x-objectstack-signature` or a declared `config.signature`, and three cases have no app surface; `DELETE` keeps a business object's rows in the recycle bin, with the restore door and its two grants; a `PATCH` with no version token skips the concurrency check; a public form answers `404 FORM_NOT_FOUND` unless its `sharing` declares `enabled`, `allowAnonymous` and `publicLink`, strips fields outside its sections, and is withheld on a walled posture with only a warning at save and publish; a person is shown `userMessage`, never `message`, on a batch publish's `probes.issues[]`, and a failed flow door renders `userMessage`, then `details.innerRefusal`, then `message`. |
| 13 | + |
| 14 | +**What left, and what answers it now.** |
| 15 | + |
| 16 | +- The publish gates one by one, and the mapping refusals beyond `transform` (`inputMapping` on a `find` / `get` / `delete` operation, two entries writing one target path): https://objectstack.ai/docs/api/declarative-endpoints, and the rejection itself, which names the endpoint, the key and the fix. `os validate` runs the same gates. |
| 17 | +- The steps for an `apis:` block written before protocol 17 (move every `path` into the carve-out, review every `authRequired: false`): the `declarative-apis-endpoints-live` entry of the protocol upgrade guide, which the entry still names. |
| 18 | +- The endpoint naming table: cut. Its two patterns (`/api/v1/{object}/:id/{action}`, `/api/v1/{domain}/{action}`) are not paths an app can declare: a declared path lives under `/api/v1/apps/<manifest.namespace>/`, and the endpoint vocabulary has no path-template syntax. |
| 19 | +- The per-primitive route table, the four `RESTORE_*` refusals of a restore, the list, purge and empty doors of the recycle bin, the one metadata type whose list refuses `names`, and the discovery route: https://objectstack.ai/docs/protocol/kernel/http-protocol. The quoted-empty entity-tag refusal (`400 VALIDATION_FAILED`): https://objectstack.ai/docs/api/wire-format. The `ApiOperation` vocabulary: `data/object.zod.ts`. Each refusal among them is loud when hit. The health and readiness routes are cut: nothing in a stack declares them. |
| 20 | +- The dispatcher's four codes, the two envelope shapes, the two-tier `error.code` vocabulary and the downstream-ledger recipe (`envelopeViolations`, `makeApiErrorSchema`): `api/errors.zod.ts`, `api/dispatcher.zod.ts`, `api/error-code-ledger.zod.ts` and `api/contract.zod.ts` under `node_modules/@objectstack/spec/src/`, and https://objectstack.ai/docs/api/error-catalog. The entry keeps that a code in no ledger fails CI. |
| 21 | +- The realtime pointers (`api/realtime.zod.ts`, `api/websocket.zod.ts`): `references/_index.md`, which lists both. |
| 22 | +- The login request's field list, and the flat `public` + `permissions` pair of `RestApiEndpointSchema` (the plugin route registry, `api/plugin-rest-api.zod.ts`): the contract. The entry keeps `AuthProvider` with its members, `LoginRequestSchema`, and that a declared endpoint has `authRequired` and no nested `auth` block (the strict endpoint shape refuses `auth` and names `authRequired`). |
| 23 | +- A public form's file-field rule (`public-form-file-field`, an error at `os validate` and at publish) and the `guest_portal` name: https://objectstack.ai/docs/ui/forms. The form contracts: `ui/view.zod.ts` (`FormViewSchema`) and `ui/sharing.zod.ts` (`SharingConfigSchema`). |
| 24 | +- The locale ladder's subtag steps, the `advisories[]` / 422 `issues[]` element (`RuntimeAuthoringIssueSchema`), and the `errorMessage` and `summary` keys of a failed flow's details: `api/protocol.zod.ts` and `api/automation-api.zod.ts`. An app-authored refusal having no `en` floor is in objectstack-i18n. |
| 25 | +- The skill-boundaries table: the frontmatter description and the last routing row. |
| 26 | + |
| 27 | +**Anchors that no longer exist in `SKILL.md`.** `#skill-boundaries`, `#auto-generated-vs-custom-apis`, `#auto-generated-apis`, `#metadata-api-meta`, `#public-anonymous-form-endpoints`, `#declarative-endpoints-apis--no-handler-code`, `#choosing-between-apis-and-a-code-handler`, `#the-path-carve-out-adr-0121-d1d2`, `#five-publish-gates-each-with-a-prescription`, `#authrequired-and-the-d6-pairing`, `#mapping-keys-projection-only`, `#upgrading-a-pre-17-stack`, `#endpoint-naming-conventions`, `#discovery--health`, `#dispatcher-error-codes`, `#realtime-subscriptions`, `#authentication--authorization`, `#auth-configuration`, `#auth-providers`, `#error-envelopes--the-code-ledger-adr-0112`, `#best-practices`, `#common-pitfalls`, `#verify-your-work`, `#references`. `#api-methods-operations` stays. The new ones are `#first-checks`, `#generated-routes`, `#a-declared-endpoint`, `#traps` and `#where-to-go`. No file in this repository linked an anchor of the old entry. |
0 commit comments