From ef4b640867dd9ccda140f2a6a0ad59a27e2a9337 Mon Sep 17 00:00:00 2001 From: piexel Date: Thu, 8 Oct 2026 20:36:10 +0200 Subject: [PATCH] Let modules declare pack resource kinds and validators: ResourceKind, PackResources.ids, @ResourceRef, the validation API and folders the host reserves --- CONTRACTS.md | 20 ++- DESIGN.md | 59 +++++++- README.md | 91 ++++++++++-- src/main/java/com/volmit/FeatureRegistry.java | 16 ++- src/main/java/com/volmit/IrisModule.java | 4 +- .../com/volmit/config/OptionsMetadata.java | 9 +- .../java/com/volmit/config/ResourceRef.java | 14 ++ .../java/com/volmit/host/DefaultValues.java | 3 +- .../java/com/volmit/host/FeatureCatalog.java | 25 +++- .../java/com/volmit/host/LoadedModules.java | 11 +- src/main/java/com/volmit/host/LoadedPack.java | 2 +- src/main/java/com/volmit/host/ModuleHost.java | 41 ++++-- .../java/com/volmit/host/ModuleRegistry.java | 61 +++++++- .../com/volmit/host/PackSchemaBuilder.java | 50 +++++-- .../volmit/host/ResourceKindRegistration.java | 17 +++ .../java/com/volmit/host/SchemaSource.java | 20 ++- src/main/java/com/volmit/host/TypeDrafts.java | 28 +++- .../volmit/host/ValidatorRegistration.java | 12 ++ src/main/java/com/volmit/host/ValueKinds.java | 113 ++++++++++----- .../com/volmit/host/schema/PackSchema.java | 20 ++- .../host/schema/ResourceKindSchema.java | 26 ++++ .../com/volmit/host/schema/ValueKind.java | 10 ++ .../com/volmit/resource/PackResources.java | 12 +- .../com/volmit/resource/ResourceKind.java | 59 ++++++++ .../java/com/volmit/validation/Problem.java | 25 ++++ .../java/com/volmit/validation/Severity.java | 9 ++ .../java/com/volmit/validation/Subject.java | 49 +++++++ .../volmit/validation/ValidationContext.java | 22 +++ .../java/com/volmit/validation/Validator.java | 12 ++ src/test/java/com/volmit/ApiValuesTest.java | 37 +++++ .../com/volmit/example/ChunkPipelineTest.java | 2 +- .../example/PlacementLifecyclePortTest.java | 2 +- .../com/volmit/host/DiscoveredModuleTest.java | 2 +- .../com/volmit/host/ModuleRegistryTest.java | 68 ++++++++- .../java/com/volmit/host/PackModulesTest.java | 24 ++-- .../java/com/volmit/host/PackSchemaTest.java | 133 ++++++++++++++++++ .../java/com/volmit/host/StageGraphTest.java | 10 +- 37 files changed, 990 insertions(+), 128 deletions(-) create mode 100644 src/main/java/com/volmit/config/ResourceRef.java create mode 100644 src/main/java/com/volmit/host/ResourceKindRegistration.java create mode 100644 src/main/java/com/volmit/host/ValidatorRegistration.java create mode 100644 src/main/java/com/volmit/host/schema/ResourceKindSchema.java create mode 100644 src/main/java/com/volmit/resource/ResourceKind.java create mode 100644 src/main/java/com/volmit/validation/Problem.java create mode 100644 src/main/java/com/volmit/validation/Severity.java create mode 100644 src/main/java/com/volmit/validation/Subject.java create mode 100644 src/main/java/com/volmit/validation/ValidationContext.java create mode 100644 src/main/java/com/volmit/validation/Validator.java diff --git a/CONTRACTS.md b/CONTRACTS.md index dee556ffd..8b8ac2508 100644 --- a/CONTRACTS.md +++ b/CONTRACTS.md @@ -26,7 +26,9 @@ types that carry them and lists what the Iris adapter still owes. | Settings described for studio | `@Desc`, `@Required`, `@MinNumber`, `@MaxNumber`, `@Snippet`, `@Ref`/`Reference`, `FeatureRegistry.registerSettings`, host `LoadedPack.schema()` (`PackSchema`, `FeatureSchema` with `shorthand()`, `ObjectType`, `SchemaOption`, `ValueKind` with `HostKind`), `ModuleHost.describingHostTypesIn` | | Geometry and mantle registration | `FeatureRegistry`, host `ModuleRegistry`, `FeatureCatalog` | | Block states and palettes | `BlockState`, `BlockRegistry`, `BlockPalette` | -| Pack-scoped resolution | `ResourceId`, `ResourceKey`, `PackResources`, `PackBiome`, `PackRegion` | +| Pack-scoped resolution | `ResourceId`, `ResourceKey`, `PackResources` (`find`, `ids`), `PackBiome`, `PackRegion` | +| Module-owned pack resources | `ResourceKind`, `FeatureRegistry.registerResourceKind`, `@ResourceRef`, host `ModuleHost.reservingFolders`, `FeatureCatalog.resourceKinds()`, `ResourceKindSchema`, `ValueKind.ResourceReferenceKind` | +| Module-owned pack checks | `Validator`, `ValidationContext`, `Problem`, `Severity`, `Subject`, `FeatureRegistry.registerValidator`, host `FeatureCatalog.validators()` | | Terrain and settings sampling | `TerrainSampler`, `BiomeSample`, `TerrainSample`, `FeatureSettings` | | Dense chunk output | `Hunk`, `GenerationContext.hunk`, reference `ArrayHunk` | | Sparse geometry and transforms | `ObjectGenerator`, `GeneratedObject`, `ObjectTransform`, `ObjectTransformer` | @@ -39,7 +41,7 @@ invocation seed and its id, so other modules never change its draws. Every value defined by IrisApi (`WorldRandom`), not by the JDK, so a JDK update never changes a world. A module owns its id (`ns:name`, no `/`) and the ids below it (`ns:name/...`). Its stage ids are -below it; feature ids and mantle keys it registers are its id or below it; a settings type in +below it; feature ids, mantle keys and resource kind ids it registers are its id or below it; a settings type in `when(...)` is owned in that sense by a module that names it. Pack modules cannot use the namespaces the host reserves. @@ -68,6 +70,10 @@ naming the jar and the classes. A class nobody has (an optional dependency) only its package is one the module declares optional with `ModuleInfo.withOptionalPackages(...)` (`PackageName`). That declaration never excuses a load error. +A resource kind reads one folder directly below the pack root, with a class no other kind uses; a folder two +kinds claim, or one the host reads itself, fails the pack load naming both owners. Resources of a kind are +values, read once per pack snapshot. Validators only report: an `ERROR` blocks the pack, a `WARNING` is shown. + There is no API version gating. Packs ship their module jars, so their compatibility with the running Iris is the pack publisher's responsibility. @@ -134,6 +140,16 @@ running Iris is the pack publisher's responsibility. - Load the pack again and rebuild the schema files after a module jar in `/modules` changes. - Create settings with their no-argument constructor and decode JSON into that instance, so an omitted field keeps the default studio shows. +- Read every module resource kind (`catalog().resourceKinds()`) from `//**/*.json` the way settings + are decoded, keyed by path without `.json`, id `:`, and serve it through + `PackResources.find` by type and `PackResources.ids`. Read each resource once per pack snapshot, fail `find` for a + file that does not read, and read the files again on every reload. +- Reserve the folders the host reads itself with `ModuleHost.reservingFolders(...)`. +- Write a studio schema per kind for the files below its folder (the host's own description for a `HostKind`), and + complete `ResourceReferenceKind` options, and the host's own references to a kind's class, with the kind's keys. +- Run every validator (`catalog().validators()`) wherever the host validates packs, after its own checks: an + `ERROR` blocks the pack, a `WARNING` is shown; show each problem with its subject. A validator that throws is an + error naming its module, and the others still run. ## Open diff --git a/DESIGN.md b/DESIGN.md index f49c300e3..71643a3b7 100644 --- a/DESIGN.md +++ b/DESIGN.md @@ -2,7 +2,7 @@ Status: pack module loading (`LoadedPack`), the stage graph, per-stage random streams, both pipelines' reference executors, settings catalog and its description for studio, geometry, -resources and typed storage contracts +resources, module resource kinds, validators and typed storage contracts exist and are tested without the Iris engine. Provider and runtime families at the end are design notes, not Java interfaces. @@ -16,7 +16,7 @@ phase or hook has special status in the API. ```mermaid flowchart TD Modules[Built-in and addon modules] --> Install[install: define stages] - Modules --> Register[register: geometry, mantle layers] + Modules --> Register[register: geometry, mantle layers, resource kinds, validators] Install --> Resolve[Resolve per pipeline at pack load] Install --> Settings[when settings types] Settings --> Catalog[Frozen feature catalog] @@ -646,6 +646,7 @@ already keep module fields from colliding with them. | `List`, `E[]` | `ListKind(E, false)` | | `Set` | `ListKind(E, true)` | | `Map` | `MapKind(V)` | +| `String` with `@ResourceRef(Type.class)` | `ResourceReferenceKind(id of the kind read into Type)` | | a class in a host type package, in built-in settings | `HostKind(class name)` | | any other concrete class | `ObjectKind(class name)` | @@ -731,10 +732,60 @@ them, so `OptionsMetadata` reads it with `java.lang.classfile`. A settings class from a jar or a class directory, which every module class does. Which settings an error names first follows feature id order too, so the same pack always fails with the same message. +## Pack resource kinds + +Iris loads its pack resources (biomes, regions, objects, structures...) with one hard-coded loader per type, +so core knew every feature class that had a folder. A module now declares a kind of pack resource itself: +`FeatureRegistry.registerResourceKind(ResourceKind.of(id, folder, type))`. The host reads every `.json` file below +`//` into a new `type` and serves it through `PackResources.find` and `PackResources.ids`, like +the resources it serves itself. + +- **Identity.** A file's key is its path below the folder without `.json`; its id is `:`, + the form every pack resource has. The JSON inside keeps unprefixed keys, the class's field names; namespacing + pack JSON is a later decision. The kind's own id follows the module id like stage ids, feature ids and mantle + keys (`ModuleInfo.ownsId`), and names the kind in errors and studio. +- **Folders.** The module chooses the folder, one folder name directly below the pack root, so a kind that takes + over one of Iris's own keeps the folder and format packs already use. A nested path would let one kind's folder + sit inside another's, whose files the host would then read twice. One folder holds one kind. The host's own + folders are reserved with `ModuleHost.reservingFolders`. Either conflict fails the pack load in `ModuleRegistry`, + naming both owners; the host is named as "the host". +- **Type.** `PackResources` selects a kind by the requested type, so one class backs at most one kind and + `find(new ResourceKey<>(id, Keep.class))` needs no kind id. The class must be concrete; like settings it needs a + no-argument constructor, checked when the pack's description is built. +- **Reading.** The host creates the instance with that constructor and reads the JSON into it, exactly as it + decodes settings, so a missing field keeps its default and studio's defaults are what packs get. +- **Lifetime.** A resource is read once per pack snapshot and every caller gets the same instance, so resources + are values: nobody may change one. A reload is a new snapshot (`snapshotId()` changes) that reads the files + again. A file that fails to read is an error from `find`, not an absent resource. +- **Host types.** A built-in module may read a kind into a class the host describes itself (`describingHostTypesIn`), + so a built-in feature can become a module before its classes are rewritten against IrisApi's annotations; studio + then renders the host's own description of the class. A pack module's kind of a host type fails the load. +- **Studio.** `PackSchema.resources()` lists each kind with its folder and the files' type, an `ObjectKind` + described in `types()` or a `HostKind`. The host writes a schema per kind for the files below its folder. An + option that names a resource of a kind carries `@ResourceRef(Keep.class)`: a class, not a kind id, so the + reference is checked by the compiler and matches how `PackResources` selects kinds. It becomes + `ResourceReferenceKind(kindId)`, and studio completes the kind's keys. Keys are pack paths without a + namespace, so only `String` fits, like the pack references of `@Ref`. A class that backs no kind of the pack + fails the load. + +## Validators + +A module registers `Validator`s with `FeatureRegistry.registerValidator`. The host runs them wherever it validates +a pack, alongside its own checks, with a `ValidationContext`: the pack's `PackResources` (module kinds included), +its `PackSettings` (every entry of every dimension, region and biome of the pack, reachable or not, since a +validator checks files rather than one world) and `report(Problem)`. + +A `Problem` has a `Severity`, a `Subject` and a message. `ERROR` stops the pack from loading, `WARNING` is only +shown: the two outcomes Iris's own validators have. The subject is a resource id or a file path below the pack +root; one id can name resources of several kinds, so a file is the clearer subject where the kind matters. The +host shows the subject with the message. A validator that throws fails the pack's validation with an error +naming its module; the other validators still run. `FeatureCatalog.validators()` lists them by module id, each +module's in registration order, so the order never depends on discovery. + ## Not implemented -- Iris host wiring: JSON decoding and validation, rendering `PackSchema` into Iris's schema and - workspace files, resource loaders, platform block adapters, storage and codecs. +- Host wiring, which lives in Iris: JSON decoding and validation, rendering `PackSchema` into Iris's schema and + workspace files, reading module resource kinds, running validators, platform block adapters, storage and codecs. - Legacy random compatibility. Existing Iris features draw from shared, positional generators in a fixed order. Where existing worlds are promised to stay the same, the adapter has to reproduce those draws inside the ported stages; per-stage streams will not match them on their own. diff --git a/README.md b/README.md index 07efd588f..3d293db62 100644 --- a/README.md +++ b/README.md @@ -51,9 +51,9 @@ public final class MossModule implements IrisModule { The stream is a `WorldRandom` (see Random streams below). `IrisModule.register(FeatureRegistry)` stays for non-stage contributions: geometry generators, -mantle layers and settings no stage names (see Settings for studio). Their feature ids and mantle -keys are the module id or start with it and `/`, like stage ids: `iris:snow` or `iris:snow/depth` -for module `iris:snow`. A settings type named in `when(...)` needs a feature id that at least one +mantle layers, settings no stage names (see Settings for studio), pack resource kinds and validators +(see below). Their feature ids, mantle keys and kind ids are the module id or start with it and `/`, +like stage ids: `iris:snow` or `iris:snow/depth` for module `iris:snow`. A settings type named in `when(...)` needs a feature id that at least one module naming it owns in that sense, or its owner must have registered it, so another module may still condition its stages on it, as moss does on `iris:snow`. @@ -146,6 +146,64 @@ A mantle stage may rely on what earlier stages wrote around its chunk, but not o own pass wrote in other chunks: whether it has run there yet depends on which chunk the host generates first. +## Pack resources of a module + +A module can own a kind of pack file, the way Iris owns biomes and objects: every JSON file below one folder +of the pack, each read into a new instance of a class of the module. + +```java +public static final ResourceKind KEEPS = ResourceKind.of("example:castle/keep", "keeps", Keep.class); + +public void register(FeatureRegistry registry) { + registry.registerResourceKind(KEEPS); // reads /keeps/**/*.json +} + +// anywhere the pack's resources are at hand, such as a stage or a validator +Keep keep = resources.require(KEEPS.key(new ResourceId(resources.packId().namespace(), "towers/north"))); +List all = resources.ids(Keep.class); // every keep of the pack, in id order +``` + +- A file's key is its path below the folder without `.json` (`towers/north`), and its id is + `:`, like every pack resource. JSON keys inside the file are the class's field names. +- The kind's id follows the module id. The folder is one folder name directly below the pack root; the module + chooses it, so a kind that replaces one of Iris's own keeps the folder and file format packs already have. +- One folder holds one kind and one class backs one kind: `PackResources` finds resources by type. Two kinds + claiming one folder, or a folder the host reads itself (`ModuleHost.reservingFolders`), fail the pack load, + naming both owners. +- The host creates each resource with the class's no-argument constructor and reads the JSON into it, as it does + settings, so an omitted field keeps its default. It reads a resource once per pack load and hands every caller + the same instance, so resources are values nobody may change. A reload (studio hotload) reads them again. +- Studio describes the files from the class like settings: `@Desc`, `@MinNumber`, `@Required` and the rest. An + option that names a resource of a kind carries `@ResourceRef(Keep.class)` on a `String`, or a list, set or + array of them, and studio completes the kind's keys. Built-in kinds may read into a class the host describes + itself, as built-in settings may hold one. + +``` +Resource kind example:castle/keep of module example:castle from modules/castle.jar reads folder 'biomes', which the host reads itself; give the kind a folder of its own +``` + +## Validators + +A module checks the pack for problems it cares about with a `Validator`. The host runs every validator of the +pack wherever it validates packs (when a pack loads, when studio opens it, on request) and reports their +problems with its own. + +```java +registry.registerValidator(pack -> { + for (ResourceId id : pack.resources().ids(Keep.class)) { + Keep keep = pack.resources().require(KEEPS.key(id)); + if (keep.towers() > 8) { + pack.report(Problem.error(Subject.file("keeps/" + id.path() + ".json"), "Keep has " + keep.towers() + " towers; at most 8 fit.")); + } + } +}); +``` + +A validator sees the pack's resources, module kinds included, and `pack.settings()`: every settings entry of +every dimension, region and biome of the pack. It reports each `Problem` with a severity and its subject, a +resource id or a file below the pack root. An `ERROR` stops the pack from loading; a `WARNING` is only shown. +A validator reports and returns; one that throws fails the pack's validation, naming its module. + ## Module jars A pack loads its modules from `/modules/*.jar`. One jar holds one module. Its entry point @@ -251,6 +309,9 @@ public final class FloraSettings implements IrisFeature { `PACK_OBJECT` of the pack. The pack kinds fit `String` only, in the form packs use (`desert/dunes`), never `ResourceId`. `BlockState` fields name blocks without it. `@Ref` on any other field fails the load. +- `@ResourceRef(Keep.class)` says that a `String`, or a list, set or array of them, names a resource of the + module resource kind read into that class, by its key (see Pack resources of a module). The class must back a + kind of the pack; anywhere else, or together with `@Ref`, it fails the load. - Packs write settings under the feature id. Built-in modules may also set `@Feature(alias = "stilt")`, a short key existing pack JSON uses; a pack module that sets one fails the load. One JSON object may not hold both. @@ -284,6 +345,7 @@ var host = ModuleHost.of(builtInModules) .reservingNamespaces("iris") .reservingFields(reservedHostFields) .describingHostTypesIn("art.arcane.iris.engine.object") // classes the host describes itself + .reservingFolders("biomes", "regions", "objects") // pack folders the host reads itself .copyingJarsTo(cacheDirectory) // default: java.io.tmpdir .loggingTo(serverLogger); // a System.Logger; default: System.getLogger @@ -305,7 +367,7 @@ try (var pack = LoadedPack.load(packRoot, host)) { `ModuleHost` holds what the host passes to every pack load: built-in modules (their `info()` is read once, here), the host packages pack modules may use, the JSON fields the host itself uses, the -reserved namespaces and the packages of the classes it describes itself. Each method adds to what earlier calls configured. Package names, namespaces and +reserved namespaces, the packages of the classes it describes itself and the pack folders it reads itself. Each method adds to what earlier calls configured. Package names, namespaces and reserved field names are checked when it is built. `LoadedPack.load` loads the pack's jars, installs them after the built-ins, catalogs settings and registrations, describes them for studio and resolves the three pipelines. It returns a complete pack or throws with nothing left open. `close()` @@ -378,8 +440,8 @@ Pack overworld uses 2 modules: A pack without jars logs `Pack overworld uses no modules: no jars in its modules directory`. `LoadedModules.load` installs every module, catalogs the settings types named in `when(...)` -together with explicitly registered settings and geometry and mantle registrations, describes them -and resolves both pipelines. Graph errors +together with explicitly registered settings, geometry and mantle registrations, resource kinds and +validators (`catalog().resourceKinds()`, `catalog().validators()`), describes them and resolves the pipelines. Graph errors (missing requirement, cycle, a stage outside its module's id, duplicate, cross-pipeline edge) fail here, at pack load, and so do reserved namespaces and feature ids or mantle keys outside the module's id. Errors about one module name its jar or "host classpath", and so does a module @@ -405,10 +467,14 @@ no JSON. The host renders it and merges it with its own fields: description, required, minimum, maximum and default value. - `ValueKind` is sealed: `BooleanKind`, `IntegerKind`, `DecimalKind`, `TextKind(format)`, `ReferenceKind(reference, format)`, `EnumKind(type, constants)`, `ListKind(element, unique)`, - `MapKind(value)` and `ObjectKind(type)`, which names an entry of `types()`. `TextFormat` is `PLAIN`, + `MapKind(value)`, `ObjectKind(type)`, which names an entry of `types()`, `HostKind(type)` and + `ResourceReferenceKind(kind)`. `TextFormat` is `PLAIN`, `RESOURCE_ID` or `BLOCK_STATE`. - `snippets()` and `objectGenerators()` pick the types with a snippet name and the object generator features. +- `resources()`: every resource kind, by id. A `ResourceKindSchema` has the kind's id, module, folder and the + files' type: an `ObjectKind` naming an entry of `types()`, or a `HostKind` for a built-in kind whose class the + host describes itself. `ResourceReferenceKind(kind)` is an option naming a resource of a kind by its key. For the stilt example the host sees one `OBJECT_PLACEMENT` feature. The records are abridged: @@ -431,8 +497,9 @@ and closes the edit in every case. Stages get buffered `PlacementAccess` without - `ResourceId` requires a namespace. `ResourceKey` pairs it with a public type. - `PackResources` serves one immutable pack snapshot; caches must not survive a reload. - It serves pack objects (`GeneratedObject`), biomes (`PackBiome`) and regions (`PackRegion`); the - requested type selects the kind, so `BiomeSample` ids look up directly. + It serves pack objects (`GeneratedObject`), biomes (`PackBiome`), regions (`PackRegion`) and every module + resource kind; the requested type selects the kind, so `BiomeSample` ids look up directly. `ids(type)` lists + a kind. - `BlockState` has value equality and sorted properties; `BlockRegistry` checks it against the platform. `BlockPalette` and `NoiseSampler` are typed resources. - `GeneratedObject` is sparse, immutable local geometry. `PlacementRequest` aligns its anchor @@ -470,7 +537,11 @@ explicit registration, built-in modules, the same result whatever the jar order, for each unsupported field type, misplaced `@Ref` (pack kinds on `ResourceId` included), unusable class, bad or repeated snippet name and pack snippet outside its module's folder, host types in built-in settings (and the load error when a pack module uses one), and the one-option shorthand. -`DiscoveredModuleTest` checks that `info()` is read once. `LoadedPackTest` loads a pack with +`PackSchemaTest` also loads a module jar with a resource kind: the kind's files described from its class, +`@ResourceRef` options as references to the kind, built-in kinds of host types, the load error for a pack kind +of a host type, for a folder two kinds claim or the host reserves, and for a misplaced `@ResourceRef`. +`ModuleRegistryTest` checks kind ids, types and folders, and the validator order. `DiscoveredModuleTest` +checks that `info()` is read once. `LoadedPackTest` loads a pack with built-ins and checks that a failed load and `close()` leave nothing open. `PackJarSnapshotTest` checks that classes come from the copies, that the original can be replaced while loaded, that copies go away on close and on failure, that errors name the original jar, and which leftover directories a diff --git a/src/main/java/com/volmit/FeatureRegistry.java b/src/main/java/com/volmit/FeatureRegistry.java index d7a5f0d63..92c36e5eb 100644 --- a/src/main/java/com/volmit/FeatureRegistry.java +++ b/src/main/java/com/volmit/FeatureRegistry.java @@ -4,12 +4,14 @@ import com.volmit.mantle.MantleCodec; import com.volmit.mantle.MantleKey; import com.volmit.mantle.MantleLifetime; import com.volmit.object.ObjectGeneratorFactory; +import com.volmit.resource.ResourceKind; import com.volmit.stage.StageGraph; +import com.volmit.validation.Validator; /** Host implementation collects non-stage registrations before loading pack configuration. * Feature IDs must be unique. JSON fields must be unique per attachment target, including the - * settings types stages name in {@code when(...)}. Feature IDs and mantle keys a module registers - * are its module id or start with it and {@code /}, such as {@code iris:snow} or {@code iris:snow/depth}. + * settings types stages name in {@code when(...)}. Feature IDs, mantle keys and resource kind ids a module + * registers are its module id or start with it and {@code /}, such as {@code iris:snow} or {@code iris:snow/depth}. */ public interface FeatureRegistry { /** Registers a layer before pack loading. Null arguments throw NullPointerException; @@ -30,4 +32,14 @@ public interface FeatureRegistry { * {@link StageGraph}). */ void registerSettings(Class settingsType); + + /** Declares a kind of pack resource this module reads: the JSON files under the kind's folder, served through + * {@link com.volmit.resource.PackResources} by the kind's type and described for studio from its class like + * settings. The pack load fails when another kind has the same id, type or folder, or the folder is one the + * host reads itself; the error names both owners. + */ + void registerResourceKind(ResourceKind kind); + + /** Adds a check the host runs over the whole pack wherever it validates packs. */ + void registerValidator(Validator validator); } diff --git a/src/main/java/com/volmit/IrisModule.java b/src/main/java/com/volmit/IrisModule.java index 52df4b27f..cb0c31eee 100644 --- a/src/main/java/com/volmit/IrisModule.java +++ b/src/main/java/com/volmit/IrisModule.java @@ -16,6 +16,8 @@ public interface IrisModule { */ void install(StageGraph graph); - /** Registers non-stage contributions: geometry generators and mantle layers. */ + /** Registers non-stage contributions: geometry generators, mantle layers, settings no stage names, pack + * resource kinds and validators. + */ default void register(FeatureRegistry registry) {} } diff --git a/src/main/java/com/volmit/config/OptionsMetadata.java b/src/main/java/com/volmit/config/OptionsMetadata.java index 003f92b61..6b9dec202 100644 --- a/src/main/java/com/volmit/config/OptionsMetadata.java +++ b/src/main/java/com/volmit/config/OptionsMetadata.java @@ -13,9 +13,11 @@ public record OptionsMetadata(String description, String snippet, List