@nusoft/nuos-build-catalogue 0.14.1 → 0.14.2

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.
@@ -1,13 +1,21 @@
1
1
  /**
2
- * Crawler — walks the NuOS catalogue tree picking up indexable .md files.
2
+ * Crawler — walks the catalogue's `docs/` tree picking up indexable .md files.
3
3
  *
4
- * Per WU 110 spec:
5
- * - includes: docs/build/**, docs/contracts/**, docs/philosophy/**,
6
- * docs/guides/**, plus top-level docs/build/STATE.md, BUILD-ORDER.md,
7
- * README.md, reference-index.md
8
- * - skips: _index.md (derived; adds noise), done/, archive/, superseded/
9
- * subdirs (opt-in via includeArchived)
10
- * - skips: .excalidraw, binary
4
+ * Default behaviour (0.14.2+): recursive crawl of EVERYTHING under
5
+ * `docs/`, including top-level loose markdown files and every subdirectory.
6
+ * The earlier hardcoded allowlist of four subdirs (`build/`, `contracts/`,
7
+ * `philosophy/`, `guides/`) silently excluded strategic content that lives
8
+ * elsewhere top-level docs like `THE-NUOS-BUILD-METHOD.md`,
9
+ * `MVP-NEXT-STEPS.md`, `PHASE-4-SIGNOFF.md`, and subdirs like
10
+ * `architecture/`, `integration/`, `investor/`, `wireframes/`. Those are
11
+ * load-bearing strategic context and need to be searchable.
12
+ *
13
+ * Skipped:
14
+ * - `_index.md` (derived; adds noise to ranking)
15
+ * - `*-template.md` (templates, not real content)
16
+ * - `done/`, `archive/`, `superseded/` subdirs (opt-in via includeArchived)
17
+ * - `node_modules/`, `.git/`, `.nuos-catalogue/`
18
+ * - non-`.md` files (binaries, .excalidraw, etc.)
11
19
  */
12
20
  export interface CrawlOptions {
13
21
  catalogueRoot: string;
@@ -1,28 +1,42 @@
1
1
  /**
2
- * Crawler — walks the NuOS catalogue tree picking up indexable .md files.
2
+ * Crawler — walks the catalogue's `docs/` tree picking up indexable .md files.
3
3
  *
4
- * Per WU 110 spec:
5
- * - includes: docs/build/**, docs/contracts/**, docs/philosophy/**,
6
- * docs/guides/**, plus top-level docs/build/STATE.md, BUILD-ORDER.md,
7
- * README.md, reference-index.md
8
- * - skips: _index.md (derived; adds noise), done/, archive/, superseded/
9
- * subdirs (opt-in via includeArchived)
10
- * - skips: .excalidraw, binary
4
+ * Default behaviour (0.14.2+): recursive crawl of EVERYTHING under
5
+ * `docs/`, including top-level loose markdown files and every subdirectory.
6
+ * The earlier hardcoded allowlist of four subdirs (`build/`, `contracts/`,
7
+ * `philosophy/`, `guides/`) silently excluded strategic content that lives
8
+ * elsewhere top-level docs like `THE-NUOS-BUILD-METHOD.md`,
9
+ * `MVP-NEXT-STEPS.md`, `PHASE-4-SIGNOFF.md`, and subdirs like
10
+ * `architecture/`, `integration/`, `investor/`, `wireframes/`. Those are
11
+ * load-bearing strategic context and need to be searchable.
12
+ *
13
+ * Skipped:
14
+ * - `_index.md` (derived; adds noise to ranking)
15
+ * - `*-template.md` (templates, not real content)
16
+ * - `done/`, `archive/`, `superseded/` subdirs (opt-in via includeArchived)
17
+ * - `node_modules/`, `.git/`, `.nuos-catalogue/`
18
+ * - non-`.md` files (binaries, .excalidraw, etc.)
11
19
  */
12
20
  import { readdir, stat } from 'node:fs/promises';
13
21
  import path from 'node:path';
14
- const TOP_LEVEL_INCLUDES = ['build', 'contracts', 'philosophy', 'guides'];
15
- const SKIPPED_DIR_NAMES = new Set(['node_modules', '.git', '.nuos-catalogue']);
22
+ const SKIPPED_DIR_NAMES = new Set([
23
+ 'node_modules',
24
+ '.git',
25
+ '.nuos-catalogue',
26
+ '.opencode',
27
+ '.claude',
28
+ '.agents',
29
+ ]);
16
30
  const ARCHIVED_DIR_NAMES = new Set(['done', 'archive', 'superseded']);
17
31
  const INDEX_FILENAMES = new Set(['_index.md']);
32
+ function isTemplateName(name) {
33
+ // Catches `001-template-simple.md`, `module-template.md`, `_template.md`,
34
+ // `99-template-power-user-operational-plan.md`, etc.
35
+ return /template\.md$/.test(name) || name === '_template.md';
36
+ }
18
37
  export async function crawl(options) {
19
38
  const out = [];
20
- for (const top of TOP_LEVEL_INCLUDES) {
21
- const start = path.join(options.catalogueRoot, top);
22
- if (await exists(start)) {
23
- await walkDir(start, options, out);
24
- }
25
- }
39
+ await walkDir(options.catalogueRoot, options, out);
26
40
  return out.sort((a, b) => a.relativePath.localeCompare(b.relativePath));
27
41
  }
28
42
  async function walkDir(dir, options, out) {
@@ -49,6 +63,8 @@ async function walkDir(dir, options, out) {
49
63
  continue;
50
64
  if (INDEX_FILENAMES.has(entry.name))
51
65
  continue;
66
+ if (isTemplateName(entry.name))
67
+ continue;
52
68
  out.push({
53
69
  absolutePath: full,
54
70
  relativePath: path.relative(options.catalogueRoot, full),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nusoft/nuos-build-catalogue",
3
- "version": "0.14.1",
3
+ "version": "0.14.2",
4
4
  "description": "NuOS build-catalogue tooling: semantic search (WU 110) + migration runner that lifts markdown artefacts into JSON-backed workflow records (WU 111, Phase G).",
5
5
  "type": "module",
6
6
  "bin": {