Skip to content

feat(cli): group doctor's checks, mark each status, and say what the warnings mean for a run - #341

Merged
goldbarth merged 1 commit into
quiet-pulse-progressfrom
doctor-groups
Oct 6, 2026
Merged

goldbarth merged 1 commit into
quiet-pulse-progressfrom
doctor-groups

Conversation

@goldbarth

Copy link
Copy Markdown
Owner

Part of #339, the second of three pull requests for the launch. Stacked on #340, which brings the terminal profile and --plain; review that one first, and this one's diff shrinks to its own once #340 is merged.

  • Why: doctor printed one flat list of ten or eleven checks and ended on "A run would start. The warnings above do not stop it" even when the warning was a token that may not publish, which stops generate before its first model call. The first command a new user runs should be the easiest to read, and must not promise a run that would stop.
  • Three groups in the order a run meets them: Repository (git, checkout, tag, repository, config), Model (model, endpoint), GitHub (read, write, PR titles), under a header chartula · doctor and the checkout's path. The checks themselves, their order and their details are unchanged.
  • Status as symbol and word: ✓ ok, ! warn, × fail, – skip, in StatusMarks (Cli/Terminal), which the progress lines of feat(cli): show the run's progress with the Quiet Pulse spinner, and add --plain #340 now use for · done and × fail too. The word carries the meaning; ok is green, fail red, warn the amber of the brand ramp where the terminal can show it, done and skip neutral. Plain output (redirected, CI, TERM=dumb, --plain) keeps the word alone in the old columns, so a report pasted into an issue reads as before and existing scripts that match ok git still do.
  • The verdict counts and qualifies: "Setup checks passed. A run would start.", "Setup checks completed with N warnings." followed by either "A run would start; read them before generate." or, when a warning is under GitHub write, "preview and generate --no-publish would start; generate would stop at GitHub write.", and "A run would stop. Fix the failed checks, then run chartula doctor again." Exit codes are unchanged: 1 on a failure, 0 otherwise.
  • Profile from stdout: the report goes to stdout, so stdout's profile decides; DoctorCommand.RunAsync takes it, and a test or a caller without one gets plain output.
  • Docs: the three doctor samples (cli.md, getting-started.md, troubleshooting.md) show the new form; cli.md gives the symbols, says what the last line means, and what plain output looks like.

Verified:

  • The built CLI in a pseudo-terminal (script, COLORTERM=truecolor) against local GitHub and model stubs: the header in bold, three bold group headings, green ✓ ok, the GitHub write warning in amber (38;2;224;163;75), detail lines aligned under the check's text, and the verdict naming GitHub write.
  • chartula doctor --plain in the same checkout: no ESC, the word alone per status, the groups and the header in plain text.

Tests: DoctorCommandTests gain the header and the groups, symbol and word on a terminal profile with the details aligned, and the verdict for a warning that does not stop a run; the token test expects the verdict for a warning under GitHub write. StatusMarkTests cover the six-column form, ASCII symbols and the colour per status and depth. All tests pass.

@goldbarth
goldbarth merged commit f92d0ae into main Oct 6, 2026
4 of 8 checks passed
@goldbarth
goldbarth deleted the doctor-groups branch October 6, 2026 17:59
goldbarth added a commit that referenced this pull request Oct 6, 2026
…n went, and group the help (#342)

Closes #339

The third of three pull requests for the launch, stacked on #341
(doctor) and #340 (progress, `--plain`); review those first. With this
one, every point of the launch cut in #339 is done; the points after the
launch stay listed there.

- **Why:** a run's summary opened on "Generated changelog for v1.3.0"
whether the checks found nothing or flagged half the customer page, and
an audience that failed showed only further down. The first line is the
one a person reads; it should say how the run went.
- **The first line:** `Generated v1.3.0.`, `Generated v1.3.0 with review
flags: 2 in customer.`, `Partially generated v1.3.0: 1 of 3 audiences
failed.` (with `; review flags: ...` when there are some), or `No
audience rendered for v1.3.0.`. "Generated" reports what the run did,
not that the text is verified; `docs/cli.md` says so. The closing "N of
M audiences failed." and the exit codes are unchanged.
- **Audience headings:** each rendering stands under its audience's
name, in bold on a terminal, in place of `--- Technical ---`. The
rendering itself is not indented, so the Markdown copies out as written,
and the flags keep the form #211 gave them.
- **A header per command:** `chartula · generate` or `chartula ·
preview` opens stderr, above the announced defaults and the run header;
plain output writes `chartula generate`. `preview`'s stdout opens on
`Preview of v1.3.0` and `No model calls · no files written · no
publication`.
- **One profile per stream:** `Program` decides stderr's profile
(progress, notices) and stdout's (the summary) separately, so `generate
> report.txt` keeps a live spinner on the terminal and a plain file.
- **Help in groups:** "Which release", "What a run writes", "How it
looks", under a lowercase `chartula` like every other header. Every
option and its text is unchanged.
- **Docs:** the summary and preview samples in `getting-started.md`,
`troubleshooting.md` and `cli.md`; `cli.md` gains a table of the first
line and the header in the `--tag`/`--repo` sample.

**Verified:**
- The built CLI in a pseudo-terminal (`script`, `COLORTERM=truecolor`)
against local GitHub and model stubs: stderr opens on `chartula ·
generate` in bold, the progress follows, and stdout opens on the
headline in bold, with the audience heading below it.
- `chartula preview --plain` in the same checkout: `chartula preview` as
the header, no ESC.

Tests: `ReleaseCommandOutputTests` gain the four first lines and the
audience heading; the tests on a run without renderings, on repeated
failures, and `PreviewOutputTests` expect the new lines;
`ArgumentCheckTests` the help's first line. All tests pass.
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.
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.

1 participant