# Issue 979 Child Fan-Out Preview

Status: proposed implementation slice stacked after the #1044 synthetic read
overlay PR.

## Problem

The #979 authoring contract models child fan-out as Flow metadata:

1. create a target parent;
2. lookup or loop over source children;
3. create target children;
4. assign the new target parent lookup on each child.

The preview runtime can already mint a request-local parent preview ID and
validate that ID during no-DML child insert preparation. Standard-action
preview discovery still rejects every later use of a synthetic record-create
ID, including the legitimate parent-lookup rewrite needed by child fan-out.

## Design

Discovery should continue to reject synthetic IDs by default. It may allow one
specific shape:

- the synthetic ID comes from an earlier preview `recordCreate`;
- the ID flows into a later `recordCreate` input assignment;
- the target assignment field is metadata-proven to be a reference or
  master-detail field;
- that field's `ReferenceTo` includes the object type that minted the
  synthetic ID.

This is the same generic metadata contract live execution relies on. It does
not authorize arbitrary synthetic IDs in lookup filters, action calls, field
mappings, formulas, or non-reference fields. Those uses remain fail-closed
until a separate parity design proves their runtime safety.

Assignment variables may carry the synthetic ID between elements, but the final
use must still be a metadata-proven lookup assignment on `recordCreate`.

## Boundary Review

This remains application-neutral L0 Flow capability detection:

- no object names, record types, profiles, tenant fields, or business statuses
  are encoded in runtime;
- `ReferenceTo` metadata is the authority for whether a child field can point
  at the preview-created parent;
- pack or tenant Flow metadata owns the child fan-out loop and field mappings;
- preview IDs stay request-local and are validated by existing no-DML insert
  preparation before any child preview image is returned.

## Verification

Focused tests should prove:

- discovery accepts direct parent-preview-ID assignment to a reference field;
- discovery accepts the same assignment after Flow assignment-variable
  propagation;
- discovery still rejects the same ID when field metadata is missing or the
  field is not a reference to the synthetic parent object;
- dotted references such as `parentId.Id` stay rejected because preview
  `recordCreate` stores an ID scalar, not a durable record object;
- existing synthetic lookup-overlay and no-DML preview tests remain green.
