isolate-vitest-type-globals: Isolate Vitest Type Globals #5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "task/isolate-vitest-type-globals"
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: Split the Wazzuf extractor TypeScript configuration so production files do not receive Vitest globals while tests still compile with them.
Task intent: Ordinary upstream-facing work for DaKheera47/job-ops: in extractors/wazzuf, stop exposing vitest/globals through the base TypeScript config used by src and manifest.ts, and add a test-only config that keeps Vitest globals available for tests.
Benchmark plan: Iterate should construct the task package from commit 21cc164d760672b9c5bb52cfc488d87396cf0950 with solver instructions focused only on TypeScript config hygiene in extractors/wazzuf. The package should ask for a minimal upstream-style change: remove test globals and test file inclusion from extractors/wazzuf/tsconfig.json, then add a dedicated test tsconfig extending the base config. Include a verifier that checks the config structure and TypeScript global visibility rather than relying on broad repository behavior.
Environment plan: Environment/repo is the materialized DaKheera47/job-ops repository at the fixed commit. Task/environment should provide Python 3 for test_outputs.py plus Node.js 20+ and installed dependencies for extractors/wazzuf so npx tsc can run locally. The task package should not require network access during verification after dependency installation.
Verifier plan: test_outputs.py should load extractors/wazzuf/tsconfig.json and assert compilerOptions.types keeps node but does not contain vitest/globals, and that include no longer contains ./tests//* while preserving ./src//* and ./manifest.ts. It should require a new extractors/wazzuf/tsconfig.test.json extending the base config, containing compilerOptions.types with both node and vitest/globals, and including ./tests/**/*. It should run concrete checks from extractors/wazzuf such as npx tsc --noEmit -p tsconfig.json and npx tsc --noEmit -p tsconfig.test.json, with temporary probe files proving describe is rejected in src under the base config and accepted in tests under the test config.
Oracle plan: The oracle solution is a minimal diff: edit extractors/wazzuf/tsconfig.json to remove vitest/globals from compilerOptions.types and remove ./tests/**/* from include, preserving module, moduleResolution, target, strict, noUnusedLocals, lib, node types, src, and manifest.ts. Add extractors/wazzuf/tsconfig.test.json that extends ./tsconfig.json, restores compilerOptions.types to include node and vitest/globals, and includes tests together with the necessary project files. The oracle path is validated by the same test_outputs.py checks.
Difficulty plan: Current coding agents may fail by simply deleting vitest/globals and breaking test compilation, by leaving tests in the base config so production still depends on test typing, or by misunderstanding that TypeScript compilerOptions.types in an extending config should be specified explicitly rather than assuming safe merging. The negative probe for src and positive probe for tests make partial fixes hard to pass.
Repo patch scope: Expected upstream edits are limited to extractors/wazzuf/tsconfig.json and a new extractors/wazzuf/tsconfig.test.json. No extractor source files, unrelated package metadata, or other repository directories should be changed.
Anti-leakage notes: Forbid any solver-facing benchmark wording or references to harness, Snorkel, Harbor, std-ts, agent, stage, attempt, retry, generated task, and evaluation context; present only the upstream TypeScript configuration request.
Approach: Modify the base Wazzuf tsconfig so it represents production compilation only, then create a separate test config for Vitest-aware compilation. Run the TypeScript commands from extractors/wazzuf to confirm the split behaves as intended.
Verification: Run python test_outputs.py; it must inspect extractors/wazzuf/tsconfig.json and extractors/wazzuf/tsconfig.test.json, then execute cd extractors/wazzuf && npx tsc --noEmit -p tsconfig.json and cd extractors/wazzuf && npx tsc --noEmit -p tsconfig.test.json with temporary src and tests probe files for global-type visibility.
Risk: The main risk is dependency availability for TypeScript execution; mitigate by installing extractors/wazzuf dependencies before verification and keeping structural JSON assertions as the first checks. Another risk is overfitting by excluding probe names, so the verifier should assert the normal include patterns remain intact.
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: isolate-vitest-type-globals
Branch: task/isolate-vitest-type-globals
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.