App handoff: name-only layer pickers and explicit custom keys¶
This decision supersedes commit 4dec089. Eve supplied the app-owned behavior below; this handoff records the matching template-side implementation. It has not been sent to another chat.
<INSERT_USER_PDK_LAYER_HERE>(name='Cladding layer')
<INSERT_USER_PDK_LAYERS_HERE>(name='Geometry layers')
Fixed contract¶
- Both tokens accept ONLY required literal
name, kept verbatim as the prompt. Removepdk_layer_roleanddefault. Reject either keyword whenever present, including null/empty values. No aliases, silent ignoring, replacement fields, sidecars or versions. Remove defaults/roles from normalized declarations too. - Keep name-based identity. Identical repeated declarations share one prompt; different names stay independent; conflicting specifications with one name fail.
- Singular returns one nonempty string. Plural returns a nonempty list of distinct nonempty strings. Explicit custom keys are valid even outside the PDK stack. Serialize them as literal data; do not evaluate them or create layers.
- No layer default or unique-candidate auto-answer is allowed. Preserve ordinary USER_INPUT and optical defaults, eligible optical candidates and boundary policy.
App-owned behavior¶
- All physical stack entries remain searchable. Name matching ranks suggestions
in both directions:
cladmatches “Cladding layer”. Suggestions never hide candidates or answer for the user. - Typing offers an explicit Use “custom_layer” choice.
- Unknown names show “Not in PDK Layer Stack” based on exact membership in the full successfully loaded stack, not filtered search results. A failed/unavailable stack is not proof that an entry is absent.
- Adding a custom item in a plural picker preserves existing selections. Finishing the plural selection is separate from adding an item.
- Do not apply closed PDK membership validation during review/preflight/publication to intentionally supplied custom keys. Type/cardinality checks, explicit USER confirmation, literal safety and existing source freshness checks still apply.
- Selection supplies strings only. A notebook that indexes an absent physical stack key may still fail at simulation time; custom entry does not synthesize geometry, materials or LayerLevel definitions.
Implementation and acceptance¶
Update inline argument parsing, normalized declarations/schema, planning, review controls and publication validation. Remove the previous role enum and authored layer-default branches. Keep the complete stack separate from filtered/ranked UI results. Apply the revised cardinalities to selected and custom items equally.
Test name-only declarations; both removed keywords with all value shapes; exact prompt preservation; shared/conflicting names; singular/plural shape and uniqueness; known and custom literal keys; safe escaping; unavailable/empty stack suggestions; no auto-answer from one suggestion; bidirectional ranking; full-domain unknown badges; plural selection preservation and separate finish; and unchanged ordinary/optical input defaults, optical membership and boundary restrictions.
The reference binder accepts explicit custom layer strings/lists without requiring closed membership or stack suggestions. It adds no layer and leaves UI ranking, custom-entry actions and stack-status badges to the app. Zap's cladding-role annotation was removed. The main authoring README is intentionally untouched at Eve's request; its companion token README and tracked specs reflect this contract.