Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Scripts/Fixtures/test-suite-contract-ledger.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ root/RepoPromptTests.AgentModeViewModelInactiveRefreshTests/testActivationRepubl
root/RepoPromptTests.AgentModeViewModelInactiveRefreshTests/testActiveCodexAssistantDeltaUsesPresentationOnlyRefresh root Tests/RepoPromptTests/AgentMode/AgentModeViewModelInactiveRefreshTests.swift RepoPromptTests.AgentModeViewModelInactiveRefreshTests testActiveCodexAssistantDeltaUsesPresentationOnlyRefresh AgentMode unreviewed unreviewed root_swiftpm routine 1 unreviewed unreviewed 0.005000 unreviewed retain_pending_review 0 initial census source line 376
root/RepoPromptTests.AgentModeViewModelInactiveRefreshTests/testActiveGenericAssistantDeltaPublishesTranscriptWithoutFullBindingSync root Tests/RepoPromptTests/AgentMode/AgentModeViewModelInactiveRefreshTests.swift RepoPromptTests.AgentModeViewModelInactiveRefreshTests testActiveGenericAssistantDeltaPublishesTranscriptWithoutFullBindingSync AgentMode unreviewed unreviewed root_swiftpm routine 1 unreviewed unreviewed 0.003000 unreviewed retain_pending_review 0 initial census source line 349
root/RepoPromptTests.AgentModeViewModelInactiveRefreshTests/testActiveRefreshCompactsSummaryOnlyToolResultSourceWhilePreservingRawRenderPayload root Tests/RepoPromptTests/AgentMode/AgentModeViewModelInactiveRefreshTests.swift RepoPromptTests.AgentModeViewModelInactiveRefreshTests testActiveRefreshCompactsSummaryOnlyToolResultSourceWhilePreservingRawRenderPayload AgentMode unreviewed unreviewed root_swiftpm routine 1 unreviewed unreviewed 0.003000 unreviewed retain_pending_review 0 initial census source line 7
root/RepoPromptTests.AgentModeViewModelInactiveRefreshTests/testAmbiguousPersistentBindingFailsRoutingWithoutLeakingCandidates root Tests/RepoPromptTests/AgentMode/AgentModeViewModelInactiveRefreshTests.swift RepoPromptTests.AgentModeViewModelInactiveRefreshTests testAmbiguousPersistentBindingFailsRoutingWithoutLeakingCandidates AgentMode unreviewed unreviewed root_swiftpm routine 1 unreviewed unreviewed 0.001500 unreviewed retain_pending_review 0 initial census source line 597
root/RepoPromptTests.AgentModeViewModelInactiveRefreshTests/testAmbiguousPersistentBindingFailsRoutingWithoutLeakingCandidates root Tests/RepoPromptTests/AgentMode/AgentModeViewModelInactiveRefreshTests.swift RepoPromptTests.AgentModeViewModelInactiveRefreshTests testAmbiguousPersistentBindingFailsRoutingWithoutLeakingCandidates AgentMode agent_mode.persistent_binding.ambiguous_worktree_state ambiguous_routing,worktree_binding_state,persistent_binding_resolution,single_scan,no_candidate_leak,missing_worktree_state deterministic_unit root_swiftpm routine 2 Ambiguous and missing persistent session claims return unavailable worktree state after exactly one authority scan, and ambiguous routing errors disclose no candidate tab IDs. critical 0.001500 in_memory_view_model retain 0 fail-closed ambiguous binding authority and bounded resolution work
root/RepoPromptTests.AgentModeViewModelInactiveRefreshTests/testAssistantPresentationRejectsStaleRevisionGenerationAndTabOwnership root Tests/RepoPromptTests/AgentMode/AgentModeViewModelInactiveRefreshTests.swift RepoPromptTests.AgentModeViewModelInactiveRefreshTests testAssistantPresentationRejectsStaleRevisionGenerationAndTabOwnership AgentMode unreviewed unreviewed root_swiftpm routine 1 unreviewed unreviewed 0.003000 unreviewed retain_pending_review 0 initial census source line 425
root/RepoPromptTests.AgentModeViewModelInactiveRefreshTests/testAssistantPresentationRequiresAuthoritativeHydratedBindingGeneration root Tests/RepoPromptTests/AgentMode/AgentModeViewModelInactiveRefreshTests.swift RepoPromptTests.AgentModeViewModelInactiveRefreshTests testAssistantPresentationRequiresAuthoritativeHydratedBindingGeneration AgentMode unreviewed unreviewed root_swiftpm routine 1 unreviewed unreviewed 0.004000 unreviewed retain_pending_review 0 initial census source line 473
root/RepoPromptTests.AgentModeViewModelInactiveRefreshTests/testAutoArchiveSkipsMutationAfterSameWorkspaceReactivation root Tests/RepoPromptTests/AgentMode/AgentModeViewModelInactiveRefreshTests.swift RepoPromptTests.AgentModeViewModelInactiveRefreshTests testAutoArchiveSkipsMutationAfterSameWorkspaceReactivation AgentMode/SidebarArchive agent.sidebar_archive.owner_revalidation same_workspace_reactivation;awaited_mutation_guard async_state_machine root_swiftpm routine 1 A newer activation epoch for the same workspace invalidates an in-flight archive before any compose-tab or stash mutation high 0.006500 test_case retain 0 PR #246 pair-review archive ownership regression
Expand Down Expand Up @@ -2114,7 +2114,7 @@ root/RepoPromptTests.PathMatchingRecoveryTests/testMovePathResolverRejectsAmbigu
root/RepoPromptTests.PathMatchingRecoveryTests/testUnicodeAndCaseInsensitiveLookupPreserveStoredRelativePath root Tests/RepoPromptTests/WorkspaceContext/PathMatching/PathMatchingRecoveryTests.swift RepoPromptTests.PathMatchingRecoveryTests testUnicodeAndCaseInsensitiveLookupPreserveStoredRelativePath WorkspaceContext unreviewed unreviewed root_swiftpm routine 1 unreviewed unreviewed 0.000000 unreviewed retain_pending_review 0 initial census source line 21
root/RepoPromptTests.PathSearchIndexRecoveryTests/testSearchMatchesFilenameSubpathTokensAndPublishesDeterministicRankMetadata root Tests/RepoPromptTests/WorkspaceContext/Search/PathSearchIndexRecoveryTests.swift RepoPromptTests.PathSearchIndexRecoveryTests testSearchMatchesFilenameSubpathTokensAndPublishesDeterministicRankMetadata WorkspaceContext unreviewed unreviewed root_swiftpm routine 1 unreviewed unreviewed 0.005000 unreviewed retain_pending_review 0 initial census source line 5
root/RepoPromptTests.PersistentAgentModeMCPReadFileConnectionTests/testAgentOwnedExplicitSetPersistsForIndependentCanonicalLookup root Tests/RepoPromptTests/MCP/Control/PersistentAgentModeMCPReadFileConnectionTests.swift RepoPromptTests.PersistentAgentModeMCPReadFileConnectionTests testAgentOwnedExplicitSetPersistsForIndependentCanonicalLookup MCP unreviewed unreviewed root_swiftpm routine 1 unreviewed unreviewed 0.541500 unreviewed retain_pending_review 0 initial census source line 28
root/RepoPromptTests.PersistentAgentModeMCPReadFileConnectionTests/testAgentOwnedHiddenWorktreeWatcherRebases6500LineReadSlicesBeforePostEditReads root Tests/RepoPromptTests/MCP/Control/PersistentAgentModeMCPReadFileConnectionTests.swift RepoPromptTests.PersistentAgentModeMCPReadFileConnectionTests testAgentOwnedHiddenWorktreeWatcherRebases6500LineReadSlicesBeforePostEditReads MCP mcp.hidden_session_worktree.read_slice_watcher_rebase persistent_agent,read_file,6500_lines,watcher_rebase,physical_logical_mapping,full_selection_dominance,no_hidden_ui_tree,stale_deferred_commit,partition_cas deterministic_integration root_swiftpm routine 5 PersistentAgentModeMCPConnectionFixture,SessionWorktreeOwnershipFixture,WorkspaceSelectionSliceFixture Three canonical read_file slices rebase exactly after atomic replacement; a gated successor cannot resurrect a concurrently removed logical target or physical partition entry; the hidden root never projects into UI and later reads cannot downgrade a full selection. critical 1.386500 socketpair,temporary_worktree,actor_store,watcher_publisher,async_tasks test_fixture+explicit_root_unload retain 0 hidden session-root watcher rebase, stale deferred partition/target fencing, and full-file-wins integration
root/RepoPromptTests.PersistentAgentModeMCPReadFileConnectionTests/testAgentOwnedHiddenWorktreeWatcherRebases6500LineReadSlicesBeforePostEditReads root Tests/RepoPromptTests/MCP/Control/PersistentAgentModeMCPReadFileConnectionTests.swift RepoPromptTests.PersistentAgentModeMCPReadFileConnectionTests testAgentOwnedHiddenWorktreeWatcherRebases6500LineReadSlicesBeforePostEditReads MCP mcp.hidden_session_worktree.read_slice_watcher_rebase persistent_agent,read_file,6500_lines,watcher_rebase,physical_logical_mapping,full_selection_dominance,no_hidden_ui_tree,stale_deferred_commit,partition_cas,per_event_binding_resolution,keyed_applied_index_lookup deterministic_integration root_swiftpm routine 6 PersistentAgentModeMCPConnectionFixture,SessionWorktreeOwnershipFixture,WorkspaceSelectionSliceFixture Three canonical read_file slices rebase exactly after atomic replacement; a gated successor cannot resurrect a concurrently removed logical target or physical partition entry; the hidden root never projects into UI and later reads cannot downgrade a full selection; a multi-file applied-index event uses one binding-provider pass, one keyed record lookup, and zero root snapshots. critical 1.386500 socketpair,temporary_worktree,actor_store,watcher_publisher,async_tasks test_fixture+explicit_root_unload retain 0 hidden session-root watcher rebase, stale deferred partition/target fencing, full-file-wins integration, and bounded per-event authority work
root/RepoPromptTests.PersistentAgentModeMCPReadFileConnectionTests/testAgentOwnedWorktreeContentSearchCarriesPhysicalCoverageAndPreservesFullSelections root Tests/RepoPromptTests/MCP/Control/PersistentAgentModeMCPReadFileConnectionTests.swift RepoPromptTests.PersistentAgentModeMCPReadFileConnectionTests testAgentOwnedWorktreeContentSearchCarriesPhysicalCoverageAndPreservesFullSelections MCP mcp.hidden_session_worktree.search_context_watcher_rebase persistent_agent,file_search,context_lines,physical_coverage_identity,no_path_leak,watcher_rebase,full_selection_dominance deterministic_integration root_swiftpm routine 5 PersistentAgentModeMCPConnectionFixture,SessionWorktreeOwnershipFixture,WorkspaceSelectionSliceFixture Watcher-created worktree content is searchable without physical-path disclosure; context_lines=2 selects exact 2-6/13-17/25-29 logical slices, atomic replacement rebases them to 6-10/20-24/30-34, unrelated and matching full selections remain full. critical 0.821500 socketpair,temporary_worktree,actor_store,watcher_publisher,async_tasks test_fixture+explicit_session_owner_release retain 0 search physical coverage sidecar, hidden watcher rebase, and full-file-wins integration
root/RepoPromptTests.PersistentAgentModeMCPReadFileConnectionTests/testCodexAgentModeLeaseRetainsOneMCPServerSessionAcrossSerialExactAbsoluteReadFileCalls root Tests/RepoPromptTests/MCP/Control/PersistentAgentModeMCPReadFileConnectionTests.swift RepoPromptTests.PersistentAgentModeMCPReadFileConnectionTests testCodexAgentModeLeaseRetainsOneMCPServerSessionAcrossSerialExactAbsoluteReadFileCalls MCP unreviewed unreviewed root_swiftpm routine 1 unreviewed unreviewed unreviewed retain_pending_review 0 initial census source line 59
root/RepoPromptTests.PersistentAgentModeMCPReadFileConnectionTests/testManageSelectionGetStopsAtCanonicalHandoverWhileMirrorBlocked root Tests/RepoPromptTests/MCP/Control/PersistentAgentModeMCPReadFileConnectionTests.swift RepoPromptTests.PersistentAgentModeMCPReadFileConnectionTests testManageSelectionGetStopsAtCanonicalHandoverWhileMirrorBlocked MCP unreviewed unreviewed root_swiftpm routine 1 unreviewed unreviewed 0.333500 unreviewed retain_pending_review 0 initial census source line 49
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,14 @@ final class AgentModeViewModel: ObservableObject {
persistentBindingResolution(for: sessionID)
}

func test_resetPersistentBindingResolutionCallCount() {
persistentBindingResolutionCallCountForTesting = 0
}

var test_persistentBindingResolutionCallCount: Int {
persistentBindingResolutionCallCountForTesting
}

func test_bindingTransitionToken(for session: TabSession) -> PersistentBindingTransitionToken {
session.persistentBindingTransitionToken()
}
Expand Down Expand Up @@ -3429,7 +3437,14 @@ final class AgentModeViewModel: ObservableObject {
)?.sessionID
}

#if DEBUG
private var persistentBindingResolutionCallCountForTesting = 0
#endif

private func persistentBindingResolution(for sessionID: UUID) -> PersistentBindingResolution {
#if DEBUG
persistentBindingResolutionCallCountForTesting += 1
#endif
var authoritativeCandidates = Set<UUID>()
var conflictingTabIDs = Set<UUID>()
let liveClaims = Dictionary(uniqueKeysWithValues: sessions.values.compactMap { session in
Expand Down Expand Up @@ -5470,20 +5485,21 @@ final class AgentModeViewModel: ObservableObject {
forAgentSessionID sessionID: UUID,
tabID: UUID? = nil
) -> AgentSessionWorktreeBindingState {
do {
if let live = try authoritativeLiveSession(for: sessionID) {
switch persistentBindingResolution(for: sessionID) {
case let .unique(resolvedTabID):
if let live = sessions[resolvedTabID], live.activeAgentSessionID == sessionID {
return live.hasLoadedPersistedState ? .hydrated(live.worktreeBindings) : .unhydrated
}
if let tabID, let live = sessions[tabID], live.activeAgentSessionID == sessionID {
return live.hasLoadedPersistedState ? .hydrated(live.worktreeBindings) : .unhydrated
}
} catch {
return .unavailable
}
if let tabID, let live = sessions[tabID], live.activeAgentSessionID == sessionID {
return live.hasLoadedPersistedState ? .hydrated(live.worktreeBindings) : .unhydrated
}
switch persistentBindingResolution(for: sessionID) {
case .unique:
return .unhydrated
case .notFound, .ambiguous:
case .notFound:
if let tabID, let live = sessions[tabID], live.activeAgentSessionID == sessionID {
return live.hasLoadedPersistedState ? .hydrated(live.worktreeBindings) : .unhydrated
}
return .unavailable
case .ambiguous:
return .unavailable
}
}
Expand Down
Loading
Loading