Commit History
-
[NOTICKET] feat(knowledge-extraction): subdomains + counts — v3 complete
Rifqi Hafizuddin +1: Claude Opus 5The last two DomainContext v3 fields, both deterministic. No LLM, no prompt change, no spend. subdomains Rolled up from the glossary entries' own `subdomain_tags`, never asked of the model. Each tag was already chosen once, per term, with that term's evidence in front of the model; a second document-level classification would be the same judgement made with less context and no way to check it. Ordered by tag frequency descending with an ALPHABETICAL TIEBREAK, which is load-bearing rather than tidy: on the reference document `production` and `equipment` both score 5, and the entries list them in differing order, so without the tiebreak two runs of one document would disagree. n_terms / n_formulas / n_rules Counts of the other three artifacts. Cheap orientation for a reviewer deciding whether a queue is worth opening, and the fastest way to spot a run that silently extracted nothing. Both are computed in `_finalise_domain`, called at the END of extract_all rathe…172d8dc -
[NOTICKET] feat(knowledge-extraction): span-guard the domain branch
Rifqi Hafizuddin +1: Claude Opus 5The domain branch was the pipeline's ONE unverifiable output: GUARDED_FIELDS ["summary"] was `()`, so `title` and `purpose` were unchecked model prose on nano, the tier whose failure mode is least detectable. Every other branch had to prove its claims against the source; this one did not. The fix is not a bigger model. It is asking a different question: v2 "write a short orientation brief" -> composed -> unprovable v3 "locate the document's own statement" -> quoted -> checkable A summary cannot be found in the source by construction. A quote can. So `purpose` becomes `purpose_verbatim`, prompts/summary.txt is rewritten from summarise to locate, and both text fields join GUARDED_FIELDS + _TRANSCRIBED. Also wires validation into `_run_summary`, which never called validate_entry - the guard table alone would have been inert. The haystack is the WHOLE document, unlike the other branches: this one is handed every chunk, so a quote may legitimately come from anywhere in it. …e2865ac -
[NOTICKET] feat(knowledge-extraction): derived outline + corroborated key parameters
Rifqi Hafizuddin +1: Claude Opus 5The two DETERMINISTIC halves of the DomainContext v3 reshape. No LLM, no spend, no prompt change - which is exactly why they ship ahead of the rest: the parts that need a prompt rewrite and an eval run are split off and still proposed. outline Derived from the artifact's heading_path, in reading order, de-duplicated. The blocker was upstream: adapter.py was dropping heading_path on the floor, so the internal Chunk never carried it - the same way it once dropped `latex`, and with the same consequence, a branch inventing prose about a document whose own structure was sitting unread. Fixed at the seam. It is the only field on this branch carrying the strong guarantee for free: verbatim source structure, nothing to hallucinate. On the BUMA fixture it yields 11 entries from 29 of 31 chunks, including the verbatim "Physical of Availability (PA)" the pipeline is required to surface rather than tidy. key_parameters Was list[str]; now list[KeyParameter{surface, term_id}],…6f5d619
-
[NOTICKET] refactor(knowledge-extraction): BriefContext -> DomainContext
Rifqi Hafizuddin +1: Claude Opus 5The workstream diagram has always called this box "Domain Knowledge", while the model and its fields described a short orientation card. Rename the entity to match the intent before anything is persisted: once an expert has approved rows keyed on these ids, changing the `b_` prefix is an id migration that loses the approvals - the exact failure the deterministic-id scheme exists to prevent. BriefContext -> DomainContext brief_id -> domain_id (prefix b_ -> d_) ExtractionResult.brief -> .domain brief_context.json -> domain_context.json Deliberately unchanged: - `Branch = "summary"` and GUARDED_FIELDS["summary"]. The branch literal is the measurement key in CallUsage.branch / RejectedField.branch; renaming it would break comparability with the committed eval baseline. - prompts/summary.txt. Editing prompt text needs the eval path, and the rewrite belongs with the v3 schema change, not with a rename. No field, prompt or guarding change - the …7f47c61
-
[NOTICKET] fix(knowledge_extraction): rule.txt few-shots stop contaminating the gold set (X23)
Rifqi Hafizuddin +1: Claude Opus 5Two of the four worked examples were lifted from the reference corpus, and they contaminated the measurement in opposite directions. Example 2 used "Waterfall Analysis dapat di-review melalui dua metode" and taught that it is NOT a rule. The gold set records that exact sentence as WATERFALL_TWO_METHODS. The prompt was instructing the model to fail one gold rule by construction, so the branch could not score above 14/15. Example 1 was the inverse and had gone unnoticed: its evidence is gold rule PTY_PRODUCTION_SOURCE verbatim (joint survey / truck count). That is a free hit inflating the score, not capping it. Both are now synthetic, which is the reasoning examples 3 and 4 already carried in the prompt itself. The closing note is generalised: all four are synthetic, so neither an answer nor a NON-answer for a real document leaks in. The gold set was deliberately NOT touched, following the X22 precedent -- the prompt is tuned constantly and the gold is the measuring instrument, so th…7e8614f -
[NOTICKET] feat(knowledge_extraction): record which guarantee formula_latex carries
Rifqi Hafizuddin +1: Claude Opus 5Three paths leave formula_latex populated and they are not equally strong: located in the source markup, no markup to check against, or an operator the source cannot express. Until now the output could not tell them apart, so a verified formula and an unverifiable one reached the expert as identical rows. That gap is not theoretical. MinerU's pipeline backend writes multiplication as a bare letter x, so every product formula from such an artifact is unverifiable -- including the Production formula this contract uses as its own worked example. Every artifact on Sofhia's machine is pipeline, because she has no GPU. FormulaEntry gains latex_verification: verified | unverified_no_markup | unverified_operator, null when there is no claim to characterise. Set by the span check, never by the model -- the model cannot know which guard ran, and a field it could write would be a claim rather than a record. _mark_latex is a never-throw seam like the rest of validation: an entry type without th…f81a227 -
[NOTICKET] feat(knowledge_extraction): output schema v2 — entity ids, links, 16 fields cut
Rifqi Hafizuddin +1: Claude Fable 5Harry's review of the output contract asked for four things: an id on every entity, a formula referenced rather than restated, rules related to formulas, and a smaller schema. All four are adopted. Two defects surfaced while adding the ids, and they matter more than the ids do. Neither existing identifier survived a re-run: `cluster_id` was a frequency-rank ordinal (`#c000` over a list sorted by mention count), so one changed count reshuffled every id after it, and `rule_id` was written by the model, so the same rule could return a different slug next run. The product is an expert working a review queue — if Mas Beta approves 40 entries and a prompt is retuned, unstable ids lose which 40. Approval continuity, not linking, is why these exist. New `ids.py` mints term/formula/rule/brief ids as sha256 over content: never positional, never model-supplied. New `link.py` resolves every reference after the branches run — deterministic, no LLM, no spend — and returns dangle counts rather than…49dfe4d