Commit History
-
[NOTICKET] fix(knowledge-extraction): parenthetical abbreviations split one concept in two
Rifqi Hafizuddin +1: Claude Opus 5Found while composing the first real domain context: "UA" and "Utilization of Availability (UA)" arrived as two measures, each with its own formula. One concept, two glossary entries - inside a SINGLE document, which is why the corpus concept layer was not the answer here. ROOT CAUSE, and it is smaller than it looked. `normalize()` allowed brackets through and then stripped only at the edges, so "Utilization of Availability (UA)" became "utilization of availability (ua" - the trailing ")" came off, the opening "(" stayed, and the malformed key matched neither the legend's expansion nor the bare abbreviation. The balance check now runs AFTER the strip, because the strip is what creates the imbalance. THE ABBREVIATION LOGIC, which is where the fix belongs. `canonical_key` now reads the "X (Y)" shape: the legend's abbreviation wins, then the legend's expansion, then a self-declaring initialism ("Equipment Capacity Analysis (ECA)" is a declaration even when the legend never listed it), t…d19a981
-
[NOTICKET] feat(knowledge_extraction): free stages — models, seam adapter, filters, cluster, ranking
Rifqi Hafizuddin +1: Claude Fable 5First slice of extraction v2, rebuilt in this repo (the kex prototype is not being ported). All stages here are free: zero API calls, CPU only. New module src/knowledge_extraction/ (named to avoid colliding with src/knowledge/, the existing OCR->pgvector service, which is untouched): - models.py pydantic v2 contracts. Encodes the three invariants: content fields Optional, subdomain_tags as an enum, provenance.span mandatory. Adds source_wording so the literal source wording survives instead of being normalised away. - adapter.py THE ONLY file that knows the seam's shape. Stages depend on an internal Chunk subset, so the artifact contract can settle either way without touching a stage. Verified against both live shapes: Sofhia's bare-list draft with its `kind` discriminator, and the document-level envelope proposed in the checklist.…024c30a