|
| 1 | +--- |
| 2 | +"@objectstack/spec": major |
| 3 | +--- |
| 4 | + |
| 5 | +refactor(spec)!: remove `connector.rateLimitConfig` and the whole outbound rate-limit shape — the engine never existed (#4911, ADR-0049) |
| 6 | + |
| 7 | +`ConnectorSchema.rateLimitConfig` let an author declare an outbound throttle for |
| 8 | +their connector — `strategy`, `maxRequests`, `windowSeconds`, `burstCapacity`, |
| 9 | +`respectUpstreamLimits`, `rateLimitHeaders` — and nothing anywhere applied it. |
| 10 | +This is not the ordinary declared-but-unread case; it is a step worse: |
| 11 | +**there is no outbound rate-limiting engine to wire it to.** The only token |
| 12 | +bucket the platform owns is `packages/runtime/src/security/rate-limit.ts`, and it |
| 13 | +is INBOUND — the dispatcher calls `consume(key)` on a request fingerprint and |
| 14 | +answers 429. No connector provider (`connector-rest`, `connector-openapi`, |
| 15 | +`connector-mcp`, `connector-slack`) reads the key, and no seam exists that could. |
| 16 | + |
| 17 | +So a well-formed, schema-validated block told the author they had capped their |
| 18 | +call rate against a third party's quota, and capped nothing — the false-compliance |
| 19 | +class ADR-0049 exists for. With no implementation and no committed roadmap, |
| 20 | +`experimental` would be a promise nobody made; **absent** is the honest |
| 21 | +disposition. The vocabulary comes back *with* the engine, in one change |
| 22 | +(implementation-first — the #4834 / PR #4878 ruling for the plugin-runtime family). |
| 23 | + |
| 24 | +FROM → TO: |
| 25 | + |
| 26 | +| Removed | Replacement | |
| 27 | +| :--- | :--- | |
| 28 | +| `connector.rateLimitConfig` (key) | **none** — delete it; throttle at the connector provider or upstream gateway | |
| 29 | +| `ConnectorRateLimitConfigSchema` / `ConnectorRateLimitConfig` | **none** — importing either is TS2305 in v17 | |
| 30 | +| `RateLimitStrategySchema` / `RateLimitStrategy` | **none** — the enum had no other consumer | |
| 31 | + |
| 32 | +**Do NOT substitute `shared`'s `RateLimitConfig`.** That is the INBOUND limiter |
| 33 | +(`enabled` / `windowMs` / `maxRequests`) and caps the calls others make to *us* — |
| 34 | +the opposite direction. #4684 split the two names for exactly this confusion; the |
| 35 | +conversion deliberately does not rewrite one into the other, because that would |
| 36 | +silently change behaviour rather than losing a no-op. |
| 37 | + |
| 38 | +The retirement kit: |
| 39 | + |
| 40 | +- **Tombstone.** `ConnectorSchema` is not `.strict()`, so a plain delete would be |
| 41 | + a silent strip (ADR-0104). `retiredKey()` makes the removal audible in the two |
| 42 | + channels an upgrading author hits — `tsc` (the key types `never`) and the parse |
| 43 | + (the prescription itself). It reaches `stack.connectors[]` and |
| 44 | + `DeclarativeConnectorEntry`, which is `ConnectorSchema.superRefine(…)`. |
| 45 | +- **ADR-0087 D2 conversion + D3 chain step** (`connector-rate-limit-config-removed`, |
| 46 | + `retiredFromLoadPath`): `os migrate meta --from 16` deletes the key from author |
| 47 | + sources and stored rows replay clean. A lossless delete — the block never had an |
| 48 | + effect to lose. |
| 49 | +- **The shape goes with the key.** `ConnectorRateLimitConfigSchema` and the |
| 50 | + `RateLimitStrategySchema` enum it embedded had no other consumer, and an |
| 51 | + exported schema with no consumer reads as a capability to whoever finds it |
| 52 | + (#3950). |
| 53 | +- **#4684's rename is absorbed.** `integration/RateLimitConfig` → |
| 54 | + `integration/ConnectorRateLimitConfig` and this retirement landed in the same |
| 55 | + unreleased major; composed they are a plain delete, so the `RENAMED_DEFS` entry |
| 56 | + is removed rather than pointing at a def this build no longer emits. |
| 57 | +- Baselines updated deliberately: `json-schema.manifest.json` (−2 defs), |
| 58 | + `authorable-surface.json` (−6 def lines; `Connector` / |
| 59 | + `DeclarativeConnectorEntry` gain `… [RETIRED]`), `api-surface.json` (−4 |
| 60 | + exports). `api-surface-signatures.json` is unchanged by construction — it hashes |
| 61 | + each `defineX` parameter as TypeScript *prints* it, a reference |
| 62 | + (`z.input<typeof ConnectorSchema >`), so key-level narrowing never reaches it. |
| 63 | + |
| 64 | +No runtime behaviour changes — that impossibility is the reason for the removal. |
0 commit comments