feat(understand): the plant pack, lean 65, five-language aliases, eight golden queries and the counts

The three track-H branches are merged; this is the integration that makes the
six tools one surface.

- TOOL_PACK_NAMES gains "plant" (pipe_takeoff, cable_takeoff); SECTION 26's
  four readers stay core. Lean gains drawing_understand and reaches 65 (55
  with TOOL_PACKS=core). The `understand` and `plant` tags rank after `arch`,
  so the sections file as `understanding` (4) and `plant` (2): 247 tools in
  28 groups.
- discovery/aliases.py folds spec section 12's vocabulary into the six records
  the branches wrote - metraj, metre cetveli, boru / kablo listesi, fark,
  karsilastir, revizyon farki, olcek, birim in both Turkish spellings, BOQ,
  takeoff, scale check, COMPARE - without writing a phrase twice. The Russian
  terms are data only: the BM25 tokenizer keeps [a-z0-9], and no golden case
  pretends otherwise.
- Eight golden tuning cases, four of them Turkish; the shared-command
  allowlist reconciled with what the merged records claim; the token-suite
  formula excludes the new pack; the inventory regenerated, the registry
  snapshot retaken and the README figures taken from check_doc_numbers.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FKFStjEFzpGyLq5bMpWxTd
This commit is contained in:
Umut CAN
2026-09-24 14:51:29 +03:00
co-authored by Claude Opus 5.5
parent 8c1a6cb27c
commit 835bc4b65e
9 changed files with 338 additions and 70 deletions
+61
View File
@@ -208,3 +208,64 @@ def test_alias_text_contains_commands_and_synonyms():
for token in (*record.acad, *record.synonyms):
assert token in text
assert alias_text("no_such_tool") == ""
# ── track H: spec §12's five-language vocabulary ───────────────────────────
#
# One row per term the spec names, in the record(s) a plant engineer means by
# it. Turkish comes in both spellings (diacritic and ASCII-folded): the search
# tokenizer splits on a non-ASCII letter instead of folding it.
TRACK_H_TERMS = {
"pipe_takeoff": (
"takeoff",
"boq",
"metraj",
"metre cetveli",
"boru listesi",
"boru metrajı",
"boru metraji",
"boru metrajı çıkar",
"boru metraji cikar",
"спецификация", # specification: a bill of quantities
"ведомость", # statement: a quantity schedule
),
"cable_takeoff": (
"takeoff",
"boq",
"metraj",
"metre cetveli",
"kablo listesi",
"kablo metrajı",
"kablo metraji",
),
"drawing_diff": (
"compare",
"dwgcompare",
"fark",
"karşılaştır",
"karsilastir",
"revizyon farkı",
"revizyon farki",
"iki revizyonu karşılaştır",
"iki revizyonu karsilastir",
),
"drawing_scale_check": (
"scale check",
"ölçek",
"olcek",
"bu çizim ölçekli mi",
"bu cizim olcekli mi",
),
"drawing_understand": ("birim", "çizim birimi", "cizim birimi"),
}
def test_track_h_records_carry_the_five_language_vocabulary():
missing = {
tool: [term for term in terms if term not in TOOL_ALIASES[tool].synonyms]
for tool, terms in TRACK_H_TERMS.items()
}
missing = {tool: terms for tool, terms in missing.items() if terms}
assert not missing, f"track-H records miss spec §12 vocabulary: {missing}"
assert "COMPARE" in TOOL_ALIASES["drawing_diff"].acad