From de2564447d126804d7f923524bc17d09a03bfd81 Mon Sep 17 00:00:00 2001 From: Trinity Bee Date: Thu, 1 Oct 2026 20:29:59 +0000 Subject: [PATCH 1/3] salvage(queen-5469): commit what the turn left uncommitted The turn ended with these files edited and never committed. Uncommitted work is invisible to the review - it reads the branch - so the attempt would have been released as empty and the next bee would have started beside this work rather than from it. This commit is not a claim that the work is correct. It is the bee's work, committed on its behalf, and it is judged exactly like any other: the adversarial reviewer reads it, the compiler runs on it, and the issue's own criteria are measured against it. Issue: #5469 Turn: 3e8210a2-f4d5-4c11-b918-ffaf3f5fedee Ending: finished (the turn closed) Committed: 1 path(s) Left uncommitted: 0 path(s) outside the declared boundary --- .../trios/crates/trios-igla-race/src/status.t27 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 specs/port/trios/crates/trios-igla-race/src/status.t27 diff --git a/specs/port/trios/crates/trios-igla-race/src/status.t27 b/specs/port/trios/crates/trios-igla-race/src/status.t27 new file mode 100644 index 0000000000..b59564365e --- /dev/null +++ b/specs/port/trios/crates/trios-igla-race/src/status.t27 @@ -0,0 +1,17 @@ +struct NeonDb {} + +pub fn show_status(db: &NeonDb) -> ?void { + undefined; +} + +pub fn show_best(db: &NeonDb) -> ?void { + undefined; +} + +test show_status_test { + assert(true); +} + +test show_best_test { + assert(true); +} \ No newline at end of file From a137af7bed1421af48140d0ec8107e4cd60dff81 Mon Sep 17 00:00:00 2001 From: "queen-publisher[bot]" Date: Fri, 9 Oct 2026 03:35:30 +0000 Subject: [PATCH 2/3] docs: the coordination entry this branch needs to land A pull request must add exactly one docs/now entry and a bee has no way to know that: its brief names a boundary file and acceptance criteria, and docs/now/ is neither. The publisher adds it rather than failing the gate. Closes #5469 Co-Authored-By: Claude Opus 5 --- ...-trios-crates-trios-igla-race-src-status-rs-rus.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 docs/now/2026-10-09-published-port-ghashtag-trios-crates-trios-igla-race-src-status-rs-rus.md diff --git a/docs/now/2026-10-09-published-port-ghashtag-trios-crates-trios-igla-race-src-status-rs-rus.md b/docs/now/2026-10-09-published-port-ghashtag-trios-crates-trios-igla-race-src-status-rs-rus.md new file mode 100644 index 0000000000..99d767b41f --- /dev/null +++ b/docs/now/2026-10-09-published-port-ghashtag-trios-crates-trios-igla-race-src-status-rs-rus.md @@ -0,0 +1,11 @@ +# NOW -- Port gHashTag/trios:crates/trios-igla-race/src/status.rs (Rust, 2 functions) to specs/port/trios/crates/trios-igla-race/src/status.t27 (published 2026-10-09) + +## A bee's work on #5469, published from `queen-5469` (Closes #5469) + +- The branch changes 1 file(s): `specs/port/trios/crates/trios-igla-race/src/status.t27`. +- `git diff --stat origin/master...queen-5469` reads: 1 file changed, 17 insertions(+) +- This entry is written by the publisher, not by the bee. A pull request must + add exactly one `docs/now/` entry and a bee has no way to know that: its brief + names a boundary file and acceptance criteria, and `docs/now/` is neither. +- What this entry does NOT establish: that the work is correct. The gates on the + pull request judge that, and they are the same gates every other change meets. From f637e70d033353eacc294d12a81e63e40f15051f Mon Sep 17 00:00:00 2001 From: Dmitrii Vasilev Date: Mon, 12 Oct 2026 17:41:05 +0700 Subject: [PATCH 3/3] fix(port): replace the assert(true) tests with the status.rs decisions show_status and show_best only move rows between the database and stderr, so they keep their undefined bodies; the decisions inside them are now ported as pure helpers with tests on values read out of the original: - rank_key: ORDER BY COALESCE(best_bpb, 9999) -- a missing best ranks as 9999, behind every real score - best_of: WHERE best_bpb IS NOT NULL ORDER BY best_bpb ASC LIMIT 1 as a fold -- null never wins, smaller real score wins, two nulls mean the table is empty ("No completed trials yet") - truncate_trial_id: the tid_trunc display rule -- longer than 18 chars prints as the first 16 followed by ".." t27c test-report on the branch: 6 tests, 6 pass, 0 FAIL, 100%, 0 vacuous. Refs #5469 Co-Authored-By: Claude Opus 5.5 --- .../crates/trios-igla-race/src/status.t27 | 99 +++++++++++++++++-- 1 file changed, 93 insertions(+), 6 deletions(-) diff --git a/specs/port/trios/crates/trios-igla-race/src/status.t27 b/specs/port/trios/crates/trios-igla-race/src/status.t27 index b59564365e..db477cefaa 100644 --- a/specs/port/trios/crates/trios-igla-race/src/status.t27 +++ b/specs/port/trios/crates/trios-igla-race/src/status.t27 @@ -1,17 +1,104 @@ -struct NeonDb {} +module port::trios::crates::trios_igla_race::src::status; +// Port of gHashTag/trios crates/trios-igla-race/src/status.rs -- the IGLA +// RACE leaderboard table (show_status) and the best-trial card (show_best). +// Both only move rows between the database and stderr, so per the issue they +// keep their names with undefined bodies that no test calls; every decision +// they make about ranking and display is ported below as a pure helper with +// tests on values read out of the original. + +pub struct NeonDb {} + +// I/O shell -- the SQL query and the eprintln table are plumbing. pub fn show_status(db: &NeonDb) -> ?void { undefined; } +// I/O shell -- the SQL query and the eprintln card are plumbing. pub fn show_best(db: &NeonDb) -> ?void { undefined; } -test show_status_test { - assert(true); +// Decision: show_status ranks rows with ORDER BY COALESCE(best_bpb, 9999) +// ASC -- a trial with no best yet sorts as if it scored 9999, behind every +// real score, and real scores sort by value. +pub fn rank_key(best_bpb: ?f64) -> f64 { + if (best_bpb == null) { + return 9999.0; + } + return best_bpb.?; } -test show_best_test { - assert(true); -} \ No newline at end of file +// Decision: show_best reduces the table with WHERE best_bpb IS NOT NULL +// ORDER BY best_bpb ASC LIMIT 1 -- best_of folds one row at a time. A null +// never wins, the smaller real score wins, and two nulls leave the table +// empty (the "No completed trials yet" branch). +pub fn best_of(a: ?f64, b: ?f64) -> ?f64 { + if (a == null) { + return b; + } + if (b == null) { + return a; + } + const av = a.?; + const bv = b.?; + if (bv < av) { + return bv; + } + return av; +} + +// Decision: show_status's tid_trunc -- a trial id longer than 18 chars +// prints as its first 16 chars followed by "..". +pub fn truncate_trial_id(trial_id: []const u8) -> []const u8 { + if (trial_id.len > 18) { + return trial_id[0:16] ++ ".."; + } + return trial_id; +} + +test rank_key_treats_a_missing_best_as_9999 { + // COALESCE(best_bpb, 9999): null -> 9999, a real score -> itself. + assert(rank_key(null) == 9999.0); + assert(rank_key(0.31) == 0.31); + // Any real score ranks ahead of a trial with no best yet. + assert(rank_key(0.31) < rank_key(null)); + assert(rank_key(9998.5) < rank_key(null)); +} + +test rank_key_orders_real_scores_by_value { + assert(rank_key(1.2) > rank_key(0.9)); + assert(rank_key(0.0) < rank_key(0.1)); +} + +test best_of_never_lets_a_null_win { + assert(best_of(null, 0.9) == 0.9); + assert(best_of(1.2, null) == 1.2); + // Two trials with no best leave the table empty. + assert(best_of(null, null) == null); +} + +test best_of_keeps_the_smaller_real_score { + assert(best_of(1.2, 0.9) == 0.9); + assert(best_of(0.9, 1.2) == 0.9); + assert(best_of(0.5, 0.5) == 0.5); +} + +test truncate_trial_id_cuts_long_ids_to_16_plus_dots { + const t = truncate_trial_id("abcdefghij0123456789"); // 20 chars + assert(t.len == 18); + assert(t[0] == 'a'); + assert(t[15] == '5'); + assert(t[16] == '.'); + assert(t[17] == '.'); +} + +test truncate_trial_id_keeps_short_ids_whole { + // 18 chars is the boundary: the id stays verbatim. + assert(truncate_trial_id("123456789012345678").len == 18); + assert(truncate_trial_id("123456789012345678")[17] == '8'); + const t = truncate_trial_id("trial-0042"); + assert(t.len == 10); + assert(t[0] == 't'); + assert(t[9] == '2'); +}