Skip to content

feat!: make preview free: show the facts and what generate would send, without a model call - #292

Merged
goldbarth merged 1 commit into
mainfrom
feat/free-preview
Sep 30, 2026
Merged

goldbarth merged 1 commit into
mainfrom
feat/free-preview

Conversation

@goldbarth

@goldbarth goldbarth commented Sep 30, 2026 •

Copy link
Copy Markdown
Owner

Closes #259

  • Why: preview ran every model call and both checks, cost as much as generate, and gave nothing generate --no-publish does not. The docs offered it as a way to check the cost, which it was not. The decision and its reasons are recorded in preview costs as much as generate, and its purpose is unclear #259.
  • Preview stops where the facts are complete: range, pull requests, curation, filtering, labels, categories, visibility. Every fact decision is made before the model, so a preview shows exactly what generate renders from, at the cost of the GitHub requests only. No model call, no key needed, nothing written.
  • What it prints: each fact with the audiences whose rendering carries it (in no rendering when none), each dropped change with the setting that dropped it (Internal is in filter.excludeCategories, its label 'skip' is in labels.exclude, ...), and what generate would send: one rephrasing call per audience with anything to render, the prompt's characters, and the thorough check when it is on.
  • Characters, not tokens: the rephrasing prompt is built with the same prompt builder from the same plan the generator uses, so the count is exact. A token count depends on the model's tokenizer, and a wrong estimate reads worse than none. The thorough check's prompt holds the rendering, so the preview says its size is known only after.
  • One source for each number: IReleaseChangelogGenerator.Plan is the plan GenerateAsync renders from, IReleaseRenderer.Plan returns it per audience, IChangeFilter.DropReason is the decision ShouldInclude makes, IFactBaseBuilder.Curate keeps the dropped changes next to the fact base (they never reach an output file), and IThoroughFaithfulnessChecker.Enabled says whether the check costs a call.
  • No key for preview: AddChartulaLlm checks the key for generate only. generate without a key is still refused before anything is read.
  • The range question fits the run: a preview of a first tag or a large range names the GitHub requests only and asks once (Read all 69 commits up to v0.1.0? [y/N]); generate asks twice as before.
  • The CI smoke tests move to generate --no-publish: binaries.yml checked that a run without a key ends with the key hint, and install.yml/check-install.sh that the model endpoint answers 401. A preview no longer gets there. generate --no-publish does, publishes nothing, and exists in every released binary install.yml may check.
  • Docs: help text and docs/cli.md (line for line, plus the preview section with an example), README quick start, architecture.md, run-metrics.md, run-record.md, what-goes-into-a-release.md (the question for a preview), versioning.md (the install check). The local CLAUDE.md still says the modes differ only in the final write step; it is not in the repository, so it is not changed here.
  • Breaking, hence feat!: preview no longer prints renderings. generate --no-publish shows the prose without publishing.

Verified end to end, no key, no tokens: the built binary in a scratch repository with v0.1.0, a pull request, a direct push and a merge, v0.2.0, GitHub served by a local stub, ANTHROPIC_API_KEY unset:

$ chartula preview --tag v0.2.0 --repo o/n
Preview of v0.2.0 - no model call was made, and nothing was written or published.

Release: 3 commits, 1 pull request, 2 commits without one (1 merge commit, skipped), 2 facts (1 with a description, 12 characters)

Facts (2):
  commit   Fix: fix: crash on start
           technical, customer
  #1       Feature: feat: add search
           technical, customer

generate would make 4 model calls:
  technical 1 rephrasing call, 2,107 characters of prompt, then 1 thorough check
  customer  1 rephrasing call, 6,172 characters of prompt, then 1 thorough check
  A thorough check sends the rendering along with the facts, so its size is known only once the rendering is.
$ echo $?
0

The stub logged no model request. The 2,107 characters are what generate sent for the same release in the verification of #291 (its context-window check reported "a prompt of 2107 characters"), so the count is the prompt as sent.

Tests: FixturePipelineTests (a preview of every fixture never reaches the model: UnreachableChangelogModel throws if it does; entries and prompt characters equal the generator's plan and the prompt builder's prompt; the thorough check off counts one call per rendering), ReleasePipelineTests (preview makes no render call and carries the facts; it does not ask whether it may publish), ChangeFilterTests (each drop reason names its setting), ConsoleRangeGateTests (a preview asks once, about GitHub requests only), PreviewOutputTests (facts with audiences, dropped with reasons, calls and characters, no tokens, no run metrics), PreviewWithoutKeyTests (the built CLI: preview without a key gets to GitHub, generate without one is refused). Tests that used preview as "render without writing" now use generate --no-publish with the spy writers. Full suite 891 passing, rebased on #291, build without warnings, dotnet format clean.

@goldbarth goldbarth self-assigned this Sep 30, 2026
@goldbarth
goldbarth merged commit 630ac74 into main Sep 30, 2026
48 checks passed
@goldbarth
goldbarth deleted the feat/free-preview branch September 30, 2026 12:07
goldbarth added a commit that referenced this pull request Sep 30, 2026
…easured costs (#298)

Follows #292, which made `preview` free and shows the calls and prompt
characters `generate` would send.

- **Why:** reading a run's cost lived in `docs/run-metrics.md`, the
measured costs in chartula-evals and in pieces of `providers.md`, and
nothing said how to size a run before paying for it.
`docs/costs-and-checks.md` is the one home for all of it: the run
summary, both checks, whether the thorough check earns its tokens,
estimating cost, comparing run records, and a dated summary of the model
comparison.
- **Before a run:** the page opens with the size `preview` shows, and
turns its prompt characters into a token estimate (characters / 4,
doubled with the thorough check). The divisor rests on the bound in
`CallValidity.cs`, and the page checks it against a real case: 90,489
characters of prompt for ServiceDeskLite `v1.9.0`, against 21,293
rephrasing tokens in the run of 2026-09-25.
- **Every example is from a real run, not written by hand:** the full
summary, the retried and the unreadable check, and the check turned off
are copied from the `chartula.log` files of the ServiceDeskLite sweep in
chartula-evals (preview.3; the summary code for that case is unchanged
since then). The `preview` output was run on 2026-09-30 with `main` on
the same range. The two `jq` commands ran against three run records of
that sweep. Paths anonymized to `/work/my-repo`.
- **The `lower bound` line** has no real run to quote, since no provider
in the sweep left usage unreported. The page gives its wording from
`RunReportFormatter.cs` in the table instead of inventing an output
block.
- **Measurements, dated and sourced:** cost, duration and flags per
model and thinking level, render × check, the thorough check off,
`title-only` and the local models, from
`sweeps/servicedesklite-v1.9.0-evaluation.md` and `-stats/report.md`,
with the evaluation's own limits (three runs per cell, one release, a
flag count says nothing about text quality) and links to the report and
the charts. No prices: the page gives the formula and links the price
lists. The Anthropic comparison runs are named as pending.
- **Single source:** `run-metrics.md` is deleted and every link to it
points to the new page (README, `chartula.example.yaml`, `cli.md`,
`configuration.md`, `run-record.md`, `what-goes-into-a-release.md`,
`architecture.md`). `providers.md` keeps its model notes and
recommendations in two sentences and links here for the figures; the
local-model details and the 62%/4× figures moved here. The one remaining
figure there (about 11,000 tokens per call) links its source.
- **Recommendations** are stated as of 2026-09-25 and only as far as the
data carries them: keep the thorough check on (it was the only check
that caught anything), start with `thinking: disabled`, check with the
steadier model, render with the cheaper one if your own reading holds
up.
- **README:** the index row for Run metrics becomes Costs and checks
under "Understanding the output". The README cost table was already gone
since #279.
- **Left for later steps:** the troubleshooting parts carried over from
`run-metrics.md` (slow run, unreadable check, cut prompt) stay here
until `troubleshooting.md` takes them; `run-record.md` keeps its purpose
section until it becomes schema only.

**Verified:**
- Every figure was compared against `cells.csv` and the evaluation text;
each number in the page traces to one of them or to a run log.
- Every relative link and anchor in all Markdown files of the repository
resolves (script, with a negative test for a missing file and a missing
anchor). The four chartula-evals links point to files that exist on its
`main`.
- No code, comment or message changed.

Tests: none, documentation only.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01BQ1Z71j4Q2W1CwGYjF55No

---
_Generated by [Claude
Code](https://claude.ai/code/session_01BQ1Z71j4Q2W1CwGYjF55No)_

Co-authored-by: Claude <[email protected]>
goldbarth added a commit that referenced this pull request Sep 30, 2026
… exit status (#302)

Follows #299, which took the failure messages out of `cli.md` into
`troubleshooting.md`, and #301, which made the CLI refuse an option it
cannot read as meant.

- **Why:** `cli.md` mixed reference with setup and concepts: a copied
help text, a first-run style tour, the model failure messages, and the
range rules. It becomes the reference only, so a reader finds every
command, option, default, variable, stream and exit status in one place,
and the rest where it lives.
- **The copied help text is gone.** The page points to `chartula
--help`, which prints from the binary and so always matches the
installed version. In its place, one table of the commands (model calls,
files, publishing) and one table of every option with its value, default
and the commands that read it.
- **How options are checked, as #301 made it:** options follow the
command in any order, `--audience` may repeat, every other option comes
once; `-h` and `--help` print the help after a command too. The page
shows the `--nopublish` message and a table of the other refusals (an
option of another command, a missing value, an option given twice, `=`
instead of a space, a word that is no option), each with the message the
built binary printed.
- **`--tag` and `--repo` keep their defaults with their messages;**
`--since`, `--yes`, `--audience` and `--no-publish` each keep a short
section with the message a wrong value gives. The explanation of the
range stays in `what-goes-into-a-release.md`.
- **New: what goes to stdout and what to stderr,** from `Program.cs`,
`ReleaseCommand.cs` and the composition root, including that the range
question needs stdin to be a terminal and the progress line updates in
place only when stderr is one.
- **Exit status as a table** of every case that gives 0 and 1.
- **Environment:** the three credential variables with a link to their
home each; `Chartula__` settings and the environment-only settings link
to `configuration.md`; the install script variables link to
`install.md`.
- **`doctor`, `--version` and `preview` as the free command it is
(#292),** and what a run prints while it works (#297), stay; the
first-run walkthrough stays in `getting-started.md`.
- **Kept for 3.1:** the list of outputs under `generate` stays until
`docs/outputs.md` takes it.
- `providers.md`: one link pointed to the removed
`#when-a-model-call-fails`; it points to
`troubleshooting.md#a-model-call-fails`. README: the index row describes
the page as it is.

**Verified:**
- Every command, option and message on the page was run with the binary
from `main` against a scratch repository and local GitHub and model
stubs, with stdout and stderr captured apart: `--help`, no arguments,
`help`, `--version`, an unknown command, an unknown option, `--tag`
without a value, an unknown audience, `--since` without a value and with
a ref that is no commit, an invalid `--repo`, `preview` with and without
`--audience` and `--no-publish`, `generate` with and without
`--no-publish`, `doctor` with and without `--tag`, and `generate
--help`, and after #301 every refusal in the page's table
(`--nopublish`, `--tga`, `--tag` at the end and before `--no-publish`,
`--no-publish` on `preview`, `--since` on `doctor`, `--tag` twice,
`--tag=v1.3.0`, a bare `v1.3.0`). The exit status of each matches the
table.
- The `preview` example is a real run on this repository's
`v0.1.0-preview.3`; the `--version` line is the build of `main`.
- Every relative link and anchor in all Markdown files of the repository
resolves (script, with a negative test).
- No code, comment or message changed.

Tests: none, documentation only.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01BQ1Z71j4Q2W1CwGYjF55No


---
_Generated by [Claude Code](https://claude.ai/code)_

Co-authored-by: Claude <[email protected]>
goldbarth added a commit that referenced this pull request Oct 1, 2026
…udience (#306)

Follows #302 and #304, which left the output list in `cli.md` and the
stable surfaces "file names" and "renderings" pointing there until this
page existed.

- **Why:** what a run writes was spread over `cli.md` (a list of the
files), the README (one sentence), `architecture.md` (the shape of each
file and why the model does not decide it) and `versioning.md` (where a
breaking change stands), and the shape of each audience was specified
only in chartula-evals. A user could not see what a file would look like
before paying for a run.
- **`docs/outputs.md` is the one home** for the output files and the
shape of each audience: a table of every output, what it is written from
and when; why Chartula decides the structure and the model only the
wording (#96); then each audience with its groups as a table, the reason
for their order, the entry, and a real example.
- **Technical:** `Changed`, `Added`, `Fixed` in Common Changelog's
order, no `Removed` because no fact marks a removal; the `CHANGELOG.md`
heading (version without `v`, the tag's date, never today's), what stays
verbatim, and that a re-run replaces its section; the release notes as
the same text without the heading, with the draft rules left to
`github.md`.
- **Customer:** the four groups by what the reader has to do,
`labels.actionRequired`, the bold label and `**Breaking:**` in its
place; `release-<tag>.md` with each front matter field, its source and
when it is left out, the file name rule, and that the page is written
with `--no-publish` too.
- **Product:** one `### Other` heading, why the model sorts nothing into
themes, `breakingProminent`, no file, only rendered when named, and
outside the 1.0 promise.
- **Short sections on `changelog.json` and the run record** say what
each is for and link their schema pages, which stay the reference.
- **A release with nothing to say** is described as the code does it: no
model call, the bare heading in `CHANGELOG.md`, empty release notes, no
customer page. The evals template asks for a notice there instead; this
page describes what exists.
- **Examples are real:** technical and customer are excerpts of the
`gpt-6-sol` run on ServiceDeskLite `v1.9.0` from the model comparison
(the run `costs-and-checks.md` already shows; `GroundedFactsFactory`,
`RenderingComposer`, the composers and the prompts are unchanged since
that build, except a visibility change in #292). Product is a new run on
the same release with the comparison's settings, on 2026-10-01, 22,533
tokens.
- **Moved here and replaced by a link:** the output list and the re-run
sentence in `cli.md`; the two paragraphs "Every audience that has a
written shape gets a file" and "The structure of a rendering is not the
model's" in `architecture.md`, which keeps the code path
(`GroundedFactsFactory`, `RenderingComposer`, the writers); the
per-rendering breaking list in `versioning.md`, now one sentence.
- **Links:** `versioning.md`'s rows "File names" and "The technical and
customer renderings" point here; `getting-started.md` and the README
short start link here; the README index gets an Outputs row under
"Understanding the output".
- **Code comments:** `GroundedFactsFactory.cs` and `CustomerPage.cs`
name `docs/outputs.md` next to the evals templates they implement. The
comments in `ChangelogPromptBuilder.Prompts.cs` keep pointing to
chartula-evals only, because they cite the rubric and the wording rules,
which this page does not hold.

**Verified:**
- Every structural rule on the page was run with the binary from `main`
against a scratch repository and local GitHub and model stubs on
127.0.0.1, all three audiences: group order, `**Breaking:**` first,
`action-required` under "What needs action", no reference for a commit
without a pull request, `### Other` for product, the tag date of an
annotated and a lightweight tag, the front matter fields.
- The release with nothing to say was run the same way: no model request
reached the stub, `CHANGELOG.md` got `## 1.2.0 - 2026-09-09` alone, no
`release-v1.2.0.md`, empty renderings in `changelog.json`.
- Every relative link and anchor in all Markdown files of the repository
resolves (script, with a negative test).
- `dotnet build` without warnings; only two doc comments changed in
code.

Tests: none, documentation only.
goldbarth added a commit that referenced this pull request Oct 7, 2026
Follows #344. Step 1 of `docs/development/releasing.md`.

- **Why now:** the launch points are merged, and the binary people
install is still `0.1.0-preview.3`, which has none of them. The
announcement needs a release that holds what the README and the docs on
`main` describe.
- **What ships since preview.3,** 63 commits:
- a first run: `chartula doctor` (#295, grouped in #341), `chartula
--version` (#286), a free `preview` (#292), progress while a run works
(#297, with a spinner and `--plain` in #340), a first tag from the first
commit with a confirmation for a large range (#282);
- what a release contains: commits without a pull request (#291), issue
numbers at every depth (#293), a sentence for a release with nothing for
developers (#307 in #333);
- checks and prompts: pull request text quoted and bounded (#338), no
false flag for a wrapped phrase or a fenced block (#336), flags set
apart from the entries (#331);
- publishing: the token checked before the first model call (#285), a
published release not replaced unless asked (#335);
- the files: `changelog.json` without descriptions and readable as text
(#294, #332).
- **Breaks to state in the notes,** as `docs/versioning.md` asks of a
preview:
- `changelog.json` is schema version 2: a change's `description` is gone
(#294). The run record is schema version 3 and holds the complete facts.
- `generate` stops on a tag whose release is already published;
`--replace-published` restores the old behaviour (#335).
- An option a command does not take stops the run (#301), and
`--whole-history` is gone (#282).
- The terminal output changed form (#340 to #342): the summary's first
line, audience headings in place of `--- Technical ---`, and `doctor`'s
last line. A script that reads those lines needs a look; exit codes and
the files are unchanged.
- 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.4`
and push it; `release.yml` builds the draft, `chartula generate --tag
v0.1.0-preview.4` writes the notes into it, and publishing runs
`install.yml`. The pinned `v0.1.0-preview.3` in `docs/ci.md` and
`docs/install.md`, and the template link in the `doctor` samples, move
to the new tag once the release exists, with the changelog pull request
of step 6.

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

Tests: no test changed. Full suite 1,010 passing, build without
warnings.
goldbarth added a commit that referenced this pull request Oct 8, 2026
…ber in the rule-based check (#357)

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
#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.
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.

preview costs as much as generate, and its purpose is unclear

1 participant