Skip to content

fix(uncheck): second whole-package review: safer fixes, fewer false greens, faster tsc plans - #21

Merged
dinwwwh merged 29 commits into
mainfrom
claude/packages-uncheck-review-3101ec
Oct 2, 2026
Merged

dinwwwh merged 29 commits into
mainfrom
claude/packages-uncheck-review-3101ec

Conversation

@dinwwwh

@dinwwwh dinwwwh commented Oct 2, 2026

Copy link
Copy Markdown
Member

A second review of the whole package. Every finding was reproduced with the real CLI and checked by independent reviewers before it was fixed. --fix no longer rewrites installed packages. The hooks and file-scoped runs now catch the type errors a full run catches. The pre-commit hook keeps working through package renames, sparse checkouts and hooks written by older versions.

Fixes

  • uncheck --fix, the agent hook and the pre-commit hook never hand oxlint or oxfmt a file in node_modules, or a link into it or out of the project. With pnpm, this rewrote the shared store.
  • tsc now runs where tsc itself would:
    • from a subfolder, using the tsconfig.json above it;
    • for deleted or moved files;
    • for packages that depend on a changed package through a workspace link;
    • when a base config extended by package name is removed.
  • tsc no longer writes vite.config.js next to vite.config.ts in Vite 4/5 projects, and projects built in place are checked against fresh declarations.
  • With paths given, a broken setup (no tools, no tsconfig) fails instead of passing, and the reason names the actual cause.
  • Pre-commit hook:
    • Package lines skip packages with nothing staged or no folder, so renames, removals and sparse checkouts no longer block every commit.
    • The line now runs in husky 4 hooks, and lines that older versions appended after an exec are moved to where they run.
    • The line lands after quoted setup and trailing comments, and never empties an if/else block.
    • Hand-written --cwd lines are left alone.
  • uncheck staged:
    • An edit saved while tsc runs stays unstaged and survives a conflict.
    • Ctrl-C during git commit -i/-p puts the unstaged changes back.
    • The verdict is printed last.
    • The empty-commit message also holds for --amend.
  • Agent hook:
    • It blocks again after another Stop hook (such as /goal) continued the turn.
    • It checks the agent's project from submodules, nested clones and outside git.
    • sherif only reports.
    • Copilot's sessionId is read.
    • A --dir that names a file gives a clean error.
  • sherif:
    • "fix": true no longer rewrites files on report-only runs.
    • A settings-only pnpm-workspace.yaml is not treated as a workspace root.
  • prepare, staged and the agent hook all report a repository git refuses (dubious ownership), and a symlinked --cwd resolves correctly.

Output changes

  • Whole-project runs show ▶ oxlint --ignore-pattern=node_modules --no-error-on-unmatched-pattern and ▶ oxfmt --check --no-error-on-unmatched-pattern. A folder with nothing to lint or format now passes.
  • Package hook lines read git --literal-pathspecs diff --cached --quiet -- "dir" || [ ! -d "dir" ] || (cd "dir" && …) || exit 1. The next prepare rewrites existing lines in place.

Performance

  • Package hook lines no longer start the package manager for packages a commit does not touch, which saved about 0.5 s per untouched package in the review's timing.
  • The tsc plan reads each config once and asks git once which projects build in place. Planning a 300-package monorepo takes under 0.2 s instead of 1.8–5 s.

Docs

  • The README matches the code:
    • the hook guarantees now cover tsc;
    • prepare flags belong in the prepare script;
    • production installs need || exit 0;
    • the presets need oxfmt 0.43+.

Testing

  • The suite has 854 e2e tests (667 before) at 100% statement, branch, function and line coverage. uncheck passes on this repo, and the production bundle builds and runs.
  • The test harness now isolates the global git ignore and attributes files, tool configs above the temp folder, and the pnpm store links.
  • The signal, lock and concurrency tests now fail when the behaviour they guard breaks.

dinwwwh added 29 commits October 1, 2026 13:54
… folder, place hook lines around husky 4 and quoted setup
…ymlinked --cwd, test the hook lock deterministically
- use the nearest tsconfig.json above a folder that has none, scoped to the folder's files
- add the projects of workspace packages that depend on a selected one
- check reference graphs whose projects would emit next to their sources with tsc -p --noEmit
- pass config paths starting with - or @ to tsc with ./
- leave unreachable tsconfig paths to tsc instead of aborting the run
- skip shared bases named tsconfig.json, select the extenders of a deleted base
- build the clean projects that -p checked ones reference first, so -p reads fresh declarations
- look for a tsconfig.json above the folder only inside its git repository
- test workspace dependents reached through references and peer or optional dependencies
…iew-3101ec

# Conflicts:
#	packages/uncheck/src/commands/uncheck.ts
…ves a dying commit index and names what it skipped
…reads setup without comments, keeps lines in blocks
…s solutions in the -p fallback, uses the config above a folder without its own, and names a missing typescript

- R5: a references member that emits beside its sources stays in tsc -b when git ignores its would-be JavaScript
- R8: an affected solution without sources in a -p graph is checked with -p, so a missing reference fails with TS6053
- R6: the config above cwd is used whenever cwd has no tsconfig.json of its own, next to the nested ones
- R7: workspace dependents also come from the packages owning the given files, before the not-covered exit
- R9: a deleted base extended by package name selects its extenders
- R11/R17: no tsconfig.json fails even for unrelated files; a missing typescript reads 'not installed'
- R19: README scopes deleted or moved files to the hooks
…etc/gitattributes and ancestor ignore files, wait for parallel prepares
…ows links, reads Copilot's sessionId and reports a repository git refuses
- the runner skips a check that plans no commands, replacing the guards in
  oxlint and oxfmt and the evenIfRequired flag; literal runs imply the
  fixes stay within the given files
- shared helpers replace copies (fileKind, resolveFolders, isOutside,
  logLines, a batched git listing, one copyBack); rawDiff always ends with --
- the agent hook finds its repository with one git call and looks it up once
  when the agent works in its project folder
- tsc reads each config and its extends chain once per run and asks git once
  which projects build in place, so planning a 300-package monorepo drops
  from about 2-5 s to under 0.2 s with the same plans
- tests share their repeated constants and assertion helpers
@pullfrog

pullfrog Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

This run was cut short: your Pullfrog Router balance ran out mid-run.

OpenRouter stopped the agent because the per-run budget was exhausted. Your wallet is now negative; top up or enable auto-reload to keep runs flowing.

Top up balance → · Enable auto-reload →

Pullfrog  | Rerun failed job ➔ | View workflow run | via Pullfrog | Using deepseek-v4.1-flash (default — pick a model for stronger reviews) | 𝕏

@pkg-pr-new

pkg-pr-new Bot commented Oct 2, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/uncheck@21

commit: 12831b9

@codecov

codecov Bot commented Oct 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@dinwwwh
dinwwwh merged commit fd9ad7b into main Oct 2, 2026
7 of 8 checks passed
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.

1 participant