Commit Graph

2 Commits

Author SHA1 Message Date
Caleb c52c89ddf5 feat(epic-execute): UI contract - ui: harness schema, preflight, test-id planning
Frontend analog of the API/DB contract harness: declare UI user-flow contracts
and validate readiness to run them. Per-story Playwright flow execution is the
next increment.

Harness (contract-harness.sh):
- New ui: section (driver, base_url, tests_dir, selector_strategy, roles, flows)
  in the schema + scaffold template
- _ui_preflight checks the browser driver (Playwright/Cypress, presence only),
  the tests directory, and that each declared role has a session seed
- Role-seed commands now feed prerequisite inference, so their env vars and
  executables are checked like any other harness command

Design phase (design-phase.sh):
- Frontend lens now requires a stable data-testid on every interactive element
  and a per-AC user_flow with an allowed/forbidden expectation
- Frontend schema gains components[].test_ids and a structured user_flows shape
- Critic enforces test-ids + user-flow expectations; validate_domain_completeness
  warns (advisory) when interactive components lack a data-testid

data-testid is adopted incrementally - the lens requires it on the components a
story touches, with accessible role/label fallback for pre-existing ones. The
"credentials" piece is separate: ui.roles seeds for permission-based checks.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 05:28:36 -05:00
Caleb b3a41e577e feat(epic-execute): contract harness preflight + dry-run readiness gate
Let a project declare a contract-validation harness (contract-harness.yaml)
describing how to bring up a sample/test environment and verify API + database
contracts. The system validates readiness itself - the user never hand-checks.

- contract-harness.sh: discover the harness, auto-derive prerequisites from its
  own commands (env var refs, executables, file paths) plus an optional
  requires: block, then run a presence preflight with a ✓/✗ readiness report
- Startup wiring: real runs fail fast (abort before story 1 if prerequisites are
  missing); dry runs print the report and exit non-zero when anything required
  is missing, so --dry-run works as a CI readiness gate
- Opt-in deep connectivity smoke (--preflight-deep) boots the sample env, polls
  the readiness URL, and tears down
- Safety guard: warns when the datastore target looks production-scoped
  (contract validation must only ever touch a throwaway/test store)
- --init-harness scaffolds a commented template; --skip-contract-validation
  bypasses the gate; full --help/usage documentation

Opt-in by presence of the harness file - projects without one are unaffected.
Parses/validates harness `cases`; executing them per-story is the next
increment.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-03 08:04:57 -05:00