Skip to content

[142] fix simulation CI: coverage, live queue position, FIFO requeue#143

Merged
BhuvanArn merged 2 commits into
stagingfrom
142-fix-simulation-ci-coverage
Jun 25, 2026
Merged

[142] fix simulation CI: coverage, live queue position, FIFO requeue#143
BhuvanArn merged 2 commits into
stagingfrom
142-fix-simulation-ci-coverage

Conversation

@BhuvanArn

@BhuvanArn BhuvanArn commented Jun 25, 2026

Copy link
Copy Markdown
Owner

What type of PR is this? (check all applicable)

  • ✨ Feature
  • 🛑 Bug
  • ⚠️ Anomaly
  • 📝 Doc
  • 🎨 Style
  • 🧑‍💻 Refactor
  • 🛠️ Setup
  • 🏗️ Build
  • 🔥 Perfs
  • ✅ Test
  • 🔁 CI
  • ⏩ Revert

Description

Splits the CI debt from #142 (merged without a green coverage run) out of PR #136 so #136 can stay chatbot-only.

What this fixes

  • Coverage gate (was RED): server Jest global was below 80% (branches 76.73%, functions 79.11%) because the simulation/ module + ai.service.ts shipped with thin/no tests. Added real unit tests across simulation-capacity, -context, -promotion, -ws-token, simulation.config, simulation.cron, simulation-internal.controller, the internal-api-key guard, and the uncovered ai.service methods. Now: branches 85.64% / functions 94.4% / lines 94.13% / statements 94.32%, 650 server tests pass.
  • Live queue position: useInterviewSession froze queuePosition at enqueue time; the poll loop fetched a fresh position each tick but discarded it. Threaded an onProgress callback so the queue banner now counts down.
  • FIFO requeue: promoteNextFromQueue LPOP'd the head waiter and, on no free slot, enqueue()'d (RPUSH → tail), demoting the earliest waiter. Added requeueFront (LPUSH to head) and use it on the no-slot path to preserve FIFO.
  • Plus the lint/format/test-mock fixes needed to make this code green (unused import, prettier, stale mocks).

Why separate from #136

#136's net diff over staging for these files was pure Prettier reformatting — zero logic. All the real simulation/ai logic came via the #142 merge. This PR carries the fixes; once merged to staging, #136 rebases and goes green as a chatbot-only PR.

Linked GitHub Ticket

No prior ticket

Workspace

  • 🖥️ Web
  • 🛠️ Server
  • 🔁 CI
  • 🤖 Ai
  • 📱 App

Screenshots

N/A — no visual changes (live queue banner already existed; this PR only feeds it the live count).

@vercel

vercel Bot commented Jun 25, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
talk-up-ai-dev Ready Ready Preview, Comment Jun 25, 2026 7:35am

@BhuvanArn BhuvanArn merged commit 6ab8465 into staging Jun 25, 2026
11 checks passed
@BhuvanArn BhuvanArn deleted the 142-fix-simulation-ci-coverage branch June 25, 2026 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants