Skip to content

feat(facts): carry the labels of a change into the fact base - #120

Merged
goldbarth merged 1 commit into
mainfrom
feat/labels-in-the-fact-base
Sep 8, 2026
Merged

goldbarth merged 1 commit into
mainfrom
feat/labels-in-the-fact-base

Conversation

@goldbarth

@goldbarth goldbarth commented Sep 8, 2026 •

Copy link
Copy Markdown
Owner

What does this PR do?

ChangeFact carries the labels of the change, and changelog.json writes them.

  IReadOnlyList<int> LinkedIssues,
+ IReadOnlyList<string> Labels,
  string? Description)
  "linkedIssues": [12],
+ "labels": ["area:ui"],
  "description": "Adds a dark theme toggle."

They arrive verbatim and unfiltered, the ones curation acted on included: which
labels an output shows is that output's decision, and a fact the base drops
cannot be recovered further down. A commit carries no labels, so a commit-based
change gets an empty list rather than a null.

Why?

ReleaseChange has the labels and LabelRulePolicy already reads them during
curation, but they stopped there.

Today that is a gap. It becomes a blocker the moment a rendering wants subject
matter in the output - tags on a customer release page, a filter on a site,
grouping by topic rather than by change type. The fact base is the only source a
rendering may draw from, so a label that never reaches it cannot be rendered,
and a tag invented outside it is exactly what the rule-based check flags as a
name the facts do not support.

The decision behind it is written up in goldbarth/chartula-evals
docs/output-format.md, section Tags: tags come from pull request labels, never
from the categories and never from a fixed vocabulary.

Closes #98

Notes for review

  • The field sits between LinkedIssues and Description. Both are
    collections of the change's own metadata; the free text stays at the end. That
    breaks every positional call site, which is the point - the compiler listed all
    14 rather than letting one slide through.
  • Labels are compared by content, like the linked issues, order included. A
    record compares a list by reference, and two facts holding the same labels in
    different instances are one fact.
  • schemaVersion stays 1. An optional field is non-breaking per the
    documented contract in docs/changelog-json.md. A document written before the
    field existed reads back with no labels rather than with a null the rest of the
    pipeline would have to guard against - as a test rather than as a claim.
  • The fixtures carry the field. typical-release got real labels,
    commits-only-release empty lists, and the byte comparison against what the
    writer produces is green, so they still represent real runs.
  • Nothing in the rendering path changed. GroundedFactsFactory and the
    prompts are untouched: this is the fact, not its use. The allowlist deciding
    which labels reach an output belongs to the output-format work.
  • [Bug] A change is called user-visible because it is typed feat, not because a reader can meet it #119 depends on this. It needs a signal for user-visibility that the
    category cannot give, and a label is the only one that answers the question
    being asked. It is not in here.

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Refactor / internal
  • Breaking change

Checklist

  • The project builds and tests pass (418 tests, 6 new)
  • Code follows the formatting in .editorconfig
  • I've added or updated tests where it makes sense
  • I've updated documentation where relevant
  • No secrets or API keys are included in this change

`ChangeFact` held the title, the number and link, the category, the two flags,
the linked issues and a description. Not the labels, although `ReleaseChange`
carries them and the curation rules already read them.

Today that is a gap. It becomes a blocker the moment a rendering wants subject
matter in the output - tags on a customer release page, a filter on a site,
grouping by topic rather than by change type. The fact base is the only source a
rendering may draw from, so a label that never reaches it cannot be rendered,
and a tag invented outside it is what the rule-based check flags as a name the
facts do not support.

They arrive verbatim and unfiltered, the ones curation acted on included: which
labels an output shows is that output's decision, and a fact the base drops
cannot be recovered further down. A commit carries no labels, so a commit-based
change gets an empty list rather than a null.

Labels are compared by content, like the linked issues, because a record
compares a list by reference and two facts holding the same labels in different
instances are one fact.

`changelog.json` carries the field. An optional field is non-breaking per the
documented contract, so `schemaVersion` stays 1, and a document written before
the field existed reads back with no labels rather than with a null - as a test
rather than as a claim.

Nothing in the rendering path changed. This is the fact, not its use.

Closes #98

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01XWVjjRRNBEJ1RowVL4i5DM
@goldbarth goldbarth self-assigned this Sep 8, 2026
@goldbarth
goldbarth merged commit 001afeb into main Sep 8, 2026
@goldbarth
goldbarth deleted the feat/labels-in-the-fact-base branch September 8, 2026 11:54
goldbarth pushed a commit to goldbarth/chartula-evals that referenced this pull request Sep 8, 2026
`sonnet-5-labels-out`, rendered from goldbarth/chartula#120 and #121 with
`--audience customer`: 24 entries, and 23 of the release's 28 changes reaching
the prompt where 26 did, after three pull requests were labelled
`visibility:internal`.

Built without `--page`: `release-v0.1.0.md` was deleted before the case was
made and the release description exists nowhere else, so the customer section is
the model's text without the front matter. B2 judges the opening and cannot be
read this turn.
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.

Labels missing from the fact base

1 participant