diff --git a/.changeset/37753-build-progress-frame-retired.md b/.changeset/37753-build-progress-frame-retired.md new file mode 100644 index 00000000000..66e78b95621 --- /dev/null +++ b/.changeset/37753-build-progress-frame-retired.md @@ -0,0 +1,22 @@ +--- +'@objectstack/spec': minor +--- + +fix(spec)!: retire the build-progress stream frame (`ai/build-progress.zod.ts`) — its reader and its producer are gone + +Clause-②: no (narrowing) — six published exports of `@objectstack/spec/ai` are removed +Metadata-protocol: narrowed + + + +**BREAKING** for TypeScript code that imports the build-progress frame from `@objectstack/spec/ai`. The module declared the payload of the `data-build-progress` stream part the build chat drew as its progress panel. That panel was removed with the build chat front end, and the cloud build loop that emitted the frame was removed with it, so nothing parsed the frame any more and the exported schemas read as a capability that no longer exists (ADR-0049 enforce-or-remove). It was never authored metadata: no metadata type, source file or stored row carries it, so there is nothing for `os migrate meta` to rewrite. A lingering import stops compiling, which is where an upgrader meets the change. + +What moves (each line FROM → TO): + +- `BuildProgressFrameSchema`, `BuildProgressFrame` (`@objectstack/spec/ai`): FROM the frame's `data` floor (`phase`, `hop`, `tool`) TO removed — delete the import and the code that emits or reads a `data-build-progress` part. +- `BuildProgressPhaseSchema`, `BuildProgressPhase`, `BUILD_PROGRESS_PHASES` (`@objectstack/spec/ai`): FROM the closed phase vocabulary (`structure`, `data`, `verify`, `done`) TO removed — delete the import. +- `BUILD_PROGRESS_FRAME_TYPE` (`@objectstack/spec/ai`): FROM the literal `'data-build-progress'` TO removed — delete the import. + +The fix: delete the imports. A host that still streams a progress part of its own passes any `data-` part name to `ctx.onProgress` (`ToolExecutionContext.onProgress`, unchanged) and owns the payload shape it sends. + +The retirement kit: `ai/build-progress.zod.ts` and its test deleted, `RETIRED_DEFS_BY_MAJOR[19]` rows `ai/BuildProgressFrame` and `ai/BuildProgressPhase`, D3 `ai-build-progress-frame-retired`, the `json-schema.manifest/ai.json` and `authorable-surface/ai.json` rows deleted deliberately (the def is no longer emitted), the regenerated `api-surface`, `export-origins` and `declaration-map` shards, the removed `build-progress` reference page, and the `type-alias-convention` pin count 881 → 879. diff --git a/content/docs/references/ai/build-progress.mdx b/content/docs/references/ai/build-progress.mdx deleted file mode 100644 index 059fe43db7a..00000000000 --- a/content/docs/references/ai/build-progress.mdx +++ /dev/null @@ -1,131 +0,0 @@ ---- -title: Build Progress schema — AI Protocol reference -navTitle: Build Progress -description: "Build-progress PHASE vocabulary for the data-build-progress stream frame (the cloud build-progress card, ruling A)." ---- - -{/* ⚠️ AUTO-GENERATED — DO NOT EDIT. Run build-docs.ts to regenerate. Hand-written docs live in the module folders under content/docs/. */} - -Build-progress PHASE vocabulary for the `data-build-progress` stream frame -(the cloud build-progress card, ruling A). - -## How to read the claims in this module - -This vocabulary is CLOSED, so whoever next asks whether a fifth member is -warranted has to re-measure before moving the array — and can only do that -if they can tell a reading from a ruling. Every producer claim below -therefore carries exactly one of three labels, and none is left bare: - -- **measured on a named reachable source** — a repository and path the - reader can open and re-measure, cited with the tree it was read against. -- **declared by ruling** — a maintainer decision. The authority is the - ruling; ⛔ it is not evidence the behaviour exists yet. -- **inferred** — deduced from something reachable, or carried from a record - this repository cannot open. ⛔ Never re-cite it as a measurement. - -## Producer - -The cloud AI-studio **agent loop** — deliberately not the tool it just ran. -**Declared by ruling**: the cloud build-progress card's ruling A owns WHERE in the loop a frame is -emitted; this module declares only what such a frame may SAY. - -A build turn applies its change through `apply_blueprint` / `apply_edit` and -then keeps working: the loop spends a further POST-APPLY VERIFICATION window -re-reading and re-seeding what it wrote. **Inferred.** The only record of -that window is the cloud#1838 turn, reported there as 111 seconds and 9 tool -calls *after* `apply_blueprint` returned — and `objectstack-ai/cloud` is -outside the set of repositories a reader of this file can open, so the -figure is carried here, not measured, and cannot be re-measured from this -repo. WHICH tools those 9 calls were is recorded nowhere reachable either: -neither objectstack#18451 nor objectui#7388 names them, so "one of them ran -the registered `verify_build` tool" is **inferred** as well. What is -**measured on a named reachable source** is narrower than that — only that -`verify_build` is a registered platform tool, listed in -`PLATFORM_TOOLS_BY_PACKAGE` in `../system/constants/platform-tool-names`. - -A tool's own `ctx.onProgress` handle dies when the tool returns, so a frame -emitted in that window can only come from the loop. **Inferred** from a -reachable contract: `AIToolContext.onProgress` in `../contracts/ai-service` -declares the emit as happening WHILE the tool executes, before it returns; -that the handle is gone afterwards is the deduction, not the declaration. - -## Consumer - -The objectui chat panel — `extractBuildProgress` in -`packages/plugin-chatbot/src/mapMessages.ts`, which lifts the reconciled part -onto `ChatBuildProgress` for the build panel in `ChatbotEnhanced.tsx`. That -reader recognises a fixed set and coerces everything else to `'structure'`, -which renders a "still building" spinner. So an UNDECLARED phase is not -merely unlabelled — it reads as the wrong phase, and the user watches a -build that finished two minutes ago still claim to be building -(objectui#7388). The panel's per-phase COPY is objectui's to choose; this -module fixes only the set of values it must be able to tell apart. - -## Channel - -Unchanged: the `data-`-prefixed custom part described on -`AIToolContext.onProgress` in `../contracts/ai-service`, reconciled in place -under a stable part id. This module adds the vocabulary that prose has always -assumed and never declared; it moves no transport and renames nothing. - -## Liveness watch — declared ahead, and ⛔ nothing gates it - -Three surfaces here are declared ahead of any code that uses them: the -`verify` phase, and the frame's `hop` and `tool` fields. Across every -repository reachable from here they have zero emitters and zero readers -(**measured on named reachable sources** — each reading is recorded in the -source beside its surface: on `BUILD_PROGRESS_PHASES` for the phase, and on -the `hop` / `tool` field declarations). They stand on a ruling instead -(**declared by ruling**): the cloud build-progress card ruled the vocabulary in, and -objectui#7388 asked the panel to be able to name the phase. That is a good -reason, and it is not a measurement. - -⛔ No gate watches this. The ADR-0049 liveness ledger is rooted in the -metadata-type registry, and `BuildProgressFrame` is not a registered -metadata type, so the liveness job stays green however long these three go -unused. Two named carriers are meant to close it — the cloud build-progress card for the -emitter, block 2 of the objectui build-panel card for the consumer's strict parse. If neither -lands, the three become enforce-or-remove candidates with nothing watching -them, and the only thing that notices is a person reading this paragraph. - - -**Source:** `packages/spec/src/ai/build-progress.zod.ts` - - -## TypeScript Usage - -```typescript -import { BuildProgressFrameSchema, BuildProgressPhaseSchema } from '@objectstack/spec/ai'; -import type { BuildProgressFrame, BuildProgressPhase } from '@objectstack/spec/ai'; - -// Validate data -const result = BuildProgressFrameSchema.parse(data); -``` - ---- - -## BuildProgressFrame - -### Properties - -| Property | Type | Required | Description | -| :--- | :--- | :--- | :--- | -| **phase** | `Enum<'structure' \| 'data' \| 'verify' \| 'done'>` | ✅ | Build-turn phase this frame reports | -| **hop** | `integer` | optional | Post-apply verification hop this frame reports | -| **tool** | `string` | optional | Name of the tool the current hop is running | - - ---- - -## BuildProgressPhase - -### Allowed Values - -* `structure` -* `data` -* `verify` -* `done` - - ---- - diff --git a/content/docs/references/ai/index.mdx b/content/docs/references/ai/index.mdx index dd0bf3925c6..cd644fb5866 100644 --- a/content/docs/references/ai/index.mdx +++ b/content/docs/references/ai/index.mdx @@ -1,7 +1,7 @@ --- title: AI Protocol — complete schema reference navTitle: AI Protocol -description: "The ObjectStack AI Protocol in 18 reference pages: every schema in @objectstack/spec with its properties, types, defaults and a TypeScript example." +description: "The ObjectStack AI Protocol in 17 reference pages: every schema in @objectstack/spec with its properties, types, defaults and a TypeScript example." --- {/* ⚠️ AUTO-GENERATED — DO NOT EDIT. Run build-docs.ts to regenerate. Hand-written docs live in the module folders under content/docs/. */} @@ -12,7 +12,6 @@ This section contains all protocol schemas for the ai layer of ObjectStack. - diff --git a/content/docs/references/ai/meta.json b/content/docs/references/ai/meta.json index d77e258852b..8803b3e8f34 100644 --- a/content/docs/references/ai/meta.json +++ b/content/docs/references/ai/meta.json @@ -17,7 +17,6 @@ "---More---", "ai-context", "ask-question", - "build-progress", "dataset-tools", "draft-review", "object-query-source", diff --git a/content/docs/references/index.mdx b/content/docs/references/index.mdx index 04a0cd9dd38..42379619350 100644 --- a/content/docs/references/index.mdx +++ b/content/docs/references/index.mdx @@ -1,7 +1,7 @@ --- title: Protocol reference — every schema by module navTitle: Protocol Reference -description: Every schema published by @objectstack/spec — 1744 schemas across 14 protocol modules +description: Every schema published by @objectstack/spec — 1742 schemas across 14 protocol modules --- {/* ⚠️ AUTO-GENERATED — DO NOT EDIT. Run build-docs.ts to regenerate. Hand-written docs live in the module folders under content/docs/. */} @@ -22,7 +22,7 @@ counts are sums of the rows they head. Regenerate with | Module | Pages | Schemas | Description | | :--- | ---: | ---: | :--- | -| [AI Protocol](/docs/references/ai) | 18 | 104 | Agents, tools, skills, RAG and knowledge sources, model registry, conversations. | +| [AI Protocol](/docs/references/ai) | 17 | 102 | Agents, tools, skills, RAG and knowledge sources, model registry, conversations. | | [API Protocol](https://github.com/objectstack-ai/objectstack/tree/main/packages/spec/docs/references/api) | 37 | 529 | REST contracts, endpoints, routing, realtime, batch, discovery. | | [Automation Protocol](/docs/references/automation) | 16 | 82 | Flows and their nodes, approvals, ETL pipelines, webhooks, state machines, execution records. | | [Data Protocol](/docs/references/data) | 35 | 197 | Objects, fields, queries, filters, datasources and drivers — the ObjectQL layer. | @@ -36,13 +36,13 @@ counts are sums of the rows they head. Regenerate with | [Studio Protocol](https://github.com/objectstack-ai/objectstack/tree/main/packages/spec/docs/references/studio) | 3 | 35 | Studio designer metadata — the authoring surfaces for the protocols above. | | [System Protocol](https://github.com/objectstack-ai/objectstack/tree/main/packages/spec/docs/references/system) | 40 | 298 | The runtime environment — logging, jobs, cache, metrics, notifications, i18n and compliance. | | [UI Protocol](/docs/references/ui) | 17 | 186 | Apps, pages, views, dashboards, reports, actions and themes — the ObjectUI layer. | -| **Total** | **224** | **1744** | 14 protocol modules | +| **Total** | **223** | **1742** | 14 protocol modules | --- ## AI Protocol -**Source:** `packages/spec/src/ai/` · **Import:** `@objectstack/spec/ai` · **18 pages, 104 schemas** +**Source:** `packages/spec/src/ai/` · **Import:** `@objectstack/spec/ai` · **17 pages, 102 schemas** Agents, tools, skills, RAG and knowledge sources, model registry, conversations. @@ -51,7 +51,6 @@ Agents, tools, skills, RAG and knowledge sources, model registry, conversations. | [`agent.zod.ts`](/docs/references/ai/agent) | `AIModelConfig`, `Agent`, `StructuredOutputConfig`, `StructuredOutputFormat`, `TransformPipelineStep` | | [`ai-context.zod.ts`](/docs/references/ai/ai-context) | `AiContext`, `AiContextBody`, `AiContextRelated`, `AiContextRelatedWhere` | | [`ask-question.zod.ts`](/docs/references/ai/ask-question) | `AskQuestion`, `AskQuestionEnvelope`, `AskQuestionOption` | -| [`build-progress.zod.ts`](/docs/references/ai/build-progress) | `BuildProgressFrame`, `BuildProgressPhase` | | [`conversation.zod.ts`](/docs/references/ai/conversation) | `CodeContent`, `ConversationAnalytics`, `ConversationContext`, `ConversationMessage`, `ConversationSession`, `ConversationSummary`, `FileContent`, `FunctionCall`, `ImageContent`, `MessageContent`, `MessageContentType`, `MessagePruningEvent`, `MessageRole`, `TextContent`, `TokenBudgetConfig`, `TokenBudgetStrategy`, `TokenUsageStats`, `ToolCall` | | [`dataset-tools.zod.ts`](/docs/references/ai/dataset-tools) | `DatasetNextStep`, `DatasetNextStepDecision`, `DatasetProvenance`, `DatasetTermCandidate`, `DatasetTermMatch`, `DatasetTermMatchedOn`, `DatasetToolCatalogDimension`, `DatasetToolCatalogEntry`, `DatasetToolCatalogMeasure`, `ListDatasetsInput`, `ListDatasetsOutput`, `QueryDatasetInput`, `QueryDatasetOutput` | | [`draft-review.zod.ts`](/docs/references/ai/draft-review) | `DraftReviewItem`, `DraftReviewLinks`, `DraftReviewList`, `DraftReviewVerdict`, `DraftReviewVerdictRefusal` | diff --git a/docs/audits/2026-07-unknown-key-strictness-ledger.counts/ai.md b/docs/audits/2026-07-unknown-key-strictness-ledger.counts/ai.md index 5f25e0c458c..3bf684e33e2 100644 --- a/docs/audits/2026-07-unknown-key-strictness-ledger.counts/ai.md +++ b/docs/audits/2026-07-unknown-key-strictness-ledger.counts/ai.md @@ -19,4 +19,4 @@ hand-patch a number here** — fix the code or the verdict and regenerate. | Dir | Sites | |---|---| -| `ai/` | 121 | +| `ai/` | 120 | diff --git a/packages/spec/api-surface/ai.json b/packages/spec/api-surface/ai.json index fdd2e061505..fbc00deb6cc 100644 --- a/packages/spec/api-surface/ai.json +++ b/packages/spec/api-surface/ai.json @@ -45,8 +45,6 @@ "AskQuestionOptionSchema (const)", "AskQuestionParsed (type)", "AskQuestionSchema (const)", - "BUILD_PROGRESS_FRAME_TYPE (const)", - "BUILD_PROGRESS_PHASES (const)", "BlueprintApp (type)", "BlueprintAppParsed (type)", "BlueprintAppSchema (const)", @@ -71,10 +69,6 @@ "BlueprintWidgetCondition (type)", "BlueprintWidgetConditionSchema (const)", "BodyHeading (interface)", - "BuildProgressFrame (type)", - "BuildProgressFrameSchema (const)", - "BuildProgressPhase (type)", - "BuildProgressPhaseSchema (const)", "CodeContentSchema (const)", "ConversationAnalytics (type)", "ConversationAnalyticsParsed (type)", diff --git a/packages/spec/authorable-surface/ai.json b/packages/spec/authorable-surface/ai.json index f5d1964962c..b844b115a60 100644 --- a/packages/spec/authorable-surface/ai.json +++ b/packages/spec/authorable-surface/ai.json @@ -123,9 +123,6 @@ "ai/BlueprintWidgetCondition:field", "ai/BlueprintWidgetCondition:op", "ai/BlueprintWidgetCondition:value", - "ai/BuildProgressFrame:hop", - "ai/BuildProgressFrame:phase", - "ai/BuildProgressFrame:tool", "ai/CodeContent:language", "ai/CodeContent:metadata", "ai/CodeContent:text", diff --git a/packages/spec/declaration-map/ai.json b/packages/spec/declaration-map/ai.json index 745aae943a1..5c53d6cc8af 100644 --- a/packages/spec/declaration-map/ai.json +++ b/packages/spec/declaration-map/ai.json @@ -41,10 +41,6 @@ "BlueprintViewSchema": "ai/BlueprintView", "BlueprintWidgetCondition": "ai/BlueprintWidgetCondition", "BlueprintWidgetConditionSchema": "ai/BlueprintWidgetCondition", - "BuildProgressFrame": "ai/BuildProgressFrame", - "BuildProgressFrameSchema": "ai/BuildProgressFrame", - "BuildProgressPhase": "ai/BuildProgressPhase", - "BuildProgressPhaseSchema": "ai/BuildProgressPhase", "CodeContentSchema": "ai/CodeContent", "ConversationAnalytics": "ai/ConversationAnalytics", "ConversationAnalyticsSchema": "ai/ConversationAnalytics", diff --git a/packages/spec/export-origins/ai.json b/packages/spec/export-origins/ai.json index ad9e5772fec..d5129c141cd 100644 --- a/packages/spec/export-origins/ai.json +++ b/packages/spec/export-origins/ai.json @@ -45,8 +45,6 @@ "AskQuestionOptionSchema": "src/ai/ask-question.zod.ts#AskQuestionOptionSchema (const)", "AskQuestionParsed": "src/ai/ask-question.zod.ts#AskQuestionParsed (type)", "AskQuestionSchema": "src/ai/ask-question.zod.ts#AskQuestionSchema (const)", - "BUILD_PROGRESS_FRAME_TYPE": "src/ai/build-progress.zod.ts#BUILD_PROGRESS_FRAME_TYPE (const)", - "BUILD_PROGRESS_PHASES": "src/ai/build-progress.zod.ts#BUILD_PROGRESS_PHASES (const)", "BlueprintApp": "src/ai/solution-blueprint.zod.ts#BlueprintApp (type)", "BlueprintAppParsed": "src/ai/solution-blueprint.zod.ts#BlueprintAppParsed (type)", "BlueprintAppSchema": "src/ai/solution-blueprint.zod.ts#BlueprintAppSchema (const)", @@ -71,10 +69,6 @@ "BlueprintWidgetCondition": "src/ai/solution-blueprint.zod.ts#BlueprintWidgetCondition (type)", "BlueprintWidgetConditionSchema": "src/ai/solution-blueprint.zod.ts#BlueprintWidgetConditionSchema (const)", "BodyHeading": "src/ai/record-body-anchor.ts#BodyHeading (interface)", - "BuildProgressFrame": "src/ai/build-progress.zod.ts#BuildProgressFrame (type)", - "BuildProgressFrameSchema": "src/ai/build-progress.zod.ts#BuildProgressFrameSchema (const)", - "BuildProgressPhase": "src/ai/build-progress.zod.ts#BuildProgressPhase (type)", - "BuildProgressPhaseSchema": "src/ai/build-progress.zod.ts#BuildProgressPhaseSchema (const)", "CodeContentSchema": "src/ai/conversation.zod.ts#CodeContentSchema (const)", "ConversationAnalytics": "src/ai/conversation.zod.ts#ConversationAnalytics (type)", "ConversationAnalyticsParsed": "src/ai/conversation.zod.ts#ConversationAnalyticsParsed (type)", diff --git a/packages/spec/json-schema.manifest/ai.json b/packages/spec/json-schema.manifest/ai.json index 75ae2fdc37d..4045da724c8 100644 --- a/packages/spec/json-schema.manifest/ai.json +++ b/packages/spec/json-schema.manifest/ai.json @@ -22,8 +22,6 @@ "ai/BlueprintSummaryOperations", "ai/BlueprintView", "ai/BlueprintWidgetCondition", - "ai/BuildProgressFrame", - "ai/BuildProgressPhase", "ai/CodeContent", "ai/ConversationAnalytics", "ai/ConversationContext", diff --git a/packages/spec/llms.txt b/packages/spec/llms.txt index 2118475e129..421abf76260 100644 --- a/packages/spec/llms.txt +++ b/packages/spec/llms.txt @@ -77,7 +77,7 @@ const query = { --- -## 3. Schema Inventory by Domain (233 schemas) +## 3. Schema Inventory by Domain (232 schemas) Counted as `*.zod.ts` modules under `packages/spec/src//` — the sources that ship in this tarball (`files` includes `src/**/*.zod.ts`), so every number @@ -92,7 +92,7 @@ here is verifiable from the installed package. | ui | 19 | View, App (incl. AI Chat Nav Params), Action, Dashboard, Page, Chart, Component, Animation | | automation | 16 | Flow, Approval, Assignment Rule, BPMN Interop, Control Flow, Webhook, Schedule Organization | | shared | 16 | Enums, HTTP, Identifiers, Mapping, Metadata Types, Connector Auth, Retry Policy, Conditional Formatting, Value Domain, Epoch Instant (EpochMs), Duration (DurationMs / DurationSeconds) | -| ai | 18 | Agent, AI Context (context pack), Ask Question (question-card envelope), Build Progress, Conversation, Dataset Tools, Draft Review (`data-draft-review` part), Knowledge Source/Document, Model Registry, MCP, Object-Query Source, Record Citation, Record Context Tools (`get_record_context`), Skill, Tool | +| ai | 17 | Agent, AI Context (context pack), Ask Question (question-card envelope), Conversation, Dataset Tools, Draft Review (`data-draft-review` part), Knowledge Source/Document, Model Registry, MCP, Object-Query Source, Record Citation, Record Context Tools (`get_record_context`), Skill, Tool | | identity | 5 | Identity, Organization, Position, SCIM, Eval User | | marketplace | 5 | Marketplace, Package, Package Version, Template Manifest, Taxonomy | | security | 5 | Permission, RLS, Sharing, Queue, Explain | diff --git a/packages/spec/src/ai/build-progress.test.ts b/packages/spec/src/ai/build-progress.test.ts deleted file mode 100644 index ba4b916177c..00000000000 --- a/packages/spec/src/ai/build-progress.test.ts +++ /dev/null @@ -1,239 +0,0 @@ -// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license. - -/** - * Pin for the build-progress PHASE vocabulary (cloud#2172 ruling A). - * - * What is actually at stake here is not "does zod reject a bad string" — it is - * that this vocabulary is CLOSED and that its refusal is LOUD. objectui#7388 - * measured the cost of the alternative: the consumer's reader coerces any - * value it does not recognise to `'structure'`, so a phase nobody declared - * renders as a "still building" spinner for the 111 seconds the build spends - * being verified after it finished. A refusal that merely throws leaves the - * next author guessing; a refusal that names the accepted set tells them. - * - * So the refusal leg asserts the ENVELOPE, not the throw: zod 4 answers an - * out-of-vocabulary enum value with `invalid_value` and carries the full - * accepted set on the issue. ⛔ A bare `expect(...).toThrow()` here would stay - * green against a schema that had degraded to a bare `z.string()` with a - * refinement, which is exactly the degradation worth catching. - * - * The membership leg is the closed-enum pin. Each member was measured against - * a real end of the channel (provenance is recorded per member on - * `BUILD_PROGRESS_PHASES` in the source), so this array moving is a claim that - * someone re-measured — not an edit to wave through. - */ - -import { readFileSync } from 'node:fs'; -import { dirname, resolve } from 'node:path'; -import { fileURLToPath } from 'node:url'; - -import { describe, it, expect } from 'vitest'; - -import { - BUILD_PROGRESS_PHASES, - BUILD_PROGRESS_FRAME_TYPE, - BuildProgressPhaseSchema, - BuildProgressFrameSchema, - type BuildProgressPhase, -} from './build-progress.zod'; - -/** - * The phases objectui's reader discriminates TODAY - * (`packages/plugin-chatbot/src/mapMessages.ts` `extractBuildProgress`, and the - * `ChatBuildProgress['phase']` union in `ChatbotEnhanced.tsx`). Declaring - * `verify` must not disturb the inherited three — this is the control that has - * to keep moving, not a restatement of the vocabulary under test. - */ -const PHASES_THE_CONSUMER_ALREADY_RENDERS = ['structure', 'data', 'done'] as const; - -describe('BUILD_PROGRESS_PHASES (closed membership)', () => { - it('is exactly the measured vocabulary, in lifecycle order', () => { - expect(BUILD_PROGRESS_PHASES).toEqual(['structure', 'data', 'verify', 'done']); - }); - - it('still contains every phase the objectui reader already discriminates', () => { - for (const phase of PHASES_THE_CONSUMER_ALREADY_RENDERS) { - expect(BUILD_PROGRESS_PHASES).toContain(phase); - } - }); - - it('names the post-apply verification phase the card exists to declare', () => { - expect(BUILD_PROGRESS_PHASES).toContain('verify'); - }); -}); - -describe('BuildProgressPhaseSchema', () => { - it('parses every declared phase', () => { - for (const phase of BUILD_PROGRESS_PHASES) { - const result = BuildProgressPhaseSchema.safeParse(phase); - expect(result.success).toBe(true); - expect(result.success && result.data).toBe(phase); - } - }); - - it('REFUSES an undeclared phase, and the refusal names the accepted set', () => { - const result = BuildProgressPhaseSchema.safeParse('rebuilding'); - - expect(result.success).toBe(false); - if (result.success) throw new Error('unreachable: an undeclared phase parsed'); - - const [issue] = result.error.issues; - expect(result.error.issues).toHaveLength(1); - expect(issue.code).toBe('invalid_value'); - // The loud half: the author is told what WAS allowed, not merely that they - // were wrong. Compared against the exported vocabulary so the two cannot - // drift apart silently. - expect((issue as { values?: readonly unknown[] }).values).toEqual([...BUILD_PROGRESS_PHASES]); - }); - - it('REFUSES the neighbouring vocabulary of the sibling blueprint-progress frame', () => { - // `data-blueprint-progress` is a DIFFERENT channel with its own phases - // (`designing` / `done`). Folding its vocabulary in here would be the - // "one enum for two frames" mistake; `designing` must not parse. - expect(BuildProgressPhaseSchema.safeParse('designing').success).toBe(false); - }); - - it('REFUSES a non-string', () => { - expect(BuildProgressPhaseSchema.safeParse(3).success).toBe(false); - expect(BuildProgressPhaseSchema.safeParse(undefined).success).toBe(false); - }); -}); - -describe('BUILD_PROGRESS_FRAME_TYPE', () => { - it('is the literal both ends select on', () => { - // objectui selects parts with `p.type === 'data-build-progress'`; the - // `data-` prefix is what makes it a custom data part at all. - expect(BUILD_PROGRESS_FRAME_TYPE).toBe('data-build-progress'); - expect(BUILD_PROGRESS_FRAME_TYPE.startsWith('data-')).toBe(true); - }); -}); - -describe('BuildProgressFrameSchema', () => { - it('parses a frame carrying only the required phase', () => { - const result = BuildProgressFrameSchema.safeParse({ phase: 'verify' }); - expect(result.success).toBe(true); - expect(result.success && result.data.phase).toBe('verify'); - expect(result.success && result.data.hop).toBeUndefined(); - expect(result.success && result.data.tool).toBeUndefined(); - }); - - it('parses a frame carrying both optional fields', () => { - const result = BuildProgressFrameSchema.safeParse({ - phase: 'verify', - hop: 4, - tool: 'verify_build', - }); - expect(result.success).toBe(true); - expect(result.success && result.data).toMatchObject({ - phase: 'verify', - hop: 4, - tool: 'verify_build', - }); - }); - - it('parses a frame carrying each optional field on its own', () => { - expect(BuildProgressFrameSchema.safeParse({ phase: 'data', hop: 0 }).success).toBe(true); - expect(BuildProgressFrameSchema.safeParse({ phase: 'data', tool: 'create_seed' }).success).toBe(true); - }); - - it('is a FLOOR: the panel fields objectui already reads survive the parse', () => { - // Regression guard for "tighten it to .strict()". Every key below is read - // by `extractBuildProgress` off this same frame today; refusing or - // stripping them would break the shipping consumer. - const shipping = { - phase: 'structure' as const, - appLabel: 'CRM', - items: [{ type: 'object', name: 'contacts' }], - done: 1, - total: 4, - seq: 12, - }; - - const result = BuildProgressFrameSchema.safeParse(shipping); - expect(result.success).toBe(true); - expect(result.success && result.data).toMatchObject(shipping); - }); - - it('REFUSES an undeclared phase, locating it at `phase`', () => { - const result = BuildProgressFrameSchema.safeParse({ phase: 'rebuilding', hop: 1 }); - - expect(result.success).toBe(false); - if (result.success) throw new Error('unreachable: a frame with an undeclared phase parsed'); - - const [issue] = result.error.issues; - expect(issue.code).toBe('invalid_value'); - expect(issue.path).toEqual(['phase']); - }); - - it('REFUSES a frame with no phase at all', () => { - const result = BuildProgressFrameSchema.safeParse({ hop: 2, tool: 'verify_build' }); - expect(result.success).toBe(false); - expect(result.success === false && result.error.issues[0].path).toEqual(['phase']); - }); - - it('REFUSES a malformed hop and an empty tool name', () => { - expect(BuildProgressFrameSchema.safeParse({ phase: 'verify', hop: -1 }).success).toBe(false); - expect(BuildProgressFrameSchema.safeParse({ phase: 'verify', hop: 1.5 }).success).toBe(false); - expect(BuildProgressFrameSchema.safeParse({ phase: 'verify', tool: '' }).success).toBe(false); - }); -}); - -describe('BuildProgressPhase (type)', () => { - it('admits every declared member and is assignable from the array', () => { - const everyPhase: BuildProgressPhase[] = [...BUILD_PROGRESS_PHASES]; - expect(everyPhase).toHaveLength(BUILD_PROGRESS_PHASES.length); - }); -}); - -/** - * The provenance leg — and the one leg whose subject is TEXT on purpose. - * - * This module's docblock is not incidental prose. The published - * `@objectstack/spec` tarball ships the `.zod.ts` sources themselves, and the - * same text is rendered verbatim into - * `content/docs/references/ai/build-progress.mdx`. For a CLOSED vocabulary it - * is the audit trail the "re-measure before you move the array" discipline - * reads: a reader who cannot tell a MEASUREMENT from a RULING re-cites the - * ruling as evidence, and the next member goes in on a claim nobody ever made. - * - * So what is pinned here is narrow and load-bearing: that the three labels are - * defined, that `verify` is labelled as the ruling it is rather than as a - * measurement, and that the liveness watch is still present — ⛔ not the - * wording around any of them. Nothing else in this file asserts on text. - */ -describe('module docblock provenance', () => { - const SOURCE = readFileSync( - resolve(dirname(fileURLToPath(import.meta.url)), 'build-progress.zod.ts'), - 'utf-8', - ); - - it('defines all three provenance labels', () => { - for (const label of ['measured on a named reachable source', 'declared by ruling', 'inferred']) { - expect(SOURCE).toContain(label); - } - }); - - it('labels `verify` as declared by ruling, and ⛔ never as measured membership', () => { - // The bullet itself, not the surrounding paragraph: `verify` is in the - // enum because cloud#2172 ruled it in, which is a good reason and is not - // an observation of any producer or consumer. - const bullet = SOURCE.slice(SOURCE.indexOf(' * - `verify`')); - expect(bullet.slice(0, 200)).toContain('**declared by ruling**'); - - // The retired headline claimed every member was measured against a real - // end of the channel. It was false for `verify` on the day it was written. - expect(SOURCE).not.toContain('Membership was MEASURED'); - expect(SOURCE).not.toContain('every member below is one a real producer emits'); - }); - - it('keeps the liveness watch for the three declared-ahead surfaces', () => { - expect(SOURCE).toContain('## Liveness watch'); - for (const surface of ['`verify` phase', '`hop`', '`tool`']) { - expect(SOURCE).toContain(surface); - } - // The point of the watch: no gate notices, so the paragraph is the notice. - expect(SOURCE).toContain('ADR-0049'); - expect(SOURCE).toContain('the cloud build-progress card'); - expect(SOURCE).toContain('block 2 of the objectui build-panel card'); - }); -}); diff --git a/packages/spec/src/ai/build-progress.zod.ts b/packages/spec/src/ai/build-progress.zod.ts deleted file mode 100644 index 974f47dea2b..00000000000 --- a/packages/spec/src/ai/build-progress.zod.ts +++ /dev/null @@ -1,202 +0,0 @@ -// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license. - -import { z } from 'zod'; -import { lazySchema } from '../shared/lazy-schema'; - -/** - * Build-progress PHASE vocabulary for the `data-build-progress` stream frame - * (the cloud build-progress card, ruling A). - * - * ## How to read the claims in this module - * - * This vocabulary is CLOSED, so whoever next asks whether a fifth member is - * warranted has to re-measure before moving the array — and can only do that - * if they can tell a reading from a ruling. Every producer claim below - * therefore carries exactly one of three labels, and none is left bare: - * - * - **measured on a named reachable source** — a repository and path the - * reader can open and re-measure, cited with the tree it was read against. - * - **declared by ruling** — a maintainer decision. The authority is the - * ruling; ⛔ it is not evidence the behaviour exists yet. - * - **inferred** — deduced from something reachable, or carried from a record - * this repository cannot open. ⛔ Never re-cite it as a measurement. - * - * ## Producer - * - * The cloud AI-studio **agent loop** — deliberately not the tool it just ran. - * **Declared by ruling**: the cloud build-progress card's ruling A owns WHERE in the loop a frame is - * emitted; this module declares only what such a frame may SAY. - * - * A build turn applies its change through `apply_blueprint` / `apply_edit` and - * then keeps working: the loop spends a further POST-APPLY VERIFICATION window - * re-reading and re-seeding what it wrote. **Inferred.** The only record of - * that window is the cloud#1838 turn, reported there as 111 seconds and 9 tool - * calls *after* `apply_blueprint` returned — and `objectstack-ai/cloud` is - * outside the set of repositories a reader of this file can open, so the - * figure is carried here, not measured, and cannot be re-measured from this - * repo. WHICH tools those 9 calls were is recorded nowhere reachable either: - * neither objectstack#18451 nor objectui#7388 names them, so "one of them ran - * the registered `verify_build` tool" is **inferred** as well. What is - * **measured on a named reachable source** is narrower than that — only that - * `verify_build` is a registered platform tool, listed in - * `PLATFORM_TOOLS_BY_PACKAGE` in `../system/constants/platform-tool-names`. - * - * A tool's own `ctx.onProgress` handle dies when the tool returns, so a frame - * emitted in that window can only come from the loop. **Inferred** from a - * reachable contract: `AIToolContext.onProgress` in `../contracts/ai-service` - * declares the emit as happening WHILE the tool executes, before it returns; - * that the handle is gone afterwards is the deduction, not the declaration. - * - * ## Consumer - * - * The objectui chat panel — `extractBuildProgress` in - * `packages/plugin-chatbot/src/mapMessages.ts`, which lifts the reconciled part - * onto `ChatBuildProgress` for the build panel in `ChatbotEnhanced.tsx`. That - * reader recognises a fixed set and coerces everything else to `'structure'`, - * which renders a "still building" spinner. So an UNDECLARED phase is not - * merely unlabelled — it reads as the wrong phase, and the user watches a - * build that finished two minutes ago still claim to be building - * (objectui#7388). The panel's per-phase COPY is objectui's to choose; this - * module fixes only the set of values it must be able to tell apart. - * - * ## Channel - * - * Unchanged: the `data-`-prefixed custom part described on - * `AIToolContext.onProgress` in `../contracts/ai-service`, reconciled in place - * under a stable part id. This module adds the vocabulary that prose has always - * assumed and never declared; it moves no transport and renames nothing. - * - * ## Liveness watch — declared ahead, and ⛔ nothing gates it - * - * Three surfaces here are declared ahead of any code that uses them: the - * `verify` phase, and the frame's `hop` and `tool` fields. Across every - * repository reachable from here they have zero emitters and zero readers - * (**measured on named reachable sources** — each reading is recorded in the - * source beside its surface: on `BUILD_PROGRESS_PHASES` for the phase, and on - * the `hop` / `tool` field declarations). They stand on a ruling instead - * (**declared by ruling**): the cloud build-progress card ruled the vocabulary in, and - * objectui#7388 asked the panel to be able to name the phase. That is a good - * reason, and it is not a measurement. - * - * ⛔ No gate watches this. The ADR-0049 liveness ledger is rooted in the - * metadata-type registry, and `BuildProgressFrame` is not a registered - * metadata type, so the liveness job stays green however long these three go - * unused. Two named carriers are meant to close it — the cloud build-progress card for the - * emitter, block 2 of the objectui build-panel card for the consumer's strict parse. If neither - * lands, the three become enforce-or-remove candidates with nothing watching - * them, and the only thing that notices is a person reading this paragraph. - */ - -/** - * The closed phase vocabulary, in emission-lifecycle order. - * - * Membership is MIXED-PROVENANCE, not uniformly measured. Each member carries - * its own label (the three are defined at the top of this module), because the - * question a re-measure has to answer is which members a real end of the - * channel already uses and which are standing on a ruling alone: - * - * - `structure`, `data`, `done` — **measured on a named reachable source**: - * the consumer's own declared union, - * `ChatBuildProgress['phase']` at `packages/plugin-chatbot/src/ChatbotEnhanced.tsx:163` - * in objectui, and the set its reader discriminates at - * `packages/plugin-chatbot/src/mapMessages.ts:743` - * (`d.phase === 'data' || d.phase === 'done' ? d.phase : 'structure'`). - * `structure` doubles as that reader's coercion default. Read at objectui - * `dda8f3815`; line numbers drift, the two symbols are the anchor. - * - `verify` — **declared by ruling**, ⛔ not measured: the post-apply - * verification window objectui#7388 asks the panel to be able to name, and - * the reason the cloud build-progress card ruled this vocabulary into the spec. At objectui - * `dda8f3815` `packages/plugin-chatbot` has ZERO occurrences of `'verify'` - * (bright control, same instrument: `'structure'` hits 4 files there), and - * this repository emits no frame at all, so `verify` has no reachable - * emitter and no reachable reader today. **Measured on a named reachable - * source** alongside it, and narrower than a corroboration of the phase: - * `service-ai-studio` registers a `verify_build` tool - * (`../system/constants/platform-tool-names`). See the liveness watch at the - * top of this module. - * - * Order is the order a build turn passes through these states; it is NOT a - * scale. ⛔ Consumers compare phases by VALUE — never by index, and never by - * assuming every phase occurs. The two illustrations of a phase being skipped - * — a turn that applies no seed data never reporting `data`, and `apply_edit` - * turns not reporting `structure` — are **inferred**: no reachable repository - * records either, and the cloud build-progress card's emitter has not landed. ⛔ The guidance - * does not rest on them; treat every phase as optional whatever a producer - * turns out to do. - * - * Exported as an array as well as a schema so a consumer can build an - * exhaustive per-phase label map without forcing the lazy schema to - * construct just to read `.options`. - */ -export const BUILD_PROGRESS_PHASES = ['structure', 'data', 'verify', 'done'] as const; - -/** - * The phase a `data-build-progress` frame is reporting. - * - * Closed on purpose: an unrecognised value is REFUSED here, loudly, at the - * seam that can still say which value was wrong. The alternative is what - * objectui#7388 measured — a silent coercion to a neighbouring phase, which - * costs the user a correct-looking label describing something that already - * finished. - */ -export const BuildProgressPhaseSchema = lazySchema(() => z.enum(BUILD_PROGRESS_PHASES)); - -/** - * The stream part name this vocabulary rides, as a Vercel UI-message-stream - * custom data-part name. Emitters pass it as `ctx.onProgress({ type, id, data })` - * and the objectui reader selects parts by exactly this string, so it is the - * one literal both ends must agree on. - */ -export const BUILD_PROGRESS_FRAME_TYPE = 'data-build-progress'; - -/** - * The `data` payload of a `data-build-progress` frame — a FLOOR, not a - * ceiling. - * - * Declared minimal on purpose, and deliberately **not** strict. The same frame - * already carries the objectui build panel's own presentation fields - * (`appLabel`, `items`, `done`, `total`, `seq` — read in `extractBuildProgress`), - * which are the consumer's to shape; a strict schema here would refuse every - * frame shipping today and would claim ownership of fields this package does - * not define. What this schema asserts is the part any consumer may rely on: - * a frame says which phase it is in, and may say which verification hop it is - * on and which tool that hop is running. - */ -export const BuildProgressFrameSchema = lazySchema(() => z.looseObject({ - /** Which phase of the build turn this frame reports. */ - phase: BuildProgressPhaseSchema.describe('Build-turn phase this frame reports'), - /** - * Which hop of the post-apply verification loop this frame is on — the - * counter behind the "9 tool calls" the cloud#1838 turn record reports, so - * the panel can show motion through a window that is otherwise a single flat - * phase. **Inferred** that a producer counts hops at all: that record is not - * reachable from this repository (see the Producer section). - * - * Typed as a non-negative integer rather than pinned to a base: whether the - * loop counts its first hop as 0 or 1 is part of the emitter's placement, - * which the cloud build-progress card owns and this card does not decide. ⛔ Consumers render it - * as progress, never as an index into anything here. - * - * ⛔ Zero emitters and zero readers in every reachable repository at this - * tree — see the liveness watch at the top of this module. - */ - hop: z.number().int().nonnegative().optional().describe('Post-apply verification hop this frame reports'), - /** - * Name of the tool the current hop is running, e.g. `verify_build`. - * - * A free string, not a closed set: the runtime's executable tool set is - * registered at boot and legitimately includes plugin-contributed names that - * `PLATFORM_PROVIDED_TOOL_NAMES` cannot know about - * (`../system/constants/platform-tool-names`). Consumers treat it as a label. - * - * ⛔ Zero emitters and zero readers in every reachable repository at this - * tree — see the liveness watch at the top of this module. - */ - tool: z.string().min(1).optional().describe('Name of the tool the current hop is running'), -})); - -/** A phase from the closed {@link BUILD_PROGRESS_PHASES} vocabulary. */ -export type BuildProgressPhase = z.input; - -/** The `data` payload of a `data-build-progress` frame. */ -export type BuildProgressFrame = z.input; diff --git a/packages/spec/src/ai/index.ts b/packages/spec/src/ai/index.ts index 4c371be2f7b..838213617eb 100644 --- a/packages/spec/src/ai/index.ts +++ b/packages/spec/src/ai/index.ts @@ -24,7 +24,6 @@ * - Context pack — the `ai_context` kind and the `get_record_context` tool's input and output (ADR-0160) * - Record citation — the citation shape an answer carries, and the body anchor it names (ADR-0160 D9) * - Object-query source — the `source` block the Ask data tools answer beside their result - * - Build Progress — phase vocabulary for the agent loop's `data-build-progress` frames * - Ask question — the envelope a question tool's result carries, from which the console draws a question card * - Draft review — the `data-draft-review` part listing the drafts an ask turn saved, drawn as a review card */ @@ -51,7 +50,6 @@ export * from './object-query-source.zod'; export * from './knowledge-source.zod'; export * from './knowledge-document.zod'; export * from './solution-blueprint.zod'; -export * from './build-progress.zod'; export * from './ask-question.zod'; export * from './draft-review.zod'; diff --git a/packages/spec/src/ai/record-citation.zod.ts b/packages/spec/src/ai/record-citation.zod.ts index 76ded7ac9d7..07d0a9604cd 100644 --- a/packages/spec/src/ai/record-citation.zod.ts +++ b/packages/spec/src/ai/record-citation.zod.ts @@ -41,9 +41,8 @@ import { strictObject } from '../shared/strict-object'; /** * The stream part name a verified citation list rides, as a UI-message-stream - * custom data-part name (the precedent is `BUILD_PROGRESS_FRAME_TYPE`). The - * producer and every surface that draws the list select the part by exactly - * this string. + * custom data-part name. The producer and every surface that draws the list + * select the part by exactly this string. */ export const RECORD_CITATIONS_PART_TYPE = 'data-record-citations'; diff --git a/packages/spec/src/contracts/ai-service.ts b/packages/spec/src/contracts/ai-service.ts index 75ebf89f893..8ae4e70d3f6 100644 --- a/packages/spec/src/contracts/ai-service.ts +++ b/packages/spec/src/contracts/ai-service.ts @@ -1405,12 +1405,9 @@ export interface ToolExecutionContext { * so handlers must call it optionally (`ctx.onProgress?.(…)`). * * `type` is a Vercel UI-message-stream custom data-part name (must start - * with `data-`, e.g. `data-build-progress`). Pass a stable `id` to RECONCILE - * (replace) the part across emits — ideal for a single progress object that - * updates in place; omit `id` for append-only events. `data` is the payload. - * - * Example (apply_blueprint streaming its build tree): - * ctx.onProgress?.({ type: 'data-build-progress', id: 'build', data: { phase, items } }); + * with `data-`). Pass a stable `id` to RECONCILE (replace) the part across + * emits — ideal for a single progress object that updates in place; omit + * `id` for append-only events. `data` is the payload. */ onProgress?: (part: { type: string; id?: string; data?: unknown }) => void; } diff --git a/packages/spec/src/migrations/entries/retired-defs/19.ai__BuildProgressFrame.ts b/packages/spec/src/migrations/entries/retired-defs/19.ai__BuildProgressFrame.ts new file mode 100644 index 00000000000..d842d9a72b9 --- /dev/null +++ b/packages/spec/src/migrations/entries/retired-defs/19.ai__BuildProgressFrame.ts @@ -0,0 +1,12 @@ +// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license. + +// #37753 — `ai/BuildProgressFrame` (`phase`, `hop`, `tool`), the payload floor +// of the `data-build-progress` stream frame, leaves with the whole +// `ai/build-progress.zod.ts` module (ADR-0049 enforce-or-remove; the #3950 +// rule: an exported schema with no consumer reads as a capability). Its one +// reader, the plugin-chatbot build panel, was deleted by the build retirement +// (#37720), and its producer, the cloud AI-studio build loop, by cloud#5046. +// It was a stream payload, never authored metadata, so no source or stored +// row carries it and there is nothing for `migrate meta` to rewrite. D3: +// `ai-build-progress-frame-retired`. +export const entry = 'ai/BuildProgressFrame'; diff --git a/packages/spec/src/migrations/entries/retired-defs/19.ai__BuildProgressPhase.ts b/packages/spec/src/migrations/entries/retired-defs/19.ai__BuildProgressPhase.ts new file mode 100644 index 00000000000..2d1048b8c90 --- /dev/null +++ b/packages/spec/src/migrations/entries/retired-defs/19.ai__BuildProgressPhase.ts @@ -0,0 +1,8 @@ +// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license. + +// #37753 — `ai/BuildProgressPhase` (`structure`, `data`, `verify`, `done`), +// the closed phase vocabulary of the `data-build-progress` stream frame, +// leaves with `ai/BuildProgressFrame` and the whole `ai/build-progress.zod.ts` +// module: its only composer was that frame. D3: +// `ai-build-progress-frame-retired`. +export const entry = 'ai/BuildProgressPhase'; diff --git a/packages/spec/src/migrations/entries/semantic/19.ai-build-progress-frame-retired.ts b/packages/spec/src/migrations/entries/semantic/19.ai-build-progress-frame-retired.ts new file mode 100644 index 00000000000..f5214e9fab8 --- /dev/null +++ b/packages/spec/src/migrations/entries/semantic/19.ai-build-progress-frame-retired.ts @@ -0,0 +1,30 @@ +// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license. + +import type { SemanticMigration } from '../../types.js'; + +// #37753 — the D3 entry of the build-progress frame's retirement (ADR-0049 +// enforce-or-remove). No D2 conversion: the frame was a stream payload a +// host's agent loop emitted and a chat panel read, never authored metadata, +// so no source or stored row carries it. The family is the two defs +// (`ai/BuildProgressFrame`, `ai/BuildProgressPhase`), both in +// RETIRED_DEFS_BY_MAJOR[19], and the module's two constants, +// `BUILD_PROGRESS_PHASES` and `BUILD_PROGRESS_FRAME_TYPE`. +export const entry: SemanticMigration = { + id: 'ai-build-progress-frame-retired', + surface: + 'Host code that imports `BuildProgressFrameSchema`, `BuildProgressPhaseSchema`, `BuildProgressFrame`, ' + + '`BuildProgressPhase`, `BUILD_PROGRESS_PHASES` or `BUILD_PROGRESS_FRAME_TYPE` from `@objectstack/spec/ai`', + replacement: + 'none: delete the import and the code that emits or reads a `data-build-progress` stream part. A host that ' + + 'still wants to stream its own progress part passes any `data-` part name to `ctx.onProgress` and owns ' + + 'the payload shape it sends.', + reason: + 'The module declared the payload of the `data-build-progress` frame for the build chat. Its only reader, ' + + 'the console build panel, was removed with the build chat front end, and its producer, the cloud build ' + + 'loop, was removed with it. Nothing parsed the frame any more, so the exported schemas read as a ' + + 'capability that no longer exists. They are removed whole; a lingering import no longer compiles, which ' + + 'is where the upgrader meets the change.', + acceptanceCriteria: + 'No code imports any of the six names from `@objectstack/spec`, no code emits or reads a ' + + '`data-build-progress` part it expects the platform to draw, and the project type-checks.', +}; diff --git a/packages/spec/src/type-alias-convention.pin.test.ts b/packages/spec/src/type-alias-convention.pin.test.ts index 34125ab59bb..2d56e6314f8 100644 --- a/packages/spec/src/type-alias-convention.pin.test.ts +++ b/packages/spec/src/type-alias-convention.pin.test.ts @@ -268,8 +268,8 @@ import type * as M185 from './shared/epoch.zod.js'; // [#18122] The closed duration vocabulary beside that instant — new module, // next free index (M186 is `automation/schedule-organization.zod.ts`). import type * as M187 from './shared/duration.zod.js'; -// [#18451] The build-progress PHASE vocabulary -- new module, next free index. -import type * as M188 from './ai/build-progress.zod.js'; +// M188 was './ai/build-progress.zod.js' (#18451) — retired whole by #37753 (ADR-0049 +// enforce-or-remove); the M-indices are positional, so the slot stays vacant. // The host fate supplement (ADR-0131 D10's C10 stage) -- new module, next free index. import type * as M189 from './system/fate-supplement.zod.js'; // [#23287] The ADR-0069 posture vocabulary and its scope -- next free index. @@ -305,7 +305,7 @@ import type * as M205 from './ai/object-query-source.zod.js'; import type * as M207 from './api/ai-answer.zod.js'; // --------------------------------------------------------------------------- -// 881 isomorphic aliases: `z.input` === `z.infer`, so no `XParsed` is declared. +// 879 isomorphic aliases: `z.input` === `z.infer`, so no `XParsed` is declared. // // That number is machine-checked, not hand-kept. The runtime companion at the // bottom of this file recomputes the pin count from the source and asserts that @@ -359,18 +359,6 @@ import type * as M207 from './api/ai-answer.zod.js'; export type Iso_ai_agent__StructuredOutputFormatSchema = Assert, z.infer< typeof M0.StructuredOutputFormatSchema > >>; export type Iso_ai_agent__TransformPipelineStepSchema = Assert, z.infer< typeof M0.TransformPipelineStepSchema > >>; -// ai/build-progress.zod.ts -- the closed build-progress PHASE vocabulary -// (#18451, cloud#2172 ruling A) and the frame that carries it. The enum has -// no default and no transform; the frame is a `z.looseObject` whose three -// members are a bare enum and two plain optionals, so both are the (RISE) -// case. The frame pin is the load-bearing one: it is deliberately a FLOOR -// that passes the consumer's own panel fields through untouched, and the day -// someone gives `phase` or `hop` a `.default()` to 'help' a producer that -// omits it, author state and parsed state part company -- this is the line -// that says so by name. -export type Iso_ai_buildProgress__BuildProgressFrameSchema = Assert, z.infer< typeof M188.BuildProgressFrameSchema > >>; -export type Iso_ai_buildProgress__BuildProgressPhaseSchema = Assert, z.infer< typeof M188.BuildProgressPhaseSchema > >>; - // ai/conversation.zod.ts export type Iso_ai_conversation__ConversationContextSchema = Assert, z.infer< typeof M1.ConversationContextSchema > >>; export type Iso_ai_conversation__ConversationSummarySchema = Assert, z.infer< typeof M1.ConversationSummarySchema > >>; @@ -1858,7 +1846,7 @@ describe('ADR-0122 type-alias convention', () => { // this title and the section header above the pin list — are now asserted // against the recomputed count below, so neither can go stale without a red // test naming it. - it('still declares all 881 isomorphic pins', () => { + it('still declares all 879 isomorphic pins', () => { // The truth of each pin is proved by tsc, not here — an `Assert>` // that stops holding is a compile error with the alias named. What tsc // cannot notice is a pin that was DELETED: removing the assertion removes @@ -2990,7 +2978,11 @@ describe('ADR-0122 type-alias convention', () => { // `ai/embedding.zod.ts` leaves whole, its only composer having been the // removed `embedding` and `vectorStore` keys (Iso_ai_embedding__*, three // pins; RETIRED_DEFS_BY_MAJOR[19]). -6. - expect(pins).toHaveLength(881); + // 881 -> 879 is #37753: `ai/build-progress.zod.ts` leaves whole, its one + // reader (the build panel in plugin-chatbot) and its producer having been + // deleted by the build retirement (Iso_ai_buildProgress__BuildProgressFrameSchema, + // __BuildProgressPhaseSchema; RETIRED_DEFS_BY_MAJOR[19]). -2. + expect(pins).toHaveLength(879); // The count is stated in PROSE twice as well — this case's title and the // section header above the pin list — and until commit c6b05c76a nothing read either diff --git a/packages/spec/src/ui/component.zod.ts b/packages/spec/src/ui/component.zod.ts index 1338a32c184..9691cdfc75b 100644 --- a/packages/spec/src/ui/component.zod.ts +++ b/packages/spec/src/ui/component.zod.ts @@ -5326,10 +5326,9 @@ export const ObjectGridPropsSchema = lazySchema(() => strictObject({ * `…` in its own describe says authors pass them — which is a wider * narrowing than the defect measured above and a different decision. So what * narrows is the accept set of a page size; what does NOT narrow is which - * keys the bag may carry. `BuildProgressFrameSchema` - * (`ai/build-progress.zod.ts`) is the house precedent for a floor-not-ceiling - * shape, and `DashboardWidgetConfigSchema` for an open bag with declared - * members. + * keys the bag may carry. `DashboardWidgetConfigSchema` (declared in + * `ui/packages/types`, `src/zod/complex.zod.ts`) is the house precedent for + * an open bag with declared members. * * Read points recorded in `liveness/page.json`, row `regions`: the grid * reads `(schema.pagination as any)?.pageSize ?? schema.pageSize`,