From 63b1d93272a91febb848cd5eab2f226b1f0c20c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B1=CE=B7dr3=CE=B15=20=C9=AE=CE=B1=CE=B7=C9=A6=D6=85l?= =?UTF-8?q?=CA=903=CA=80?= <2878033+a6b8@users.noreply.github.com> Date: Fri, 19 Jun 2026 22:55:31 +0200 Subject: [PATCH] fix: exclude _-prefixed meta dirs in RebuildIndex (Memo 138) #65 #listSchemaDirs enumerated the _schema emit dir as a phantom pending schema, inflating the schema count and tainting the rollup. Excludes _-prefixed meta dirs (schema names never start with _). --- src/RebuildIndex.mjs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/RebuildIndex.mjs b/src/RebuildIndex.mjs index 014644e..2bb8105 100644 --- a/src/RebuildIndex.mjs +++ b/src/RebuildIndex.mjs @@ -992,8 +992,13 @@ class RebuildIndex { static async #listSchemaDirs( { namespaceDir } ) { const all = await RebuildIndex.#listSubDirs( { dir: namespaceDir } ) + // Exclude meta dirs (`_gradings`, the per-schema emit dir `_schema`, and any + // future `_`-prefixed island dir). Schema names are `[a-z][a-z0-9-]*`, so none + // start with `_` — excluding them keeps the emit scaffolding from surfacing as + // a phantom pending schema that taints the rollup + the schema count. return all .filter( ( name ) => name !== GRADINGS_DIR ) + .filter( ( name ) => name.startsWith( '_' ) === false ) }