blackout: enforce bounded oldest-drop queue policy on overflow (#371) #384
Reference in New Issue
Block a user
Delete Branch "feature/issue-371-blackout-queue-overflow"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
enqueue=False로 intent를 버리던 경로를 제거하고, bounded queue의oldest-drop정책으로 최신 intent를 보존하도록 변경했습니다.BlackoutOrderManager에overflow_drop_count를 추가해 overflow eviction을 명시적으로 추적합니다._maybe_queue_order_intent()에서 overflow 발생 시 "oldest intent evicted" 로그를 남기고, 큐 비활성(max_queue_size<=0)인 경우만 fail-stop 로그를 남깁니다.Scope Mapping
REQ-V3-004TASK-CODE-008TEST-ACC-017Validation
ruff check src/core/blackout_manager.py src/main.py tests/test_blackout_manager.py tests/test_main.pypytest -q tests/test_blackout_manager.pypytest -q tests/test_main.py -k "blackout_queue_overflow_keeps_latest_intent or blackout_queues_order_and_skips_submission or process_blackout_recovery"python3 scripts/validate_ouroboros_docs.pypython3 scripts/validate_governance_assets.py origin/feature/v3-session-policy-stream...HEADpython3 scripts/validate_docs_sync.pyPR 리뷰 (Claude Code)
전체 판정: ✅ LGTM
CI 통과, 167개 테스트 전체 통과 확인.
로직 검증
enqueue()정책 분기max_queue_size <= 00 >= 0→ return Falselen >= max)의미 변화: 큐 비활성과 포화가 명확히 분리되었고, 포화 시 intent 유실이 제거되었습니다.
overflow 감지 방식
enqueue 전후로
overflow_drop_count를 비교해 overflow 발생을 감지하는 방식이 올바릅니다.enqueue()가 기존 인터페이스(bool반환)를 유지하면서 overflow 여부를 알 수 있는 유일한 방법입니다.테스트 경계값 검증
max_queue_size=2, 3개 enqueue →["000002", "000003"]만 복구 배치에 포함 ✅max_queue_size=1, 2개 enqueue → 최신"000660"만 복구 배치에 포함 ✅소견
_coerce_nonnegative_int+getattr조합이 과방어적overflow_drop_count는int타입의 프로퍼티로 타입 보장이 되어 있으므로:블로킹 사항은 아닙니다.
추가 리뷰 (Claude Code)
이전 소견 반영 현황
_coerce_nonnegative_int+getattr제거 → 직접 접근판정: ✅ LGTM
직접 접근으로 바뀌면서 기존 mock에
overflow_drop_count속성이 없으면AttributeError가 발생하는 문제를test_blackout_queues_order_and_skips_submissionmock에overflow_drop_count = 0을 추가해 정확히 대응했습니다. 167개 테스트 전체 재통과 확인.