diff --git a/memhub/apps/core/tests/TEST_INDEX.md b/memhub/apps/core/tests/TEST_INDEX.md index 0dbfb64..8e2bfbe 100644 --- a/memhub/apps/core/tests/TEST_INDEX.md +++ b/memhub/apps/core/tests/TEST_INDEX.md @@ -328,6 +328,7 @@ | `test_secret_store_error_codes.py` | `integration` | 3925a kernel item 3: keychain failure classification and backoff that heals. | | `test_secure_storage.py` | `integration` | 覆盖 isolated keychain service namespace、custom keychain service is refused outside isolated tests、packaged keychain budget covers loaded process startup 等 20 个场景。 | | `test_sedimentation_concurrency.py` | `contract` | Sedimentation runs several harnesses at once, but one harness at a time. | +| `test_sedimentation_switch.py` | `contract` | Stopping model-driven sedimentation without losing the configuration. | | `test_service_level_pressure_acceptance.py` | `contract` | 覆盖 workbuddy recall remains available during 100k import 场景。 | | `test_service_levels.py` | `contract` | 覆盖 background never consumes the realtime reservation、realtime is next for the same source after background yields、import history gets one slice after nine realtime admissions 等 8 个场景。 | | `test_session_inbox.py` | `contract` | A session inbox is not a shared mailbox and a pull is not adoption. | @@ -386,4 +387,4 @@ | `test_workspace_recall.py` | `contract` | Workspace memories were unreachable from every host; these pin the way in. | | `test_write_queue_lease_renewal.py` | `contract` | Rule 8: a lease must outlive the work it covers, and be renewed while it runs. | -共 381 个测试文件。 +共 382 个测试文件。 diff --git a/memhub/apps/core/tests/core_test_classification.py b/memhub/apps/core/tests/core_test_classification.py index 051d194..d054784 100644 --- a/memhub/apps/core/tests/core_test_classification.py +++ b/memhub/apps/core/tests/core_test_classification.py @@ -14,8 +14,8 @@ from pathlib import Path import pytest PRIMARY_MARKERS = ("unit", "contract", "integration", "performance", "live") -EXPECTED_TEST_FILE_COUNT = 381 -EXPECTED_TEST_FILES_SHA256 = "1f5100ccee78a9a4ea91805ec07b2054ee4a18911a8162943acedf471ae9b3e7" +EXPECTED_TEST_FILE_COUNT = 382 +EXPECTED_TEST_FILES_SHA256 = "f08fbe22bc3af3df5c340ec75b94ba42287220bb728b34cbeadd5f5c93eea40b" # Pure transformations, validation models, parity checks and state machines. # This list is intentionally small: uncertain files default to contract. diff --git a/memhub/apps/core/tests/test_sedimentation_switch.py b/memhub/apps/core/tests/test_sedimentation_switch.py index 554a2bf..5ebfe5a 100644 --- a/memhub/apps/core/tests/test_sedimentation_switch.py +++ b/memhub/apps/core/tests/test_sedimentation_switch.py @@ -145,7 +145,28 @@ def test_stopped_switch_enqueues_nothing(tmp_path) -> None: def test_stopped_switch_prepares_no_backfill(tmp_path) -> None: flag = _Flag(False) evidence, tasks, active, supervisor, _profiles, _secrets = _stores(tmp_path, flag) - _task(evidence, tasks, active, index=1) + # No task is queued yet: backfill is what would create one for this + # conversation, so the stopped switch must keep it from creating any. + # A settled turn (question plus answer): an unanswered user tail is not + # backfill material, so the conversation needs both records. + for message_id, role, written_by, verbatim in ( + ("m-old", "user", WrittenBy.PERSON, "Remember this too."), + ("m-old-reply", "assistant", WrittenBy.AGENT, "Saved."), + ): + evidence.put( + EvidenceInput( + source_id="cursor", + workspace="/Users/me/project", + conversation_id="conv-old", + message_id=message_id, + correlation_id=message_id, + role=role, + written_by=written_by, + created_at=NOW - timedelta(days=1), + verbatim=verbatim, + origin_meta={EvidenceOrigin.FILE: OriginMetadata()}, + ) + ) assert supervisor.prepare_backfill() == []