Repository navigation
serve: show the start screen's tier row from the load record and share the count with the bar - #721
Conversation
There was a problem hiding this comment.
Verdict: CLEAN: The shared tier count preserves record precedence and fixes the missing detail row.
Checked
Duplicates: 2 new test functions checked against existing screen tests; no duplicate owner found. No new production functions, types or constants. Dryer returned 0 pairs.
Complexity: crapper flagged no functions. The production changes resolve one count and allow its row without a plan.
Silent failure: 3 added default sites followed, including the test expectation. An absent count defaults to zero only in the bar; an absent card name contributes no text. A count such as lots suppresses the bar and detail row and names its record as unread.
Tests: static mutation checks cover all 4 new or changed tests. Dropping the devices push at crates/serve/src/screen.rs:488 fails several_cards_show_the_whole_list. Dropping the tier push at crates/serve/src/screen.rs:494 fails the changed load-fallback test. Reversing plan/load precedence at crates/serve/src/screen.rs:370 fails the new precedence test. Selecting the first load at crates/serve/src/screen.rs:368 fails the new last-record test.
Gates: no thresholds moved or tests removed. The PR supplies fail-first output for the tier contracts and both consumers.
Adversarial checks: explicit zero overrides a nonzero load; malformed plan text prevents fallback; no plan permits a load-only row but no bar; a newer load without a count prevents stale tier data.
Performance: startup display only; no inference hot path changed.
Escape catalog: C1–C4 do not match this Rust-only diff.
Notes
The author reports 15 passing screen tests. Tests were not executed during this review. The PR reports that clippy and the full workspace check were not run.
🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)
Filed outside this PR: #722
|
The review is done and the contribution check passed, so I'm merging this. |
시작 화면의 tier 상세 행이 막대와 같은 expert 수를 쓰도록 고칩니다. 수가 load 기록에만 있어도 상세 행이 나옵니다.
Part of #565. Tracked in #699.
What and why
The start screen draws a tier bar and a
tierdetail row from the start's record lines. They read the tier's expert count from different places. The bar takestier_expertsfrom the plan line and falls back to the load line when the plan has none. The detail row came only from the plan, and only when the plan named the tier card and also gave the count. A start whose count sat only in the load record, or whose plan gave a count without a card name, drew tier cells in the bar and notierrow beside them. This came in with the screen itself in 8f6eae6 (#80).factsincrates/serve/src/screen.rsnow picks the count once and hands it to both the detail row and the bar. The plan's field wins, the load line is used only when the plan has no such field, and a field that is present but not a number is not replaced by the other record.where_rowsshows the row from that count alone. With a card name it reads<card> <dot> <n> experts, and without one it reads<n> experts. A valid load record with no plan still shows the row, but draws no bar, because the screen cannot tell which card or host holds the experts. An explicit count of 0 shows a row, and a missing field shows none. A malformed count is reported through the existingunreadrow and draws no bar.The
devicesrow now reads from the plan line on its own, so it no longer depends on the row order of the plan block. No placement, inference, record schema or public API changes.Release notes: Fixed: the start screen shows the tier detail row whenever the tier's expert count is in the plan or the load record, and the row and the bar use the same count.
Code shape
factsand handed towhere_rowsand the bar. The second read inwhere_rowsis gone.cargo fmt -p bloomery-servepasses.cargo clippyhas not been run on this head, so the lint count is unchecked.Duplication found or removed (
path:line): the second read oftier_expertsinwhere_rows(crates/serve/src/screen.rs) is removed. The duplicate scan reported no other candidates.What I ran
The head is
88abd059045760ea5144b1101036c8920fa72860, three commits on main6c5cc348c96314a89ae9990d34b47edfc92330fa. The checks ran on a Linux host.bloomery-servedoes not link CUDA, and this change touches no device code, so no GPU gate applies.Fail-first: with the base's production code and this head's tests,
cargo test -p bloomery-serve --lib screen::tests -- --nocapturefails with rc 101.The three failing tests are
the_bar_takes_the_tier_count_from_the_load,tier_details_and_the_bar_keep_the_record_precedenceandtier_details_use_only_the_last_records_of_the_listening_place.Each consumer of the shared count also has to fail when it stops using it. With the bar's tier value forced to 0,
tier_details_and_the_bar_keep_the_record_precedencefails (rc 101). With thedevicesrow filtered out,several_cards_show_the_whole_listfails (rc 101).With the code restored, the same command passes, including the ASCII, UTF-8 and colored screens and the existing golden screens, and
git diff --exit-codeshows the tracked tree restored:Reproduce on a Linux host:
Two tests are new: one checks the precedence and edge cases of the shared count, and one checks that only the last records of the listening place count. The cases cover a count in the plan only, in the load only, in both, and in neither. They cover counts of 0, 1 and 2, a missing card name and a malformed count.
several_cards_show_the_whole_listnow renders one to four cards, andthe_bar_takes_the_tier_count_from_the_loadalso asserts the detail row.Not run:
cargo clippyand the full workspace check on this head. The change adds no public item, so I did not run a workspace-wide build.What I ran into
This does not block the PR. The screen's width handling is a separate matter, and this change leaves it alone.
AI help
AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.