rdmpw3275m-changelog-20260921-1334-resolve-feat-20260905-14-worktree-checkpoint-production-wiring
Summary: Wired the git worktree isolation and
ephemeral checkpoint engine (ECSWorktreeManager, aliased as
TyrellWorktreeEngine / CheckpointEngine) to
production callers across tyrelld HTTP lease API, turn
boundary checkpointing with zero staging pollution,
FleetChatView 1-click turn revert, and orchestrator orphan
snapshotting, resolving FEAT-20260905-14.
- Host:
rdmpw3275m(work authored in linked worktree and integrated on canonical hubrdmsm4x) - Ticket:
FEAT-20260905-14(RESOLVED) - Parent Epic:
EPIC-20260905-01(T3code Apple-Native Adaptation) - Related Tickets:
FEAT-20260903-02
1. Scope & Architecture Changes
Reconciled Naming & Typealiases (
Sources/TyrellCore/Worktree/WorktreeModels.swift):- Reconciled
FEAT-20260903-02andFEATURE_MATRIX.mdspecifications withECSWorktreeManagerby declaring:public typealias TyrellWorktreeEngine = ECSWorktreeManager public typealias CheckpointEngine = ECSWorktreeManager - Added strongly-typed Codable request/response models:
AllocateWorktreeRequestReleaseWorktreeRequestReleaseWorktreeResponseCaptureCheckpointRequestRestoreCheckpointRequestRestoreCheckpointResponseSnapshotOrphanRequestWorktreeDiffResponseWorktreeAPIError
- Reconciled
Worktree Lease API on
tyrelld(Sources/tyrelld/WorktreeRoutes.swift,Daemon.swift):- Registered endpoints under
/api/worktrees/*secured byServerLogic.authorized:GET /api/worktrees: lists all active worktrees.POST /api/worktrees/allocate: allocates an isolated worktree under~/.tyrell/worktreeswith merge-base anchoring and submodule updates.POST /api/worktrees/release: decrements refCount and purges worktree from disk when 0.POST /api/worktrees/checkpoint: out-of-band turn boundary checkpoint intorefs/tyrell/checkpoints/<session>/<turn>.POST /api/worktrees/restore: atomic restore viagit restore --worktree --stagedandgit clean -fd.GET /api/worktrees/diff: returns unified diff between checkpoint commits or working tree.POST /api/worktrees/snapshot-orphan: snapshots an orphan dirty worktree.
- Registered endpoints under
Turn Boundary Checkpointing & Staging Preservation (
Sources/TyrellCore/Worktree/ECSWorktreeManager.swift):- Added
sanitizeGitRefComponent(_:)adhering strictly to git ref formatting rules (sanitizing colons:, spaces,~,^,?,*,[,],\,..,@{), guaranteeing real conversation identifiers likedomain:tyrell.local:generalsucceed duringgit update-ref. - Verified that
captureCheckpointuses an isolatedGIT_INDEX_FILE, guaranteeing that the developer's.git/indexis byte-identical before and after checkpoint capture (verified via SHA256 comparison).
- Added
1-Click Turn Revert in GUI (
Sources/tyrell-app/ChatViewModel.swift,FleetChatView.swift):ChatViewModel:- Added
@Published var activeWorktreeURL: URL?,checkpointsByTurn,checkpointsByMessageID,lastRestoredCommitOID, andrevertNotice. - Added
captureTurnCheckpoint(messageID:turnIndex:worktreeManager:), automatically invoked at turn boundaries when sending messages with an active worktree. - Added
revertCheckpoint(_:worktreeManager:)andrevertTurn(for:worktreeManager:)performing atomic rollback and state updates.
- Added
FleetChatView:- Added 1-click turn revert button
(
arrow.uturn.backward.circle.fill) toChatMessageRowfor any turn with an associated checkpoint. - Added feedback banner with dismiss affordance when a turn is reverted.
- Added 1-click turn revert button
(
Orchestrator Orphan Dirty Worktree Snapshotting (
Sources/TyrellCore/Approvals/SessionHoldOrchestrator.swift):- Added
snapshotOrphanDirtyWorktree(worktreeURL:sessionID:reason:worktreeManager:)onSessionHoldOrchestratorandsnapshotOrphanWorktreeonECSWorktreeManager, replacing externalworktree_snapshot.zsh savecalls per PRD §4.3 Rule 3.
- Added
Documentation & Capability Status Matrix (
FEATURE_MATRIX.md,SESSION-STATE.md):- Updated
FEATURE_MATRIX.mdmarkingFEAT-20260903-02/FEAT-20260905-14as Shipped with full implementation subsystem links and verification evidence. - Recorded checkpoint in
SESSION-STATE.md.
- Updated
2. Verification Evidence & Test Execution
Tests/TyrellCoreTests/WorktreeLeaseAndCheckpointIntegrationTests.swift(NEW):testTypealiasesAndPayloadSerialization: VerifiedTyrellWorktreeEngine&CheckpointEnginealiases and payload round-trips.testTurnBoundaryCheckpointDoesNotAlterDeveloperIndex: Verified out-of-band index isolation (GIT_INDEX_FILE), proving SHA256 of.git/indexis byte-identical before and after checkpoint capture.testBidirectionalRollbackRestorationAndCorruptCommitRejection: Verified both directions (successful rollback restores exact file contents and purges rogue files, while bogus commit OID throwsWorktreeError.commandFailedrather than silently succeeding).testOrphanDirtyWorktreeSnapshottingViaCheckpointEngine: Verified orchestrator snapshotting into hidden checkpoint refs.testFullAllocateCheckpointCorruptRestoreReleaseLifecycle: Verified full end-to-end lifecycle.testDefaultWorktreeRootLocationAndLeaseAllocation: Verified allocation under~/.tyrell/worktrees.
Tests/tyrell-appTests/ChatTurnCheckpointTests.swift(NEW):- Verified
ChatViewModelturn checkpointing and 1-click revert.
- Verified
- Full regression suite execution:
WorktreeEngineTests: 11/11 tests passed.WorktreeLeaseAndCheckpointIntegrationTests: 6/6 tests passed.ChatTurnCheckpointTests: 1/1 test passed.AgentsRosterLiveTelemetryTests: 6/6 tests passed.ChatStreamAdoptionTests: 5/5 tests passed.- Total Worktree & App test suites passing: 36 tests across 5 suites.
3. Git Integration & Delivery
- Integrated into canonical repository
rdmsm4x:~/dev/apps/Tyrellonmain:- Feature commit:
272e5d5 - Session state commit:
4036565
- Feature commit:
- Pushed to both remotes:
fleet(git.ecs0.net:git/apps/Tyrell.git)backup(github.com/richhdoty/rdmsm4x-dev-apps-tyrell.git)
- Ticket
FEAT-20260905-14resolved via~/bin/ticket resolve. - Fleet message bus broadcast sent:
20260921-133333-FA8A39EF.