Skip to content

Design: the 3.0 Lexicon surface, configuring by reading (#754, 4i decided) - #988

Merged
derek73 merged 12 commits into
masterfrom
claude/lexicon-surface-design-6e662a
Nov 2, 2026
Merged

derek73 merged 12 commits into
masterfrom
claude/lexicon-surface-design-6e662a

Conversation

@derek73

@derek73 derek73 commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

Docs-only. This PR records the decided API for 3.0's Lexicon surface, the part the 2026-10-28 decision ("a caller configures vocabulary by reading, and the compiled sets become internal") left open. Decided on 2026-11-02 as recommended; the title warning was decided on 2026-11-01. Nothing is built.

  • docs/design/vocabulary-model-rfc.md:
    • a new Phase 4 section, "The Lexicon surface: configuring by reading", with seven items and the options weighed for each;
    • the 4i work-order row;
    • pointers to it from phase 3's provenance and API sections.
  • docs/design/decisions/vocabulary-model.md:
    • the 2026-11-01 proposal entry, with its measurements and recipes and the revisions each review round made;
    • the 2026-11-01 title-warning entry;
    • the 2026-11-02 decision entry, with its Declined line;
    • the chained-choices entry marked superseded, and 3j's dropped-listing clause too, both effective with 4i-c;
    • Standing and Open lines updated.

Decided

  1. Configuring:
    • Lexicon.add(*words, kind, **properties) and Lexicon.remove(*words, kind=None), with kinds and properties spelled as the language files spell them.
    • Derived markers come through compile_readings.
    • The generation, credentials and patronymic views read the kind from the lexicon; rules/R8 and rules/R9 are amended when 4i-b builds it.
    • Title warning (decided 2026-11-01): an add warns when a given reading makes the title reading it adds phrase-only, naming remove(w, kind="given"). A property-only update is exempt.
  2. Queries: Lexicon.readings_of(word) returns a public LexiconReading, and the repr counts readings by kind.
  3. State: five parts — a base, an ordered edit log, the choice, the lists and the masks.
    • Equality is structural, with each edit stored frozen.
    • The base, log and choice are underscore constructor parameters, validated as parser_for validates a choice.
    • | is later-wins. parser_for joins fragments in pack order, with the caller's lexicon last.
    • An edit that clashes with a reading a later choice turns on raises at parser_for, naming the choice.
  4. The choice:
    • The Lexicon records its languages and strictness, set publicly only by parser_for.
    • Chained choices union.
    • Caller edits apply after the choice.
    • The default's base stays lazy, keeping the 2026-10-29 lazy-load decision.
  5. Pickle: a 2.x state translates onto the nearer named base plus a per-word log. It is refused only where the compile does not give its sets back.
  6. Migration: the old spellings fail loudly with a per-word translation.
  7. Work order: 4i is built in four PRs, none moving a default parse:
    • 4i-a: the internal sets object
    • 4i-b: the break
    • 4i-c: the recorded choice
    • 4i-d (optional): Reading.languages follows the choice

Declined:

  • the caller's reading winning at parser_for;
  • an eager default base;
  • refusing every 2.x pickle (option a);
  • the alternatives weighed for the other items: a positional add, a reading object, new method names, a public IndexReading, per-category predicates, recording no choice, a Parser field, and a pickled base by reference.

Review

  • The design-docs reviewer ran on every fix commit.
  • Three independent reviews of the proposal ran, and their findings were fixed before the decision:
    • the off-by-default base readings;
    • the dean pickle round trip;
    • log ordering and equality;
    • replace dropping state;
    • the lazy load;
    • the views ignoring a stated kind;
    • the warning's scope;
    • the | and pack order;
    • the 3j quote.

The doc tests pass (2,186).

🤖 Generated with Claude Code

derek73 and others added 2 commits November 1, 2026 23:08
…posed)

Proposes the API the 2026-10-28 Lexicon-surface decision left open:
add/remove by words and a reading kind, readings_of for queries, a
constructor narrowed to the lists and masks, the choice recorded on the
Lexicon so chained choices union, and a 2.x pickle loaded where its sets
translate back to readings. Proposed, not decided; nothing is built.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The default's base holds every index row, its off readings included, so
a choice can still turn them on; a 2.x lexicon with a word in both titles
sets translates as a title; the caller counts leave out surnames, which
stays; the field count and the ADDED_IN pointer corrected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derek73 derek73 added docs Documentation fixes and updates breaking-change Backwards-incompatible API change design labels Nov 2, 2026
@derek73 derek73 self-assigned this Nov 2, 2026
derek73 and others added 9 commits November 1, 2026 23:28
A 2.x pickle translates as the default plus a log; a lexicon keeps its
base and an ordered edit log apart; replace carries the underscore state;
the default's base loads lazily; the views read the lexicon's kinds; an
add that changes nothing warns; equality and | state the choice; the
strict supersession is marked; name and relation are categories only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A 2.x state translates onto the nearer named base, so a 2.8 pack
fragment stays empty-based; the warning is narrowed to a title made
phrase-only by a given reading under no choice; bases compare by name,
a snapshot by its rows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The 4i-b row names the narrowed warning; the 2.x translation removes a
word first only where the base holds it, so the 2.8 fixture's lexicon
equals its fresh 3.0 spelling.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Logs compare as written; parser_for recompiles and refuses with the choice
named; the underscore choice parameters are validated, a private exception
to 3j; a 2.x chosen parser loads with no choice; the title warning fires
only on a new title kind; bound_given is a fifth named kind; parser_for
joins a pack fragment under the caller's lexicon.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…dings (#754)

The title warning is decided, with its own entry and Standing line; it
warns save a property update of a held title reading, so a re-add of
dean's own kind warns again. No 2.x pickle carries a choice, so that
paragraph goes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…entence (#754)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Quote 3j verbatim and treat the underscore parameters as a private route,
not an exception; item 4 says the choice is set publicly only by
parser_for; fragments join in pack order, a later pack winning, before the
caller's lexicon; edits stored frozen; the parser_for clash offers raise
(recommended) or caller-wins; the decided entry's attribution follows the
file's head convention.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ry (#754)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The configure-by-reading API is decided as recommended; caller-wins at
parser_for, an eager default base and refusing every 2.x pickle are
declined. The chained-choices entry and 3j's dropped-listing clause are
superseded, effective with 4i-c; Standing and Open lines updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derek73 derek73 changed the title Design: the 3.0 Lexicon surface, configuring by reading (#754, 4i proposed) Design: the 3.0 Lexicon surface, configuring by reading (#754, 4i decided) Nov 2, 2026
The shape question no longer calls the method names open; the decision
entry carries a SUPERSEDES: line; the Declined reason names the overlap
rule the dean customization round-trips under.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derek73
derek73 merged commit b55d4d3 into master Nov 2, 2026
13 checks passed
@derek73
derek73 deleted the claude/lexicon-surface-design-6e662a branch November 4, 2026 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-change Backwards-incompatible API change design docs Documentation fixes and updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant