The stack comes out — Kanban/Git/ deleted wholesale, ten thousand lines into history
Step 5 of strategy/01-git-excision.md: the seventeen dead engine files and the five remaining git test suites go (InertGitTests stays — the naming footgun is a Storage keeper). Two rescues ride ahead of the delete: HarvestedReceipt relocates to EchoLedger (the harvest surface outlives its git consumer; foundation for the deferred journal), and commentTimestamps joins the narrator it always served. The provider-swap purge test re-expresses over a git-free fake; the duplicate-id ladder keeps every pure historyRank pin and loses only the two ranker-driven ones. Resurrection point: tag pre-git-excision. 2,707 tests green. Claude-Session: https://claude.ai/code/session_014PtZdPwqZuqEDLc6wZMtEy
This commit is contained in:
@@ -16,6 +16,25 @@ import Testing
|
||||
/// The fine steps' own round trips are `UndoWriteTests`' and `CommentWriteTests`'; the provider
|
||||
/// grammar is `HistoryProviderTests`'.
|
||||
|
||||
// MARK: - A substrate that keeps no steps
|
||||
|
||||
/// **A provider that retires every step on arrival** — the minimal fake `HistoryProviding.backedContent`'s
|
||||
/// own doc names ("a substrate that keeps no steps... and a test fake's"). `register(_:)` runs the
|
||||
/// step's retirement immediately and keeps nothing, which is what makes "purge rides the close flush"
|
||||
/// true over such a substrate with no tier check anywhere in the call path.
|
||||
@MainActor
|
||||
private final class NoBackingHistoryProvider: HistoryProviding {
|
||||
var canUndo = false
|
||||
var canRedo = false
|
||||
var undoActionName: String?
|
||||
var redoActionName: String?
|
||||
|
||||
func register(_ step: HistoryStep) { step.retirement?.run() }
|
||||
func undo() {}
|
||||
func redo() {}
|
||||
func clear() {}
|
||||
}
|
||||
|
||||
// MARK: - The window under test
|
||||
|
||||
@MainActor
|
||||
@@ -735,7 +754,7 @@ struct CardSessionPurgeTests {
|
||||
defer { fixture.tearDown() }
|
||||
let (window, card) = try await closedWithADeletedComment(fixture)
|
||||
|
||||
// `AppModel`'s teardown, and the add-git swap, both do exactly this.
|
||||
// `AppModel`'s teardown does exactly this.
|
||||
window.board.clear()
|
||||
#expect(try fixture.entryNames("\(card)/comments/.trash").isEmpty)
|
||||
}
|
||||
@@ -823,10 +842,11 @@ struct CardSessionPurgeTests {
|
||||
try fixture.item(path, commentText())
|
||||
let window = try makeWindow(fixture)
|
||||
window.comments.reload()
|
||||
// The git provider drops every registration (its substrate is the commit trail) and retires
|
||||
// it on the way past — which is what makes "purge rides the close flush" true on Pro with no
|
||||
// tier check at any call site. Bound directly here: `register` reads no repository.
|
||||
window.store.history = GitHistoryProvider(boardRoot: fixture.root)
|
||||
// A substrate that keeps no steps drops every registration and retires it on the way past —
|
||||
// which is what makes "purge rides the close flush" true structurally, with no tier check at
|
||||
// any call site. `history` is weak, so the fake is held locally for the assertion's duration.
|
||||
let noBackingProvider = NoBackingHistoryProvider()
|
||||
window.store.history = noBackingProvider
|
||||
|
||||
window.comments.delete(ItemID(rawValue: CommentIdent.one))
|
||||
await window.session.endSession()
|
||||
|
||||
Reference in New Issue
Block a user