fix: a save that changes nothing records nothing, and apply says so - #1799
Merged
Merged
Conversation
Collaborator
Author
|
Labelled |
jhgaylor
force-pushed
the
stack/1680-unchanged-verdict
branch
from
September 10, 2026 11:10
8d50b0c to
55c0abd
Compare
…1680) `Repo.update` on an empty changeset skips the SQL, but `Environments`, `Vaults`, `Agents` and `Webhooks` audited the `{:ok, _}` either way. An idempotent re-apply of a manifest therefore wrote one `*.updated` row per resource, each naming an empty changed-field list, against a record nobody had touched. That is what CLAUDE.md's "only record what happened" forbids. The four contexts now gate the recording on a non-empty changeset, the way `Fountain.Team.Schedules.update_schedule/3` already did. The same re-apply also reported an update it had not made. `Fountain.Manifest` compares the record before and after over the schema's own columns, with the timestamps left out, and reports a third verdict: `unchanged`. A second apply of the same file now says plainly that it wrote nothing. Inline `spec.secrets` are the exception and keep reporting `upserted`. The stored ciphertext cannot be compared with the plaintext given, so they are re-encrypted on every apply. `fountain apply` prints `=` for such a row, beside `+` and `~`. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WQyc3wWWDAeZJE1Vr6etQa
jhgaylor
force-pushed
the
stack/1680-unchanged-verdict
branch
from
September 10, 2026 11:26
55c0abd to
e23057e
Compare
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.
Repo.updateon an empty changeset skips the SQL, butEnvironments,Vaults,AgentsandWebhooksaudited the{:ok, _}either way. Anidempotent re-apply of a manifest therefore wrote one
*.updatedrow perresource, each naming an empty changed-field list, about a record nobody had
touched. That is what CLAUDE.md's "only record what happened" forbids. The
four contexts now gate the recording on a non-empty changeset, the way
Fountain.Team.Schedules.update_schedule/3already did.The same re-apply also reported an update it had not made.
Manifestnowcompares the record before and after over the schema's own columns (timestamps
left out) and reports a third verdict,
unchanged, so a second apply of thesame file says plainly that it wrote nothing. Inline
spec.secretsare theexception and keep reporting
upserted: the stored ciphertext cannot becompared with the plaintext given, so they are re-encrypted on every apply.
fountain applyprints=for such a row, next to+and~.This is the first of eight PRs that together land #1636 (one manifest
reconciles a whole estate). #1675 is the combined branch and stays open as the
reference until the stack is in.
Closes #1680
Validation:
mix testover the touched suites,mix precommitclean.go test ./...incli/.the whole stack lands in the last PR, so no publish happens here.
The stack (each PR is based on the one above it; review and merge top down):
stack/1680-unchanged-verdict— a save that changes nothing records nothing (Bulk apply reportsupdatedfor a document that changed nothing, so a client cannot tell a no-op from a write #1680) ← this onestack/1636-apply-isolation— a raise in one apply document fails that rowstack/1636-cotenant-identity— a co-tenant follows a replacement only if it declared the same identitystack/1636-update-teammate— Team.update_teammate/4stack/1636-cli-group-by-kind— CLI: group apply documents by kindstack/1636-teammate-kind— apply reconciles Teammate documentsstack/1636-schedule-kind— apply reconciles Schedule documentsstack/1636-webhook-kind— apply reconciles Webhook documents (Bulk apply: accept Teammate, Schedule and Webhook documents so one manifest reconciles the whole estate #1636)🤖 Generated with Claude Code
https://claude.ai/code/session_01WQyc3wWWDAeZJE1Vr6etQa