ontocast.agent.complete_facts¶
Insert-only facts completion agent.
Runs after the facts render/critic loop, only when the numeric-coverage
inventory still lists measurements the render missed (see
:func:ontocast.tool.facts_validation.unit_findings.unit_numeric_inventory).
Mirrors :mod:ontocast.agent.criticise_facts in shape -- one LLM call parsed
into :class:~ontocast.onto.model.TripleFix fixes -- but proposes insertions
instead of judging what is already there.
The fixes returned here are not applied by this module: the unit loop
(ontocast.stategraph.atomic) compiles and applies them through
compile_critic_fixes / _apply_patches, the same per-subject
regression check a critic fix goes through, so a fix that leaves the unit
worse is rolled back exactly the way a bad critic fix would be.
Attributes¶
logger = logging.getLogger(__name__)
module-attribute
¶
Classes¶
Functions:¶
complete_facts(state, atomic, inventory)
async
¶
Propose insert-only fixes recovering measurements the render missed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state
|
UnitFactsState
|
The unit's current facts state. Read-only here -- the unit loop applies whatever this returns. |
required |
atomic
|
AtomicToolBox
|
Toolbox for the LLM call and the unit's quantity vocabulary. |
required |
inventory
|
NumericInventory
|
The unit's missing-measurement inventory, already computed by the caller so the completion pass and the NUMERIC_COVERAGE finding agree on what is missing. An empty inventory short- circuits with no call. |
required |
Returns:
| Type | Description |
|---|---|
list[TripleFix]
|
Proposed fixes, action |
list[TripleFix]
|
is dropped defensively rather than trusted -- this pass is |
list[TripleFix]
|
insert-only by contract, not by the model's cooperation. |
Source code in ontocast/agent/complete_facts.py
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 | |