Repository navigation
fix(homeostatic): the fold UPDATE runs in each backend's own dialect (#736) - #761
Conversation
|
ZETETIC-REVIEW: APPROVE
|
…736) _apply_fold issued LEAST/GREATEST in handler code, which SQLite lacks, so every fold cycle raised OperationalError on the SQLite backend. The UPDATE moves into fold_heat_base on each store (PostgreSQL keeps LEAST/GREATEST/ NOW(); SQLite uses scalar MIN/MAX and CURRENT_TIMESTAMP), like the other heat writers. Fixes #736 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n test stubs fold_heat_base (#736) The fold UPDATE moved from the handler into PgHeatMixin.fold_heat_base, which borrows the batch pool through self.acquire_batch(). PgStoreHost, the typing surface every pg mixin inherits, declared acquire_interactive but not acquire_batch, so pyright's zero-diagnostic gate failed on pg_store_heat.py:63. The host now declares acquire_batch next to acquire_interactive (implementation unchanged in pg_store_schema.py). test_homeostatic_stratification stubbed the old handler path (store.acquire_batch -> conn.execute) and asserted on conn.execute. It now stubs store.fold_heat_base and asserts one call, for the auto class only, which is what the test protects (deliberate is never folded). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VH9JM8qvKiJysP16BmAxAU
08be5d9 to
d3a0743
Compare
|
ZETETIC-REVIEW: APPROVE Delta depuis 08be5d9 (relu par range-diff) : rebase sans changement, plus d3a0743. Le stub |
Fixes #736
Cause
_apply_fold(handlers/consolidation/homeostatic_apply.py) issuedLEAST/GREATESTin handler code. SQLite has neither, so every fold cycle raisedsqlite3.OperationalError: no such function: LEASTon the SQLite backend.Fix
The UPDATE moves into
fold_heat_base(domain, write_class, factor)on each store, as the other heat writers already are. PostgreSQL keeps the same statement; SQLite uses scalarMIN/MAXandCURRENT_TIMESTAMP. No skip, no fallback. The I2 allow-list tracks the two new writer sites.Evidence
tests_py/infrastructure/test_sqlite_homeostatic_fold_736.pyruns the fold on a realSqliteMemoryStore: fails on main withno such function: LEAST, passes here.🤖 Generated with Claude Code
https://claude.ai/code/session_01VH9JM8qvKiJysP16BmAxAU