feat: add type-level ownership checks to the layer validator

Ouverte
#28 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
22/100
Type d'issue
Fonctionnalité
Clarté
Plutôt claire
Activité
Active
Stack technique
dart, flutter
Domaine
tooling

Piste de recherche

Start with the ffca-layer-auditor agent and domain.md, which define the ownership rules and the Summary pattern. The issue is blocked by #22 (moving the validator into Very Good CLI) and uses severity levels from #21, so confirm both are merged before building on them. Done means three rules (data implementing another feature's domain interface as an error, domain interfaces using another feature's models as a warning, and domain public APIs importing dart:ui, Flutter, or backend types as an error), each with fixtures and tests, and the agent consuming these results.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

feature

Description

Some ownership rules can only be checked by looking at types, not at pubspecs or import directives. The ffca-layer-auditor agent covers them with an LLM today.

The validator stays a dependency-free script in this plugin: moving it into Very Good CLI was decided against. package:analyzer is therefore not available, since it would need dart pub get in scripts/ before the hook could run. These checks have to work from source text, the way the import checks from #25 do: read class … implements … declarations and repository method signatures, and resolve type names through the file's imports. A rule that cannot be checked reliably that way stays with the auditor.

Requirements

  • Error: a class in {f}_data implements a repository interface from another feature's _domain. The dependency on that domain is allowed, but the data layer implements only its own domain's interfaces.
  • Warning: a repository interface in {f}_domain takes or returns a model from another feature's _domain. This is what the Summary pattern in domain.md avoids. Sometimes legitimate, hence a warning (#21).
  • Error: {f}_domain uses dart:ui, Flutter types, or backend types (Firebase, HTTP clients) in its public API. The domain layer is pure Dart (domain.md).
  • Each check works from source text with no new dependencies. A rule that would need full type resolution to avoid false positives stays with the auditor, and the issue says which.
  • Fixtures and tests for each rule.
  • The ffca-layer-auditor agent relies on these results instead of checking the same rules itself.
  • All CI/CD checks are passing.
  • There is no drop in the test coverage percentage.

Additional Context

Uses the severity levels from #21 and the directive scanner from #31.

Langage dominant
Dart
Étoiles
7
Forks
2
Merge moyen
2 j 8 h
PR mergées (30 j)
9

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de VeryGoodOpenSource/vgv-ffca-plugin

Toutes les issues de VeryGoodOpenSource/vgv-ffca-plugin

Issues similaires

Plus d'issues Dart

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.