Repository navigation
feat(serialization): record how changelog.json was made - #202
Merged
Merged
Conversation
Tool version, provider and model were visible only on stdout during the run, so a bad release could not be explained afterwards from the file. changelog.json gains an optional provenance object: the Chartula version with the commit it was built from, the provider, the model id, and a SHA-256 of every instruction Chartula sends, without the facts. It is additive under schemaVersion 1; a value the run does not have is left out, and a file written without provenance has none, so the stored fixtures do not change. Endpoint hosts stay out of a file meant to be published. Closes #179
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #179
changelog.jsongains an optionalprovenanceobject withtoolVersion,provider,modelandpromptHash(OD18, OD19). It is additive underschemaVersion: 1, which the Stability section ofdocs/changelog-json.mdallows for a new optional field.toolVersionis the assembly's informational version, which the SDK already suffixes with the commit it was built from (0.1.0-alpha+2c43772...), so the file names the exact build.promptHashissha256:over every instruction Chartula sends - each audience's system prompt, the thorough check's system prompt and its user template - without the facts, so it changes exactly when a prompt changes. It lives onChangelogPromptBuilder.PromptHash, where A change to the prompt text is invisible in CI #180's snapshot test can use it too.provenancekey at all. That keeps the stored fixtures byte-identical, so none needed regenerating.OutputServiceCollectionExtensions.Provenance) fromLlmOptionsand handed toFileChangelogJsonWriter; the pipeline and its port are unchanged.docs/changelog-json.mddocuments the object and narrows "fields are always present" to the fields that always were.Verification: the built binary's informational version reads
0.1.0-alpha+2c43772833e4ed32790e5549848f7f42bc0e4eee. A fullgeneratewas not run, since writingchangelog.jsonneeds a rendering and that costs tokens; the writer, the serializer and the wiring are covered below.Tests:
ProvenanceSerializationTests(all four fields written, a null or blank value left out, no provenance means no key, reads back without touching the facts, the prompt hash is a stable SHA-256);FileChangelogJsonWriterTests(the written file carries the provenance it was given);ProvenanceWiringTests(a run records the tool version, the configured provider and model, and the prompt hash).FactBaseFixtureTestspass unchanged, which is the check that files without provenance serialize exactly as before.