Skip to content

serve: show the start screen's tier row from the load record and share the count with the bar - #721

Merged
juliankang4 merged 3 commits into
midagedev:mainfrom
juliankang4:fix-screen-tier-facts
Oct 23, 2026
Merged

juliankang4 merged 3 commits into
midagedev:mainfrom
juliankang4:fix-screen-tier-facts

Conversation

@juliankang4

Copy link
Copy Markdown
Collaborator

시작 화면의 tier 상세 행이 막대와 같은 expert 수를 쓰도록 고칩니다. 수가 load 기록에만 있어도 상세 행이 나옵니다.

Part of #565. Tracked in #699.

What and why

The start screen draws a tier bar and a tier detail row from the start's record lines. They read the tier's expert count from different places. The bar takes tier_experts from 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 no tier row beside them. This came in with the screen itself in 8f6eae6 (#80).

facts in crates/serve/src/screen.rs now 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_rows shows 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 existing unread row and draws no bar.

The devices row 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

  • No second copy. The tier count is read once in facts and handed to where_rows and the bar. The second read in where_rows is gone.
  • Model code holds only architecture facts. The change is in the start screen's record reader. No model file changed.
  • Dead code is gone. The change adds no helper, flag or constant and leaves none unused.
  • No silent failure. A tier count that is not a number is reported as unread and is not turned into 0 or replaced by another record.
  • Comments state what is true now. No production comment was added.
  • No relaxed gate. No band, tolerance or lint level moved, and no existing test was removed.
  • cargo fmt -p bloomery-serve passes. cargo clippy has not been run on this head, so the lint count is unchecked.

Duplication found or removed (path:line): the second read of tier_experts in where_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 main 6c5cc348c96314a89ae9990d34b47edfc92330fa. The checks ran on a Linux host. bloomery-serve does 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 -- --nocapture fails with rc 101.

test result: FAILED. 12 passed; 3 failed; 0 ignored; 0 measured; 332 filtered out; finished in 0.01s
FAIL-FIRST baseline rc=101; all three tier contracts failed

The three failing tests are the_bar_takes_the_tier_count_from_the_load, tier_details_and_the_bar_keep_the_record_precedence and tier_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_precedence fails (rc 101). With the devices row filtered out, several_cards_show_the_whole_list fails (rc 101).

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 346 filtered out; finished in 0.00s
FAIL-FIRST bar consumer rc=101
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 346 filtered out; finished in 0.00s
FAIL-FIRST devices consumer 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-code shows the tracked tree restored:

test result: ok. 15 passed; 0 failed; 0 ignored; 0 measured; 332 filtered out; finished in 0.02s
PASS screen contracts and existing goldens; tracked tree restored

Reproduce on a Linux host:

cargo test -p bloomery-serve --lib screen::tests -- --nocapture

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_list now renders one to four cards, and the_bar_takes_the_tier_count_from_the_load also asserts the detail row.

Not run: cargo clippy and 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 초안 리뷰는 제가 직접 했습니다.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@juliankang4

Copy link
Copy Markdown
Collaborator Author

The review is done and the contribution check passed, so I'm merging this.

@juliankang4
juliankang4 merged commit f31f0ee into midagedev:main Oct 23, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

serve The HTTP server: crates/serve

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant