Skip to content

Commit a406443

Browse files
committed
feat(spec): retire the six branded identifier schemas of shared/branded-types.zod.ts
ADR-0049 enforce-or-remove, maintainer ruling 2026-09-01 (director batch C, verbatim approval: retire; binding weighed and not adopted). No schema in either repo ever composed a brand, so the promised compile-time safety was unobtainable, while the surfaces the brands were named for are validated by inline regexes or bare SnakeCaseIdentifierSchema — those five real validators are the contract of record and are untouched here. Removes the module whole (6 schemas + 12 type exports), registers the six shared/* defs under RETIRED_DEFS_BY_MAJOR 18 plus the D3 semantic entry branded-identifier-schemas-retired, deletes the six manifest keys behind the #4725 gate, and regenerates api-surface / declaration-map / export-origins / reference docs. SnakeCaseIdentifierSchema and SystemIdentifierSchema stay published and unchanged. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Mciyv38maJ6HYVMiaM26T1
1 parent c85a265 commit a406443

20 files changed

Lines changed: 254 additions & 408 deletions

File tree

‎content/docs/references/index.mdx‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Protocol Reference
3-
description: Every schema published by @objectstack/spec — 1598 schemas across 14 protocol modules
3+
description: Every schema published by @objectstack/spec — 1592 schemas across 14 protocol modules
44
---
55

66
{/* ⚠️ AUTO-GENERATED — DO NOT EDIT. Run build-docs.ts to regenerate. Hand-written docs live in the module folders under content/docs/. */}
@@ -29,11 +29,11 @@ counts are sums of the rows they head. Regenerate with
2929
| [Kernel Protocol](/docs/references/kernel) | 30 | 163 | Plugin lifecycle and manifests, capabilities and security, metadata loading, service registry. |
3030
| [QA Protocol](/docs/references/qa) | 1 | 8 | Declarative test suites — scenarios, steps, actions and assertions. |
3131
| [Security Protocol](/docs/references/security) | 5 | 29 | Permission sets, row-level security, sharing rules, tenancy posture. |
32-
| [Shared Protocol](/docs/references/shared) | 8 | 32 | Primitives used across every protocol — identifiers, HTTP, expressions, error maps, enums. |
32+
| [Shared Protocol](/docs/references/shared) | 7 | 26 | Primitives used across every protocol — identifiers, HTTP, expressions, error maps, enums. |
3333
| [Studio Protocol](/docs/references/studio) | 3 | 35 | Studio designer metadata — the authoring surfaces for the protocols above. |
3434
| [System Protocol](/docs/references/system) | 36 | 291 | The runtime environment — logging, jobs, cache, metrics, notifications, i18n and compliance. |
3535
| [UI Protocol](/docs/references/ui) | 16 | 153 | Apps, pages, views, dashboards, reports, actions and themes — the ObjectUI layer. |
36-
| **Total** | **200** | **1598** | 14 protocol modules |
36+
| **Total** | **199** | **1592** | 14 protocol modules |
3737

3838
---
3939

@@ -286,13 +286,12 @@ Permission sets, row-level security, sharing rules, tenancy posture.
286286

287287
## Shared Protocol
288288

289-
**Source:** `packages/spec/src/shared/` · **Import:** `@objectstack/spec/shared` · **8 pages, 32 schemas**
289+
**Source:** `packages/spec/src/shared/` · **Import:** `@objectstack/spec/shared` · **7 pages, 26 schemas**
290290

291291
Primitives used across every protocol — identifiers, HTTP, expressions, error maps, enums.
292292

293293
| File | Schemas |
294294
| :--- | :--- |
295-
| [`branded-types.zod.ts`](/docs/references/shared/branded-types) | `AppName`, `FieldName`, `FlowName`, `ObjectName`, `RoleName`, `ViewName` |
296295
| [`enums.zod.ts`](/docs/references/shared/enums) | `IsolationLevelEnum`, `MutationEventEnum`, `SortDirectionEnum`, `SortItem` |
297296
| [`expression.zod.ts`](/docs/references/shared/expression) | `CronExpressionInput`, `Expression`, `ExpressionDialect`, `ExpressionInput`, `ExpressionMeta`, `Predicate`, `PredicateInput`, `TemplateExpressionInput` |
298297
| [`http.zod.ts`](/docs/references/shared/http) | `CorsConfig`, `HttpMethod`, `HttpMethodSubset`, `HttpRequest`, `RateLimitConfig`, `StaticMount` |

‎content/docs/references/shared/branded-types.mdx‎

Lines changed: 0 additions & 94 deletions
This file was deleted.

‎content/docs/references/shared/index.mdx‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ description: Complete reference for all shared protocol schemas
66
This section contains all protocol schemas for the shared layer of ObjectStack.
77

88
<Cards>
9-
<Card href="/docs/references/shared/branded-types" title="Branded Types" description="Source: packages/spec/src/shared/branded-types.zod.ts" />
109
<Card href="/docs/references/shared/enums" title="Enums" description="Source: packages/spec/src/shared/enums.zod.ts" />
1110
<Card href="/docs/references/shared/expression" title="Expression" description="Source: packages/spec/src/shared/expression.zod.ts" />
1211
<Card href="/docs/references/shared/http" title="Http" description="Source: packages/spec/src/shared/http.zod.ts" />

‎content/docs/references/shared/meta.json‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"title": "Shared Protocol",
33
"pages": [
4-
"branded-types",
54
"enums",
65
"expression",
76
"http",

‎packages/spec/api-surface/shared.json‎

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
"description": "Every exported `name (kind)` of one published entry point of @objectstack/spec — the breadth half of the ADR-0059 backward-compatibility gate. Sharded by entry point (#5837) so two PRs touching different entry points never share a file. Reads the BUILT dist/*.d.ts: regenerate with `pnpm --filter @objectstack/spec gen:api-surface` after a real build.",
33
"entry": "./shared",
44
"exports": [
5-
"AppName (type)",
6-
"AppNameParsed (type)",
7-
"AppNameSchema (const)",
85
"ApplyProtectionContext (interface)",
96
"BaseMetadataRecord (type)",
107
"BaseMetadataRecordSchema (const)",
@@ -31,12 +28,6 @@
3128
"F (const)",
3229
"FieldMapping (type)",
3330
"FieldMappingSchema (const)",
34-
"FieldName (type)",
35-
"FieldNameParsed (type)",
36-
"FieldNameSchema (const)",
37-
"FlowName (type)",
38-
"FlowNameParsed (type)",
39-
"FlowNameSchema (const)",
4031
"HttpMethod (type)",
4132
"HttpMethodSubset (type)",
4233
"HttpMethodSubsetSchema (const)",
@@ -59,9 +50,6 @@
5950
"MutationEvent (type)",
6051
"MutationEventEnum (const)",
6152
"NormalizeStackInputOptions (interface)",
62-
"ObjectName (type)",
63-
"ObjectNameParsed (type)",
64-
"ObjectNameSchema (const)",
6553
"ObjectStackRawIssue (type)",
6654
"P (const)",
6755
"PLURAL_TO_SINGULAR (const)",
@@ -76,9 +64,6 @@
7664
"RateLimitConfigParsed (type)",
7765
"RateLimitConfigSchema (const)",
7866
"ResilientFetchOptions (interface)",
79-
"RoleName (type)",
80-
"RoleNameParsed (type)",
81-
"RoleNameSchema (const)",
8267
"SINGULAR_TO_PLURAL (const)",
8368
"SchemaDiffEntry (interface)",
8469
"SchemaDiffEntryKind (type)",
@@ -97,9 +82,6 @@
9782
"TemplateExpressionInputSchema (const)",
9883
"VISIBILITY_ALIAS_KEYS (const)",
9984
"VISIBILITY_STRICT_OPTIONS (const)",
100-
"ViewName (type)",
101-
"ViewNameParsed (type)",
102-
"ViewNameSchema (const)",
10385
"applyProtection (function)",
10486
"canonicalMetaUrlType (function)",
10587
"cel (function)",

‎packages/spec/declaration-map/shared.json‎

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
"description": "TS declaration name → spec registry name (def key) for the schemas @objectstack/spec publishes: entries['ObjectSchemaBase'] === 'data/Object'. Composed from json-schema.manifest/ (the def keys), export-origins/ (which declaration each export resolves to), and a syntactic unwinding of wrapper initializers that recovers module-private base declarations (the ObjectSchemaBase case — see scripts/build-declaration-map.ts). A name that maps to two different def keys is DROPPED into `collisions` rather than guessed, so a lookup miss means \"not known to be an authorable container\". Consumers hold a changed line’s enclosing declaration name and ask which authorable container it declares (docs-audit anchor qualification is the funding one). Generated — never hand-edited; regenerate with `pnpm --filter @objectstack/spec gen:declaration-map` and read the diff.",
33
"category": "shared",
44
"entries": {
5-
"AppName": "shared/AppName",
6-
"AppNameSchema": "shared/AppName",
75
"BaseMetadataRecord": "shared/BaseMetadataRecord",
86
"BaseMetadataRecordSchema": "shared/BaseMetadataRecord",
97
"CorsConfig": "shared/CorsConfig",
@@ -21,10 +19,6 @@
2119
"ExpressionSchema": "shared/Expression",
2220
"FieldMapping": "shared/FieldMapping",
2321
"FieldMappingSchema": "shared/FieldMapping",
24-
"FieldName": "shared/FieldName",
25-
"FieldNameSchema": "shared/FieldName",
26-
"FlowName": "shared/FlowName",
27-
"FlowNameSchema": "shared/FlowName",
2822
"HttpMethod": "shared/HttpMethod",
2923
"HttpMethodSubset": "shared/HttpMethodSubset",
3024
"HttpMethodSubsetSchema": "shared/HttpMethodSubset",
@@ -36,8 +30,6 @@
3630
"MetadataItemName": "shared/MetadataItemName",
3731
"MetadataItemNameSchema": "shared/MetadataItemName",
3832
"MutationEventEnum": "shared/MutationEventEnum",
39-
"ObjectName": "shared/ObjectName",
40-
"ObjectNameSchema": "shared/ObjectName",
4133
"Predicate": "shared/Predicate",
4234
"PredicateInput": "shared/PredicateInput",
4335
"PredicateInputSchema": "shared/PredicateInput",
@@ -46,8 +38,6 @@
4638
"ProtectionSchema": "shared/Protection",
4739
"RateLimitConfig": "shared/RateLimitConfig",
4840
"RateLimitConfigSchema": "shared/RateLimitConfig",
49-
"RoleName": "shared/RoleName",
50-
"RoleNameSchema": "shared/RoleName",
5141
"SnakeCaseIdentifier": "shared/SnakeCaseIdentifier",
5242
"SnakeCaseIdentifierSchema": "shared/SnakeCaseIdentifier",
5343
"SortDirectionEnum": "shared/SortDirectionEnum",
@@ -58,9 +48,7 @@
5848
"SystemIdentifier": "shared/SystemIdentifier",
5949
"SystemIdentifierSchema": "shared/SystemIdentifier",
6050
"TemplateExpressionInput": "shared/TemplateExpressionInput",
61-
"TemplateExpressionInputSchema": "shared/TemplateExpressionInput",
62-
"ViewName": "shared/ViewName",
63-
"ViewNameSchema": "shared/ViewName"
51+
"TemplateExpressionInputSchema": "shared/TemplateExpressionInput"
6452
},
6553
"collisions": []
6654
}

‎packages/spec/export-origins/shared.json‎

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
"description": "Which SOURCE DECLARATION each name exported by one public entry point of @objectstack/spec resolves to, after its alias chain is unwound: `<src path>#<declared name> (<kind>)`. Two exports share an origin string iff they are the same declaration — so equal origins across two entries are a harmless re-export, and different origins under one name are the #4411 dual-source trap. Generated from src/ (no build needed) and read by the export-surface pin tests, which compare against it instead of each building their own ts.createProgram — that was ~55s of compilation per CI lap and a non-deterministic timeout that ejected unrelated PRs from the merge queue (#4796). Sharded by entry point (#5837) so two retirement PRs never share a file. Carries NO line numbers: the pins asserted the line as `\\d+`, and recording it would rewrite this artifact on every edit that shifts a line in any .zod.ts. Regenerate with `pnpm --filter @objectstack/spec gen:export-origins` and read the diff.",
33
"entry": "./shared",
44
"exports": {
5-
"AppName": "src/shared/branded-types.zod.ts#AppName (type)",
6-
"AppNameParsed": "src/shared/branded-types.zod.ts#AppNameParsed (type)",
7-
"AppNameSchema": "src/shared/branded-types.zod.ts#AppNameSchema (const)",
85
"ApplyProtectionContext": "src/shared/protection.zod.ts#ApplyProtectionContext (interface)",
96
"BaseMetadataRecord": "src/shared/metadata-types.zod.ts#BaseMetadataRecord (type)",
107
"BaseMetadataRecordSchema": "src/shared/metadata-types.zod.ts#BaseMetadataRecordSchema (const)",
@@ -31,12 +28,6 @@
3128
"F": "src/shared/expression.zod.ts#F (const)",
3229
"FieldMapping": "src/shared/mapping.zod.ts#FieldMapping (type)",
3330
"FieldMappingSchema": "src/shared/mapping.zod.ts#FieldMappingSchema (const)",
34-
"FieldName": "src/shared/branded-types.zod.ts#FieldName (type)",
35-
"FieldNameParsed": "src/shared/branded-types.zod.ts#FieldNameParsed (type)",
36-
"FieldNameSchema": "src/shared/branded-types.zod.ts#FieldNameSchema (const)",
37-
"FlowName": "src/shared/branded-types.zod.ts#FlowName (type)",
38-
"FlowNameParsed": "src/shared/branded-types.zod.ts#FlowNameParsed (type)",
39-
"FlowNameSchema": "src/shared/branded-types.zod.ts#FlowNameSchema (const)",
4031
"HttpMethod": "src/shared/http.zod.ts#HttpMethod (type)",
4132
"HttpMethodSubset": "src/shared/http.zod.ts#HttpMethodSubset (type)",
4233
"HttpMethodSubsetSchema": "src/shared/http.zod.ts#HttpMethodSubsetSchema (const)",
@@ -59,9 +50,6 @@
5950
"MutationEvent": "src/shared/enums.zod.ts#MutationEvent (type)",
6051
"MutationEventEnum": "src/shared/enums.zod.ts#MutationEventEnum (const)",
6152
"NormalizeStackInputOptions": "src/shared/metadata-collection.zod.ts#NormalizeStackInputOptions (interface)",
62-
"ObjectName": "src/shared/branded-types.zod.ts#ObjectName (type)",
63-
"ObjectNameParsed": "src/shared/branded-types.zod.ts#ObjectNameParsed (type)",
64-
"ObjectNameSchema": "src/shared/branded-types.zod.ts#ObjectNameSchema (const)",
6553
"ObjectStackRawIssue": "src/shared/error-map.zod.ts#ObjectStackRawIssue (type)",
6654
"P": "src/shared/expression.zod.ts#P (const)",
6755
"PLURAL_TO_SINGULAR": "src/meta-spelling/manifest-collection-spelling.ts#PLURAL_TO_SINGULAR (const)",
@@ -76,9 +64,6 @@
7664
"RateLimitConfigParsed": "src/shared/http.zod.ts#RateLimitConfigParsed (type)",
7765
"RateLimitConfigSchema": "src/shared/http.zod.ts#RateLimitConfigSchema (const)",
7866
"ResilientFetchOptions": "src/shared/resilient-fetch.ts#ResilientFetchOptions (interface)",
79-
"RoleName": "src/shared/branded-types.zod.ts#RoleName (type)",
80-
"RoleNameParsed": "src/shared/branded-types.zod.ts#RoleNameParsed (type)",
81-
"RoleNameSchema": "src/shared/branded-types.zod.ts#RoleNameSchema (const)",
8267
"SINGULAR_TO_PLURAL": "src/meta-spelling/manifest-collection-spelling.ts#SINGULAR_TO_PLURAL (const)",
8368
"SchemaDiffEntry": "src/shared/external-errors.ts#SchemaDiffEntry (interface)",
8469
"SchemaDiffEntryKind": "src/shared/external-errors.ts#SchemaDiffEntryKind (type)",
@@ -97,9 +82,6 @@
9782
"TemplateExpressionInputSchema": "src/shared/expression.zod.ts#TemplateExpressionInputSchema (const)",
9883
"VISIBILITY_ALIAS_KEYS": "src/shared/visibility.ts#VISIBILITY_ALIAS_KEYS (const)",
9984
"VISIBILITY_STRICT_OPTIONS": "src/shared/visibility.ts#VISIBILITY_STRICT_OPTIONS (const)",
100-
"ViewName": "src/shared/branded-types.zod.ts#ViewName (type)",
101-
"ViewNameParsed": "src/shared/branded-types.zod.ts#ViewNameParsed (type)",
102-
"ViewNameSchema": "src/shared/branded-types.zod.ts#ViewNameSchema (const)",
10385
"applyProtection": "src/shared/protection.zod.ts#applyProtection (function)",
10486
"canonicalMetaUrlType": "src/meta-spelling/metadata-url-spelling.ts#canonicalMetaUrlType (function)",
10587
"cel": "src/shared/expression.zod.ts#cel (function)",

‎packages/spec/json-schema.manifest/shared.json‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"description": "Ratchet manifest of every JSON Schema emitted by scripts/build-schemas.ts for one category. Sharded by category (#5837); the gate reads the whole json-schema.manifest/ directory as ONE set. Auto-appended when new schemas are added (commit the change). A listed schema that a build no longer emits fails gen:schema. DELETING a key is gated too (#4725): the removal is measured against this directory at the merge base with origin/main — which the commit under test cannot rewrite — and every def that leaves the published set must be declared in RETIRED_DEFS_BY_MAJOR (src/migrations/registry.ts), or in RENAMED_DEFS (scripts/lib/renamed-defs.ts) when it is a rename rather than a removal. See #2978, #4725.",
33
"category": "shared",
44
"schemas": [
5-
"shared/AppName",
65
"shared/BaseMetadataRecord",
76
"shared/CorsConfig",
87
"shared/CronExpressionInput",
@@ -12,27 +11,22 @@
1211
"shared/ExpressionInput",
1312
"shared/ExpressionMeta",
1413
"shared/FieldMapping",
15-
"shared/FieldName",
16-
"shared/FlowName",
1714
"shared/HttpMethod",
1815
"shared/HttpMethodSubset",
1916
"shared/HttpRequest",
2017
"shared/IsolationLevelEnum",
2118
"shared/MetadataFormat",
2219
"shared/MetadataItemName",
2320
"shared/MutationEventEnum",
24-
"shared/ObjectName",
2521
"shared/Predicate",
2622
"shared/PredicateInput",
2723
"shared/Protection",
2824
"shared/RateLimitConfig",
29-
"shared/RoleName",
3025
"shared/SnakeCaseIdentifier",
3126
"shared/SortDirectionEnum",
3227
"shared/SortItem",
3328
"shared/StaticMount",
3429
"shared/SystemIdentifier",
35-
"shared/TemplateExpressionInput",
36-
"shared/ViewName"
30+
"shared/TemplateExpressionInput"
3731
]
3832
}

‎packages/spec/scripts/lib/schema-section.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ export function renderSchemaSection(schemaName: string, schema: any, ctx: Sectio
562562
//
563563
// ONE LINE, and it is `formatType`'s rendering, not a second one. That is
564564
// what every property row on the page already prints for the same node, so
565-
// `ObjectName`'s own section and a property typed `ObjectName` cannot
565+
// `SystemIdentifier`'s own section and a property typed `SystemIdentifier` cannot
566566
// disagree about what it is. It is also why the line does NOT spell
567567
// `pattern` / `minLength` / `minimum`: this renderer has never printed a
568568
// constraint in any position, and inventing constraint prose here alone
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
2+
3+
// #13612 — ADR-0049 enforce-or-remove (maintainer ruling 2026-09-01, director
4+
// batch C: retire; binding was weighed and not adopted). One of the six
5+
// branded identifier schemas of `shared/branded-types.zod.ts`, removed whole
6+
// with the module. No schema in either repo ever composed `AppNameSchema`,
7+
// so the promised brand safety was unobtainable. The real app-name contract
8+
// is the bare `SnakeCaseIdentifierSchema` at `ui/app.zod.ts` — untouched by
9+
// this retirement. No tombstone and no D2 conversion (no authored document
10+
// ever embedded a branded value); this table plus the D3 semantic entry
11+
// `branded-identifier-schemas-retired` are the declaration.
12+
export const entry = 'shared/AppName';

0 commit comments

Comments
 (0)