Repository navigation
test: audit redundant owner-boundary coverage (1000 → 886) - #576
Merged
Merged
Conversation
Consolidate 101 redundant test declarations and retire 14 duplicate or dead-path tests, preserving their useful assertions at the owning boundaries. Repair vacuous test drivers and remove obsolete support and unused workspace path caching. Net declaration reduction is 115 of 1000 (11.5%); the requested 20% target remains unmet.
Native multipath can select global interfaces between in-process peers. Keep exact protocol and connection checks without assuming LAN selection, and preserve the LAN assertion on real QUIC endpoints bound to IPv4 loopback. The original fixture failed 7 of 20 fixed runs; both repaired keepers passed 20 of 20, three transport-suite runs passed, and the restored macOS workspace passed 868 tests with 6 skipped. No production behavior or test seam changes.
Tryanks
marked this pull request as ready for review
October 3, 2026 01:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This audit removes redundant test layers and transfers their useful assertions to the production boundary that owns each behavior. It also removes dead workspace-path canonicalization and obsolete test-only adapters/accessors. No product bug fix, dependency change, protocol change or visual redesign is included.
The workspace was audited at
464775ea59b9ad7e4149e2bcb55d8804d25e0a73, following.agents/skills/test-audit. Every one of the 1,000 declarations received a read-only owner/caller/history/CI ledger entry before cutover; seven boundary groups received independent preservation review.Result: 1,000 → 886 declarations, net −114 (11.4%). The requested ≥20% target is not met. The audit retired 115 declarations; the CI follow-up adds one independently owned native-path classification test. Reaching 20% would require 86 further net deletions, which have not been justified by this audit. Three conditional candidates were retained because their exact partial/unpainted-selection and residency guarantees had no proven stronger replacement. Eight keeper renames are excluded from the deletion count. Case-table rows remain independent input/assertion cases, not additional declarations.
Audit-commit physical source lines at
60ef6427, before the CI follow-up (comments and blank lines included; inline test bodies and test-only support classified separately using Rust syntax trees):The follow-up and final review add a net 49 physical lines across tests and test support, with no production-source change relative to the audit table. Final declarations are 884 Rust test declarations plus two existing Node test cases. The retirement map still lists all 115 retired declarations; the new keeper accounts for the net reduction of 114.
Production simplifications remove the unused services workspace-root canonicalization/cache, the terminal cwd override chain, the unused work-count/rewind accessors and queued-message conversion, and transparent UI test wrappers. Shared runtime test-support remains because retained real-host tests still use it. The Markdown residency candidate wrapper becomes its existing vector; this does not change residency policy.
Useful assertions now run through recorded provider translation/native launch, actual runtime commands and scripted providers, persisted imports/search/forks, transport restart/preferences/HTTP/mux, and real rendered UI/navigation/selection. Literal wire compatibility, permission/path boundaries, platform-specific behavior, defaults and credible independent regressions remain. The existing desktop title-layout probe remains: replacing it would have required a new production-only-for-tests selector. Terminal cache assertions are honestly named for output freshness, without claiming cache-hit proof.
Preservation repairs and controls
Independent review found lost or insufficiently discriminating proof for a line-limited MCP prefix's final newline, direct persisted device-detail reload, exact terminal wrap positions, multiple clipped syntax spans and nonzero ordinary-prepend offset. Existing keepers were strengthened in place. A local quota-order fixture was reordered so its assertion actually observes the ordering it describes. All corresponding deliberate local owner mutations failed the named keeper; mutation files are restored byte-for-byte and no mutant is committed. Additional controls exercise plan replacement/clearing and terminal style/history identity.
Validation
All locally available required gates passed on the original audit commit
60ef6427(Rust 1.99.0, Ubuntu 24.04); final follow-up evidence is recorded below:cargo fmt --all --checkandgit diff --check.xvfb-run -a cargo nextest run --workspace --locked --no-fail-fast: 852 passed, 6 skipped, 0 failed, no leaks (98.129s execution).cargo clippy --workspace --all-targets --locked -- -D warnings.cargo machete.RUSTFLAGS='-D warnings' cargo check -p tcode-web --target wasm32-unknown-unknown --locked.mcp_line_boundarybounded_output_continuation_round_trips_without_mutationdevice_details_reloadmobile_preferences_preserve_device_identity_last_host_and_unknown_fieldsstored_output_wraprendering_stored_output_rewraps_at_the_requested_widthlocal_body_limit_ordermanifest_and_pkarr_store_over_httpplan_replacementplan_updated_tracks_latest_stepsplan_explanation_clearplan_updated_tracks_latest_stepsterminal_style_remappingapplying_a_delta_replaces_rows_and_trims_history_at_the_capterminal_history_endapplying_a_delta_replaces_rows_and_trims_history_at_the_capdiff_multispan_clippingfull_text_pipeline_builds_expanded_rows_collapsed_context_and_word_runsordinary_prepend_pixel_offsetjump_to_latest_survives_unmeasured_historyFinal review is complete; all seven CI gates passed on the final reviewed commit
13d51cd6. The original audit commit passed all seven platform/hygiene CI jobs after its first-contributor workflow approval. The requested 20% reduction is not claimed. See the follow-up section below for final-head CI evidence.Baseline evidence: local Linux
cargo test --workspace --lockedunder Xvfb: 968 passed, 4 ignored, 0 failed; untouched browser auth Node test file passed. Pinned baseline CI run also passed Linux, macOS, Windows and compile/hygiene jobs. Baseline CI does not establish final candidate platform results.Live/platform gaps remain explicit: real ACP installation, credentialed provider usage, foreground PTY cwd, history benchmark and macOS desktop overlay slot were not exercised here. The mDNS test previously silently returned without
TCODE_TEST_MDNS=1; it now has an explicit ignored prerequisite instead of a misleading pass. Four Android input declarations are outside the desktop workspace and remain unchanged/unexecuted locally. Native OS permission/input behavior is not established by policy tests. The desktop, iOS, Android and Web candidate gates are verified in the PR CI environment. No ignored test is counted as deleted.Candidate failures resolved at the test
orchestrate_moves_untouched_astra_executors_to_sol_6no_wrap_widths_cover_unified_and_split_rowscompact_list_groups_sections_omits_inapplicable_and_folds_advancedcompact_families_keep_activity_order_indent_and_collapsethread_navigation_matches_displayed_rows_and_disclosuresThe two initial UI compile errors (variable spelling and boxed frame fixture) and one blank-line formatting issue were corrected mechanically. No assertion was loosened to accommodate changed product behavior. Async controls are repeated as fixed runs; any failure/leak is a failure, not retried into green.
Declaration-by-declaration retirement map
Cmeans the useful assertion was moved to the keeper before retirement;Dmeans the stronger existing proof or lack of production responsibility justified deletion. Keeper names below use their final names. These are owner-boundary evidence, not new ownership requirements for CONTRIBUTING.providers: 9 retired declarations
crates/agent/src/claude.rs::exit_plan_mode_captures_and_deniescrates/agent/src/claude.rs::compact_boundary_maps_to_context_compactedcrates/agent/src/claude.rs::empty_structured_patch_preserves_external_file_diffcrates/agent/src/claude.rs::can_use_tool_maps_to_approval_and_responsecrates/agent/src/claude.rs::permission_mode_flag_maps_all_modescrates/agent/src/codex.rs::maps_token_usage_from_last_and_totalcrates/agent/src/codex.rs::cancel_decision_maps_to_cancel_wire_stringcrates/agent/src/lib.rs::claude_mcp_config_json_shapecrates/agent/src/lib.rs::codex_config_override_is_valid_toml_streamable_httpdomain: 15 retired declarations
crates/client/src/lib.rs::retired_subscription_rejects_queued_reply_and_releases_generationcrates/client/src/pairing.rs::secrets_are_sixteen_bytes_as_unpadded_base64urlcrates/core/src/attachments.rs::generated_file_names_take_only_plain_extensionscrates/core/src/git.rs::fallback_merge_collapses_fragments_and_keeps_summed_statscrates/core/src/provider_colors.rs::custom_colors_fill_the_palette_before_reusing_slotscrates/core/src/provider_models.rs::reads_capabilities_from_catalog_descriptorscrates/core/src/relay.rs::relay_prompt_delimits_transcript_from_new_user_messagecrates/core/src/session.rs::fold_simple_claude_style_tracecrates/core/src/session.rs::review_comment_serialization_matches_prompt_formatcrates/core/src/session.rs::a_backward_timestamp_neither_underflows_nor_inflates_a_bucketcrates/core/src/session.rs::replaying_a_stored_turn_reproduces_the_live_breakdowncrates/core/src/session.rs::each_turn_gets_its_own_breakdowncrates/core/src/session.rs::served_model_without_1m_suffix_is_not_a_model_changecrates/core/src/settings.rs::orchestrate_preserves_every_customized_sol_shapecrates/core/src/settings.rs::orchestrate_migration_does_not_duplicate_existing_execution_sol_6runtime: 14 retired declarations
crates/runtime/src/app/tests.rs::dispatched_start_draft_emits_session_status_over_ndjsoncrates/runtime/src/app/tests.rs::host_start_folds_only_parents_with_visible_childrencrates/runtime/src/app/tests.rs::generated_titles_are_cleaned_and_boundedcrates/runtime/src/app/tests.rs::provider_diagnostics_with_zero_output_tokens_are_not_titlescrates/runtime/src/app/tests.rs::title_prompt_treats_the_request_as_bounded_json_datacrates/runtime/src/app/tests.rs::draft_send_creates_session_with_project_cwdcrates/runtime/src/app/tests.rs::launch_env_merges_secrets_for_sensitive_rowscrates/runtime/src/app/tests.rs::child_meta_links_parent_project_and_maps_effortcrates/runtime/src/app/tests.rs::dispatched_brief_carries_report_contract_footercrates/runtime/src/app/tests.rs::final_assistant_message_joins_all_blocks_of_the_final_outputcrates/runtime/src/app/tests.rs::steering_does_not_disturb_turn_accountingcrates/runtime/src/app/tests.rs::model_switch_restarts_live_providercrates/runtime/src/app/tests.rs::unread_requires_a_visit_before_the_latest_updatecrates/runtime/src/terminal/stored_output.rs::captured_output_normalizes_lines_wraps_within_supported_widths_and_keeps_stylesremote: 4 retired declarations
crates/traverse/src/identity.rs::host_identity_survives_restartcrates/traverse/src/identity.rs::device_identity_is_stable_and_records_its_detailscrates/traverse/tests/lan.rs::saved_addresses_are_the_whole_resolve_with_the_browse_offcrates/traverse-server/src/pkarr.rs::newer_packets_replace_older_ones_and_stale_puts_conflictservices_mcp: 9 retired declarations
crates/computer-use-mcp/src/outline.rs::safe_prefix_ends_on_utf8_and_line_boundariescrates/computer-use-mcp/src/state.rs::recent_actions_keep_only_the_latest_bounded_window_in_ordercrates/computer-use-mcp/src/state.rs::candidate_targets_include_only_interactive_nodes_with_assigned_refscrates/services/src/git.rs::read_git_branch_reads_headcrates/services/src/import/tests.rs::existing_ids_include_import_and_native_resume_cursorscrates/services/src/session_search.rs::query_matching_is_case_insensitive_and_generates_a_bounded_snippetcrates/services/src/store.rs::clone_events_copies_contents_and_missing_source_is_a_noopcrates/services/src/user_files.rs::relativizes_workspace_files_and_preserves_outside_pathscrates/services/src/user_files.rs::relativization_reuses_the_resolved_workspace_rootui_presentation: 35 retired declarations
crates/ui/src/chat/components/assistant.rs::plain_text_markdown_preserves_lines_and_indentationcrates/ui/src/chat/components/changed_files.rs::expanded_file_edit_renders_its_provider_diffcrates/ui/src/chat/mod.rs::second_old_activity_collapses_before_minimum_visibility_endscrates/ui/src/chat/mod.rs::returning_session_shows_only_latest_snapshot_activitycrates/ui/src/chat/mod.rs::collapsed_activity_stays_collapsed_after_visiting_another_sessioncrates/ui/src/chat/mod.rs::prepending_history_preserves_the_visible_turn_and_pixel_offsetcrates/ui/src/chat/mod.rs::incoming_page_replaces_scrollable_reservation_without_moving_contentcrates/ui/src/chat/mod.rs::small_markdown_is_resident_synchronouslycrates/ui/src/chat/model.rs::live_empty_turn_append_is_not_mistaken_for_history_prependcrates/ui/src/chat/model.rs::history_completing_the_only_partial_turn_prepends_instead_of_resettingcrates/ui/src/chat/model.rs::incremental_turn_index_matches_full_index_across_tail_and_reset_scenarioscrates/ui/src/chat/model.rs::subagent_status_change_remeasures_the_turncrates/ui/src/chat/model.rs::file_change_status_change_remeasures_the_turncrates/ui/src/chat/model.rs::steer_status_and_reordering_invalidate_the_virtualized_turn_rowcrates/ui/src/chat/model.rs::live_activity_run_keeps_five_entries_outside_the_folded_prefixcrates/ui/src/chat/residency.rs::candidate_filter_preserves_decisions_with_distant_tail_and_selectioncrates/ui/src/diff/algorithm.rs::line_diff_can_ignore_all_whitespacecrates/ui/src/diff/model.rs::sub_runs_clips_and_rebasescrates/ui/src/diff/model.rs::invisibles_remap_bytes_and_override_stylescrates/ui/src/diff/model.rs::expand_up_down_and_all_update_visibilitycrates/ui/src/diff/model.rs::split_pairing_aligns_equal_content_inside_change_blockcrates/ui/src/diff/model.rs::display_columns_accounts_for_tabs_and_wide_characterscrates/ui/src/diff/model.rs::reconstructs_matching_unified_patch_into_expandable_full_textcrates/ui/src/diff/parse.rs::bare_diffs_preserve_create_and_edit_line_numberscrates/ui/src/diff/parse.rs::unified_diffs_preserve_line_numbers_gaps_and_no_newline_markerscrates/ui/src/highlight.rs::jsx_arrow_function_highlights_without_panickingcrates/ui/src/markdown/state.rs::source_and_parsed_text_stay_coherentcrates/ui/src/markdown/state.rs::link_reference_definitions_force_a_full_reparsecrates/ui/src/markdown/state.rs::select_all_reads_blocks_that_were_never_paintedcrates/ui/src/markdown/state.rs::select_all_includes_code_and_table_textcrates/ui/src/markdown/view.rs::markdown_reports_intrinsic_height_inside_outer_listcrates/ui/src/markdown/view.rs::small_table_stretches_to_viewport_widthcrates/ui/src/markdown/view.rs::wide_table_track_contains_the_last_cellcrates/ui/src/markdown/view.rs::drag_across_paragraphs_copies_both_blockscrates/ui/src/markdown/view.rs::long_press_selects_word_then_drag_extends_selectionui_shell: 29 retired declarations
crates/ui/src/attachment.rs::detaching_one_mux_client_leaves_an_independent_client_attachedcrates/ui/src/i18n.rs::platform_system_locale_precedes_the_desktop_fallbackcrates/ui/src/pairing.rs::results_from_a_superseded_attempt_are_droppedcrates/ui/src/preview_panel/android_geometry.rs::fractional_scale_rounds_edges_and_collapsed_view_has_no_areacrates/ui/src/provider_status.rs::probe_diagnostic_messages_cover_every_variantcrates/ui/src/runtime_event.rs::representative_event_severities_are_presentedcrates/ui/src/settings_page.rs::sections_apply_from_client_capabilities_and_attachmentcrates/ui/src/shell.rs::same_page_thread_selection_is_checkpointed_without_waiting_for_hostcrates/ui/src/shell.rs::desktop_visual_viewport_changes_never_blurcrates/ui/src/shell.rs::software_keyboard_wide_cold_restore_stays_unfocusedcrates/ui/src/shell.rs::the_hosts_page_never_shows_hosting_settingscrates/ui/src/sidebar.rs::settled_partition_keeps_active_descendants_visible_and_orders_familiescrates/ui/src/sidebar.rs::repeat_click_on_selected_parent_toggles_direct_child_rowscrates/ui/src/sidebar.rs::active_direct_child_count_excludes_grandchildrencrates/ui/src/sidebar.rs::collapsed_children_do_not_consume_thread_list_slotscrates/ui/src/sidebar.rs::flat_blocks_sort_by_attention_then_recency_and_keep_children_adjacentcrates/ui/src/sidebar.rs::flat_block_attention_is_lifted_from_a_waiting_childcrates/ui/src/store/history.rs::failed_prefetch_is_silent_and_retries_only_after_cooldowncrates/ui/src/store/terminal.rs::word_selection_stops_at_delimiters_and_line_selection_takes_the_rowcrates/ui/src/store/terminal.rs::wrapped_rows_join_without_a_newlinecrates/ui/src/store/terminal.rs::wide_spacers_follow_their_partner_into_the_selectioncrates/ui/src/terminal_drawer.rs::unselected_default_grid_has_no_selection_or_ansi_background_paintcrates/ui/src/terminal_drawer.rs::undercurl_maps_to_wavy_underlinecrates/ui/src/widgets/menu.rs::long_press_dismissal_consumes_outside_tapcrates/ui/src/window_seam.rs::desktop_is_always_wide_and_mobile_follows_the_breakpointcrates/ui/src/window_state.rs::back_pops_the_history_one_step_and_stops_at_the_rootcrates/ui/src/window_state.rs::entering_a_workspace_clears_the_previous_host_s_pagescrates/ui/src/window_state.rs::wide_back_leaves_a_route_rather_than_a_pagecrates/ui/src/window_state.rs::wide_sidebar_navigation_replaces_a_hosts_visit_without_growing_historyCross-platform CI follow-up
The original head
60ef6427had no CI jobs because GitHub held the first-time contributor's workflow for approval, not because any platform had failed. After verifying that the PR did not modify the workflow, it was approved. All seven original-head jobs passed: Linux x64, macOS arm64, Windows x64, iOS, Android, Web and dependency hygiene.A separate local macOS full-workspace run exposed an invalid transport-fixture assumption:
revocation_closes_the_live_connection_and_rejects_reconnectsexpected the selected direct path to havelan: true, but a valid authenticated connection selected a globally routable IPv6 interface. A single run passed; a fixed 20-run diagnostic reproduced seven assertion failures. Source inspection confirmed that iroh's native QNT exchanges interface candidates and probes additional paths after pairing. Filtering invitation hints to loopback and disabling mDNS did not constrain that behavior (three failures in another fixed 20 runs); that attempted fixture change was discarded.CONTRIBUTING's failure steps 1–2 settled the issue at the test contract. The protocol, heartbeat, routing, revocation and restart keepers continue to assert their actual contracts: exact Syncing/Connected stages, a present direct path, no relay, no probing-direct flag, command/event delivery, durable revoke failure, authentication rejection and literal reconnect attempt/reason. They no longer assume the native transport must select a private/loopback address on every host.
an_unreachable_self_hosted_instance_still_lets_the_lan_pair_and_connectanda_restarted_machine_is_rejoined_and_buffered_writes_are_deliveredalso hit that same unsupported expectation during the unsuccessful fixture experiment; their independent protocol/restart assertions remain.The useful IPv4-loopback LAN assertion was moved to
host::tests::native_loopback_connections_report_lan_on_both_sides: both real QUIC endpoints bind specifically to127.0.0.1, and the existing productionpath_infomust return the complete literal LAN path on both sides. This tests Tcode's classification at its owner without a new production test seam. It does not claim coverage of every private subnet or IPv6 address family. An independent preservation review found no code blocker; its stale loopback comment finding was corrected.Follow-up validation on macOS (Rust 1.98.1):
git diff --check, full-workspace Clippy, cargo-machete, iOS simulator and Web checks all passed. The untouched browser-auth Node file passed both tests.Final restored-source result: 868 passed, 6 skipped, 0 failed, no leaks (48.314s execution).
Final-head CI for
13d51cd6: all seven jobs passed — Linux x64, macOS arm64, Windows x64, iOS, Android, Web and dependency hygiene. The desktop summaries below are taken from this final-head run; no test-process leak warnings were present.Final merge review
Independent Standards and Spec reviews cover the complete 70-file diff against
464775ea. Standards found two comment blocks detached by retired tests;13d51cd6removes those five stale comment lines, without changing executable code or assertions. The Standards reviewer confirmed the finding is resolved. Local formatting andgit diff --checkpassed. Spec review found no blocking gap or scope change. One retirement-map row still contained an unimplemented C plan; that text was removed, preserving its actual D rationale and keeper references. Both review axes now have no unresolved findings. All seven CI gates for13d51cd6passed. The final run has 853 Linux, 868 macOS and 847 Windows tests passed, with 6/6/5 explicit skips respectively and no failures or test-process leak warnings. The PR head is13d51cd64c6911bcaf15e8451e9c59e082ac9459; the base remains464775ea59b9ad7e4149e2bcb55d8804d25e0a73. No prior-head result is used as the final merge gate.