lefthook-types-glob-fix: Fix lefthook TypeScript glob #1

Open
std-bot wants to merge 1 commit from task/lefthook-types-glob-fix into main
First-time contributor

Assigned idea

Benchmark authoring specification.

Summary: Correct the pre-commit type-check glob in lefthook.yml so JSX and TSX staged files are included consistently with the lint hook.

Task intent: Make an upstream-facing configuration fix in lefthook.yml: the pre-commit types command should match JavaScript, TypeScript, JSX, and TSX files without embedded spaces that break extension matching.

Benchmark plan: Construct a regular task package that presents the repository at commit 7ca4b0e84a5b0b99849cb538b33e6ad3d1abfa52 and asks the solver to fix the lefthook pre-commit type-check file glob. The package should focus on the existing lefthook.yml configuration and the mismatch between the lint glob and the types glob. Do not require adding new application code.

Environment plan: The repo environment is the upstream pressto checkout with its existing files. The task environment only needs enough tooling to inspect and edit YAML text; installing project dependencies is optional because verification can operate on lefthook.yml directly.

Verifier plan: Implement test_outputs.py to read lefthook.yml and assert that pre-commit.commands.types.glob is exactly ".{js,ts,jsx,tsx}". Also assert that pre-commit.commands.types.run remains "npx tsc" and that the existing pre-commit.commands.lint.glob remains ".{js,ts,jsx,tsx}". The verifier should fail if the types glob still contains spaces such as "*.{js,ts, jsx, tsx}".

Oracle plan: The oracle solution is a minimal one-line edit to lefthook.yml changing the types glob from ".{js,ts, jsx, tsx}" to ".{js,ts,jsx,tsx}" while leaving the surrounding lint, types, and commit-msg commands unchanged.

Difficulty plan: This is small but easy to miss because the visible configuration looks almost correct. Many coding systems may normalize YAML mentally, overlook the spaces inside the brace expansion, or make unnecessary broader changes to hook commands instead of the precise glob correction.

Repo patch scope: Expected upstream edit scope is limited to lefthook.yml, specifically pre-commit.commands.types.glob.

Anti-leakage notes: Do not expose solver-facing benchmark, harness, Snorkel, Harbor, std-ts, agent, stage, attempt, retry, generated task, or evaluation context. Present only the upstream configuration fix request.

Approach: Inspect lefthook.yml, compare the lint and types globs under pre-commit.commands, and remove the accidental spaces inside the types brace glob so JSX and TSX extensions are matched.

Verification: Run python test_outputs.py after applying the edit; it should validate lefthook.yml contains the corrected types glob and unchanged hook commands.

Risk: Low risk. The main risk is over-editing lefthook.yml or changing command behavior beyond the intended glob correction.

Path rules: task package is tasks/; mutable upstream checkout is tasks//environment/repo; benchmark package files are under tasks//task; verifier/container environment belongs under tasks//task/environment; regular and UI verifier logic belongs in task/tests/test_outputs.py and test.sh only runs that file through pytest.

Agent context

Task slug: lefthook-types-glob-fix
Branch: task/lefthook-types-glob-fix

## Assigned idea Benchmark authoring specification. Summary: Correct the pre-commit type-check glob in lefthook.yml so JSX and TSX staged files are included consistently with the lint hook. Task intent: Make an upstream-facing configuration fix in lefthook.yml: the pre-commit types command should match JavaScript, TypeScript, JSX, and TSX files without embedded spaces that break extension matching. Benchmark plan: Construct a regular task package that presents the repository at commit 7ca4b0e84a5b0b99849cb538b33e6ad3d1abfa52 and asks the solver to fix the lefthook pre-commit type-check file glob. The package should focus on the existing lefthook.yml configuration and the mismatch between the lint glob and the types glob. Do not require adding new application code. Environment plan: The repo environment is the upstream pressto checkout with its existing files. The task environment only needs enough tooling to inspect and edit YAML text; installing project dependencies is optional because verification can operate on lefthook.yml directly. Verifier plan: Implement test_outputs.py to read lefthook.yml and assert that pre-commit.commands.types.glob is exactly "*.{js,ts,jsx,tsx}". Also assert that pre-commit.commands.types.run remains "npx tsc" and that the existing pre-commit.commands.lint.glob remains "*.{js,ts,jsx,tsx}". The verifier should fail if the types glob still contains spaces such as "*.{js,ts, jsx, tsx}". Oracle plan: The oracle solution is a minimal one-line edit to lefthook.yml changing the types glob from "*.{js,ts, jsx, tsx}" to "*.{js,ts,jsx,tsx}" while leaving the surrounding lint, types, and commit-msg commands unchanged. Difficulty plan: This is small but easy to miss because the visible configuration looks almost correct. Many coding systems may normalize YAML mentally, overlook the spaces inside the brace expansion, or make unnecessary broader changes to hook commands instead of the precise glob correction. Repo patch scope: Expected upstream edit scope is limited to lefthook.yml, specifically pre-commit.commands.types.glob. Anti-leakage notes: Do not expose solver-facing benchmark, harness, Snorkel, Harbor, std-ts, agent, stage, attempt, retry, generated task, or evaluation context. Present only the upstream configuration fix request. Approach: Inspect lefthook.yml, compare the lint and types globs under pre-commit.commands, and remove the accidental spaces inside the types brace glob so JSX and TSX extensions are matched. Verification: Run python test_outputs.py after applying the edit; it should validate lefthook.yml contains the corrected types glob and unchanged hook commands. Risk: Low risk. The main risk is over-editing lefthook.yml or changing command behavior beyond the intended glob correction. Path rules: task package is tasks/<slug>; mutable upstream checkout is tasks/<slug>/environment/repo; benchmark package files are under tasks/<slug>/task; verifier/container environment belongs under tasks/<slug>/task/environment; regular and UI verifier logic belongs in task/tests/test_outputs.py and test.sh only runs that file through pytest. ## Agent context Task slug: lefthook-types-glob-fix Branch: task/lefthook-types-glob-fix <!-- std-ts:idea-pr-body -->
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin task/lefthook-types-glob-fix:task/lefthook-types-glob-fix
git switch task/lefthook-types-glob-fix

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff task/lefthook-types-glob-fix
git switch task/lefthook-types-glob-fix
git rebase main
git switch main
git merge --ff-only task/lefthook-types-glob-fix
git switch task/lefthook-types-glob-fix
git rebase main
git switch main
git merge --no-ff task/lefthook-types-glob-fix
git switch main
git merge --squash task/lefthook-types-glob-fix
git switch main
git merge --ff-only task/lefthook-types-glob-fix
git switch main
git merge task/lefthook-types-glob-fix
git push origin main
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
snorkel/root-repository-maintenance-fa5dc9ae42094b!1
No description provided.