Skip to content

Fix frontend validation readiness in worktrees - #449

Open
adriandemian wants to merge 7 commits into
mainfrom
ralphx/ralphx/agent-e188a852
Open

Fix frontend validation readiness in worktrees#449
adriandemian wants to merge 7 commits into
mainfrom
ralphx/ralphx/agent-e188a852

Conversation

@adriandemian

@adriandemian adriandemian commented Jun 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Tighten frontend validation handling in worktrees so validation discovers the frontend/ package context, runs from the package directory, and uses the local Vitest binary rather than a root/global fallback.
  • Add backend readiness checks around frontend install/validate steps so partial node_modules trees do not count as ready just because the directory exists.
  • Expand merge-validation coverage for frontend readiness edge cases, including command sanitization, cached success paths, package.json-based frontend detection, and readiness failure handling.
  • Include a small metrics IPC contract adjustment so workspace delivery-trend counts stay aligned with the current event-backed model.

User Impact

Frontend worktrees should now validate against the actual app package instead of accidentally treating the repository root as the execution context. That reduces false-ready installs, avoids running the wrong Vitest binary, and makes readiness failures surface before validation proceeds.

The metrics IPC change keeps workspace-count reporting consistent with the delivery-trend contract used by the UI and tests.

Technical Context

  • agents/ralphx-project-analyzer/shared/prompt.md now tells the analyzer to emit path: "frontend" when the only Node package lives under frontend/package.json, and it avoids passing vitest.config.ts as a test target.
  • A new frontend_readiness module centralizes frontend-specific cwd selection, Vitest command sanitization, package-context detection, executable checks, and Node import probes for vitest/config, react, zod, and @tauri-apps/api.
  • run_install_phase and run_validate_phase now consult that readiness logic before skipping installs or starting validation, and they fail early when frontend dependencies are still incomplete.
  • Merge-validation state now carries an optional install command on analysis entries so validate can bootstrap missing frontend dependencies before retrying validation.
  • The merge-validation test suite adds focused regression coverage for the new frontend readiness behavior and the sanitized Vitest command paths.
  • src-tauri/tests/metrics_commands.rs was updated to keep the IPC delivery-trend contract aligned with the workspace-count expectations.

Risks / Follow-Ups

  • Frontend validation is now stricter about what counts as ready, so any incomplete or unusual local package layout may fail earlier than before.
  • The readiness checks rely on package inspection and import probes; if a project uses an atypical frontend stack, it may need an explicit validation shape that fits this detection.
  • Vitest command sanitization is targeted at the command forms covered here, so other custom invocation patterns may still need follow-up if they appear in real projects.

Generated by RalphX

@codecov

codecov Bot commented Jun 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.82456% with 29 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...ne/transition_handler/merge_validation/validate.rs 84.84% 15 Missing ⚠️
...ion_handler/merge_validation/frontend_readiness.rs 91.77% 13 Missing ⚠️
...ine/transition_handler/merge_validation/install.rs 96.42% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@adriandemian adriandemian changed the title Fix frontend validation readiness in worktrees Harden frontend validation readiness in worktrees Jun 21, 2026
@adriandemian adriandemian changed the title Harden frontend validation readiness in worktrees Fix frontend validation readiness in worktrees Jun 21, 2026
@adriandemian
adriandemian marked this pull request as ready for review June 24, 2026 15:03
@adriandemian
adriandemian requested a review from lazabogdan June 24, 2026 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant