* 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 — Widen issue_versions.change_at to DATETIME(6) before any store accumulates real history (refs be-hs42e.8)
* feat: green — Widen issue_versions.change_at to DATETIME(6) before any store accumulates real history (refs be-hs42e.8)
* test(schema): fix TestMigration0067...ThroughDoltCLI for the 0068 DATETIME(6) widen (reviewer MAJOR, round 1)
Mayor-specified remediation (b): assert the column type the full
migration chain now produces, not the schema as of 0067 alone.
TestMigration0067AddsVersionedBeadsSchemaThroughDoltCLI already runs
AllMigrationsSQL() (the whole bundle through 0068) and already tracks
two other 0068-introduced shape changes on this same table
(durable_state -> LONGBLOB, attribution_status NOT NULL) rather than
pinning the pre-0068 shape, so change_at/removed_at follow the same
existing pattern: datetime -> datetime(6).
Asserting AS-OF-0067 instead would mean forking the test to stop the
bundle at slot 0067, which would also have to unwind those two other
already-adapted assertions -- contradicting the test's own documented
intent to check the current cumulative shape.
refs be-hs42e.8 / be-ebl4t (review round 1)
* fix(history): scope, stage and forward dual-write versioned history (review rounds 1-2)
Maintainer fixup for the three majors in the #6675 review. All three are
incompleteness in the activation half of this PR's own contract: the seam
mints correctly, but the store half never turns minting on everywhere, never
publishes what it minted, and cannot be turned on at all through the shipped
provider chain. The flag is off in every build, so none of this regresses
today -- which is why it is cheap to fix here instead of being inherited by
the phase that flips it.
1. Scope versioned history where the journal already is.
RecordVersionInTx no-ops unless ScopeVersionedHistoryTransaction bound the
transaction. Two issues-plane sites were unscoped: runDoltTransaction --
the whole doltTransaction mutator surface, reached from bd create, batch
create/import, bd graph apply, merge_slot and the CLI transact wrappers --
and the non-wisp arm of DoltStore.RemoveDependencyWithOptions. Unscoped
means the mutation commits and no version row exists, so the next scoped
mutation mints revision 1 and the history claims the update is the
creation.
version_scope_completeness_test.go is the structural twin of the journal's
guard, in two arms because one cannot see both shapes: the raw-tx scan
(mutator set computed from issueops source, 8 wisp-plane exemptions with
reasons) plus a wrapper arm for the callback-taking transaction runners the
direct scan cannot reach. Deleting runDoltTransaction's scope fails only
the second arm -- measured -- which is why both exist.
2. Stage what a mint writes. issue_versions and store_epoch replicate: they
are deliberately not dolt_ignore'd, and the single-writer constraint this
feature documents is a statement about merging them between clones, which
only means anything for a table that replicates. So every mint has to reach
its operation's DOLT_COMMIT, or the rows sit dirty in the working set --
unreplicated, and swept into whatever unrelated commit stages next.
issueops.VersionedHistoryStagedTables is the one list; the fixed-list
DOLT_ADD paths and both DirtyTableTracker paths consult it, keyed off
activation so no call site has to remember. The decision is recorded in
0068's header, since 0067 is frozen and said nothing.
The uow/serve and embedded -Am paths already stage the whole working set
and are untouched. bd-2y9ke is not widened: every addition is gated on
activation, so no flag-off commit changes shape.
3. Forward the configurer through externaldeps.uowProvider, the outermost
provider on both real chains. Activation type-asserts the outermost value,
so without this the assertion fails exactly where it matters and the inner
forwarder is unreachable -- silently, because the compiler cannot see a
missing optional-interface method. The assertion block now lists the
interface and a table-driven test covers both configurers through the
wrapper.
The new contract case drives a flag-on mutation through RunInTransaction (not
the already-scoped withWriteTx arm) and asserts dolt_status is clean for
issue_versions afterwards, so it is red against 1 and 2 independently.
Also: correct the stale "three guarded PREPARE blocks" count in the 0068
CLI-bundle override comment (four blocks, three steps -- step 8 has one per
column), and record the deferred per-mint round-trip cost against #6379.
Round 2 (comment-only; both findings are against this commit, both non-gating
-- the iteration-2 synthesis and scorecard are approve with no required
changes):
- doltAddAndCommitInTx's NEXUS#92 HAZARD header enumerated the in-tx planes
the lost-update still reaches but predates the staged-set widening this
commit added at that same site. issues was already exposed there and
self-heals -- the next mutation of the bead rewrites the reverted row --
while issue_versions and store_epoch are append-only, so a row reverted to
its BEGIN-time value is simply gone. Named in the header so the activation
phase inherits a written hazard instead of discovering it.
- MarkVersionedHistoryDirty's "cannot disagree" claim is absolute where the
code is not: scope time and stage time are two Load()s of the same atomic,
not one value threaded through, so the invariant holds only while activation
does not flip mid-operation. Unreachable in production (no non-test setter
caller; activation is wiring-time), so the comment states the dependency and
names the latch-the-flag remedy for whenever that stops being true.
* fix(schema): move the change_at/removed_at DATETIME(6) widen out of frozen 0068 into new migration 0069
0068 landed on main (#6650) with steps 6 and 7 only, so check C of
scripts/check-migration-hygiene.sh now treats it as frozen: clones built
from main have applied it and recorded its content hash. This branch still
appended step 8 (the change_at/removed_at DATETIME(6) widen) to both 0068
files, which forked the fresh-bundle 0068 hash from the applied one and
turned `Check migration hygiene` (and so `CI Gate / Required`) red.
Per the review:
- restore 0068_add_attribution_status.{up,down}.sql byte-identical to main;
- add 0069_widen_issue_versions_datetime_precision.{up,down}.sql carrying
the DATETIME_PRECISION-guarded PREPARE blocks as written, plus the step-8
reverse; the DOLT PLANE paragraph moves into 0069's header;
- split cliMigration0068AddAttributionStatus back to main's two-ALTER form
and add cliMigration0069WidenIssueVersionsDatetimePrecision with its own
case in cliCompatibleMigrationSQL;
- retarget the datetime-precision tests at 0069
(migration_0068_datetime_precision_test.go ->
migration_0069_datetime_precision_test.go), which also drops the stale
"0069 and 0070 are already spoken for" pointer from round 1.
Two follow-throughs the move needs beyond that list:
- TestLatestVersionIncludesMigration0068 hardcodes 68, so it is superseded
by TestLatestVersionIncludesMigration0069, the same way #6650 retired the
0067 pin when 0068 arrived;
- TestAllMigrationsSQLUsesDirectDDLForKnownCLIIncompatibilities gains 0069's
direct-DDL and guard-variable anchors, as 0066-0068 each have.
The 0069 header no longer rests on "this migration and the table's first
writer ship in the same build" (the writer is already on main, behind the
versioned-history flag). Widening is lossless whatever the table holds,
which is the claim it makes instead. The down file records that narrowing
rounds sub-second values half-up (measured on dolt 2.3.3: .750000 reads
back as the next second).
refs be-mu248 / be-hs42e.8 (gastownhall/beads#6675 review 5328477668)
* test(schema): pin 0069 on the raw-SQL path existing stores take
Round 1 of the review noted that the widen was pinned as bytes only on the
path existing stores take: every live test in internal/storage/schema goes
through the CLI-bundle override, so deleting the guarded blocks from the
.up.sql turned only the byte pin red. With the widen now in its own
migration, that path matters more than before. A store that applied main's
0068 is at precision 0, and 0069's DATETIME_PRECISION-guarded PREPARE blocks
are the only thing that moves it to DATETIME(6).
TestMigration0069WidensPrecisionZeroStoreAsRawSQL (integration tag, beside
the 0067 replay test) turns the reviewer's manual probe into a test, run
through the same runMigrationSQL executor as the pr4107 replay harness:
- the raw down narrows both columns to datetime;
- the raw up re-widens both to datetime(6), and a whole-second row written
at precision 0 reads back unchanged, which is the up header's
"widening is lossless" claim;
- a second raw up is a clean no-op;
- a .750000 insert then reads back intact.
Mutants, each red: removing the change_at guarded block from the up file
fails this test (and TestCLIBundleMatchesRuntimeCommittedSchema), and
making the down's guards never fire fails it at the post-down check.
refs be-mu248 / be-hs42e.8 (gastownhall/beads#6675, review round 1 note 1)
---------
Co-authored-by: Julian Knutsen <julianknutsen@users.noreply.github.com>
Maintainer-side re-port of realies' #4288 (substance-approved by maphew
2026-07-27), redone against current main per bd-oibnz. The consolidation
half of the original PR (issues.go hand-rolled DOLT_ADD/DOLT_COMMIT sites
onto doltAddAndCommitInTx) already landed independently via #5341, so this
carries the remaining half: the empty-commit guards.
An idempotent no-op write (INSERT IGNORE duplicate, ON DUPLICATE KEY
re-writing the same value, UPDATE matching nothing) leaves its table clean,
so the selective DOLT_ADD stages nothing and DOLT_COMMIT('-m') fails
server-side with a 'nothing to commit' warning — flooding dolt.log at
reconcile cadence.
- issueops.HasStagedChanges: reports whether dolt_status has staged rows —
exactly what a '-m' commit would include.
- versioncontrolops.StageAndCommit: global HasPendingChanges fast-path
before staging, plus the precise HasStagedChanges guard before commit
(an unrelated dirty table must not trigger an empty '-m' commit).
- DoltStore.doltAddAndCommit / doltAddAndCommitInTx: staged-set guard
before commit (these stage a fixed table list, so only the staged check
applies). A guard-read failure in doltAddAndCommit is a plain error, not
a publication failure: nothing committed, nothing indeterminate.
- Tests: sqlmock discriminators asserting DOLT_COMMIT is NOT issued on an
empty staged set (they fail if a guard is reverted), integration
regression tests for no-op dependency writes and claim/close
over-suppression, and existing commit-boundary/draincall/phase harnesses
taught to serve the two new dolt_status guard reads.
Co-authored-by: realies <5107843+realies@users.noreply.github.com>
* feat(recompute-blocked): port to proxied-server mode (bd-04vav)
`bd recompute-blocked` stops refusing proxied-server mode. It is the
mode-independent repair for a stale is_blocked column (bd-6dnrw.37) and
wh-bridge-sync's remedy after a cross-machine merge, so a constellation
running on the proxied plane without it has no way to repair the flag
`bd ready` trusts.
Parity is by construction rather than by assertion: the whole
in-transaction body (dirty-graph guard + fixpoint recompute), the commit
message, and the staging set now live in ONE place,
versioncontrolops.GuardedRecomputeAllBlockedInTx /
BlockedRecomputeCommitMsg / BlockedRecomputeStagedTables, which the
embedded store, the server store and the new proxied route all call. The
CLI's two rendered branches are likewise one function shared by both
routes. Nothing about the repair's semantics is restated per mode; what
differs is only how each mode gets its connection.
The proxied route runs on a PINNED non-transactional connection
(uow.MaintenanceProvider, as compact/gc already do) rather than through
uow.RunTx*, for two reasons specific to this command: the post-commit
DOLT_ADD/DOLT_COMMIT are stored procedures Dolt refuses inside an
explicit transaction, and the uow commit path stages with '-Am' while
this repair must stage `issues` ALONE — a commit whose entire content is
a derived flag has no business sweeping an unrelated dirty working set,
which is the very thing the read-side guard exists to prevent.
StageAndCommit grows an empty-author form for that call: proxied-mode
commits are unauthored by design (uow.Tx.Commit passes no --author), and
an empty '--author' argument would be malformed rather than
unattributed.
admin cleanup stays gated. The 2026-08-04 recon on bd-04vav found it has
no wheelhouse call sites, so porting it would be untested surface area
bought for nobody.
TestProxiedServerRecomputeBlocked is a cross-mode oracle: the same
corrupt-then-repair scenario is replayed against a classic embedded
workspace and a proxied one, and every observable — both rendered
branches and the corrected-row count — must match, with the shared
values additionally pinned so a symmetric regression in both modes still
fails. It also covers what wh-bridge-sync actually depends on
(idempotency, honest exit codes), that a no-op repair mints no Dolt
commit, and that the dirty-graph refusal survived the port.
Part of bd-vxavz (proxied-server capability parity).
* test(delete/prune/purge): cross-mode cascade parity, and a data-loss divergence (bd-04vav)
The verification half of F7. Proxied `bd delete` "always cascades"
(--cascade is refused outright) while classic cascades only when asked,
so the question the constellation needs answered before cutover is not
"is the flag there" but "does the cascade reach anything classic would
have left alone" — on the shapes the wheelhouse actually runs.
TestProxiedServerCascadeParity replays three of them against a classic
embedded workspace AND a proxied one and compares the outcomes, so a
difference is reported as a difference rather than as one mode's test
failing alone: wh-gate-sweep's delivery-ledger purge, the wisp-decay
close + `purge --pattern '*' --force` pair, and a reference-aware durable
`prune` sweep.
FINDING — proxied delete of a gate destroys the bead it gated.
`bd gate create --blocks <target>` records the edge as target
DEPENDS-ON gate, so the gated bead is a DEPENDENT of the gate row. On the
proxied plane wh-gate-sweep's `bd delete <gate> --force` therefore
deletes the target and everything downstream of it; classic leaves both
standing. Measured, not inferred: proxied {gateGone:true,
targetSurvives:false, siblingSurvives:false} vs classic {true, true,
true}. This is a shared-server cutover blocker, and the fix is a design
call on what --cascade should mean in proxied mode (three existing
proxied delete suites deliberately pin today's unconditional cascade), so
it is filed rather than smuggled in here.
The subtest CHARACTERIZES the defect: the classic half pins the correct
behavior, the proxied half pins exactly today's blast radius, and the
comparison is logged loudly. The suite stays green while the divergence
is open and fails the moment the damage changes in EITHER direction —
including when it is fixed, at which point the expectation is flipped to
match classic and the paragraph explaining it goes away.
Wisp decay and prune agree across modes with no divergence: the closed
wisp is reclaimed while a durable closed bead and an open wisp survive
(purge is ephemeral-only and closed-only), and prune protects a closed
bead an open bead still cites.
Part of bd-vxavz (proxied-server capability parity).