Skip to content

feat: add study validation and ui mcp automation (STUDYU-78) - #903

Draft
johannesvedder wants to merge 39 commits into
devfrom
feat/studyu-mcp
Draft

johannesvedder wants to merge 39 commits into
devfrom
feat/studyu-mcp

Conversation

@johannesvedder

@johannesvedder johannesvedder commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Description

Combines and supersedes #866 and #902 in a single branch targeting dev. Tracks STUDYU-78.

  • Adds the composable StudyU validator library, JSON Schema validation, and studyu_validator CLI.
  • Adds generated StudyU model documentation and drift checks.
  • Adds the repository-owned studyu_mcp server for participant app and Designer v2 automation through Flutter Driver and the Dart VM service.
  • Adds driver-enabled Melos commands and onboarding coverage in the web E2E workflow.
  • Restricts MCP VM-service connections to loopback hosts.
  • Incorporates current dev and resolves the stacked branches' merge conflicts.

Visuals

No user-facing UI changes. A recording of the MCP-driven app flow should be attached before merging.

Testing Steps

  1. Run scripts/pre-commit-check.
  2. Run fvm exec melos run test --scope studyu_core --scope studyu_validator.
  3. Run cd tools/studyu_mcp && fvm dart test.
  4. Start local Supabase and run fvm exec melos run local:app:driver.
  5. Start fvm exec melos run mcp:studyu with the printed VM-service URI.
  6. Verify read_screen, app_complete_onboarding_to_study_list, and app_get_visible_studies.

PR Checklist

  • fvm exec melos qualitycheck passes
  • Formatting passes via scripts/pre-commit-check
  • Dart and Flutter analyzers pass via scripts/pre-commit-check
  • StudyU core and validator tests pass
  • StudyU MCP unit tests pass
  • Screenshot or video attached
  • Description links related issues

ibrahimozkn and others added 30 commits July 1, 2026 16:11
- field table: show `field (json_key)` when names differ; add Default
  column populated from field initializers and @jsonkey(defaultValue:)
- remove `<!-- Human prose goes here. -->` placeholder from skeleton
  and strip it from previously generated pages on next --write run
- dispatcher pages (Question, Expression): collect concrete subtype
  wire values scoped to the same directory, not all classes globally
- filter keyType constants so they are not misread as wire values
- drift check: fail when metadata describes a field absent from source
  (unless virtual: true) and when metadata is missing a title
- mark SliderQuestion.initial as virtual in _metadata.yaml (getter only)
- add doc_metadata_test.dart (7 tests) and expand generated_block_test
  and page_scope_test with discriminator and fieldLabel coverage
- 41 unit tests passing, 0 analyzer warnings
Replace blank default cells with - in generated field tables.
Add model_scanner_test.dart covering buildDispatcherDiscriminators
and ScannedField/ScannedClass data classes.
Regenerate all doc pages to reflect the new placeholder.
Empty consent at publish level must be an error, not a warning — the
CLI section flag test specifies this contract.
feat(core): add study_data_docs generator and generated docs tree
Add a two-stage study-data validation pipeline: a fast JSON Schema gate
over raw decoded JSON, followed by the existing Study.fromJson plus
cross-entity Dart validators only when schema validation succeeds.

- core/tool/emit_schema.dart: standalone emitter generating
  core/lib/src/validators/schema/study.schema.json from the committed
  model serializers (Draft 7, additionalProperties: false, oneOf
  discriminators with const, nullable via type arrays/anyOf)
- studyu_validator: insert schema pass into validateJson and
  validateSection, add --schema-only flag and replace schema stub with
  schema subcommand printing the checked-in schema
- .github/workflows/schema-validate.yml: node-only CI validating the
  portable fixture against the schema with ajv-cli
- pubspec.yaml: add docs:study-data:schema melos script
- tests: 20 cases proving stage separation, schema-only mode, schema
  command, and conflicting flag rejection
ajv-cli does not include format validators, causing date-time format
in the schema to be rejected. Use ajv + ajv-formats directly instead.
@github-actions

github-actions Bot commented Jul 23, 2026 •

Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit f45eee0):

(expires Wed, 05 Aug 2026 13:11:41 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 2149dad49ed83535217e50d5c18c0c8c90da629b

@coderabbitai

coderabbitai Bot commented Sep 21, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app core dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants