ontocast.agent.complete_facts¶
Insert-only facts gap agent.
Runs after the facts render/critic loop, only when the unit has a gap: the
numeric-coverage inventory still lists measurements the render missed (see
:func:ontocast.tool.facts_validation.unit_findings.unit_numeric_inventory),
or a statement or value is linked to nothing (statement_without_subject
findings).
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, subject_gaps=(), detached=())
async
¶
Propose insert-only fixes closing the unit's gaps.
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. |
required |
subject_gaps
|
Sequence[FactsUnitFinding]
|
The unit's |
()
|
detached
|
Sequence[URIRef]
|
The unit's instances linked to nothing that no subject gap names. With no gap of any kind there is no call. |
()
|
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
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 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 | |