StaticgetStaticisDoes the class at classPath extend Zone? Folder classes (the
folder/leaf invariant's "may have descendants" set) are exactly
the Zone subclasses; this predicate is what Template.findByPath
and TemplateApi.validateFolderLeaf* consult.
Result is cached per classPath. Returns false when the class
fails to import or has no prototype chain (e.g. a typoed path) —
the caller's path validation surfaces those errors separately.
StaticisDoes the class at classPath extend SpatialZone? The strict
subset of folder classes that stamp Stuff.zone. Non-spatial
Zones (Clade) return false here even though isFolderClass
returns true for them.
StaticresolveResolve the nearest spatial zone for a template path.
Walks ancestor paths from nearest to root; returns the singleton
SpatialZone at the first ancestor whose template's class extends
SpatialZone. Non-spatial zone ancestors (Clades, future
permission/rule scopes) are skipped — they're folders for the
template-tree invariant, but not the spatial zone for the
descendant.
Returns null when:
templatePath is itself a spatial Zone (a
zone isn't inside itself).Calls StuffApi.singleton(ancestor) so the second resolution for
the same zone path is an O(1) cache hit; first resolution clones.
e.g. /narnia/castle/foyer
Nearest Zone-class template ancestor of
zone, ornullat universe-root (or whenzonehas notemplatePath, e.g., a fixture built viamakeStuffwithout a path stamp). Skips non-Zone path segments. Lazy-clones the ancestor viaStuffApi.singleton(cache-or-clone; subsequent calls are O(1)).The orchestration step
Zone.lookupAncestorField(the polymorphic field-inheritance hook inlib/zone/Zone.ts) delegates to this helper. Lives here, not on Zone, because the walk is pure plumbing — no override seam needed, no Stuff subclass should reshape it.