Add composition.template_of(entity) -> string|nil, returning the
template-id this entity was created from. Returns nil for
non-composition-managed entities (e.g. raw entity.create() handles)
and loud-errors on nil arg. Enables crafting and inventory consumers
to recover the template-id without round-tripping through tags.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- set_tag(entity, tag, present): adds/removes entity from index_by_tag
and entity_meta.tags. Idempotent (double-add and double-remove are
no-ops). Loud-Error on entity not created by composition.
- define_template now accepts an optional container block. Validates
kind="list" (only supported value). Loud-Errors individually on each
unimplemented constraint field (weight_max, volume_max, grid,
accepts_fluid, accepts_gas, restrictions) and on unknown container
keys, preventing silent capability mismatches.
- create() copies tpl.tags into entity_meta so per-entity set_tag calls
do not mutate the shared template tag-set.
- manifest.lib version bumped to 0.2.0.
- README and header comment updated to reflect new surface and revised
deferred-list.
Phase-A.1 implementation per
sporel-meta/docs/superpowers/specs/2026-06-09-phase-A-...
Template-Only-Subset; slots/container/quality/condition produce
loud-errors with explicit re-entry-phase hints. Position-Format
revised to two flat scalar properties (position.x, position.y) per
engine reality: no PROPERTY_TABLE exists.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>