Skip to content

Commit 2b912f1

Browse files
committed
docs(skills): the objectstack-api entry file becomes a router
The entry goes from 21,359 to 8,986 bytes (438 lines to 151). It keeps four first checks, the generated routes with the metadata list's closed query set and an import mapping's applyOn, the apiMethods primitives and what derives from them, one type-checked declared endpoint, six traps and a routing table. The skill has no hand-written reference file, so nothing moved: the rest is cut behind a pointer to the contract, the publish gates or the published API pages. The changeset lists every cut and every anchor that left. The ratchet row is pinned at the measurement, 5333 to 2240 tokens, and the sum of all ceilings falls by the same 3093. Claude-Session: https://claude.ai/code/session_01ADHkmSM46qymk97AyqPzoS Co-authored-by: Claude <noreply@anthropic.com>
1 parent 840c3aa commit 2b912f1

3 files changed

Lines changed: 144 additions & 389 deletions

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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.

‎scripts/check-skills-token-ratchet.mjs‎

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,22 @@ export const CEILINGS = new Map([
578578
// longer has. Lowered to the measurement, per the shrink-only discipline.
579579
// 6319 -> 6314: A2′ — the release-stamp line left the count (see
580580
// STAMP_LINE_REPIN); the file's count fell by the same 5, headroom unchanged.
581-
['skills/objectstack-api/SKILL.md', 5333], // -981 to the measurement (was 6314)
581+
// 6314 -> 5333: lowered to the measurement (-981).
582+
// 5333 -> 2240 (#34770): the entry becomes a router. It keeps four first checks, the
583+
// generated routes with the two request contracts a client gets wrong (the closed query set
584+
// of the metadata list, an import mapping's `applyOn`), the `apiMethods` primitives and what
585+
// derives from them, one type-checked declared endpoint, six traps (each passes the build
586+
// and then answers wrong at run time, or is refused only at publish with the form to write)
587+
// and a routing table. This skill has no hand-authored reference file, so nothing MOVED: the
588+
// rest is CUT behind a pointer, to the contract (`api/*.zod.ts`, whose strict endpoint shape
589+
// refuses a wrong key with the key to write), to the publish gates (`os validate` runs them
590+
// and each rejection carries its fix) or to the published API pages. No row rises and no
591+
// row is added. The file is 21359 bytes (21332 priced) -> 8986 (8959 priced) -> 2240
592+
// tokens, pinned AT the measurement; the sum of all ceilings falls by the same 3093.
593+
// Authority: the ruling of record that orders the entry file down to router size, decision
594+
// record #34691 S3 = A.
595+
// ceil(($(wc -c < skills/objectstack-api/SKILL.md) - 27) / 4) == ceil(8959 / 4)
596+
['skills/objectstack-api/SKILL.md', 2240],
582597
// 12511 -> 12643 (#11348): the flow value-expression section documented the
583598
// expression surface but not the function vocabulary (round/floor/ceil/abs/
584599
// min/max); an unknown function fails at RUNTIME, not at flow-save, so the

0 commit comments

Comments
 (0)