check:contracts

Introduction

check:contracts checks that the feature contracts and the SPL’s UVL constraints tell the same dependency story. A dependency lives in two places, the feature’s [tool.splent.contract.requires].features and the model’s A => B. feature:install and the marketplace read the first, and product:auto-require and the configuration checks read the second.

splent check:contracts --spl my_spl
  check:contracts  my_spl
  ------------------------------------------------------------
  ⚠  UVL says 'recipes => gallery' but recipes's contract does not require 'gallery'
      fix: add "gallery" to requires.features_manual in splent_feature_recipes/pyproject.toml (preserved on regeneration), or confirm it is SPL-level policy

  0 error(s), 1 warning(s).

It exits 1 when there are errors and 0 otherwise, so it fits in CI next to product:validate.


Checking every SPL

splent check:contracts

Without --spl it checks every SPL the workspace knows, the ones spl:list shows. With none it exits 1.


Fixing what it reports

Every finding prints its fix under it.

Level Finding What to do
Error A contract requires B and the model has no A => B, so a product could select A without B and break at runtime Add the constraint, with spl:add-constraints
Error A contract requires a feature that is not in the model Add the feature to the model, or drop the requirement
Error The model offers a feature that exists nowhere, not in the workspace, the cache or the forge Create and release it, or drop it from the model
Warning A UVL implication no contract backs, invisible to feature:install and the marketplace Add the feature to requires.features_manual, which survives a contract regeneration
Warning The model is not on disk Run the spl:fetch command it prints. With no DOI recorded there is nothing to check against

A model that hardens a dependency the contract lists in requires.features_optional is fine.


Reference

Option Description
--spl SPL Check this SPL only

A feature of the model with no local copy is skipped and listed as not local (skipped). When the forge cannot be asked, offline or rate limited, such a feature is assumed to exist.


Back to top

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