Skip to content

docs: record ADR 0004, the domain talks to models through IChatClient alone - #319

Merged
goldbarth merged 2 commits into
mainfrom
docs/adr-0004
Oct 1, 2026
Merged

goldbarth merged 2 commits into
mainfrom
docs/adr-0004

Conversation

@goldbarth

@goldbarth goldbarth commented Oct 1, 2026 •

Copy link
Copy Markdown
Owner

Follows #318, which added the ADR index and template.

  • Why: the reason the domain knows no model provider was argued in one bullet of architecture.md, in CLAUDE.md, and implied in testing.md, but recorded nowhere as a decision with its date and its cost. A contributor who wanted to call a provider feature from Chartula.Core found a rule without the reasons behind it.
  • ADR 0004 records it in the template of docs: add an ADR index and template, and date what each decision record decided, recorded and amended #318: decided 2026-07-16 in feat(llm): abstract the LLM provider behind IChangelogModel #41 (for Decide and abstract the LLM provider #2), recorded here.
  • Context: two operations need a model, both with structured output; the product promises several providers (Decide what swappable LLM providers has to mean #75); a domain tied to one SDK ties the pipeline to it, and lets a test of the domain reach a real model, which costs tokens, needs a key and depends on the model.
  • Decision: Chartula.Core references Microsoft.Extensions.AI alone, ChatModel sends to an IChatClient, the provider packages are referenced by Chartula.Cli alone, and what the domain asks of a model is expressed in Microsoft.Extensions.AI terms. Provider knowledge such as ClaudeThinkingSupport stays in Cli/Composition.
  • Consequences, precise about the tests: Chartula.Core.Tests cannot reach a model by construction. Chartula.Cli.Tests does reference the SDKs, on purpose, and stays offline because its tests replace the network, not because of its references; the ADR says so rather than claiming the whole suite is safe by construction. Also: a provider joins in the composition root (feat(llm): add an OpenAI-compatible provider with a configurable base URL #88 changed no file in Chartula.Core), the domain is limited to what IChatClient expresses, a provider package is weighed for trimming (ADR 0002), and referencing one from Core or Infrastructure starts as an issue.
  • architecture.md keeps the choice as one line and links the ADR instead of arguing it; testing.md links the ADR for why no Core test can reach a model.
  • The index in adr/README.md lists 0004.

Verified:

Tests: none, documentation only.

@goldbarth
goldbarth merged commit 578d23c into main Oct 1, 2026
4 checks passed
@goldbarth
goldbarth deleted the docs/adr-0004 branch October 1, 2026 18:49
@goldbarth goldbarth self-assigned this Oct 1, 2026
goldbarth added a commit that referenced this pull request Oct 1, 2026
…320)

Follows #319 (ADR 0004); this branch builds on it for the index row and
is rebased onto `main` once #319 is merged.

- **Why:** seven changes since September made Chartula stop where it
used to choose silently, each with its own reasoning in its pull
request, but the rule they share was written down nowhere. A contributor
adding an option or a setting could not tell whether to refuse an
ambiguous value or take the likelier reading, nor when refusing goes too
far.
- **Context** lists the seven cases in one table, each with what the
silent choice did and the change that ended it: a first tag (#198 for
#138, #282), a key sent to the other provider's host (#235), an unknown
or misindented key (#238), a shallow clone read as a first release
(#244), review mode approving unseen text (#247), two configuration
files (#287 for #278), and options a command does not take (#301).
Decided is #198, the first of them.
- **Decision:** stop and say so instead of choosing; before anything is
spent; with a message that names the cause and the fix, shown with two
real messages; ask at a terminal where the answer is the user's, and
stop naming the option without one; refuse only what Chartula can tell
for certain (an empty list, an unknown host and an unknown model id are
taken as written); refuse a setting that would have no effect. The rule
is about what the user meant, not about what the release says, which is
what flags are for.
- **Consequences** name the cost: a run that could have produced
something stops, and a CI job fails until the input says what it means.
The ADR weighs that rerun against what a silent choice cost in the seven
cases. For a new case, four questions in order, so a contributor can
apply the rule rather than match it against the examples.
- The index in `adr/README.md` lists 0005.

**Verified:**
- Each case was checked against its pull request's description and the
issue it closes (#237, #243, #233, #278, #300, #138); the dates are the
merge dates.
- Both messages are the ones `docs/cli.md` and `docs/configuration.md`
show from the built binary.
- The counter-cases were checked in the code: `ProviderHost` accepts
every host but two, `ClaudeThinkingSupport` passes an unknown model id,
#289 reads an empty list as written, and #244 still runs `--since` in a
shallow clone when the range holds.
- Every relative link and anchor in all Markdown files of the repository
resolves (script, with a negative test).

Tests: none, documentation only.
goldbarth added a commit that referenced this pull request Oct 1, 2026
…cks and where messages are written (#321)

Follows #318, #319 and #320, after which every principle the page names
has a decision record to link.

- **Why:** `architecture.md` mixed product behavior (what `--no-publish`
writes, what a customer page holds, which outputs exist) with code,
argued its principles in place instead of pointing to their records,
named the pipeline steps but not the code path from `Program` to the
writers, and had no answer to "where is this message written?". Its
"Where things are" left out `Cli/Configuration`, `Cli/Commands`,
`Core/Pipeline`, `Core/Formatting` and the provider adapters in
`Cli/Composition`.
- **A run in code:** a diagram and a numbered walk from `Program.Main`
through `BuildConfiguration` and `BuildServices` to `ReleaseCommand` and
every step of `ReleasePipeline`, each with its port and adapter. Review
is shown as what it is today: it approves as is, because review mode is
refused until #249.
- **Principles, one sentence each with its ADR:** facts first and the
structure of a rendering (0001), one fact base for every audience stated
as what it gives and not as a guarantee of agreement (0001, as amended
in #318), the AOT-friendly dependencies (0002), endpoints from the
environment (0003), `IChatClient` in the domain (0004), refuse rather
than guess (0005). The page no longer argues any of them.
- **How the two checks work,** in code: what the rule-based check builds
and searches (with #315 named), what the thorough check sends and how it
keeps a pull request number, and how `CallValidity` treats a failed
rendering and a failed verdict differently.
- **Where user-facing messages are written:** a table from what the user
sees to the file that writes it, under the rule that a message is
written where its cause is known (ADR 0005).
- **Where things are** is complete for every folder of the three
projects and links the recipe.
- **The recipe** caught up with #294: step 3 is now "keep it in the run
record, and decide whether it is published" (`FactEntry` always,
`ChangelogChange` only for what may be published, `schemaVersion` 2 and
3); step 5 names the file `FactBaseFixtureTests` lives in and how it
compares; step 6 names the round-trip tests that exist
(`FactBaseRoundTripTests`), not the removed
`ChangelogJsonRoundTripTests`. Its terms (fact, fact base, fixture,
statement, haystack, run record, `schemaVersion`) are explained on first
use.
- **Three doc comments** (`GroundedFactsFactory`, `IReleaseRenderer`,
`ReleaseRenderer`) said the renderings "cannot contradict each other";
they now say what the shared fact base gives, as the glossary, ADR 0001
and the README do. `CHANGELOG.md` keeps the line, since it is committed
as Chartula wrote it.

**Verified:**
- Every step, type and file named was checked against the code: the
order in `Program.Main` and `ReleasePipeline.RunStepsAsync`, the ports
and their adapters, `RuleBasedFaithfulnessChecker`,
`ThoroughFaithfulnessChecker`, `CallValidity`, and the file each listed
message comes from (`git grep` on the message text).
- The recipe's step 3 against `FactEntry.cs`, `ChangelogDocument.cs` and
`ChangelogJsonSerializer.cs`; step 5 against `FixturePipelineTests.cs`;
step 6 against the test files that exist.
- `dotnet build` without warnings (doc comments only changed in code).
- Every relative link and anchor in all Markdown files of the repository
resolves (script, with a negative test).

Tests: none changed, documentation and doc comments 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.

1 participant