Skip to content

Commit f8ccc47

Browse files
committed
fix(spec): narrow the retirement pin's examples radius to non-code files and drop the dead PROTOCOL_MAP row
The dispatch-gates self-test pins that no cross-package hint reaches a test file outside packages/**; a bare examples/** glob covered the CRM example's smoke test. The pin now scans only JSON / MD / MDX / YAML under examples/ (every example has its own tsc typecheck) and the declaration + turbo.json name those five extension globs with heldBy witnesses. PROTOCOL_MAP.md linked the deleted change-management module; its row is dropped (the map test's own remedy). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01M59rPZZFzqhfMUPFqqZTkf
1 parent 6793240 commit f8ccc47

4 files changed

Lines changed: 42 additions & 11 deletions

File tree

packages/spec/PROTOCOL_MAP.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ This document serves as the **Grand Map** of the ObjectStack specification. It l
138138
| [`license.zod.ts`](src/system/license.zod.ts) | | **Licensing**. License keys and entitlements. |
139139
| [`registry-config.zod.ts`](src/system/registry-config.zod.ts) | | **Registry Config**. Configuration for the package registry. |
140140
| [`tenant.zod.ts`](src/system/tenant.zod.ts) | | **Tenant**. Multi-tenant environment isolation. |
141-
| [`change-management.zod.ts`](src/system/change-management.zod.ts) | | **Change Mgmt**. Deployment history and rollbacks. |
142141
| [`collaboration.zod.ts`](src/system/collaboration.zod.ts) | | **Collaboration**. Real-time collaboration settings. |
143142

144143
---

packages/spec/src/system/compliance-families-retirement.test.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,16 +302,26 @@ describe('[#15513] ADR-0087 registration', () => {
302302
// `packages/client-react`'s `realtime-hooks.test.tsx` (the `@objectstack/core`
303303
// entry records the measurement). A `.tsx` import of a retired name fails
304304
// `tsc` in its own package, which is the enforced channel for typed sources.
305+
// Under `examples/` NO code file is scanned at all (only JSON / MD / MDX /
306+
// YAML): every example is a workspace package with its own `typecheck`, and
307+
// the same self-test pins that no cross-package hint reaches a test file
308+
// outside `packages/**` — its `OUTSIDE_PACKAGES` specimen is the CRM example's
309+
// smoke test, which a bare `examples/**` glob covers and a `.json` / `.md`
310+
// glob cannot. (The specimen's path is deliberately not spelled here: the
311+
// inputs gate collects a quoted whole path as a named read and would demand
312+
// the very declaration the self-test refuses.)
305313
// The residue this leg covers is everything `tsc` does not compile: JSON,
306-
// YAML, MD, MDX, and untyped `.js` / `.mjs` / `.cjs`.
314+
// YAML, MD, MDX, and (under `packages/`) untyped `.js` / `.mjs` / `.cjs`.
307315
describe('[#15513] tree-scoped absence: nothing inside the declared radius references a retired name', () => {
308316
const REPO_ROOT = path.resolve(SPEC_ROOT, '../..');
309317
const THIS_FILE = path.relative(REPO_ROOT, fileURLToPath(import.meta.url)).split(path.sep).join('/');
310318

311319
/** The walked roots — declared in `scripts/cross-package-test-inputs.mjs` under `@objectstack/spec`. */
312320
const WALK_ROOTS = ['packages', 'examples', 'skills', 'content', 'scripts'];
313-
/** Per-extension under `packages/` (never `.tsx`, see above); the other roots are declared whole. */
321+
/** Per-extension under `packages/` (never `.tsx`, see above); `content/`, `skills/`, `scripts/` are declared whole. */
314322
const SCANNED_EXT = new Set(['.ts', '.mts', '.cts', '.js', '.mjs', '.cjs', '.json', '.md', '.mdx', '.yaml', '.yml']);
323+
/** Under `examples/` only the non-code extensions are scanned AND declared (see above). */
324+
const EXAMPLES_EXT = new Set(['.json', '.md', '.mdx', '.yaml', '.yml']);
315325
/** Build, SCM and cache state — not authored sources. */
316326
const SKIPPED_DIRS = new Set(['node_modules', 'dist', '.git', '.turbo', '.cache', '.objectstack', 'coverage', '.next', '.source']);
317327

@@ -383,7 +393,8 @@ describe('[#15513] tree-scoped absence: nothing inside the declared radius refer
383393
continue;
384394
}
385395
if (!entry.isFile()) continue;
386-
if (!SCANNED_EXT.has(path.extname(entry.name))) continue;
396+
const ext = path.extname(entry.name);
397+
if (!(rel.startsWith('examples/') ? EXAMPLES_EXT : SCANNED_EXT).has(ext)) continue;
387398
if (entry.name === 'CHANGELOG.md') continue; // release prose records the removal
388399
if (EXCLUDED.has(rel) || EXCLUDED_PREFIXES.some((p) => rel.startsWith(p))) continue;
389400
visited += 1;

scripts/cross-package-test-inputs.mjs

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,19 @@ export const CROSS_PACKAGE_TEST_INPUTS = {
194194
// `tsc` in its own package, which is the enforced channel there.
195195
// `packages/**/*.ts` and `*.mts` subsume this entry's narrower `.ts`
196196
// globs above, which are left as the tests that declared them spelled
197-
// them. `examples/**` and `content/**` are declared whole (the pin scans
198-
// their JSON / MD / MDX / YAML too; `content/**` subsumes the two
199-
// `content/docs/...` rows above). `skills/**` and `scripts/**` were
200-
// already declared by the tests named at their rows.
197+
// them. `content/**` is declared whole (the pin scans its JSON / MD /
198+
// MDX / YAML too; it subsumes the two `content/docs/...` rows above).
199+
// `examples/` is declared per NON-CODE extension only: every example is
200+
// a workspace package with its own `typecheck` (`tsc --noEmit`), so a
201+
// typed resurrection there fails `tsc` in its own package, and the pin
202+
// scans only JSON / MD / MDX / YAML under it. ⛔ Not `examples/**` — that
203+
// glob covers the CRM example's smoke test, and the dispatch-gates
204+
// self-test pins that no cross-package hint reaches a test file outside
205+
// `packages/**` (its `OUTSIDE_PACKAGES` specimen; the path is not spelled
206+
// here for the reason the `@objectstack/types` entry gives — a quoted
207+
// whole path in this module becomes the very hint the case refuses);
208+
// a `.json` / `.md` glob cannot match a `.ts` path. `skills/**` and
209+
// `scripts/**` were already declared by the tests named at their rows.
201210
'packages/**/*.ts',
202211
'packages/**/*.mts',
203212
'packages/**/*.cts',
@@ -209,7 +218,11 @@ export const CROSS_PACKAGE_TEST_INPUTS = {
209218
'packages/**/*.mdx',
210219
'packages/**/*.yaml',
211220
'packages/**/*.yml',
212-
'examples/**',
221+
'examples/**/*.json',
222+
'examples/**/*.md',
223+
'examples/**/*.mdx',
224+
'examples/**/*.yaml',
225+
'examples/**/*.yml',
213226
'content/**',
214227
],
215228
heldBy: {
@@ -234,7 +247,11 @@ export const CROSS_PACKAGE_TEST_INPUTS = {
234247
'packages/**/*.mdx': ['packages/spec/src/system/compliance-families-retirement.test.ts'],
235248
'packages/**/*.yaml': ['packages/spec/src/system/compliance-families-retirement.test.ts'],
236249
'packages/**/*.yml': ['packages/spec/src/system/compliance-families-retirement.test.ts'],
237-
'examples/**': ['packages/spec/src/system/compliance-families-retirement.test.ts'],
250+
'examples/**/*.json': ['packages/spec/src/system/compliance-families-retirement.test.ts'],
251+
'examples/**/*.md': ['packages/spec/src/system/compliance-families-retirement.test.ts'],
252+
'examples/**/*.mdx': ['packages/spec/src/system/compliance-families-retirement.test.ts'],
253+
'examples/**/*.yaml': ['packages/spec/src/system/compliance-families-retirement.test.ts'],
254+
'examples/**/*.yml': ['packages/spec/src/system/compliance-families-retirement.test.ts'],
238255
},
239256
},
240257
'@objectstack/core': {

turbo.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,11 @@
7979
"$TURBO_ROOT$/packages/**/*.mdx",
8080
"$TURBO_ROOT$/packages/**/*.yaml",
8181
"$TURBO_ROOT$/packages/**/*.yml",
82-
"$TURBO_ROOT$/examples/**",
82+
"$TURBO_ROOT$/examples/**/*.json",
83+
"$TURBO_ROOT$/examples/**/*.md",
84+
"$TURBO_ROOT$/examples/**/*.mdx",
85+
"$TURBO_ROOT$/examples/**/*.yaml",
86+
"$TURBO_ROOT$/examples/**/*.yml",
8387
"$TURBO_ROOT$/content/**"
8488
]
8589
},

0 commit comments

Comments
 (0)