ADR-189 + ADR-190 (v1.2.0): entity default-trait registry & natural-language list rendering#168
Merged
Merged
Conversation
…ers) Replace hand-wavy filler phrases and "restates-next" paragraph leads with concrete prose; remove em-dashes from edited passages. clarity-ch08.md flag marked REJECTED (David kept original wording). Co-Authored-By: Claude <noreply@anthropic.com>
… accept ADR-189 (entity default-trait registry) - Integrate em-dash edits into ch01–04 (part-1 and part-2/04) - Apply full-paragraph em-dash pass across all 31 chapters (parts 2–8 modified) - Add 23 emdash-ch*.md full-paragraph review docs to gpt-review/ - Delete 63 spent clarity-ch* and edits-ch* review docs (recoverable from git history) - Accept ADR-189: entity-type default-traits registry Co-Authored-By: Claude <noreply@anthropic.com>
…add() replace-on-same-type Implements Phase 1 of ADR-189 (entity default traits): - `add()` on IFEntity now silently replaces an existing trait of the same type rather than warning and keeping the original (first-wins → replace-on-same-type) - New `DefaultTraitRegistry` wired into `WorldModel.createEntity()` opts; SCENERY entity type auto-applies SceneryTrait via the registry - Tests: world/default-traits.test.ts covers AC-1,3,4,5,6; if-entity.test.ts covers AC-7; identity/container/exit trait tests updated for new replace semantics; stdlib taking-golden.test.ts covers AC-2 - `docs/reference/core-concepts.md` updated to document the registry Also riding along: the ADR-189 planning doc (`docs/work/adr-189-entity-defaults/`) and a new PROPOSED ADR-190 (natural-language list rendering) draft. All tests pass — world-model 1290 passed, stdlib taking-golden 25 passed. Co-Authored-By: Claude <noreply@anthropic.com>
…guage list renderer Phase 1 (foundations): extract pluralize.ts and number-words.ts as free functions; language-provider delegates pluralize, adds serialComma toggle and injects settings into formatter context; EntityInfo.plural field flows from identityTrait through entityInfoFrom; countFormatter bug fixed (GH #166). Phase 2 (list renderer): list formatter rewritten with per-element articles, grouping/pluralization, Oxford-comma toggle, and bare-string safety; new the-list and names formatters registered; AC-1..AC-8, AC-11, AC-12, AC-13 covered by list-formatter.test.ts. ADR-190 updated to ACCEPTED with resolved decisions and implementation plan. Co-Authored-By: Claude <noreply@anthropic.com>
…nfoFrom + AC-9 showcase
Phase 3: migrate {list:items} producers in looking-data, going, and switching_on
to pass entityInfoFrom(e)[] instead of bare names, enabling article + grouping
rendering per ADR-158/ADR-190. Corrects adjacent comments from {items:list} to
{list:items}.
Phase 4: add ac9-showcase.test.ts in lang-en-us exercising the full LanguageProvider
pipeline end-to-end — "You can see a goat, a rabbit, and a parrot here." and the
grouped "two rabbits" variant. All stdlib action tests (looking/going/switching_on,
67 passed) and AC-9 green.
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
…en-us/stdlib to 1.2.0
Corrects backwards {items:list}→{list:items} formatter examples in lang-en-us
source comments (formatters/index.ts, types.ts, registry.ts, language-provider.ts)
and rewrites book ch19's Lists section into a real API showcase. Bumps
world-model, lang-en-us, and stdlib to 1.2.0 for the ADR-189/190 milestone.
Co-Authored-By: Claude <noreply@anthropic.com>
|
❌ The last analysis has failed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Consolidates everything since the last push to
main: two accepted platform ADRs (published as1.2.0) plus the book copy-edit integration that had been committed locally onmainbut never pushed.Platform — ADR-189: entity-type default-trait registry
WorldModel.createEntity(name, type, { defaultTraits? })consults aDEFAULT_TRAITSregistry (SCENERY → SceneryTraitonly); other types deferred.IFEntity.add()changed to silent replace-on-same-type (last add wins), so a configured trait supersedes a default. 4 existing tests that asserted the old first-wins/warn behavior were flipped.takingAC-2). ASCENERYentity is non-takeable by construction.Platform — ADR-190: natural-language list rendering (the ID→language "proof")
listformatter rewritten overEntityInfo[]: per-element articles (a/an/some/none), grouping identical common nouns into pluralized counts ("two goats"), commas + Oxford "and" (author-configurable, default on). Addedthe-listandnames.countformatter fixed (closes countFormatter returns hardcoded "items" noun for count > 1 #166) — real pluralized noun, spelled-out counts (1–10).{list:items}(closes Formatter docs/examples show {items:list} but parser requires {list:items} (placeholder last) #167) across source comments and book ch19; ch19's Lists section is now the real showcase.EntityInfo.plural+IdentityTrait.plural(round-trips save/restore) +entityInfoFrompopulates it;looking/going/switching_onmigrated to passEntityInfo[](ADR-158 fix).Versions (published to npm)
@sharpee/world-model,@sharpee/lang-en-us,@sharpee/stdlib→ 1.2.0.Book copy-edit integration (riding along; was local-only on main)
Tests
world-model suite green (1292); lang-en-us green (243+); stdlib
taking/entity-info/producers green. Every AC has a named passing test.Follow-ups (not in this PR)
{items}container/surface contents path (looking.ts:129pre-joins) needs a template→{list:items}change + entity threading to also render articles.Closes #166, closes #167.
🤖 Generated with Claude Code