Skip to content

Commit 947b96e

Browse files
committed
wip(types): name the module for links, not routes, so the route-envelope audit does not read it as a REST module (#36895)
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzhpykmQZe1yMupC2CU
1 parent ffe0516 commit 947b96e

13 files changed

Lines changed: 29 additions & 29 deletions

File tree

‎.changeset/36895-studio-address-builder.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ Metadata-protocol: none
1414
Studio redesign groundwork (#36895, epic #36890). Every place that produced a `/studio...` URL now calls one builder, so a later change can move an item type to its metadata address in one place. Every address is byte-for-byte what it was: no link, bookmark or redirect changes.
1515

1616
- **Console.** `studioAddress.ts` in `@object-ui/app-shell` builds every Studio address: the landing, a package, a pillar, an item (`studioItemPath`), the "All metadata" area, and the draft review links. `studioAddressTable.ts` lists every address family, every `?surface=` spelling and every query parameter, with what each becomes on the metadata address. The retired `/interfaces` redirect keeps exactly the parameters that table marks. New exports from `@object-ui/app-shell`: `STUDIO_ROOT_PATH`, `STUDIO_HOME_PILLAR`, `studioLandingPath`, `studioPackagePath`. Existing exports keep their names and values.
17-
- **Server.** `studioChangesReviewRoute` and `studioItemReviewRoute`, new in `@objectstack/types`, build the review links that `os meta register` prints and that the MCP authoring tools return after a draft save. The text an AI is handed is unchanged.
17+
- **Server.** `studioChangesReviewLink` and `studioItemReviewLink`, new in `@objectstack/types`, build the review links that `os meta register` prints and that the MCP authoring tools return after a draft save. The text an AI is handed is unchanged.
1818
- **Guards.** A test under `ui/` refuses a hand-built Studio address in any ui source. A test in `@objectstack/types` refuses one in any server package, and holds the review links quoted by the `objectstack-mcp-build` skill's evals equal to what the builder returns.

‎packages/cli/src/commands/meta/register.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type { MetadataValidationResult } from '@objectstack/spec/kernel';
66
import { printError, printInfo, printSuccess, printWarning, emitJson, errorCodeFields } from '../../utils/format.js';
77
import { createApiClient, requireAuth } from '../../utils/api-client.js';
88
import { formatOutput } from '../../utils/output-formatter.js';
9-
import { studioChangesReviewRoute } from '@objectstack/types';
9+
import { studioChangesReviewLink } from '@objectstack/types';
1010

1111
/**
1212
* [#23350] The refusal an EMPTY `--package` earns, before anything reaches the
@@ -211,7 +211,7 @@ export function draftSaveLines(args: {
211211
if (args.packageId) {
212212
lines.push(
213213
`Review and publish it in Studio's Changes for package ${args.packageId} `
214-
+ `(${studioChangesReviewRoute(args.packageId)}).`,
214+
+ `(${studioChangesReviewLink(args.packageId)}).`,
215215
);
216216
}
217217
return lines;

‎packages/runtime/src/domains/mcp-authoring.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ import type { AIToolDefinition } from '@objectstack/spec/contracts';
168168
import type { HttpProtocolContext } from '../http-dispatcher.js';
169169
import type { DomainHandlerDeps } from '../domain-handler-registry.js';
170170
import { readEffectiveTenancyPosture } from './activation-gate.js';
171-
import { studioChangesReviewRoute, studioItemReviewRoute } from '@objectstack/types';
171+
import { studioChangesReviewLink, studioItemReviewLink } from '@objectstack/types';
172172

173173
/** The read tools' names, in the order the registry lists them. */
174174
export const OPEN_AUTHORING_READ_TOOL_NAMES = ['list_metadata_items', 'get_metadata_item', 'list_drafts'] as const;
@@ -1290,8 +1290,8 @@ function verdictOf(judgement: OpenAuthoringDraftJudgement): {
12901290
*/
12911291
function reviewRoutes(packageId: string, type: string, name: string): { changes: string; item: string; note: string } {
12921292
return {
1293-
changes: studioChangesReviewRoute(packageId),
1294-
item: studioItemReviewRoute(packageId, type, name),
1293+
changes: studioChangesReviewLink(packageId),
1294+
item: studioItemReviewLink(packageId, type, name),
12951295
note: 'Console routes. A person reviews and publishes the draft there; this server cannot publish.',
12961296
};
12971297
}

‎packages/types/src/index.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ export * from './packaged-item-turned-off.js';
151151
// [#36895] The Studio addresses a server hands out for a saved draft's review.
152152
// Its producers (cli's `os meta register`, runtime's MCP authoring tools)
153153
// cannot depend on the Console; both already depend on this package.
154-
export * from './studio-review-routes.js';
154+
export * from './studio-review-links.js';
155155

156156
// Placeholder for Kernel interface to avoid circular dependency
157157
// The actual Kernel implementation will satisfy this interface.

packages/types/src/studio-review-routes.callers.test.ts renamed to packages/types/src/studio-review-links.callers.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* The Studio redesign (epic #36890) moves Studio's addresses one item type at
1111
* a time. A `/studio/...` string written out in a server package would keep
1212
* the old address after the move, and an AI handed it would send a person to
13-
* the wrong page. `studio-review-routes.ts` is the one place a server spells
13+
* the wrong page. `studio-review-links.ts` is the one place a server spells
1414
* one; the Console's builder (`studioAddress.ts` in the app-shell package)
1515
* is held by the same kind of pin in the ui workspace.
1616
*
@@ -22,7 +22,7 @@
2222
* in comments is free.
2323
* 2. The eval file of the published skill (it is governed: it is read, never
2424
* edited here): every Studio address it quotes equals what
25-
* `studioChangesReviewRoute` / `studioItemReviewRoute` return for the
25+
* `studioChangesReviewLink` / `studioItemReviewLink` return for the
2626
* package, type and name the address names, so the two cannot drift.
2727
*
2828
* ── Controls ─────────────────────────────────────────────────────────────────
@@ -41,7 +41,7 @@ import { describe, expect, it } from 'vitest';
4141
import { existsSync, readdirSync, readFileSync } from 'node:fs';
4242
import { dirname, join, relative, resolve, sep } from 'node:path';
4343
import ts from 'typescript';
44-
import { studioChangesReviewRoute, studioItemReviewRoute } from './studio-review-routes.js';
44+
import { studioChangesReviewLink, studioItemReviewLink } from './studio-review-links.js';
4545

4646
/**
4747
* This package is CJS-typed, so `import.meta` is not available: walk up from
@@ -73,7 +73,7 @@ const SCANNED_TREE = join(REPO_ROOT, 'packages');
7373
const EVAL_FILE = join(REPO_ROOT, 'skills/objectstack-mcp-build/evals/draft-door-procedure.json');
7474

7575
/** The one server file that spells a Studio address. */
76-
const ALLOWED = 'packages/types/src/studio-review-routes.ts';
76+
const ALLOWED = 'packages/types/src/studio-review-links.ts';
7777

7878
const SKIP_DIRS = new Set(['node_modules', 'dist', 'build', 'coverage', '.turbo', '.next', '__tests__']);
7979

@@ -126,10 +126,10 @@ function quotedStudioAddresses(text: string): string[] {
126126
/** What the builder returns for the package, type and name an address names. */
127127
function rebuilt(address: string): string | null {
128128
const changes = /^\/studio\/([^/?#]+)\/data\?changes=review$/.exec(address);
129-
if (changes) return studioChangesReviewRoute(decodeURIComponent(changes[1]));
129+
if (changes) return studioChangesReviewLink(decodeURIComponent(changes[1]));
130130
const item = /^\/studio\/([^/?#]+)\/metadata\/([^/?#]+)\/([^/?#]+)\?review=1$/.exec(address);
131131
if (item) {
132-
return studioItemReviewRoute(decodeURIComponent(item[1]), decodeURIComponent(item[2]), decodeURIComponent(item[3]));
132+
return studioItemReviewLink(decodeURIComponent(item[1]), decodeURIComponent(item[2]), decodeURIComponent(item[3]));
133133
}
134134
return null;
135135
}
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
22

33
import { describe, expect, it } from 'vitest';
4-
import { studioChangesReviewRoute, studioItemReviewRoute } from './studio-review-routes.js';
4+
import { studioChangesReviewLink, studioItemReviewLink } from './studio-review-links.js';
55

66
/**
77
* objectstack#36895 — the server's draft review links, byte for byte as the CLI
@@ -11,14 +11,14 @@ import { studioChangesReviewRoute, studioItemReviewRoute } from './studio-review
1111
*/
1212
describe('the Studio review links a server hands out (objectstack#36895)', () => {
1313
it("a package's Changes drawer on its Studio home", () => {
14-
expect(studioChangesReviewRoute('com.acme.crm')).toBe('/studio/com.acme.crm/data?changes=review');
15-
expect(studioChangesReviewRoute('a b/c')).toBe('/studio/a%20b%2Fc/data?changes=review');
14+
expect(studioChangesReviewLink('com.acme.crm')).toBe('/studio/com.acme.crm/data?changes=review');
15+
expect(studioChangesReviewLink('a b/c')).toBe('/studio/a%20b%2Fc/data?changes=review');
1616
});
1717

1818
it("an item's draft review in the All metadata area", () => {
19-
expect(studioItemReviewRoute('com.acme.crm', 'flow', 'crm_lead_created_notify')).toBe(
19+
expect(studioItemReviewLink('com.acme.crm', 'flow', 'crm_lead_created_notify')).toBe(
2020
'/studio/com.acme.crm/metadata/flow/crm_lead_created_notify?review=1',
2121
);
22-
expect(studioItemReviewRoute('p q', 'object', 'a/b')).toBe('/studio/p%20q/metadata/object/a%2Fb?review=1');
22+
expect(studioItemReviewLink('p q', 'object', 'a/b')).toBe('/studio/p%20q/metadata/object/a%2Fb?review=1');
2323
});
2424
});

packages/types/src/studio-review-routes.ts renamed to packages/types/src/studio-review-links.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,19 @@
1111
* and `studioItemReviewPath` (`studioAddress.ts` in the Console's app-shell package),
1212
* which does not depend on this package; both sides are pinned to the same
1313
* literals, and to the literals the `objectstack-mcp-build` skill's evals
14-
* quote (`studio-review-routes.test.ts`).
14+
* quote (`studio-review-links.test.ts`).
1515
*
1616
* ⛔ A changed byte here changes the review link an AI is handed and repeats to
1717
* a person. The addresses move only when the Studio redesign moves them, and
1818
* then on both sides together.
1919
*/
2020

2121
/** A package's Changes drawer on its Studio home: `/studio/<package>/data?changes=review`. */
22-
export function studioChangesReviewRoute(packageId: string): string {
22+
export function studioChangesReviewLink(packageId: string): string {
2323
return `/studio/${encodeURIComponent(packageId)}/data?changes=review`;
2424
}
2525

2626
/** An item's draft review in Studio's "All metadata" area: `/studio/<package>/metadata/<type>/<name>?review=1`. */
27-
export function studioItemReviewRoute(packageId: string, type: string, name: string): string {
27+
export function studioItemReviewLink(packageId: string, type: string, name: string): string {
2828
return `/studio/${encodeURIComponent(packageId)}/metadata/${encodeURIComponent(type)}/${encodeURIComponent(name)}?review=1`;
2929
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[
22
"src/driver-error-classification.callers.test.ts",
3-
"src/studio-review-routes.callers.test.ts"
3+
"src/studio-review-links.callers.test.ts"
44
]

‎scripts/cross-package-test-inputs.mjs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ export const CROSS_PACKAGE_TEST_INPUTS = {
406406
// entry adds no new top-level root for `check-ci-filter-parity.mjs` to want
407407
// in ci.yml's `crosspkg:` filter. Its own header records that trade.
408408
//
409-
// src/studio-review-routes.callers.test.ts (#36895) walks the same `.ts`
409+
// src/studio-review-links.callers.test.ts (#36895) walks the same `.ts`
410410
// population for hand-built Studio addresses, and reads the one skill eval
411411
// that quotes the server's draft review links, to hold each quoted link
412412
// equal to what this package builds. That file sits under the published

‎ui/packages/app-shell/src/views/studio-design/studioAddress.guard.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* `studioAddress.ts` is the one file allowed to spell the root (and the
2222
* mapping table beside it, which spells shapes, not links). The server's
2323
* two review links are held by the same kind of pin in `@objectstack/types`
24-
* (`studio-review-routes.callers.test.ts`), which also holds the skill evals'
24+
* (`studio-review-links.callers.test.ts`), which also holds the skill evals'
2525
* literals equal to the builder's output.
2626
*/
2727

0 commit comments

Comments
 (0)