Skip to content

fix(faithfulness): read a number with thousands separators as one number in the rule-based check - #357

Merged
goldbarth merged 1 commit into
mainfrom
fix/thousands-separator-in-rule-based-check
Oct 8, 2026
Merged

goldbarth merged 1 commit into
mainfrom
fix/thousands-separator-in-rule-based-check

Conversation

@goldbarth

Copy link
Copy Markdown
Owner

Closes #350

  • Why: the rule-based check read numbers as text, with a pattern a comma is not part of. Facts that say 8,000 were read as 8 and 000, so a rendering that wrote 8000 was flagged although the facts back it, and a rendering that invented "8 retries" was not.
  • Fix: the pattern reads a number with thousands separators as one number, and both sides are compared without the commas: 8,000, 1,234,567 and 1,234.50 are 8000, 1234567 and 1234.50. The comparison stays a lookup of text in a set; nothing is parsed into a numeric type, so a version such as 10.0.1 compares as it did.
  • What counts as a separator: a comma directly followed by exactly three digits. 1, 2, 3, #294, #292 and 12,34 stay lists of separate numbers.
  • One case that is read the other way now: three-digit numbers listed without a space, 100,200, are one number. Text alone cannot tell that from a hundred thousand, and prose puts the space; the comment on the pattern says so.
  • The finding quotes the number as the rendering wrote it, '9,000', so it can be found in the text.
  • Docs: one sentence in docs/costs-and-checks.md for the reader of a flag, one in docs/development/architecture.md next to the note on The rule-based check flags a quoted phrase that the facts break over two lines #315.

Reproduced first: the tests below were written against the unchanged checker, and 8 of them failed, among them the flag two runs on v0.1.0-preview.4 raised (facts Cut at 8,000 characters, rendering at 8000 characters). Reproduced at the checker with the phrases of those runs, not with a new model run.

Tests: RuleBasedFaithfulnessCheckerTests gain a theory of six pairs written with and without separators, the two groups 8 and 000 that are no longer supported, two lists, a version and a decimal, and an absent number quoted as written. The fixture tests, where an echoing model must never be flagged, pass unchanged. Full suite 1,043 passing, build without warnings.

@goldbarth goldbarth self-assigned this Oct 8, 2026
@goldbarth
goldbarth merged commit ee6ea75 into main Oct 8, 2026
4 checks passed
@goldbarth
goldbarth deleted the fix/thousands-separator-in-rule-based-check branch October 8, 2026 14:23
goldbarth added a commit that referenced this pull request Oct 8, 2026
Follows #360. Step 1 of `docs/development/releasing.md`.

- **Why now:** the manual run of `0.1.0-preview.4` on 2026-10-08 found
what a first user meets in the terminal, and six pull requests fixed it.
The binary people install is still preview.4, which has none of them,
and the terminal recording for the README (#325) and the model
comparison (#324) should show and measure the Chartula the announcement
describes.
- **What ships since preview.4,** 6 changes:
- the progress: the spinner next to its label and the header on the
column of the steps (#352), the line fitted to a narrow terminal (#356),
the step of an audience that did not render marked `× fail` (#359);
- the summary: a rendering shown for reading on a terminal, in the two
colours of the ramp (#360), a publishing run that says what became of
the release notes (#359), a blank line before the count of failed
audiences (#358);
- `doctor`: details broken between words with their indent (#356), a
rate limit message that stands on its own (#358);
- the command line: a slip in `--audience` refused, every refused
argument printed alike, `chartula version` told the flag (#358);
- the free check: a number with thousands separators read as one number
(#357).
- **Breaks to state in the notes,** as `docs/versioning.md` asks of a
preview:
- On a terminal the summary no longer prints a rendering as Markdown
source (#360). Redirected output, CI and `--plain` are unchanged, so a
script is not affected; a person who copied from the terminal copies
from the files or passes `--plain`.
- The header keys `Model:`, `GitHub:` and `Range:` are padded by one
more space (#352). A script that cuts the value at a fixed column needs
a look; one that reads past the key does not.
- `--audience product,` and `--audience 1` stop the run (#358); both ran
before, the second as the customer audience.
- A refused argument prints a second line, the pointer to the help, and
`--repo name-only` no longer prints the header first (#358).
- A publishing run without a technical rendering lists the release notes
under `Skipped` (#359), and the step of a failed audience reads `× fail`
where it read `· done`.
- The rule-based check reads `100,200` as one number (#357), so facts
that list three-digit numbers without a space no longer back each of
them.
- The csproj `Version` is the single source; nothing else carries the
number.

**After merge:** tag the merge commit on `main` with `v0.1.0-preview.5`
and push it; `release.yml` builds the draft, `chartula generate --tag
v0.1.0-preview.5` writes the notes into it with the settings
`releasing.md` names (`gpt-6.1-sol`, thinking `low`), and publishing
runs `install.yml`. The pinned `v0.1.0-preview.4` in `docs/ci.md` and
`docs/install.md`, and the template link in the `doctor` samples, move
to the new tag with the changelog pull request of step 6.

**Verified:** the built CLI prints `chartula 0.1.0-preview.5+<commit>`.

Tests: no test changed. Full suite 1,082 passing, build without
warnings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The rule-based check flags a number the facts write with a thousands separator

1 participant