Skip to content

spec(port): port specs/port/trios-railway/crates/trios-igla-race/src/bin/debug_queue.t27 (Closes #9704) - #10015

Open
dmitrii-f-t27 wants to merge 1 commit into
gHashTag:masterfrom
dmitrii-f-t27:zcode-port-9704-debug-queue
Open

dmitrii-f-t27 wants to merge 1 commit into
gHashTag:masterfrom
dmitrii-f-t27:zcode-port-9704-debug-queue

Conversation

@dmitrii-f-t27

Copy link
Copy Markdown
Contributor

Summary

Port gHashTag/trios-railway:crates/trios-igla-race/src/bin/debug_queue.rs (at 46ea51e585ee, 53 lines) as specs/port/trios-railway/crates/trios-igla-race/src/bin/debug_queue.t27 — Roadmap Stage 6 (goal #4548), target t27c gen-rust. Closes #9704.

The original is the queue inspector CLI: it resolves the Postgres URL, lists up to ten pending experiments, then resets stale running rows and bogus done rows.

Per the issue's rule ("Port the decision, not the plumbing"), the one listed function is ported under its name as a pure function (no transports — the Postgres connection, raw_query and raw_execute are the callers' plumbing) with 7 tests (32 runtime asserts, 0 vacuous, 100% function coverage):

  • the L-NEON-RENAME URL resolution (original lines 17-22): a present, non-empty --neon-url flag wins; an absent or empty flag falls back to the legacy NEON_DATABASE_URL; when neither holds a URL the run dies with RAILWAY_POSTGRES_URL (or legacy NEON_DATABASE_URL) not set;
  • the pending listing shape (line 29): at most 10 rows (LIMIT 10), of every count the smaller of the two;
  • the listing order (line 28): priority DESC, then id ASC — a tie on priority is broken by the smaller id;
  • the pending filter (line 28): only pending rows enter the listing;
  • the stale-running reset (line 46): a running experiment claimed more than 30 minutes ago goes back to pending — exactly 30 is not yet stale, because the SQL comparison is a strict <;
  • the bogus-done reset (line 49): a done experiment whose final_step is present and 0 is reset — SQL final_step=0 never matches NULL, so a done row without a final step is kept;
  • main's URL gate (line 14): exit 1 before any queue work when no URL resolves, else 0 after the listing and both resets.

Verification (all run live from the worktree root, zig 0.16.0)

  • t27c parse: OK. t27c spec-status: IMPLEMENTED. t27c typecheck: 0 errors, 0 warnings.
  • t27c coverage: 7/7 tested (100%) — no transports in this port.
  • t27c test-report: 7 tests / 7 pass / 0 FAIL / 0 BLOCKED, 0 vacuous passes — the URL resolution all three ways, main's gate at each source, the LIMIT-10 shape below/at/beyond the limit, the order both ways plus the id tie-break and equal keys, the stale threshold at 29/30/31 minutes, and the bogus filter with and without a present final step.
  • t27c gen | grep -c 'not yet implemented': 0; gen | wc -l: 117 (> 12).
  • grep -cE '^\s*(pub )?fn (main)\(': 1. grep -cE '^[[:space:]]*test[[:space:]]+("|[A-Za-z_])': 7 (≥ 1).
  • Boundary: git status --short — exactly this one file. The repo's lefthook pre-commit passed.
  • dupe_scan: all 7 function names unique across 2059 specs (checked before the commit); the bare body scan adds no duplicate group (722 bodies / 217 groups on base, identical with this spec present).

Dmitrii Fedorov (@dmitrii-f-t27)

…bin/debug_queue.t27 (Closes gHashTag#9704)

Port gHashTag/trios-railway:crates/trios-igla-race/src/bin/debug_queue.rs
(at 46ea51e585ee, 53 lines) as specs/port/trios-railway/crates/
trios-igla-race/src/bin/debug_queue.t27 - Roadmap Stage 6, goal gHashTag#4548,
target t27c gen-rust.

The queue inspector's decisions are ported as pure functions and tested
(7 tests, 7 pass, 0 vacuous, 32 runtime asserts, 100% function
coverage): the L-NEON-RENAME URL resolution (a present, non-empty
--neon-url flag wins, an absent or empty flag falls back to the legacy
NEON_DATABASE_URL, neither is the missing-URL error), the pending
listing shape (at most 10 rows, LIMIT 10), the listing order (priority
DESC, then id ASC), the pending filter, the stale-running reset (a
claim of more than 30 minutes; exactly 30 is not yet stale - the SQL
is a strict <), the bogus-done reset (a done row whose final_step is
present and 0; NULL never matches), and main's URL gate (exit 1
before any queue work when no URL resolves, else 0 after the listing
and both resets). The Postgres connection, raw_query and raw_execute
are the callers' plumbing.

Verified: parse OK, spec-status IMPLEMENTED, typecheck 0 errors,
coverage 7/7, test-report 7/7 pass, 0 BLOCKED, gen 117 lines with
0 'not yet implemented', boundary exactly this one file, dupe_scan:
all 7 function names unique across 2059 specs, bare body scan 722/217
unchanged (no new group, none grew).

Dmitrii Fedorov ([@dmitrii-f-t27](https://github.com/dmitrii-f-t27))
@dmitrii-f-t27

Copy link
Copy Markdown
Contributor Author

@gHashTag Please merge this PR into master via the golden chain — rights on gHashTag/t27 are read-only for me (403), so only you can merge it.

Verification of this head (d286bb4):

  • Required CI trio green: validate, check-linked-issue, parse-ratchet; also Check L1 TRACEABILITY, Corpus ratchet and duplicate-bodies green.
  • The t27b-native-run artifact of this head (commit d286bb4, run 39050099398) row for specs/port/trios-railway/crates/trios-igla-race/src/bin/debug_queue.t27: reference pass, t27b pass, tests 7, invariants 0, asserts 31, blockers [], detail empty, reference_disagree: [].
  • The only red checks are the known base-red pair (cli-tri ci: repair the two workflows whose failure was in the workflow #3324 include_str!, t27b-native-ratchet registration debt) — both red on master without this PR; no other check is red.

After the merge I will: verify the spec file live on the merge SHA, confirm #9704 auto-closed, and file the 14-step report.

Dmitrii Fedorov (@dmitrii-f-t27)

This was referenced Oct 17, 2026
This was referenced Oct 18, 2026

This branch has not been deployed

No deployments
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