honcho/tests
lilyplasticlabs d24958dd7c fix(dreamer): atomic guard-pair write + in-flight stampede defense
Loop 4 response to Vineeth's CHANGES_REQUESTED on PR #573.

The pre-Loop-4 enqueue-time write of last_dream_document_count was serving
double duty: rate limiter AND stampede latch. By arming the 8h guard the
moment a dream entered the pipeline, it implicitly blocked a second dream
from being scheduled during the in-flight window. Loop 3 relocated the
last_dream_at write to completion without moving its sibling baseline,
splitting the semantic pair and exposing the latch role that had lived
only in Vineeth's head.

Invariant (now pinned to check_and_schedule_dream's docstring): from the
moment a dream is scheduled until it completes or fails, no second dream
may be enqueued for the same (workspace, observer, observed) — and the
baseline count advances only when consolidation actually happened.

Changes:
- enqueue_dream: remove the last_dream_document_count write entirely and
  drop the document_count parameter. enqueue no longer touches dream
  metadata; the implicit stampede latch is replaced by an explicit
  queue-backed defense.
- process_dream: extend the existing row-locked RMW to write both guard
  fields atomically. Current explicit-doc count is recomputed inside the
  locked block (not carried on DreamPayload) so the pair reflects the
  actual consolidation moment.
- check_and_schedule_dream: query QueueItem for pending dreams on this
  collection's work_unit_keys (mirrors uq_queue_dream_pending_work_unit_key)
  before arming a timer. Uses queue state as source of truth rather than
  reflecting it into metadata.
- Tests: two new coherence tests under TestGuardPairCoherence —
  test_pending_queue_item_blocks_second_schedule walks the stampede timeline,
  test_silent_failure_allows_retry_on_same_corpus verifies failed dreams
  don't consume the baseline. Existing tests updated to the new contract.
2026-04-24 15:34:00 -04:00
..
alembic feat: make session_name nullable for documents and update related SDKs (#347) 2026-01-26 13:33:11 -05:00
bench Tighten Transaction Scopes (#525) 2026-04-08 11:14:50 -04:00
crud fix dialectic held connection (#477) 2026-04-02 11:13:09 -04:00
deriver fix(dreamer): atomic guard-pair write + in-flight stampede defense 2026-04-24 15:34:00 -04:00
dialectic feat: agentic dreamer and agentic dialectic (#309) 2026-01-12 15:12:17 -05:00
dreamer fix(dreamer): atomic guard-pair write + in-flight stampede defense 2026-04-24 15:34:00 -04:00
integration Tighten Transaction Scopes (#525) 2026-04-08 11:14:50 -04:00
reconciler fix: Various Codex Audits (#386) 2026-02-13 12:00:15 -05:00
routes fix(dreamer): atomic guard-pair write + in-flight stampede defense 2026-04-24 15:34:00 -04:00
sdk ts SDK fix: adding strict checking (#421) 2026-03-30 10:57:12 -04:00
sdk_typescript Tighten Transaction Scopes (#525) 2026-04-08 11:14:50 -04:00
telemetry switch OTEL metrics to prometheus (#344) 2026-01-25 17:26:42 -05:00
unified fix: Remove noisy sentry error on llm failure and upgrade deps (#396) 2026-02-23 15:53:29 -05:00
utils Tighten Transaction Scopes (#525) 2026-04-08 11:14:50 -04:00
webhooks Tighten Transaction Scopes (#525) 2026-04-08 11:14:50 -04:00
__init__.py [0.0.10] Release 2024-07-25 13:45:27 -04:00
conftest.py Tighten Transaction Scopes (#525) 2026-04-08 11:14:50 -04:00
test_advanced_filters.py feat: honcho 3.0, sdks 2.0, excise stainless, update v3 docs, changelogs (#331) 2026-01-22 15:16:28 -05:00
test_datetime_parsing.py create Representation class and use it to unify all formatting (#214) 2025-10-07 15:28:44 -04:00
test_dependencies.py Vineeth/force rollback (#486) 2026-04-03 11:58:03 -04:00
test_schema_validations.py fix: add migration for 'deriver' to 'reasoning' in ResolvedConfiguration (#352) 2026-01-27 11:17:49 -05:00
test_search.py Tighten Transaction Scopes (#525) 2026-04-08 11:14:50 -04:00