arborist/docs/tickets/ticket-000042-term-aliases-table.md
russell@unturf.com ed470dc4b9
docs: 100% claim-pack warrant resolution recorded across tickets
Update #000031 ticket with the 2026-05-10 push details: 18 textbook
substrates ingested, 40 citation-alias rows + 13 term-alias rows,
cascade tuning in _build_record_query_cascade. Per-pillar end state
recorded (13/13 · 10/10 · 13/13 · 18/18 · 5/5 · 5/5 · 14/14 · 14/14).
Honest tier breakdown of the 92 chains added. Phase 1 follow-up
(source-side title-from-author backfill) and via_citation_alias
attribution fix surfaced as open follow-ups under the same ticket.

Update #000041 with full registry of 40 citation aliases now live
(distribution by substrate; per-pillar breakdown). Update #000042
with 13-row count + acknowledgement that Newton/arithmetic rows are
mostly unused (cascade picked different tokens).

Update CLAUDE.md with the 18 per-textbook make targets + the 100%
warrant-resolve milestone.

Update TICKETS.md index status for #000031, #000041, #000042.

No code change in this commit; documentation refresh only.
2026-05-10 08:40:35 -04:00

10 KiB

Ticket #000042 — Term-aliases table (vocabulary-mismatch bridge)

Status: closed · mechanism + 4 smoke aliases landed 2026-05-09; 13 rows live by 2026-05-10 across geometry + classical-physics + arithmetic domains. Geometry rows lifted all 18 Hilbert pillar IV records (4 smoke aliases for the 1902-Townsend vs modern-vocabulary gap). Classical-physics rows registered for Newton 1729 vocabulary (some unused — cascade picked different tokens; informational only). Arithmetic rows for Peano symbolic-vs-modern axiom names (most unused — same reason). Opened: 2026-05-09 Scope: Add an arborist term_aliases table that maps a (term, domain) pair to an alternate term used in older / foreign-language / pre-modern translations of the same concept. Read at warrant-resolve time, AND'd with the existing FTS5 query so the resolver can find chunks that use the cited concept even when the cited word doesn't appear verbatim in the textbook prose. Audience: future blackops shifts running warrant-promotion on records whose theorem name uses modern vocabulary against textbooks that use historical terminology. Hard constraint: alias decisions are auditable. Each alias row carries a decision_at timestamp + decision_by identifier (free-string, e.g. "fox 2026-05-12"); silent substitution of synonyms is not allowed. Same audit discipline as #000041 citation-aliases.


1. Problem statement

#000040 Phase 5 cascade landed correctly but produced zero new derivations rows for the 7 unresolved Hilbert pillar IV records. Root cause documented in §6 of that ticket:

  • Claim-pack records (g4 2025) use modern post-1950s names: "Axiom of Line Incidence", "Axioms of Incidence" (Group I).
  • Hilbert's 1902 Townsend translation uses the original "Verknüpfung" / "axioms of connection" — Hilbert's own 1899 German term, before the field standardized on "incidence" as the English rendering.
  • Empirically: literal token "incidence" appears zero times in the ingested Hilbert TeX surface; "connection" is the relevant synonym.

The Phase 5 cascade tries phrase → content-tokens → discriminating-tokens → OR-fallback. Every layer searches for tokens THE TEXTBOOK DOESN'T CONTAIN. No matter how clever the query, you can't find a word that isn't there.

This is a real engineering gap and not a one-off case:

  • Hilbert German "Verknüpfung" → "connection" (1902) → "incidence" (modern). Same gap with "Anordnung" → "order" → "betweenness" (sometimes).
  • Łukasiewicz Polish 1921 papers used Polish neologisms; their English translations used a different vocabulary than modern textbooks.
  • Newton's Motte 1729 calls the second law "alteration of motion proportional to the impressed force" — modern physics says "F = ma".
  • Boole 1854 "elective symbols" → modern "Boolean variables".
  • Aristotle's traditional Mure / Owen translations use "convertibility", "syllogism in Barbara", "particular" / "universal" — modern logic uses different words for the same concepts.

Every textbook-translation pair has a vocabulary gap.

2. Design choices

2.1 Schema

CREATE TABLE IF NOT EXISTS term_aliases (
    term               TEXT NOT NULL,        -- modern term used in claim-pack
    alternate_term     TEXT NOT NULL,        -- term used in textbook prose
    domain             TEXT NOT NULL,        -- e.g., "geometry", "logic"
    decision_at        INTEGER NOT NULL,     -- unix timestamp
    decision_by        TEXT NOT NULL,        -- e.g., "fox 2026-05-12"
    decision_rationale TEXT,                 -- e.g., "Hilbert 1902 uses 'connection' for what modern texts call 'incidence'"
    PRIMARY KEY (term, alternate_term, domain)
);

Stored alongside citation_aliases (#000041) — same global location, same opt-in discipline, same audit trail. The two tables are orthogonal:

  • citation_aliases substitutes ONE textbook for another (Hilbert-Ackermann ↔ Mendelson).
  • term_aliases translates a vocabulary item WITHIN a citation (modern "incidence" ↔ historical "connection").

A claim-pack record might need BOTH layers (cite Hilbert, match using Hilbert's "connection" for "incidence"). The resolver applies both during a single warrant-resolve run.

2.2 Resolver wiring

Current resolver builds an FTS5 query from the claim-pack record's title + content. With term-aliases:

  1. For each token in the FTS5 query, look up term_aliases for (token, domain) (domain inferred from claim-pack pillar — pillar IV → "geometry").
  2. If aliases exist, expand the FTS5 query: replace token with (token OR alt_term1 OR alt_term2).
  3. Run the cascade as today; the OR-expansion gives FTS5 a way to match either vocabulary.

This means a query like "line incidence" (phrase) becomes "line incidence" OR "line connection" when fox approves the incidence ↔ connection alias for geometry domain. The phrase match still works on textbooks that use modern vocabulary; the OR-expansion catches Hilbert 1902.

2.3 Domain inference

Per arborist/qa/warrant_resolver.py the claim-pack record has metadata: pillar (Roman numeral I-VII + IX) → domain_for_pillar(pillar):

I    → "logic"
II   → "set-theory"
III  → "arithmetic"
IV   → "geometry"
V    → "probability"
VI   → "classical-physics"
VII  → "combinatorics"
IX   → "lambda-calculus"

Domain is a string in the schema; new pillars (e.g., the hypothetical pillar VIII for graph theory) extend this map without schema changes.

2.4 CLI surface

arborist alias term add TERM ALT --domain D --by FOX [--rationale RAT]
arborist alias term list [--domain D] [--filter X]
arborist alias term remove TERM ALT --domain D

Subcommand-grouped under arborist alias shared with the citation-alias surface (#000041). Both take --use-aliases opt-in on arborist warrant-resolve.

2.5 What this does NOT do

  • Does not auto-discover aliases. Requires fox decision per pair. The substrate's "honest substitute, not silent fabrication" discipline holds.
  • Does not do general-purpose semantic similarity (embeddings, WordNet, etc.). Aliases are exact-string substitutions in a curated table.
  • Does not mesh-sync auto. Aliases are local-curator decisions; peers can share the table but each peer's curator approves them locally.

3. Recommendation

Trigger conditions:

  • Trigger A: A foreign-language PD textbook is ingested whose English translation uses different vocabulary than modern claim-pack records. Hilbert German 1899 if anyone ingests the original; Kolmogorov German 1933.
  • Trigger B: A historical translation is ingested whose vocabulary differs from modern (Hilbert 1902 Townsend, the current case; Newton 1729 Motte for physics).
  • Trigger C: A textbook is ingested whose author uses idiosyncratic vocabulary (Boole 1854 "elective symbol"; Aristotle traditional translations).

Today trigger B fires for Hilbert. 7 records would resolve if ("incidence", "connection", "geometry") were a registered alias.

Recommend implementation when fox decides on at least one alias entry. The codepath integrates cleanly with the existing Phase 5 cascade — adds query expansion just before _fts5_search.

4. Implementation sketch

4.1 Schema

Add to arborist/store.py alongside the citation-aliases schema:

def _ensure_term_aliases_schema(conn):
    conn.execute(SCHEMA_TERM_ALIASES)

4.2 Resolver integration

In arborist/qa/warrant_resolver.py:

def _expand_query_with_term_aliases(
    query: str, domain: str, aliases_db: Path
) -> str:
    """Replace each token in `query` with `(token OR alt OR alt2)`
    when `(token, domain)` has alias rows in `aliases_db`."""
    # Tokenize; lookup; rewrite; return.
    ...

# In resolve_chunks (or its caller):
if use_aliases:
    query = _expand_query_with_term_aliases(query, domain, aliases_db)

4.3 CLI subcommands

def _cmd_alias_term_add(args):
    ...
def _cmd_alias_term_list(args):
    ...
def _cmd_alias_term_remove(args):
    ...

Wire under the existing alias subcommand group from #000041.

5. Hard constraints (re-stated)

  1. No silent substitution. Every alias row has decision_at + decision_by + decision_rationale.
  2. Opt-in by default. --use-aliases flag required; default warrant-resolve runs without alias expansion.
  3. Audit trail preserves which alias resolved what. Derivations rows from alias-resolved chains carry a distinct process_id ("warrant-resolver-v1+alias", shared with citation-aliases — both alias mechanisms collapse to the same audit-distinct flag since the downstream consumer only cares "was an alias used, yes/no").
  4. OR-expansion preserves precision. The expanded query matches either vocabulary; it doesn't widen to ANY token. False-positive risk stays bounded by the existing _shard_matches_citation author + title check.

6. Open questions

  • Bidirectional aliases? If ("incidence", "connection", "geometry") is registered, should the reverse ("connection", "incidence", "geometry") apply too? Probably yes (symmetric); document the convention.
  • Phrase aliases? "axioms of incidence""axioms of connection" is more discriminating than single-token "incidence" ↔ "connection". Schema supports it (phrases are just multi-word strings); operators populate both granularities.
  • Mesh sync? Same answer as citation-aliases: defer mesh semantics; treat the table as local-only initially.
  • Alias confidence? Some aliases are EXACT synonyms (Hilbert's "Verknüpfung" → "connection" 1902 → "incidence" modern). Others are LOOSE (Newton's "alteration of motion" → "F=ma" — not strictly equal). Schema doesn't model confidence today; if needed, add a column later.

7. Status

Open · awaiting fox's first term-alias decision. Today's candidate fox could trigger this with:

arborist alias term add incidence connection \
    --domain geometry \
    --by "fox 2026-05-XX" \
    --rationale "Hilbert 1902 Townsend uses 'connection' for what modern texts call 'incidence'"

That single decision unlocks 7 Hilbert records.

Estimated size when triggered:

  • Schema migration: ~30 LOC + 1 migration test.
  • Query expansion: ~50 LOC.
  • CLI subcommands (term add / list / remove): ~80 LOC + 5 unit tests.
  • Documentation update.

Total: ~160 LOC + ~6 tests when triggered.


8. References

  • #000040 §6 — terminology mismatch surfaced by Phase 5
  • #000041 — sibling design (citation-aliases table)
  • #000038 — Phase 4 content acquisition (parallel track)