Repository navigation
fix(consolidation): pin source_fact_ids to the batch and report actions that cite none (#5273) - #5307
Merged
Merged
Conversation
…ns that cite none (#5273) A create/update whose source_fact_ids all missed the batch (truncated UUID, an observation id) was dropped with no trace, and its facts were reported as no_durable_knowledge and stamped consolidated. - The per-batch response schema now pins source_fact_ids to the batch's fact ids (enum, plus minItems: 1 when array-length keywords are supported), so a grammar-constrained provider cannot emit an unresolvable id. Validation stays list[str], so a provider ignoring the hint cannot fail the batch. - A discarded action is logged at warning level and counted in the job's new unresolved_actions stat and the run summary. - has_tagged_union's cache is bounded, since a model is now built per batch.
This was referenced Oct 6, 2026
This was referenced Oct 6, 2026
This was referenced Oct 8, 2026
Merged
This was referenced Oct 16, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5273.
When a model miscopied a fact id in
source_fact_ids(truncated UUID, an observation id), consolidation dropped the whole create/update with no log, then reported its facts asno_durable_knowledgeand stamped them consolidated. On the reporter's bank that was 206 of 537 actions with 0 errors.Changes
_build_response_modelnow takes the batch's fact ids and emitsitems.enum(plusminItems: 1whenHINDSIGHT_API_LLM_SUPPORTS_MAX_ITEMSis on) onsource_fact_idsfor creates and updates. A grammar-constrained provider can no longer emit an id outside the batch. Validation stayslist[str], so a provider that ignores the hint can't fail the batch. Checked that the schema survives both the OpenAI strict transform and the Gemini SDK conversion.unresolved_actionsstat, plus a summary warning line.has_tagged_unionused an unboundedlru_cachekeyed on the model class. Now that each batch builds its own class, it's capped at 256.SUPPORTS_MAX_ITEMSentry now mentionsminItems.Not done: facts behind a discarded action still count as skipped. The bad ids don't say which facts were meant, so they can't be linked back.
Tests: schema unit tests (enum, minItems gating, still accepts foreign ids) and an end-to-end run where one create cites a mangled id → 1 observation created,
unresolved_actions == 1.