@cosmicdrift/kumiko-guards 0.284.0 → 0.285.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cosmicdrift/kumiko-guards",
3
- "version": "0.284.0",
3
+ "version": "0.285.0",
4
4
  "description": "AST-based security guards for Kumiko repos: direct-fs/fetch, tenant escalation, admin-API, escape hatches and related checks, run over a shared ts-morph project.",
5
5
  "license": "BUSL-1.1",
6
6
  "author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
@@ -27,7 +27,7 @@
27
27
  "kumiko-guards": "./src/cli.ts"
28
28
  },
29
29
  "dependencies": {
30
- "@cosmicdrift/kumiko-repo-manifest": "0.284.0",
30
+ "@cosmicdrift/kumiko-repo-manifest": "0.285.0",
31
31
  "ts-morph": "^28.0.0"
32
32
  },
33
33
  "publishConfig": {
@@ -9,7 +9,8 @@ export type ScanExtension = "ts" | "tsx";
9
9
 
10
10
  type ScanSpecBase = {
11
11
  readonly extensions: readonly ScanExtension[];
12
- /** Manifest roles to scan; omitted = every root. */
12
+ /** Manifest roles to scan; omitted = every root except "tooling" — a guard
13
+ * must opt in to scanning an infra/build-tooling root explicitly. */
13
14
  readonly kinds?: readonly RepoKind[];
14
15
  /** Repo-relative globs; in a kind "framework" root only files matching one of them are kept (replaces `within` there). */
15
16
  readonly frameworkWithin?: readonly string[];
@@ -141,10 +142,13 @@ function scanRoot(spec: ScanSpec, root: RepoRoot): RootScan {
141
142
  return { root, files, sourceSurface: sourceSurfaceHits.length };
142
143
  }
143
144
 
145
+ function keepsRootKind(spec: ScanSpec, root: RepoRoot): boolean {
146
+ if (spec.kinds) return spec.kinds.includes(root.kind);
147
+ return root.kind !== "tooling";
148
+ }
149
+
144
150
  export function scanRoots(spec: ScanSpec, roots: readonly RepoRoot[]): RootScan[] {
145
- return roots
146
- .filter((root) => !spec.kinds || spec.kinds.includes(root.kind))
147
- .map((root) => scanRoot(spec, root));
151
+ return roots.filter((root) => keepsRootKind(spec, root)).map((root) => scanRoot(spec, root));
148
152
  }
149
153
 
150
154
  export function scanFiles(spec: ScanSpec, roots: readonly RepoRoot[]): string[] {