development-only-lovable-tagger: Development-only Lovable tagger #3

Open
std-bot wants to merge 1 commit from task/development-only-lovable-tagger into main
First-time contributor

Assigned idea

Benchmark authoring specification.

Summary: Refactor the Vite config so production/Cloudflare builds do not load the Lovable development tagger package, while development mode still enables it.

Task intent: Make ordinary upstream-facing maintenance to vite.config.ts: keep the React SWC plugin, @ alias, dev server settings, and Cloudflare dist output, but ensure lovable-tagger is imported and used only when mode === 'development'.

Benchmark plan: Construct a regular coding task from the fixed repo commit that asks the solver to update only the Vite configuration. The prompt should state that production config loading must succeed even if lovable-tagger is unavailable, and development mode must still include the component tagger. Keep the package focused on repo behavior in vite.config.ts; put all checks in an external test_outputs.py.

Environment plan: Task environment: Node.js 20+, npm-installed repo dependencies, and Python 3 for the verifier; no browser or Cloudflare account is needed. Repo environment: use the materialized checkout at the specified commit and load vite.config.ts through Vite’s config loader under production and development modes, temporarily hiding node_modules/lovable-tagger only for the production-mode check.

Verifier plan: test_outputs.py should read vite.config.ts and assert there is no static import from lovable-tagger, while a dynamic import('lovable-tagger') or equivalent development-only dynamic import remains. It should create .verifier/load-vite-config.mjs that calls Vite loadConfigFromFile for vite.config.ts. The verifier should temporarily rename node_modules/lovable-tagger if present, run node .verifier/load-vite-config.mjs production, and assert the config loads with build.outDir === 'dist', server.host === '::', server.port === 8080, and an @ alias ending in /src. It should restore the package, run node .verifier/load-vite-config.mjs development, and assert the development plugin list has more flattened plugin entries than production.

Oracle plan: The oracle solution removes the top-level import { componentTagger } from 'lovable-tagger', makes the defineConfig callback async, builds a plugins array starting with react(), dynamically imports lovable-tagger only inside the mode === 'development' branch, pushes componentTagger() there, and returns the existing server, resolve alias, and build outDir: 'dist' settings unchanged.

Difficulty plan: Current coding agents may see the existing mode === 'development' && componentTagger() expression and miss that the top-level import still loads the package in production. Others may delete the tagger entirely, break the async Vite config shape, forget to preserve .filter(Boolean)-style plugin handling, or accidentally alter the alias/build settings while refactoring.

Repo patch scope: Expected upstream edits are limited to vite.config.ts. Do not change src/, package manifests, lockfiles, generated dist, or unrelated configuration.

Anti-leakage notes: The solver-facing prompt must not mention benchmark, harness, Snorkel, Harbor, std-ts, agent, stage, attempt, retry, generated task, or evaluation context.

Approach: Implement a development-only dynamic import in vite.config.ts and keep all other existing Vite settings semantically identical.

Verification: From the repo root, run npm install and then python test_outputs.py; the verifier runs node .verifier/load-vite-config.mjs production with node_modules/lovable-tagger hidden and node .verifier/load-vite-config.mjs development after restoring it.

Risk: Low scope risk because the behavior is isolated to Vite config loading. Main verifier risk is dependency layout when hiding node_modules/lovable-tagger; mitigate by restoring it in a finally block and using the Vite config API rather than a full browser build.

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: development-only-lovable-tagger
Branch: task/development-only-lovable-tagger

## Assigned idea Benchmark authoring specification. Summary: Refactor the Vite config so production/Cloudflare builds do not load the Lovable development tagger package, while development mode still enables it. Task intent: Make ordinary upstream-facing maintenance to `vite.config.ts`: keep the React SWC plugin, `@` alias, dev server settings, and Cloudflare `dist` output, but ensure `lovable-tagger` is imported and used only when `mode === 'development'`. Benchmark plan: Construct a regular coding task from the fixed repo commit that asks the solver to update only the Vite configuration. The prompt should state that production config loading must succeed even if `lovable-tagger` is unavailable, and development mode must still include the component tagger. Keep the package focused on repo behavior in `vite.config.ts`; put all checks in an external `test_outputs.py`. Environment plan: Task environment: Node.js 20+, npm-installed repo dependencies, and Python 3 for the verifier; no browser or Cloudflare account is needed. Repo environment: use the materialized checkout at the specified commit and load `vite.config.ts` through Vite’s config loader under production and development modes, temporarily hiding `node_modules/lovable-tagger` only for the production-mode check. Verifier plan: `test_outputs.py` should read `vite.config.ts` and assert there is no static import from `lovable-tagger`, while a dynamic `import('lovable-tagger')` or equivalent development-only dynamic import remains. It should create `.verifier/load-vite-config.mjs` that calls Vite `loadConfigFromFile` for `vite.config.ts`. The verifier should temporarily rename `node_modules/lovable-tagger` if present, run `node .verifier/load-vite-config.mjs production`, and assert the config loads with `build.outDir === 'dist'`, `server.host === '::'`, `server.port === 8080`, and an `@` alias ending in `/src`. It should restore the package, run `node .verifier/load-vite-config.mjs development`, and assert the development plugin list has more flattened plugin entries than production. Oracle plan: The oracle solution removes the top-level `import { componentTagger } from 'lovable-tagger'`, makes the `defineConfig` callback async, builds a plugins array starting with `react()`, dynamically imports `lovable-tagger` only inside the `mode === 'development'` branch, pushes `componentTagger()` there, and returns the existing server, resolve alias, and build `outDir: 'dist'` settings unchanged. Difficulty plan: Current coding agents may see the existing `mode === 'development' && componentTagger()` expression and miss that the top-level import still loads the package in production. Others may delete the tagger entirely, break the async Vite config shape, forget to preserve `.filter(Boolean)`-style plugin handling, or accidentally alter the alias/build settings while refactoring. Repo patch scope: Expected upstream edits are limited to `vite.config.ts`. Do not change `src/`, package manifests, lockfiles, generated `dist`, or unrelated configuration. Anti-leakage notes: The solver-facing prompt must not mention benchmark, harness, Snorkel, Harbor, std-ts, agent, stage, attempt, retry, generated task, or evaluation context. Approach: Implement a development-only dynamic import in `vite.config.ts` and keep all other existing Vite settings semantically identical. Verification: From the repo root, run `npm install` and then `python test_outputs.py`; the verifier runs `node .verifier/load-vite-config.mjs production` with `node_modules/lovable-tagger` hidden and `node .verifier/load-vite-config.mjs development` after restoring it. Risk: Low scope risk because the behavior is isolated to Vite config loading. Main verifier risk is dependency layout when hiding `node_modules/lovable-tagger`; mitigate by restoring it in a `finally` block and using the Vite config API rather than a full browser build. 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: development-only-lovable-tagger Branch: task/development-only-lovable-tagger <!-- 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/development-only-lovable-tagger:task/development-only-lovable-tagger
git switch task/development-only-lovable-tagger

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/development-only-lovable-tagger
git switch task/development-only-lovable-tagger
git rebase main
git switch main
git merge --ff-only task/development-only-lovable-tagger
git switch task/development-only-lovable-tagger
git rebase main
git switch main
git merge --no-ff task/development-only-lovable-tagger
git switch main
git merge --squash task/development-only-lovable-tagger
git switch main
git merge --ff-only task/development-only-lovable-tagger
git switch main
git merge task/development-only-lovable-tagger
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-fa5dc9ae42094b!3
No description provided.