Skip to content

feat: F18 Request Queuing retrospective spec + TOCTOU fix - #182

Merged
leocamello merged 1 commit into
mainfrom
021-request-queuing
Feb 18, 2026
Merged

leocamello merged 1 commit into
mainfrom
021-request-queuing

Conversation

@leocamello

Copy link
Copy Markdown
Owner

F18: Request Queuing & Prioritization

Retrospective Spec Artifacts

  • spec.md (14 FRs, 5 user stories, 5 edge cases)
  • plan.md, tasks.md (47 tasks, all completed)
  • research.md, data-model.md, quickstart.md
  • requirements-validation.md, verification.md, walkthrough.md
  • contracts/ and checklists/

Red Team Review: CONDITIONAL PASS → Fixed

CRITICAL fix: TOCTOU race condition in enqueue()

  • Old code: load() → check → fetch_add() — non-atomic, depth could exceed max_size under concurrency
  • New code: compare_exchange CAS loop — truly atomic check-and-increment
  • Added concurrent_enqueue_respects_max_size test proving correctness under 50 concurrent enqueue tasks

Documentation: Added double-timeout comment explaining handler-side vs drain-loop-side timeout guards.

speckit.analyze: ✅ APPROVED

  • 14/14 requirements covered (100%)
  • 4/4 constitution gates passed
  • 3 minor documentation inconsistencies (LOW)

Test Results

  • All 1055+ tests pass
  • Clippy clean, formatted

Closes #176

Retrospective spec artifacts for F18 Request Queuing & Prioritization:
- spec.md (14 FRs, 5 user stories)
- plan.md, tasks.md (47 tasks, all completed)
- research.md, data-model.md, quickstart.md
- requirements-validation.md, verification.md, walkthrough.md
- contracts/ and checklists/

Red team review found CRITICAL TOCTOU race in enqueue():
- Replaced load+check+increment with compare_exchange CAS loop
- Added concurrent enqueue test proving max_size never exceeded
- Added double-timeout documentation comment

Closes #176
@leocamello leocamello added enhancement New feature or request v0.4 v0.4 Quality & Queuing milestone labels Feb 18, 2026
@leocamello
leocamello merged commit 92fbbd5 into main Feb 18, 2026
9 checks passed
@leocamello
leocamello deleted the 021-request-queuing branch February 18, 2026 01:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request v0.4 v0.4 Quality & Queuing milestone

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[F18] feat: Request Queuing — bounded queue with priority and drain task (T021-T030)

1 participant