Skip to content

serve: name an empty numeric field of the start screen as unread - #733

Merged
juliankang4 merged 1 commit into
midagedev:mainfrom
juliankang4:fix-screen-empty-numbers
Oct 23, 2026
Merged

juliankang4 merged 1 commit into
midagedev:mainfrom
juliankang4:fix-screen-empty-numbers

Conversation

@juliankang4

Copy link
Copy Markdown
Collaborator

시작 화면이 값이 빈 숫자 필드를 조용히 빼지 않고 unread 행에 이름을 남기도록 고칩니다.

Fixes #722. Part of #565. Tracked in #699.

What and why

The start screen reads numbers from the start's record lines. When a numeric field is present but its value is not a number, the screen notes that line in its unread row instead of filling the value in. A field written with an empty value, such as cache ram= or parallel slots=, skipped that note. The screen left the value out and the unread row did not name the line either, so the gap was invisible.

Line::num in crates/serve/src/screen.rs read the field through word, which returns None for an empty value. The ? on that call returned before unread.note ran. The note came in with 0661e74 (the unread row), and the early return has been there since.

num now reads the field with text(key)? and takes the first word of it. If the first word is missing or is not a whole number, it notes the line as unread. A key that is absent still returns None without a note. bytes_beside needs no change: num runs first on the same key, and an empty value has no parenthesis. The other numeric readers on the screen all go through num, so this is the only place that changed. No signature, record schema or public API changes.

Release notes: Fixed: the start screen names a numeric field with an empty value on its unread row instead of dropping it silently.

Code shape

  • No second copy. The fix is in Line::num, the one reader the numeric fields share.
  • 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. An empty numeric value is now noted as unread and is not dropped without a trace.
  • Comments state what is true now. The doc comment of num now says a value that is empty or not a number is noted as unread.
  • No relaxed gate. No band, tolerance or lint level moved, and no existing test case was removed.
  • cargo fmt passes. cargo clippy has not been run on this head, so the lint count is unchecked.

Duplication found or removed (path:line): none.

What I ran

The change touches only the start screen's text reader in bloomery-serve. It has no device code, so no GPU gate applies.

I extended the existing test a_value_that_is_no_number_is_named_not_filled_in with two cases, cache ram= and parallel slots= (both empty). Before the fix the test failed because no unread row appeared for them. After it, the screen tests pass as a group:

cargo test -p bloomery-serve --lib screen
15 passed

Reproduce:

cargo test -p bloomery-serve --lib screen

Not run: cargo clippy and the full workspace check on this head. I did not save the raw failing output of the base run, so the failure above is the observed result and not a pasted log.

What I ran into

This does not block the PR. Nothing outside the change turned up.

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: Empty numeric fields now reach unread reporting, while absent fields retain their existing behavior.

Checked

  • Duplicates: 0 new functions, types, or constants. The fix stays in the shared numeric reader.
  • Complexity: the parser removes an early return for empty values and reuses the existing unread branch.
  • Silent failure: 1 changed .ok() site followed through its consumers. Empty and invalid values return no number and name the record on unread; absent keys return before the note. Zero remains valid; overflow reaches the note.
  • Tests: the two added cases protect screen.rs:271. Restoring self.word(key)?.parse().ok() makes their unread assertion fail, by static mutation analysis.
  • Gates: no pins or thresholds moved; no cases removed. The PR describes failure before the fix.
  • Escape catalog: no C1–C4 pattern matched. This change touches startup rendering, with no inference hot path change.

Notes

Tests were inspected, not executed. The PR reports 15 passing screen tests.

🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)

@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 8748465 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.

serve screen: empty numeric fields bypass the unread diagnostic

1 participant