Skip to content

Commit 40a3731

Browse files
committed
fix(runtime): the new-similar objects limb hands the registered object through whole, and runtime tests alias @objectstack/lint/runtime to source
Claude-Session: https://claude.ai/code/session_01FEkQ5khiLzZmecWFfjSZLc Co-authored-by: Claude <noreply@anthropic.com>
1 parent 56f6631 commit 40a3731

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

‎packages/runtime/src/domains/new-similar-target.ts‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,13 @@ export function newSimilarTargetRefusal(
161161
}
162162
}
163163
if (request.objects !== undefined && request.objects.length > 0) {
164-
const entries: Array<{ name: string; isSystem?: unknown; _packageId?: string }> = [];
164+
// Each entry is the registered object as the save gate's predicate
165+
// reads it, with its owner stamped the way `getAllObjects` tags one.
166+
const entries: Array<{ name: string; _packageId?: string }> = [];
165167
for (const name of request.objects) {
166-
const object = registry?.getObject?.(name) as { isSystem?: unknown } | undefined;
167-
if (!object) continue;
168-
entries.push({ name, isSystem: object.isSystem, _packageId: registry?.getObjectOwner?.(name)?.packageId });
168+
const object = registry?.getObject?.(name);
169+
if (!object || typeof object !== 'object') continue;
170+
entries.push({ ...object, name, _packageId: registry?.getObjectOwner?.(name)?.packageId });
169171
}
170172
const kept = new Set(narrowObjectsToPackageClosure(entries, resolvePackageClosure(target, (id) => getPackage(id))));
171173
const outside = entries.filter((entry) => !kept.has(entry));

‎packages/runtime/vitest.config.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ export default defineConfig({
148148
replacement: path.resolve(__dirname, '../platform-objects/src/index.ts'),
149149
},
150150
{ find: '@objectstack/rest', replacement: path.resolve(__dirname, '../rest/src/index.ts') },
151+
// The clone door's target rule (`domains/new-similar-target.ts`) walks the
152+
// dependency closure with `resolvePackageClosure`, the one walk the save
153+
// door's publish gate uses; its tests judge the source, never `dist/`.
154+
{ find: /^@objectstack\/lint\/runtime$/, replacement: path.resolve(__dirname, '../lint/src/runtime.ts') },
151155
// #9457: ONE anchored rule for every `@objectstack/spec` namespace, in
152156
// place of the hand-maintained list of the twelve subpaths tests happened
153157
// to reach on the day it was written. That list had gone stale in three

0 commit comments

Comments
 (0)