Architecture


Table of contents

  1. Introduction
  2. What the index holds
    1. features
    2. spls
    3. collisions
  3. How the index is built
  4. Which copy each reader uses
  5. Dependency kinds

Introduction

The marketplace reads one static document, index.json, built from the features’ contracts and the product lines’ models. This page explains how the index is shaped, built and read, for contributors to the marketplace itself.

splent marketplace:index --registry registry.toml --output index.json

That one command builds it, in CI or on your machine.


What the index holds

{
  "schema": 1,
  "generated_at": "2026-10-06T18:01:58+00:00",
  "generator": "splent_cli/1.26.1",
  "sources": {"orgs": ["splent-io"], "repos": [], "workspace": false,
              "marketplace": "https://marketplace.splent.io"},
  "features": [ ... ],
  "spls": [ ... ],
  "collisions": [ ... ]
}

sources records what the build read. workspace is true for a --local build, and marketplace is null then.

features

One entry per feature, keyed by id (org/repo). Each is the full contract at the latest released tag, plus what only the indexer can compute.

Group Fields
Identity id, org, repo, short, version (latest tag), project_version, source ("forge" for a released tag, "workspace" with --local)
Origin host, where the code lives, and ref, the reference to install it by
Presentation description, archetype, category, tags, env
Contract provides, requires (with feature_versions), extensible, docker, refinement
Settings config, the keys under [tool.splent.config], and schema, the declarations under [tool.splent.config_schema]
Tooling cli_version, requires_python, dependencies
Computed used_by, pypi (published, latest, has_current), repository (url, description, pushed_at, stars, private)

ref leaves the host out only for SPLENT’s own forge, the way Terraform writes hashicorp/aws for its public registry and the full address for any other. A feature on another host keeps it.

{"id": "acme/splent_feature_notes", "host": "github.com",
 "ref": "github.com/acme/splent_feature_notes", "source": "forge"}

Indexes built before host existed called source "github" and the repository github. The marketplace still reads them.

config lists the feature’s settings in declaration order.

"config": [
  {"key": "NOTES_PAGE_SIZE", "default": "20", "required": false,
   "help": "Notes listed on each page."},
  {"key": "SHOP_PAYMENT_SECRET", "default": "", "required": true, "help": ""}
]

default is the value as an env file holds it. required is true for a <SET> value. help is the comment block above the key, or the comment after its value. requires.env_vars is something else, the variables the code reads.

spls

One entry per product line, with name, description, the uvl pin (mirror, doi, concept_doi, version, file) and the parsed model, so consumers never need a UVL parser. model.features holds each feature’s presence, org, package and group, model.alternative_groups the groups, and model.constraints the implications as [a, b] pairs.

A feature’s presence is mandatory when every product of the line has it, as the solver reads the model, and optional otherwise. Each group says whether it is required, which is true when its owner is in every product. model.uvl carries the UVL text itself, for a configurator that solves the model with its own solver, and model.parameters the default of every parameter node. A model the solver cannot read keeps the structural reading and marketplace:index warns about it.

collisions

Features that provide the same route, service or model. Two of them can coexist in a line only behind an alternative group, and the feature sheet and the configurator say so.


How the index is built

What triggers an index build, what it reads and what it writes TRIGGERS A push to main Every 6 hours workflow_dispatch after a release or publish Build job splent marketplace:index --registry registry.toml Forgejo Actions in splent_index READS, ANONYMOUSLY registry.toml, the sources contracts at their tags lines from the marketplace models by DOI from UVLHub WRITES index.json committed back, served raw
Any of three triggers runs one command. It reads its sources without a token, and committing index.json is its only write.

The published index lives in splent-io/splent_index, with registry.toml (the sources), a Forgejo workflow and the index.json it commits back. Only the recipe is written by hand.

Step What happens
When On a push to main (not its own commit), every 6 hours, and on workflow_dispatch
After a release feature:release, release:resume and spl:publish send that workflow_dispatch last, so a new version is listed within minutes. It needs SPLENT_FORGE_TOKEN with write access to splent_index, and is best effort
Build Installs the framework and the CLI, runs marketplace:index and commits the result
Auth Contracts are read anonymously. The job blanks the tokens Forgejo injects, which would hide every other repository
Product lines Read from the marketplace’s public GET /api/v1/spls, each at the DOI it publishes. If the marketplace cannot be read, the build stops and the previous index stays

The options are at marketplace:index.


Which copy each reader uses

Reader Order
CLI (feature:search, feature:info) The workspace cache .splent_cache/marketplace/index.json, then SPLENT_INDEX_URL when there is no cache or with --refresh, then a live query of the forge
Marketplace web feature A 60 second memory cache (SPLENT_INDEX_TTL_SECONDS), then the newer of the workspace cache and SPLENT_INDEX_URL by generated_at, then the last stale copy
Configurator feature The marketplace feature when installed, else the workspace cache, else SPLENT_INDEX_URL

The CLI is local-first, so a fresh --local build shows features not published yet. The web catalog serves whichever copy is newer, so a developer sees their own build and a server follows the published one. Production containers have no workspace cache.


Dependency kinds

The contract tells three kinds of dependency apart, inferred from how the code is written.

Kind Field Inferred from Enforced
Hard requires.features Imports of other features, bare service_proxy("XService") calls and foreign keys to another feature’s table Yes. feature:install resolves them and feature:remove refuses
Soft requires.features_optional A service_proxy or import_module inside a tolerant try, a signal or slot of another feature No. The marketplace shows “works better with”
Manual requires.features_manual Written by the author for what analysis cannot see Yes, like hard

Call service_proxy bare when your feature needs the service, and wrap it in try when it only improves with it. The generator turns that choice into the dependency graph.

check:contracts checks that the contracts and the line’s UVL constraints agree. Run it in CI next to product:validate.


Back to top

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