Skip to content

refactor: repo-wide behavior-preserving simplification sweep (batch-simplify) - #3454

Merged
kyle-sexton merged 15 commits into
mainfrom
claude/repo-code-tidying-batch-twhddw
Aug 27, 2026
Merged

refactor: repo-wide behavior-preserving simplification sweep (batch-simplify)#3454
kyle-sexton merged 15 commits into
mainfrom
claude/repo-code-tidying-batch-twhddw

Conversation

@kyle-sexton

Copy link
Copy Markdown
Contributor

No linked issue

Summary

Repo-wide behavior-preserving simplification sweep (/code-tidying:batch-simplify repo mode): 986 swept code files in 62 groups across 12 waves, delivering byte-preserving cleanups in 34 groups and leaving 28 groups untouched with recorded reasons. Every changed group passed a fresh-context adversarial refutation verifier.

Fix

One wave commit per group batch (W1-W12), each with per-plugin patch bumps and CHANGELOG entries:

  • Dead code and dead stores removed (dead guards, unused locals, unreachable returns, duplicate awk counters)
  • Duplication collapsed inside file/contract boundaries (usage-string hoists, fail_usage() helper, memoryStore(seed) test fixture consolidation, sed/glob chain merges, array slices over manual chunk loops)
  • The video-digest isMainModule() helper rollout completed package-wide (30 remaining hand-rolled ESM main checks)
  • Named helpers for repeated inline logic (_rlg_bash_at_least, _rlg_read_settings_json, failDegraded(), noTranscriptPlan())
  • Boolean-ladder and branch collapses where results are provably identical (SIM103 shapes, ${configured:-$3}, isinstance merges)

Deferred everything that changes emitted bytes, exit codes, or crosses contract boundaries: 237 items inventoried; the 28 High items are filed as #3424-#3451 (24 bugs, 4 dedicated-PR refactors). Two mid-run merges of origin/main resolved parallel version claims by renumbering sweep entries above main's (latest: claude-config 0.40.13, claude-ops 0.38.13, disk-hygiene 0.20.29, knowledge 0.13.19, machine-health 0.11.12, session-flow 0.34.10, work-items 0.39.35).

Verification

  • Per-group: repo suites via scripts/affected-tests.sh --run, per-ecosystem gates (shellcheck, pinned ruff wrapper, package vitest/tsc, pwsh parse), plus a mandatory fresh-context refutation verifier per changed group (differential drives, byte-equality probes, AST/token identity, up to 20k-case fuzz)
  • Union pass over the full 114-file branch diff: 212 shell suites passed; video-digest vitest 502 tests + tsc clean; course-digest, miro, babysit-prs python suites green; check-shell-portability.sh --all clean over 1506 shell files; check-changelog-parity.sh --check-bump origin/main green; pwsh parse 0 errors
  • Post-merge (origin/main brought in twice): parity gate green; merge-delta re-run 197 shell suites passed; the single both-sides code file (disk-hygiene hygiene.py) covered by repo-wide ruff and its suites in that run
  • Known non-blocking signals: one vitest timeout that re-ran green in 2.2s (container load); one pre-existing E402 that fires identically on origin/main

Related

Refs #3424, #3425, #3426, #3427, #3428, #3429, #3430, #3431, #3432, #3433, #3434, #3435, #3436, #3437, #3438, #3439, #3440, #3441, #3442, #3443, #3444, #3445, #3446, #3447, #3448, #3449, #3450, #3451 (High-priority deferrals filed by this sweep's closeout). Precedent: #3379 (prior sweep).

🤖 Generated with Claude Code

https://claude.ai/code/session_01JCpHV7rFh5QiekTCPmN2qT


Generated by Claude Code

claude added 15 commits August 27, 2026 04:00
Repo-mode batch-simplify wave 1 (groups: root-config, scripts-lib,
claude-config-lib). Groups 01 and 09 reviewed clean, no changes needed.
Group 02: fix a self-contradictory comment on the expect() helper in
read-list.test.sh ("NUL-joined" -> "newline-joined"; the helper joins
with printf '%s\n'). Comment-only, behavior-preserving, adversarially
refutation-verified; suite 29/29, portability gate clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JCpHV7rFh5QiekTCPmN2qT
…og-parity gate

Repo-mode batch-simplify wave 2 (groups: scripts-top entrypoints, sync,
checks-1..4). Five of six groups reviewed clean, no changes needed.
Group checks-1: remove the absorbed_reported dedup guard in
check-changelog-parity.sh's --check-bump absorbed-heading loop - provably
unreachable since introduction (touched_changelogs is already deduplicated
by the seen_changelog guard at both build sites; confirmed via git log -L
and an adversarial rename/copy fixture attack). Output bytes and exit
taxonomy unchanged; suite 82/82; refutation verifier compared old vs new
byte-for-byte across five fixture scenarios including dual-changelog
absorption and merge-commit HEAD shapes - identical.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JCpHV7rFh5QiekTCPmN2qT
… scripts

Repo-mode batch-simplify wave 3 (groups: claude-config permission-state /
structure audits / instruction audits, claude-ops audits / runtime).
Groups 11 and 13 reviewed clean. Applied, each adversarially
refutation-verified against the pre-change script byte-for-byte:

- claude-config audit-instructions/restatement-scan.py: drop a redundant
  "nunit and" truthiness test (length guard already excludes empty) and
  the main() empty-file-list special case (general path proven
  byte-identical; 20k-case differential fuzz).
- claude-config audit-permission-state/automode-block-lint.test.sh: drop
  a duplicate command -v bash reassignment (62/62 checks, old-vs-new run
  byte-identical).
- claude-ops inventory/inventory.py: hoist duplicated candidate_binaries()
  call into one snapshot; docstring em-dash normalization; formatter-hook
  layout churn AST-verified neutral (31/31 tests; --disk-only smoke
  byte-identical).
- claude-ops plugins/normalize-enabled-plugins.sh: drop dead shellcheck
  disable=SC2064 above a single-quoted trap (31 checks pass).

claude-config 0.40.12, claude-ops 0.38.12 with changelog entries.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JCpHV7rFh5QiekTCPmN2qT
Repo-mode batch-simplify wave 4 (groups: claude-ops observability,
course-digest extraction top-level + adapters/lib, knowledge misc,
video-digest extraction core). Four of five groups reviewed clean.
Group course-digest-scripts: drop a dead return { modulesDir } from
runLessonExtraction and the destructure feeding only it - repo-wide
call-site census shows the sole caller awaits without reading the value;
package suite 10 files / 91 tests green (npm ci + tsc + vitest);
refutation verifier confirmed no reader of the resolution value and no
getter side effects.

knowledge 0.13.15 with changelog entry.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JCpHV7rFh5QiekTCPmN2qT
Repo-mode batch-simplify wave 5 (groups: acquisition, adapters, evals,
lib, transcript of video-digest extraction). Groups evals and lib
reviewed clean. Applied, each adversarially refutation-verified with
emitted bytes unchanged:
- adapters/x.js: fold twice-built degraded-acquisition failure message
  into one failDegraded() helper; drop per-iteration Set + spread inside
  files.filter for a plain array (dedup unobservable under .some).
- adapters/adapter-contract.js: collapse the two near-identical
  extractorArgs/allowedExtractors validation branches into one loop;
  violation strings and push order byte-identical.
- adapters/youtube.js: single-use /^\// regex replaced by .slice(1)
  (WHATWG pathname always /-prefixed when hostname non-empty; probed);
  per-call Set literal hoisted to module scope.
- transcript/transcript-strategy.js: fold two byte-identical
  no-transcript degradation returns into noTranscriptPlan().
- acquisition/build-yt-dlp-args.js: collapse redundant "&& length > 0"
  conjunct to "||" (value domain is undefined | trimmed string).

Suites: adapters 112/112, transcript 58/58, acquisition 93/93,
tsc --noEmit clean. knowledge 0.13.16 with changelog entry.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JCpHV7rFh5QiekTCPmN2qT
…ideo-digest

Repo-mode batch-simplify wave 6 (groups: watch-a, watch-b, watching,
machine-health checks-security, checks-system; machine-health groups
reviewed clean). knowledge/video-digest extraction:

- Complete the lib/cli-entrypoint.js isMainModule() rollout started by
  the prior sweep: 30 hand-rolled ESM main-module checks across watch/,
  watching/, transcript/, evals/, acquisition/ migrated to the helper;
  orphaned node:url (and where fully unused node:path) imports dropped.
  The only main-module check remaining in the package is the helper
  itself.
- watch/watch-state.test.js: four hand-rolled Map-backed fs fakes
  consolidated into one memoryStore(seed) helper (57/57 assertions
  line-identical); watch/snapshot-bootstrap.test.js: byte-identical
  fixture setup hoisted into beforeEach.

All batches adversarially refutation-verified (expression-identity
tables, URL-normalization probes, HEAD-baseline spot-runs, HEAD-copy
test-run parity). Full package suite 71 files / 494 tests green;
tsc --noEmit clean. knowledge 0.13.17 with changelog entry.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JCpHV7rFh5QiekTCPmN2qT
…t-runner cleanups

Repo-mode batch-simplify wave 7 (groups: machine-health lib
catalog-helpers, lib discovery Get-*, lib orchestration/IO, core +
test-infra, miro). Four of five groups reviewed clean (miro verified
green across tsc, vitest 32/32, biome, and dist parity). Group
core-test-infra applied two edits, each refutation-verified by
empirical pwsh probes:

- Clear-TempFiles.ps1: drop dead sync-back after [ref] counter
  (write-through confirmed across the function/pipeline boundary;
  emitted after.skipped_reparse byte-identical).
- Invoke-MachineHealthTests.ps1: hoist duplicated failed-container
  predicate into one $failedContainers behind the existing guard
  (7-case differential harness under StrictMode 3.0 +
  ErrorActionPreference=Stop shows identical output, order included).

machine-health 0.11.10 with changelog entry.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JCpHV7rFh5QiekTCPmN2qT
origin/main advanced and claimed machine-health 0.11.10 and knowledge
0.13.15 for other change sets. Renumber this branch's bumps strictly
above main's current versions: machine-health 0.11.10 -> 0.11.11;
knowledge changelog chain 0.13.15/16/17 -> 0.13.16/17/18 with manifest
at 0.13.18. Content of the entries unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JCpHV7rFh5QiekTCPmN2qT
…ing-batch-twhddw

# Conflicts:
#	plugins/knowledge/.claude-plugin/plugin.json
#	plugins/knowledge/CHANGELOG.md
#	plugins/machine-health/.claude-plugin/plugin.json
#	plugins/machine-health/CHANGELOG.md
…e cleanups

Repo-mode batch-simplify wave 8 (groups: repo-hygiene git-ops +
clean-ops reviewed clean; babysit-prs engine + state/queue;
source-control misc core). Each change adversarially
refutation-verified, emitted bytes unchanged, full 643-test babysit
suite green:

- babysit_feedback/babysit_delta: human_stop_from_feedback extracted as
  the single definition of the human-stop record; classify_pr delegates
  (1800-case differential matrix: field/key-set/key-order identical;
  closes a two-copy drift risk on the external_required presence
  branch).
- babysit_resolve_thread: seven summary-count comprehensions folded
  into one acted() counter (eight-site census verified).
- request_review: eight record_attempt_problem sites over the same five
  fixed args folded into a record_problem closure (capture-mutation
  trace clean).
- babysit_review_trigger: thrice-spelled gate-context predicate
  extracted into is_gate() (400-fixture differential; CheckRun/
  StatusContext asymmetry preserved).
- test_babysit_merge: stale line-number docstring anchor replaced with
  a symbol anchor per guard-contract convention.
- worktree-claim.sh: main-vs-linked flush branches collapsed;
  readiness-gate suite resolves its python probe once (HAVE_PY311);
  worktree-root-doctor.test.sh gains fgit() wrapping the git-config
  isolation prefix at ten fixture sites; reap suite hoists uname -s;
  reap script uses $'\t' directly.

Suites 53/163/37/45 baseline-identical; shellcheck + portability gate
clean. source-control 0.55.24 with changelog entry.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JCpHV7rFh5QiekTCPmN2qT
…eanups

Repo-mode batch-simplify wave 9 (groups: source-control pr/commit
scripts reviewed clean; tracker core lib; work-items misc scripts;
gitea, github, jira adapters — jira reviewed clean). Each change
adversarially refutation-verified, byte-identical output and exit
codes:

- work-item-tracker.sh: fail_usage() helper replaces five open-coded
  usage-error sites (per-site byte comparison table: 591-byte stderr,
  exit 2, identical everywhere).
- lib/binding.sh: wit_role_label if/else collapsed to
  ${configured:-$3} (always-assigned trace + falsy-value drive).
- onboard-adapter generate-adapter.sh: three spec reads routed through
  the file's own sget helper (generated trees diff -r identical across
  three spec shapes; 140-case suite green).
- gitea create-item.sh: per-page label count captured once (LABEL_GOT)
  instead of re-running jq length (four-path pagination harness
  byte-identical, including unreachable-input analysis).
- github renew-lease.sh: lease-comment emptiness check uses [[ -n ]]
  (token-stream identity via bash --pretty-print), plus repo-hook shfmt
  normalization of case arms.

Suites green at baseline counts (tracker 56, binding 69, adapters
45/3/25, generator 140). work-items 0.39.33 with changelog entry.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JCpHV7rFh5QiekTCPmN2qT
…eck-skill fork drop

Repo-mode batch-simplify wave 10 (groups: linear adapter, local-markdown
adapter, conformance harness, two cross-plugin audit-check bundles —
three reviewed clean). Each change adversarially refutation-verified:

- local-markdown adapter (6 verbs): usage string previously duplicated
  verbatim at the help and usage-error sites hoisted into one usage=
  literal (paired literals byte-identical at HEAD; 24-invocation
  differential drive byte-identical on stdout/stderr/rc; 8 suites,
  79 checks green), plus repo shfmt hook case-arm normalization.
- skill-quality check-skill.sh: vc_lead_mutate pipes its helper
  directly into grep -qE instead of re-materializing via printf+command
  substitution (one fork per call on a CI-hot predicate; pipefail rc
  trace deterministic-zero; 11-input newline probe against the verbatim
  regex; full suite green).

work-items 0.39.34 and skill-quality 0.20.5 with changelog entries.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JCpHV7rFh5QiekTCPmN2qT
…, disk-hygiene engine

Repo-mode batch-simplify wave 11 (groups: update-family, runtime-misc,
autonomy setup, claude-memory, code-tidying, disk-hygiene — three
reviewed clean). Each change adversarially refutation-verified with
byte-identical output and exit codes:

- autonomy setup gates: nested single-branch if collapsed to && in
  check-signal-envelope.mjs (three-envelope differential drive
  identical); loop-push to spread in resolve-prerequisites.mjs
  (findings arrays proven bounded and plain); dead local removed from
  the fixtures runner. Suites 22/22 + 4/4; generated/ unchanged.
- code-tidying dead-code-scan.sh: dead store removed (ts="" in the
  branch only reachable when ts is already empty); suite 162/162;
  git and no-git fixture runs byte-identical.
- disk-hygiene hygiene.py: accumulator loop to the file's own
  walrus-filter sum idiom (callee pure, one eval per entry) and two
  byte-identical isinstance branches merged; ruff-format hook reflowed
  token-identical regions; a test file moves to parenthesized context
  managers. Suites 317 + 10 green; guard/kill-switch code untouched.

autonomy 0.22.15, code-tidying 0.14.8, disk-hygiene 0.20.28 with
changelog entries.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JCpHV7rFh5QiekTCPmN2qT
…session-flow, guardrails, docs/specs

Behavior-preserving simplifications across the final six batch-simplify
groups (57-62), each refutation-verified:

- docs-hygiene: drop duplicate glob alternative in compress/audit-scan.sh;
  replace manual chunk loop with array slices and drop dead `local tier`
  in audit-noise/detect.sh; remove duplicate awk counter in
  audit-noise/emit-findings.sh (0.21.19)
- instruction-placement: collapse bracket-negation if/elif in
  glob-tools.sh; merge two sed passes in render-index.sh (0.11.9)
- rate-limit-guard: name repeated bash-version checks as
  _rlg_bash_at_least with per-site floors; extract _rlg_read_settings_json
  helper; use lines+=() append in statusline-tee.sh (0.7.15)
- session-flow: collapse boolean ladder and use `or` fallback for the
  UTC zone in keep-going/check-usage-limit-reset.py (0.34.9)
- guardrails: whitespace/comment cleanup in lib/powershell/ps-command.sh,
  generated PowerShell pretty-prints identically (0.29.18)
- docs/specs d1_proxy.py: collapse is_instruction tail to a single
  return; use maxsplit on the keyword split

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JCpHV7rFh5QiekTCPmN2qT
…ing-batch-twhddw

# Conflicts:
#	plugins/claude-config/CHANGELOG.md
#	plugins/claude-ops/CHANGELOG.md
#	plugins/disk-hygiene/CHANGELOG.md
#	plugins/knowledge/.claude-plugin/plugin.json
#	plugins/knowledge/CHANGELOG.md
#	plugins/machine-health/CHANGELOG.md
#	plugins/session-flow/CHANGELOG.md
#	plugins/work-items/.claude-plugin/plugin.json
#	plugins/work-items/CHANGELOG.md
@claude

claude Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 3m 54s —— View job


Code review complete

  • Gather context (PR body, changed files, CLAUDE.md/AGENTS.md conventions)
  • Confirm skip-gate does not apply
  • Review diff for correctness / maintainability issues (git diff origin/main...HEAD, 114 files)
  • Post inline findings (none warranted)
  • Post final summary

Scope: reviewed the full origin/main...HEAD diff (114 files — plugin manifests/CHANGELOGs plus the 96 code/test files they cover), not just the 100-file paginated list surfaced in the PR event payload; the work-items adapter scripts and scripts/check-changelog-parity.sh/scripts/lib/read-list.test.sh were in the real diff but missing from that list.

Method: traced control flow before/after for every file with a non-trivial diff, cross-checked each "simplification" against its call sites and surrounding invariants rather than trusting the description. Two independent subagents (producer ≠ verifier, per this lane's adversarial-validation rule) covered the highest-diff clusters — babysit-prs/work-items/source-control scripts, and the video-digest isMainModule() rollout plus inventory.py/hygiene.py/statusline-tee.sh/ps-command.sh/Invoke-MachineHealthTests.ps1 — while I covered the remaining files (all video-digest watch/eval scripts, docs-hygiene, instruction-placement, session-flow, claude-config, autonomy, machine-health Clear-TempFiles.ps1, and the work-items adapter tree) directly.

Result: no findings. Spot-checked reasoning for a few of the less-obvious collapses, since a "behavior-preserving" claim this broad is exactly where a subtle regression would hide:

  • scripts/check-changelog-parity.sh#L582-L588 — the removed absorbed_reported dedup guard is genuinely redundant: touched_changelogs is already de-duplicated via seen_changelog at the point it's built (same file, lines 418-475).
  • restatement-scan.pynunit and nunit in nsrcnunit in nsrc is safe because the function already returns early when len(nunit) < 24, so nunit can't be empty by that point; the args.files early-return removal produces identical output (empty loop + print(0)/nothing) to the removed branch.
  • plugins/work-items/tools/work-item-tracker/adapters/gitea/create-item.sh — caching jq 'length' into LABEL_GOT instead of calling it twice per loop iteration is behavior-preserving (same input both times) and marginally more efficient.
  • Clear-TempFiles.ps1 — dropping the manual $skippedReparse = $skipCounter.Value sync-back after the loop is safe: [ref]$skippedReparse already writes through on every .Value++ inside Get-NonReparseFile, so the trailing assignment was dead.
  • plugins/docs-hygiene/skills/audit-noise/scripts/detect.sh — the manual OFFSET/LIMIT chunking loop replaces cleanly with array slicing (${SORTED[@]:OFFSET:LIMIT} / ${SORTED[@]:OFFSET}); both OFFSET/LIMIT are validated non-negative integers earlier in the script, and the branch structure matches the original's no-op case when both are zero.
  • The video-digest isMainModule() rollout (~25 files) is a mechanical swap of hand-rolled import.meta.url/process.argv[1] checks for the shared helper already in use elsewhere in the package; verified the helper's semantics match every call site, including the handful that previously compared an unresolved RHS path (now resolved on both sides via the shared helper — a pre-existing, already-adopted pattern, not a new risk this PR introduces).

No correctness or maintainability issues met this lane's high-signal bar (see plugins/review/skills/code-review/SKILL.md). Nothing here should block merge.

Branch: claude/repo-code-tidying-batch-twhddw

@claude

claude Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 1m 49s —— View job


Security review (/review:security-review)

  • Gather context (PR diff, changed files, CLAUDE.md/AGENTS.md instructions)
  • Invoke /review:security-review and follow its instructions
  • Post findings / summary

No security issues found.

This is a large (100-file) behavior-preserving simplification sweep. I reviewed gh pr diff 3454 in full, with focused attention on every file with realistic security surface:

  • Credential/settings handling: plugins/rate-limit-guard/scripts/statusline-tee.sh — the new _rlg_read_settings_json() helper preserves the existing pattern of piping settings.json to jq via an environment variable (RLG_SETTINGS_DOC), never argv or a temp file, matching prior behavior.
  • PR-automation / GitHub API scripts: plugins/source-control/skills/babysit-prs/scripts/{request_review,babysit_feedback,babysit_resolve_thread,babysit_review_trigger}.py — all changes are DRY extractions (shared closures/helpers) that preserve the original control flow, authorization checks (is_bot, is_self_login), and state recording byte-for-byte.
  • GitHub/Gitea work-item adapters (plugins/work-items/tools/work-item-tracker/adapters/**) — pagination/loop and formatting cleanups only, no change to how remote data is validated or how commands are constructed.
  • plugins/guardrails/lib/powershell/ps-command.sh (PowerShell command-injection guard logic) — changes are whitespace/formatting only (for ((; jfor (( ; j), no change to the detection regexes or control flow.
  • plugins/machine-health/skills/audit/scripts/windows/remediations/Clear-TempFiles.ps1 (file-deletion remediation script) — only a redundant $ref sync-back line removed; no change to path/deletion logic.
  • No GitHub Actions workflow files are touched, no permissions: blocks changed, no new subprocess/shell=True/eval/exec call sites introduced, no injection surfaces added.

This matches the PR's stated scope (dead-code removal, duplication collapse, boolean-ladder/branch simplification, helper extraction) — nothing in the diff crosses a trust boundary or touches auth/authz, secrets, or command construction in a way that changes behavior.

@github-actions

Copy link
Copy Markdown

Last security-reviewed head: 1782e5cc7d76cfc26511bbf6311bdc74d0eb004b. On the next push, the relevance gate compares only the commits since this SHA; delete this comment to force a full re-review.

@github-actions

Copy link
Copy Markdown

Claude has reviewed this PR 1 time. The lane skips further automatic reviews after 5; deleting this comment resets the count.

@kyle-sexton
kyle-sexton merged commit 16c47bf into main Aug 27, 2026
55 checks passed
@kyle-sexton
kyle-sexton deleted the claude/repo-code-tidying-batch-twhddw branch August 27, 2026 22:42
kyle-sexton added a commit that referenced this pull request Aug 29, 2026
…1 redundancies removed (#3486)

Full-repository /code-tidying:batch-simplify re-sweep. 3,375 tracked files filtered to
1,031 code files, divided into 73 groups, reviewed group by group by fresh-context agents.
Eleven files carried a real redundancy; the rest came back reviewed-clean — the expected
ratio for a tree swept the previous day by #3454, #3453 and #3404.

Dead code and dead bookkeeping removed:
- scripts/check-fleet-finding-test-coverage.sh: intermediate missing_tmp pass
- instruction-placement/scripts/detect.sh: manual -- capture loop, dead SECTION_COUNT=0
- claude-ops lanes/machine-behavior.sh: WT_COUNT shadow counter
- knowledge docpage-digest/digest_fences.py: dead `unclosed` bookkeeping
- video-digest build-yt-dlp-args.js: born-dead YT_DLP_CAPTION_ONLY_SLEEP_SUBTITLES_SEC
- video-digest setup-deps.mjs: redundant per-directory localeCompare sort
- video-digest acquisition/acquire.js: double-defaulting spread at the call site

Duplication collapsed onto an existing in-repo form:
- babysit-prs pr_queue_snapshot.py: resolve_self_logins now uses dict.setdefault, as
  babysit_gh.resolve_authors already does
- machine-health Clear-TempFiles.Tests.ps1: parses via the shared ConvertFrom-CheckOutput
- repo-hygiene clean/scan.sh: one echo with ${STALE_REFS:-none}
- planning test suites, claude-config automode-entry-diff.sh, disk-hygiene alias probe,
  work-item-tracker local-markdown and lease suites: small local collapses
- work-items linear/common.sh: duplicated comment clause that inverted its own meaning

Every shipped edit was cleared by a fresh-context refutation verifier briefed to break the
claim rather than confirm it. Notably: 33,825-input exhaustive differential over
casefold-colliding tokens plus 200,000 random sequences for the Python change; 14 input
shapes executed side by side plus a Pester replica under 5.7.1 and 6.1.0 for the PowerShell
change; a 27-value byte-differential plus three end-to-end fixtures for scan.sh.

Test lanes: 209 shell suites passed; 12 Python suites OK; Node 502 + 91 + 41 tests passed.
The 29 Pester suites are OS-gated to Windows and were not run — reported as unrunnable
rather than claimed as passing.

Two valid cleanups under adapters/linear/schema-check were deliberately reverted: those
files map to zero test suites, no CI lane covers them, and the no-suite allowlist states
that an uncovered .mjs should fail rather than be exempted.

High-priority findings filed: #3482, #3483, #3484, #3485.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants