mixle.task.knowledge_routing module¶
M3 – problem decomposition & tool/model routing over the IC-10 catalog (M3-core wiring).
route_task turns one compound question into ordered sub-tasks and explicit, typed prerequisite
gaps – never hidden prose intermediates – matches each gap against the IC-10 catalog by declared
domain/schema, and drives the existing orchestrate() loop to resolve
what it can. Every tool result is normalized into an IC-13-shaped KnowledgeItem/KnowledgeDelta
dict with model/tool attribution and a receipt; nothing free-form ever becomes a canonical delta. Core
never imports mixle_knowledge – everything here is a plain, dependency-free dict envelope shaped
to the frozen IC-13 contract (notes/exec/contracts.md), so M1c/M2a can validate and persist it.
This module reuses, rather than reinvents, three pieces of existing machinery:
DecompositionProposer– an outcome-trained proposer over ordered sub-task sequences;proposer.plan_model.sample(rng)gives the decomposition order.orchestrate()– the step/re-plan/stop controller loop; this module supplies a trivial sequential plan model plus aWorldthat resolves one gap per step.ResearchProposal– the existing “here is how to find out” abstention output;research_proposal_to_gap()folds it into the same IC-13 gap shape rather than maintaining a second missing-knowledge lifecycle.
Pre-M5, the decomposition itself is heuristic/seeded (proposer is fit on a seed corpus, not
learned online) – that is an explicit non-goal here, deferred to M5.
- class KnowledgeOrchestrationResult(answer, trace, delta, remaining_gaps)[source]
Bases:
objectAn IC-13-shaped, dependency-free dict envelope: the answer, the IC-5 trace, an aggregate IC-13
KnowledgeDelta-shaped dict, and the gaps still open after this call. M1c/M2a validate and persistdelta/remaining_gapsagainst the realmixle_knowledgecontracts; core never imports that package itself.
- research_proposal_to_gap(proposal, *, gap_id)[source]
Map an existing
ResearchProposal(an abstention’s “here is how to find out”) into the frozen IC-13 gap shape, rather than maintaining a second missing-knowledge lifecycle alongside it.ResearchProposalcarries no structured schema for the missing evidence, sorequired_schemais a best-effort description;acceptance_criteriais the proposal’s own ranked acquisition options (mirroringrender()’s top-4 slice).nearest_knowledge/notehave no home in the frozenKnowledgeGapfields and are intentionally dropped rather than smuggled in as ad hoc extra keys.
- route_task(question, catalog, *, proposer, budget, bundle=None)[source]
Decompose
questioninto ordered sub-tasks and explicit prerequisite gaps, route each gap to the cheapest reliable/verifiable catalog entry (or an item already inbundle), driveorchestrate()to resolve what it can, and return an IC-13-shaped answer/trace/delta/remaining-gaps envelope. Core emits plain dicts and never importsmixle_knowledge; M1c/M2a validate and persist this envelope against the real contracts.