@warlock.js/grimoire 5.57.0 → 5.58.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.
Files changed (105) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/esm/book/build.d.mts.map +1 -1
  3. package/esm/book/build.mjs +2 -1
  4. package/esm/book/build.mjs.map +1 -1
  5. package/esm/book/render.mjs +10 -0
  6. package/esm/book/render.mjs.map +1 -1
  7. package/esm/bookmap/build.d.mts.map +1 -1
  8. package/esm/bookmap/build.mjs +2 -2
  9. package/esm/bookmap/build.mjs.map +1 -1
  10. package/esm/bookmap/steps.mjs +53 -38
  11. package/esm/bookmap/steps.mjs.map +1 -1
  12. package/esm/check/check-grimoire.d.mts.map +1 -1
  13. package/esm/check/check-grimoire.mjs +4 -1
  14. package/esm/check/check-grimoire.mjs.map +1 -1
  15. package/esm/check/rules/criteria.mjs +21 -2
  16. package/esm/check/rules/criteria.mjs.map +1 -1
  17. package/esm/check/rules/screenshots.mjs +57 -0
  18. package/esm/check/rules/screenshots.mjs.map +1 -0
  19. package/esm/codes/codes.d.mts +12 -0
  20. package/esm/codes/codes.d.mts.map +1 -1
  21. package/esm/codes/codes.mjs +6 -0
  22. package/esm/codes/codes.mjs.map +1 -1
  23. package/esm/contracts/adapter.d.mts +6 -0
  24. package/esm/contracts/adapter.d.mts.map +1 -1
  25. package/esm/contracts/book.d.mts +2 -0
  26. package/esm/contracts/book.d.mts.map +1 -1
  27. package/esm/contracts/book.mjs.map +1 -1
  28. package/esm/contracts/bookmap.d.mts +19 -1
  29. package/esm/contracts/bookmap.d.mts.map +1 -1
  30. package/esm/contracts/snapshot.d.mts +11 -0
  31. package/esm/contracts/snapshot.d.mts.map +1 -1
  32. package/esm/contracts/test-results.d.mts +34 -0
  33. package/esm/contracts/test-results.d.mts.map +1 -1
  34. package/esm/contracts/written.d.mts +44 -0
  35. package/esm/contracts/written.d.mts.map +1 -1
  36. package/esm/contracts/written.mjs.map +1 -1
  37. package/esm/devtools/data.mjs +94 -3
  38. package/esm/devtools/data.mjs.map +1 -1
  39. package/esm/devtools/index.d.mts +26 -0
  40. package/esm/devtools/index.d.mts.map +1 -1
  41. package/esm/devtools/index.mjs +88 -5
  42. package/esm/devtools/index.mjs.map +1 -1
  43. package/esm/devtools/product-map.d.mts +14 -0
  44. package/esm/devtools/product-map.d.mts.map +1 -0
  45. package/esm/devtools/product-map.mjs +385 -0
  46. package/esm/devtools/product-map.mjs.map +1 -0
  47. package/esm/devtools/site.d.mts.map +1 -1
  48. package/esm/devtools/site.mjs +85 -13
  49. package/esm/devtools/site.mjs.map +1 -1
  50. package/esm/devtools/snapshot-source.mjs +10 -6
  51. package/esm/devtools/snapshot-source.mjs.map +1 -1
  52. package/esm/graph/index.d.mts +10 -1
  53. package/esm/graph/index.d.mts.map +1 -1
  54. package/esm/graph/index.mjs +3 -2
  55. package/esm/graph/index.mjs.map +1 -1
  56. package/esm/index.d.mts +4 -4
  57. package/esm/paths/index.d.mts +2 -0
  58. package/esm/paths/index.d.mts.map +1 -1
  59. package/esm/paths/index.mjs +3 -1
  60. package/esm/paths/index.mjs.map +1 -1
  61. package/esm/scry/compact.mjs +169 -0
  62. package/esm/scry/compact.mjs.map +1 -0
  63. package/esm/scry/format.d.mts.map +1 -1
  64. package/esm/scry/format.mjs +7 -1
  65. package/esm/scry/format.mjs.map +1 -1
  66. package/esm/scry/query.d.mts.map +1 -1
  67. package/esm/scry/query.mjs +12 -1
  68. package/esm/scry/query.mjs.map +1 -1
  69. package/esm/test-results/index.d.mts +7 -2
  70. package/esm/test-results/index.d.mts.map +1 -1
  71. package/esm/test-results/index.mjs +79 -12
  72. package/esm/test-results/index.mjs.map +1 -1
  73. package/esm/vitest/index.d.mts +6 -0
  74. package/esm/vitest/index.d.mts.map +1 -1
  75. package/esm/vitest/index.mjs +22 -6
  76. package/esm/vitest/index.mjs.map +1 -1
  77. package/esm/warlock/adapter.d.mts.map +1 -1
  78. package/esm/warlock/adapter.mjs +6 -2
  79. package/esm/warlock/adapter.mjs.map +1 -1
  80. package/esm/warlock/mcp-tools.mjs +48 -12
  81. package/esm/warlock/mcp-tools.mjs.map +1 -1
  82. package/esm/workspace/index.d.mts.map +1 -1
  83. package/esm/workspace/index.mjs +4 -2
  84. package/esm/workspace/index.mjs.map +1 -1
  85. package/esm/written/apps.mjs +4 -2
  86. package/esm/written/apps.mjs.map +1 -1
  87. package/esm/written/features.mjs +119 -6
  88. package/esm/written/features.mjs.map +1 -1
  89. package/esm/written/markdown.mjs +66 -1
  90. package/esm/written/markdown.mjs.map +1 -1
  91. package/esm/written/parse-grimoire.d.mts.map +1 -1
  92. package/esm/written/parse-grimoire.mjs +1 -1
  93. package/esm/written/parse-grimoire.mjs.map +1 -1
  94. package/llms-full.txt +76 -3
  95. package/package.json +3 -3
  96. package/skills/backfill-a-grimoire/SKILL.md +5 -0
  97. package/skills/describe-an-app/SKILL.md +12 -0
  98. package/skills/record-a-change/SKILL.md +8 -0
  99. package/skills/use-the-grimoire/SKILL.md +14 -1
  100. package/skills/write-a-feature/SKILL.md +37 -2
  101. package/ui/grimoire-static.js +4 -0
  102. package/ui/grimoire-view.js +1016 -178
  103. package/ui/grimoire.css +427 -2
  104. package/ui/product-map.css +636 -0
  105. package/ui/product-map.js +817 -0
@@ -1 +1 @@
1
- {"version":3,"file":"steps.mjs","names":[],"sources":["../../../../../../../../packages/grimoire/src/bookmap/steps.ts"],"sourcesContent":["/**\n * The files behind each step of a flow: what a route, page, mail, job, event\n * or notification step reaches in the book.\n */\nimport type { BookFacts, BookNamedType } from \"../contracts/adapter\";\nimport type { FlowBookmapStep } from \"../contracts/bookmap\";\nimport type { AppMatch } from \"../contracts/snapshot\";\nimport type { WrittenFeature, WrittenGrimoire, WrittenStep } from \"../contracts/written\";\nimport { importClosure, type FileGraph } from \"../graph\";\n\nconst NAMED_TYPES: ReadonlySet<string> = new Set<BookNamedType>([\n \"mail\",\n \"job\",\n \"event\",\n \"notification\",\n]);\n\n/** A route path with params written one way (`:id` and `[id]` → `:id`) and no trailing `/`. */\nexport function normalizeRoutePath(route: string): string {\n const withParams = route\n .trim()\n .replace(/\\[\\.\\.\\.([^\\]]+)\\]/g, \":$1\")\n .replace(/\\[([^\\]]+)\\]/g, \":$1\");\n const trimmed = withParams.replace(/\\/+$/, \"\");\n\n return trimmed === \"\" ? \"/\" : trimmed;\n}\n\n/**\n * Whether a route answers `METHOD path`: paths compared after\n * `normalizeRoutePath` (`:id` ≡ `[id]`, trailing `/` ignored), methods\n * without regard to case, `ALL` on either side matching any method. The\n * check, the book maps and `scry --route` all match this way.\n */\nexport function routeMatches(\n route: { readonly method: string; readonly path: string },\n method: string,\n path: string,\n): boolean {\n const routeMethod = route.method.toUpperCase();\n const asked = method.toUpperCase();\n const methodMatches = routeMethod === asked || routeMethod === \"ALL\" || asked === \"ALL\";\n\n return methodMatches && normalizeRoutePath(route.path) === normalizeRoutePath(path);\n}\n\nfunction sortedUnique(files: Iterable<string>): string[] {\n return [...new Set(files)].sort();\n}\n\n/** What the step matched: its entry file and the files behind it. */\ntype StepMatch = Pick<FlowBookmapStep, \"found\" | \"entry\" | \"files\">;\n\nconst NOTHING: StepMatch = { found: false, entry: null, files: [] };\n\nfunction routeStep(step: WrittenStep, facts: BookFacts, graph: FileGraph): StepMatch {\n if (facts.routes === null || step.route === null) return { found: null, entry: null, files: [] };\n\n const target = step.route;\n const routes = facts.routes.filter((route) => routeMatches(route, target.method, target.path));\n const first = routes[0];\n\n if (!first) return NOTHING;\n\n const files = new Set<string>();\n\n for (const route of routes) {\n if (route.handlerFile !== null)\n importClosure(graph, [route.handlerFile]).forEach((file) => files.add(file));\n if (route.sourceFile !== null) files.add(route.sourceFile);\n }\n\n return { found: true, entry: first.handlerFile ?? first.sourceFile, files: sortedUnique(files) };\n}\n\nfunction pageStep(\n step: WrittenStep,\n feature: WrittenFeature,\n facts: BookFacts,\n apps: Record<string, AppMatch>,\n graph: FileGraph,\n): StepMatch {\n const wanted = normalizeRoutePath(step.target);\n const entries: string[] = [];\n const files = new Set<string>();\n\n // `page /support [web-admin]` looks in that app only; without a scope, in the feature's apps.\n const appIds =\n step.app === null ? (feature.readme?.apps.map((app) => app.value) ?? []) : [step.app];\n\n for (const appId of appIds) {\n const match = apps[appId];\n\n if (!match) continue;\n\n if (match.site) {\n const siteId = match.site.id;\n\n for (const page of facts.pages) {\n if (page.site !== siteId || normalizeRoutePath(page.route) !== wanted) continue;\n\n entries.push(page.file);\n const start = page.setupFile === null ? [page.file] : [page.file, page.setupFile];\n importClosure(graph, start).forEach((file) => files.add(file));\n start.forEach((file) => files.add(file));\n }\n }\n\n if (match.mobile) {\n for (const screen of match.mobile.screens) {\n if (normalizeRoutePath(screen.route) !== wanted) continue;\n\n entries.push(screen.file);\n importClosure(graph, [screen.file]).forEach((file) => files.add(file));\n files.add(screen.file);\n }\n }\n }\n\n const entry = entries[0];\n\n if (entry === undefined) return NOTHING;\n\n return { found: true, entry, files: sortedUnique(files) };\n}\n\nfunction namedStep(step: WrittenStep, facts: BookFacts, graph: FileGraph): StepMatch {\n const named = facts.named.filter(\n (thing) => thing.type === step.type && thing.name === step.target,\n );\n const first = named[0];\n\n if (!first) return NOTHING;\n\n const files = new Set<string>();\n\n for (const thing of named) {\n if (thing.file === null) continue;\n\n importClosure(graph, [thing.file]).forEach((file) => files.add(file));\n files.add(thing.file);\n }\n\n return { found: true, entry: first.file, files: sortedUnique(files) };\n}\n\nfunction affectsStep(step: WrittenStep, written: WrittenGrimoire): StepMatch {\n const target = step.affects;\n\n if (target === null) return NOTHING;\n\n const feature = written.features.find((candidate) => candidate.id === target.feature);\n const found =\n feature !== undefined &&\n (target.flow === null || feature.flows.some((flow) => flow.id.value === target.flow));\n\n return { found, entry: null, files: [] };\n}\n\n/** Everything the step resolver reads. */\nexport type StepContext = {\n written: WrittenGrimoire;\n facts: BookFacts;\n apps: Record<string, AppMatch>;\n graph: FileGraph;\n};\n\n/** One step of a flow of `feature`, with what it matched in the book. */\nexport function resolveStep(\n step: WrittenStep,\n feature: WrittenFeature,\n context: StepContext,\n): FlowBookmapStep {\n let match: StepMatch;\n\n if (step.type === \"route\") match = routeStep(step, context.facts, context.graph);\n else if (step.type === \"page\")\n match = pageStep(step, feature, context.facts, context.apps, context.graph);\n else if (NAMED_TYPES.has(step.type)) match = namedStep(step, context.facts, context.graph);\n else if (step.type === \"affects\") match = affectsStep(step, context.written);\n else match = { found: null, entry: null, files: [] };\n\n const target = step.app === null ? step.target : `${step.target} [${step.app}]`;\n\n return { index: step.index, type: step.type, target, ...match };\n}\n"],"mappings":";;;AAUA,MAAM,8BAAmC,IAAI,IAAmB;CAC9D;CACA;CACA;CACA;AACF,CAAC;;AAGD,SAAgB,mBAAmB,OAAuB;CAKxD,MAAM,UAJa,MAChB,KAAK,CAAC,CACN,QAAQ,uBAAuB,KAAK,CAAC,CACrC,QAAQ,iBAAiB,KACH,CAAC,CAAC,QAAQ,QAAQ,EAAE;CAE7C,OAAO,YAAY,KAAK,MAAM;AAChC;;;;;;;AAQA,SAAgB,aACd,OACA,QACA,MACS;CACT,MAAM,cAAc,MAAM,OAAO,YAAY;CAC7C,MAAM,QAAQ,OAAO,YAAY;CAGjC,QAFsB,gBAAgB,SAAS,gBAAgB,SAAS,UAAU,UAE1D,mBAAmB,MAAM,IAAI,MAAM,mBAAmB,IAAI;AACpF;AAEA,SAAS,aAAa,OAAmC;CACvD,OAAO,CAAC,GAAG,IAAI,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK;AAClC;AAKA,MAAM,UAAqB;CAAE,OAAO;CAAO,OAAO;CAAM,OAAO,CAAC;AAAE;AAElE,SAAS,UAAU,MAAmB,OAAkB,OAA6B;CACnF,IAAI,MAAM,WAAW,QAAQ,KAAK,UAAU,MAAM,OAAO;EAAE,OAAO;EAAM,OAAO;EAAM,OAAO,CAAC;CAAE;CAE/F,MAAM,SAAS,KAAK;CACpB,MAAM,SAAS,MAAM,OAAO,QAAQ,UAAU,aAAa,OAAO,OAA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AU,MAAM,QAAQ,OAAO,QAAQ,KAAK;MAC1E,IAAI,KAAK,SAAS,QACrB,QAAQ,SAAS,MAAM,SAAS,QAAQ,OAAO,QAAQ,MAAM,QAAQ,KAAK;MACvE,IAAI,YAAY,IAAI,KAAK,IAAI,GAAG,QAAQ,UAAU,MAAM,QAAQ,OAAO,QAAQ,KAAK;MACpF,IAAI,KAAK,SAAS,WAAW,QAAQ,YAAY,MAAM,QAAQ,OAAO;MACtE,QAAQ;EAAE,OAAO;EAAM,OAAO;EAAM,OAAO,CAAC;CAAE;CAEnD,MAAM,SAAS,KAAK,QAAQ,OAAO,KAAK,SAAS,GAAG,KAAK,OAAO,IAAI,KAAK,IAAI;CAE7E,OAAO;EAAE,OAAO,KAAK;EAAO,MAAM,KAAK;EAAM;EAAQ,GAAG;CAAM;AAChE"}
1
+ {"version":3,"file":"steps.mjs","names":[],"sources":["../../../../../../../../packages/grimoire/src/bookmap/steps.ts"],"sourcesContent":["/**\n * The files behind each step of a flow: what a route, page, mail, job, event\n * or notification step reaches in the book.\n */\nimport type { BookFacts, BookNamedType } from \"../contracts/adapter\";\nimport type { FlowBookmapStep } from \"../contracts/bookmap\";\nimport type { AppMatch } from \"../contracts/snapshot\";\nimport type { WrittenFeature, WrittenGrimoire, WrittenStep } from \"../contracts/written\";\nimport { importClosure, type FileGraph } from \"../graph\";\n\nconst NAMED_TYPES: ReadonlySet<string> = new Set<BookNamedType>([\n \"mail\",\n \"job\",\n \"event\",\n \"notification\",\n]);\n\n/** A route path with params written one way (`:id` and `[id]` → `:id`) and no trailing `/`. */\nexport function normalizeRoutePath(route: string): string {\n const withParams = route\n .trim()\n .replace(/\\[\\.\\.\\.([^\\]]+)\\]/g, \":$1\")\n .replace(/\\[([^\\]]+)\\]/g, \":$1\");\n const trimmed = withParams.replace(/\\/+$/, \"\");\n\n return trimmed === \"\" ? \"/\" : trimmed;\n}\n\n/**\n * Whether a route answers `METHOD path`: paths compared after\n * `normalizeRoutePath` (`:id` ≡ `[id]`, trailing `/` ignored), methods\n * without regard to case, `ALL` on either side matching any method. The\n * check, the book maps and `scry --route` all match this way.\n */\nexport function routeMatches(\n route: { readonly method: string; readonly path: string },\n method: string,\n path: string,\n): boolean {\n const routeMethod = route.method.toUpperCase();\n const asked = method.toUpperCase();\n const methodMatches = routeMethod === asked || routeMethod === \"ALL\" || asked === \"ALL\";\n\n return methodMatches && normalizeRoutePath(route.path) === normalizeRoutePath(path);\n}\n\nfunction sortedUnique(files: Iterable<string>): string[] {\n return [...new Set(files)].sort();\n}\n\n/** What the step matched: its entry files and the files behind them. */\ntype StepMatch = Pick<\n FlowBookmapStep,\n \"found\" | \"entry\" | \"entries\" | \"direct\" | \"files\" | \"typeOnlyFiles\"\n>;\n\nconst NOTHING: StepMatch = {\n found: false,\n entry: null,\n entries: [],\n direct: [],\n files: [],\n typeOnlyFiles: [],\n};\n\nconst UNKNOWN: StepMatch = { ...NOTHING, found: null };\n\n/**\n * Work out a step's files from its entry files. `extra` are files that belong\n * to the step without being imported by an entry (a route's routes file).\n */\nfunction reach(\n graph: FileGraph,\n entries: readonly string[],\n extra: readonly string[] = [],\n): Pick<StepMatch, \"entries\" | \"direct\" | \"files\" | \"typeOnlyFiles\"> {\n const entryFiles = sortedUnique(entries);\n const known = new Set(entryFiles);\n const direct = new Set<string>();\n\n for (const entry of entryFiles) {\n for (const edge of graph.get(entry)?.imports ?? []) {\n if (edge.file !== null && !known.has(edge.file)) direct.add(edge.file);\n }\n }\n\n const files = new Set([\n ...entryFiles,\n ...extra,\n ...importClosure(graph, entryFiles, { skipTypeOnly: true }),\n ]);\n const everything = importClosure(graph, entryFiles);\n\n return {\n entries: entryFiles,\n direct: sortedUnique(direct),\n files: sortedUnique(files),\n typeOnlyFiles: everything.filter((file) => !files.has(file)),\n };\n}\n\nfunction routeStep(step: WrittenStep, facts: BookFacts, graph: FileGraph): StepMatch {\n if (facts.routes === null || step.route === null) return UNKNOWN;\n\n const target = step.route;\n const routes = facts.routes.filter((route) => routeMatches(route, target.method, target.path));\n const first = routes[0];\n\n if (!first) return NOTHING;\n\n const handlers = routes.flatMap((route) => (route.handlerFile === null ? [] : [route.handlerFile]));\n const sources = routes.flatMap((route) => (route.sourceFile === null ? [] : [route.sourceFile]));\n const handlerReach = reach(graph, handlers, sources);\n // The routes files are entries too, but their own imports are not part of the step.\n const entries = sortedUnique([...handlers, ...sources]);\n\n return {\n found: true,\n entry: first.handlerFile ?? first.sourceFile,\n ...handlerReach,\n entries,\n direct: handlerReach.direct.filter((file) => !entries.includes(file)),\n };\n}\n\nfunction pageStep(\n step: WrittenStep,\n feature: WrittenFeature,\n facts: BookFacts,\n apps: Record<string, AppMatch>,\n graph: FileGraph,\n): StepMatch {\n const wanted = normalizeRoutePath(step.target);\n const matched: string[] = [];\n const starts: string[] = [];\n\n // `page /support [web-admin]` looks in that app only; without a scope, in the feature's apps.\n const appIds =\n step.app === null ? (feature.readme?.apps.map((app) => app.value) ?? []) : [step.app];\n\n for (const appId of appIds) {\n const match = apps[appId];\n\n if (!match) continue;\n\n if (match.site) {\n const siteId = match.site.id;\n\n for (const page of facts.pages) {\n if (page.site !== siteId || normalizeRoutePath(page.route) !== wanted) continue;\n\n matched.push(page.file);\n starts.push(page.file);\n if (page.setupFile !== null) starts.push(page.setupFile);\n }\n }\n\n if (match.mobile) {\n for (const screen of match.mobile.screens) {\n if (normalizeRoutePath(screen.route) !== wanted) continue;\n\n matched.push(screen.file);\n starts.push(screen.file);\n }\n }\n }\n\n const entry = matched[0];\n\n if (entry === undefined) return NOTHING;\n\n return { found: true, entry, ...reach(graph, starts) };\n}\n\nfunction namedStep(step: WrittenStep, facts: BookFacts, graph: FileGraph): StepMatch {\n const named = facts.named.filter(\n (thing) => thing.type === step.type && thing.name === step.target,\n );\n const first = named[0];\n\n if (!first) return NOTHING;\n\n const entries = named.flatMap((thing) => (thing.file === null ? [] : [thing.file]));\n\n return { found: true, entry: first.file, ...reach(graph, entries) };\n}\n\nfunction affectsStep(step: WrittenStep, written: WrittenGrimoire): StepMatch {\n const target = step.affects;\n\n if (target === null) return NOTHING;\n\n const feature = written.features.find((candidate) => candidate.id === target.feature);\n const found =\n feature !== undefined &&\n (target.flow === null || feature.flows.some((flow) => flow.id.value === target.flow));\n\n return { ...NOTHING, found };\n}\n\n/** Everything the step resolver reads. */\nexport type StepContext = {\n written: WrittenGrimoire;\n facts: BookFacts;\n apps: Record<string, AppMatch>;\n graph: FileGraph;\n};\n\n/** One step of a flow of `feature`, with what it matched in the book. */\nexport function resolveStep(\n step: WrittenStep,\n feature: WrittenFeature,\n context: StepContext,\n): FlowBookmapStep {\n let match: StepMatch;\n\n if (step.type === \"route\") match = routeStep(step, context.facts, context.graph);\n else if (step.type === \"page\")\n match = pageStep(step, feature, context.facts, context.apps, context.graph);\n else if (NAMED_TYPES.has(step.type)) match = namedStep(step, context.facts, context.graph);\n else if (step.type === \"affects\") match = affectsStep(step, context.written);\n else match = UNKNOWN;\n\n const target = step.app === null ? step.target : `${step.target} [${step.app}]`;\n\n return { index: step.index, type: step.type, target, ...match };\n}\n"],"mappings":";;;AAUA,MAAM,8BAAmC,IAAI,IAAmB;CAC9D;CACA;CACA;CACA;AACF,CAAC;;AAGD,SAAgB,mBAAmB,OAAuB;CAKxD,MAAM,UAJa,MAChB,KAAK,CAAC,CACN,QAAQ,uBAAuB,KAAK,CAAC,CACrC,QAAQ,iBAAiB,KACH,CAAC,CAAC,QAAQ,QAAQ,EAAE;CAE7C,OAAO,YAAY,KAAK,MAAM;AAChC;;;;;;;AAQA,SAAgB,aACd,OACA,QACA,MACS;CACT,MAAM,cAAc,MAAM,OAAO,YAAY;CAC7C,MAAM,QAAQ,OAAO,YAAY;CAGjC,QAFsB,gBAAgB,SAAS,gBAAgB,SAAS,UAAU,UAE1D,mBAAmB,MAAM,IAAI,MAAM,mBAAmB,IAAI;AACpF;AAEA,SAAS,aAAa,OAAmC;CACvD,OAAO,CAAC,GAAG,IAAI,IAAI,KAAK,CAAC,CAAC,CAAC,KAA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file":"check-grimoire.d.mts","names":[],"sources":["../../../../../../../../packages/grimoire/src/check/check-grimoire.ts"],"mappings":";;;;wBA8BgB,cAAc,UAAU,mBAAmB"}
1
+ {"version":3,"file":"check-grimoire.d.mts","names":[],"sources":["../../../../../../../../packages/grimoire/src/check/check-grimoire.ts"],"mappings":";;;;wBAiCgB,cAAc,UAAU,mBAAmB"}
@@ -4,8 +4,9 @@ import { checkTestResults } from "../test-results/index.mjs";
4
4
  import { checkReleases } from "../releases/index.mjs";
5
5
  import { checkTasks } from "../tasks/index.mjs";
6
6
  import { checkBookNotes } from "./rules/book-notes.mjs";
7
- import { checkCriteriaTests, checkProofTargets } from "./rules/criteria.mjs";
7
+ import { checkCaseCriteria, checkCriteriaTests, checkProofTargets } from "./rules/criteria.mjs";
8
8
  import { checkAppNames, checkChangelogLinks, checkRelations, checkSteps } from "./rules/links.mjs";
9
+ import { checkScreenshots } from "./rules/screenshots.mjs";
9
10
  import { checkFolders, checkHeaders, checkOwners, checkUnreached } from "./rules/source-files.mjs";
10
11
  import { checkChangeWords, checkFlowVersions, checkReadmeDates } from "./rules/versions.mjs";
11
12
 
@@ -20,6 +21,8 @@ const CHECK_RULES = [
20
21
  checkOwners,
21
22
  checkFolders,
22
23
  checkUnreached,
24
+ checkCaseCriteria,
25
+ checkScreenshots,
23
26
  checkCriteriaTests,
24
27
  checkProofTargets,
25
28
  checkReadmeDates,
@@ -1 +1 @@
1
- {"version":3,"file":"check-grimoire.mjs","names":[],"sources":["../../../../../../../../packages/grimoire/src/check/check-grimoire.ts"],"sourcesContent":["import { checkApps } from \"../apps\";\nimport type { GrimoireCheckReport, GrimoireFinding } from \"../contracts/findings\";\nimport type { GrimoireRule, GrimoireSnapshot } from \"../contracts/snapshot\";\nimport { checkReleases } from \"../releases\";\nimport { checkTasks } from \"../tasks\";\nimport { checkTestResults } from \"../test-results\";\nimport { checkBookNotes } from \"./rules/book-notes\";\nimport { checkCriteriaTests, checkProofTargets } from \"./rules/criteria\";\nimport { checkAppNames, checkChangelogLinks, checkRelations, checkSteps } from \"./rules/links\";\nimport { checkFolders, checkHeaders, checkOwners, checkUnreached } from \"./rules/source-files\";\nimport { checkChangeWords, checkFlowVersions, checkReadmeDates } from \"./rules/versions\";\n\n/** The check's own rules, in report order before sorting. */\nexport const CHECK_RULES: readonly GrimoireRule[] = [\n checkSteps,\n checkAppNames,\n checkChangelogLinks,\n checkRelations,\n checkHeaders,\n checkOwners,\n checkFolders,\n checkUnreached,\n checkCriteriaTests,\n checkProofTargets,\n checkReadmeDates,\n checkChangeWords,\n checkFlowVersions,\n];\n\n/** Run every rule over a snapshot. Pure; never writes. */\nexport function checkGrimoire(snapshot: GrimoireSnapshot): GrimoireCheckReport {\n const findings = [\n ...snapshot.structure,\n ...snapshot.proofFindings,\n ...CHECK_RULES.flatMap((rule) => rule(snapshot)),\n ...checkApps(snapshot),\n ...checkReleases(snapshot),\n ...checkTasks(snapshot),\n ...checkTestResults(snapshot),\n ...checkBookNotes(snapshot),\n ];\n\n return finishReport(snapshot, findings);\n}\n\n/**\n * Mark the findings on proposed features and flows as expected, sort them\n * and count them. The findings of the snapshot are copied, never changed.\n */\nexport function finishReport(\n snapshot: GrimoireSnapshot,\n findings: readonly GrimoireFinding[],\n): GrimoireCheckReport {\n const proposed = proposedWork(snapshot);\n const marked = findings\n .map((finding) => ({ ...finding, expected: finding.expected || isProposed(finding, proposed) }))\n .sort(compareFindings);\n const unexpected = marked.filter((finding) => !finding.expected);\n const errors = unexpected.filter((finding) => finding.severity === \"error\").length;\n\n return {\n schemaVersion: 1,\n root: snapshot.root,\n findings: marked,\n counts: {\n errors,\n warnings: unexpected.length - errors,\n expected: marked.length - unexpected.length,\n },\n ok: errors === 0,\n routes: snapshot.routes,\n };\n}\n\n/** Feature ids and `<feature>/<flow>` refs whose status is `proposed`. */\nfunction proposedWork(snapshot: GrimoireSnapshot): Set<string> {\n const proposed = new Set<string>();\n\n for (const feature of snapshot.written.features) {\n if (feature.readme?.status.value === \"proposed\") proposed.add(feature.id);\n\n for (const flow of feature.flows) {\n if (flow.status.value === \"proposed\") proposed.add(flow.ref);\n }\n }\n\n return proposed;\n}\n\nfunction isProposed(finding: GrimoireFinding, proposed: ReadonlySet<string>): boolean {\n const { feature, flow } = finding.subject;\n const flowFeature = flow?.split(\"/\")[0] ?? null;\n\n return [feature, flow, flowFeature].some((id) => id !== null && proposed.has(id));\n}\n\n/** Unexpected findings first, then expected; within each, errors before warnings, then by file, line and code. */\nfunction compareFindings(left: GrimoireFinding, right: GrimoireFinding): number {\n return (\n Number(left.expected) - Number(right.expected) ||\n severityRank(left) - severityRank(right) ||\n compareText(\n left.at?.file ?? left.subject.file ?? \"\",\n right.at?.file ?? right.subject.file ?? \"\",\n ) ||\n (left.at?.line ?? 0) - (right.at?.line ?? 0) ||\n compareText(left.code, right.code) ||\n compareText(left.message, right.message)\n );\n}\n\nfunction severityRank(finding: GrimoireFinding): number {\n return finding.severity === \"error\" ? 0 : 1;\n}\n\n/** Locale-free comparison, so the order is the same on every machine. */\nfunction compareText(left: string, right: string): number {\n return left < right ? -1 : left > right ? 1 : 0;\n}\n"],"mappings":";;;;;;;;;;;;;AAaA,MAAa,cAAuC;CAClD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;AAGA,SAAgB,cAAc,UAAiD;CAY7E,OAAO,aAAa,UAAU;EAV5B,GAAG,SAAS;EACZ,GAAG,SAAS;EACZ,GAAG,YAAY,SAAS,SAAS,KAAK,QAAQ,CAAC;EAC/C,GAAG,UAAU,QAAQ;EACrB,GAAG,cAAc,QAAQ;EACzB,GAAG,WAAW,QAAQ;EACtB,GAAG,iBAAiB,QAAQ;EAC5B,GAAG,eAAe,QAAQ;CAGS,CAAC;AACxC;;;;;AAMA,SAAgB,aACd,UACA,UACqB;CACrB,MAAM,WAAW,aAAa,QAAQ;CACtC,MAAM,SAAS,SACZ,KAAK,aAAa;EAAE,GAAG;EAAS,UAAU,QAAQ,YAAY,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S,aAAa,SAAkC;CACtD,OAAO,QAAQ,aAAa,UAAU,IAAI;AAC5C;;AAGA,SAAS,YAAY,MAAc,OAAuB;CACxD,OAAO,OAAO,QAAQ,KAAK,OAAO,QAAQ,IAAI;AAChD"}
1
+ {"version":3,"file":"check-grimoire.mjs","names":[],"sources":["../../../../../../../../packages/grimoire/src/check/check-grimoire.ts"],"sourcesContent":["import { checkApps } from \"../apps\";\nimport type { GrimoireCheckReport, GrimoireFinding } from \"../contracts/findings\";\nimport type { GrimoireRule, GrimoireSnapshot } from \"../contracts/snapshot\";\nimport { checkReleases } from \"../releases\";\nimport { checkTasks } from \"../tasks\";\nimport { checkTestResults } from \"../test-results\";\nimport { checkBookNotes } from \"./rules/book-notes\";\nimport { checkCaseCriteria, checkCriteriaTests, checkProofTargets } from \"./rules/criteria\";\nimport { checkAppNames, checkChangelogLinks, checkRelations, checkSteps } from \"./rules/links\";\nimport { checkScreenshots } from \"./rules/screenshots\";\nimport { checkFolders, checkHeaders, checkOwners, checkUnreached } from \"./rules/source-files\";\nimport { checkChangeWords, checkFlowVersions, checkReadmeDates } from \"./rules/versions\";\n\n/** The check's own rules, in report order before sorting. */\nexport const CHECK_RULES: readonly GrimoireRule[] = [\n checkSteps,\n checkAppNames,\n checkChangelogLinks,\n checkRelations,\n checkHeaders,\n checkOwners,\n checkFolders,\n checkUnreached,\n checkCaseCriteria,\n checkScreenshots,\n checkCriteriaTests,\n checkProofTargets,\n checkReadmeDates,\n checkChangeWords,\n checkFlowVersions,\n];\n\n/** Run every rule over a snapshot. Pure; never writes. */\nexport function checkGrimoire(snapshot: GrimoireSnapshot): GrimoireCheckReport {\n const findings = [\n ...snapshot.structure,\n ...snapshot.proofFindings,\n ...CHECK_RULES.flatMap((rule) => rule(snapshot)),\n ...checkApps(snapshot),\n ...checkReleases(snapshot),\n ...checkTasks(snapshot),\n ...checkTestResults(snapshot),\n ...checkBookNotes(snapshot),\n ];\n\n return finishReport(snapshot, findings);\n}\n\n/**\n * Mark the findings on proposed features and flows as expected, sort them\n * and count them. The findings of the snapshot are copied, never changed.\n */\nexport function finishReport(\n snapshot: GrimoireSnapshot,\n findings: readonly GrimoireFinding[],\n): GrimoireCheckReport {\n const proposed = proposedWork(snapshot);\n const marked = findings\n .map((finding) => ({ ...finding, expected: finding.expected || isProposed(finding, proposed) }))\n .sort(compareFindings);\n const unexpected = marked.filter((finding) => !finding.expected);\n const errors = unexpected.filter((finding) => finding.severity === \"error\").length;\n\n return {\n schemaVersion: 1,\n root: snapshot.root,\n findings: marked,\n counts: {\n errors,\n warnings: unexpected.length - errors,\n expected: marked.length - unexpected.length,\n },\n ok: errors === 0,\n routes: snapshot.routes,\n };\n}\n\n/** Feature ids and `<feature>/<flow>` refs whose status is `proposed`. */\nfunction proposedWork(snapshot: GrimoireSnapshot): Set<string> {\n const proposed = new Set<string>();\n\n for (const feature of snapshot.written.features) {\n if (feature.readme?.status.value === \"proposed\") proposed.add(feature.id);\n\n for (const flow of feature.flows) {\n if (flow.status.value === \"proposed\") proposed.add(flow.ref);\n }\n }\n\n return proposed;\n}\n\nfunction isProposed(finding: GrimoireFinding, proposed: ReadonlySet<string>): boolean {\n const { feature, flow } = finding.subject;\n const flowFeature = flow?.split(\"/\")[0] ?? null;\n\n return [feature, flow, flowFeature].some((id) => id !== null && proposed.has(id));\n}\n\n/** Unexpected findings first, then expected; within each, errors before warnings, then by file, line and code. */\nfunction compareFindings(left: GrimoireFinding, right: GrimoireFinding): number {\n return (\n Number(left.expected) - Number(right.expected) ||\n severityRank(left) - severityRank(right) ||\n compareText(\n left.at?.file ?? left.subject.file ?? \"\",\n right.at?.file ?? right.subject.file ?? \"\",\n ) ||\n (left.at?.line ?? 0) - (right.at?.line ?? 0) ||\n compareText(left.code, right.code) ||\n compareText(left.message, right.message)\n );\n}\n\nfunction severityRank(finding: GrimoireFinding): number {\n return finding.severity === \"error\" ? 0 : 1;\n}\n\n/** Locale-free comparison, so the order is the same on every machine. */\nfunction compareText(left: string, right: string): number {\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;AAEA,SAAS,WAAW,SAA0B,UAAwC;CACpF,MAAM,EAAE,SAAS,SAAS,QAAQ;CAGlC,OAAO;EAAC;EAAS;EAFG,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM;CAET,CAAC,CAAC,MAAM,OAAO,OAAO,QAAQ,SAAS,IAAI,EAAE,CAAC;AAClF;;AAGA,SAAS,gBAAgB,MAAuB,OAAgC;CAC9E,OACE,OAAO,KAAK,QAAQ,IAAI,OAAO,MAAM,QAAQ,KAC7C,aAAa,IAAI,IAAI,aAAa,KAAK,KACvC,YACE,KAAK,IAAI,QAAQ,KAAK,QAAQ,QAAQ,IACtC,MAAM,IAAI,QAAQ,MAAM,QAAQ,QAAQ,EAC1C,MACC,KAAK,IAAI,QAAQ,MAAM,MAAM,IAAI,QAAQ,MAC1C,YAAY,KAAK,MAAM,MAAM,IAAI,KACjC,YAAY,KAAK,SAAS,MAAM,OAAO;AAE3C;AAEA,SAAS,aAAa,SAAkC;CACtD,OAAO,QAAQ,aAAa,UAAU,IAAI;AAC5C;;AAGA,SAAS,YAAY,MAAc,OAAuB;CACxD,OAAO,OAAO,QAAQ,KAAK,OAAO,QAAQ,IAAI;AAChD"}
@@ -3,7 +3,8 @@ import { isRetired, writtenLookup } from "./lookup.mjs";
3
3
 
4
4
  //#region ../../packages/grimoire/src/check/rules/criteria.ts
5
5
  /**
6
- * GR4001–GR4002: criteria and the `@proves` lines that name them.
6
+ * GR2013 and GR4001–GR4002: criteria, the cases that name them and the
7
+ * `@proves` lines that name them.
7
8
  */
8
9
  /** GR4001: a criterion of a flow (not retired) that no `@proves` line names. */
9
10
  function checkCriteriaTests(snapshot) {
@@ -42,7 +43,25 @@ function checkProofTargets(snapshot) {
42
43
  }
43
44
  return findings;
44
45
  }
46
+ /** GR2013: a case that ends in `(AC-n)` naming a criterion its flow does not have. */
47
+ function checkCaseCriteria(snapshot) {
48
+ const findings = [];
49
+ for (const feature of snapshot.written.features) for (const flow of feature.flows) {
50
+ const known = new Set(flow.criteria.map((criterion) => criterion.id));
51
+ for (const entry of flow.cases) for (const id of entry.criteria) {
52
+ if (known.has(id)) continue;
53
+ findings.push(createFinding({
54
+ code: "GR2013",
55
+ message: `the case "${entry.question}" in ${flow.ref} names ${id}, which the flow does not have`,
56
+ at: entry.at,
57
+ feature: feature.id,
58
+ flow: flow.ref
59
+ }));
60
+ }
61
+ }
62
+ return findings;
63
+ }
45
64
 
46
65
  //#endregion
47
- export { checkCriteriaTests, checkProofTargets };
66
+ export { checkCaseCriteria, checkCriteriaTests, checkProofTargets };
48
67
  //# sourceMappingURL=criteria.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"criteria.mjs","names":[],"sources":["../../../../../../../../../packages/grimoire/src/check/rules/criteria.ts"],"sourcesContent":["/**\n * GR4001–GR4002: criteria and the `@proves` lines that name them.\n */\nimport { createFinding } from \"../../codes\";\nimport type { GrimoireFinding } from \"../../contracts/findings\";\nimport type { GrimoireSnapshot } from \"../../contracts/snapshot\";\nimport { isRetired, writtenLookup } from \"./lookup\";\n\n/** GR4001: a criterion of a flow (not retired) that no `@proves` line names. */\nexport function checkCriteriaTests(snapshot: GrimoireSnapshot): GrimoireFinding[] {\n const proven = new Set(snapshot.proofs.map((proof) => `${proof.ref} ${proof.criterion}`));\n const findings: GrimoireFinding[] = [];\n\n for (const feature of snapshot.written.features) {\n for (const flow of feature.flows) {\n if (isRetired(feature, flow)) continue;\n\n for (const criterion of flow.criteria) {\n if (proven.has(`${flow.ref} ${criterion.id}`)) continue;\n\n findings.push(\n createFinding({\n code: \"GR4001\",\n message: `${flow.ref} ${criterion.id} has no test`,\n at: criterion.at,\n feature: feature.id,\n flow: flow.ref,\n }),\n );\n }\n }\n }\n\n return findings;\n}\n\n/** GR4002: a `@proves` line naming a flow or criterion that does not exist. */\nexport function checkProofTargets(snapshot: GrimoireSnapshot): GrimoireFinding[] {\n const { flows } = writtenLookup(snapshot);\n const findings: GrimoireFinding[] = [];\n\n for (const proof of snapshot.proofs) {\n const flow = flows.get(proof.ref);\n const missing = !flow\n ? `no flow ${proof.ref}`\n : flow.criteria.some((criterion) => criterion.id === proof.criterion)\n ? null\n : `no ${proof.criterion} in ${proof.ref}`;\n\n if (missing === null) continue;\n\n findings.push(\n createFinding({\n code: \"GR4002\",\n message: `\"@proves ${proof.ref} ${proof.criterion}\" names ${missing}`,\n at: proof.at,\n feature: proof.feature,\n flow: proof.ref,\n }),\n );\n }\n\n return findings;\n}\n"],"mappings":";;;;;;;;AASA,SAAgB,mBAAmB,UAA+C;CAChF,MAAM,SAAS,IAAI,IAAI,SAAS,OAAO,KAAK,UAAU,GAAG,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;CACxF,MAAM,WAA8B,CAAC;CAErC,KAAK,MAAM,WAAW,SAAS,QAAQ,UACrC,KAAK,MAAM,QAAQ,QAAQ,OAAO;EAChC,IAAI,UAAU,SAAS,IAAI,GAAG;EAE9B,KAAK,MAAM,aAAa,KAAK,UAAU;GACrC,IAAI,OAAO,IAAI,GAAG,KAAK,IAAI,GAAG,UAAU,IAAI,GAAG;GAE/C,SAAS,KACP,cAAc;IACZ,MAAM;IACN,SAAS,GAAG,KAAK,IAAI,GAAG,UAAU,GAAG;IACrC,IAAI,UAAU;IACd,SAAS,QAAQ;IACjB,MAAM,KAAK;GACb,CAAC,CACH;EACF;CACF;CAGF,OAAO;AACT;;AAGA,SAAgB,kBAAkB,UAA+C;CAC/E,MAAM,EAAE,UAAU,cAAc,QAAQ;CACxC,MAAM,WAA8B,CAAC;CAErC,KAAK,MAAM,SAAS,SAAS,QAAQ;EACnC,MAAM,OAAO,MAAM,IAAI,MAAM,GAAG;EAChC,MAAM,UAAU,CAAC,OACb,WAAW,MAAM,QACjB,KAAK,SAAS,MAAM,cAAc,UAAU,OAAO,MAAM,SAAS,IAChE,OACA,MAAM,MAAM,UAAU,MAAM,MAAM;EAExC,IAAI,YAAY,MAAM;EAEtB,SAAS,KACP,cAAc;GACZ,MAAM;GACN,SAAS,YAAY,MAAM,IAAI,GAAG,MAAM,UAAU,UAAU;GAC5D,IAAI,MAAM;GACV,SAAS,MAAM;GACf,MAAM,MAAM;EACd,CAAC,CACH;CACF;CAEA,OAAO;AACT"}
1
+ {"version":3,"file":"criteria.mjs","names":[],"sources":["../../../../../../../../../packages/grimoire/src/check/rules/criteria.ts"],"sourcesContent":["/**\n * GR2013 and GR4001–GR4002: criteria, the cases that name them and the\n * `@proves` lines that name them.\n */\nimport { createFinding } from \"../../codes\";\nimport type { GrimoireFinding } from \"../../contracts/findings\";\nimport type { GrimoireSnapshot } from \"../../contracts/snapshot\";\nimport { isRetired, writtenLookup } from \"./lookup\";\n\n/** GR4001: a criterion of a flow (not retired) that no `@proves` line names. */\nexport function checkCriteriaTests(snapshot: GrimoireSnapshot): GrimoireFinding[] {\n const proven = new Set(snapshot.proofs.map((proof) => `${proof.ref} ${proof.criterion}`));\n const findings: GrimoireFinding[] = [];\n\n for (const feature of snapshot.written.features) {\n for (const flow of feature.flows) {\n if (isRetired(feature, flow)) continue;\n\n for (const criterion of flow.criteria) {\n if (proven.has(`${flow.ref} ${criterion.id}`)) continue;\n\n findings.push(\n createFinding({\n code: \"GR4001\",\n message: `${flow.ref} ${criterion.id} has no test`,\n at: criterion.at,\n feature: feature.id,\n flow: flow.ref,\n }),\n );\n }\n }\n }\n\n return findings;\n}\n\n/** GR4002: a `@proves` line naming a flow or criterion that does not exist. */\nexport function checkProofTargets(snapshot: GrimoireSnapshot): GrimoireFinding[] {\n const { flows } = writtenLookup(snapshot);\n const findings: GrimoireFinding[] = [];\n\n for (const proof of snapshot.proofs) {\n const flow = flows.get(proof.ref);\n const missing = !flow\n ? `no flow ${proof.ref}`\n : flow.criteria.some((criterion) => criterion.id === proof.criterion)\n ? null\n : `no ${proof.criterion} in ${proof.ref}`;\n\n if (missing === null) continue;\n\n findings.push(\n createFinding({\n code: \"GR4002\",\n message: `\"@proves ${proof.ref} ${proof.criterion}\" names ${missing}`,\n at: proof.at,\n feature: proof.feature,\n flow: proof.ref,\n }),\n );\n }\n\n return findings;\n}\n\n/** GR2013: a case that ends in `(AC-n)` naming a criterion its flow does not have. */\nexport function checkCaseCriteria(snapshot: GrimoireSnapshot): GrimoireFinding[] {\n const findings: GrimoireFinding[] = [];\n\n for (const feature of snapshot.written.features) {\n for (const flow of feature.flows) {\n const known = new Set(flow.criteria.map((criterion) => criterion.id));\n\n for (const entry of flow.cases) {\n for (const id of entry.criteria) {\n if (known.has(id)) continue;\n\n findings.push(\n createFinding({\n code: \"GR2013\",\n message: `the case \"${entry.question}\" in ${flow.ref} names ${id}, which the flow does not have`,\n at: entry.at,\n feature: feature.id,\n flow: flow.ref,\n }),\n );\n }\n }\n }\n }\n\n return findings;\n}\n"],"mappings":";;;;;;;;;AAUA,SAAgB,mBAAmB,UAA+C;CAChF,MAAM,SAAS,IAAI,IAAI,SAAS,OAAO,KAAK,UAAU,GAAG,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;CACxF,MAAM,WAA8B,CAAC;CAErC,KAAK,MAAM,WAAW,SAAS,QAAQ,UACrC,KAAK,MAAM,QAAQ,QAAQ,OAAO;EAChC,IAAI,UAAU,SAAS,IAAI,GAAG;EAE9B,KAAK,MAAM,aAAa,KAAK,UAAU;GACrC,IAAI,OAAO,IAAI,GAAG,KAAK,IAAI,GAAG,UAAU,IAAI,GAAG;GAE/C,SAAS,KACP,cAAc;IACZ,MAAM;IACN,SAAS,GAAG,KAAK,IAAI,GAAG,UAAU,GAAG;IACrC,IAAI,UAAU;IACd,SAAS,QAAQ;IACjB,MAAM,KAAK;GACb,CAAC,CACH;EACF;CACF;CAGF,OAAO;AACT;;AAGA,SAAgB,kBAAkB,UAA+C;CAC/E,MAAM,EAAE,UAAU,cAAc,QAAQ;CACxC,MAAM,WAA8B,CAAC;CAErC,KAAK,MAAM,SAAS,SAAS,QAAQ;EACnC,MAAM,OAAO,MAAM,IAAI,MAAM,GAAG;EAChC,MAAM,UAAU,CAAC,OACb,WAAW,MAAM,QACjB,KAAK,SAAS,MAAM,cAAc,UAAU,OAAO,MAAM,SAAS,IAChE,OACA,MAAM,MAAM,UAAU,MAAM,MAAM;EAExC,IAAI,YAAY,MAAM;EAEtB,SAAS,KACP,cAAc;GACZ,MAAM;GACN,SAAS,YAAY,MAAM,IAAI,GAAG,MAAM,UAAU,UAAU;GAC5D,IAAI,MAAM;GACV,SAAS,MAAM;GACf,MAAM,MAAM;EACd,CAAC,CACH;CACF;CAEA,OAAO;AACT;;AAGA,SAAgB,kBAAkB,UAA+C;CAC/E,MAAM,WAA8B,CAAC;CAErC,KAAK,MAAM,WAAW,SAAS,QAAQ,UACrC,KAAK,MAAM,QAAQ,QAAQ,OAAO;EAChC,MAAM,QAAQ,IAAI,IAAI,KAAK,SAAS,KAAK,cAAc,UAAU,EAAE,CAAC;EAEpE,KAAK,MAAM,SAAS,KAAK,OACvB,KAAK,MAAM,MAAM,MAAM,UAAU;GAC/B,IAAI,MAAM,IAAI,EAAE,GAAG;GAEnB,SAAS,KACP,cAAc;IACZ,MAAM;IACN,SAAS,aAAa,MAAM,SAAS,OAAO,KAAK,IAAI,SAAS,GAAG;IACjE,IAAI,MAAM;IACV,SAAS,QAAQ;IACjB,MAAM,KAAK;GACb,CAAC,CACH;EACF;CAEJ;CAGF,OAAO;AACT"}
@@ -0,0 +1,57 @@
1
+ import { createFinding } from "../../codes/index.mjs";
2
+ import { GRIMOIRE_PATHS } from "../../paths/index.mjs";
3
+ import path from "node:path";
4
+ import { statSync } from "node:fs";
5
+
6
+ //#region ../../packages/grimoire/src/check/rules/screenshots.ts
7
+ /**
8
+ * GR2014: image lines that name a screenshot file that does not exist, or
9
+ * that is not an image type the viewers serve.
10
+ */
11
+ /** Image types a screenshot may have. */
12
+ const SCREENSHOT_EXTENSIONS = [
13
+ ".png",
14
+ ".jpg",
15
+ ".jpeg",
16
+ ".webp",
17
+ ".gif"
18
+ ];
19
+ function isFile(target) {
20
+ try {
21
+ return statSync(target).isFile();
22
+ } catch {
23
+ return false;
24
+ }
25
+ }
26
+ /** GR2014: a screenshot of a story step, page, screen or block that is missing or not an image type. */
27
+ function checkScreenshots(snapshot) {
28
+ const findings = [];
29
+ const folder = path.join(snapshot.root, GRIMOIRE_PATHS.screenshots);
30
+ const check = (screenshots, subject) => {
31
+ for (const screenshot of screenshots) {
32
+ if (screenshot.path === null) continue;
33
+ const extension = path.posix.extname(screenshot.path).toLowerCase();
34
+ const problem = !SCREENSHOT_EXTENSIONS.includes(extension) ? `is not one of ${SCREENSHOT_EXTENSIONS.join(", ")}` : isFile(path.join(folder, ...screenshot.path.split("/"))) ? null : "does not exist";
35
+ if (problem === null) continue;
36
+ findings.push(createFinding({
37
+ code: "GR2014",
38
+ message: `the image ${JSON.stringify(screenshot.written)} ${problem} (grimoire/screenshots/${screenshot.path})`,
39
+ at: screenshot.at,
40
+ ...subject
41
+ }));
42
+ }
43
+ };
44
+ for (const feature of snapshot.written.features) for (const flow of feature.flows) for (const step of flow.story) check(step.screenshots, {
45
+ feature: feature.id,
46
+ flow: flow.ref
47
+ });
48
+ for (const app of snapshot.written.apps) for (const page of [...app.pages, ...app.screens]) {
49
+ check(page.screenshots, { app: app.id.value });
50
+ for (const block of page.blockFiles) check(block.screenshots, { app: app.id.value });
51
+ }
52
+ return findings;
53
+ }
54
+
55
+ //#endregion
56
+ export { SCREENSHOT_EXTENSIONS, checkScreenshots };
57
+ //# sourceMappingURL=screenshots.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"screenshots.mjs","names":[],"sources":["../../../../../../../../../packages/grimoire/src/check/rules/screenshots.ts"],"sourcesContent":["/**\n * GR2014: image lines that name a screenshot file that does not exist, or\n * that is not an image type the viewers serve.\n */\nimport { statSync } from \"node:fs\";\nimport path from \"node:path\";\nimport { createFinding } from \"../../codes\";\nimport type { GrimoireFinding } from \"../../contracts/findings\";\nimport type { GrimoireSnapshot } from \"../../contracts/snapshot\";\nimport type { WrittenScreenshot } from \"../../contracts/written\";\nimport { GRIMOIRE_PATHS } from \"../../paths\";\n\n/** Image types a screenshot may have. */\nexport const SCREENSHOT_EXTENSIONS: readonly string[] = [\".png\", \".jpg\", \".jpeg\", \".webp\", \".gif\"];\n\nfunction isFile(target: string): boolean {\n try {\n return statSync(target).isFile();\n } catch {\n return false;\n }\n}\n\n/** GR2014: a screenshot of a story step, page, screen or block that is missing or not an image type. */\nexport function checkScreenshots(snapshot: GrimoireSnapshot): GrimoireFinding[] {\n const findings: GrimoireFinding[] = [];\n const folder = path.join(snapshot.root, GRIMOIRE_PATHS.screenshots);\n\n const check = (\n screenshots: readonly WrittenScreenshot[],\n subject: { feature?: string; flow?: string; app?: string },\n ): void => {\n for (const screenshot of screenshots) {\n // A path outside the folder is GR1029 (the parser); nothing to look up.\n if (screenshot.path === null) continue;\n\n const extension = path.posix.extname(screenshot.path).toLowerCase();\n const problem = !SCREENSHOT_EXTENSIONS.includes(extension)\n ? `is not one of ${SCREENSHOT_EXTENSIONS.join(\", \")}`\n : isFile(path.join(folder, ...screenshot.path.split(\"/\")))\n ? null\n : \"does not exist\";\n\n if (problem === null) continue;\n\n findings.push(\n createFinding({\n code: \"GR2014\",\n message: `the image ${JSON.stringify(screenshot.written)} ${problem} (grimoire/screenshots/${screenshot.path})`,\n at: screenshot.at,\n ...subject,\n }),\n );\n }\n };\n\n for (const feature of snapshot.written.features) {\n for (const flow of feature.flows) {\n for (const step of flow.story) {\n check(step.screenshots, { feature: feature.id, flow: flow.ref });\n }\n }\n }\n\n for (const app of snapshot.written.apps) {\n for (const page of [...app.pages, ...app.screens]) {\n check(page.screenshots, { app: app.id.value });\n\n for (const block of page.blockFiles) check(block.screenshots, { app: app.id.value });\n }\n }\n\n return findings;\n}\n"],"mappings":";;;;;;;;;;;AAaA,MAAa,wBAA2C;CAAC;CAAQ;CAAQ;CAAS;CAAS;AAAM;AAEjG,SAAS,OAAO,QAAyB;CACvC,IAAI;EACF,OAAO,SAAS,MAAM,CAAC,CAAC,OAAO;CACjC,QAAQ;EACN,OAAO;CACT;AACF;;AAGA,SAAgB,iBAAiB,UAA+C;CAC9E,MAAM,WAA8B,CAAC;CACrC,MAAM,SAAS,KAAK,KAAK,SAAS,MAAM,eAAe,WAAW;CAElE,MAAM,SACJ,aACA,YACS;EACT,KAAK,MAAM,cAAc,aAAa;GAEpC,IAAI,WAAW,SAAS,MAAM;GAE9B,MAAM,YAAY,KAAK,MAAM,QAAQ,WAAW,IAAI,CAAC,CAAC,YAAY;GAClE,MAAM,UAAU,CAAC,sBAAsB,SAAS,SAAS,IACrD,iBAAiB,sBAAsB,KAAK,IAAI,MAChD,OAAO,KAAK,KAAK,QAAQ,GAAG,WAAW,KAAK,MAAM,GAAG,CAAC,CAAC,IACrD,OACA;GAEN,IAAI,YAAY,MAAM;GAEtB,SAAS,KACP,cAAc;IACZ,MAAM;IACN,SAAS,aAAa,KAAK,UAAU,WAAW,OAAO,EAAE,GAAG,QAAQ,yBAAyB,WAAW,KAAK;IAC7G,IAAI,WAAW;IACf,GAAG;GACL,CAAC,CACH;EACF;CACF;CAEA,KAAK,MAAM,WAAW,SAAS,QAAQ,UACrC,KAAK,MAAM,QAAQ,QAAQ,OACzB,KAAK,MAAM,QAAQ,KAAK,OACtB,MAAM,KAAK,aAAa;EAAE,SAAS,QAAQ;EAAI,MAAM,KAAK;CAAI,CAAC;CAKrE,KAAK,MAAM,OAAO,SAAS,QAAQ,MACjC,KAAK,MAAM,QAAQ,CAAC,GAAG,IAAI,OAAO,GAAG,IAAI,OAAO,GAAG;EACjD,MAAM,KAAK,aAAa,EAAE,KAAK,IAAI,GAAG,MAAM,CAAC;EAE7C,KAAK,MAAM,SAAS,KAAK,YAAY,MAAM,MAAM,aAAa,EAAE,KAAK,IAAI,GAAG,MAAM,CAAC;CACrF;CAGF,OAAO;AACT"}
@@ -57,6 +57,10 @@ export declare const GRIMOIRE_CODE_LIST: readonly [GrimoireCodeDefinition & {
57
57
  readonly code: "GR1027";
58
58
  }, GrimoireCodeDefinition & {
59
59
  readonly code: "GR1028";
60
+ }, GrimoireCodeDefinition & {
61
+ readonly code: "GR1029";
62
+ }, GrimoireCodeDefinition & {
63
+ readonly code: "GR1030";
60
64
  }, GrimoireCodeDefinition & {
61
65
  readonly code: "GR2001";
62
66
  }, GrimoireCodeDefinition & {
@@ -81,6 +85,10 @@ export declare const GRIMOIRE_CODE_LIST: readonly [GrimoireCodeDefinition & {
81
85
  readonly code: "GR2011";
82
86
  }, GrimoireCodeDefinition & {
83
87
  readonly code: "GR2012";
88
+ }, GrimoireCodeDefinition & {
89
+ readonly code: "GR2013";
90
+ }, GrimoireCodeDefinition & {
91
+ readonly code: "GR2014";
84
92
  }, GrimoireCodeDefinition & {
85
93
  readonly code: "GR3001";
86
94
  }, GrimoireCodeDefinition & {
@@ -109,6 +117,10 @@ export declare const GRIMOIRE_CODE_LIST: readonly [GrimoireCodeDefinition & {
109
117
  readonly code: "GR4007";
110
118
  }, GrimoireCodeDefinition & {
111
119
  readonly code: "GR4008";
120
+ }, GrimoireCodeDefinition & {
121
+ readonly code: "GR4009";
122
+ }, GrimoireCodeDefinition & {
123
+ readonly code: "GR4010";
112
124
  }, GrimoireCodeDefinition & {
113
125
  readonly code: "GR5001";
114
126
  }, GrimoireCodeDefinition & {
@@ -1 +1 @@
1
- {"version":3,"file":"codes.d.mts","names":[],"sources":["../../../../../../../../packages/grimoire/src/codes/codes.ts"],"mappings":";;;qBA0Ca,8BAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAqsBnB,uBAAuB;;qBAGtB,gBAAgB,SAAS,OAAO,cAAc"}
1
+ {"version":3,"file":"codes.d.mts","names":[],"sources":["../../../../../../../../packages/grimoire/src/codes/codes.ts"],"mappings":";;;qBA0Ca,8BAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAqvBnB,uBAAuB;;qBAGtB,gBAAgB,SAAS,OAAO,cAAc"}
@@ -44,6 +44,8 @@ const GRIMOIRE_CODE_LIST = [
44
44
  define("GR1026", "structure", "error", "The feature README lists a flow that has no file", "Add `flows/<flow>.md`, or remove the flow from the README's Flows list.", WRITE),
45
45
  define("GR1027", "structure", "warning", "A flow file is not listed in the feature README", "Add the flow to the README's Flows list.", WRITE),
46
46
  define("GR1028", "structure", "error", "A list line has the wrong form", "Write list lines as `- name text`: the name, spaces, then the text.", WRITE),
47
+ define("GR1029", "structure", "warning", "An image line points outside grimoire/screenshots", "Keep screenshots in `grimoire/screenshots/` and write the path relative to the Markdown file, like `![Product page](../../../screenshots/web/product.png)`.", WRITE),
48
+ define("GR1030", "structure", "warning", "A flow has no summary", "Write one or two plain sentences under the flow's `# Title`: who does what, and what they get.", WRITE),
47
49
  define("GR2001", "links", "error", "A route step names a route that does not exist", "Fix the method and path in the flow, or add the route in code.", RECORD),
48
50
  define("GR2002", "links", "error", "A page step names a page that does not exist", "Fix the route path in the flow, or add the page to one of the feature's apps. A step scoped like `page /support [web-admin]` looks only in that app.", RECORD),
49
51
  define("GR2003", "links", "error", "A mail step names a mail that does not exist", "Use the mail's name as code defines it, or add the mail.", RECORD),
@@ -56,6 +58,8 @@ const GRIMOIRE_CODE_LIST = [
56
58
  define("GR2010", "links", "error", "A changelog entry names a flow that does not exist", "Fix the flow id before the `:`, or add the flow.", RECORD),
57
59
  define("GR2011", "links", "error", "A changelog entry names a criterion the flow does not have", "Fix the criterion id, or add the criterion to the flow.", RECORD),
58
60
  define("GR2012", "links", "error", "A README relation names a flow that does not exist", "Fix the `<feature>/<flow>` reference in Affects and affected by.", WRITE),
61
+ define("GR2013", "links", "error", "A case names a criterion the flow does not have", "Fix the `(AC-n)` at the end of the case line, or add the criterion under Acceptance criteria.", WRITE),
62
+ define("GR2014", "links", "warning", "An image line names a screenshot file that does not exist", "Add the image under `grimoire/screenshots/`, or fix the path.", WRITE),
59
63
  define("GR3001", "files", "warning", "A source file has no header sentence", "Start the file with a one-sentence comment saying why it exists.", FILE),
60
64
  define("GR3002", "files", "warning", "A source file belongs to no feature", "Add its folder to a feature's `folders`, or tag it `@feature <id>` in its header.", FILE),
61
65
  define("GR3003", "files", "error", "A source file has two owners", "Keep one owner: remove the duplicate folder from one feature, or keep one `@feature` tag.", FILE),
@@ -70,6 +74,8 @@ const GRIMOIRE_CODE_LIST = [
70
74
  define("GR4006", "tests", "error", "A test proving a criterion failed in its last run", "Fix the code or the test, then run the tests again.", RECORD),
71
75
  define("GR4007", "tests", "warning", "A criterion's test result is older than the test file", "Run the tests again.", RECORD),
72
76
  define("GR4008", "tests", "warning", "A criterion's test did not run in the last run", "Run the tests that prove the criterion.", RECORD),
77
+ define("GR4009", "tests", "warning", "Tests prove criteria but no test results are recorded", "Add `grimoireReporter()` from `@warlock.js/grimoire/vitest` to `test.reporters` in the Vitest config and run the tests; in production, ship the results file with the deploy.", RECORD),
78
+ define("GR4010", "tests", "warning", "The reporter could not match a proving test to its result", "Keep the `it(...)` or `test(...)` call on the line right under the `@proves` comment, with a plain string name.", RECORD),
73
79
  define("GR5001", "apps", "error", "A block points to a flow that does not exist", "Fix the `<feature>/<flow>` in the Flow column or the block file.", APP),
74
80
  define("GR5002", "apps", "error", "A condition is not declared in the app README", "Add the condition under Conditions in the app README, or use a declared one.", APP),
75
81
  define("GR5003", "apps", "error", "A page's route does not exist in its site", "Fix the `route` of the page file, or remove the page file if the page is gone.", APP),
@@ -1 +1 @@
1
- {"version":3,"file":"codes.mjs","names":[],"sources":["../../../../../../../../packages/grimoire/src/codes/codes.ts"],"sourcesContent":["/**\n * The catalog of stable Grimoire finding codes.\n *\n * THE SCHEME: `GR` followed by four digits. The first digit is the area:\n *\n * | Range | Area | Meaning |\n * | ------ | --------- | ----------------------------------------------------------- |\n * | GR1xxx | structure | a written file does not follow its fixed structure |\n * | GR2xxx | links | a written name points at something that does not exist |\n * | GR3xxx | files | source files: headers, owners, files no flow reaches |\n * | GR4xxx | tests | criteria, `@proves` lines and test results |\n * | GR5xxx | apps | sites, mobile apps, pages, screens and blocks |\n * | GR6xxx | changelog | feature versions, changelogs and releases |\n * | GR7xxx | tasks | task files |\n * | GR8xxx | book | building the book from the framework's facts |\n * | GR9xxx | usage | a command or query was asked something it cannot answer |\n *\n * STABILITY: a released code keeps its meaning. Titles and fixes may be\n * reworded; a code is never reused or renumbered.\n *\n * This module imports nothing, so any entry can use it.\n */\nimport type { GrimoireCodeDefinition } from \"../contracts/findings\";\n\nfunction define<const Code extends string>(\n code: Code,\n area: GrimoireCodeDefinition[\"area\"],\n severity: GrimoireCodeDefinition[\"severity\"],\n title: string,\n fix: string,\n skill: string,\n): GrimoireCodeDefinition & { readonly code: Code } {\n return { code, area, severity, title, fix, skill };\n}\n\nconst WRITE = \"write-a-feature\";\nconst RECORD = \"record-a-change\";\nconst APP = \"describe-an-app\";\nconst FILE = \"document-a-file\";\nconst USE = \"use-the-grimoire\";\n\n/** Every code, in order. */\nexport const GRIMOIRE_CODE_LIST = [\n // ── GR1xxx structure ─────────────────────────────────────────────────────\n define(\n \"GR1001\",\n \"structure\",\n \"error\",\n \"A written file has no front matter\",\n \"Start the file with the front matter block its template shows, between two `---` lines.\",\n WRITE,\n ),\n define(\n \"GR1002\",\n \"structure\",\n \"error\",\n \"The front matter cannot be read\",\n \"Write one `key: value` per line; lists as `[a, b]` or as `- item` lines under the key; close the block with `---`.\",\n WRITE,\n ),\n define(\n \"GR1003\",\n \"structure\",\n \"error\",\n \"A required front matter key is missing\",\n \"Add the key named in the message; the template of that file lists every required key.\",\n WRITE,\n ),\n define(\n \"GR1004\",\n \"structure\",\n \"error\",\n \"A front matter value has the wrong form\",\n \"Use the form the message names: dates as yyyy-mm-dd, versions as 2.1, ids in lower-case-with-dashes, a status from the list (a task status is open, waiting for approval, approved, in progress, blocked, done or dropped; a question for the owner is waiting for approval).\",\n WRITE,\n ),\n define(\n \"GR1005\",\n \"structure\",\n \"warning\",\n \"A front matter key is not part of the template\",\n \"Remove the key, or move what it says into the body of the file.\",\n WRITE,\n ),\n define(\n \"GR1006\",\n \"structure\",\n \"error\",\n \"A required heading is missing\",\n \"Add the heading named in the message, spelled as in the template.\",\n WRITE,\n ),\n define(\n \"GR1007\",\n \"structure\",\n \"warning\",\n \"A heading is not part of the template\",\n \"Use the template's headings; put the text under one of them or remove it.\",\n WRITE,\n ),\n define(\n \"GR1008\",\n \"structure\",\n \"error\",\n \"A step line has the wrong form\",\n \"Write steps as `1. route POST /wishlist`: a number, a kind, then the name used in code.\",\n WRITE,\n ),\n define(\n \"GR1009\",\n \"structure\",\n \"error\",\n \"A step names an unknown kind\",\n \"Use one of: page, route, mail, notification, job, event, outside service, affects.\",\n WRITE,\n ),\n define(\n \"GR1010\",\n \"structure\",\n \"error\",\n \"Steps are not numbered 1, 2, 3 in order\",\n \"Number the steps from 1 without gaps, in the order a user meets them.\",\n WRITE,\n ),\n define(\n \"GR1011\",\n \"structure\",\n \"error\",\n \"A case line has the wrong form\",\n \"Write cases as `- double submit two taps save once`: the question, spaces, then the answer.\",\n WRITE,\n ),\n define(\n \"GR1012\",\n \"structure\",\n \"warning\",\n \"A case question is not answered\",\n \"Answer the question under Cases (or `does not apply` and why), or list it under Not handled.\",\n WRITE,\n ),\n define(\n \"GR1013\",\n \"structure\",\n \"error\",\n \"A criterion line has the wrong form\",\n \"Write criteria as `- AC-3 a guest is sent to sign in`, optionally `- AC-4 [mobile] …`.\",\n WRITE,\n ),\n define(\n \"GR1014\",\n \"structure\",\n \"error\",\n \"A criterion id is used twice in one flow\",\n \"Give the new criterion the next free number. Never renumber existing criteria.\",\n WRITE,\n ),\n define(\n \"GR1015\",\n \"structure\",\n \"error\",\n \"A changelog line has the wrong form\",\n \"Write entries as `- 2.1 fixed new-arrivals: what changed (AC-2)`.\",\n RECORD,\n ),\n define(\n \"GR1016\",\n \"structure\",\n \"error\",\n \"A changelog entry uses an unknown word\",\n \"Use one of: added, changed, fixed, removed.\",\n RECORD,\n ),\n define(\n \"GR1017\",\n \"structure\",\n \"error\",\n \"A changelog heading has the wrong form\",\n \"Use `## Unreleased`, or `## <release> (<yyyy-mm-dd>)` for entries of a release.\",\n RECORD,\n ),\n define(\n \"GR1018\",\n \"structure\",\n \"error\",\n \"A blocks table has the wrong form\",\n \"Use the columns Block, Flow, Who sees it, Changes with; one row per part of the page.\",\n APP,\n ),\n define(\n \"GR1019\",\n \"structure\",\n \"error\",\n \"An id does not match its folder or file name\",\n \"Make the front matter `id` (or `release`) equal the folder or file name.\",\n WRITE,\n ),\n define(\n \"GR1020\",\n \"structure\",\n \"warning\",\n \"A file in the grimoire folder is not part of the layout\",\n \"Move the file to where the layout expects it, or remove it.\",\n USE,\n ),\n define(\n \"GR1021\",\n \"structure\",\n \"error\",\n \"A feature, app, page or screen folder has no README.md\",\n \"Add README.md with the front matter of its template.\",\n WRITE,\n ),\n define(\n \"GR1022\",\n \"structure\",\n \"error\",\n \"Two files use the same id\",\n \"Give each feature, app or task its own id.\",\n WRITE,\n ),\n define(\n \"GR1023\",\n \"structure\",\n \"error\",\n \"A task file is misnamed or misplaced\",\n \"Name tasks `T-<n>-<slug>.md`, in `tasks/open/` or `tasks/done/<yyyy-mm>/`.\",\n RECORD,\n ),\n define(\n \"GR1024\",\n \"structure\",\n \"error\",\n \"The collected-list markers of a release file are broken\",\n \"Keep the start and end markers in pairs, or remove both and run `warlock grimoire release` again.\",\n RECORD,\n ),\n define(\n \"GR1025\",\n \"structure\",\n \"error\",\n \"A written file cannot be read\",\n \"Save the file as UTF-8 text.\",\n USE,\n ),\n define(\n \"GR1026\",\n \"structure\",\n \"error\",\n \"The feature README lists a flow that has no file\",\n \"Add `flows/<flow>.md`, or remove the flow from the README's Flows list.\",\n WRITE,\n ),\n define(\n \"GR1027\",\n \"structure\",\n \"warning\",\n \"A flow file is not listed in the feature README\",\n \"Add the flow to the README's Flows list.\",\n WRITE,\n ),\n define(\n \"GR1028\",\n \"structure\",\n \"error\",\n \"A list line has the wrong form\",\n \"Write list lines as `- name text`: the name, spaces, then the text.\",\n WRITE,\n ),\n\n // ── GR2xxx links ─────────────────────────────────────────────────────────\n define(\n \"GR2001\",\n \"links\",\n \"error\",\n \"A route step names a route that does not exist\",\n \"Fix the method and path in the flow, or add the route in code.\",\n RECORD,\n ),\n define(\n \"GR2002\",\n \"links\",\n \"error\",\n \"A page step names a page that does not exist\",\n \"Fix the route path in the flow, or add the page to one of the feature's apps. A step scoped like `page /support [web-admin]` looks only in that app.\",\n RECORD,\n ),\n define(\n \"GR2003\",\n \"links\",\n \"error\",\n \"A mail step names a mail that does not exist\",\n \"Use the mail's name as code defines it, or add the mail.\",\n RECORD,\n ),\n define(\n \"GR2004\",\n \"links\",\n \"error\",\n \"A notification step names a notification that does not exist\",\n \"Use the notification's name as code defines it, or add it.\",\n RECORD,\n ),\n define(\n \"GR2005\",\n \"links\",\n \"error\",\n \"A job step names a job that does not exist\",\n \"Use the job's name as code defines it, or add the job.\",\n RECORD,\n ),\n define(\n \"GR2006\",\n \"links\",\n \"error\",\n \"An event step names an event that does not exist\",\n \"Use the event's name as code emits it, or add the event.\",\n RECORD,\n ),\n define(\n \"GR2007\",\n \"links\",\n \"error\",\n \"An affects step names a feature or flow that does not exist\",\n \"Write `affects <feature>/<flow>` with an existing feature and flow.\",\n WRITE,\n ),\n define(\n \"GR2008\",\n \"links\",\n \"error\",\n \"A name refers to an app with no folder\",\n \"Add `grimoire/apps/<app>/README.md`, or fix the app id.\",\n APP,\n ),\n define(\n \"GR2009\",\n \"links\",\n \"warning\",\n \"A flow names an app its feature does not list\",\n \"Add the app to the feature's `apps`, or fix the app id in Differs by app or the criterion.\",\n WRITE,\n ),\n define(\n \"GR2010\",\n \"links\",\n \"error\",\n \"A changelog entry names a flow that does not exist\",\n \"Fix the flow id before the `:`, or add the flow.\",\n RECORD,\n ),\n define(\n \"GR2011\",\n \"links\",\n \"error\",\n \"A changelog entry names a criterion the flow does not have\",\n \"Fix the criterion id, or add the criterion to the flow.\",\n RECORD,\n ),\n define(\n \"GR2012\",\n \"links\",\n \"error\",\n \"A README relation names a flow that does not exist\",\n \"Fix the `<feature>/<flow>` reference in Affects and affected by.\",\n WRITE,\n ),\n\n // ── GR3xxx files ─────────────────────────────────────────────────────────\n define(\n \"GR3001\",\n \"files\",\n \"warning\",\n \"A source file has no header sentence\",\n \"Start the file with a one-sentence comment saying why it exists.\",\n FILE,\n ),\n define(\n \"GR3002\",\n \"files\",\n \"warning\",\n \"A source file belongs to no feature\",\n \"Add its folder to a feature's `folders`, or tag it `@feature <id>` in its header.\",\n FILE,\n ),\n define(\n \"GR3003\",\n \"files\",\n \"error\",\n \"A source file has two owners\",\n \"Keep one owner: remove the duplicate folder from one feature, or keep one `@feature` tag.\",\n FILE,\n ),\n define(\n \"GR3004\",\n \"files\",\n \"error\",\n \"A `@feature` tag names a feature that does not exist\",\n \"Fix the tag, or write the feature.\",\n FILE,\n ),\n define(\n \"GR3005\",\n \"files\",\n \"error\",\n \"A feature's `folders` entry does not exist\",\n \"Fix the folder or file path, or remove it from `folders`.\",\n WRITE,\n ),\n define(\n \"GR3006\",\n \"files\",\n \"warning\",\n \"A file in a feature's folders is reached by no flow\",\n \"Describe the behaviour in a flow, or delete dead code.\",\n RECORD,\n ),\n\n // ── GR4xxx tests ─────────────────────────────────────────────────────────\n define(\n \"GR4001\",\n \"tests\",\n \"warning\",\n \"A criterion has no test\",\n \"Write a test with `// @proves <feature>/<flow> AC-<n>` above it, or say in the task why not.\",\n RECORD,\n ),\n define(\n \"GR4002\",\n \"tests\",\n \"error\",\n \"A `@proves` line names a flow or criterion that does not exist\",\n \"Fix the `@proves` line to name an existing `<feature>/<flow> AC-<n>`.\",\n RECORD,\n ),\n define(\n \"GR4003\",\n \"tests\",\n \"error\",\n \"A `@proves` line has the wrong form\",\n \"Write `// @proves <feature>/<flow> AC-<n>` on its own line.\",\n RECORD,\n ),\n define(\n \"GR4004\",\n \"tests\",\n \"error\",\n \"A `@proves` line is not directly above a test\",\n \"Move the line right above the `it(…)` or `test(…)` it describes.\",\n RECORD,\n ),\n define(\n \"GR4005\",\n \"tests\",\n \"warning\",\n \"One test proves two criteria\",\n \"Split the test so each proves one criterion.\",\n RECORD,\n ),\n define(\n \"GR4006\",\n \"tests\",\n \"error\",\n \"A test proving a criterion failed in its last run\",\n \"Fix the code or the test, then run the tests again.\",\n RECORD,\n ),\n define(\n \"GR4007\",\n \"tests\",\n \"warning\",\n \"A criterion's test result is older than the test file\",\n \"Run the tests again.\",\n RECORD,\n ),\n define(\n \"GR4008\",\n \"tests\",\n \"warning\",\n \"A criterion's test did not run in the last run\",\n \"Run the tests that prove the criterion.\",\n RECORD,\n ),\n\n // ── GR5xxx apps ──────────────────────────────────────────────────────────\n define(\n \"GR5001\",\n \"apps\",\n \"error\",\n \"A block points to a flow that does not exist\",\n \"Fix the `<feature>/<flow>` in the Flow column or the block file.\",\n APP,\n ),\n define(\n \"GR5002\",\n \"apps\",\n \"error\",\n \"A condition is not declared in the app README\",\n \"Add the condition under Conditions in the app README, or use a declared one.\",\n APP,\n ),\n define(\n \"GR5003\",\n \"apps\",\n \"error\",\n \"A page's route does not exist in its site\",\n \"Fix the `route` of the page file, or remove the page file if the page is gone.\",\n APP,\n ),\n define(\n \"GR5004\",\n \"apps\",\n \"error\",\n \"A page names a layout with no file\",\n \"Add `layouts/<layout>.md` to the app, or fix the page's `layout`.\",\n APP,\n ),\n define(\n \"GR5005\",\n \"apps\",\n \"error\",\n \"An app's root matches no site or mobile app\",\n \"Set `root` to the site folder (`src/web/$sites/<site>`) or the mobile app folder.\",\n APP,\n ),\n define(\n \"GR5006\",\n \"apps\",\n \"error\",\n \"A screen's route does not exist in the mobile app\",\n \"Fix the `route` of the screen file, or remove it if the screen is gone.\",\n APP,\n ),\n define(\n \"GR5007\",\n \"apps\",\n \"warning\",\n \"A block file has no row in its page's Blocks table\",\n \"Add the block to the page's Blocks table, or remove the block file.\",\n APP,\n ),\n define(\n \"GR5008\",\n \"apps\",\n \"error\",\n \"An entry point in Also reached from does not exist\",\n \"Fix the mail, notification or page name.\",\n APP,\n ),\n define(\n \"GR5009\",\n \"apps\",\n \"warning\",\n \"A site or mobile app has no folder in grimoire/apps\",\n \"Add `grimoire/apps/<app>/README.md` for it.\",\n APP,\n ),\n\n // ── GR6xxx changelog ─────────────────────────────────────────────────────\n define(\n \"GR6001\",\n \"changelog\",\n \"error\",\n \"A release lists a changelog entry that is not stamped with it\",\n \"Move the entry under `## <release> (<date>)` in the feature's CHANGELOG.md.\",\n RECORD,\n ),\n define(\n \"GR6002\",\n \"changelog\",\n \"error\",\n \"A changelog release section has no release file\",\n \"Write `grimoire/releases/<release>.md`, or fix the release in the heading.\",\n RECORD,\n ),\n define(\n \"GR6003\",\n \"changelog\",\n \"error\",\n \"A changelog release date differs from the release file\",\n \"Use the date in the release file's front matter.\",\n RECORD,\n ),\n define(\n \"GR6004\",\n \"changelog\",\n \"error\",\n \"The README `updated` is older than the newest changelog entry\",\n \"Reshape the README to describe the feature as it is now, and set `updated`.\",\n RECORD,\n ),\n define(\n \"GR6005\",\n \"changelog\",\n \"error\",\n \"The README `version` differs from the newest changelog entry\",\n \"Set `version` to the newest entry's version.\",\n RECORD,\n ),\n define(\n \"GR6006\",\n \"changelog\",\n \"warning\",\n \"A changelog word does not match its version step\",\n \"Use a whole-number version for added and removed, a decimal for changed and fixed.\",\n RECORD,\n ),\n define(\n \"GR6007\",\n \"changelog\",\n \"error\",\n \"A flow's `since` is newer than its feature's version\",\n \"Fix `since`, or the feature `version`.\",\n WRITE,\n ),\n define(\n \"GR6008\",\n \"changelog\",\n \"warning\",\n \"A new whole-number version has no brief\",\n \"Write `versions/v<n>.md` before building it.\",\n WRITE,\n ),\n\n // ── GR7xxx tasks ─────────────────────────────────────────────────────────\n define(\n \"GR7001\",\n \"tasks\",\n \"error\",\n \"A task names a feature that does not exist\",\n \"Fix the task's `feature`, or write the feature first.\",\n WRITE,\n ),\n define(\n \"GR7002\",\n \"tasks\",\n \"error\",\n \"A task names a flow that does not exist\",\n \"Fix the task's `flow`, or write the flow first.\",\n WRITE,\n ),\n define(\n \"GR7003\",\n \"tasks\",\n \"error\",\n \"A task's status does not match its folder\",\n \"Done tasks live in `tasks/done/<yyyy-mm>/` with `status: done` and `shipped`; open tasks in `tasks/open/`.\",\n RECORD,\n ),\n define(\n \"GR7004\",\n \"tasks\",\n \"error\",\n \"A task's `shipped` names a version the changelog does not have\",\n \"Fix `shipped: <feature> <version>`, or add the changelog entry.\",\n RECORD,\n ),\n define(\n \"GR7005\",\n \"tasks\",\n \"warning\",\n \"A task's brief does not exist\",\n \"Fix the `Brief:` path, or write the brief.\",\n WRITE,\n ),\n\n // ── GR8xxx book ──────────────────────────────────────────────────────────\n define(\n \"GR8001\",\n \"book\",\n \"error\",\n \"The project's source files could not be read\",\n \"Read the message; fix the file or folder it names, then build again.\",\n USE,\n ),\n define(\n \"GR8002\",\n \"book\",\n \"warning\",\n \"Route facts could not be read because the app did not boot\",\n \"Run `warlock doctor`, fix what stops the app from booting, then `warlock grimoire build`.\",\n USE,\n ),\n define(\n \"GR8003\",\n \"book\",\n \"warning\",\n \"Route facts are older than the routes files\",\n \"Run `warlock grimoire build` to refresh them.\",\n USE,\n ),\n define(\n \"GR8004\",\n \"book\",\n \"warning\",\n \"Pages or screens could not be read\",\n \"Read the message; fix the page file it names, then build again.\",\n USE,\n ),\n\n // ── GR9xxx usage ─────────────────────────────────────────────────────────\n define(\n \"GR9001\",\n \"usage\",\n \"error\",\n \"The file is not in the book\",\n \"Pass a code file under the source roots, as a project-relative path.\",\n USE,\n ),\n define(\n \"GR9002\",\n \"usage\",\n \"error\",\n \"No route matches\",\n 'Pass `\"<METHOD> <path>\"` as the route is registered; `warlock routes` lists them.',\n USE,\n ),\n define(\n \"GR9003\",\n \"usage\",\n \"error\",\n \"No feature has that id\",\n \"Use an id from `grimoire/features/`.\",\n USE,\n ),\n define(\n \"GR9004\",\n \"usage\",\n \"error\",\n \"No flow has that id\",\n \"Use `<feature>/<flow>` with a file in `grimoire/features/<feature>/flows/`.\",\n USE,\n ),\n define(\n \"GR9005\",\n \"usage\",\n \"error\",\n \"The release file has no brief yet\",\n \"Write `grimoire/releases/<release>.md` with `release` and `date` front matter and the brief, then run the command again.\",\n RECORD,\n ),\n define(\n \"GR9006\",\n \"usage\",\n \"error\",\n \"A query argument has the wrong form\",\n \"Read the command's help (`warlock scry --help`) and pass the argument in that form.\",\n USE,\n ),\n] as const;\n\n/** One registered code, as a union. */\nexport type GrimoireCode = (typeof GRIMOIRE_CODE_LIST)[number][\"code\"];\n\n/** The catalog, keyed by code. */\nexport const GRIMOIRE_CODES: Readonly<Record<GrimoireCode, GrimoireCodeDefinition>> =\n Object.fromEntries(\n GRIMOIRE_CODE_LIST.map((definition) => [definition.code, definition]),\n ) as Record<GrimoireCode, GrimoireCodeDefinition>;\n"],"mappings":";AAwBA,SAAS,OACP,MACA,MACA,UACA,OACA,KACA,OACkD;CAClD,OAAO;EAAE;EAAM;EAAM;EAAU;EAAO;EAAK;CAAM;AACnD;AAEA,MAAM,QAAQ;AACd,MAAM,SAAS;AACf,MAAM,MAAM;AACZ,MAAM,OAAO;AACb,MAAM,MAAM;;AAGZ,MAAa,qBAAqB;CAEhC,OACE,UACA,aACA,SACA,sCACA,2FACA,KACF;CACA,OACE,UACA,aACA,SACA,mCACA,sHACA,KACF;CACA,OACE,UACA,aACA,SACA,0CACA,yFACA,KACF;CACA,OACE,UACA,aACA,SACA,2CACA,iRACA,KACF;CACA,OACE,UACA,aACA,WACA,kDACA,mEACA,KACF;CACA,OACE,UACA,aACA,SACA,iCACA,qEACA,KACF;CACA,OACE,UACA,aACA,WACA,yCACA,6EACA,KACF;CACA,OACE,UACA,aACA,SACA,kCACA,6FACA,KACF;CACA,OACE,UACA,aACA,SACA,gCACA,sFACA,KACF;CACA,OACE,UACA,aACA,SACA,2CACA,yEACA,KACF;CACA,OACE,UACA,aACA,SACA,kCACA,iGACA,KACF;CACA,OACE,UACA,aACA,WACA,mCACA,gGACA,KACF;CACA,OACE,UACA,aACA,SACA,uCACA,8FACA,KACF;CACA,OACE,UACA,aACA,SACA,4CACA,kFACA,KACF;CACA,OACE,UACA,aACA,SACA,uCACA,wEACA,MACF;CACA,OACE,UACA,aACA,SACA,0CACA,+CACA,MACF;CACA,OACE,UACA,aACA,SACA,0CACA,mFACA,MACF;CACA,OACE,UACA,aACA,SACA,qCACA,yFACA,GACF;CACA,OACE,UACA,aACA,SACA,gDACA,4EACA,KACF;CACA,OACE,UACA,aACA,WACA,2DACA,+DACA,GACF;CACA,OACE,UACA,aACA,SACA,0DACA,wDACA,KACF;CACA,OACE,UACA,aACA,SACA,6BACA,8CACA,KACF;CACA,OACE,UACA,aACA,SACA,wCACA,8EACA,MACF;CACA,OACE,UACA,aACA,SACA,2DACA,qGACA,MACF;CACA,OACE,UACA,aACA,SACA,iCACA,gCACA,GACF;CACA,OACE,UACA,aACA,SACA,oDACA,2EACA,KACF;CACA,OACE,UACA,aACA,WACA,mDACA,4CACA,KACF;CACA,OACE,UACA,aACA,SACA,kCACA,yEACA,KACF;CAGA,OACE,UACA,SACA,SACA,kDACA,kEACA,MACF;CACA,OACE,UACA,SACA,SACA,gDACA,wJACA,MACF;CACA,OACE,UACA,SACA,SACA,gDACA,4DACA,MACF;CACA,OACE,UACA,SACA,SACA,gEACA,8DACA,MACF;CACA,OACE,UACA,SACA,SACA,8CACA,0DACA,MACF;CACA,OACE,UACA,SACA,SACA,oDACA,4DACA,MACF;CACA,OACE,UACA,SACA,SACA,+DACA,yEACA,KACF;CACA,OACE,UACA,SACA,SACA,0CACA,2DACA,GACF;CACA,OACE,UACA,SACA,WACA,iDACA,8FACA,KACF;CACA,OACE,UACA,SACA,SACA,sDACA,oDACA,MACF;CACA,OACE,UACA,SACA,SACA,8DACA,2DACA,MACF;CACA,OACE,UACA,SACA,SACA,sDACA,oEACA,KACF;CAGA,OACE,UACA,SACA,WACA,wCACA,oEACA,IACF;CACA,OACE,UACA,SACA,WACA,uCACA,qFACA,IACF;CACA,OACE,UACA,SACA,SACA,gCACA,6FACA,IACF;CACA,OACE,UACA,SACA,SACA,wDACA,sCACA,IACF;CACA,OACE,UACA,SACA,SACA,8CACA,6DACA,KACF;CACA,OACE,UACA,SACA,WACA,uDACA,0DACA,MACF;CAGA,OACE,UACA,SACA,WACA,2BACA,gGACA,MACF;CACA,OACE,UACA,SACA,SACA,kEACA,yEACA,MACF;CACA,OACE,UACA,SACA,SACA,uCACA,+DACA,MACF;CACA,OACE,UACA,SACA,SACA,iDACA,oEACA,MACF;CACA,OACE,UACA,SACA,WACA,gCACA,gDACA,MACF;CACA,OACE,UACA,SACA,SACA,qDACA,uDACA,MACF;CACA,OACE,UACA,SACA,WACA,yDACA,wBACA,MACF;CACA,OACE,UACA,SACA,WACA,kDACA,2CACA,MACF;CAGA,OACE,UACA,QACA,SACA,gDACA,oEACA,GACF;CACA,OACE,UACA,QACA,SACA,iDACA,gFACA,GACF;CACA,OACE,UACA,QACA,SACA,6CACA,kFACA,GACF;CACA,OACE,UACA,QACA,SACA,sCACA,qEACA,GACF;CACA,OACE,UACA,QACA,SACA,+CACA,qFACA,GACF;CACA,OACE,UACA,QACA,SACA,qDACA,2EACA,GACF;CACA,OACE,UACA,QACA,WACA,sDACA,uEACA,GACF;CACA,OACE,UACA,QACA,SACA,sDACA,4CACA,GACF;CACA,OACE,UACA,QACA,WACA,uDACA,+CACA,GACF;CAGA,OACE,UACA,aACA,SACA,iEACA,+EACA,MACF;CACA,OACE,UACA,aACA,SACA,mDACA,8EACA,MACF;CACA,OACE,UACA,aACA,SACA,0DACA,oDACA,MACF;CACA,OACE,UACA,aACA,SACA,iEACA,+EACA,MACF;CACA,OACE,UACA,aACA,SACA,gEACA,gDACA,MACF;CACA,OACE,UACA,aACA,WACA,oDACA,sFACA,MACF;CACA,OACE,UACA,aACA,SACA,wDACA,0CACA,KACF;CACA,OACE,UACA,aACA,WACA,2CACA,gDACA,KACF;CAGA,OACE,UACA,SACA,SACA,8CACA,yDACA,KACF;CACA,OACE,UACA,SACA,SACA,2CACA,mDACA,KACF;CACA,OACE,UACA,SACA,SACA,6CACA,8GACA,MACF;CACA,OACE,UACA,SACA,SACA,kEACA,mEACA,MACF;CACA,OACE,UACA,SACA,WACA,iCACA,8CACA,KACF;CAGA,OACE,UACA,QACA,SACA,gDACA,wEACA,GACF;CACA,OACE,UACA,QACA,WACA,8DACA,6FACA,GACF;CACA,OACE,UACA,QACA,WACA,+CACA,iDACA,GACF;CACA,OACE,UACA,QACA,WACA,sCACA,mEACA,GACF;CAGA,OACE,UACA,SACA,SACA,+BACA,wEACA,GACF;CACA,OACE,UACA,SACA,SACA,oBACA,uFACA,GACF;CACA,OACE,UACA,SACA,SACA,0BACA,wCACA,GACF;CACA,OACE,UACA,SACA,SACA,uBACA,+EACA,GACF;CACA,OACE,UACA,SACA,SACA,qCACA,4HACA,MACF;CACA,OACE,UACA,SACA,SACA,uCACA,uFACA,GACF;AACF;;AAMA,MAAa,iBACX,OAAO,YACL,mBAAmB,KAAK,eAAe,CAAC,WAAW,MAAM,UAAU,CAAC,CACtE"}
1
+ {"version":3,"file":"codes.mjs","names":[],"sources":["../../../../../../../../packages/grimoire/src/codes/codes.ts"],"sourcesContent":["/**\n * The catalog of stable Grimoire finding codes.\n *\n * THE SCHEME: `GR` followed by four digits. The first digit is the area:\n *\n * | Range | Area | Meaning |\n * | ------ | --------- | ----------------------------------------------------------- |\n * | GR1xxx | structure | a written file does not follow its fixed structure |\n * | GR2xxx | links | a written name points at something that does not exist |\n * | GR3xxx | files | source files: headers, owners, files no flow reaches |\n * | GR4xxx | tests | criteria, `@proves` lines and test results |\n * | GR5xxx | apps | sites, mobile apps, pages, screens and blocks |\n * | GR6xxx | changelog | feature versions, changelogs and releases |\n * | GR7xxx | tasks | task files |\n * | GR8xxx | book | building the book from the framework's facts |\n * | GR9xxx | usage | a command or query was asked something it cannot answer |\n *\n * STABILITY: a released code keeps its meaning. Titles and fixes may be\n * reworded; a code is never reused or renumbered.\n *\n * This module imports nothing, so any entry can use it.\n */\nimport type { GrimoireCodeDefinition } from \"../contracts/findings\";\n\nfunction define<const Code extends string>(\n code: Code,\n area: GrimoireCodeDefinition[\"area\"],\n severity: GrimoireCodeDefinition[\"severity\"],\n title: string,\n fix: string,\n skill: string,\n): GrimoireCodeDefinition & { readonly code: Code } {\n return { code, area, severity, title, fix, skill };\n}\n\nconst WRITE = \"write-a-feature\";\nconst RECORD = \"record-a-change\";\nconst APP = \"describe-an-app\";\nconst FILE = \"document-a-file\";\nconst USE = \"use-the-grimoire\";\n\n/** Every code, in order. */\nexport const GRIMOIRE_CODE_LIST = [\n // ── GR1xxx structure ─────────────────────────────────────────────────────\n define(\n \"GR1001\",\n \"structure\",\n \"error\",\n \"A written file has no front matter\",\n \"Start the file with the front matter block its template shows, between two `---` lines.\",\n WRITE,\n ),\n define(\n \"GR1002\",\n \"structure\",\n \"error\",\n \"The front matter cannot be read\",\n \"Write one `key: value` per line; lists as `[a, b]` or as `- item` lines under the key; close the block with `---`.\",\n WRITE,\n ),\n define(\n \"GR1003\",\n \"structure\",\n \"error\",\n \"A required front matter key is missing\",\n \"Add the key named in the message; the template of that file lists every required key.\",\n WRITE,\n ),\n define(\n \"GR1004\",\n \"structure\",\n \"error\",\n \"A front matter value has the wrong form\",\n \"Use the form the message names: dates as yyyy-mm-dd, versions as 2.1, ids in lower-case-with-dashes, a status from the list (a task status is open, waiting for approval, approved, in progress, blocked, done or dropped; a question for the owner is waiting for approval).\",\n WRITE,\n ),\n define(\n \"GR1005\",\n \"structure\",\n \"warning\",\n \"A front matter key is not part of the template\",\n \"Remove the key, or move what it says into the body of the file.\",\n WRITE,\n ),\n define(\n \"GR1006\",\n \"structure\",\n \"error\",\n \"A required heading is missing\",\n \"Add the heading named in the message, spelled as in the template.\",\n WRITE,\n ),\n define(\n \"GR1007\",\n \"structure\",\n \"warning\",\n \"A heading is not part of the template\",\n \"Use the template's headings; put the text under one of them or remove it.\",\n WRITE,\n ),\n define(\n \"GR1008\",\n \"structure\",\n \"error\",\n \"A step line has the wrong form\",\n \"Write steps as `1. route POST /wishlist`: a number, a kind, then the name used in code.\",\n WRITE,\n ),\n define(\n \"GR1009\",\n \"structure\",\n \"error\",\n \"A step names an unknown kind\",\n \"Use one of: page, route, mail, notification, job, event, outside service, affects.\",\n WRITE,\n ),\n define(\n \"GR1010\",\n \"structure\",\n \"error\",\n \"Steps are not numbered 1, 2, 3 in order\",\n \"Number the steps from 1 without gaps, in the order a user meets them.\",\n WRITE,\n ),\n define(\n \"GR1011\",\n \"structure\",\n \"error\",\n \"A case line has the wrong form\",\n \"Write cases as `- double submit two taps save once`: the question, spaces, then the answer.\",\n WRITE,\n ),\n define(\n \"GR1012\",\n \"structure\",\n \"warning\",\n \"A case question is not answered\",\n \"Answer the question under Cases (or `does not apply` and why), or list it under Not handled.\",\n WRITE,\n ),\n define(\n \"GR1013\",\n \"structure\",\n \"error\",\n \"A criterion line has the wrong form\",\n \"Write criteria as `- AC-3 a guest is sent to sign in`, optionally `- AC-4 [mobile] …`.\",\n WRITE,\n ),\n define(\n \"GR1014\",\n \"structure\",\n \"error\",\n \"A criterion id is used twice in one flow\",\n \"Give the new criterion the next free number. Never renumber existing criteria.\",\n WRITE,\n ),\n define(\n \"GR1015\",\n \"structure\",\n \"error\",\n \"A changelog line has the wrong form\",\n \"Write entries as `- 2.1 fixed new-arrivals: what changed (AC-2)`.\",\n RECORD,\n ),\n define(\n \"GR1016\",\n \"structure\",\n \"error\",\n \"A changelog entry uses an unknown word\",\n \"Use one of: added, changed, fixed, removed.\",\n RECORD,\n ),\n define(\n \"GR1017\",\n \"structure\",\n \"error\",\n \"A changelog heading has the wrong form\",\n \"Use `## Unreleased`, or `## <release> (<yyyy-mm-dd>)` for entries of a release.\",\n RECORD,\n ),\n define(\n \"GR1018\",\n \"structure\",\n \"error\",\n \"A blocks table has the wrong form\",\n \"Use the columns Block, Flow, Who sees it, Changes with; one row per part of the page.\",\n APP,\n ),\n define(\n \"GR1019\",\n \"structure\",\n \"error\",\n \"An id does not match its folder or file name\",\n \"Make the front matter `id` (or `release`) equal the folder or file name.\",\n WRITE,\n ),\n define(\n \"GR1020\",\n \"structure\",\n \"warning\",\n \"A file in the grimoire folder is not part of the layout\",\n \"Move the file to where the layout expects it, or remove it.\",\n USE,\n ),\n define(\n \"GR1021\",\n \"structure\",\n \"error\",\n \"A feature, app, page or screen folder has no README.md\",\n \"Add README.md with the front matter of its template.\",\n WRITE,\n ),\n define(\n \"GR1022\",\n \"structure\",\n \"error\",\n \"Two files use the same id\",\n \"Give each feature, app or task its own id.\",\n WRITE,\n ),\n define(\n \"GR1023\",\n \"structure\",\n \"error\",\n \"A task file is misnamed or misplaced\",\n \"Name tasks `T-<n>-<slug>.md`, in `tasks/open/` or `tasks/done/<yyyy-mm>/`.\",\n RECORD,\n ),\n define(\n \"GR1024\",\n \"structure\",\n \"error\",\n \"The collected-list markers of a release file are broken\",\n \"Keep the start and end markers in pairs, or remove both and run `warlock grimoire release` again.\",\n RECORD,\n ),\n define(\n \"GR1025\",\n \"structure\",\n \"error\",\n \"A written file cannot be read\",\n \"Save the file as UTF-8 text.\",\n USE,\n ),\n define(\n \"GR1026\",\n \"structure\",\n \"error\",\n \"The feature README lists a flow that has no file\",\n \"Add `flows/<flow>.md`, or remove the flow from the README's Flows list.\",\n WRITE,\n ),\n define(\n \"GR1027\",\n \"structure\",\n \"warning\",\n \"A flow file is not listed in the feature README\",\n \"Add the flow to the README's Flows list.\",\n WRITE,\n ),\n define(\n \"GR1028\",\n \"structure\",\n \"error\",\n \"A list line has the wrong form\",\n \"Write list lines as `- name text`: the name, spaces, then the text.\",\n WRITE,\n ),\n define(\n \"GR1029\",\n \"structure\",\n \"warning\",\n \"An image line points outside grimoire/screenshots\",\n \"Keep screenshots in `grimoire/screenshots/` and write the path relative to the Markdown file, like `![Product page](../../../screenshots/web/product.png)`.\",\n WRITE,\n ),\n define(\n \"GR1030\",\n \"structure\",\n \"warning\",\n \"A flow has no summary\",\n \"Write one or two plain sentences under the flow's `# Title`: who does what, and what they get.\",\n WRITE,\n ),\n\n // ── GR2xxx links ─────────────────────────────────────────────────────────\n define(\n \"GR2001\",\n \"links\",\n \"error\",\n \"A route step names a route that does not exist\",\n \"Fix the method and path in the flow, or add the route in code.\",\n RECORD,\n ),\n define(\n \"GR2002\",\n \"links\",\n \"error\",\n \"A page step names a page that does not exist\",\n \"Fix the route path in the flow, or add the page to one of the feature's apps. A step scoped like `page /support [web-admin]` looks only in that app.\",\n RECORD,\n ),\n define(\n \"GR2003\",\n \"links\",\n \"error\",\n \"A mail step names a mail that does not exist\",\n \"Use the mail's name as code defines it, or add the mail.\",\n RECORD,\n ),\n define(\n \"GR2004\",\n \"links\",\n \"error\",\n \"A notification step names a notification that does not exist\",\n \"Use the notification's name as code defines it, or add it.\",\n RECORD,\n ),\n define(\n \"GR2005\",\n \"links\",\n \"error\",\n \"A job step names a job that does not exist\",\n \"Use the job's name as code defines it, or add the job.\",\n RECORD,\n ),\n define(\n \"GR2006\",\n \"links\",\n \"error\",\n \"An event step names an event that does not exist\",\n \"Use the event's name as code emits it, or add the event.\",\n RECORD,\n ),\n define(\n \"GR2007\",\n \"links\",\n \"error\",\n \"An affects step names a feature or flow that does not exist\",\n \"Write `affects <feature>/<flow>` with an existing feature and flow.\",\n WRITE,\n ),\n define(\n \"GR2008\",\n \"links\",\n \"error\",\n \"A name refers to an app with no folder\",\n \"Add `grimoire/apps/<app>/README.md`, or fix the app id.\",\n APP,\n ),\n define(\n \"GR2009\",\n \"links\",\n \"warning\",\n \"A flow names an app its feature does not list\",\n \"Add the app to the feature's `apps`, or fix the app id in Differs by app or the criterion.\",\n WRITE,\n ),\n define(\n \"GR2010\",\n \"links\",\n \"error\",\n \"A changelog entry names a flow that does not exist\",\n \"Fix the flow id before the `:`, or add the flow.\",\n RECORD,\n ),\n define(\n \"GR2011\",\n \"links\",\n \"error\",\n \"A changelog entry names a criterion the flow does not have\",\n \"Fix the criterion id, or add the criterion to the flow.\",\n RECORD,\n ),\n define(\n \"GR2012\",\n \"links\",\n \"error\",\n \"A README relation names a flow that does not exist\",\n \"Fix the `<feature>/<flow>` reference in Affects and affected by.\",\n WRITE,\n ),\n define(\n \"GR2013\",\n \"links\",\n \"error\",\n \"A case names a criterion the flow does not have\",\n \"Fix the `(AC-n)` at the end of the case line, or add the criterion under Acceptance criteria.\",\n WRITE,\n ),\n define(\n \"GR2014\",\n \"links\",\n \"warning\",\n \"An image line names a screenshot file that does not exist\",\n \"Add the image under `grimoire/screenshots/`, or fix the path.\",\n WRITE,\n ),\n\n // ── GR3xxx files ─────────────────────────────────────────────────────────\n define(\n \"GR3001\",\n \"files\",\n \"warning\",\n \"A source file has no header sentence\",\n \"Start the file with a one-sentence comment saying why it exists.\",\n FILE,\n ),\n define(\n \"GR3002\",\n \"files\",\n \"warning\",\n \"A source file belongs to no feature\",\n \"Add its folder to a feature's `folders`, or tag it `@feature <id>` in its header.\",\n FILE,\n ),\n define(\n \"GR3003\",\n \"files\",\n \"error\",\n \"A source file has two owners\",\n \"Keep one owner: remove the duplicate folder from one feature, or keep one `@feature` tag.\",\n FILE,\n ),\n define(\n \"GR3004\",\n \"files\",\n \"error\",\n \"A `@feature` tag names a feature that does not exist\",\n \"Fix the tag, or write the feature.\",\n FILE,\n ),\n define(\n \"GR3005\",\n \"files\",\n \"error\",\n \"A feature's `folders` entry does not exist\",\n \"Fix the folder or file path, or remove it from `folders`.\",\n WRITE,\n ),\n define(\n \"GR3006\",\n \"files\",\n \"warning\",\n \"A file in a feature's folders is reached by no flow\",\n \"Describe the behaviour in a flow, or delete dead code.\",\n RECORD,\n ),\n\n // ── GR4xxx tests ─────────────────────────────────────────────────────────\n define(\n \"GR4001\",\n \"tests\",\n \"warning\",\n \"A criterion has no test\",\n \"Write a test with `// @proves <feature>/<flow> AC-<n>` above it, or say in the task why not.\",\n RECORD,\n ),\n define(\n \"GR4002\",\n \"tests\",\n \"error\",\n \"A `@proves` line names a flow or criterion that does not exist\",\n \"Fix the `@proves` line to name an existing `<feature>/<flow> AC-<n>`.\",\n RECORD,\n ),\n define(\n \"GR4003\",\n \"tests\",\n \"error\",\n \"A `@proves` line has the wrong form\",\n \"Write `// @proves <feature>/<flow> AC-<n>` on its own line.\",\n RECORD,\n ),\n define(\n \"GR4004\",\n \"tests\",\n \"error\",\n \"A `@proves` line is not directly above a test\",\n \"Move the line right above the `it(…)` or `test(…)` it describes.\",\n RECORD,\n ),\n define(\n \"GR4005\",\n \"tests\",\n \"warning\",\n \"One test proves two criteria\",\n \"Split the test so each proves one criterion.\",\n RECORD,\n ),\n define(\n \"GR4006\",\n \"tests\",\n \"error\",\n \"A test proving a criterion failed in its last run\",\n \"Fix the code or the test, then run the tests again.\",\n RECORD,\n ),\n define(\n \"GR4007\",\n \"tests\",\n \"warning\",\n \"A criterion's test result is older than the test file\",\n \"Run the tests again.\",\n RECORD,\n ),\n define(\n \"GR4008\",\n \"tests\",\n \"warning\",\n \"A criterion's test did not run in the last run\",\n \"Run the tests that prove the criterion.\",\n RECORD,\n ),\n define(\n \"GR4009\",\n \"tests\",\n \"warning\",\n \"Tests prove criteria but no test results are recorded\",\n \"Add `grimoireReporter()` from `@warlock.js/grimoire/vitest` to `test.reporters` in the Vitest config and run the tests; in production, ship the results file with the deploy.\",\n RECORD,\n ),\n define(\n \"GR4010\",\n \"tests\",\n \"warning\",\n \"The reporter could not match a proving test to its result\",\n \"Keep the `it(...)` or `test(...)` call on the line right under the `@proves` comment, with a plain string name.\",\n RECORD,\n ),\n\n // ── GR5xxx apps ──────────────────────────────────────────────────────────\n define(\n \"GR5001\",\n \"apps\",\n \"error\",\n \"A block points to a flow that does not exist\",\n \"Fix the `<feature>/<flow>` in the Flow column or the block file.\",\n APP,\n ),\n define(\n \"GR5002\",\n \"apps\",\n \"error\",\n \"A condition is not declared in the app README\",\n \"Add the condition under Conditions in the app README, or use a declared one.\",\n APP,\n ),\n define(\n \"GR5003\",\n \"apps\",\n \"error\",\n \"A page's route does not exist in its site\",\n \"Fix the `route` of the page file, or remove the page file if the page is gone.\",\n APP,\n ),\n define(\n \"GR5004\",\n \"apps\",\n \"error\",\n \"A page names a layout with no file\",\n \"Add `layouts/<layout>.md` to the app, or fix the page's `layout`.\",\n APP,\n ),\n define(\n \"GR5005\",\n \"apps\",\n \"error\",\n \"An app's root matches no site or mobile app\",\n \"Set `root` to the site folder (`src/web/$sites/<site>`) or the mobile app folder.\",\n APP,\n ),\n define(\n \"GR5006\",\n \"apps\",\n \"error\",\n \"A screen's route does not exist in the mobile app\",\n \"Fix the `route` of the screen file, or remove it if the screen is gone.\",\n APP,\n ),\n define(\n \"GR5007\",\n \"apps\",\n \"warning\",\n \"A block file has no row in its page's Blocks table\",\n \"Add the block to the page's Blocks table, or remove the block file.\",\n APP,\n ),\n define(\n \"GR5008\",\n \"apps\",\n \"error\",\n \"An entry point in Also reached from does not exist\",\n \"Fix the mail, notification or page name.\",\n APP,\n ),\n define(\n \"GR5009\",\n \"apps\",\n \"warning\",\n \"A site or mobile app has no folder in grimoire/apps\",\n \"Add `grimoire/apps/<app>/README.md` for it.\",\n APP,\n ),\n\n // ── GR6xxx changelog ─────────────────────────────────────────────────────\n define(\n \"GR6001\",\n \"changelog\",\n \"error\",\n \"A release lists a changelog entry that is not stamped with it\",\n \"Move the entry under `## <release> (<date>)` in the feature's CHANGELOG.md.\",\n RECORD,\n ),\n define(\n \"GR6002\",\n \"changelog\",\n \"error\",\n \"A changelog release section has no release file\",\n \"Write `grimoire/releases/<release>.md`, or fix the release in the heading.\",\n RECORD,\n ),\n define(\n \"GR6003\",\n \"changelog\",\n \"error\",\n \"A changelog release date differs from the release file\",\n \"Use the date in the release file's front matter.\",\n RECORD,\n ),\n define(\n \"GR6004\",\n \"changelog\",\n \"error\",\n \"The README `updated` is older than the newest changelog entry\",\n \"Reshape the README to describe the feature as it is now, and set `updated`.\",\n RECORD,\n ),\n define(\n \"GR6005\",\n \"changelog\",\n \"error\",\n \"The README `version` differs from the newest changelog entry\",\n \"Set `version` to the newest entry's version.\",\n RECORD,\n ),\n define(\n \"GR6006\",\n \"changelog\",\n \"warning\",\n \"A changelog word does not match its version step\",\n \"Use a whole-number version for added and removed, a decimal for changed and fixed.\",\n RECORD,\n ),\n define(\n \"GR6007\",\n \"changelog\",\n \"error\",\n \"A flow's `since` is newer than its feature's version\",\n \"Fix `since`, or the feature `version`.\",\n WRITE,\n ),\n define(\n \"GR6008\",\n \"changelog\",\n \"warning\",\n \"A new whole-number version has no brief\",\n \"Write `versions/v<n>.md` before building it.\",\n WRITE,\n ),\n\n // ── GR7xxx tasks ─────────────────────────────────────────────────────────\n define(\n \"GR7001\",\n \"tasks\",\n \"error\",\n \"A task names a feature that does not exist\",\n \"Fix the task's `feature`, or write the feature first.\",\n WRITE,\n ),\n define(\n \"GR7002\",\n \"tasks\",\n \"error\",\n \"A task names a flow that does not exist\",\n \"Fix the task's `flow`, or write the flow first.\",\n WRITE,\n ),\n define(\n \"GR7003\",\n \"tasks\",\n \"error\",\n \"A task's status does not match its folder\",\n \"Done tasks live in `tasks/done/<yyyy-mm>/` with `status: done` and `shipped`; open tasks in `tasks/open/`.\",\n RECORD,\n ),\n define(\n \"GR7004\",\n \"tasks\",\n \"error\",\n \"A task's `shipped` names a version the changelog does not have\",\n \"Fix `shipped: <feature> <version>`, or add the changelog entry.\",\n RECORD,\n ),\n define(\n \"GR7005\",\n \"tasks\",\n \"warning\",\n \"A task's brief does not exist\",\n \"Fix the `Brief:` path, or write the brief.\",\n WRITE,\n ),\n\n // ── GR8xxx book ──────────────────────────────────────────────────────────\n define(\n \"GR8001\",\n \"book\",\n \"error\",\n \"The project's source files could not be read\",\n \"Read the message; fix the file or folder it names, then build again.\",\n USE,\n ),\n define(\n \"GR8002\",\n \"book\",\n \"warning\",\n \"Route facts could not be read because the app did not boot\",\n \"Run `warlock doctor`, fix what stops the app from booting, then `warlock grimoire build`.\",\n USE,\n ),\n define(\n \"GR8003\",\n \"book\",\n \"warning\",\n \"Route facts are older than the routes files\",\n \"Run `warlock grimoire build` to refresh them.\",\n USE,\n ),\n define(\n \"GR8004\",\n \"book\",\n \"warning\",\n \"Pages or screens could not be read\",\n \"Read the message; fix the page file it names, then build again.\",\n USE,\n ),\n\n // ── GR9xxx usage ─────────────────────────────────────────────────────────\n define(\n \"GR9001\",\n \"usage\",\n \"error\",\n \"The file is not in the book\",\n \"Pass a code file under the source roots, as a project-relative path.\",\n USE,\n ),\n define(\n \"GR9002\",\n \"usage\",\n \"error\",\n \"No route matches\",\n 'Pass `\"<METHOD> <path>\"` as the route is registered; `warlock routes` lists them.',\n USE,\n ),\n define(\n \"GR9003\",\n \"usage\",\n \"error\",\n \"No feature has that id\",\n \"Use an id from `grimoire/features/`.\",\n USE,\n ),\n define(\n \"GR9004\",\n \"usage\",\n \"error\",\n \"No flow has that id\",\n \"Use `<feature>/<flow>` with a file in `grimoire/features/<feature>/flows/`.\",\n USE,\n ),\n define(\n \"GR9005\",\n \"usage\",\n \"error\",\n \"The release file has no brief yet\",\n \"Write `grimoire/releases/<release>.md` with `release` and `date` front matter and the brief, then run the command again.\",\n RECORD,\n ),\n define(\n \"GR9006\",\n \"usage\",\n \"error\",\n \"A query argument has the wrong form\",\n \"Read the command's help (`warlock scry --help`) and pass the argument in that form.\",\n USE,\n ),\n] as const;\n\n/** One registered code, as a union. */\nexport type GrimoireCode = (typeof GRIMOIRE_CODE_LIST)[number][\"code\"];\n\n/** The catalog, keyed by code. */\nexport const GRIMOIRE_CODES: Readonly<Record<GrimoireCode, GrimoireCodeDefinition>> =\n Object.fromEntries(\n GRIMOIRE_CODE_LIST.map((definition) => [definition.code, definition]),\n ) as Record<GrimoireCode, GrimoireCodeDefinition>;\n"],"mappings":";AAwBA,SAAS,OACP,MACA,MACA,UACA,OACA,KACA,OACkD;CAClD,OAAO;EAAE;EAAM;EAAM;EAAU;EAAO;EAAK;CAAM;AACnD;AAEA,MAAM,QAAQ;AACd,MAAM,SAAS;AACf,MAAM,MAAM;AACZ,MAAM,OAAO;AACb,MAAM,MAAM;;AAGZ,MAAa,qBAAqB;CAEhC,OACE,UACA,aACA,SACA,sCACA,2FACA,KACF;CACA,OACE,UACA,aACA,SACA,mCACA,sHACA,KACF;CACA,OACE,UACA,aACA,SACA,0CACA,yFACA,KACF;CACA,OACE,UACA,aACA,SACA,2CACA,iRACA,KACF;CACA,OACE,UACA,aACA,WACA,kDACA,mEACA,KACF;CACA,OACE,UACA,aACA,SACA,iCACA,qEACA,KACF;CACA,OACE,UACA,aACA,WACA,yCACA,6EACA,KACF;CACA,OACE,UACA,aACA,SACA,kCACA,6FACA,KACF;CACA,OACE,UACA,aACA,SACA,gCACA,sFACA,KACF;CACA,OACE,UACA,aACA,SACA,2CACA,yEACA,KACF;CACA,OACE,UACA,aACA,SACA,kCACA,iGACA,KACF;CACA,OACE,UACA,aACA,WACA,mCACA,gGACA,KACF;CACA,OACE,UACA,aACA,SACA,uCACA,8FACA,KACF;CACA,OACE,UACA,aACA,SACA,4CACA,kFACA,KACF;CACA,OACE,UACA,aACA,SACA,uCACA,wEACA,MACF;CACA,OACE,UACA,aACA,SACA,0CACA,+CACA,MACF;CACA,OACE,UACA,aACA,SACA,0CACA,mFACA,MACF;CACA,OACE,UACA,aACA,SACA,qCACA,yFACA,GACF;CACA,OACE,UACA,aACA,SACA,gDACA,4EACA,KACF;CACA,OACE,UACA,aACA,WACA,2DACA,+DACA,GACF;CACA,OACE,UACA,aACA,SACA,0DACA,wDACA,KACF;CACA,OACE,UACA,aACA,SACA,6BACA,8CACA,KACF;CACA,OACE,UACA,aACA,SACA,wCACA,8EACA,MACF;CACA,OACE,UACA,aACA,SACA,2DACA,qGACA,MACF;CACA,OACE,UACA,aACA,SACA,iCACA,gCACA,GACF;CACA,OACE,UACA,aACA,SACA,oDACA,2EACA,KACF;CACA,OACE,UACA,aACA,WACA,mDACA,4CACA,KACF;CACA,OACE,UACA,aACA,SACA,kCACA,yEACA,KACF;CACA,OACE,UACA,aACA,WACA,qDACA,+JACA,KACF;CACA,OACE,UACA,aACA,WACA,yBACA,kGACA,KACF;CAGA,OACE,UACA,SACA,SACA,kDACA,kEACA,MACF;CACA,OACE,UACA,SACA,SACA,gDACA,wJACA,MACF;CACA,OACE,UACA,SACA,SACA,gDACA,4DACA,MACF;CACA,OACE,UACA,SACA,SACA,gEACA,8DACA,MACF;CACA,OACE,UACA,SACA,SACA,8CACA,0DACA,MACF;CACA,OACE,UACA,SACA,SACA,oDACA,4DACA,MACF;CACA,OACE,UACA,SACA,SACA,+DACA,yEACA,KACF;CACA,OACE,UACA,SACA,SACA,0CACA,2DACA,GACF;CACA,OACE,UACA,SACA,WACA,iDACA,8FACA,KACF;CACA,OACE,UACA,SACA,SACA,sDACA,oDACA,MACF;CACA,OACE,UACA,SACA,SACA,8DACA,2DACA,MACF;CACA,OACE,UACA,SACA,SACA,sDACA,oEACA,KACF;CACA,OACE,UACA,SACA,SACA,mDACA,iGACA,KACF;CACA,OACE,UACA,SACA,WACA,6DACA,iEACA,KACF;CAGA,OACE,UACA,SACA,WACA,wCACA,oEACA,IACF;CACA,OACE,UACA,SACA,WACA,uCACA,qFACA,IACF;CACA,OACE,UACA,SACA,SACA,gCACA,6FACA,IACF;CACA,OACE,UACA,SACA,SACA,wDACA,sCACA,IACF;CACA,OACE,UACA,SACA,SACA,8CACA,6DACA,KACF;CACA,OACE,UACA,SACA,WACA,uDACA,0DACA,MACF;CAGA,OACE,UACA,SACA,WACA,2BACA,gGACA,MACF;CACA,OACE,UACA,SACA,SACA,kEACA,yEACA,MACF;CACA,OACE,UACA,SACA,SACA,uCACA,+DACA,MACF;CACA,OACE,UACA,SACA,SACA,iDACA,oEACA,MACF;CACA,OACE,UACA,SACA,WACA,gCACA,gDACA,MACF;CACA,OACE,UACA,SACA,SACA,qDACA,uDACA,MACF;CACA,OACE,UACA,SACA,WACA,yDACA,wBACA,MACF;CACA,OACE,UACA,SACA,WACA,kDACA,2CACA,MACF;CACA,OACE,UACA,SACA,WACA,yDACA,iLACA,MACF;CACA,OACE,UACA,SACA,WACA,6DACA,mHACA,MACF;CAGA,OACE,UACA,QACA,SACA,gDACA,oEACA,GACF;CACA,OACE,UACA,QACA,SACA,iDACA,gFACA,GACF;CACA,OACE,UACA,QACA,SACA,6CACA,kFACA,GACF;CACA,OACE,UACA,QACA,SACA,sCACA,qEACA,GACF;CACA,OACE,UACA,QACA,SACA,+CACA,qFACA,GACF;CACA,OACE,UACA,QACA,SACA,qDACA,2EACA,GACF;CACA,OACE,UACA,QACA,WACA,sDACA,uEACA,GACF;CACA,OACE,UACA,QACA,SACA,sDACA,4CACA,GACF;CACA,OACE,UACA,QACA,WACA,uDACA,+CACA,GACF;CAGA,OACE,UACA,aACA,SACA,iEACA,+EACA,MACF;CACA,OACE,UACA,aACA,SACA,mDACA,8EACA,MACF;CACA,OACE,UACA,aACA,SACA,0DACA,oDACA,MACF;CACA,OACE,UACA,aACA,SACA,iEACA,+EACA,MACF;CACA,OACE,UACA,aACA,SACA,gEACA,gDACA,MACF;CACA,OACE,UACA,aACA,WACA,oDACA,sFACA,MACF;CACA,OACE,UACA,aACA,SACA,wDACA,0CACA,KACF;CACA,OACE,UACA,aACA,WACA,2CACA,gDACA,KACF;CAGA,OACE,UACA,SACA,SACA,8CACA,yDACA,KACF;CACA,OACE,UACA,SACA,SACA,2CACA,mDACA,KACF;CACA,OACE,UACA,SACA,SACA,6CACA,8GACA,MACF;CACA,OACE,UACA,SACA,SACA,kEACA,mEACA,MACF;CACA,OACE,UACA,SACA,WACA,iCACA,8CACA,KACF;CAGA,OACE,UACA,QACA,SACA,gDACA,wEACA,GACF;CACA,OACE,UACA,QACA,WACA,8DACA,6FACA,GACF;CACA,OACE,UACA,QACA,WACA,+CACA,iDACA,GACF;CACA,OACE,UACA,QACA,WACA,sCACA,mEACA,GACF;CAGA,OACE,UACA,SACA,SACA,+BACA,wEACA,GACF;CACA,OACE,UACA,SACA,SACA,oBACA,uFACA,GACF;CACA,OACE,UACA,SACA,SACA,0BACA,wCACA,GACF;CACA,OACE,UACA,SACA,SACA,uBACA,+EACA,GACF;CACA,OACE,UACA,SACA,SACA,qCACA,4HACA,MACF;CACA,OACE,UACA,SACA,SACA,uCACA,uFACA,GACF;AACF;;AAMA,MAAa,iBACX,OAAO,YACL,mBAAmB,KAAK,eAAe,CAAC,WAAW,MAAM,UAAU,CAAC,CACtE"}
@@ -29,6 +29,12 @@ export type BookImport = {
29
29
  specifier: string;
30
30
  /** The project file it resolves to, or `null` for a package or an unresolved alias. */
31
31
  file: string | null;
32
+ /**
33
+ * `true` when every import and re-export of the specifier in the file is
34
+ * type-only (`import type`, `export type`, `import { type A }`); erased at
35
+ * runtime. Absent for a value import, and in facts from older adapters.
36
+ */
37
+ typeOnly?: boolean;
32
38
  };
33
39
  /** Facts about one source file. Code files only (`.ts`, `.tsx`, `.js`, …). */
34
40
  export type BookFile = {
@@ -1 +1 @@
1
- {"version":3,"file":"adapter.d.mts","names":[],"sources":["../../../../../../../../packages/grimoire/src/contracts/adapter.ts"],"mappings":";;;;;;;;;;;;;;;;;YAiBY;;YAiCA;;EAEV;;EAEA;;;YAIU;;EAEV;;EAEA;;;YAIU;EACV;;EAEA;EACA,MAAM;EACN;;EAEA;;EAEA,MAAM;EACN,SAAS;EACT,SAAS;;EAET;;EAEA;;;YAIU;;EAEV;;EAEA;EACA;;EAEA;;EAEA;;EAEA;EACA;;EAEA;;EAEA;;EAEA;IAAQ;IAAmB;;;EAE3B;EACA;;;;;;;YAQU;EACV;EACA;;EAEA;;;YAIU;EACV;;EAEA;EACA;;;YAIU;;EAEV;;EAEA;EACA;;EAEA;;EAEA;;EAEA;;EA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;;EAEP;;;;;;;;;;YAWU;;EAEV;;EAEA;;EAEA,YAAY,eAAe;;EAE3B,MAAM,eAAe,QAAQ;;EAE7B,QAAQ,eAAe,QAAQ;;;;;;EAM/B,aAAa,cAAc,gBAAgB,aAAa;;EAExD,OAAO,eAAe,QAAQ;;EAE9B,OAAO,eAAe,QAAQ;;EAE9B,QAAQ,eAAe,QAAQ;;;;;;;EAO/B,OAAO,eAAe,QAAQ;;EAE9B,OAAO,eAAe"}
@@ -37,6 +37,8 @@ export type BookEntry = {
37
37
  packages: string[];
38
38
  /** Project files it imports. */
39
39
  imports: string[];
40
+ /** The part of `imports` that is type-only (erased at runtime), sorted. */
41
+ typeOnlyImports: string[];
40
42
  /** Project files that import it. */
41
43
  importedBy: string[];
42
44
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"book.d.mts","names":[],"sources":["../../../../../../../../packages/grimoire/src/contracts/book.ts"],"mappings":";;;;qBAoBa;;YAGD;EACV;EACA;EACA;;;;;;;YAQU;EACV,sBAAsB;;EAEtB;EACA;EACA,MAAM;EACN;;EAEA;;EAEA;;EAEA;;EAEA;EACA;IAAW;IAAc;;;EAEzB;;EAEA;;EAEA;;;;;;EAMA,SAAS;IAAiB;;;EAE1B;IAAS;IAAc;IAAe;;;EAEtC;IAAW;IAAa;IAAe;;;;YAI7B;EACV,sBAAsB;;EAEtB,SAAS,gBAAgB;IAAiB;;;;YAIhC;EACV,sBAAsB;EACtB,MAAM;EACN,OAAO;;;YAIG;EACV,sBAAsB;EACtB,KAAK,KAAK;EACV,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;YA2BC;EACV;;EAEA;EACA;IAAS;IAAc,MAAM;IAAc;IAAe;;EAC1D,QAAQ;;EAER;IAAU;IAAgB;;;;YAIhB;;EAEV;;EAEA;EACA;;EAEA;;;;;;;;YASU;EACV,sBAAsB;;EAEtB;EACA;IAAW;IAAc;;;EAEzB;EACA;;EAEA,OAAO,eAAe;;EAEtB,OAAO;;EAEP;;;;;;EAMA;;IAEE;IACA,QAAQ;;;;;;;;YASA;EACV,sBAAsB;EACtB,OAAO;;;YAIG;;EAEV;EACA,UAAU;EACV,OAAO;EACP,QAAQ;;;YAIE;;;;;;;EAOV;;EAEA;;EAEA,YAAY;;EAEZ;;;YAIU;EACV,MAAM;;EAEN;;EAEA;;;;;;;YAQU;;EAEV;;EAEA,OAAO;EACP,OAAO;IAAiB;IAAwB;IAAsB;;;;YAI5D;;EAEV;;EAEA"}
1
+ {"version":3,"file":"book.d.mts","names":[],"sources":["../../../../../../../../packages/grimoire/src/contracts/book.ts"],"mappings":";;;;qBAoBa;;YAGD;EACV;EACA;EACA;;;;;;;YAQU;EACV,sBAAsB;;EAEtB;EACA;EACA,MAAM;EACN;;EAEA;;EAEA;;EAEA;;EAEA;EACA;IAAW;IAAc;;;EAEzB;;EAEA;;EAEA;;EAEA;;;;;;EAMA,SAAS;IAAiB;;;EAE1B;IAAS;IAAc;IAAe;;;EAEtC;IAAW;IAAa;IAAe;;;;YAI7B;EACV,sBAAsB;;EAEtB,SAAS,gBAAgB;IAAiB;;;;YAIhC;EACV,sBAAsB;EACtB,MAAM;EACN,OAAO;;;YAIG;EACV,sBAAsB;EACtB,KAAK,KAAK;EACV,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;YA2BC;EACV;;EAEA;EACA;IAAS;IAAc,MAAM;IAAc;IAAe;;EAC1D,QAAQ;;EAER;IAAU;IAAgB;;;;YAIhB;;EAEV;;EAEA;EACA;;EAEA;;;;;;;;YASU;EACV,sBAAsB;;EAEtB;EACA;IAAW;IAAc;;;EAEzB;EACA;;EAEA,OAAO,eAAe;;EAEtB,OAAO;;EAEP;;;;;;EAMA;;IAEE;IACA,QAAQ;;;;;;;;YASA;EACV,sBAAsB;EACtB,OAAO;;;YAIG;;EAEV;EACA,UAAU;EACV,OAAO;EACP,QAAQ;;;YAIE;;;;;;;EAOV;;EAEA;;EAEA,YAAY;;EAEZ;;;YAIU;EACV,MAAM;;EAEN;;EAEA;;;;;;;YAQU;;EAEV;;EAEA,OAAO;EACP,OAAO;IAAiB;IAAwB;IAAsB;;;;YAI5D;;EAEV;;EAEA"}
@@ -1 +1 @@
1
- {"version":3,"file":"book.mjs","names":[],"sources":["../../../../../../../../packages/grimoire/src/contracts/book.ts"],"sourcesContent":["/**\n * The generated book under `grimoire/book/`. Warlock writes every file here;\n * the folder is ignored by git and rebuilt when sources or written files\n * change. Paths of the files are decided by `bookEntryPath()` and the\n * constants in `src/paths`.\n *\n * JSON files carry no timestamps except `manifest.json`, so an unchanged\n * project rewrites nothing and golden files stay stable.\n */\nimport type {\n BookFacts,\n BookFileType,\n BookMobileApp,\n BookPage,\n BookScreen,\n BookSite,\n} from \"./adapter\";\nimport type { RouteFreshness } from \"./findings\";\n\n/** The version of every book and collected JSON shape. Bumped only for a breaking change. */\nexport const BOOK_SCHEMA_VERSION = 1;\n\n/** A route as a book entry or list shows it. */\nexport type BookRouteRef = {\n method: string;\n path: string;\n name: string | null;\n};\n\n/**\n * `grimoire/book/<mirror path>.json`: one per code file.\n * `src/app/auth/controllers/login.controller.ts` →\n * `grimoire/book/app/auth/controllers/login.controller.json`.\n */\nexport type BookEntry = {\n schemaVersion: typeof BOOK_SCHEMA_VERSION;\n /** The source file. */\n file: string;\n module: string;\n type: BookFileType;\n lines: number;\n /** The header sentence, or `null`. */\n about: string | null;\n /** The feature that owns the file, or `null`. */\n feature: string | null;\n /** Features that import the file without owning it. */\n borrowedBy: string[];\n /** `<feature>/<flow>` of every flow whose steps reach the file. */\n flows: string[];\n exports: { name: string; about: string | null }[];\n /** External packages it imports (`@warlock.js/core`, `dayjs`), by package name. */\n packages: string[];\n /** Project files it imports. */\n imports: string[];\n /** Project files that import it. */\n importedBy: string[];\n /**\n * Routes this file registers (`via: \"registers\"`, a routes file) or handles\n * (`via: \"handles\"`, the handler's file). Routes that only reach the file\n * through imports are answered by `scry --impact`, not stored here.\n */\n routes: (BookRouteRef & { via: \"registers\" | \"handles\" })[];\n /** Pages this file is the page, setup or layout file of: `<site> <route>`. */\n pages: { site: string; route: string; via: \"page\" | \"setup\" | \"layout\" }[];\n /** Mobile screens this file is the screen or layout file of. */\n screens: { app: string; route: string; via: \"screen\" | \"layout\" }[];\n};\n\n/** `grimoire/book/app/routes.json`: every route, grouped by the module of its routes file. */\nexport type BookRoutesFile = {\n schemaVersion: typeof BOOK_SCHEMA_VERSION;\n /** Module (`src/app/catalog`) → routes, in registration order. `(none)` holds routes with no source file. */\n modules: Record<string, (BookRouteRef & { handlerFile: string | null })[]>;\n};\n\n/** `grimoire/book/web/<site>.pages.json`: the pages of one site. */\nexport type BookSitePagesFile = {\n schemaVersion: typeof BOOK_SCHEMA_VERSION;\n site: BookSite;\n pages: BookPage[];\n};\n\n/** `grimoire/book/mobile/<app>.screens.json`: one mobile app and its screens. */\nexport type BookMobileScreensFile = {\n schemaVersion: typeof BOOK_SCHEMA_VERSION;\n app: Omit<BookMobileApp, \"screens\">;\n screens: BookScreen[];\n};\n\n/**\n * The data behind `grimoire/book/<module>/index.md`, the module summary.\n *\n * The Markdown is:\n *\n * ```md\n * # src/app/catalog\n *\n * Feature: catalog. 14 files, 820 lines.\n *\n * ## Files\n * - controllers/new-arrivals.controller.ts controller Answers the new arrivals request.\n *\n * ## Routes\n * - GET /products/new-arrivals\n *\n * ## Used by\n * - src/app/orders (3 files)\n * ```\n *\n * Sections with nothing in them are left out. Files are listed by path\n * relative to the module, in path order; the header sentence is omitted when\n * the file has none.\n */\nexport type BookModuleSummary = {\n module: string;\n /** Owning features of the module's files, most files first. */\n features: string[];\n files: { file: string; type: BookFileType; lines: number; about: string | null }[];\n routes: BookRouteRef[];\n /** Other modules importing files of this one, with how many of their files do. */\n usedBy: { module: string; files: number }[];\n};\n\n/** One source file as the manifest remembers it. */\nexport type BookManifestFile = {\n /** sha256 of the content (hex). */\n hash: string;\n /** Size and modification time, to skip hashing unchanged files. */\n size: number;\n mtimeMs: number;\n /** The book entry path (`grimoire/book/...json`), or `null` for a file with no entry. */\n entry: string | null;\n};\n\n/**\n * `grimoire/book/manifest.json`: the fingerprint that says whether the book is\n * fresh. The book is fresh when the grimoire version, adapter name and version\n * and `schemaVersion` match, the set of files under the source roots is the\n * same, every file's hash matches, and the written-files hash matches.\n */\nexport type BookManifest = {\n schemaVersion: typeof BOOK_SCHEMA_VERSION;\n /** `@warlock.js/grimoire` version that wrote the book. */\n grimoireVersion: string;\n adapter: { name: string; version: string };\n /** ISO time of the last build that changed anything. */\n builtAt: string;\n sourceRoots: string[];\n /** Every file under the source roots (code or not), by project-relative path. */\n files: Record<string, BookManifestFile>;\n /** Test files scanned for `@proves`, with their hashes. */\n tests: Record<string, string>;\n /** `WrittenGrimoire.hash` the ownership and book maps were built from. */\n writtenHash: string;\n /**\n * The cache of facts that need the app booted (routes, named things). It is\n * stale when any input's hash differs from the one stored here, or an input\n * was added or removed.\n */\n boot: {\n /** ISO time the routes were read, or `null` when never. */\n collectedAt: string | null;\n inputs: Record<string, string>;\n };\n};\n\n/**\n * `grimoire/book/.cache/facts.json`: the adapter's last answer, so a file-only\n * question never calls the adapter's `routes()` and loading the book reads one\n * file. Machine use only.\n */\nexport type BookFactsCache = {\n schemaVersion: typeof BOOK_SCHEMA_VERSION;\n facts: BookFacts;\n};\n\n/** The book as `loadBook()` returns it. */\nexport type LoadedBook = {\n /** Absolute project root. */\n root: string;\n manifest: BookManifest;\n facts: BookFacts;\n routes: RouteFreshness;\n};\n\n/** Options of `buildBook()`. */\nexport type BuildBookOptions = {\n /**\n * `fresh`: refresh stale route facts (may boot the app through the adapter).\n * `cached`: never boot; reuse cached route facts, reported `stale` when their\n * inputs changed and `missing` when there are none.\n * Default `cached`. `warlock grimoire build` and `check` pass `fresh`.\n */\n routes?: \"fresh\" | \"cached\";\n /** Rebuild every entry even when the manifest says the book is fresh. */\n force?: boolean;\n /** Clock for `builtAt`. */\n now?: () => Date;\n /** `false` computes the book in memory only and writes nothing. Default `true`. */\n write?: boolean;\n};\n\n/** What `buildBook()` did. */\nexport type BuildBookResult = {\n book: LoadedBook;\n /** `false` when the manifest matched: the adapter was not called and nothing was written. */\n rebuilt: boolean;\n /** Source files added, changed or removed since the previous manifest. */\n changed: string[];\n};\n\n/**\n * What the book entries need from the written files: owner, borrowers and\n * flows per source file. `openGrimoire()` computes it (ownership and book\n * maps) and hands it to `writeBook()`.\n */\nexport type BookAnnotations = {\n /** `WrittenGrimoire.hash` it was computed from; stored in the manifest. */\n writtenHash: string;\n /** Test file → sha256, stored in the manifest. */\n tests: Record<string, string>;\n files: Record<string, { feature: string | null; borrowedBy: string[]; flows: string[] }>;\n};\n\n/** What `writeBook()` wrote. Unchanged files are not rewritten. */\nexport type WriteBookResult = {\n /** Book files created or changed (entries, summaries, lists), project-relative. */\n written: string[];\n /** Book files removed because their source is gone. */\n removed: string[];\n};\n"],"mappings":";;AAoBA,MAAa,sBAAsB"}
1
+ {"version":3,"file":"book.mjs","names":[],"sources":["../../../../../../../../packages/grimoire/src/contracts/book.ts"],"sourcesContent":["/**\n * The generated book under `grimoire/book/`. Warlock writes every file here;\n * the folder is ignored by git and rebuilt when sources or written files\n * change. Paths of the files are decided by `bookEntryPath()` and the\n * constants in `src/paths`.\n *\n * JSON files carry no timestamps except `manifest.json`, so an unchanged\n * project rewrites nothing and golden files stay stable.\n */\nimport type {\n BookFacts,\n BookFileType,\n BookMobileApp,\n BookPage,\n BookScreen,\n BookSite,\n} from \"./adapter\";\nimport type { RouteFreshness } from \"./findings\";\n\n/** The version of every book and collected JSON shape. Bumped only for a breaking change. */\nexport const BOOK_SCHEMA_VERSION = 1;\n\n/** A route as a book entry or list shows it. */\nexport type BookRouteRef = {\n method: string;\n path: string;\n name: string | null;\n};\n\n/**\n * `grimoire/book/<mirror path>.json`: one per code file.\n * `src/app/auth/controllers/login.controller.ts` →\n * `grimoire/book/app/auth/controllers/login.controller.json`.\n */\nexport type BookEntry = {\n schemaVersion: typeof BOOK_SCHEMA_VERSION;\n /** The source file. */\n file: string;\n module: string;\n type: BookFileType;\n lines: number;\n /** The header sentence, or `null`. */\n about: string | null;\n /** The feature that owns the file, or `null`. */\n feature: string | null;\n /** Features that import the file without owning it. */\n borrowedBy: string[];\n /** `<feature>/<flow>` of every flow whose steps reach the file. */\n flows: string[];\n exports: { name: string; about: string | null }[];\n /** External packages it imports (`@warlock.js/core`, `dayjs`), by package name. */\n packages: string[];\n /** Project files it imports. */\n imports: string[];\n /** The part of `imports` that is type-only (erased at runtime), sorted. */\n typeOnlyImports: string[];\n /** Project files that import it. */\n importedBy: string[];\n /**\n * Routes this file registers (`via: \"registers\"`, a routes file) or handles\n * (`via: \"handles\"`, the handler's file). Routes that only reach the file\n * through imports are answered by `scry --impact`, not stored here.\n */\n routes: (BookRouteRef & { via: \"registers\" | \"handles\" })[];\n /** Pages this file is the page, setup or layout file of: `<site> <route>`. */\n pages: { site: string; route: string; via: \"page\" | \"setup\" | \"layout\" }[];\n /** Mobile screens this file is the screen or layout file of. */\n screens: { app: string; route: string; via: \"screen\" | \"layout\" }[];\n};\n\n/** `grimoire/book/app/routes.json`: every route, grouped by the module of its routes file. */\nexport type BookRoutesFile = {\n schemaVersion: typeof BOOK_SCHEMA_VERSION;\n /** Module (`src/app/catalog`) → routes, in registration order. `(none)` holds routes with no source file. */\n modules: Record<string, (BookRouteRef & { handlerFile: string | null })[]>;\n};\n\n/** `grimoire/book/web/<site>.pages.json`: the pages of one site. */\nexport type BookSitePagesFile = {\n schemaVersion: typeof BOOK_SCHEMA_VERSION;\n site: BookSite;\n pages: BookPage[];\n};\n\n/** `grimoire/book/mobile/<app>.screens.json`: one mobile app and its screens. */\nexport type BookMobileScreensFile = {\n schemaVersion: typeof BOOK_SCHEMA_VERSION;\n app: Omit<BookMobileApp, \"screens\">;\n screens: BookScreen[];\n};\n\n/**\n * The data behind `grimoire/book/<module>/index.md`, the module summary.\n *\n * The Markdown is:\n *\n * ```md\n * # src/app/catalog\n *\n * Feature: catalog. 14 files, 820 lines.\n *\n * ## Files\n * - controllers/new-arrivals.controller.ts controller Answers the new arrivals request.\n *\n * ## Routes\n * - GET /products/new-arrivals\n *\n * ## Used by\n * - src/app/orders (3 files)\n * ```\n *\n * Sections with nothing in them are left out. Files are listed by path\n * relative to the module, in path order; the header sentence is omitted when\n * the file has none.\n */\nexport type BookModuleSummary = {\n module: string;\n /** Owning features of the module's files, most files first. */\n features: string[];\n files: { file: string; type: BookFileType; lines: number; about: string | null }[];\n routes: BookRouteRef[];\n /** Other modules importing files of this one, with how many of their files do. */\n usedBy: { module: string; files: number }[];\n};\n\n/** One source file as the manifest remembers it. */\nexport type BookManifestFile = {\n /** sha256 of the content (hex). */\n hash: string;\n /** Size and modification time, to skip hashing unchanged files. */\n size: number;\n mtimeMs: number;\n /** The book entry path (`grimoire/book/...json`), or `null` for a file with no entry. */\n entry: string | null;\n};\n\n/**\n * `grimoire/book/manifest.json`: the fingerprint that says whether the book is\n * fresh. The book is fresh when the grimoire version, adapter name and version\n * and `schemaVersion` match, the set of files under the source roots is the\n * same, every file's hash matches, and the written-files hash matches.\n */\nexport type BookManifest = {\n schemaVersion: typeof BOOK_SCHEMA_VERSION;\n /** `@warlock.js/grimoire` version that wrote the book. */\n grimoireVersion: string;\n adapter: { name: string; version: string };\n /** ISO time of the last build that changed anything. */\n builtAt: string;\n sourceRoots: string[];\n /** Every file under the source roots (code or not), by project-relative path. */\n files: Record<string, BookManifestFile>;\n /** Test files scanned for `@proves`, with their hashes. */\n tests: Record<string, string>;\n /** `WrittenGrimoire.hash` the ownership and book maps were built from. */\n writtenHash: string;\n /**\n * The cache of facts that need the app booted (routes, named things). It is\n * stale when any input's hash differs from the one stored here, or an input\n * was added or removed.\n */\n boot: {\n /** ISO time the routes were read, or `null` when never. */\n collectedAt: string | null;\n inputs: Record<string, string>;\n };\n};\n\n/**\n * `grimoire/book/.cache/facts.json`: the adapter's last answer, so a file-only\n * question never calls the adapter's `routes()` and loading the book reads one\n * file. Machine use only.\n */\nexport type BookFactsCache = {\n schemaVersion: typeof BOOK_SCHEMA_VERSION;\n facts: BookFacts;\n};\n\n/** The book as `loadBook()` returns it. */\nexport type LoadedBook = {\n /** Absolute project root. */\n root: string;\n manifest: BookManifest;\n facts: BookFacts;\n routes: RouteFreshness;\n};\n\n/** Options of `buildBook()`. */\nexport type BuildBookOptions = {\n /**\n * `fresh`: refresh stale route facts (may boot the app through the adapter).\n * `cached`: never boot; reuse cached route facts, reported `stale` when their\n * inputs changed and `missing` when there are none.\n * Default `cached`. `warlock grimoire build` and `check` pass `fresh`.\n */\n routes?: \"fresh\" | \"cached\";\n /** Rebuild every entry even when the manifest says the book is fresh. */\n force?: boolean;\n /** Clock for `builtAt`. */\n now?: () => Date;\n /** `false` computes the book in memory only and writes nothing. Default `true`. */\n write?: boolean;\n};\n\n/** What `buildBook()` did. */\nexport type BuildBookResult = {\n book: LoadedBook;\n /** `false` when the manifest matched: the adapter was not called and nothing was written. */\n rebuilt: boolean;\n /** Source files added, changed or removed since the previous manifest. */\n changed: string[];\n};\n\n/**\n * What the book entries need from the written files: owner, borrowers and\n * flows per source file. `openGrimoire()` computes it (ownership and book\n * maps) and hands it to `writeBook()`.\n */\nexport type BookAnnotations = {\n /** `WrittenGrimoire.hash` it was computed from; stored in the manifest. */\n writtenHash: string;\n /** Test file → sha256, stored in the manifest. */\n tests: Record<string, string>;\n files: Record<string, { feature: string | null; borrowedBy: string[]; flows: string[] }>;\n};\n\n/** What `writeBook()` wrote. Unchanged files are not rewritten. */\nexport type WriteBookResult = {\n /** Book files created or changed (entries, summaries, lists), project-relative. */\n written: string[];\n /** Book files removed because their source is gone. */\n removed: string[];\n};\n"],"mappings":";;AAoBA,MAAa,sBAAsB"}
@@ -74,8 +74,26 @@ export type FlowBookmapStep = {
74
74
  found: boolean | null;
75
75
  /** The file the step starts from (handler, page, mail file…), or `null`. */
76
76
  entry: string | null;
77
- /** The entry file and every project file it imports, transitively, sorted. */
77
+ /**
78
+ * Every file the step starts from, sorted: a page and its setup file, each
79
+ * matching route's handler file and routes file, each named file. Empty
80
+ * when nothing matched.
81
+ */
82
+ entries: string[];
83
+ /** Project files the entries import directly (any import, type-only included), minus the entries, sorted. */
84
+ direct: string[];
85
+ /**
86
+ * The entries and every project file they reach through imports that run
87
+ * (type-only imports are not followed), sorted.
88
+ */
78
89
  files: string[];
90
+ /**
91
+ * Files reached only through type-only imports (not in `files`), sorted.
92
+ * `files` plus these is the step's full reach: ownership coverage
93
+ * (`unreached`, `GR3006`), the book entries' `flows` and `scry --impact`
94
+ * count both.
95
+ */
96
+ typeOnlyFiles: string[];
79
97
  };
80
98
  /** One acceptance criterion with its tests and their last results. */
81
99
  export type FlowBookmapCriterion = {
@@ -1 +1 @@
1
- {"version":3,"file":"bookmap.d.mts","names":[],"sources":["../../../../../../../../packages/grimoire/src/contracts/bookmap.ts"],"mappings":";;;;;;;;;;;;;;YA8BY;EACV;EACA;;EAEA;;EAEA;;EAEA;IAAa;IAAiB;;;EAE9B;;;YAIU;EACV,OAAO,eAAe;;EAEtB,UAAU;IAAiB;IAAe;;;;YAMhC;EACV,sBAAsB;EACtB;;EAEA;;EAEA;IAAY;IAAc;IAAsB;;;EAEhD,SAAS;IAAiB;;;EAE1B,OAAO;IAAiB;IAAe;IAAc;;;EAErD;;;YAIU;EACV;EACA,MAAM;EACN;;;;;;EAMA;;EAEA;;EAEA;;;YAIU;EACV,IAAI;EACJ;EACA;EACA;IACE;IACA;IACA;;IAEA,QAAQ;IACR;;EAEF,QAAQ;;;YAIE;EACV,sBAAsB;EACtB;EACA;EACA,KAAK;EACL,OAAO;EACP,UAAU;;EAEV;IACE;IACA;;IAEA;IACA;;IAEA;;;;YAOQ;EACV,sBAAsB;EACtB;IACE;IACA;IACA,QAAQ;IACR,SAAS;;IAET;IACA;IACA,QAAQ;IACR;MAAS;MAAY,QAAQ;MAAe,OAAO;;;IAEnD;MAAY,SAAS;MAAgB;MAAiB;;;;;YAK9C;EACV;EACA;EACA,MAAM;EACN,QAAQ;EACR;EACA;EACA;EACA;EACA;IAAW;IAAiB,SAAS;;EACrC;;;;;;;YAQU;EACV,sBAAsB;EACtB,MAAM;EACN,SAAS;EACT,MAAM;;;YAII;EACV,UAAU,eAAe;;EAEzB,OAAO,eAAe;EACtB,eAAe;EACf,YAAY"}
1
+ {"version":3,"file":"bookmap.d.mts","names":[],"sources":["../../../../../../../../packages/grimoire/src/contracts/bookmap.ts"],"mappings":";;;;;;;;;;;;;;YA8BY;EACV;EACA;;EAEA;;EAEA;;EAEA;IAAa;IAAiB;;;EAE9B;;;YAIU;EACV,OAAO,eAAe;;EAEtB,UAAU;IAAiB;IAAe;;;;YAMhC;EACV,sBAAsB;EACtB;;EAEA;;EAEA;IAAY;IAAc;IAAsB;;;EAEhD,SAAS;IAAiB;;;EAE1B,OAAO;IAAiB;IAAe;IAAc;;;EAErD;;;YAIU;EACV;EACA,MAAM;EACN;;;;;;EAMA;;EAEA;;;;;;EAMA;;EAEA;;;;;EAKA;;;;;;;EAOA;;;YAIU;EACV,IAAI;EACJ;EACA;EACA;IACE;IACA;IACA;;IAEA,QAAQ;IACR;;EAEF,QAAQ;;;YAIE;EACV,sBAAsB;EACtB;EACA;EACA,KAAK;EACL,OAAO;EACP,UAAU;;EAEV;IACE;IACA;;IAEA;IACA;;IAEA;;;;YAOQ;EACV,sBAAsB;EACtB;IACE;IACA;IACA,QAAQ;IACR,SAAS;;IAET;IACA;IACA,QAAQ;IACR;MAAS;MAAY,QAAQ;MAAe,OAAO;;;IAEnD;MAAY,SAAS;MAAgB;MAAiB;;;;;YAK9C;EACV;EACA;EACA,MAAM;EACN,QAAQ;EACR;EACA;EACA;EACA;EACA;IAAW;IAAiB,SAAS;;EACrC;;;;;;;YAQU;EACV,sBAAsB;EACtB,MAAM;EACN,SAAS;EACT,MAAM;;;YAII;EACV,UAAU,eAAe;;EAEzB,OAAO,eAAe;EACtB,eAAe;EACf,YAAY"}