typecheck-test-sources: Typecheck test sources without changing production build #4
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "task/typecheck-test-sources"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.