Summary
class_t dictionary attributes carry a class_type that names a node in the family's extends taxonomy (the family root such as base_module for "any module", a category: true node such as integration, or a concrete class). The valid values for the attribute are that node's concrete descendants. Two parts of the server ignore class_type and must be brought in line so scoping is enforced consistently.
Background — what already works
The sample generator (Schema.Generator.get_valid_classes/1) and the exported JSON Schema (Schema.JsonSchema.encode_class/3) already scope correctly: they list Utils.find_children(class_type) minus category: true classes. Setting an attribute's class_type to a category (e.g. integration) already restricts those two paths to that branch. No change is needed there.
The gaps to fix
-
Runtime validator does not enforce class_type. Schema.Validator (used by the /validate API) resolves a class_t entry against the whole family (Schema.find_class(family, …)) and the only membership check rejects the base class. It never consults class_type, so a class from the wrong branch — or an abstract category: true class used as a concrete value — passes validation.
-
UI type link ignores class_type. In SchemaWeb.PageView (format_type/2), a class_t attribute's type always links to /{family}s (e.g. /modules), regardless of class_type.
-
Tests covering the validator scope error (class_out_of_scope) and the three class_t link cases.
Notes
- Keep the existing convention of naming the family root (
base_skill / base_domain / base_module) to mean "any class of the family". No dictionary changes are required for this issue.
- Matching the resolved class to the valid set is done by class
:name (unique within a family; present on both the find_children entries and the enriched resolved class).
Out of scope (separate follow-up)
The new integration_types attribute on the record object — adding it to record.json, the dictionary (class_type: "integration"), and the matching record.proto field, plus the end-to-end "wrong-branch" validation test — will be handled in a separate issue/PR on top of this one.
Summary
class_tdictionary attributes carry aclass_typethat names a node in the family'sextendstaxonomy (the family root such asbase_modulefor "any module", acategory: truenode such asintegration, or a concrete class). The valid values for the attribute are that node's concrete descendants. Two parts of the server ignoreclass_typeand must be brought in line so scoping is enforced consistently.Background — what already works
The sample generator (
Schema.Generator.get_valid_classes/1) and the exported JSON Schema (Schema.JsonSchema.encode_class/3) already scope correctly: they listUtils.find_children(class_type)minuscategory: trueclasses. Setting an attribute'sclass_typeto a category (e.g.integration) already restricts those two paths to that branch. No change is needed there.The gaps to fix
Runtime validator does not enforce
class_type.Schema.Validator(used by the/validateAPI) resolves aclass_tentry against the whole family (Schema.find_class(family, …)) and the only membership check rejects the base class. It never consultsclass_type, so a class from the wrong branch — or an abstractcategory: trueclass used as a concrete value — passes validation.class_tbranch of attribute validation, verify the resolved class is withinUtils.find_children(class_type)(excludingcategory: true), and emit aclass_out_of_scopeerror otherwise.UI type link ignores
class_type. InSchemaWeb.PageView(format_type/2), aclass_tattribute's type always links to/{family}s(e.g./modules), regardless ofclass_type.base_module) and unknown values to/{family}s; acategory: truenode to/{family}_categories/{class_type}(e.g./module_categories/integration); and a concrete class to/{family}s/{class_type}.Tests covering the validator scope error (
class_out_of_scope) and the threeclass_tlink cases.Notes
base_skill/base_domain/base_module) to mean "any class of the family". No dictionary changes are required for this issue.:name(unique within a family; present on both thefind_childrenentries and the enriched resolved class).Out of scope (separate follow-up)
The new
integration_typesattribute on therecordobject — adding it torecord.json, the dictionary (class_type: "integration"), and the matchingrecord.protofield, plus the end-to-end "wrong-branch" validation test — will be handled in a separate issue/PR on top of this one.