Repository navigation
fix(pipeline): check that the token may publish before the first model call - #285
Merged
Merged
Conversation
This was referenced Sep 30, 2026
goldbarth
added a commit
that referenced
this pull request
Sep 30, 2026
…n stops (#299) Follows #298, which added `docs/costs-and-checks.md`, the page this one takes the diagnosis sections from. - **Why:** the messages a run stops with were spread over `cli.md`, `github.md`, `configuration.md`, `what-goes-into-a-release.md` and `run-metrics.md`, each explained where its topic lives, but nothing let a user start from the message. `docs/troubleshooting.md` is that entry: message, cause, fix, with a link to the page that explains more. - **It opens with `chartula doctor`,** which finds most of the setup and range situations before anything is spent, and says which ones it cannot find (a spent rate limit, a first tag, everything that only shows once the model writes a whole release). - **The situations:** no model key; GitHub cannot read the repository (404); a rejected token (401); a token that cannot publish, which stops `generate` before its first model call (#285); the rate limit, with and without a token; a configuration error; a shallow clone; a first tag without a terminal; a failed model call by status (404, 401 with and without a key, 403), an unreachable endpoint, and an answer the SDK cannot read, kept apart from an unreachable one (#288); an answer that does not match the facts; an answer cut off at `maxOutputTokens`; a context window too small; a thorough check that verified nothing; a slow run, read from the progress lines (#297) and the run summary. - **Every message is from a real run of the built binary,** in a scratch repository, with GitHub and the model served by a local stub (a mode per case: 404, 401, rate limit with `x-ratelimit-remaining: 0`, 403 with `x-accepted-github-permissions`, model 404/401, an unknown `finish_reason`, a reported prompt of 120 tokens, prose instead of a verdict, a cut answer, a 4 s delay per call). Paths are anonymized to `/work/my-repo`, the stub's address to `https://api.github.com/` and `http://localhost:11434/v1`. The line after `The endpoint said:` came from the stub, so the page shows it as `...` and says its wording depends on the provider. The slow run's summary is the real local run from the chartula-evals sweep already used in #298. - **One home per explanation:** a message appears here and, where it has one, on the page that explains its topic; the explanation itself stays there and is linked. From `cli.md`, the status-by-status account of a failed model call and the missing-key example move here and are replaced by links. From `costs-and-checks.md`, the three diagnosis sections (slow run, unreadable check, cut prompt) move here; the summary page keeps a short list of the lines that point to a problem, each linking its section. - **A message corrected on the way:** the warning without a GitHub token said a run spends "roughly one [request] per pull request". It spends one per commit in the range, as `docs/github.md` says, so a release merged with merge commits was underestimated. The class comment also still claimed that an exhausted limit fails with a 403 naming a commit; the run names the rate limit (`GitHubErrorResponse.cs`). Both are corrected in `GitHubTokenNotice.cs`. - **README:** Troubleshooting joins the "Setting it up" index; `getting-started.md` links it under "Next". **Verified:** - Every case ran with the binary built from this branch; the outputs match the page, and the corrected no-token warning was rerun after the fix. - Every relative link and anchor in all Markdown files of the repository resolves (script, with a negative test). - `dotnet build -c Release` without warnings, `dotnet format --verify-no-changes` clean. Tests: full suite passing (920), no test changed; no test asserts the warning's wording. 🤖 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
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #262
generatefound out that the token could not publish only in its last step, after every model call. A read-only token, or none, paid for the whole run and then ended onNot published:.POST releases/generate-notes: GitHub requires Contents write for it and stores nothing, so it answers "may this token write releases?" without writing one. It costs one GitHub request. The answer is discarded.IReleaseNotesWriter.EnsureCanWriteAsyncsits next toWriteAsync, so the platform decides how to ask, andchartula doctor(chartula doctor: check the setup before the first run #254) can reuse the same check.generatechecks:previewandgenerate --no-publishpublish nothing, so they do not ask and still run without a token.GitHub does not let this run publish ...instead ofGitHub refused to publish ..., since nothing was sent. The pipeline adds that the run stopped before any model call and names--no-publish.Not published:as before.docs/github.mdanddocs/cli.mddescribe the check (roadmap follow-up 2.3, thegeneratefinds out the token cannot publish only after every model call #262 part).Reproduced and verified end to end against
goldbarth/chartulav0.1.0-preview.3,GITHUB_TOKENunset, local Ollama (qwen3:14b-ctx24k),--audience technical, in a scratch clone:Before, on
main:After, on this branch:
Exit 1, no run record, no file written. The same run with
--no-publishrenders and writes as before.The endpoint itself, checked with
curl:200with a token that can write,401without a token,404with a token on a repository it cannot write to. A tag GitHub does not know still answers200.Tests:
ReleasePipelineTests(a refused check stops before rendering and writing,previewand--no-publishdo not check,generatechecks once and publishes),GitHubReleaseNotesWriterTests(a token that may write, one that may not with the permission GitHub names, no token). Full suite passing, build without warnings,dotnet formatclean.