Fix instance lookups that trusted stale data

Two regressions from the template-resolution rework, plus the harness gap
that hid them:

- `instanceTargetOf` decided from the shape of the id. Unpacking keeps the
  derived ids, so unpacked content still counted as template content. It now
  asks whether the object is spelled out in the holder.
- The parent picker captured its holder when the row was built. Since
  `viewOf()` returns a derived copy, the menu listed the objects of that
  moment (measured: 40 in the model, 17 in the menu). It resolves on open.
- `evaluate()` swallowed page exceptions, so a mutate that died half-way let
  every later check pass or fail for the wrong reason.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
rootandClaude Opus 5 committed 2026-09-08 21:59:22 +02:00
1 parent ead649eec3
commit f40b8a0523
5 files changed
+45 -6

No files matched your search

+3
View File
@@ -209,6 +209,9 @@ export function instanceTargetOf(
holder: ObjectTree,
objectId: string,
): InstanceTarget | undefined {
// Unpacking keeps the derived ids, so the shape of the id alone still looks like content of a
// template afterwards. What decides is whether the object is spelled out in the holder.
if (!isTemplateContent(holder, objectId)) return undefined;
const split = splitInstanceId(objectId);
const instance = split && holder.objects.find((o) => o.id === split.instanceId);
if (!split || !instance) return undefined;