Whole-repo simplify pass
Status: paused. Ticked items are committed, with 23 and 57 ticked as decided against; the unticked ones are open, and items 44, 45, 46, 70 and 71 are partly done (below). No suite is run from a session, so the closing loop goes to the maintainer.
Partly done: 44 has all but _hi_ctl_case; 45 has 11 cases on _hi_refused, the packaging sites assert a nonzero exit and stay; 46 has the helper only; 71 has ci.yml:777, coverage.yml:471 and the docs plugin; 70 has setup-shells only.
A later whole-tree pass, uncommitted until its closing loop runs, moved these on: _hi_ctl_case (14 of 15 cases), more _hi_refused and _hi_script sites, 53, 58, 60’s keep helpers, 61’s ok flags, 64’s _hi_lint_cmd and one awk, 65’s shell paths, and 71’s windows-client.yml half. Sites of an unusual shape were left alone, so the unticked items stay open. Still open from that pass: the rest of _hi_prints and _hi_var_is beyond their simple pairs, and _hi_arrives past the ten single-line sites.
Decided against in that pass, each adding lines: _hi_tool_versions_tree, and _hi_shared_out for the header rows, which also keeps a bad first render FAILED where a rerun would call it FLAKY.
Also decided against: 57 (twin counters fold into bad, and a wrong tally in a lint gate is the worst place to find out), 70’s session_verdict.sh (Windows-only paths, verifiable only on a CI round trip).
Behavior stays as it is unless an item says otherwise. No new eval or kin, the bash 3.2 floor holds, a failing case keeps its reason, and nothing adds a fork or capture on a test’s passing path.
Decided against, each changing behavior or losing a pin: 23 (exports all of hi.keep on the hold path); 29’s <on> field (ten pinned patterns, no runtime gain); 32’s doctor_row under --problems (_hi_state_row writes rows directly, which would then draw); 40’s setting_value memo (it would turn reads into answers); 44’s rm -f settings.sh in paths_test.sh (it removes a file the fixture wrote).
Possible bugs
- 1.
hi.sh:308: a barecatreads stdin when a site settings file exists and no tag file does. Guard it on the array’s length. - 2.
scripts/pack.sh:491:_hi_ssh_tags_filerecuts and moveshi.ssh_tagson every lookup when the ssh config has anInclude; that file is incache_also, so the overlay cache stays cold. Replace only on a change. - 3.
tests/scripts/preview_packages_test.sh:121,307: assign shared output through_hi_shared_out. - 4.
tests/scripts/doctor_target_test.sh:221: a barereturn 1gets a reason. - 5.
tests/common/header_whole_test.sh:504-608:vscodenames no scheme, the “24-word” case passes$_HI_TEST_SCHEME48. Fixed with item 61.
Shipped: dead code and leftovers
- 6.
hi.sh:1518-1529: delete the warm subshell, itswait, and “warm below” at 1511. If a miss’s stderr can surface, keep the subshell’s redirect in the foreground. - 7.
scripts/pack_stream.sh:290-300: delete_hi_overlay_bytes. - 8.
scripts/pack.sh:172-174,376,380-381,scripts/pack_plugins.sh:97-98: drop_HI_PLUGIN_GENand_HI_OVERLAY_INDEX_GEN; reset_HI_OVERLAY_INDEX=""in the plugin load and test-z(a built index holds at least a newline). - 9.
scripts/configure_menu.sh:326-336: drop_hi_menu_rows, call_hi_menu_rowat 428-429, dropconfigure_test.sh:695-702. - 10.
common/config.fish:591-595,common/zsh.zsh:292: source the overlay with the plain test-and-source shape, delete both comments. - 11.
load.sh:77-80: stand-in becomesreturn 1; drop the limit fromload_session_test.sh:459’s expected string. - 12.
common/targets.sh: inlineplugin_tables(161-166) in the--disable-pluginarm; inlinescratch_dir(298-304) at 389; one_hi_nsdefault at the top ofkube_rows(471-476); fix the header (19-22). - 13.
common/header.sh:426-428(double validation),:203,230(unread print in_hi_header_version, plusconfigure_preview.sh:64,header_test.sh:288,291),common/core.sh:757-758(redundant primes). - 14.
common/header.sh:854-858: delete the orphaned comment. - 15.
scripts/pack_scan.sh:108-109;scripts/install.sh:57-59; one-line HI.05 notes atcommon/env_prompt.sh:52-54,common/git_prompt.sh:13-17. - 16.
hi.sh:1895guard, its testparse_help_test.sh:602-610,678;hi.sh:1041,1047movehandoff=into the branch;hi.sh:1216-1218call_hi_wire_done;hi.sh:859_hi_out;hi.sh:1633-1636,970_hi_list_has;common/keep.sh:491-500dropprobes. - 17.
hi.sh:233-243,910-917: spell the format literals; fix comments at 193, 232, 907; drop the test atremote_test.sh:318-325.
Shipped: reuse and duplication
- 18.
scripts/pack_plugins.sh:481-488: drop_hi_hook_off; call_hi_plugin_switched_offatpack.sh:288,704and in the scripts library (_hi_hr_n); move its note. - 19.
common/git_prompt.sh:147-153,common/env_prompt.sh:128-141: tail is_hi_opts_restore;_hi_out "${1:-}" "($_hi_out) "; source$_HI_COREfirst inenv_prompt_test.sh:124. - 20.
scripts/doctor_target.sh:15-38:arms=("ssh|ssh host||_hi_is_ssh_host" "${_HI_BACKENDS[@]}");:144-162: one chain on_hi_list_has. - 21.
scripts/add_package.sh:105-130: inline at 144 and 164. - 22.
common/targets.sh:544-554,571-586: flatten the age check, one cleanup inwrite_cache. - 23. Decided against.
common/keep.sh:358-386: move the_hi_mux_herecheck below the export loop;_hi_keep_hold_herereads$_HI_KEEP_AS. - 24.
hi.sh:121-129,scripts/pack_stream.sh:305-314: oneprintf -vafter the fallback chain. - 25.
hi.sh:1572-1595: one early-exit block; hoist the errlog line above 1587. - 26.
scripts/preview.sh:192-201:_hi_colors_names hostname | grep '[*?]' || true;:281-302,371-374: keep keys and escapes only, outvar with a prefixed name. - 27.
common/header.sh:70-85and the scripts library’s copy:_hi_term_colsincore.sh; the tput memo stays in_hi_draw_width. - 28.
scripts/configure.sh:224-229,configure_menu.sh:838:_hi_list_has "$vocab";configure_test.sh:173,207-210use_hi_is_header_order. - 29.
scripts/configure_menu.sh:26,523-526: length check;:961-968,1020-1021: drop arguments and the<on>field, updateconfigure_wizard_test.sh:686-690. - 30.
scripts/plugins.sh:98-105:--textarm in_hi_args, gated on_HI_TEXT=1. - 31.
scripts/doctor.sh:96-101drop;:507-523onecase;:423-429anddoctor_target.sh:39,42,47,188,190,197_hi_doc_now. - 32. scripts library: derive
effin the member rows,_hi_plugin_word_ok’s required argument;doctor.sh:301-303,874_hi_count_lines;:287,318-320armor;:931-933one condition;:210-213,260no buffering under--problems. - 33.
scripts/zshrc.sh:24-28with_hi_rc_last_matchmoved there;pack_stream.sh:203-212outvar-only key,cache_test.shfollows;pack.sh:237-254one theme loop. - 34.
_hi_prompt_fitsforconfigure.sh:244-246,configure_preview.sh:290-325;configure.sh:78-84drop<off>;set_color.sh:21-29add/remove;_hi_strip_escapesintable.sh, used byconfigure_preview.sh:27-32. - 35.
common/core.sh:985,1030,1055,common/header.sh:554:l="${X:+$X;}"thenr="${l%%;*}" l="${l#*;}". Not_hi_ramp_ok. - 36.
common/git_prompt.sh:24-41,81. - 37.
_hi_prompt_ext <shell>incore.sh, used bybash.sh:212-221,zsh.zsh:95-100, keeping word splitting; dropbash.sh:80-81. - 38.
common/paths.sh:29-31: export fromtests/test_lib.sh; update GLOSSARY. - 39.
common/header.sh:1121-1125: drop the source-time palette; add it topreview.shand suites that callcheck_linedirectly. - 40.
_hi_load_preview_sourcesonce inrun_configureandconfig_hub;configure_menu.sh:411notes only when drawing;configure.sh:66-76memo for$_HI_SETTINGSreads only. - 41.
common/config.fish:368-407: plain statements; rewrite the pins atprompt_test.sh:216,232. - 42.
common/targets.sh:533-534:set -- $(exec ls -ldn ...), test${3:-}.
Tests: cross-suite
- 43.
_hi_prints <want> <cmd...>in the harness’s report helpers; rows fordispatch_test.sh:56-138,parse_test.sh:40-46,392-399,470-499,container_test.sh:174-216,payload_overlay_test.sh:18-23,126-141,196-201,637-643. - 44. Remove pre-
$_HI_WORKDIRcleanups:cache_test.sh:40-44and 39 call sites plus_hi_ctl_case;rc_prompt_test.sh:57,83-84,211,566,616,637,rc_test.sh:392,410,763(common),git_prompt_test.sh:164,178,215,241,paths_test.sh:264,310,341,356,core_identity_test.sh:501,516,load_session_test.sh:277,300,load_test.sh:245,248,header_whole_test.sh:663,targets_complete_test.sh:189;tests/scripts/rc_test.sh:383,461,doctor_target_test.sh:323,plugins_test.sh:40-47,edit_test.sh:36-41,configure_test.sh:845. Keep removals of amktempoutside the workdir. - 45.
_hi_refused <phrase> <cmd...>:install_run_test.sh:56-93,252-259,570-593,doctor_report_test.sh:40-105,preview_test.sh:61-73,92-97,636-640,install_test.sh:199-203, suite twins inset_color_test.sh:33,plugins_test.sh:65; 16! out="$(sites intests/packaging;parse_test.sh:90-129,197-207,401-429. Sites asserting an exact other rc stay. - 46.
_hi_scriptreads stdin given no lines: 28chmod +xintests/packaging;core_test.sh:779,792,header_bare_test.sh:236-244,load_session_test.sh:701-707,targets_test.sh:640-652. - 47. Join 57 adjacent
localpairs intests/hi.
Tests: per suite
- 48.
doctor_config_test.sh:_hi_doc_at <dir> <fn...>. - 49.
lib_report_test.sh:339-709:_hi_ended, prefix assignments. - 50.
core_identity_test.sh:19,205,223,253,302-364,core_test.sh:413,462:_hi_colors_say,_hi_tag_is. - 51. Duplicate coverage:
_hi_human_bytes,_hi_require, trap strings, overlay rc strip, separator intests/hi; keep the union. - 52.
header_check_test.sh,header_test.sh:629-653: one-line form; 249 stays. - 53.
install_test.sh:295-470,configure_wizard_test.sh:375-424:_hi_config_hi_at. - 54.
_hi_deal <n>in the harness’s parallel helpers forshellcheck_test.sh:184-233,test_runner.sh:444-453. - 55. Delete
test_package_sh_rejects_unknown_arguments,test_bump_b2_fallback_agrees_with_b2sum,test_src_tarball_uses_the_versioned_prefix,test_package_sh_reads_the_version_from_the_pkgbuild. - 56.
_hi_ledger imagein_hi_build_imagefor*-$$tags; sweep in_hi_test_cleanup; drop the six per-suite cleanups. - 57. Decided against.
_hi_lint_failbumps$bad;lint_site_linkskeeps its per-file count. - 58.
packaging_ci_release_test.sh:490-626:_hi_in_mkpkgmoved,_hi_checksum_dist,_hi_checksums_with. - 59.
cache_test.sh:237-405: parameterized freshness and stability cases. - 60.
ssh_keep_test.sh:_hi_keep_connect,_hi_keep_next_alone,_hi_keep_retry_said. - 61.
header_whole_test.sh:504-728_hi_hues_differ;header_bare_test.sh:94-351one header helper,_HI_IP_PROBE;okflags to|| _hi_whyinheader_check_test.sh:467-501,header_whole_test.sh:505,729,targets_test.sh:523,load_test.sh:211-228;targets_test.sh:48-59,389-445shim helpers;rc_prompt_test.sh:669-694,803-805registration loop,:364subsumed case;header_test.sh:27,96strip once;core_test.sh:735with_hi_shell_agreesreason;paths_test.sh:228,314;header_check_test.sh:372-378. - 62.
preview_test.sh_hi_tree_preview,_hi_source_agrees;_HI_SETTINGS_SHAPEat five sites;install_run_test.sh:204-212,308-322,339-347,648-676;update_test.sh:333-401;configure_test.sh:610-616,833-874; one-line wrappers;rc_test.sh:28-48; redundant statementsdoctor_config_test.sh:652,table_test.sh:13-14,rc_test.sh:635,doctor_target_test.sh:344. - 63.
runner_test.sh:12,55-56,93-99,403-453,508,631-644,699-714,819,runner_ci_test.sh:14-16,32-39,78-91,232-331,343-375;lib_test.sh:108-213. - 64.
_hi_lint_runfortools_test.sh,dialects_test.sh:67-72;drift_test.sh:93-114oneawk;drift_docs_test.sh:298-331,479-483_hi_jekyll_excluded;drift_test.sh:336,344-346,660-662,tools_test.sh:112-114. - 65.
alias_fallthrough_test.sh:28,92-102,177-189,244,386,436-480,564;keep_test.sh:604-743;remote_test.sh:540-576;prompt_test.sh:26-36,69-87,278;parse_help_test.sh_HI_MAN,_HI_HELP_OUT;payload_test.sh:316-373,513-524;payload_scan_test.sh,payload_home_test.sh:449-477,payload_overlay_test.sh:471in-process exports; dead assertions and stranded comments. - 66.
stage_fixtureto_hi_staged_999; dotfile scan through a moved_hi_wf_steps_missing;docker_test.sh:14-58; redundantmkdir -p "$ctx";packaging_ci_mkpkg_test.sh:409-413;ssh_wire_test.sh:120-194;_hi_gpg_export_key;framework_test.sh:183-186;ssh_test.sh:23-323flags. - 67.
update_test.sh:35-61: build once in$_HI_SUITE_WORKDIR,cp -Rper case. - 68.
add_tag_test.sh:20-221;preview_test.sh:710,doctor_test.sh:423,configure_test.sh:757setup moved to its users;lib_test.sh:715-717parallel;bench_test.sh:149.
CI, packaging, scratch
- 69.
coverage.yml:121-138,617;release.yml:952,1007;ci.yml:101,131, workflow-level_HI_RUN_DEADLINE. - 70.
setup-shells/action.yml:41throughsetup-backends/install.shwithHI_BACKENDS: none;.github/scripts/session_verdict.shforwindows-e2e.yml:99,136,351,ci.yml:522,bsd_loopback.sh:56. - 71.
windows-client.yml:50withplatform_badges.sh:62;ci.yml:777;coverage.yml:471;platform_badges.sh:94;prettier-plugin-docs.mjs:82;coverage_data.py(since deleted). - 72.
setup-tool’s unused overrides: a shared file, so it goes on the shared CI batch list, not into this repo alone.