[NOTICKET] feat(knowledge): arm the consumption path end to end (K5, K6, K9, K11)
Rifqi Hafizuddin+1: Claude Opus 5
a6bed7f
Everything wired, and a single real turn through the product to prove nothing
broke. Basic first, iterate later - the eval (K8) is deliberately still owed.
WIRED. The composition root resolves the company's domain card once per turn and
threads it, the same shape the catalog uses for the traceability scratchpad
(Q10) rather than a lookup inside each prompt builder. The planner reads it
before the catalog; the coordinator resolves the terms a finished run actually
touched and hands those to the assembler; traceability records which knowledge
was in play.
Both paths are NEVER-THROW. Domain knowledge is an ENRICHMENT: a turn that
worked without it must keep working, so a failure degrades to no card rather
than to no answer. A company with no reviewed knowledge plans exactly as it
did before, because the card renders to "".
PROMPTS. planner.md gains a "Domain knowledge" section: their definitions beat
your priors; match a question's wording through `Known terms`; **a term you
re…
The half that could not be derived: what a domain IS, and what it deliberately
is NOT. `measures`, `policies` and `units` fall out of entries; identity and
boundary do not, and that is what the review loop exists for.
**`boundary` IS DERIVED, and that is the design decision worth keeping.** v3's
real lesson was not the rename - it was changing the question so the answer is
checkable, `purpose` (composed, unverifiable) becoming `purpose_verbatim`
(located, span-checked). A boundary sentence is inherently unquotable, being a
statement about ABSENCE, so asking a model to write one reproduces exactly the
unfalsifiable claim v3 removed.
Instead it is the complement of the covered subdomains over a closed 11-member
enum. On the BUMA corpus: covers production, equipment, planning, hauling,
loading -> "no approved knowledge about maintenance, drilling_blasting,
safety, quality, cost, geology". Deterministic, checkable, and it turns an
honest refusal into a fact about the corpus rat…
[NOTICKET] fix(knowledge-domain): a domain entry was being read as a document brief
Rifqi Hafizuddin+1: Claude Opus 5
1160b03
Found by Rifqi asking the obvious question of the fresh run: the entries are
`document: 1, glossary: 66, rule: 16, formula: 5` - where is the domain?
The answer is that nothing writes one yet, and that is correct: the SCOPE-level
DomainContext is composed at read time, not stored, because a persisted derived
view drifts from what it was derived from - the same reason the review queue is
not stored. What IS missing is the DECLARED half (identity, boundary,
conventions, entities, dimensions), which is expert-authored and therefore must
be an entry to be reviewable, since knowledge_reviews keys on entity_id. That is
what `kind='domain'` is reserved for, and V4-9/V4-10 have not been built.
THE BUG the question surfaced: `compose.py` read `kind='domain'` rows and
treated them as document briefs. That line was transitional, written to handle
v3 rows before the V4-4 split, and after the split it is wrong - the first
declared domain entry ever written would have been silently folded into
`au…
[NOTICKET] feat(knowledge-domain): KnowledgeService — the interface agents read through (K1-K4)
Rifqi Hafizuddin+1: Claude Opus 5
ae0e456
Three calls, and they ARE the product. The end goal is an MCP service exposing
domain knowledge to agents we do not own, so these three are what an external
client would be given; our planner becomes the FIRST client rather than the only
one, which makes the eventual MCP server a transport rather than a redesign.
get_context(user_id, catalog=None) Tier 1 - the card, preloaded
lookup(user_id, terms=[...]) Tier 2 - detail, on demand
terms_used(user_id, surfaces=[...]) what a finished run actually touched
K2 - THE CARD. Two tiers because the preload-vs-lookup question is settled by
size and hit-rate, not by kind. The card carries identity, boundary, measures
with their formulas/inputs/governing rules, and the full vocabulary as BARE
SURFACES - which is the point of it: a term list costs a few hundred tokens and
is what stops a planner force-mapping an unrecognised term onto a column that
merely looks similar (the pr/13 `pa`-as-"revenue" failure). The card says …
Two changes that belong together, both made BEFORE the authorised extraction run
so the fresh rows land in the right shape and nothing needs re-keying after.
V4-4 - THE DOCUMENT BRIEF SPLIT. The per-document object is now `DocumentBrief`,
`kind='document'`, prefix `b_`, and `domain` is reserved for the scope-level
semantic model composed in src/knowledge_domain/.
Prefix history, and it is not churn: b_ (BriefContext) -> d_ (DomainContext,
2026-09-01) -> b_ again (DocumentBrief, 2026-09-08). The middle move renamed
the object without changing what it held - a per-document card. v4 builds the
real domain context and gives d_ to it, so this one goes back to the name that
describes it. Safe only because nothing is approved against it: an id prefix
change after an expert has ruled is a migration that loses their approvals.
WHAT A DOMAIN IS THE UNIT OF (Rifqi's question, answered in the plan section 3.0).
Per SCOPE - the company - composed across all its documents and runs.
…
[NOTICKET] feat(knowledge-domain): compose a real domain context (V4 phase 2)
Rifqi Hafizuddin+1: Claude Opus 5
e43be1c
The derived half of Domain Context v4. New package `src/knowledge_domain/`, the
fourth in the workstream and the first that faces the AGENT rather than the
document:
knowledge_parsing file -> ParsedDocument
knowledge_extraction artifact -> candidate entries
knowledge_ingest orchestration, persistence, HTTP
knowledge_domain entries -> DomainContext <- new
NOTHING HERE CALLS A MODEL. Composition is a join over rows the pipeline already
produced, which is what makes it deterministic, checkable, and free to run. A
measure is the join that makes the output usable: the glossary says what it IS,
the formula says how it is COMPUTED, the rules say when that computation is
VALID. Any one alone is documentation; together they are something a planner can
act on.
VERIFIED against the 88 live rows, no spend:
9 measures from 66 glossary terms (57 bare surfaces correctly dropped -
a term with no definition and no formula adds tokens and no informatio…