feat(preflight): clear error when project lacks @playwright/test (v0.1.2) - #4
Conversation
…1.2) Running 9l in a repo that has a package.json but hasn't installed @playwright/test previously fell through to the bare-spec scaffold path: the spec ran detached from the project, its fixture/helper imports failed, and 'heal' then tried to 'fix' those phantom errors — masking the real cause (Playwright just isn't installed). Add a CLI preflight (ensure_project_ready) on the original spec, before the run/heal loop: if no enclosing package.json depends on @playwright/test but one exists, fail fast with an actionable message and exit 2 — never invoking Tier 2. Bare specs (no enclosing package.json) still scaffold. Also: bump to 0.1.2 and enrich PyPI classifiers (per-version Python, OS, console, QA topic).
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
Sigilix OverviewEffort: 2/5 (small) Quality gates
Summary — latest pushAdds a preflight check ( Important files
Confidence: 5/5The change introduces a well-scoped, fail-fast guard with full test coverage for the three distinct project states and carries no risk to existing valid workflows.
Suggested labels:
|
Fixes the real UX sharp edge found during the 0.1.0 smoke test (QUA-1266).
Problem
Running
9l run/9l healinside a repo that has apackage.jsonbut hasn't installed@playwright/testfell through to the bare-spec scaffold path (find_user_projectonly matches a package.json that depends on@playwright/test). The spec ran in a detached temp project, its fixture/helper imports failed, andhealthen tried to "fix" those phantom import errors — masking the real cause (Playwright just isn't installed).Fix
New CLI preflight
ensure_project_ready(spec)called on the original spec at the top ofrun_one/heal_one, before any scaffold/heal:@playwright/test→ proceed;(Preflight keys on the original spec, not the working copy — the heal path stashes the working copy in a tempdir when there's no project, so a check inside
run_specwould miss it.)Also
Tests
test_preflight_*(bare ok / real-project ok / missing-playwright raises). Full suite 28 green, ruff clean.9l heal+9l runagainst a react-onlypackage.jsonemit the message and exit 2 with no Tier 2; bare spec still scaffolds.Ship: merge → tag
v0.1.2→git tag -f v1 && git push -f origin v1.