From 3b43d7b09e7d6fcc9e2ed6b6496f7af238fa3aff Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 14 Nov 2026 23:57:06 +0000 Subject: [PATCH 1/2] refactor(spec)!: retire the uncalled describeManagedApiMethodConflicts export The spec helper had no caller left: the lint rule and the registry strip each build their own message from checkManagedApiMethodAffordances. Remove the function and its test block; the predicate, its conflict type and the verb table stay. Claude-Session: https://claude.ai/code/session_01FEkQ5mqr24gy2eNyrmiqJd Co-Authored-By: Claude --- .../src/data/managed-api-affordance.test.ts | 31 ------------------- .../spec/src/data/managed-api-affordance.ts | 22 ------------- 2 files changed, 53 deletions(-) diff --git a/packages/spec/src/data/managed-api-affordance.test.ts b/packages/spec/src/data/managed-api-affordance.test.ts index e3538062c0b..be899adc96f 100644 --- a/packages/spec/src/data/managed-api-affordance.test.ts +++ b/packages/spec/src/data/managed-api-affordance.test.ts @@ -10,7 +10,6 @@ import { describe, expect, it } from 'vitest'; import { MANAGED_WRITE_VERB_AFFORDANCE, checkManagedApiMethodAffordances, - describeManagedApiMethodConflicts, type ManagedApiMethodConflict, } from './managed-api-affordance'; @@ -133,33 +132,3 @@ describe('the verb → affordance table', () => { expect(Object.isFrozen(MANAGED_WRITE_VERB_AFFORDANCE)).toBe(true); }); }); - -describe('describeManagedApiMethodConflicts', () => { - it('names the verbs and the affordance they would need', () => { - const msg = describeManagedApiMethodConflicts(checkManagedApiMethodAffordances(managed())); - expect(msg).toContain('create, update, delete'); - expect(msg).toContain('userActions create/edit/delete'); - expect(msg).toContain('enable.apiMethods'); - expect(msg).toContain('ADR-0092'); - }); - - it('states the contradiction only — the remedy belongs to each consumer', () => { - const msg = describeManagedApiMethodConflicts(checkManagedApiMethodAffordances(managed())); - expect(msg).not.toMatch(/\b(drop|remove|Either)\b/); - }); - - it('does not repeat an affordance flag shared by two verbs', () => { - const msg = describeManagedApiMethodConflicts( - checkManagedApiMethodAffordances(managed({ enable: { apiMethods: ['update', 'upsert'] } })), - ); - expect(msg).toContain('needs userActions edit)'); - }); - - it('reads correctly for a single conflict', () => { - const msg = describeManagedApiMethodConflicts( - checkManagedApiMethodAffordances(managed({ enable: { apiMethods: ['get', 'delete'] } })), - ); - expect(msg).toContain('[delete]'); - expect(msg).toContain('needs userActions delete)'); - }); -}); diff --git a/packages/spec/src/data/managed-api-affordance.ts b/packages/spec/src/data/managed-api-affordance.ts index 9e2543eb924..3b4286f23a5 100644 --- a/packages/spec/src/data/managed-api-affordance.ts +++ b/packages/spec/src/data/managed-api-affordance.ts @@ -127,25 +127,3 @@ export function checkManagedApiMethodAffordances(schema: unknown): ManagedApiMet } return out; } - -/** - * The one sentence both consumers say about a conflict, so an operator who - * greps a stripped verb out of a boot log and an author reading the lint - * finding are told the same thing in the same words. - * - * States the CONTRADICTION only. Each consumer appends its own remedy, because - * the honest remedy differs by where you are standing: at registration the verb - * has already been taken away and the operator's next move is to find the - * author, while at authoring time both doors — open the affordance, or drop the - * verb — are still open. - */ -export function describeManagedApiMethodConflicts( - conflicts: readonly ManagedApiMethodConflict[], -): string { - const verbs = conflicts.map((c) => c.verb).join(', '); - const flags = [...new Set(conflicts.map((c) => c.needs))].join('/'); - return ( - `advertises generic write verb(s) [${verbs}] in enable.apiMethods that its resolved ` + - `affordances do not permit (needs userActions ${flags}) — see ADR-0092 / ADR-0103.` - ); -} From 5516b6812be77cdaf420b4ea68ab26efb0dc4c2a Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 14 Nov 2026 23:59:40 +0000 Subject: [PATCH 2/2] chore(spec): regenerate the surface snapshots and add the changeset gen:api-surface and gen:export-origins drop the retired function; the changeset declares the narrowing and its ADR-0087 disposition. Claude-Session: https://claude.ai/code/session_01FEkQ5mqr24gy2eNyrmiqJd Co-Authored-By: Claude --- ...tire-describe-managed-api-method-conflicts.md | 16 ++++++++++++++++ packages/spec/api-surface/data.json | 1 - packages/spec/export-origins/data.json | 1 - 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 .changeset/33522-retire-describe-managed-api-method-conflicts.md diff --git a/.changeset/33522-retire-describe-managed-api-method-conflicts.md b/.changeset/33522-retire-describe-managed-api-method-conflicts.md new file mode 100644 index 00000000000..284e33c9105 --- /dev/null +++ b/.changeset/33522-retire-describe-managed-api-method-conflicts.md @@ -0,0 +1,16 @@ +--- +'@objectstack/spec': patch +--- + +refactor(spec)!: retire `describeManagedApiMethodConflicts`, an export of `@objectstack/spec/data` that nothing calls + +Clause-②: no (narrowing) +Metadata-protocol: none + + + +**BREAKING** for a TypeScript caller that imports `describeManagedApiMethodConflicts` from `@objectstack/spec/data`. None is known: in this repository (`ui/` and `examples/` included), in hotcrm and in gallery the name occurs only in its own declaration, its own test and the generated surface snapshots. The lint rule `object/managed-api-method-unaffordable` and the registry's boot-time strip each word their own message from `checkManagedApiMethodAffordances`, so the helper's sentence reached no author or operator. That sentence also named `userActions` as the remedy on every `managedBy` bucket, which is wrong on a `synced` object, whose parse refuses a `userActions` override that opens a write. + +**What stays.** `checkManagedApiMethodAffordances`, `ManagedApiMethodConflict` and `MANAGED_WRITE_VERB_AFFORDANCE` are unchanged, and so is every verdict the lint rule and the registry strip reach. + +**For a caller.** The compiler names the import (`TS2305: Module '"@objectstack/spec/data"' has no exported member 'describeManagedApiMethodConflicts'`). Delete it, and word the message from the `verb` and `needs` of each conflict `checkManagedApiMethodAffordances` returns, for the object's own `managedBy` bucket. **No deprecation window** (startup-stage posture: a shipped capability with no consumer retires at once). diff --git a/packages/spec/api-surface/data.json b/packages/spec/api-surface/data.json index 3dd6a05f3f6..b3e34a468ce 100644 --- a/packages/spec/api-surface/data.json +++ b/packages/spec/api-surface/data.json @@ -934,7 +934,6 @@ "deriveInlineRowFormFields (function)", "deriveRecordFlowSurface (function)", "deriveRecordSurface (function)", - "describeManagedApiMethodConflicts (function)", "discriminateDefaultValueShape (function)", "driverConfigJsonSchema (function)", "driverHasLocalDefault (function)", diff --git a/packages/spec/export-origins/data.json b/packages/spec/export-origins/data.json index 24f322456c9..60f043c2f0a 100644 --- a/packages/spec/export-origins/data.json +++ b/packages/spec/export-origins/data.json @@ -920,7 +920,6 @@ "deriveInlineRowFormFields": "src/data/inline-grid-columns.ts#deriveInlineRowFormFields (function)", "deriveRecordFlowSurface": "src/data/record-surface.ts#deriveRecordFlowSurface (function)", "deriveRecordSurface": "src/data/record-surface.ts#deriveRecordSurface (function)", - "describeManagedApiMethodConflicts": "src/data/managed-api-affordance.ts#describeManagedApiMethodConflicts (function)", "discriminateDefaultValueShape": "src/data/default-value-shape.ts#discriminateDefaultValueShape (function)", "driverConfigJsonSchema": "src/data/driver/common.zod.ts#driverConfigJsonSchema (function)", "driverHasLocalDefault": "src/data/driver/config-registry.zod.ts#driverHasLocalDefault (function)",