tslib-helper-dependency: Declare tslib helper dependency #1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "task/tslib-helper-dependency"
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: The top-level TypeScript config enables compilerOptions.importHelpers in tsconfig.base.json, so emitted helpers are imported from tslib. The work is to make that dependency explicit and add a local check that prevents clean installs from relying on a transitive tslib package.
Task intent: Implement ordinary upstream-facing TypeScript dependency hygiene for zip-captions: because tsconfig.base.json sets importHelpers to true, ensure the project has a direct runtime dependency on tslib and expose a check script that verifies this invariant before builds.
Benchmark plan: Construct the work package from the fixed commit with a solver-facing prompt that references only the upstream behavior: TypeScript helper imports are enabled in tsconfig.base.json and the repo should not rely on transitive tslib. The expected change is to add a small Node script at scripts/check-tslib-dependency.mjs, wire it through package.json as check:tslib, and add or preserve a direct dependencies.tslib entry.
Environment plan: Task/environment: provide Python 3 plus Node.js and npm, with no external services. Environment/repo: materialize jptrsn/zip-captions at the specified commit, do not alter tsconfig.base.json during setup, and run commands from the repository top level using the package metadata already present in the repo.
Verifier plan: test_outputs.py should load tsconfig.base.json and assert compilerOptions.importHelpers remains true. It should load package.json and assert dependencies.tslib is present with a non-empty string value, not only devDependencies. It should assert package.json has a check:tslib script that runs node scripts/check-tslib-dependency.mjs, run npm run check:tslib expecting exit code 0, then create a temporary copy with dependencies.tslib removed and run node scripts/check-tslib-dependency.mjs expecting a nonzero exit and an error mentioning both tslib and importHelpers.
Oracle plan: The oracle patch adds scripts/check-tslib-dependency.mjs using Node built-ins to parse tsconfig.base.json and package.json. When importHelpers is true, the script exits 1 unless package.json dependencies contains tslib; otherwise it exits 0. The oracle also adds the package.json check:tslib script and adds or preserves a direct tslib dependency, updating the existing lockfile only if the dependency was newly added.
Difficulty plan: Current coding agents may fail because importHelpers is a compile-time option with runtime dependency impact. Common wrong fixes include disabling importHelpers, putting tslib only in devDependencies, adding a superficial script that never parses the config, or overlooking package-manager lockfile consistency.
Repo patch scope: Expected edits are limited to package.json, scripts/check-tslib-dependency.mjs, and the existing package-manager lockfile if adding tslib changes it. Do not require changes under app source directories or changes to tsconfig.base.json.
Anti-leakage notes: The solver-facing prompt and any repo files added for the work must not mention benchmark, harness, Snorkel, Harbor, std-ts, agent, stage, attempt, retry, generated task, or evaluation context; phrase the request as normal project maintenance for TypeScript helper dependencies.
Approach: Use Node fs/path JSON parsing to read tsconfig.base.json and package.json. If compilerOptions.importHelpers is true, require package.json dependencies.tslib to exist; print an actionable error and exit 1 if missing. Add npm script check:tslib and keep tslib as a runtime dependency.
Verification: Run python test_outputs.py from the completed repo; it inspects tsconfig.base.json, package.json, and scripts/check-tslib-dependency.mjs, runs npm run check:tslib, and performs the temporary-copy negative check by removing dependencies.tslib and expecting node scripts/check-tslib-dependency.mjs to fail with a message naming tslib and importHelpers.
Risk: If the repo already declares tslib, the dependency portion may be a no-op, so the verifier must require the new check script and package.json script. If installs are slow, verification can avoid full builds because the check script uses only Node built-ins.
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: tslib-helper-dependency
Branch: task/tslib-helper-dependency
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.