Repository navigation
Record provenance per environment, and for the newest commit only - #103
Merged
Merged
Conversation
The provenance log skipped any (code_id, commit) pair it had seen before, which lost the answer the fleet view and `codavox provenance` give in two cases. The key left out the environment. r10k turns a branch into an environment, and a branch just cut from production has production's tree and HEAD, so the same code_id and the same commit. Whichever of the two sealed second was dropped as a duplicate, and its COMMIT column showed `-` until the branch got a commit that changed its tree. Every new branch starts out that way. And a pair already seen was never recorded again. When two commits produce the same tree and a branch is reset to the first, the reset was skipped, so the commit in between stayed newest and was reported as current. Records are now keyed by environment and code_id, and one is skipped only when the newest record for that key already names the commit. Identical reseals still add nothing. Lookup returns append order reversed instead of sorting on sealed_at: records are appended as they are sealed, so the two agree, but append order is what Record compares against and a clock stepped backwards cannot reorder it. Existing logs need no migration. OpenLog rebuilds the newest commit per key from file order, and the publisher's reseal at startup writes the records the old key dropped. Fixes #102 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Michael Harp <mike@mikeharp.com>
miharp
force-pushed
the
provenance-per-environment
branch
from
October 14, 2026 14:51
dba4151 to
e9e94cd
Compare
2 tasks done
miharp
added a commit
that referenced
this pull request
Oct 14, 2026
The release workflow refuses a tag that installation.md does not document, so the install lines move to 0.10.0. The upgrade note exists because the catalog label changes format. config-version now prints <environment>-<code_id> (#104), so anything matching the bare 0.9 label, an OpenVoxDB query or a dashboard, has to change first. It also says when an upgraded server starts printing the new form: OpenVox computes the label once per cached environment, so under environment_timeout = unlimited the old form lasts until the next deploy or restart. The provenance fix (#103) needs nothing from the operator, but the note says when the missing branch commits appear. CONTRIBUTING still told the release to bump a VERSION= line in the README, which has had none since the install moved to the package repository in #96. Lab: batches B, F, and I green (56/56) against an fa7e9cb snapshot built with go1.26.9, including the new I8: on real r10k, a branch that has not diverged from production gets its own label and its own provenance commit (codavox-lab 82397df). Signed-off-by: Michael Harp <mike@mikeharp.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.
Fixes #102.
Problem
The provenance log skipped any (
code_id, commit) pair it had seen before. That lost the answercodavox compilersandcodavox provenancegive in two cases:productionhas the same tree and HEAD, so the samecode_idand commit, and whichever of the two sealed second was dropped. Its COMMIT column showed-until the branch got a commit that changed its tree. Every new branch starts out that way.Change
code_id. A record is skipped only when the newest record for that key already names the same commit. Identical reseals still add nothing.Lookupreturns append order reversed instead of sorting onsealed_at. Records are appended as they are sealed, so the two agree, but append order is whatRecordcompares against, and a clock stepped backwards cannot reorder it.OpenLogrebuilds the newest commit per key from file order, and the publisher's reseal at startup writes the records the old key dropped.commands.md(codavox provenance) andpublishing.md(Provenance) say records are per environment and that a commit is listed again when an environment returns to it.Test plan
go test -race ./...,go vet,golangci-lint(0 issues),gofmt, cspell, markdownlintTestProvenanceUndivergedBranchGetsItsOwnRecordandTestProvenanceReturnToEarlierCommit, fail againstmain'sprovenance.goAssisted by Claude.