Skip to content

feat(faithfulness): name the pull request behind each flag - #250

Merged
goldbarth merged 1 commit into
mainfrom
feat/flag-pull-request
Sep 24, 2026
Merged

goldbarth merged 1 commit into
mainfrom
feat/flag-pull-request

Conversation

@goldbarth

Copy link
Copy Markdown
Owner

Follows the flag review of five ServiceDeskLite v1.9.0 runs recorded with #227: 5 of 38 flags named a pull request anywhere in their text. The other 33 had to be traced to their fact by hand, and repeats across runs could only be grouped by how alike their wording was.

  • The check names the fact, code decides whether it is one. The verdict schema is now { claim, pullRequest } per claim. ThoroughFaithfulnessChecker keeps the number only when the fact base has that pull request, the same rule as for categories and links: the model never decides what is a fact.
  • One place for the number. Each fact in the check's prompt opens on [#n], and the prompt says to take the number from there only. Titles and descriptions mention issue numbers (build: bump version to 0.1.0-preview.2 #245's title ends in (#243)), which read like pull requests.
  • An unknown number is not dropped silently. It leaves pullRequest but stays in the text as (The check named #243, which is not a pull request of this release.), so the reviewer keeps the lead.
  • No number where there is no single fact: rule-based flags (a token no fact contains), claims about the release as a whole such as the customer description, commit-based facts, and "could not be evaluated".
  • Existence, not correctness. A number the release has is still the check's reading. docs/run-record.md says so.
  • Run record schema version 2. flags becomes [{ "text", "pullRequest"? }]. Changing the element type is breaking, so the version is bumped rather than adding a parallel field that repeats every flag text. The record is local only, and nothing in chartula-evals reads its flags.
  • Terminal and review output put the number first: ! #223: ....
  • IRunMetrics stays string-based: the pipeline passes the flag texts, so the thorough-only count means what it did.
  • Prompt change: thorough-system snapshot and promptHash updated (sha256:abf516c2...), so runs before and after differ in promptHash, as they should.

Verified end to end, no paid tokens: binary with this change against local Ollama (gemma3:12b, factBase.depth: title-only), generate --no-publish --tag v0.1.0-preview.2 in a scratch clone of this repository:

--- Customer ---
  Flagged for review:
    ! #242: This expands the places where Chartula can be run, so you can now use it on a wider range of systems.
    ...
    ! #218: To restore access, please check your repository and token settings in the repository's settings.
  • 24 of 24 flags named a pull request, all 24 in the fact base, none rewritten. In the run record each is { "text": ..., "pullRequest": 242 }.
  • The request schema of both real adapters, dumped from the wire test: claim string, pullRequest integer or null; OpenAI strict mode requires both.
  • Whether a hosted model names the right fact as reliably is for the next comparison run.

Tests: ChatModelTests (claims with and without a number, a claim without text does not count), ThoroughFaithfulnessCheckerTests (a fact opens on its number, a known number is kept, an unknown one is dropped and noted), ReviewPresentationTests (a flag opens on its pull request), RunRecordJsonSerializerTests (flag objects, schema version 2). Full suite 821 passing, build without warnings, dotnet format clean.

The thorough check names, with each claim, the pull request whose fact it
rephrases. Each fact in the check's prompt opens on its number in brackets,
the one place the model may take it from: titles and descriptions mention
issue numbers that read like pull requests.

Chartula keeps the number only when the fact base has that pull request.
A number it does not have stays in the flag's text as the check's lead.

The run record writes each flag as an object with text and pullRequest,
so its schema version goes to 2.
@goldbarth
goldbarth merged commit df9c591 into main Sep 24, 2026
4 checks passed
@goldbarth
goldbarth deleted the feat/flag-pull-request branch September 24, 2026 12:25
@goldbarth goldbarth self-assigned this Sep 24, 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.

1 participant