Skip to content

feat(port): queen-needs-you.ts as queen-needs-you.t27 (Closes #5026) - #6557

Merged
gHashTag merged 1 commit into
masterfrom
claude/bee-5026-v2
Oct 5, 2026
Merged

gHashTag merged 1 commit into
masterfrom
claude/bee-5026-v2

Conversation

@gHashTag

@gHashTag gHashTag commented Oct 5, 2026

Copy link
Copy Markdown
Owner

Closes #5026

Ports trios/agent-server/apps/server/src/api/routes/queen-needs-you.ts (gHashTag/BrowserOS @ c25e1b0278a6, fetched from the API and identical to the issue's quote) to specs/port/browseros/trios/agent-server/apps/server/src/api/routes/queen-needs-you.t27. This one file is the whole change.

What is ported

createQueenNeedsYouRoute (Hono, pg pool, logger) and outstandingEscalations (one count query) are I/O. They keep their names with undefined; bodies that no test calls. Every decision they make is a pure, tested helper:

  • resolve_database_url + url_usable: QUEEN_LEASE_DATABASE_URL ?? DATABASE_URL, then if (!url) gives 503. ?? keeps "", which is then refused.
  • hours_waiting: Math.round(Number(age_hours ?? 0) * 10) / 10, implemented as ECMA-262 Math.round (halves toward +Infinity). The naive floor(y+0.5) gets 0.049999999999999996 wrong, and a test pins that case.
  • reason_of: a falsy note gives null, otherwise its first 400 chars. attempts_of: send_backs ?? 0. waiting_of maps one row.
  • summarize: waitingCount, oldestHours (row 0, because the SQL orders oldest first) or 0, needsYou.
  • headline_of: String(headline ?? '').slice(0, 200). report_needs_you: Boolean(needs_you).
  • outstanding_from: Number(rows[0]?.n ?? 0).
  • The three SQL texts are kept verbatim as constants. UNAVAILABLE, 503, REASON_MAX and REPORT_LIMIT are kept as constants too.

Every expected value in the tests was printed by the original's own expressions under node 22.

Acceptance criteria (run on the t27c lab, master t27c @ e7afb32)

--- 1
present
--- 2
2
--- 3
0
205
--- 4
IMPLEMENTED
--- 5
7
--- 6
0
--- parse
parse-ok
--- test-report
--- test report: specs/port/browseros/trios/agent-server/apps/server/src/api/routes/queen-needs-you.t27 ---

  tests       7
  pass        7
  FAIL        0
  rate    100.0%

Negative controls:

  • flipping 3 expected values (pg://b -> pg://a, 400 -> 401, 6 -> 7) gives tests 7, pass 4, FAIL 3, naming exactly those three tests;
  • replacing the Math.round port with floor(y + 0.5) gives FAIL 1 (hours_waiting_rounds_like_math_round).

The tests compare strings with std.mem.eql and do not copy a local helper (duplicate-bodies).

Files: queen-needs-you.t27 (.t27). Nothing generated is committed.

Replaces #6538. That PR had the same file, but its second commit had no issue reference and failed L1 TRACEABILITY. This PR has the same final spec in one commit.

🤖 Generated with Claude Code

One-commit replacement of the earlier PR for this issue: its follow-up commit
lacked an issue reference and failed L1 TRACEABILITY. The spec is the final
version from that PR (tests compare with std.mem.eql, no copied helper).

Closes #5026

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-05 16:39:41 UTC

Summary

Status Count
Total Open PRs 50
PRs with Failing Checks 38
PRs with All Checks Green 12
READY 7
FAILING 38
PENDING 0
NO CHECKS YET 0

These columns do not partition: 7 + 38 + 0 + 0 = 45, and there are 50 open PRs. A PR is being counted twice or not at all.

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=9f2c8a4829f6 != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant