Validation guardrails

The framework validates refinement declarations at startup and through CLI commands, preventing invalid overrides before they cause runtime errors.

Table of contents

Startup validation

FeatureIntegrator reads [tool.splent.contract.extensible] from every base feature and [tool.splent.refinement] from every refiner. The RefinementValidator checks three rules:

Rule Error message
Override targets an extensible point "overrides service 'X' from auth, but auth does not declare it as extensible"
No duplicate overrides "overrides service 'X' from auth, but it is already overridden by auth_sso"
Base feature exists in product "refines 'auth' but it is not declared in the product"

If any rule fails, the app refuses to start.


CLI validation

splent feature:xray --validate

Runs the same validation without starting Flask. Use this in CI or before deploying.

Visualizing refinements

splent feature:xray
  splent_feature_notes (refined by splent_feature_notes_tags)
       service: NotesService  <- overridden by splent_feature_notes_tags
         model: Notes  <- extended by splent_feature_notes_tags
          hook: notes.create.form_extra  <- splent_feature_notes_tags
          hook: notes.index.before_list  <- splent_feature_notes_tags
          hook: notes.index.note_extra  <- splent_feature_notes_tags

Use --full to see all extensible points, not just active connections.


See also


Back to top

splent. Distributed by an LGPL license v3. Contact us: drorganvidez@us.es