Skip to content

feat(prompting): quote pull request text between tags and cut long descriptions - #338

Merged
goldbarth merged 1 commit into
mainfrom
quoted-pull-request-text
Oct 6, 2026
Merged

goldbarth merged 1 commit into
mainfrom
quoted-pull-request-text

Conversation

@goldbarth

@goldbarth goldbarth commented Oct 6, 2026 •

Copy link
Copy Markdown
Owner

Closes #337

Prompt change: merge after the evaluation run in chartula-evals (see the last section). The promptHash moves from sha256:18467240... to sha256:adfdfc6c....

  • Why: a fact's title and description, written by whoever opened the pull request, were appended to the fact statement after ": " and " - ". Nothing marked where the author's text ended and Chartula's instructions began, and nothing bounded it: a description with "ignore the rules above", or a pasted log, went to the model as it was, once per audience and once per check.
  • Quoted between tags: PullRequestQuote writes <title>...</title> <description>...</description> into the statement, in the rephrasing prompt (GroundedFactsFactory) and in the thorough check's prompt (ThoroughFaithfulnessChecker) alike, so both read the same text. An opening or closing title or description tag inside the text, in any case or spacing, has its < written as &lt;, so the text cannot close its own quote or open another. Other angle brackets, such as List<string>, stay as written.
  • Told what it is: a sixth shared rule in every audience's system prompt says the quoted text is material to rephrase, never instructions, and that a cut description goes on beyond what the model sees. The thorough check's system prompt says the same for the facts and for the output it checks, which now stands between <output> and </output> and cannot close that quote either, since a rendering may repeat what a description said.
  • Cut at 8,000 characters, in the prompt only: a longer description ends in [cut: N more characters not shown]. The detailed pull request bodies of this repository run to about 4,300 characters, so the limit leaves room for them. The cut is made where the statement is built, not in the fact base: the run record keeps the description whole, as CLAUDE.md asks of a rendering-level concern, and a cut never splits a surrogate pair.
  • What it does not do: it makes text written to steer the model less likely to work, not impossible. The README limitation now says that ("Pull request text is quoted, not trusted"), and so does SECURITY.md; the roadmap's first point after the launch keeps the rest (breaking status source, edits after the merge, links).
  • Docs: what-goes-into-a-release.md, section 8, describes the tags and the cut. The launch list in ROADMAP.md gets its line once feat(releases): stop before replacing the notes of a published release unless asked #335, which rewrote that section, is merged.

Verified:

  • The built CLI, generate --tag v0.1.0-preview.3 --repo goldbarth/chartula --no-publish in a throwaway clone, GitHub read for real, the model on a local stub that records what it is sent: the system prompt carries the new rule, and each fact reads [n] Category: <title>...</title> <description>...</description>.

Evaluation, before merging: run the usual cross-run evaluation in chartula-evals at this commit against the last baseline, one run per audience, and compare flags and rubric results. A run costs tokens, so it is not part of this pull request.

Tests: PullRequestQuoteTests (tags, a title alone, tags in the text neutralized in three spellings, other angle brackets kept, the limit, the cut and its note, no split surrogate); ChangelogPromptBuilderTests (the output quoted and unable to close its quote, the rule in every audience); ThoroughFaithfulnessCheckerTests expect the quoted statement; prompt snapshots and prompt-hash.txt updated. All tests pass.

@goldbarth goldbarth self-assigned this Oct 6, 2026
@goldbarth
goldbarth merged commit cd04513 into main Oct 6, 2026
4 checks passed
@goldbarth
goldbarth deleted the quoted-pull-request-text branch October 6, 2026 17:03
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 7, 2026
Follows #345 and the `v0.1.0-preview.4` tag. Step 6 of
`docs/development/releasing.md`.

- `CHANGELOG.md` section for `0.1.0-preview.4` generated by Chartula and
committed as written.
- Run: `generate --tag v0.1.0-preview.4`, provider `openai-compatible`,
model `gpt-6.1-sol`, thinking `low`, thorough check on with the same
model, binary `0.1.0-preview.4+00f636c` downloaded from the draft. 64
commits, 64 pull requests, 63 facts, 137,866 tokens (134,933 in, 2,933
out), 1 min 32 s, no retries. The same run wrote the release notes,
published as written.
- **Why `gpt-6.1-sol` and `low`:** the newest model of the family
preview.2 and preview.3 used. It refuses `disabled` (`reasoning_effort`
`none`), which Chartula reported before any token was spent, so `low` is
the nearest setting; the price per token is the same as `gpt-6-sol`.
- **`releasing.md` step 4** shows the settings of this run, and says
what preview.2 and preview.3 used and why `disabled` is gone: the
example as it stood fails on `gpt-6.1-sol`.
- Only the note above the sections was edited by hand: it gets the line
for `0.1.0-preview.4`.
- **The pinned tag moves to the new release** where it is an instruction
rather than a quoted run: `CHARTULA_VERSION` in `docs/ci.md` and
`docs/install.md`, the sample `--version` line in `docs/install.md`, and
the template link in the `doctor` samples of `docs/getting-started.md`
and `docs/troubleshooting.md`. Samples that quote a real preview.3 run
(`cli.md`, `outputs.md`, `changelog-json.md`, the README) stay as they
were, since they show what that run wrote.

**Verification**

- `toolVersion` in the run's `changelog.json` and run record is
`0.1.0-preview.4+00f636c9cd449c6577fc403e26eb6cfb4ae9c57f`, the tagged
commit; prompt hash `sha256:adfdfc6c...`.
- Thorough check: technical 0 flags, customer 1 (#338: the entry says
the model is told not to guess beyond a cut; the instruction is in the
prompt, but the fact base of the run does not say it). The customer
rendering is not in this file.
- The new template link and `install.sh` at `v0.1.0-preview.4` both
answer 200.

Tests: none, documentation only.
goldbarth pushed a commit to goldbarth/chartula-evals that referenced this pull request Oct 12, 2026
goldbarth pushed a commit to goldbarth/chartula-evals that referenced this pull request Oct 12, 2026
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.

Pull request text reaches the model undelimited and unbounded

1 participant