Skip to content

Commit 6269a55

Browse files
os-warrenclaude
andauthored
feat(spec): gate the shipped llms.txt against the real package surface (#11688)
`packages/spec/llms.txt` ships in the npm tarball as context for AI consumers and is hand-kept with no generator, so nothing ever re-derived what it asserts. It had drifted: eleven advertised symbols existed in no entry point, two advertised packages did not exist, the schema-inventory heading disagreed with the sum of its own table, and the package heading claimed 19 against a real 68. Add `check:llms-txt`, which re-derives every checkable claim: symbols against the checked-in api-surface/ shards, subpaths against the manifest `exports`, per-domain counts against src/<domain>/**/*.zod.ts, and the package table against the workspace. Symbol claims resolve at the strictness their position earns — namespace bullets and fenced imports name an entry point and must resolve from it, the architecture overview resolves against the union. Repair the claims the gate was otherwise born red on. Deliberately no `gen:llms-txt`: the numbers are not the claim, the prose beside them is. Claude-Session: https://claude.ai/code/session_01Rxnd8cyFnoU8V5y21PaTsy Co-authored-by: Claude <noreply@anthropic.com>
1 parent 4e786cd commit 6269a55

6 files changed

Lines changed: 1099 additions & 34 deletions

File tree

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
'@objectstack/spec': patch
3+
---
4+
5+
Gate the shipped `llms.txt` against the real package, and repair the claims that had rotted.
6+
7+
`packages/spec/llms.txt` ships in the npm tarball as context for AI consumers and is
8+
hand-kept with no generator, so nothing ever re-derived what it asserts. It had drifted
9+
badly: eleven advertised symbols existed in no entry point (`IUIService` — removed in
10+
v11 — plus `ThemeSchema`, `IdentitySchema`, `PolicySchema`, `ContractSchema`,
11+
`EndpointSchema`, `RAGPipelineSchema`, `MCPSchema`, `FilterSchema`, `AnalyticsSchema`,
12+
`FormSchema`), two advertised packages did not exist (`@objectstack/nextjs`,
13+
`@objectstack/nestjs`), the schema-inventory heading disagreed with the sum of its own
14+
table (171 vs 170) and with the tree (207), and the package heading claimed 19 against a
15+
real 68. An agent reading the file wrote imports that do not resolve.
16+
17+
New gate `check:llms-txt` re-derives every checkable claim on every PR: advertised
18+
symbols against the checked-in `api-surface/` shards, `@objectstack/spec/x` subpaths
19+
against the manifest `exports`, the per-domain schema counts against
20+
`src/<domain>/**/*.zod.ts`, and the package table against the workspace. Symbol claims
21+
are resolved at the strictness their position earns — namespace bullets and fenced
22+
imports name an entry point and must resolve from it, while the architecture overview
23+
resolves against the union. Prose, code-fence bodies and `N+` lower-bound figures are
24+
out of population and the script header says why.
25+
26+
There is deliberately no `gen:llms-txt`: the numbers are not the claim, the prose beside
27+
them is, and restamping a count without re-reading its row would turn a loud staleness
28+
into a silent lie.

.github/workflows/lint.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3015,6 +3015,23 @@ jobs:
30153015
- name: Check spec pin citations still name the pin this repo builds against
30163016
run: pnpm --filter @objectstack/spec check:objectui-pin-citations
30173017

3018+
# #11344. `packages/spec/llms.txt` is hand-kept, has no generator, and
3019+
# SHIPS in the published tarball as context for AI consumers — the
3020+
# audience least able to notice staleness and most likely to turn a claim
3021+
# into code. When this landed the file advertised eleven symbols that
3022+
# existed in no entry point (`IUIService` among them, removed in v11), two
3023+
# packages that did not exist, and a schema table whose heading disagreed
3024+
# with the sum of its own rows.
3025+
#
3026+
# Reads `src/`, the checked-in `api-surface/` shards, the package manifest
3027+
# and pnpm-workspace.yaml — no build — so it belongs in this pre-build
3028+
# source-audit group beside its nearest sibling above. Unfiltered on
3029+
# purpose: the counts are measured against the whole workspace and against
3030+
# every schema domain, so a PR that adds a package or a schema anywhere
3031+
# can falsify this file without touching packages/spec/**.
3032+
- name: Check the shipped llms.txt still describes this package
3033+
run: pnpm --filter @objectstack/spec check:llms-txt
3034+
30183035
# Lane 2 of 4 behind the required `TypeScript Type Check` context. The
30193036
# aggregator job at the bottom of this file explains the split, holds the
30203037
# contract, and is the thing the merge queue actually requires — read it

packages/spec/llms.txt

Lines changed: 42 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,15 @@ It is divided into three layers, reflected in the import paths:
1414
- **`FieldSchema`**: Defines columns with 46+ types (`text`, `number`, `lookup`, `formula`, `vector`, etc.).
1515
- **`QuerySchema`**: A JSON-based AST for querying data (replaces SQL).
1616
- **`IDataDriver`**: The authoritative contract for database adapters (SQL, NoSQL, Memory).
17-
- **`AnalyticsSchema`**: OLAP cubes, measures, and dimensions.
17+
Exported from `@objectstack/spec/contracts` — see §6.
18+
- **`CubeSchema`**: OLAP cubes, measures, and dimensions.
1819

1920
### Layer 2: ObjectOS (`@objectstack/spec/system` & `@objectstack/spec/api`)
2021
**The Runtime Kernel**. Defines "How System Operates".
2122
- **`ManifestSchema`**: `objectstack.config.ts` configuration.
22-
- **`IdentitySchema`**: Users, Roles, Organizations, SCIM.
23+
- **`OrganizationSchema`**: Organizations, members, positions, SCIM provisioning.
2324
- **`EventSchema`**: System bus, DLQ, and Webhooks (6 sub-modules).
24-
- **`EndpointSchema`**: API Gateway configuration.
25+
- **`ApiEndpointSchema`**: API Gateway configuration.
2526
- **`PluginSchema`**: Module lifecycle, security, registry, loading.
2627

2728
### Layer 3: ObjectUI (`@objectstack/spec/ui`)
@@ -30,14 +31,13 @@ It is divided into three layers, reflected in the import paths:
3031
- **`ViewSchema`**: Layouts for data (Grid, Kanban, Calendar, Gantt).
3132
- **`ActionSchema`**: Buttons and triggers.
3233
- **`DashboardSchema`**: Widget composition.
33-
- **`ThemeSchema`**: Design tokens and theming.
3434

3535
### Layer 4: ObjectAI (`@objectstack/spec/ai`)
3636
**The Intelligence Layer**. Defines AI Agents and Pipelines.
3737
- **`AgentSchema`**: Autonomous actors with tools and permissions.
38-
- **`RAGPipelineSchema`**: Retrieval Augmented Generation pipelines.
38+
- **`KnowledgeSourceSchema`**: Retrieval sources backing RAG grounding.
3939
- **`ModelRegistrySchema`**: LLM configuration and routing.
40-
- **`MCPSchema`**: Model Context Protocol integration.
40+
- **`MCPServerRefSchema`**: Model Context Protocol integration.
4141

4242
---
4343

@@ -77,53 +77,58 @@ const query = {
7777

7878
---
7979

80-
## 3. Schema Inventory by Domain (171 schemas)
80+
## 3. Schema Inventory by Domain (207 schemas)
81+
82+
Counted as `*.zod.ts` modules under `packages/spec/src/<domain>/` — the sources
83+
that ship in this tarball (`files` includes `src/**/*.zod.ts`), so every number
84+
here is verifiable from the installed package.
8185

8286
| Domain | Count | Key Schemas |
8387
|--------|-------|-------------|
88+
| system | 36 | Auth, Cache, Compliance, Encryption, HTTP Server, License, Logging, Metrics |
8489
| kernel | 32 | Plugin, Manifest, Events (6 sub-modules), Feature, Context, Package Registry |
85-
| system | 27 | Auth, Cache, Compliance, Encryption, HTTP Server, License, Logging, Metrics |
86-
| api | 25 | Contract, Endpoint, REST Server, Discovery, GraphQL, OData, Batch, WebSocket |
87-
| data | 19 | Object, Field, Query, Filter, Driver (SQL/NoSQL/Memory/Mongo/Postgres), Hook |
88-
| ui | 18 | View, App, Action, Dashboard, Page, Chart, Component, Theme, Animation |
89-
| ai | 14 | Agent, RAG Pipeline, Model Registry, MCP, Orchestration, NLQ, Predictive |
90-
| automation | 8 | Flow, Workflow, Trigger, Approval, ETL, State Machine, Webhook |
91-
| integration | 7 | Connector (Database, File Storage, GitHub, MQ, SaaS, Vercel) |
92-
| shared | 6 | Enums, HTTP, Identifiers, Mapping, Metadata Types, Connector Auth |
93-
| security | 5 | Permission, Policy, RLS, Sharing, Territory |
94-
| identity | 4 | Identity, Organization, Role, SCIM |
95-
| cloud | 4 | Marketplace, Developer Portal, App Store, Marketplace Admin |
96-
| studio | 1 | Studio Plugin Manifest |
90+
| data | 30 | Object, Field, Query, Filter, Driver (SQL/NoSQL/Memory/Mongo/Postgres), Cube |
91+
| api | 29 | Endpoint, REST Server, Discovery, OData, Batch, WebSocket, Response Envelope |
92+
| ui | 18 | View, App, Action, Dashboard, Page, Chart, Component, Animation |
93+
| automation | 13 | Flow, Approval, BPMN Interop, Control Flow, State Machine, Webhook |
94+
| shared | 13 | Enums, HTTP, Identifiers, Mapping, Metadata Types, Connector Auth, Retry Policy |
95+
| ai | 11 | Agent, Conversation, Knowledge Source/Document, Model Registry, MCP, Skill, Tool |
96+
| cloud | 11 | Marketplace, Developer Portal, App Store, Environment, Package, Tenant |
97+
| identity | 5 | Identity, Organization, Position, SCIM, Eval User |
98+
| security | 4 | Permission, RLS, Sharing, Explain |
99+
| studio | 3 | Flow Builder, Object Designer, Studio Plugin |
100+
| integration | 1 | Connector |
101+
| qa | 1 | Testing |
97102

98103
---
99104

100105
## 4. Key Exports by Namespace
101106

102107
### `import * as Data from '@objectstack/spec/data'`
103108
- `ObjectSchema`, `FieldSchema`: Logic & Storage definition.
104-
- `QuerySchema`, `FilterSchema`: Data retrieval AST.
105-
- `IDataDriver`, `DatasourceSchema`: Database connectivity.
106-
- `AnalyticsSchema`: OLAP cubes and metrics.
109+
- `QuerySchema`, `FilterArraySchema`: Data retrieval AST.
110+
- `DatasourceSchema`, `DriverInterfaceSchema`: Database connectivity.
111+
- `CubeSchema`: OLAP cubes and metrics.
107112

108113
### `import * as UI from '@objectstack/spec/ui'`
109114
- `ViewSchema`: `type: 'grid' | 'kanban' | 'calendar'`.
110-
- `FormSchema`: `layout: 'simple' | 'tabbed'`.
115+
- `FormViewSchema`: Form layout and sections.
111116
- `DashboardSchema`: Widget composition.
112-
- `ThemeSchema`: Design tokens.
117+
- `AppSchema`, `ActionSchema`: Navigation and triggers.
113118

114-
### `import * as System from '@objectstack/spec/system'`
115-
- `PluginSchema`: Module lifecycle.
119+
### `import * as Kernel from '@objectstack/spec/kernel'`
120+
- `PluginSchema`, `ManifestSchema`: Module lifecycle and configuration.
116121
- `EventSchema`: Pub/Sub definitions.
117-
- `PolicySchema`: Security rules.
122+
- `KernelSecurityPolicySchema`: Plugin security rules.
118123

119124
### `import * as AI from '@objectstack/spec/ai'`
120125
- `AgentSchema`: AI agent configuration.
121-
- `RAGPipelineSchema`: Retrieval pipelines.
126+
- `KnowledgeSourceSchema`, `KnowledgeDocumentSchema`: Retrieval sources.
122127
- `ModelRegistrySchema`: LLM routing.
123128

124129
### `import * as API from '@objectstack/spec/api'`
125-
- `EndpointSchema`: REST/GraphQL endpoints.
126-
- `ContractSchema`: Request/Response envelopes.
130+
- `ApiEndpointSchema`: REST endpoints.
131+
- `ResponseEnvelopeConfigSchema`, `ApiErrorSchema`: Request/Response envelopes.
127132
- `DiscoverySchema`: Service discovery.
128133

129134
---
@@ -165,11 +170,14 @@ function registerObject(rawConfig: unknown) {
165170
| `IAnalyticsService` | query, aggregate, timeSeries |
166171
| `IAuthService` | authenticate, authorize, validateToken |
167172
| `IAutomationService` | executeFlow, triggerWorkflow |
168-
| `IUIService` | **DEPRECATED** — use IMetadataService.getView(), .listViews(), .getEffective('view', name, { userId }) |
169173

170174
---
171175

172-
## 7. Package Ecosystem (19 packages)
176+
## 7. Package Ecosystem (68 packages)
177+
178+
The workspace publishes 68 packages under the `@objectstack` scope. The table
179+
below is a curated entry-point list, not the full set — drivers, connectors,
180+
triggers, plugins and kernel-managed services each form their own family.
173181

174182
| Package | Description |
175183
|---------|-------------|
@@ -183,9 +191,9 @@ function registerObject(rawConfig: unknown) {
183191
| `@objectstack/client-react` | React hooks for client |
184192
| `@objectstack/cli` | Command-line interface |
185193
| `@objectstack/hono` | Hono adapter |
186-
| `@objectstack/nextjs` | Next.js adapter |
187-
| `@objectstack/nestjs` | NestJS adapter |
188194
| `@objectstack/driver-memory` | In-memory database driver |
195+
| `@objectstack/driver-sql` | SQL database driver |
196+
| `@objectstack/types` | Shared TypeScript utilities |
189197

190198
---
191199

packages/spec/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@
268268
"check:dual-source-exports": "tsx scripts/check-dual-source-exports.ts --self-test && tsx scripts/check-dual-source-exports.ts",
269269
"check:browser-reachable-entries": "tsx scripts/check-browser-reachable-entries.ts --self-test && tsx scripts/check-browser-reachable-entries.ts",
270270
"check:objectui-pin-citations": "tsx scripts/check-objectui-pin-citations.ts --self-test && tsx scripts/check-objectui-pin-citations.ts",
271+
"check:llms-txt": "tsx scripts/check-llms-txt.ts --self-test && tsx scripts/check-llms-txt.ts",
271272
"check:authorable-surface": "OS_EAGER_SCHEMAS=1 tsx scripts/build-schemas.ts --check",
272273
"gen:migration-registry": "tsx scripts/build-migration-registry.ts",
273274
"check:migration-registry": "tsx scripts/build-migration-registry.ts --self-test --check",

packages/spec/scripts/check-generated.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,19 @@ const NO_GENERATOR: ReadonlyArray<{ check: string; why: string }> = [
278278
check: 'check:objectui-pin-citations',
279279
why: 'audits spec source prose: a citation in the asserting spelling (`.objectui-sha` = `<sha>`) must equal the root pin file — no artifact, and deliberately no `gen:`, because rewriting the sha without re-measuring the anchors beside it is the failure mode (#10274)',
280280
},
281+
// #11344. The nearest sibling to `check:objectui-pin-citations` above, and
282+
// classified NO_GENERATOR for the same reason rather than for a bookkeeping
283+
// one. `llms.txt` is hand-kept prose that SHIPS in the tarball (`files`), and
284+
// the obvious `gen:` — restamp each count, drop each dead symbol — is the one
285+
// operation that must never be offered: the number is not the claim, the
286+
// sentence beside it is. Restamping `| integration | 7 | Connector (Database,
287+
// File Storage, GitHub, MQ, SaaS, Vercel) |` to `1` would leave a freshly
288+
// dated row listing six connectors that do not exist, converting a loud
289+
// staleness into a silent lie. A failure here is a re-read of the section.
290+
{
291+
check: 'check:llms-txt',
292+
why: 'audits the shipped llms.txt: every advertised symbol must resolve against api-surface/, every `@objectstack/spec/x` against the manifest `exports`, and every declared count against src/ and the workspace — no artifact, and deliberately no `gen:`, because restamping a count without re-reading the prose beside it is the failure mode (#11344)',
293+
},
281294
];
282295

283296
/**

0 commit comments

Comments
 (0)