Repository navigation
feat(port): queen-needs-you.ts as queen-needs-you.t27 (Closes #5026) - #6557
Merged
Merged
Conversation
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>
Contributor
This was referenced Oct 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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) tospecs/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) andoutstandingEscalations(one count query) are I/O. They keep their names withundefined;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, thenif (!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 naivefloor(y+0.5)gets0.049999999999999996wrong, and a test pins that case.reason_of: a falsy note givesnull, otherwise its first 400 chars.attempts_of:send_backs ?? 0.waiting_ofmaps 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).UNAVAILABLE, 503,REASON_MAXandREPORT_LIMITare 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)
Negative controls:
pg://b->pg://a,400->401,6->7) givestests 7, pass 4, FAIL 3, naming exactly those three tests;floor(y + 0.5)givesFAIL 1(hours_waiting_rounds_like_math_round).The tests compare strings with
std.mem.eqland 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