* feat: add max_observations_per_scope bank config Adds a configurable limit on the number of observations per tag scope. When the limit is reached, consolidation only updates/deletes existing observations — no new ones are created. Enforcement is done via a constrained Pydantic response model (max_length on creates list) so the LLM structurally cannot exceed the limit, plus prompt guidance. - Config: HINDSIGHT_API_MAX_OBSERVATIONS_PER_SCOPE (-1 = unlimited) - Reorder action execution: deletes → updates → creates - Dynamic _ConsolidationBatchResponse with max_length constraint - Prompt CAPACITY CONSTRAINT section when near/at limit - Observations with no tags skip the limit entirely - Control plane UI field + docs * fix: strengthen max_observations tests with mock LLM + defensive truncation - Rewrite integration tests to use MockLLM with deterministic responses (one observation per fact) instead of relying on real LLM behavior - Add defensive truncation in _consolidate_batch_with_llm as belt-and- suspenders — catches LLM providers that ignore JSON schema max_length - Tests now assert exact counts, not just upper bounds |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| consolidator.py | ||
| prompts.py | ||