normalize-types-hook-glob: Normalize TypeScript hook glob #1

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

Assigned idea

Benchmark authoring specification.

Summary: Fix the Lefthook pre-commit TypeScript hook glob so it consistently matches js, ts, jsx, and tsx files without embedded spaces.

Task intent: Make an ordinary upstream configuration fix in lefthook.yml: align the pre-commit.commands.types.glob pattern with the existing lint glob so staged JSX and TSX files trigger the type-check hook correctly.

Benchmark plan: Construct the task package around a small repository maintenance change. The prompt should point contributors to the Lefthook pre-commit configuration and ask them to correct the TypeScript hook file glob, not to rewrite hooks or change commands. The expected patch should be limited to replacing *.{js,ts, jsx, tsx} with *.{js,ts,jsx,tsx} in lefthook.yml.

Environment plan: Use the upstream repo checkout at commit c97bcc1c9a965026404ec7197fe6934ae25d5c3a as the environment/repo. The task/environment only needs normal text editing and optionally Node tooling if already available; verification should not depend on installing new packages because the target behavior is a static Lefthook YAML configuration fix.

Verifier plan: test_outputs.py should read lefthook.yml, parse or regex-check the pre-commit.commands.types.glob value, and assert it is exactly *.{js,ts,jsx,tsx}. It should also assert the lint glob remains *.{js,ts,jsx,tsx}, the types command remains npx tsc, and no extra pre-commit command blocks were added. A concrete verifier command can be python test_outputs.py from the repo root.

Oracle plan: The oracle solution is a minimal edit to lefthook.yml changing only the types glob from *.{js,ts, jsx, tsx} to *.{js,ts,jsx,tsx}. No source code or package metadata changes are needed.

Difficulty plan: Current coding systems may over-edit by changing the npx tsc command, adding package scripts, reformatting unrelated YAML, or assuming the space-containing glob is harmless. The verifier should reward the precise configuration correction and reject broad unrelated hook rewrites.

Repo patch scope: Expected upstream edit scope: lefthook.yml only, 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 this only as a normal repository maintenance request.

Approach: Inspect lefthook.yml, compare the lint and types pre-commit globs, and normalize the types glob by removing the embedded spaces inside the brace expansion.

Verification: Run python test_outputs.py; it should confirm lefthook.yml contains glob: "*.{js,ts,jsx,tsx}" for both lint and types while preserving run: npx tsc for the types command.

Risk: The main risk is that Lefthook glob parsing may tolerate some whitespace in some contexts, making the bug subtle. Keeping the verifier focused on exact configuration consistency avoids ambiguity.

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: normalize-types-hook-glob
Branch: task/normalize-types-hook-glob

## Assigned idea Benchmark authoring specification. Summary: Fix the Lefthook pre-commit TypeScript hook glob so it consistently matches js, ts, jsx, and tsx files without embedded spaces. Task intent: Make an ordinary upstream configuration fix in `lefthook.yml`: align the `pre-commit.commands.types.glob` pattern with the existing lint glob so staged JSX and TSX files trigger the type-check hook correctly. Benchmark plan: Construct the task package around a small repository maintenance change. The prompt should point contributors to the Lefthook pre-commit configuration and ask them to correct the TypeScript hook file glob, not to rewrite hooks or change commands. The expected patch should be limited to replacing `*.{js,ts, jsx, tsx}` with `*.{js,ts,jsx,tsx}` in `lefthook.yml`. Environment plan: Use the upstream repo checkout at commit `c97bcc1c9a965026404ec7197fe6934ae25d5c3a` as the environment/repo. The task/environment only needs normal text editing and optionally Node tooling if already available; verification should not depend on installing new packages because the target behavior is a static Lefthook YAML configuration fix. Verifier plan: `test_outputs.py` should read `lefthook.yml`, parse or regex-check the `pre-commit.commands.types.glob` value, and assert it is exactly `*.{js,ts,jsx,tsx}`. It should also assert the lint glob remains `*.{js,ts,jsx,tsx}`, the `types` command remains `npx tsc`, and no extra pre-commit command blocks were added. A concrete verifier command can be `python test_outputs.py` from the repo root. Oracle plan: The oracle solution is a minimal edit to `lefthook.yml` changing only the `types` glob from `*.{js,ts, jsx, tsx}` to `*.{js,ts,jsx,tsx}`. No source code or package metadata changes are needed. Difficulty plan: Current coding systems may over-edit by changing the `npx tsc` command, adding package scripts, reformatting unrelated YAML, or assuming the space-containing glob is harmless. The verifier should reward the precise configuration correction and reject broad unrelated hook rewrites. Repo patch scope: Expected upstream edit scope: `lefthook.yml` only, 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 this only as a normal repository maintenance request. Approach: Inspect `lefthook.yml`, compare the lint and types pre-commit globs, and normalize the types glob by removing the embedded spaces inside the brace expansion. Verification: Run `python test_outputs.py`; it should confirm `lefthook.yml` contains `glob: "*.{js,ts,jsx,tsx}"` for both lint and types while preserving `run: npx tsc` for the types command. Risk: The main risk is that Lefthook glob parsing may tolerate some whitespace in some contexts, making the bug subtle. Keeping the verifier focused on exact configuration consistency avoids ambiguity. 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: normalize-types-hook-glob Branch: task/normalize-types-hook-glob <!-- 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/normalize-types-hook-glob:task/normalize-types-hook-glob
git switch task/normalize-types-hook-glob

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/normalize-types-hook-glob
git switch task/normalize-types-hook-glob
git rebase main
git switch main
git merge --ff-only task/normalize-types-hook-glob
git switch task/normalize-types-hook-glob
git rebase main
git switch main
git merge --no-ff task/normalize-types-hook-glob
git switch main
git merge --squash task/normalize-types-hook-glob
git switch main
git merge --ff-only task/normalize-types-hook-glob
git switch main
git merge task/normalize-types-hook-glob
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-e12f3c587c0145!1
No description provided.