* test(feat): red — Phase 0: conformance suite (history, expectedRevision R16.1, epochs R20) - gastownhall/beads#6133 (refs be-hs42e.1)
* feat: green — Phase 0 conformance suite (history, R16.1, R20 epochs) (refs be-hs42e.1)
Implements the 32 in-process RunXxx contract cases from be-hs42e.1 §4
(gastownhall/beads#6133): expectedRevision CAS + refusal (R16/R17, 10 cases),
the cross-record-invariant boundary (R16.1, 7 cases), and retention/epoch
semantics (R20, 15 cases). All hooks nil in every backend's fixture kit per
architecture §12 — ships disabled by default, zero behavior change.
Also fixes a role-tier coverage-gate false positive: role_bundle_test.go's
TestRoleContractCasesCoverEveryContractCase matched any Run*(t, ctx,
XxxFixture) function in the package with no scoping, incorrectly sweeping in
these new history-semantics functions. Scoped via roleTierFixtureNames()
(reflection over RoleContractBundle's field types) so only functions whose
Fixture type is an actual bundle field count as role-tier cases.
* feat: green — Review: Phase 0: conformance suite (history, expectedRevision R16.1, epochs R20) - gastownhall/beads#6133 (refs be-zv3ob)
Wire the 32 new R16/R16.1/R20 role-contract entrypoints (expected_revision,
cross_record_invariant, retention, epoch) into all three storage legs so
TestEveryLegWiresEveryRoleContract passes on dolt, embeddeddolt, and uow —
fixing the round-1 review's blocking finding (gastownhall/beads#6133).
Each new per-leg _test.go file follows the existing wiring convention (one
TestXxxContract per role, one t.Run per case, calling conformance.RunXxx)
with the same all-nil Phase 0 fixtures used everywhere else this phase, so
every case skips by name until Phase 3 gives it a non-nil hook.
Also corrects a stale comment in versioned_history_wiring_test.go that
argued against per-leg wiring files exactly like the ones this commit adds.
No other behavior change: wiring only, no new dependency, no scope beyond
the reviewer's named blocking issue.
* chore: release gate PASS for Phase 0 conformance suite (be-e0w8y)
Review: be-g8mp3 (PASS). Deploy bead: be-e0w8y.
Refs be-e0w8y, be-g8mp3, be-hs42e.1, be-zv3ob.
* feat: green — Review round 2: Phase 0 conformance suite (bounds assertion, RetentionAnswer fields) - gastownhall/beads#6147 (refs be-ekp0w)
Fix bee-ghosttrack's round-2 MERGE-AFTER-FIXES review on PR #6147
(comment 5504085482):
- RunAHoldPreventsRemovalAndReportsInRetainedBounds now asserts BOTH
refusal (ErrRetentionHeld) AND that the held Address shows up
positively in the reported RetainedWindow bounds, not merely inferred
from the absence of a Gone restriction (R20-h).
- RetentionAnswer gains Attribution *ChangeAttribution and Epoch *int.
RunForcingAHeldRemovalRecordsWhoWhenWhy now asserts real attribution
content (R20-h2) instead of accepting it only as a parameter.
RunEpochBumpVoidsOnlyAddressesOfVersionsNoLongerServed now asserts
Restriction=GoneReorganization AND the current epoch is named (R20-n).
Reviewer-sanctioned, taken in the same pass:
- RetentionFixture gains a Mint hook (analogous to
EpochFixture.MintUnderEpoch); every retention case that needs a real,
resolvable Address now mints one instead of relying on the retired
"fabricated address defaults to Live" convention. The one exception,
RunAStoreWithNoLineageKnowledgeAnswersUnknownNotGone, keeps the old
fabricated-address helper on purpose: Unknown specifically means an
Address no store ever minted.
- RunStoreInvariantTransactionScopesExactlyTheSpanningRecords adds a
post-refusal read-back via CountHistoryForSubject, pinning that a
refused cross-record batch is atomic (leaves no trace on either
record), as an inline nil-check rather than a t.Skip.
- Refusal's doc comment now states the fixture kit is the translation
boundary between whatever shape a real backend ships and the one
shape this suite asserts against — not a mandate banning a native
typed-error refusal shape at the backend level.
- Package doc comment in expected_revision_contract.go records four
reviewer-named deferrals verbatim (unretained/disclosure-gating as a
future authorization axis rather than a sixth Restriction state;
invariant-declaration discoverability; lease TTL self-expiry; R20-j
durability-across-restart) and notes the "_attribution" patch-key
convention as canonical for Phase 3 hook docs.
§4a's choice-vs-transcription table (this file's package doc comment)
already marks choices 2 and 3 DIED as of this round; no separate
callout-row table exists elsewhere in the repo.
No other behavior change: all touched Run* entrypoints still skip by
name under Phase 0's all-nil fixtures on every leg (confirmed via
TestVersionedHistoryPhase0RunsInFullSkipMode and
TestEveryLegWiresEveryRoleContract), no new dependency, no scope beyond
the reviewer's named findings.
* feat: green — Review round 3: Phase 0 conformance suite (nil-hook logging, retained-bounds assertion, stale comment) - gastownhall/beads#6147 (refs be-gw08e)
bee-ghosttrack round-2 review (2026-09-03T01:03Z, MERGE-AFTER-FIXES):
- cross_record_invariant_contract.go:158,178 — log which half of the
atomicity read-back goes unverified when CountHistoryForSubject is nil,
matching the file's existing skip-by-name convention (:327-328).
- retention_epoch_contract.go:511 — RunAHoldPreventsRemovalAndReportsInRetainedBounds
asserted both RetainedWindow bounds equal the held Address, on the
assumption nothing else was ever minted in this store. That assumption
doesn't hold: IssuePrefix is a static per-package string
(internal/storage/uow/retention_epoch_contract_test.go:17), not
randomized per run, so a persistent backend's second run would fail
this for the wrong reason. Weakened to at-least-one-bound.
- retention_epoch_contract.go:60-61 — fixed a stale "those two cases
still use" comment; retentionAddress's own doc comment already names
RunAStoreWithNoLineageKnowledgeAnswersUnknownNotGone as sole caller.
PR body's choice-vs-transcription callout table updated separately
(ten -> eight rows; the R20-h2 and R20-baseline rows described choices
this same review round already marked DIED in source).
* test(feat): red — Implement Phase 2 dual-write history behind flag - gastownhall/beads#6135 (refs be-0uifx)
* feat: green — Implement Phase 2 dual-write history behind flag - gastownhall/beads#6135 (refs be-0uifx)
* test(issueops): red — Phase 2 dual-write: re-seat builder/be-0uifx onto the merged base + add attribution_status (§16.4) — preempt the known review bounce (refs be-v33pa)
* fix(issueops): green — Phase 2 dual-write: re-seat builder/be-0uifx onto the merged base + add attribution_status (§16.4) — preempt the known review bounce (refs be-v33pa)
Migration 0068 step 6 only (VARCHAR(20) NOT NULL on issue_versions);
RecordVersionInTx derives it from the actor string it already receives
via attributionStatusForActor (non-empty -> supplied, empty ->
undetermined; not_supplied/imported are schema-valid but unreached by
any of the 7 current call sites). CLI-bundle direct-DDL override added
per dolthub/dolt#11345. Two pre-existing raw-SQL issue_versions
fixtures updated for the new NOT NULL column.
* chore(release-gates): add be-764ey deploy gate record (Phase 2 dual-write)
Factory release gate for be-764ey / gastownhall/beads#6135, PR #6358
(supersedes draft #6354). 7/7 PASS, no waivers — independent full-suite
run (97 packages ok, 0 FAIL, 0 SKIP), gofmt/vet clean, two pre-existing
non-blocking lint/policy findings attributed to be-2l6n8/be-xzg59.
* chore(ci): no-op commit to retrigger checks — code identical to 4179638; the macOS lane failed on runner disk I/O errors (see PR #6358 discussion)
* fix(history): attribution_status is claimed|unknown (BDP-aligned); document ordinals as local and the flag as single-writer-only
Per donnabox's review on #6358 items 1-3: align issue_versions.attribution_status to bdp#18's carried-attribution vocabulary (claimed | unknown), drop the unreachable not_supplied and the provenance-not-assertion imported; state that current_revision/revision are local ordinals and version_id is the only durable address; document VersionedHistoryConfigurer as single-writer-only until 0068 steps 1-3 land.
* fix(history): durable_state is LONGBLOB holding the RFC 8785 canonical form
Per donnabox's review on #6358 item 4: Dolt's JSON type renormalizes numbers, so a JSON column cannot keep the verbatim-bytes promise (R5.1) or back a content-derived token. Migration 0068 step 7 retypes issue_versions.durable_state to LONGBLOB (guarded PREPARE, CLI-bundle override extended), RecordVersionInTx stores the JCS canonical bytes of the marshalled issue so sha256(stored) is a stable token, and the all-migrations shape test pins longblob.
* build(nix): bump vendorHash for github.com/gowebpki/jcs v1.0.1
The JCS canonicalizer added on this branch changes go.sum, so the
fixed-output go-modules derivation hash moves.
Recomputed on the rebase onto main at 71c4cd08b. The merged module graph
is main's v1.3.0 dependency and toolchain bumps (#6047) plus this
branch's gowebpki/jcs v1.0.1, so neither side's pre-rebase hash applies:
main's was computed without jcs, and this branch's was computed against
the older dependency set. The value here was extracted from nix's own
hash-mismatch report and then verified by a clean nix build .#default.
* style(history): marshaled, not marshalled (misspell lint)
* fix(history): mint a version on every accepted issue-plane mutation, last in the transaction, on every leg
Per the write-path inventory on #6135 (donnabox's item 5 on #6358): the seam was reached from 3 of 57 journaled entry points. Close, reopen, claim, unclaim/release, lease reclaim, defer wake, label add/remove, promote and persistence moves now mint; update's label/parent patches and batch-create edges are applied before the mint so durable_state carries them; dependency add/remove mint at the lowest helper on all legs (uow and legacy verbs included) with the editor's duplicate call removed. version_completeness_test.go pins the set.
* docs(history): issue-plane write-path inventory with Phase 2 dispositions
The table donnabox asked for on #6358 (item 5), derived from the code rather than the design's count, with the dispositions that changed after a14f48b17 and the caveats that remain.
* docs(history): write-path doc: the seam has 27 call sites after a14f48b17, not "exactly six"
The sentence "is reached from exactly six call sites" described the tree at
321a79278 in the present tense, in a doc whose header already says those
rows changed after the completeness fix. It now scopes the six to that
commit and points at a new section listing the 27 sites (18 in issueops,
9 in domain/db) verified with grep over non-test files at d484b809d, with
the enclosing function for each. The "29 sites" figure quoted in the PR
thread was an over-count; 27 is the measured number.
The unchanged-re-import caveat now records that the journal seam sits in
the same position: RecordEventInTx(EventCreate) at create.go:207 runs on
every accepted upsert (only the events-table write behind the isNew gate
at create.go:171 is skipped), so a field-level no-op gate belongs in front
of both seams, not the version seam alone.
Doc only; no Go change.
* fix(history): seed store_epoch once per store, state the fail-closed canonicalization policy, and say single writer means one at a time
From bee-ghosttrack's round-1 review of #6358.
- store_epoch (nit): RecordVersionInTx ran INSERT IGNORE INTO store_epoch
on every mint, putting one shared row (id = 1) into every write
transaction's footprint. It now reads first and seeds only when the row
is absent, so the seed happens once per store. Same result, one fewer
write per versioned mutation.
- canonicalDurableState (MINOR-4): the comment now states the two
properties a hand-rolled canonicalizer would get wrong -- jcs.Transform
normalizes away encoding/json's HTML escaping, so the token is a function
of content, not of Go's escaping policy; and a snapshot that cannot be
canonicalized deliberately fails the mutation. Duplicate keys in an
issue's metadata (a json.RawMessage, reachable via bd sql or a hand-
written JSONL import) make the seam return an error with the flag on.
Fail-closed is the policy for now; normalizing first, or finding such rows
with bd doctor, is gastownhall/beads#6379 item 3.
- Single writer (MINOR-5): the constraint in version_history.go,
storage.go and the 0068 header now says one writer AT A TIME per store,
not merely one clone -- MAX(revision)+1 is not a safe allocator for two
concurrent transactions in one store either, and no contract case runs
concurrent writers. gastownhall/beads#6379 item 4.
- RecordVersionInTx doc (nit): IsWisp is Ephemeral || NoHistory, so a
promoted no-history bead is also never versioned; stated as what
no-history means rather than as an FR-8 wisp rule.
No behaviour change beyond the one fewer INSERT. Gates: gofmt, go build,
go vet, golangci-lint v2.10.1 (0 issues), issueops, the five embedded-Dolt
version suites, scripts/check-migration-hygiene.sh.
* docs(history): restate the write-path doc at this head; keep the 321a79278 inventory under a dated heading
bee-ghosttrack's MINOR-2 on #6358: the table and notes were written in
the present tense against 321a79278, so as merged the doc said close was
OUT OF CONTRACT and that no completeness test existed, beside the code
that ships both.
The doc now has two parts. "Dispositions at this head" carries a table of
every row whose disposition changed after a14f48b17 (rows 13-23, 25, 27,
34) with the mechanism and line for each, the counts at this head (21
VERSIONED, 13 OUT OF CONTRACT, 5 no-op gates), the deferred items, the
seam call sites, and notes that are true now. "As found at 321a79278" keeps
the original table and notes verbatim as the record of what the review
found, with a sentence saying which rows it no longer describes.
Also: row 13 now says wisp or promoted no-history bead (nit); the flag-off
sentence says behaviourally a no-op at the seam but not literally zero
added work (nit); the flag-on prerequisites point at gastownhall/beads#6379.
* test(history): a call passing mintVersion=false is not a minting edge (reviewer MINOR-1)
The versioned-history guard's fixpoint treated "textually calls
RecordVersionInTx, directly or transitively" as the mint predicate, so a
call to a helper with mintVersion=false still counted as a minting edge.
Reviewer Probe 2 on #6358 showed the consequence: deleting ExecuteUpdate's
own final `if changedAny { RecordVersionInTx(...) }` block left the whole
issueops package green, because the fixpoint credited ExecuteUpdate with
the mints of the very constituents it had told not to mint.
journalscan now records each function's parameter names and each call's
reduced argument list (bare identifier or literal per argument), and
exposes CallsOnlyWithLiteralFalse(fns, f, callee, gate): true only when
every call f makes to callee passes the predeclared false for callee's
parameter named gate. A call passing true, a variable, the caller's own
parameter, or too few arguments keeps its edge, as does a callee without
the parameter. Existing callers (IdentCalls, SelCalls, Fixpoint) are
unchanged; the resolve closure is merely lifted to a package function.
versionMintEdges drops the switched-off edges, and a new
TestCompositeMutationsCarryTheirOwnMint pins that ExecuteUpdate,
applyLabelPatch and applyParentPatch each call the seam themselves and
that none of their remaining edges reaches it.
Verified: full issueops package green on the unmodified tree. Probe 2
(delete ExecuteUpdate's final mint block) now fails
TestCompositeMutationsCarryTheirOwnMint, TestEveryVersionedEntryPointMints
and TestEveryBeadMutatorMintsOrIsExempt, all naming ExecuteUpdate; the
same probe against the previous guard stays green. Probe 1 (delete the
close mint) still fails TestEveryVersionedEntryPointMints and
TestEveryBeadMutatorMintsOrIsExempt naming CloseIssueInTx,
CloseIssueWithoutEventInTx, CloseIssueCheckedInTx and ExecuteClose. The
exemption tables are untouched.
* test(history): pin the uow leg's 1+N+M create divergence as a red-when-fixed test (reviewer MINOR-3)
TestDualWriteContract's Mutate closure creates an issue with no labels and
no dependencies, so its "exactly one version row per accepted mutation"
case cannot see what a fuller create does on the uow leg:
domain.IssueUseCase.CreateIssue inserts the row and then persists each
label and each edge through its own repository (domain/db label.go,
dependency.go), and every one of those writes reaches
issueops.RecordVersionInTx on its own. The direct legs mint exactly one
row for the same shape (CreateIssuesInTxWithContext mints once per issue
after the creation-time edges land).
TestUOWCreateWithLabelAndEdgeMintsPerRepositoryWrite_KnownDivergence
creates an issue through the uow leg with exactly one label and one
blocks edge and asserts the MEASURED count of issue_versions rows:
3 (1 issue + 1 label + 1 edge), matching the 1+N+M prediction. It also
checks the label and edge actually landed, and that the bare-shape target
seeded through the same leg holds exactly 1 row, so the two extra rows
are attributable to the label and the edge. A t.Log line and the doc
comment name the follow-up as gastownhall/beads#<FOLLOWUP-ISSUE> (to be
substituted before push) and state that the test is expected to FLIP to
1 when it lands.
The provider boot + flag enablement is lifted out of
newUOWDualWriteFixture into newUOWVersionedHistoryProvider so the new
test shares it; the existing contract cases and the fixture closures are
unchanged. Runs on the same backend and skips as its neighbours (a real
dolt sql-server, gated by testutil.RequireDoltBinary; no extra env
needed).
Verified: go test -count=1 -run 'TestDualWrite|TestUOWCreateWithLabelAndEdge' ./internal/storage/uow/ passes.
* test(history): pin canonicalDurableState to the RFC 8785 vectors, key order, HTML escapes and duplicate keys
TestCanonicalDurableStateIsJCS covered only number forms. It is now
table-driven over:
- the ten RFC 8785 test vectors that ship with github.com/gowebpki/jcs
v1.0.1 (Apache-2.0), copied verbatim to
internal/storage/issueops/testdata/jcs/{input,expected} with a README.md
recording their provenance (upstream's "output" directory is named
"expected" here because the repository's .gitignore drops any output/
tree); the count is pinned so an emptied directory cannot pass as a
vacuous table;
- a unicode/astral key-ordering case: {"b":1,"a":2,"é":3,"A":4,"😀":5}
canonicalizes to {"A":4,"a":2,"b":1,"é":3,"😀":5} (UTF-16 code-unit
order, so the astral key sorts after "é");
- an HTML-escape case: a string value <a>&"'</a> comes out as
"<a>&\"'</a>" with no <-style escaping, plus a companion subtest
proving plain json.Marshal DOES emit </& so the normalization
is demonstrably jcs.Transform's work;
- a fixed-point check, canonical(canonical(x)) == canonical(x), for every
table case;
- a duplicate-key input {"k":1,"k":2}, which must fail with an error
containing "Duplicate key" rather than store whichever value wins.
The existing number-form assertions are kept as they were.
Verified: go test -count=1 -run 'CanonicalDurableState' ./internal/storage/issueops/ passes (16 subtests).
* ci: no-op retrigger after a known flake in internal/metrics
Run 34173415291 on 0645e7827 failed only TestStartDetachedReapsExitedChild
("child pid became a zombie; startDetached did not reap"), the residual
child-process reap race tracked as beads be-w5rdt; #5933's fix is already
on this branch. Nothing in this PR touches internal/metrics. Empty commit
to re-run CI, since the PR author cannot re-run jobs in this repository.
* ci: no-op retrigger after a package-level timeout in the differential regression lane
Run 34174581104 on d81157b7d: 124 of 125 checks green; "Differential
Regression (v0.49.6 baseline)" panicked with "test timed out after 20m0s"
in the middle of TestRapidLabelAddRemoveStability, after the earlier
scenarios in the same package ran at several times their d484b809d
durations (TestListAllOverridesLimitWithLabel 87.9s; the whole lane took
11m0s on d484b809d). The regression suite never enables versioned history,
so nothing in this PR is on its path. Empty commit to re-run CI.
* docs(history): drop the stale head sha from the current-part heading; cite the seam by function, not line (bee round 2)
* test(history): make the mintVersion=false guard's claims exact (shadowed false, ambiguous names, method constituents)
Three reviewer nits on the versioned-history completeness guard
(gastownhall/beads#6358), each closing a gap between what the guard
claimed and what it checked. Detection is only ever strengthened.
Shadowed false. CallsOnlyWithLiteralFalse matched the NAME false, and
Go lets a local, a parameter or a package-level declaration take that
name, so a shadow read as a switch-off. journalscan now reads a false
or true as the predeclared identifier only when the parser's per-file
resolution (ParsePackage's mode 0, now pinned) attaches no declaration
to it AND no file of the package declares the name at package level
(per-file resolution cannot see the cross-file case; ParsePackage folds
each file's package scope in). Any shadow reduces to "", an unknown
expression, so the edge stays live. TestFalseIsNotShadowedInIssueops
independently walks every declaration position in issueops (test files
included) and fails on any true/false, so the reading is exact there,
not merely conservative.
Ambiguous names. Resolution is name-based, so a literal-false call to a
name shared by a gated function and an ungated one dropped the
fixpoint's edge to both. Resolve's semantics are unchanged;
TestLiteralFalseCalleesResolveUnambiguously requires every callee of a
mintVersion=false call to resolve to one function or to only functions
that declare the gate, naming the ambiguous name otherwise.
Method constituents. TestCompositeMutationsCarryTheirOwnMint looked up
mints[callee] by bare name while the fixpoint keys methods Recv.Name,
so that half only bit for free functions. The check now resolves each
live edge through the scanner's own Resolve (exported for this, with a
stable order); TestCompositeCheckSeesMethodConstituents proves it on a
synthetic package whose constituent is a method.
Reviewer probes re-run: deleting the close mint, deleting
ExecuteUpdate's final mint block, and flipping its
moveIssuePersistenceInTx call to mintVersion=true each still fail the
guard.
* chore: remove leaked internal release-gate docs from PR branch
release-gates/be-764ey-gate.md
release-gates/be-e0w8y-phase0-conformance-suite-gate.md
Tracked our internal gc-management/beads-rig release-gate checklist and
should never have been committed to this upstream branch -- it's process
residue from our deploy tooling, not part of the change itself.
Per maintainer bee-ghosttrack's request during review of PR #6571. The
root cause (our deploy tooling auto-committing this file) is already fixed
as of gm-qatxl1; this branch predates that fix, so this commit is cleanup
only -- no other content on this branch is touched.
Ref: be-lk7o3
* test(feat): red — same-type dep re-add double-journals (refs be-58eip)
Adds bd_events_journal assertions to the existing SameTypeReAddIsIdempotent
and RemoveIsIdempotent conformance cases, across all three DependencyEditor
backends (dolt, embeddeddolt, uow). The journal has no deduplication of its
own, so a same-type re-add that gates on TYPE alone (never the stored
metadata VALUE) journals a dep_add that never happened — RED on all three
legs today. The remove side already holds (confirmatory pin).
Refs gastownhall/beads#5898, #6358.
* fix(feat): green — same-type dep re-add is a true no-op when metadata is unchanged (refs be-58eip)
addDependencyInTx (embedded/proxied-server legs) and the uow leg's
DependencySQLRepository.Insert both gated the same-type re-add branch on
TYPE equality alone, so a duplicate add with identical metadata still
rewrote the metadata column and journaled a dep_add via
RecordDepEventInTx even though nothing changed. Both now also compare the
existing stored metadata against the requested value: identical metadata
returns immediately with no write and no journal entry, and only a genuine
metadata change still updates the row and journals the replacement edge.
Makes RunDependencyEditorSameTypeReAddIsIdempotent green on all three
DependencyEditor backends (dolt, embeddeddolt, uow); full contract suites
and TestEventsJournal_UOWDependencySnapshotsFollowBlockedState (a real
metadata change must still journal) remain green.
Refs gastownhall/beads#5898, #6358.
* test(feat): red — same-type dep re-add with changed metadata leaves it unminted (refs be-ejoty, #5898 leg 2)
Round-1 review on be-58eip found leg 2 of #5898 comment 5561794917
unimplemented, not merely untested: a same-type dependency re-add whose
metadata actually changed is a real durable-state mutation of the source
issue, so it must mint exactly one version — but neither backend's
same-type branch called the mint seam, and no test in the suite
constructed the changed-metadata case (RunDependencyEditorSameTypeReAddIsIdempotent
reuses one identical request for both calls, so existingMetadata==metadata
on every run).
Adds RunDependencyEditorSameTypeReAddWithChangedMetadataMintsOneVersion,
driven through fixture.AddDependency (the role's own DependencyEdge
carries no metadata field). Reads issue_versions directly via a new
SetVersionedHistoryEnabled fixture hook rather than CountHistory/dolt_log:
AddDependency writes through the backend's raw store path, and on at
least one backend only the role's own transaction wrapper issues the
version-control commit CountHistory observes.
Currently red: the production same-type branches update the row and
journal the replacement edge, then return without minting.
* fix(feat): green — same-type dep re-add mints one version when metadata actually changed (refs be-ejoty, #5898 leg 2)
Completes #5898 comment 5561794917's leg 2. A same-type re-add that
changes metadata is a real durable-state mutation of the source issue,
so it mints on the same terms as a genuinely new edge — only a
change-free re-add (identical type and metadata) mints nothing.
addDependencyInTx's same-type branch (dolt/embeddeddolt shared path)
now calls the existing mintDependencyVersion seam after journaling the
replacement edge. dependencySQLRepositoryImpl.Insert (uow/domain
backend) now calls issueops.RecordVersionInTx at the equivalent point.
Without this, any caller that sets non-default dep.Metadata (e.g.
types.NewWaitsForDependency's gate JSON, used by graph-plan apply and
batch_apply.go) re-adding the same (issue,target,type) pair with a
different gate value would silently rewrite it with zero version-history
trail.
* fix(deps): canonicalize both sides of the change-free re-add gate
Maintainer review fixup for #6650.
The change-free re-add gate compared the caller's raw metadata string
against bytes read back out of a native JSON column. Dolt renormalizes
what it stores -- spacing, key order, number form -- so a semantically
identical re-add was misclassified as "changed": it journaled a false
dep_add replacement entry (the #5898 R3 defect this PR exists to
remove) and, new versus base, minted a version row on a path base never
minted on. The no-op held only for metadata already in Dolt-normal
form, which is not the form hand-authored or struct-marshaled metadata
arrives in.
Both gate sites now compare through issueops.DependencyMetadataEqual
(RFC 8785 / JCS), falling back to a byte compare when either side does
not parse. The widened SELECTs also scan metadata via sql.NullString
and read SQL-NULL as "{}", so a row carrying an explicit NULL -- the
column is nullable -- stays idempotent instead of hard-failing with
"converting NULL to string is unsupported" on a path base handled fine.
RunDependencyEditorSameTypeReAddWithIdenticalMetadataIsANoOp covers the
boundary the four-leg matrix never exercised, identical NON-EMPTY
metadata, in two sub-cases: the compact spelling the caller already
sent, and the same fields with their keys reordered. Wired on all three
backends. Red before this commit on both write planes -- embedded dolt
fails both sub-cases, because the renormalization happens on storage
and breaks even byte-identical caller input, and the uow/serve-mode
plane fails ReorderedKeys. Unit pins for the comparison rule and for
the NULL scan live in issueops/dependencies_test.go, and the serve-mode
scan has its own sqlmock twin in
domain/db/dependency_null_metadata_test.go, so reverting either plane's
scan has something red to catch it rather than only one of the two.
Every production and conformance hunk here is byte-identical to stacked
successor #6693, which implements the same repair, so folding it in
leaves that PR a clean drop rather than a conflict to adjudicate.
Addresses review findings 1 (major), 2 and 3 (minor), plus the
iteration-2 test-evidence minor: the NULL repair landed on two planes
but was pinned on one.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
---------
Co-authored-by: Julian Knutsen <julianknutsen@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
1 line
No EOL
118 B
JSON
1 line
No EOL
118 B
JSON
{"literals":[null,true,false],"numbers":[333333333.3333333,1e+30,4.5,0.002,1e-27],"string":"€$\u000f\nA'B\"\\\\\"/"} |