Commit History
-
[NOTICKET] fix(knowledge_extraction): move runner into the package; fix two ranking defects
Rifqi Hafizuddin +1: Claude Fable 5Runner relocated scripts/run_knowledge_extraction.py -> the package as src/knowledge_extraction/cli.py. scripts/ is gitignored, and this runner is the pipeline's operator entry point, so it has to ship with the module: uv run --no-sync python -m src.knowledge_extraction.cli <artifact.json> pyproject: narrow the T201 lint exemption to that one CLI file rather than all of scripts/, so the ignore traces to this change and nothing else. Two ranking defects found while verifying against the real 9-page BUMA standard (both recorded as deviations V1/V2 in KNOWLEDGE_PIPELINE_CALIBRATION.md §9): V1 — a heading that names the term now counts as a mention at offset 0 for cue-proximity scoring. Indonesian standards are written "2.1.3 Physical of Availability (PA)" / "Adalah ketersediaan fisik...": the heading names the term and the body opens with the definitional cue WITHOUT repeating it, so the definition section earned no cue bonus at all. Measured before the fix, PA's own definition se…72605ff -
[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