Skip to content

feat: put the structure of every rendering together in code - #129

Merged
goldbarth merged 2 commits into
mainfrom
feat/render-structure-in-code
Sep 16, 2026
Merged

goldbarth merged 2 commits into
mainfrom
feat/render-structure-in-code

Conversation

@goldbarth

Copy link
Copy Markdown
Owner

What does this PR do?

Moves the structure of every rendering out of the prompt and into code.
The model now writes the words of each entry and nothing else.

  • The model is sent the facts with an id each and answers with one text per id, as structured output (RenderedEntries).
  • GroundedFactsFactory plans each audience before the call: which changes, in which order, under which group, whether breaking, and a technical entry's reference.
  • RenderingComposer writes the headings, the **Breaking:** marker, the customer label and the reference around those texts.
  • A fact left without an entry, answered twice, or an entry for a fact that was never sent fails that audience with a message naming the ids, instead of vanishing from the rendering.
  • The prompts lose every structure rule and keep the rules for how an entry is worded.
  • The customer description is a field of the answer, so ReleaseDescription is removed.

Groups per audience:

Audience Groups, in order
Technical Changed, Added, Fixed - breaking first within each
Customer What needs action (breaking, or labelled labels.actionRequired), What's New, What's Changed, Bug Fixes
Product Other

There is no collapsed Also: line any more: every change gets its own entry.

Two commits, each builds and passes on its own:

Commit Change
feat(labels): a label for a change the reader has to act on labels.actionRequired, carried by LabelRules
feat(generation): put the structure of every rendering together in code the plan, the structured answer, the composer, the prompts, tests and docs

Unchanged: the changelog.json schema, review, both faithfulness checks, the written files.

Why?

#96: five renderings of one release on four models came back in five structures while the prompt still carried format rules, two of them from the same model.
Under the decision rule for the alpha, a structure that is not identical across runs moves into code.
See the comparison on #96.

Verified

dotnet build Chartula.slnx -c Release: 0 warnings, 0 errors, on both commits.
dotnet test Chartula.slnx -c Release: 462 passing on the last commit (Core 352, Infrastructure 33, Cli 77).

One live run of this branch, 2026-09-16: claude-sonnet-5, v0.1.0 as tagged today (0d4f6f4, 44 changes), all audiences, --no-publish.
No audience failed, and the structure matches the plan exactly:

Entries Groups Lines that are not entries
Technical 38 of 38 Added 31, Fixed 7 0
Customer 35 of 35 What's New 28, Bug Fixes 7 0
Product 38 of 38 Other 38 0

All 38 technical entries end on their reference and all 35 customer entries carry a label.
The customer page carries its description, and CHANGELOG.md opens on ## 0.1.0 - 2026-09-04.

Observed, not resolved here

  • Tokens and cost. 95,400 in / 33,887 out for rephrasing and 113,190 in / 24,943 out for the thorough check, about $1.51 at list prices. That is roughly double the earlier Sonnet runs. Part of it is the larger range - 44 changes where those runs had 28 - and part is this change: every fact now gets its own entry, the customer entries carry a label, and the answer is JSON. The two were not separated; that would take another run on 8061f46.
  • Duration. The run took 10 minutes 1 second, where earlier runs took two to three. The cause is unknown: the run records neither the time per call nor retries by the provider client. That is [Feature] Record the duration and the retries of every model call in the run metrics #128.
  • openai-compatible endpoints that do not honour the JSON schema now fail the rendering rather than returning free text.

Closes #96
Refs #128

goldbarth added 2 commits September 16, 2026 16:35
A breaking change always asks something of the reader, and the fact base knows
which changes are breaking. A change that is not breaking and still costs the
reader their setup cannot be told from its category: whoever wrote it knows.

labels.actionRequired names the labels that say so. The rules carry them and
nothing reads them yet; the rendering that puts such a change first follows.
Five renderings of one release on four models came back in five structures
while the prompt carried format rules, two of them from the same model. What a
template decides was left to whichever model ran.

The model now answers with one text per fact, keyed by the id the fact was sent
with, as structured output. Everything else is decided before the call and put
around those texts:

- GroundedFactsFactory plans each audience: which changes, in which order, under
  which group, whether breaking, and a technical entry's reference. Customer
  groups follow the template - breaking or labelled as asking something first,
  then new, changed, fixed - and there is no collapsed Also line.
- RenderingComposer writes the headings, the Breaking marker, the customer label
  and the reference, and a fact left without an entry, answered twice or
  invented fails the audience by name instead of vanishing from it.
- The prompts lose every structure rule and keep how an entry is worded. The
  customer description is a field of the answer, so ReleaseDescription goes.

changelog.json, review, both faithfulness checks and the written files are
unchanged.
@goldbarth goldbarth self-assigned this Sep 16, 2026
@goldbarth
goldbarth merged commit 14823f5 into main Sep 16, 2026
@goldbarth
goldbarth deleted the feat/render-structure-in-code branch September 16, 2026 14:41
goldbarth pushed a commit to goldbarth/chartula-evals that referenced this pull request Sep 16, 2026
Two renderings of v0.1.0 at 0d4f6f4 (44 changes), all audiences, from builds
that carry goldbarth/chartula#129: sonnet-5-structure-out on claude-sonnet-5,
and qwen3-14b-structure-out on qwen3:14b through a local openai-compatible
endpoint. Read for structure, not judged.
goldbarth added a commit that referenced this pull request Sep 17, 2026
…ck sees (#142)

Since #129 the composer adds a pull request reference to every technical
entry after the model has written. The facts handed to the thorough check
carried no number and no link, so every reference read as invented: 48
false claims on this repository's own changelog with thinking disabled.

Closes #140
goldbarth added a commit that referenced this pull request Oct 1, 2026
…rd decided, recorded and amended (#318)

Follows #264, which moved the ADRs to `docs/development/adr/`, and #317,
which ruled out the claim that the audiences "cannot disagree".

- **Why:** the ADRs had one `Date` line that mixed when a decision was
taken with what changed later ("2026-07-16 (#45), extended by #96"), no
record of when each file was written, and no list of their own;
CONTRIBUTING kept the only list. ADR 0003 did not mention #235, which
added a refusal to the decision it records, and ADR 0002's title named
the tools rather than the decision.
- **`docs/development/adr/README.md`** holds the index, when to write an
ADR, and a template with separate fields: **Decided** (when it took
effect in the code, which can precede the record), **Recorded** (when
the file was written), and **Amended** (every later change to the
decision or to a fact in it, each dated with its pull request). A moved
file, a fixed link or a reworded sentence is not an amendment, so the
list stays a record of meaning.
- **0001** gives the date and pull request of each part: facts first on
2026-07-16 (#45), and the structure of a rendering on 2026-09-16 (#129,
for #96), which the Decision now marks as its own paragraph with the
reason #96 found. Amended here: "so they cannot disagree on what
happened" becomes what a shared fact base actually gives, the same
changes, categories and breaking status, and says why texts can still
disagree.
- **0002** is retitled to its decision, "Dependencies that keep a
native-AOT build reachable", and the file renamed to match; the Decision
opens on the rule the bullets implement. #268's correction of the
platform count is listed as its amendment.
- **0003** records #235: a model endpoint on the API host of the other
provider is refused before any request, with the reason (a key sent
there must be rotated) and why the list of hosts stays short. Dated
2026-09-23, the day of #235, and marked as recorded here.
- **CONTRIBUTING** links the index instead of listing the ADRs, and the
README's "Contribute" table gains a row for it, so the list exists in
one place.

**Verified:**
- Every date and number was taken from GitHub: the merge dates of #42,
#43, #45, #129, #166, #216, #235 and #268, and the issues each closes
(#3, #4, #6, #96, #158, #184, #233).
- What #268 changed in 0002 was read from its diff: the platform count,
nothing else. #264, #270 and #316 only moved the files or changed a
link, so they are not amendments.
- The rule 0003 now states was checked against `ProviderHost.cs` and
#235's description.
- Every relative link and anchor in all Markdown files of the repository
resolves (script, with a negative test); the renamed 0002 had no inbound
link besides CONTRIBUTING's list.

Tests: none, documentation only.
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 output format is left to the model

1 participant