Skip to content

refactor: repo-wide batch-simplify re-sweep — 1,031 files reviewed, 11 redundancies removed - #3486

Merged
kyle-sexton merged 10 commits into
mainfrom
claude/code-tidying-batch-simplify-bx7vgv
Aug 29, 2026
Merged

refactor: repo-wide batch-simplify re-sweep — 1,031 files reviewed, 11 redundancies removed#3486
kyle-sexton merged 10 commits into
mainfrom
claude/code-tidying-batch-simplify-bx7vgv

Conversation

@kyle-sexton

Copy link
Copy Markdown
Contributor

No linked issue

Summary

A full-repository /code-tidying:batch-simplify re-sweep. The 3,375 tracked files were filtered to 1,031 code files, divided into 73 groups, and reviewed group by group by fresh-context agents. Eleven files carried a real redundancy; the other ~1,020 came back reviewed-clean.

That ratio is the expected result, not a shortfall. PR #3454 (the previous repo-wide batch-simplify), #3404 (dissolve-comments) and #3453 (audit-comment-residue) all merged the day before this sweep started, so the prompts were calibrated hard against churn: no style preferences, no comment rewording, no reordering, no "modernization" a reviewer could not distinguish from noise. An edit had to be a genuine simplification — redundancy removed, dead code removed, a real duplication collapsed — with behavior provably identical.

Fix

Eleven files, grouped by what was removed.

Dead code and dead bookkeeping

  • scripts/check-fleet-finding-test-coverage.sh — dropped an intermediate missing_tmp pass.
  • plugins/instruction-placement/scripts/detect.sh — replaced a manual -- argument-capture loop with the marketplace's precedented EXPLICIT+=("$@"); break, and removed a dead SECTION_COUNT=0 initializer.
  • plugins/claude-ops/skills/lanes/scripts/machine-behavior.sh — removed the WT_COUNT parallel counter; both reads now use ${#WT_LINES[@]} directly, matching the file's existing WANT_PLUGINS idiom.
  • plugins/knowledge/skills/docpage-digest/scripts/digest_fences.py — removed unclosed bookkeeping from parse_claims; the flag was assigned on both arms of the try and the trailing if unclosed could never change the already-computed value.
  • plugins/knowledge/skills/video-digest/extraction/acquisition/build-yt-dlp-args.js — removed the born-dead export YT_DLP_CAPTION_ONLY_SLEEP_SUBTITLES_SEC (zero references at any commit; the consumed constant lives in acquire-retry-policy.js).
  • plugins/knowledge/skills/video-digest/extraction/setup-deps.mjs — removed a redundant per-directory localeCompare sort inside computeStamp's walk; the final code-unit path sort alone determines hash-input order.
  • plugins/knowledge/skills/video-digest/extraction/acquisition/acquire.js — dropped a double-defaulting spread at the acquireFullStaged call site.

Duplication collapsed onto an existing in-repo form

  • plugins/source-control/skills/babysit-prs/scripts/pr_queue_snapshot.pyresolve_self_logins kept a result list alongside a seen set whose only job was tracking keys the result already implied; now the dict.setdefault form the sibling babysit_gh.resolve_authors already uses.
  • plugins/machine-health/.../tests/windows/remediations/Clear-TempFiles.Tests.ps1 — parses check output through ConvertFrom-CheckOutput, as sixteen sibling suites already do, instead of inlining that helper's own body.
  • plugins/repo-hygiene/skills/clean/scripts/scan.sh — a two-branch if printed the literal Git stale refs dry-run: in both arms; now one echo with ${STALE_REFS:-none}, matching the sentinel form the preceding line uses.
  • plugins/planning/scripts/{check-open-questions,goal-condition-length}.test.sh — inline --help assertions replaced with the suite's own expect_exit.
  • plugins/claude-config/.../automode-entry-diff.sh:365, plugins/claude-ops/.../claude-observability.test.sh, plugins/disk-hygiene/.../test_python3_alias_probe.py, plugins/work-items/.../local-markdown/common.test.sh, plugins/work-items/.../lib/lease.test.sh — small local collapses of the same kind.
  • plugins/work-items/.../adapters/linear/common.sh — removed a duplicated comment clause that inverted its own meaning; the restored sentence is what adapters/gitea/common.sh:43-45 already carries verbatim.

Verification

Behavior preservation. Every shipped edit was cleared by a fresh-context refutation verifier briefed to break the claim, with "looks fine" explicitly rejected. All returned NOT-REFUTED. The strongest evidence:

  • pr_queue_snapshot.py — exhaustive differential over a 33-token casefold-colliding alphabet (ß/SS/, U+212A Kelvin, İ/ı, ligatures, combining iota) for lengths 0–3: 33,825 inputs, 0 divergences; plus 200,000 random sequences and a 67,584-group codepoint sweep, also zero. Every call site traced; the sole production consumer wraps the result in frozenset(...).
  • Clear-TempFiles.Tests.ps1 — 14 input shapes executed side by side (blank-line interleave, @(), $null, top-level and nested arrays, falsy 0/$false/'', non-JSON), plus a Pester-structure replica passing under both 5.7.1 and 6.1.0 confirming mocks still intercept through the new call path.
  • scan.sh — 27-value byte-differential under four shell option combinations, plus old-vs-new whole-script runs over three git fixtures; stdout, stderr and exit status byte-identical throughout.

Test lanes (all run sequentially, as the guardrails suites assert wall-clock ceilings):

Lane Result
scripts/affected-tests.sh --run (38 changed files) 209 shell suites passed, exit 3 = 103 selected for other ecosystems
Python (12 suites) all OK — including 104 tests in the babysit-prs set
Node — video-digest 71 files / 502 tests passed
Node — course-digest 10 files / 91 tests passed
Node — ai-briefing build 41/41 passed
Pester (29 suites) NOT RUNtests/windows is OS-gated (Invoke-MachineHealthTests.ps1:102) and this is Linux; the runner selects a tests/linux tree that does not exist. The one edited file parse-checks clean under pwsh 7.6.5.

Gates: check-changelog-parity.sh --check and --check-bump origin/main both pass; check-cross-plugin-source-drift.sh --check reports no unregistered or drifted clusters.

Two things I did not ship, deliberately. Two valid cleanups in adapters/linear/schema-check/ were reverted: those files map to zero test suites, and this repo treats that as an error rather than "nothing to run". No CI lane covers them (they need a fetched schema and a manual npm install graphql), and affected-tests-no-suite.txt says in its own header that an uncovered .mjs should fail there — so an allowlist entry would have been a coverage claim the repo cannot honor. A dead = [] initializer is not worth that.

Related

Findings filed from this sweep's deferral ledger, High priority only:

Prior sweeps this one re-swept: #3454, #3453, #3404. Open findings from those (#3407#3451, #3374#3375) were treated as a skip list and left alone.

Follow-up not addressed here: the garbled comment clause fixed in adapters/linear/common.sh also lives in the adapter generator template at plugins/work-items/skills/onboard-adapter/scripts/templates/common.sh.tmpl:43-45, so newly generated adapters will reproduce it. .tmpl files were excluded from this sweep as rendered content, and no gate diffs shipped adapters against the template, so nothing currently breaks.

Roughly 160 sub-High deferrals (dedup candidates blocked by the recorded per-plugin test-helper decision, perf items that would change process counts or failure isolation, and cosmetic items rejected as churn) were recorded and not filed, per repo-mode policy.


Generated by Claude Code

claude added 10 commits August 28, 2026 06:07
…test-coverage (batch-simplify wave 1)

Repo-mode batch-simplify wave 1 (groups: root-config, scripts/lib,
scripts parts 1-4). Sole change: check-fleet-finding-test-coverage.sh
drops the intermediate missing_tmp build-then-read pass and tests
"! kind_asserted && un-baselined" directly over emitted_tmp in --check
mode (-8 lines, one fewer temp file). All other 130 files in the wave
reviewed clean. Behavior preserved: black-box old-vs-new comparison was
byte-identical across green/discover/forced-red runs, a fresh-context
refutation verifier could not construct a counterexample across 19
attack scenarios, and the suite passes (11/11) via affected-tests.sh.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FXfW1Ro1VBjjHSBewern3X
… drop dead initializer (batch-simplify wave 3)

Repo-mode batch-simplify wave 3 (groups: code-tidying, context-guard,
discovery, docs-hygiene, guardrails lib, instruction-placement). Sole
change: detect.sh replaces the manual `--` capture loop with the
marketplace-precedented `EXPLICIT+=("$@"); break` and removes a dead
SECTION_COUNT=0 initializer. All other 61 files in the wave reviewed
clean. Behavior preserved: fresh-context refutation verifier ran 23
argv/edge-case attacks old-vs-new (byte-identical stdout/exit codes)
plus the full 40-case suite; changelog parity (--check, --check-bump)
and the 16 affected suites pass. instruction-placement 0.11.10 ->
0.11.11 with changelog entry.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FXfW1Ro1VBjjHSBewern3X
…t (batch-simplify wave 4)

Repo-mode batch-simplify wave 4 (groups: planning, plugin-quality,
rate-limit-guard, session-flow, skill-quality, source-control misc).
Sole change: the check-open-questions and goal-condition-length test
suites use their own expect_exit helper for the --help exit-code case
instead of a hand-rolled inline assertion. All other 66 files in the
wave reviewed clean. Behavior preserved: fresh-context refutation
verifier compared old-vs-new suites byte-for-byte on the passing path,
verified argv is uncontaminated by the helper's stdin argument, and
confirmed identical detection power against mutated subjects (--help
exiting 1; --help reading stdin); both suites pass via
affected-tests.sh. planning 0.34.11 -> 0.34.12 with changelog entry.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FXfW1Ro1VBjjHSBewern3X
…helper (batch-simplify wave 5)

Repo-mode batch-simplify wave 5 (groups: work-items misc, small-plugins
parts 1-2, disk-hygiene lib+clean, disk-hygiene setup, autonomy setup).
Sole change: test_python3_alias_probe.py's make_file helper drops a
hand-rolled open("wb") context manager with a dead zero-size guard for
path.write_bytes(b"\0" * size). All other 90 files in the wave reviewed
clean. Behavior preserved: fresh-context refutation verifier confirmed
byte-identical contents/permissions across all sizes the suite uses
(matching CPython's own write_bytes implementation) and 10/10 tests
pass in the python lane. disk-hygiene 0.20.30 -> 0.20.31 with
changelog entry.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FXfW1Ro1VBjjHSBewern3X
…r in automode-entry-diff (batch-simplify wave 6)

Repo-mode batch-simplify wave 6 (groups: ai-briefing build+tests,
claude-config audit/audit-instructions/audit-permission-state,
claude-memory skills). Sole change: automode-entry-diff.sh's
empty-prediction guard loses its printf command-substitution wrapper;
the value's grammar (non-empty IFS-trimmed rules each followed by one
newline) makes the wrapper's trailing-newline stripping unobservable,
so the two tests are equivalent in every reachable state. All other
70 files in the wave reviewed clean. A first attempt at this group was
interrupted by a rate limit and its partial edit reverted; the retry
re-derived the change independently with a full equivalence proof, and
a fresh-context refutation verifier could not refute it (static trace,
12-case empirical matrix, 63/63 suite checks, no-writes property
intact). claude-config 0.40.14 -> 0.40.15 with changelog entry.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FXfW1Ro1VBjjHSBewern3X
…atch-simplify-bx7vgv

# Conflicts:
#	plugins/claude-config/.claude-plugin/plugin.json
#	plugins/claude-config/CHANGELOG.md
#	plugins/disk-hygiene/.claude-plugin/plugin.json
#	plugins/disk-hygiene/CHANGELOG.md
#	plugins/instruction-placement/CHANGELOG.md
#	plugins/planning/.claude-plugin/plugin.json
#	plugins/planning/CHANGELOG.md
…(batch-simplify wave 7)

Repo-mode batch-simplify wave 7 (groups: claude-ops lanes +
observability, docs-hygiene audit-noise, kindle-dedrm manage,
knowledge docpage-digest + map-corpus). Changes: lanes'
machine-behavior.sh drops the WT_COUNT parallel counter in favor of
${#WT_LINES[@]}; observability's claude-observability.test.sh collapses
two case-based substring checks into its own assert_contains helper;
docpage-digest's digest_fences.py removes dead `unclosed` bookkeeping
from parse_claims. All other 66 files in the wave reviewed clean. Each
change refutation-verified by a fresh-context agent (divergence traces,
old-vs-new fixture matrices, glob-metacharacter probes; 26/26, 33/33,
and 30-test suites identical), and the 5 affected suites pass via
affected-tests.sh on the merged tree. claude-ops 0.38.17 -> 0.38.18,
knowledge 0.13.23 -> 0.13.24, with changelog entries.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FXfW1Ro1VBjjHSBewern3X
…ocument absorbed wave-7 edits (batch-simplify wave 8)

Repo-mode batch-simplify wave 8 (groups: course-digest extraction top +
adapters/lib, video-digest extraction top + acquisition + adapters/evals
+ harvesting/lib). One new change: acquisition/acquire.js passes
mergedDeps directly to acquireFullStaged instead of re-injecting a
withThrottle value that was by construction mergedDeps' own value or
the same default the callee re-derives; a fresh-context refutation
verifier traced the full case matrix (function, absent, null, falsy
non-callable) and found no divergent reachable shape. This commit also
expands the knowledge 0.13.24 changelog entry to name two edits that
wave 7's broad staging absorbed into 282a837 before their write-ups:
setup-deps.mjs's redundant inner sort removal and build-yt-dlp-args.js's
born-dead export removal - both since refutation-verified byte-identical
(stamps identical under readdir scrambling; zero references to the dead
export at any commit, no export-enumeration observers). All other 108
files across the wave reviewed clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FXfW1Ro1VBjjHSBewern3X
…simplify waves 9-11)

Final wave of the repo-wide /code-tidying:batch-simplify re-sweep. Groups G58-G73
(machine-health Pester suites, repo-hygiene clean, babysit-prs, the pull-request
skill, and the whole work-item-tracker tree including all five adapters and
plugins/miro) were reviewed file by file; ~200 files came back reviewed-clean and
these six carried a real redundancy.

- machine-health Clear-TempFiles.Tests.ps1: parse check output through the shared
  ConvertFrom-CheckOutput helper, as sixteen sibling suites already do, instead of
  inlining the helper's own body.
- repo-hygiene scan.sh: one echo with ${STALE_REFS:-none} in place of a two-branch
  if that repeated the output label in both arms.
- source-control pr_queue_snapshot.py: resolve_self_logins dedupes via
  dict.setdefault, matching babysit_gh.resolve_authors, instead of carrying a
  parallel seen set.
- work-items linear/common.sh: drop a duplicated comment clause that inverted its
  own meaning; the restored sentence is what gitea/common.sh already carries.
- work-items local-markdown/common.test.sh: source via the SCRIPT_DIR the previous
  line already computed.
- work-items lib/lease.test.sh: name the injected fixed clock directly rather than
  recomputing it as BOUNDARY_EXPIRY - BOUNDARY_TTL * 3600.

Behavior preservation was checked by fresh-context refutation verifiers, which were
asked to break each claim rather than confirm it. The PowerShell change was cleared
against fourteen input shapes executed side by side plus a Pester replica passing
under both 5.7.1 and 6.1.0; the Python change against an exhaustive differential
fuzz over casefold-colliding tokens; the scan.sh change against a twenty-value byte
differential and three end-to-end fixtures.

Two candidate edits under adapters/linear/schema-check were reverted rather than
shipped: those files map to no test suite, and this repo deliberately treats that as
an error rather than as nothing to run. No CI lane covers them, so an allowlist entry
would have been a coverage claim the repo cannot honor.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FXfW1Ro1VBjjHSBewern3X
origin/main advanced nine commits while the sweep's final wave ran. No code
conflicts: none of main's 126 changed files overlaps any file this branch touched.

Eight conflicts, all in version manifests and CHANGELOGs where both sides bumped
the same plugin. Resolved by renumbering this branch's entries strictly above
main's current versions and keeping both sides' prose, ordered descending:

- claude-ops     0.38.18 -> 0.38.20 (main took 0.38.18 and 0.38.19)
- instruction-placement 0.11.12 -> 0.11.13 (collision: both wrote 0.11.12)
- knowledge      0.13.24 -> 0.13.25 (collision: both wrote 0.13.24)
- source-control 0.55.31 kept (already above main's 0.55.30)
- work-items     0.39.40 kept (already above main's 0.39.39)

check-changelog-parity.sh --check and --check-bump origin/main both pass.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FXfW1Ro1VBjjHSBewern3X
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 29, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-29T00:48:13.019697Z 1ba2cb0 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@claude

claude Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 2m 47s —— View job


Code review complete

  • Gather context (PR body, changed files, /review:code-review skill)
  • Check skip gate (open/draft/trivial/already-reviewed) — none apply, reviewed
  • Review changed files for correctness & maintainability
  • Post inline findings (none — see below)
  • Post final summary

Scope. This repo carries a claude-security-review.yml workflow, so security is out of scope for this lane per REVIEW.md. I independently diff-read all 11 files the PR body claims carry a real simplification, plus the mechanical plugin.json/CHANGELOG.md pairs, against origin/main...HEAD. I did not re-run the author's test/differential claims (Test plan, 33,825-input differential, Pester runs, etc.) — those are author-claimed and unverified by me; I verified logical equivalence by reading the code instead.

Findings: none. Every non-mechanical hunk holds up as behavior-preserving:

  • scripts/check-fleet-finding-test-coverage.sh — the --check loop now checks ! kind_asserted "$kind" && ! baselined directly over emitted_tmp instead of pre-computing missing_tmp; same predicate, same iteration set, one fewer temp file.
  • plugins/claude-ops/skills/lanes/scripts/machine-behavior.shWT_COUNT was a pure shadow of ${#WT_LINES[@]}, incremented 1:1 with array appends; both read sites now read the array length directly.
  • plugins/instruction-placement/scripts/detect.shEXPLICIT+=("$@"); break inside the --) case arm is equivalent to the manual per-arg shift loop it replaced; the loop was inside while [[ $# -gt 0 ]], so break exits it cleanly. SECTION_COUNT=0's removal is safe — the only real assignment is a later, independent SECTION_COUNT="$(grep -c ...)" at detect.sh#L414.
  • plugins/knowledge/skills/docpage-digest/scripts/digest_fences.pyfence = fences[0] if fences else None already yields None on the exception path (fences = []), so the removed if unclosed: fence = None was a no-op on both arms of the try.
  • plugins/knowledge/skills/video-digest/extraction/acquisition/acquire.jsacquireFullStaged computes deps.withThrottle ?? withAcquireThrottle internally (acquire.js#L220), identical to how the caller's throttle was derived; passing plain mergedDeps instead of {...mergedDeps, withThrottle: throttle} reaches the same value.
  • build-yt-dlp-args.js — confirmed YT_DLP_CAPTION_ONLY_SLEEP_SUBTITLES_SEC has zero references anywhere else in the tree.
  • setup-deps.mjscomputeStamp's final files.sort() (line 55) is a full string sort of the whole path list, so the per-directory localeCompare sort during traversal was provably redundant.
  • plugins/source-control/skills/babysit-prs/scripts/pr_queue_snapshot.pydict.setdefault(login.casefold(), login) + list(.values()) preserves first-seen order identically to the old seen-set + list-append pattern (Python 3.7+ dict order guarantee).
  • plugins/repo-hygiene/skills/clean/scripts/scan.sh${STALE_REFS:-none} is exactly equivalent to the two-armed if [[ -n "$STALE_REFS" ]] it replaced.
  • plugins/claude-config/skills/audit-permission-state/scripts/automode-entry-diff.sh:365 — worth noting I checked this one harder: [[ -z "$predicted_dropped" ]] vs. the old [[ -z "$(printf '%s' "$predicted_dropped")" ]] differ only if predicted_dropped could ever be pure newlines (command substitution strips trailing newlines, plain -z doesn't). Traced every append site — both are gated on -n "$rule" (automode-entry-diff.sh#L188), so the variable is always either "" or contains real rule text before any \n. The edge case can't occur; the simplification is safe.
  • plugins/work-items/.../adapters/linear/common.sh — the restored comment now matches adapters/gitea/common.sh:43-45 verbatim; comment-only, no behavior change.
  • The plugins/planning/*.test.sh, claude-observability.test.sh, Clear-TempFiles.Tests.ps1, test_python3_alias_probe.py, and lease.test.sh collapses each check out to a helper/expression that's already used elsewhere in the same file or a sibling suite, with matching call signatures — no divergence found.

Version bumps are all patch-level (x.y.Z+1) with matching CHANGELOG.md entries, consistent with a no-behavior-change refactor batch.

No inline comments were posted since no findings survived review.

@claude

claude Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 48s —— View job


Security review — /review:security-review

  • Gather context (PR diff, changed files)
  • Apply skip-gate check
  • Review changed files for security-relevant surface
  • Post findings (or clean bill of health)

Skip gate: no security-relevant surface. I reviewed the full diff (git diff origin/main...HEAD, 38 files, +151/-78) at HEAD 1ba2cb0. It is a repo-wide /code-tidying:batch-simplify sweep: dead-code/dead-bookkeeping removal, small duplication collapses, and the accompanying plugin.json version bumps + CHANGELOG.md entries. None of it touches authentication, authorization, secrets/credentials, injection surfaces (command, SQL, path, template), or GitHub Actions workflow files/permissions — this lane's scope per its skill definition.

Spot-checked the changes with any nominal exposure and found nothing exploitable:

  • plugins/knowledge/skills/video-digest/extraction/acquisition/acquire.js#L307 — dropped a redundant withThrottle: throttle spread key already present in mergedDeps; no change to what gets passed to the network call.
  • plugins/work-items/tools/work-item-tracker/adapters/linear/common.sh#L42-L47 — comment-only correction (SC1091 rationale), no behavior change.
  • plugins/source-control/skills/babysit-prs/scripts/pr_queue_snapshot.py#L117-L126resolve_self_logins dedup logic changed from a list+set to a dict.setdefault; preserves the same casefold-based collision handling, no new trust boundary.

No CRITICAL, IMPORTANT, or SUGGESTION findings. Nothing posted inline.

@github-actions

Copy link
Copy Markdown

Last security-reviewed head: 1ba2cb0cd030a6c19e5add515470569eb941a861. 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 bfefed9 into main Aug 29, 2026
60 checks passed
@kyle-sexton
kyle-sexton deleted the claude/code-tidying-batch-simplify-bx7vgv branch August 29, 2026 00:55
kyle-sexton added a commit that referenced this pull request Aug 30, 2026
…ed) (#3492)

No linked issue

## Summary

Full-repository `/code-tidying:batch-simplify repo` sweep: 1,154 code
files in 68 dependency-ordered groups across 12 waves, each group read
end to end by a dedicated simplifier agent and every non-empty diff
adversarially checked by a fresh-context refutation verifier. Only
behavior-preserving changes land; deferred findings are being worked in
this same branch rather than filed as issues. This PR grows by one
commit per wave; this body's Verification section is updated as waves
land.

## Fix

Wave 1 (root config, `lib/` SSOT, `scripts/`; 98 files read, 5 changed):

- `scripts/affected-tests.sh`: `lang_family()` converted from
command-substitution return to a `LANG_FAMILY` global (one fork saved
per frontier path and per reverse-lookup hit, per the header's Windows
spawn budget); single-use `invoke_print_manifest` wrapper inlined.
Selection proven byte-identical old-vs-new across ten seed scenarios.
- `scripts/check-fleet-finding-test-coverage.sh`: baseline temp file
replaced by an ordered in-memory array (same order/duplicate semantics,
one fewer mktemp + trap arg).
- `scripts/check-orphaned-fixtures.sh`: nested two-`find` walk collapsed
to one `find -print0 | sort -z` pipeline; live-tree discovery
byte-identical (363 entries). Only delta: a synthetic `evals/fixtures`
nested inside another fixtures tree was double-reported by the old code
and is reported once now.
- `scripts/check-plugin-catalog-enablement.sh`: header env-override list
gains the missing `PLUGIN_CATALOG_ENABLEMENT_BOOTSTRAP` entry
(comment-only).
- `lib/hook-utils.test.sh`: seven stale `hook-utils.sh:<line>` comment
references refreshed (stale since #3463; comments only).

Waves 2–12 and a deferred-work pass follow on this branch.

## Verification

- shellcheck (repo `.shellcheckrc`) clean on every touched file.
- `scripts/affected-tests.sh --run` over all five changed files: 124
selected shell suites pass; the seven delegated Python suites run
directly, all pass except
`plugins/disk-hygiene/lib/test_hook_telemetry.py`, whose
`test_absolute_sink_used_as_is` races a fire-and-forget subprocess and
fails at HEAD too on fast machines (untouched by this wave; robustness
fix queued for the disk-hygiene wave in this branch).
- All four `lib/` sync clusters verified drift-free (`scripts/sync-*.sh
--check`).
- Per-group fresh-context refutation verifiers: NOT-REFUTED for the
`affected-tests.sh` and `lib/hook-utils.test.sh` diffs (differential
runs byte-identical); the orphaned-fixtures nested-double-report delta
above was surfaced by its verifier and accepted as strictly more
correct.

## Related

Refs #3486 (prior repo-wide simplify sweep this run re-verifies), #3463
(source of the stale test-comment line numbers), #3488 (recent
shell-portability perf work in the same scripts area).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01W61wikkiEK5StWgg9rfEQW

---
_Generated by [Claude
Code](https://claude.ai/code/session_01W61wikkiEK5StWgg9rfEQW)_

---------

Co-authored-by: Claude <noreply@anthropic.com>
kyle-sexton added a commit that referenced this pull request Aug 31, 2026
## Summary

Second and final delivery of the repo-wide
`/code-tidying:batch-simplify` sweep (waves 1-3 merged in #3492). This
PR carries waves 4-12 of the 68-group sweep plus the deferred-work pass
that closes out every actionable finding the sweep recorded.

Sweep waves (each edit refutation-verified by a fresh-context verifier
before shipping; near-zero yield expected and confirmed after the #3486
sweep two days prior):

- Waves 4-8 (previously pushed): claude-ops hook-failure-audit early
exit and restart-consumer locals, disk-hygiene telemetry test race fix,
markdown-format inert ctx_reset removal, knowledge dead-export removals,
machine-health dead test helpers, plus per-wave version bumps
(claude-ops 0.38.21, disk-hygiene 0.20.35, markdown-format 0.11.35,
knowledge 0.13.28, machine-health 0.11.17, and siblings).
- Wave 9: provenance 0.4.2, `check-stamps.sh` duplicate-branch collapse
(25-case executed input matrix, byte-identical).
- Wave 10: repo-hygiene 0.10.19, stale `shellcheck disable=SC2086`
removed from `git-prune.sh` (proven inert under the pinned ShellCheck).
- Wave 11: source-control 0.55.32, `fetch-annotations.sh`
comment-accuracy fix (comment was wrong from its first commit).
- Wave 12: zero net edits; three provably-locally-stale SC2154 disables
were reverted by an orchestrator consistency ruling to keep the 51-file
byte-uniform disable header intact.
- Two refutations led to full reverts earlier in the run (claude-ops
jq_fields consolidation; knowledge spawn merge), both with executed
counterexamples.

## Fix

Deferred-work pass (commit "Deferred-work pass", reviewed as a whole by
a fresh-context adversarial pass): root scripts (changelog-parity
message spacing plus test pin, cheatsheet named diagnostic for
frontmatter-less SKILL.md, allowScripts lockstep to 2.1.246,
deletion-aware `affected-tests.sh` with two suite cases and README
contract update); guardrails 0.29.24 (verify-cli-flag printf-pipe with
ten-case byte-identical differential, require-jq zero-match count fix);
machine-health 0.11.18 (doc name fix, real `[Console]::Error` capture in
ElevationBanner tests, Restart-StoppedService Linux stubs 0 to 10
passing, Scaffold env pin 17+3 to 20); claude-config 0.40.21 (case-label
renumber); discovery 0.16.18 (root-env visible skip);
instruction-placement 0.11.14 (render-index brace-glob corruption fix
plus pins); rate-limit-guard 0.7.21 and context-guard 0.7.28 (statusline
tees exchange proven hardening: >1MiB pass-through, noclobber temp
writes, SIGKILL temp reclaim; zero-fork assertions and bench floor
unchanged); source-control 0.55.33 (three `--help` printers stop
truncating, one recovering 38 lines); work-items 0.39.42 (vacuous
conformance assert removed, schema-check tree comment fix plus no-suite
allowlist entry); knowledge 0.13.29 (orphaned `promotion-name-map.js`
removed, zero importers re-proven).

## Verification

- Every sweep edit passed a fresh-context refutation verifier with
executed evidence; every deferred fix shipped with reproduce-then-fix
evidence and before/after suite counts.
- Full-suite union run vs origin/main: 146 shell suites passed or
skipped; non-shell lanes run directly (Pester file-by-file under pwsh
7.6.5, Python lanes, knowledge vitest 154/154 plus tsc, miro npm
typecheck/lint/test/verify-bundle).
- Gates green at every push: changelog parity (`--check-bump`,
`--check-order`), vendor bump, catalog `--check`, cheatsheet `--check`.
- An independent adversarial review over the deferred-work diff surfaced
two findings; both are fixed in this PR (the deletion-aware
affected-tests handling and a changelog wording correction).

## Related

No linked issue. Follows #3492 (waves 1-3) and the prior repo sweep
#3486.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01W61wikkiEK5StWgg9rfEQW

---------

Co-authored-by: Claude <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