Commit Graph

3 Commits

Author SHA1 Message Date
Axel Meyer
b2a6d5c170 feat: add template_of getter + bump to v0.3.0
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>
2026-06-14 11:57:29 +02:00
Axel Meyer
87357571bd feat(composition): add set_tag + accept container={kind="list"} block
- 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.
2026-06-13 14:02:16 +02:00
Axel Meyer
b6a16df6f0 initial: composition v0.1.0 — template + tag-index + instantiation
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>
2026-06-09 13:28:52 +00:00