typecheck-test-sources: Typecheck test sources without changing production build #4

Open
std-bot wants to merge 1 commit from task/typecheck-test-sources into main
First-time contributor

Assigned idea

Benchmark authoring specification.

Summary: Add a dedicated TypeScript config for test files while preserving the existing production tsconfig boundary that includes src and types declarations but excludes tests.

Task intent: Give maintainers a way to run strict TypeScript checking over tests without changing the production build inputs defined in tsconfig.json.

Benchmark plan: Construct the task package so the solver is asked to add a root-level test typecheck configuration. The package should rely on the observed tsconfig.json behavior: production compilation currently includes src//*.ts and types//*.d.ts while excluding tests. The requested change should be narrow: add a separate config for tests, not broaden the production config.

Environment plan: Use the materialized repo at the specified commit as the upstream repo environment. The task environment should add only the verifier script and any temporary verifier-created probe files; it should not pre-edit repository source files. Run verification with the repo's normal Node/TypeScript tooling, using npx tsc where needed.

Verifier plan: test_outputs.py should assert that tsconfig.tests.json exists at the repository root, extends ./tsconfig.json, sets compilerOptions.noEmit to true, includes tests//*.ts along with the existing production source/declaration globs, and does not inherit an exclusion of tests. It should confirm tsconfig.json still contains include ["src//.ts", "types/**/.d.ts"] and still excludes tests. It should create a temporary tests/typecheck_probe.ts file, run npx tsc -p tsconfig.tests.json --showConfig, and assert the probe file appears there while npx tsc -p tsconfig.json --showConfig does not include it.

Oracle plan: The oracle solution adds tsconfig.tests.json at the repo root with extends set to ./tsconfig.json, compilerOptions.noEmit true, include covering src//*.ts, types//.d.ts, and tests/**/.ts, and exclude limited to node_modules and dist so the inherited production tests exclusion is removed for this config only.

Difficulty plan: A common failure is to add tests to the existing tsconfig.json, which changes production build inputs. Another likely failure is to create an extending config but forget that exclude can keep tests omitted, so the new config appears present but still does not typecheck test files.

Repo patch scope: Expected upstream edits are limited to tsconfig.tests.json, with tsconfig.json only touched if comments or formatting are preserved without changing its production include/exclude semantics.

Anti-leakage notes: Do not expose solver-facing references to benchmark, harness, Snorkel, Harbor, std-ts, agent, stage, attempt, retry, generated task, or evaluation context. Present it only as a normal repository maintenance request.

Approach: Author the package around TypeScript config inheritance and file inclusion. Keep the user-facing request focused on adding a test-only typecheck config while preserving the existing production compile boundary.

Verification: Run python test_outputs.py from the repository root; it should inspect tsconfig.json and tsconfig.tests.json and execute npx tsc -p tsconfig.tests.json --showConfig plus npx tsc -p tsconfig.json --showConfig with a temporary tests/typecheck_probe.ts file.

Risk: Low to moderate: the verifier depends on TypeScript being available through the repo environment, and JSON parsing should tolerate standard tsconfig formatting while still enforcing the required semantics.

Path rules: task package is tasks/; mutable upstream checkout is tasks//task/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: typecheck-test-sources
Branch: task/typecheck-test-sources

## Assigned idea Benchmark authoring specification. Summary: Add a dedicated TypeScript config for test files while preserving the existing production tsconfig boundary that includes src and types declarations but excludes tests. Task intent: Give maintainers a way to run strict TypeScript checking over tests without changing the production build inputs defined in tsconfig.json. Benchmark plan: Construct the task package so the solver is asked to add a root-level test typecheck configuration. The package should rely on the observed tsconfig.json behavior: production compilation currently includes src/**/*.ts and types/**/*.d.ts while excluding tests. The requested change should be narrow: add a separate config for tests, not broaden the production config. Environment plan: Use the materialized repo at the specified commit as the upstream repo environment. The task environment should add only the verifier script and any temporary verifier-created probe files; it should not pre-edit repository source files. Run verification with the repo's normal Node/TypeScript tooling, using npx tsc where needed. Verifier plan: test_outputs.py should assert that tsconfig.tests.json exists at the repository root, extends ./tsconfig.json, sets compilerOptions.noEmit to true, includes tests/**/*.ts along with the existing production source/declaration globs, and does not inherit an exclusion of tests. It should confirm tsconfig.json still contains include ["src/**/*.ts", "types/**/*.d.ts"] and still excludes tests. It should create a temporary tests/__typecheck_probe__.ts file, run npx tsc -p tsconfig.tests.json --showConfig, and assert the probe file appears there while npx tsc -p tsconfig.json --showConfig does not include it. Oracle plan: The oracle solution adds tsconfig.tests.json at the repo root with extends set to ./tsconfig.json, compilerOptions.noEmit true, include covering src/**/*.ts, types/**/*.d.ts, and tests/**/*.ts, and exclude limited to node_modules and dist so the inherited production tests exclusion is removed for this config only. Difficulty plan: A common failure is to add tests to the existing tsconfig.json, which changes production build inputs. Another likely failure is to create an extending config but forget that exclude can keep tests omitted, so the new config appears present but still does not typecheck test files. Repo patch scope: Expected upstream edits are limited to tsconfig.tests.json, with tsconfig.json only touched if comments or formatting are preserved without changing its production include/exclude semantics. Anti-leakage notes: Do not expose solver-facing references to benchmark, harness, Snorkel, Harbor, std-ts, agent, stage, attempt, retry, generated task, or evaluation context. Present it only as a normal repository maintenance request. Approach: Author the package around TypeScript config inheritance and file inclusion. Keep the user-facing request focused on adding a test-only typecheck config while preserving the existing production compile boundary. Verification: Run python test_outputs.py from the repository root; it should inspect tsconfig.json and tsconfig.tests.json and execute npx tsc -p tsconfig.tests.json --showConfig plus npx tsc -p tsconfig.json --showConfig with a temporary tests/__typecheck_probe__.ts file. Risk: Low to moderate: the verifier depends on TypeScript being available through the repo environment, and JSON parsing should tolerate standard tsconfig formatting while still enforcing the required semantics. Path rules: task package is tasks/<slug>; mutable upstream checkout is tasks/<slug>/task/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: typecheck-test-sources Branch: task/typecheck-test-sources <!-- 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/typecheck-test-sources:task/typecheck-test-sources
git switch task/typecheck-test-sources

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/typecheck-test-sources
git switch task/typecheck-test-sources
git rebase main
git switch main
git merge --ff-only task/typecheck-test-sources
git switch task/typecheck-test-sources
git rebase main
git switch main
git merge --no-ff task/typecheck-test-sources
git switch main
git merge --squash task/typecheck-test-sources
git switch main
git merge --ff-only task/typecheck-test-sources
git switch main
git merge task/typecheck-test-sources
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-11d7954bb80d4b!4
No description provided.