@warlock.js/grimoire 5.63.0 → 5.64.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 (194) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/esm/book/build.d.mts.map +1 -1
  3. package/esm/book/build.mjs +24 -2
  4. package/esm/book/build.mjs.map +1 -1
  5. package/esm/check/check-grimoire.d.mts.map +1 -1
  6. package/esm/check/check-grimoire.mjs +11 -1
  7. package/esm/check/check-grimoire.mjs.map +1 -1
  8. package/esm/check/rules/api-snapshot.mjs +39 -0
  9. package/esm/check/rules/api-snapshot.mjs.map +1 -0
  10. package/esm/check/rules/code-rules.mjs +45 -0
  11. package/esm/check/rules/code-rules.mjs.map +1 -0
  12. package/esm/check/rules/drift.mjs +54 -0
  13. package/esm/check/rules/drift.mjs.map +1 -0
  14. package/esm/check/rules/focused-tests.mjs +39 -0
  15. package/esm/check/rules/focused-tests.mjs.map +1 -0
  16. package/esm/check/rules/shows.mjs +52 -0
  17. package/esm/check/rules/shows.mjs.map +1 -0
  18. package/esm/codes/codes.d.mts +48 -0
  19. package/esm/codes/codes.d.mts.map +1 -1
  20. package/esm/codes/codes.mjs +26 -1
  21. package/esm/codes/codes.mjs.map +1 -1
  22. package/esm/contracts/adapter.d.mts +6 -0
  23. package/esm/contracts/adapter.d.mts.map +1 -1
  24. package/esm/contracts/guard.d.mts +104 -0
  25. package/esm/contracts/guard.d.mts.map +1 -0
  26. package/esm/contracts/index.mjs +5 -0
  27. package/esm/contracts/matrix.d.mts +75 -0
  28. package/esm/contracts/matrix.d.mts.map +1 -0
  29. package/esm/contracts/scry.d.mts +21 -0
  30. package/esm/contracts/scry.d.mts.map +1 -1
  31. package/esm/contracts/settings.d.mts +71 -0
  32. package/esm/contracts/settings.d.mts.map +1 -0
  33. package/esm/contracts/settings.mjs +67 -0
  34. package/esm/contracts/settings.mjs.map +1 -0
  35. package/esm/contracts/shots.d.mts +146 -0
  36. package/esm/contracts/shots.d.mts.map +1 -0
  37. package/esm/contracts/snapshot.d.mts +10 -0
  38. package/esm/contracts/snapshot.d.mts.map +1 -1
  39. package/esm/contracts/written.d.mts +13 -0
  40. package/esm/contracts/written.d.mts.map +1 -1
  41. package/esm/contracts/written.mjs +7 -1
  42. package/esm/contracts/written.mjs.map +1 -1
  43. package/esm/devtools/approvals.mjs +59 -0
  44. package/esm/devtools/approvals.mjs.map +1 -0
  45. package/esm/devtools/data.mjs +2 -0
  46. package/esm/devtools/data.mjs.map +1 -1
  47. package/esm/devtools/graphs.mjs +13 -3
  48. package/esm/devtools/graphs.mjs.map +1 -1
  49. package/esm/devtools/index.d.mts.map +1 -1
  50. package/esm/devtools/index.mjs +32 -2
  51. package/esm/devtools/index.mjs.map +1 -1
  52. package/esm/devtools/matrix.mjs +207 -0
  53. package/esm/devtools/matrix.mjs.map +1 -0
  54. package/esm/devtools/product-map.d.mts.map +1 -1
  55. package/esm/devtools/product-map.mjs +87 -1
  56. package/esm/devtools/product-map.mjs.map +1 -1
  57. package/esm/devtools/site.d.mts.map +1 -1
  58. package/esm/devtools/site.mjs +12 -3
  59. package/esm/devtools/site.mjs.map +1 -1
  60. package/esm/devtools/snapshot-source.mjs +5 -1
  61. package/esm/devtools/snapshot-source.mjs.map +1 -1
  62. package/esm/git/index.d.mts +20 -0
  63. package/esm/git/index.d.mts.map +1 -0
  64. package/esm/git/index.mjs +280 -0
  65. package/esm/git/index.mjs.map +1 -0
  66. package/esm/guard/api.mjs +70 -0
  67. package/esm/guard/api.mjs.map +1 -0
  68. package/esm/guard/assertions.mjs +18 -0
  69. package/esm/guard/assertions.mjs.map +1 -0
  70. package/esm/guard/collect.mjs +139 -0
  71. package/esm/guard/collect.mjs.map +1 -0
  72. package/esm/guard/format.mjs +27 -0
  73. package/esm/guard/format.mjs.map +1 -0
  74. package/esm/guard/glob.mjs +79 -0
  75. package/esm/guard/glob.mjs.map +1 -0
  76. package/esm/guard/index.mjs +9 -0
  77. package/esm/guard/rules.mjs +310 -0
  78. package/esm/guard/rules.mjs.map +1 -0
  79. package/esm/guard/scope.mjs +95 -0
  80. package/esm/guard/scope.mjs.map +1 -0
  81. package/esm/index.d.mts +10 -3
  82. package/esm/index.mjs +6 -2
  83. package/esm/paths/index.d.mts +15 -1
  84. package/esm/paths/index.d.mts.map +1 -1
  85. package/esm/paths/index.mjs +27 -3
  86. package/esm/paths/index.mjs.map +1 -1
  87. package/esm/proves/index.mjs +2 -1
  88. package/esm/proves/scan-proofs.mjs +1 -1
  89. package/esm/proves/scan-proofs.mjs.map +1 -1
  90. package/esm/proves/scan-shows.d.mts +21 -0
  91. package/esm/proves/scan-shows.d.mts.map +1 -0
  92. package/esm/proves/scan-shows.mjs +168 -0
  93. package/esm/proves/scan-shows.mjs.map +1 -0
  94. package/esm/releases/index.d.mts.map +1 -1
  95. package/esm/releases/index.mjs +5 -3
  96. package/esm/releases/index.mjs.map +1 -1
  97. package/esm/releases/stamp.mjs +121 -0
  98. package/esm/releases/stamp.mjs.map +1 -0
  99. package/esm/rules/focused.mjs +26 -0
  100. package/esm/rules/focused.mjs.map +1 -0
  101. package/esm/rules/index.mjs +88 -0
  102. package/esm/rules/index.mjs.map +1 -0
  103. package/esm/rules/logical-css.mjs +112 -0
  104. package/esm/rules/logical-css.mjs.map +1 -0
  105. package/esm/rules/no-js-imports.mjs +22 -0
  106. package/esm/rules/no-js-imports.mjs.map +1 -0
  107. package/esm/rules/scan.mjs +196 -0
  108. package/esm/rules/scan.mjs.map +1 -0
  109. package/esm/rules/specific-errors.mjs +51 -0
  110. package/esm/rules/specific-errors.mjs.map +1 -0
  111. package/esm/rules/type-discriminator.mjs +27 -0
  112. package/esm/rules/type-discriminator.mjs.map +1 -0
  113. package/esm/scry/also-changes.mjs +106 -0
  114. package/esm/scry/also-changes.mjs.map +1 -0
  115. package/esm/scry/format.d.mts.map +1 -1
  116. package/esm/scry/format.mjs +22 -0
  117. package/esm/scry/format.mjs.map +1 -1
  118. package/esm/scry/query.d.mts.map +1 -1
  119. package/esm/scry/query.mjs +7 -2
  120. package/esm/scry/query.mjs.map +1 -1
  121. package/esm/scry/search.d.mts.map +1 -1
  122. package/esm/scry/search.mjs +43 -11
  123. package/esm/scry/search.mjs.map +1 -1
  124. package/esm/shots/approve.mjs +195 -0
  125. package/esm/shots/approve.mjs.map +1 -0
  126. package/esm/shots/drift.mjs +174 -0
  127. package/esm/shots/drift.mjs.map +1 -0
  128. package/esm/shots/png.mjs +166 -0
  129. package/esm/shots/png.mjs.map +1 -0
  130. package/esm/shots/state.mjs +43 -0
  131. package/esm/shots/state.mjs.map +1 -0
  132. package/esm/shots/store.mjs +66 -0
  133. package/esm/shots/store.mjs.map +1 -0
  134. package/esm/shots/touched.mjs +38 -0
  135. package/esm/shots/touched.mjs.map +1 -0
  136. package/esm/warlock/adapter.d.mts.map +1 -1
  137. package/esm/warlock/adapter.mjs +15 -2
  138. package/esm/warlock/adapter.mjs.map +1 -1
  139. package/esm/warlock/api-command.mjs +41 -0
  140. package/esm/warlock/api-command.mjs.map +1 -0
  141. package/esm/warlock/approve-command.mjs +80 -0
  142. package/esm/warlock/approve-command.mjs.map +1 -0
  143. package/esm/warlock/commands.d.mts +1 -1
  144. package/esm/warlock/commands.d.mts.map +1 -1
  145. package/esm/warlock/commands.mjs +61 -8
  146. package/esm/warlock/commands.mjs.map +1 -1
  147. package/esm/warlock/guard-command.mjs +116 -0
  148. package/esm/warlock/guard-command.mjs.map +1 -0
  149. package/esm/warlock/index.d.mts +2 -1
  150. package/esm/warlock/index.mjs +2 -1
  151. package/esm/warlock/languages.mjs +75 -0
  152. package/esm/warlock/languages.mjs.map +1 -0
  153. package/esm/warlock/mcp-tools.mjs +2 -2
  154. package/esm/warlock/mcp-tools.mjs.map +1 -1
  155. package/esm/warlock/release-command.mjs +65 -0
  156. package/esm/warlock/release-command.mjs.map +1 -0
  157. package/esm/warlock/shows.d.mts +35 -0
  158. package/esm/warlock/shows.d.mts.map +1 -0
  159. package/esm/warlock/shows.mjs +195 -0
  160. package/esm/warlock/shows.mjs.map +1 -0
  161. package/esm/workspace/cache.mjs +4 -1
  162. package/esm/workspace/cache.mjs.map +1 -1
  163. package/esm/workspace/derived.mjs +11 -6
  164. package/esm/workspace/derived.mjs.map +1 -1
  165. package/esm/workspace/index.d.mts.map +1 -1
  166. package/esm/workspace/index.mjs +8 -1
  167. package/esm/workspace/index.mjs.map +1 -1
  168. package/esm/workspace/stored.mjs +4 -1
  169. package/esm/workspace/stored.mjs.map +1 -1
  170. package/esm/written/features.mjs +21 -5
  171. package/esm/written/features.mjs.map +1 -1
  172. package/esm/written/index.mjs +2 -1
  173. package/esm/written/parse-grimoire.d.mts.map +1 -1
  174. package/esm/written/parse-grimoire.mjs +16 -3
  175. package/esm/written/parse-grimoire.mjs.map +1 -1
  176. package/esm/written/settings.d.mts +11 -0
  177. package/esm/written/settings.d.mts.map +1 -0
  178. package/esm/written/settings.mjs +88 -0
  179. package/esm/written/settings.mjs.map +1 -0
  180. package/llms-full.txt +276 -39
  181. package/llms.txt +2 -0
  182. package/package.json +3 -3
  183. package/skills/backfill-a-grimoire/SKILL.md +4 -0
  184. package/skills/describe-an-app/SKILL.md +4 -1
  185. package/skills/guard-a-change/SKILL.md +85 -0
  186. package/skills/index.md +7 -3
  187. package/skills/record-a-change/SKILL.md +52 -16
  188. package/skills/review-a-change/SKILL.md +53 -0
  189. package/skills/use-the-grimoire/SKILL.md +21 -18
  190. package/skills/write-a-feature/SKILL.md +42 -1
  191. package/ui/grimoire-view.js +756 -40
  192. package/ui/grimoire.css +303 -28
  193. package/ui/product-map.css +43 -7
  194. package/ui/product-map.js +212 -37
@@ -101,6 +101,14 @@ export declare const GRIMOIRE_CODE_LIST: readonly [GrimoireCodeDefinition & {
101
101
  readonly code: "GR3005";
102
102
  }, GrimoireCodeDefinition & {
103
103
  readonly code: "GR3006";
104
+ }, GrimoireCodeDefinition & {
105
+ readonly code: "GR3007";
106
+ }, GrimoireCodeDefinition & {
107
+ readonly code: "GR3008";
108
+ }, GrimoireCodeDefinition & {
109
+ readonly code: "GR3009";
110
+ }, GrimoireCodeDefinition & {
111
+ readonly code: "GR3010";
104
112
  }, GrimoireCodeDefinition & {
105
113
  readonly code: "GR4001";
106
114
  }, GrimoireCodeDefinition & {
@@ -121,6 +129,24 @@ export declare const GRIMOIRE_CODE_LIST: readonly [GrimoireCodeDefinition & {
121
129
  readonly code: "GR4009";
122
130
  }, GrimoireCodeDefinition & {
123
131
  readonly code: "GR4010";
132
+ }, GrimoireCodeDefinition & {
133
+ readonly code: "GR4011";
134
+ }, GrimoireCodeDefinition & {
135
+ readonly code: "GR4012";
136
+ }, GrimoireCodeDefinition & {
137
+ readonly code: "GR4013";
138
+ }, GrimoireCodeDefinition & {
139
+ readonly code: "GR4014";
140
+ }, GrimoireCodeDefinition & {
141
+ readonly code: "GR4015";
142
+ }, GrimoireCodeDefinition & {
143
+ readonly code: "GR4016";
144
+ }, GrimoireCodeDefinition & {
145
+ readonly code: "GR4017";
146
+ }, GrimoireCodeDefinition & {
147
+ readonly code: "GR4018";
148
+ }, GrimoireCodeDefinition & {
149
+ readonly code: "GR4019";
124
150
  }, GrimoireCodeDefinition & {
125
151
  readonly code: "GR5001";
126
152
  }, GrimoireCodeDefinition & {
@@ -167,6 +193,22 @@ export declare const GRIMOIRE_CODE_LIST: readonly [GrimoireCodeDefinition & {
167
193
  readonly code: "GR7004";
168
194
  }, GrimoireCodeDefinition & {
169
195
  readonly code: "GR7005";
196
+ }, GrimoireCodeDefinition & {
197
+ readonly code: "GR7006";
198
+ }, GrimoireCodeDefinition & {
199
+ readonly code: "GR7007";
200
+ }, GrimoireCodeDefinition & {
201
+ readonly code: "GR7008";
202
+ }, GrimoireCodeDefinition & {
203
+ readonly code: "GR7009";
204
+ }, GrimoireCodeDefinition & {
205
+ readonly code: "GR7010";
206
+ }, GrimoireCodeDefinition & {
207
+ readonly code: "GR7011";
208
+ }, GrimoireCodeDefinition & {
209
+ readonly code: "GR7012";
210
+ }, GrimoireCodeDefinition & {
211
+ readonly code: "GR7013";
170
212
  }, GrimoireCodeDefinition & {
171
213
  readonly code: "GR8001";
172
214
  }, GrimoireCodeDefinition & {
@@ -189,6 +231,12 @@ export declare const GRIMOIRE_CODE_LIST: readonly [GrimoireCodeDefinition & {
189
231
  readonly code: "GR9006";
190
232
  }, GrimoireCodeDefinition & {
191
233
  readonly code: "GR9007";
234
+ }, GrimoireCodeDefinition & {
235
+ readonly code: "GR9008";
236
+ }, GrimoireCodeDefinition & {
237
+ readonly code: "GR9009";
238
+ }, GrimoireCodeDefinition & {
239
+ readonly code: "GR9010";
192
240
  }];
193
241
  /** One registered code, as a union. */
194
242
  export type GrimoireCode = (typeof GRIMOIRE_CODE_LIST)[number]["code"];
@@ -1 +1 @@
1
- {"version":3,"file":"codes.d.mts","names":[],"sources":["../../../../../../../../packages/grimoire/src/codes/codes.ts"],"mappings":";;;qBA0Ca,8BAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAqwBnB,uBAAuB;;qBAGtB,gBAAgB,SAAS,OAAO,cAAc"}
1
+ {"version":3,"file":"codes.d.mts","names":[],"sources":["../../../../../../../../packages/grimoire/src/codes/codes.ts"],"mappings":";;;qBA2Ca,8BAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAq8BnB,uBAAuB;;qBAGtB,gBAAgB,SAAS,OAAO,cAAc"}
@@ -14,6 +14,7 @@ const RECORD = "record-a-change";
14
14
  const APP = "describe-an-app";
15
15
  const FILE = "document-a-file";
16
16
  const USE = "use-the-grimoire";
17
+ const GUARD = "guard-a-change";
17
18
  /** Every code, in order. */
18
19
  const GRIMOIRE_CODE_LIST = [
19
20
  define("GR1001", "structure", "error", "A written file has no front matter", "Start the file with the front matter block its template shows, between two `---` lines.", WRITE),
@@ -66,6 +67,10 @@ const GRIMOIRE_CODE_LIST = [
66
67
  define("GR3004", "files", "error", "A `@feature` tag names a feature that does not exist", "Fix the tag, or write the feature.", FILE),
67
68
  define("GR3005", "files", "error", "A feature's `folders` entry does not exist", "Fix the folder or file path, or remove it from `folders`.", WRITE),
68
69
  define("GR3006", "files", "warning", "A file in a feature's folders is reached by no flow", "Describe the behaviour in a flow, or delete dead code.", RECORD),
70
+ define("GR3007", "files", "error", "A style uses a physical direction where a logical one is needed", "Use the logical form (`margin-inline-start`, `text-align: start`, `inset-inline-start`, `ms-4`, `text-start`, `start-0`) so right-to-left languages work. When the physical side is really meant, write `grimoire-allow logical-css: <why>` in a comment on that line.", GUARD),
71
+ define("GR3008", "files", "error", "A user-facing error message is generic", "Say what failed and what to do next (\"Could not reach the server, check your connection\"), mapped from the error code. When the text is not shown to users, write `grimoire-allow specific-errors: <why>` in a comment on that line.", GUARD),
72
+ define("GR3009", "files", "error", "A discriminator field is named `kind`", "Name the field `type`.", GUARD),
73
+ define("GR3010", "files", "error", "A relative import path ends in `.js`", "Drop the extension: `./orders.service`, not `./orders.service.js`.", GUARD),
69
74
  define("GR4001", "tests", "warning", "A criterion has no test", "Write a test with `// @proves <feature>/<flow> AC-<n>` above it, or say in the task why not.", RECORD),
70
75
  define("GR4002", "tests", "error", "A `@proves` line names a flow or criterion that does not exist", "Fix the `@proves` line to name an existing `<feature>/<flow> AC-<n>`.", RECORD),
71
76
  define("GR4003", "tests", "error", "A `@proves` line has the wrong form", "Write `// @proves <feature>/<flow> AC-<n>` on its own line.", RECORD),
@@ -76,6 +81,15 @@ const GRIMOIRE_CODE_LIST = [
76
81
  define("GR4008", "tests", "warning", "A criterion's test did not run in the last run", "Run the tests that prove the criterion.", RECORD),
77
82
  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
83
  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),
84
+ define("GR4011", "tests", "error", "A test is focused with `.only`", "Remove `.only`: it makes the runner skip every other test in the file.", RECORD),
85
+ define("GR4012", "tests", "warning", "A test is skipped with `.skip`", "Remove `.skip`, or use `.skipIf(<condition>)` with the reason the test cannot run there.", RECORD),
86
+ define("GR4013", "tests", "error", "A `@shows` line has the wrong form or no matching `shows()` call", "Write `// @shows <feature>/<flow> AC-<n>` on its own line, directly above `await shows(context, \"<feature>/<flow> AC-<n>\", …)` naming the same criterion.", RECORD),
87
+ define("GR4014", "tests", "error", "A `@shows` line names a flow or criterion that does not exist", "Fix the `@shows` line and its `shows()` call to name an existing `<feature>/<flow> AC-<n>`.", RECORD),
88
+ define("GR4015", "tests", "warning", "A shown criterion has no capture in a language", "Run the browser tests (`npx warlock e2e`); `GRIMOIRE_SHOTS=all` captures every flow, not only the changed ones.", RECORD),
89
+ define("GR4016", "tests", "error", "A shown criterion failed in a language", "Open the capture and the error in the Bird view, fix the code or the scene, then run the browser tests again.", RECORD),
90
+ define("GR4017", "tests", "warning", "A capture differs from its approved version", "Compare the two images in the Bird view; the owner approves or rejects the change (`warlock grimoire approve <id>`). List it in your report.", RECORD),
91
+ define("GR4018", "tests", "warning", "A flow, criterion, case or proving test changed since the last approval", "The owner approves or rejects it in the Bird view (`warlock grimoire approve <id>`). List it in your report.", RECORD),
92
+ define("GR4019", "tests", "error", "A change the owner rejected is still there", "Undo the rejected change the message names, then run the check again.", RECORD),
79
93
  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),
80
94
  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),
81
95
  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),
@@ -99,6 +113,14 @@ const GRIMOIRE_CODE_LIST = [
99
113
  define("GR7003", "tasks", "error", "A task's status does not match its folder", "Done tasks live in `tasks/done/<yyyy-mm>/` with `status: done` and `shipped`; open tasks in `tasks/open/`.", RECORD),
100
114
  define("GR7004", "tasks", "error", "A task's `shipped` names a version the changelog does not have", "Fix `shipped: <feature> <version>`, or add the changelog entry.", RECORD),
101
115
  define("GR7005", "tasks", "warning", "A task's brief does not exist", "Fix the `Brief:` path, or write the brief.", WRITE),
116
+ define("GR7006", "tasks", "error", "A changed file is outside the task", "Change only the files of the task's features and its `Files:` line. When the file belongs to the change, add it to `Files:` (or its feature to `Features:`) and say why in the task.", GUARD),
117
+ define("GR7007", "tasks", "error", "The change removes a flow, criterion or case the task does not name", "Restore it, or name it in the task's `Removes:` line once the owner agreed.", GUARD),
118
+ define("GR7008", "tasks", "error", "The change deletes a proving test", "Restore the test, or name its criterion in `Removes:` when the criterion goes too.", GUARD),
119
+ define("GR7009", "tasks", "error", "The change edits a locked test", "A locked test is the task's acceptance: change the code, not the test. Ask the owner when the test itself is wrong.", GUARD),
120
+ define("GR7010", "tasks", "warning", "A changed test has fewer assertions than before", "Keep every assertion, or say in the task why one goes.", GUARD),
121
+ define("GR7011", "tasks", "error", "The change touches a protected area the task does not name", "Leave the area unchanged, or name it in the task's `Touches:` line once the owner agreed (migrations, auth, public-api, config, lockfile, dependencies, or an area of the settings).", GUARD),
122
+ define("GR7012", "tasks", "error", "A commit does not name its task", "Name the task id in the commit message (`T-12`).", GUARD),
123
+ define("GR7013", "tasks", "warning", "The public API differs from its approved snapshot", "Once the owner agreed, approve it with `warlock grimoire approve api`; otherwise undo the change.", GUARD),
102
124
  define("GR8001", "book", "error", "The project's source files could not be read", "Read the message; fix the file or folder it names, then build again.", USE),
103
125
  define("GR8002", "book", "warning", "Route facts could not be read because the app did not boot", "Run `warlock doctor`, fix what stops the app from booting, then `warlock grimoire build`.", USE),
104
126
  define("GR8003", "book", "warning", "Route facts are older than the routes files", "Run `warlock grimoire build` to refresh them.", USE),
@@ -109,7 +131,10 @@ const GRIMOIRE_CODE_LIST = [
109
131
  define("GR9004", "usage", "error", "No flow has that id", "Use `<feature>/<flow>` with a file in `grimoire/features/<feature>/flows/`.", USE),
110
132
  define("GR9005", "usage", "error", "The release file has no brief yet", "Write `grimoire/releases/<release>.md` with `release` and `date` front matter and the brief, then run the command again.", RECORD),
111
133
  define("GR9006", "usage", "error", "A query argument has the wrong form", "Read the command's help (`warlock scry --help`) and pass the argument in that form.", USE),
112
- define("GR9007", "usage", "error", "The book is not built", "Run `warlock grimoire build`, then ask again. `warlock scry` only reads the book; it never builds it.", USE)
134
+ define("GR9007", "usage", "error", "The book is not built", "Run `warlock grimoire build`, then ask again. `warlock scry` only reads the book; it never builds it.", USE),
135
+ define("GR9008", "usage", "error", "The guard has no task to check the change against", "Pass the task id (`warlock grimoire guard T-12`), pass `--commits <range>` whose commits name their tasks, or have exactly one task `in progress`.", GUARD),
136
+ define("GR9009", "usage", "error", "Git could not answer", "Run inside a git repository and pass a base that exists (`--base origin/main`); in CI, fetch the full history.", GUARD),
137
+ define("GR9010", "usage", "error", "Nothing matches the approve or reject target", "Pass a change id from the Bird view or the check, a `<feature>/<flow>`, `api`, or `--all`.", RECORD)
113
138
  ];
114
139
  /** The catalog, keyed by code. */
115
140
  const GRIMOIRE_CODES = Object.fromEntries(GRIMOIRE_CODE_LIST.map((definition) => [definition.code, definition]));
@@ -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. A flow with no writes (only pages and GET, HEAD or OPTIONS routes) may leave out `duplicate` and `double submit`.\",\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 define(\n \"GR5010\",\n \"apps\",\n \"warning\",\n \"A name in backticks in Changes with is not a declared condition\",\n \"Declare the condition under Conditions in the app README, fix the name, or write it without backticks when it is not a condition.\",\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 define(\n \"GR9007\",\n \"usage\",\n \"error\",\n \"The book is not built\",\n \"Run `warlock grimoire build`, then ask again. `warlock scry` only reads the book; it never builds it.\",\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,kNACA,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;CACA,OACE,UACA,QACA,WACA,mEACA,qIACA,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;CACA,OACE,UACA,SACA,SACA,yBACA,yGACA,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, and a change guarded against its task |\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\";\nconst GUARD = \"guard-a-change\";\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. A flow with no writes (only pages and GET, HEAD or OPTIONS routes) may leave out `duplicate` and `double submit`.\",\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 define(\n \"GR3007\",\n \"files\",\n \"error\",\n \"A style uses a physical direction where a logical one is needed\",\n \"Use the logical form (`margin-inline-start`, `text-align: start`, `inset-inline-start`, `ms-4`, `text-start`, `start-0`) so right-to-left languages work. When the physical side is really meant, write `grimoire-allow logical-css: <why>` in a comment on that line.\",\n GUARD,\n ),\n define(\n \"GR3008\",\n \"files\",\n \"error\",\n \"A user-facing error message is generic\",\n 'Say what failed and what to do next (\"Could not reach the server, check your connection\"), mapped from the error code. When the text is not shown to users, write `grimoire-allow specific-errors: <why>` in a comment on that line.',\n GUARD,\n ),\n define(\n \"GR3009\",\n \"files\",\n \"error\",\n \"A discriminator field is named `kind`\",\n \"Name the field `type`.\",\n GUARD,\n ),\n define(\n \"GR3010\",\n \"files\",\n \"error\",\n \"A relative import path ends in `.js`\",\n \"Drop the extension: `./orders.service`, not `./orders.service.js`.\",\n GUARD,\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 define(\n \"GR4011\",\n \"tests\",\n \"error\",\n \"A test is focused with `.only`\",\n \"Remove `.only`: it makes the runner skip every other test in the file.\",\n RECORD,\n ),\n define(\n \"GR4012\",\n \"tests\",\n \"warning\",\n \"A test is skipped with `.skip`\",\n \"Remove `.skip`, or use `.skipIf(<condition>)` with the reason the test cannot run there.\",\n RECORD,\n ),\n define(\n \"GR4013\",\n \"tests\",\n \"error\",\n \"A `@shows` line has the wrong form or no matching `shows()` call\",\n 'Write `// @shows <feature>/<flow> AC-<n>` on its own line, directly above `await shows(context, \"<feature>/<flow> AC-<n>\", …)` naming the same criterion.',\n RECORD,\n ),\n define(\n \"GR4014\",\n \"tests\",\n \"error\",\n \"A `@shows` line names a flow or criterion that does not exist\",\n \"Fix the `@shows` line and its `shows()` call to name an existing `<feature>/<flow> AC-<n>`.\",\n RECORD,\n ),\n define(\n \"GR4015\",\n \"tests\",\n \"warning\",\n \"A shown criterion has no capture in a language\",\n \"Run the browser tests (`npx warlock e2e`); `GRIMOIRE_SHOTS=all` captures every flow, not only the changed ones.\",\n RECORD,\n ),\n define(\n \"GR4016\",\n \"tests\",\n \"error\",\n \"A shown criterion failed in a language\",\n \"Open the capture and the error in the Bird view, fix the code or the scene, then run the browser tests again.\",\n RECORD,\n ),\n define(\n \"GR4017\",\n \"tests\",\n \"warning\",\n \"A capture differs from its approved version\",\n \"Compare the two images in the Bird view; the owner approves or rejects the change (`warlock grimoire approve <id>`). List it in your report.\",\n RECORD,\n ),\n define(\n \"GR4018\",\n \"tests\",\n \"warning\",\n \"A flow, criterion, case or proving test changed since the last approval\",\n \"The owner approves or rejects it in the Bird view (`warlock grimoire approve <id>`). List it in your report.\",\n RECORD,\n ),\n define(\n \"GR4019\",\n \"tests\",\n \"error\",\n \"A change the owner rejected is still there\",\n \"Undo the rejected change the message names, then run the check again.\",\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 define(\n \"GR5010\",\n \"apps\",\n \"warning\",\n \"A name in backticks in Changes with is not a declared condition\",\n \"Declare the condition under Conditions in the app README, fix the name, or write it without backticks when it is not a condition.\",\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 define(\n \"GR7006\",\n \"tasks\",\n \"error\",\n \"A changed file is outside the task\",\n \"Change only the files of the task's features and its `Files:` line. When the file belongs to the change, add it to `Files:` (or its feature to `Features:`) and say why in the task.\",\n GUARD,\n ),\n define(\n \"GR7007\",\n \"tasks\",\n \"error\",\n \"The change removes a flow, criterion or case the task does not name\",\n \"Restore it, or name it in the task's `Removes:` line once the owner agreed.\",\n GUARD,\n ),\n define(\n \"GR7008\",\n \"tasks\",\n \"error\",\n \"The change deletes a proving test\",\n \"Restore the test, or name its criterion in `Removes:` when the criterion goes too.\",\n GUARD,\n ),\n define(\n \"GR7009\",\n \"tasks\",\n \"error\",\n \"The change edits a locked test\",\n \"A locked test is the task's acceptance: change the code, not the test. Ask the owner when the test itself is wrong.\",\n GUARD,\n ),\n define(\n \"GR7010\",\n \"tasks\",\n \"warning\",\n \"A changed test has fewer assertions than before\",\n \"Keep every assertion, or say in the task why one goes.\",\n GUARD,\n ),\n define(\n \"GR7011\",\n \"tasks\",\n \"error\",\n \"The change touches a protected area the task does not name\",\n \"Leave the area unchanged, or name it in the task's `Touches:` line once the owner agreed (migrations, auth, public-api, config, lockfile, dependencies, or an area of the settings).\",\n GUARD,\n ),\n define(\n \"GR7012\",\n \"tasks\",\n \"error\",\n \"A commit does not name its task\",\n \"Name the task id in the commit message (`T-12`).\",\n GUARD,\n ),\n define(\n \"GR7013\",\n \"tasks\",\n \"warning\",\n \"The public API differs from its approved snapshot\",\n \"Once the owner agreed, approve it with `warlock grimoire approve api`; otherwise undo the change.\",\n GUARD,\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 define(\n \"GR9007\",\n \"usage\",\n \"error\",\n \"The book is not built\",\n \"Run `warlock grimoire build`, then ask again. `warlock scry` only reads the book; it never builds it.\",\n USE,\n ),\n define(\n \"GR9008\",\n \"usage\",\n \"error\",\n \"The guard has no task to check the change against\",\n \"Pass the task id (`warlock grimoire guard T-12`), pass `--commits <range>` whose commits name their tasks, or have exactly one task `in progress`.\",\n GUARD,\n ),\n define(\n \"GR9009\",\n \"usage\",\n \"error\",\n \"Git could not answer\",\n \"Run inside a git repository and pass a base that exists (`--base origin/main`); in CI, fetch the full history.\",\n GUARD,\n ),\n define(\n \"GR9010\",\n \"usage\",\n \"error\",\n \"Nothing matches the approve or reject target\",\n \"Pass a change id from the Bird view or the check, a `<feature>/<flow>`, `api`, or `--all`.\",\n RECORD,\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;AACZ,MAAM,QAAQ;;AAGd,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,kNACA,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;CACA,OACE,UACA,SACA,SACA,mEACA,0QACA,KACF;CACA,OACE,UACA,SACA,SACA,0CACA,0OACA,KACF;CACA,OACE,UACA,SACA,SACA,yCACA,0BACA,KACF;CACA,OACE,UACA,SACA,SACA,wCACA,sEACA,KACF;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;CACA,OACE,UACA,SACA,SACA,kCACA,0EACA,MACF;CACA,OACE,UACA,SACA,WACA,kCACA,4FACA,MACF;CACA,OACE,UACA,SACA,SACA,oEACA,+JACA,MACF;CACA,OACE,UACA,SACA,SACA,iEACA,+FACA,MACF;CACA,OACE,UACA,SACA,WACA,kDACA,mHACA,MACF;CACA,OACE,UACA,SACA,SACA,0CACA,iHACA,MACF;CACA,OACE,UACA,SACA,WACA,+CACA,gJACA,MACF;CACA,OACE,UACA,SACA,WACA,2EACA,gHACA,MACF;CACA,OACE,UACA,SACA,SACA,8CACA,yEACA,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;CACA,OACE,UACA,QACA,WACA,mEACA,qIACA,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;CACA,OACE,UACA,SACA,SACA,sCACA,wLACA,KACF;CACA,OACE,UACA,SACA,SACA,uEACA,+EACA,KACF;CACA,OACE,UACA,SACA,SACA,qCACA,sFACA,KACF;CACA,OACE,UACA,SACA,SACA,kCACA,uHACA,KACF;CACA,OACE,UACA,SACA,WACA,mDACA,0DACA,KACF;CACA,OACE,UACA,SACA,SACA,8DACA,wLACA,KACF;CACA,OACE,UACA,SACA,SACA,mCACA,oDACA,KACF;CACA,OACE,UACA,SACA,WACA,qDACA,qGACA,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;CACA,OACE,UACA,SACA,SACA,yBACA,yGACA,GACF;CACA,OACE,UACA,SACA,SACA,qDACA,sJACA,KACF;CACA,OACE,UACA,SACA,SACA,wBACA,kHACA,KACF;CACA,OACE,UACA,SACA,SACA,gDACA,8FACA,MACF;AACF;;AAMA,MAAa,iBACX,OAAO,YACL,mBAAmB,KAAK,eAAe,CAAC,WAAW,MAAM,UAAU,CAAC,CACtE"}
@@ -231,6 +231,12 @@ export type BookAdapter = {
231
231
  tests?(root: string): Promise<string[]>;
232
232
  /** The framework brand and the app's own name and version, for the view's header and footer. Optional; never boots the app. */
233
233
  host?(root: string): Promise<BookHost | null> | BookHost | null;
234
+ /**
235
+ * The app's languages, in order (`["en", "ar"]`), when `grimoire/settings.md`
236
+ * names none. Static: never boots the app. Absent or empty means one
237
+ * language column.
238
+ */
239
+ languages?(root: string): Promise<string[]> | string[];
234
240
  };
235
241
  //#endregion
236
242
  //# sourceMappingURL=adapter.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"adapter.d.mts","names":[],"sources":["../../../../../../../../packages/grimoire/src/contracts/adapter.ts"],"mappings":";;;;;;;;;;;;;;;;;YAiBY;;YAkCA;;EAEV;;EAEA;;;YAIU;;EAEV;;EAEA;;;;;;EAMA;;;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;;EAEA;;EAEA;;EAEA;;;;;EAKA,aAAa;;;YAIH;;EAEV;EACA;;EAEA;;;YAIU;;EAEV;;EAEA;;;;;;EAMA;;EAEA;EACA,SAAS;;;YAIC;;YAGA;EACV,MAAM;;EAEN;;EAEA;;;YAIU;EACV,OAAO;;EAEP,QAAQ;EACR,OAAO;EACP,OAAO;EACP,QAAQ;EACR,OAAO;;EAEP;;;;;;;;YASU;;EAEV;;EAEA;;EAEA;;EAEA;IAAO;IAAc;;;;;;;;;;;YAWX;;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;;EAEtB,MAAM,eAAe,QAAQ,mBAAmB"}
1
+ {"version":3,"file":"adapter.d.mts","names":[],"sources":["../../../../../../../../packages/grimoire/src/contracts/adapter.ts"],"mappings":";;;;;;;;;;;;;;;;;YAiBY;;YAkCA;;EAEV;;EAEA;;;YAIU;;EAEV;;EAEA;;;;;;EAMA;;;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;;EAEA;;EAEA;;EAEA;;;;;EAKA,aAAa;;;YAIH;;EAEV;EACA;;EAEA;;;YAIU;;EAEV;;EAEA;;;;;;EAMA;;EAEA;EACA,SAAS;;;YAIC;;YAGA;EACV,MAAM;;EAEN;;EAEA;;;YAIU;EACV,OAAO;;EAEP,QAAQ;EACR,OAAO;EACP,OAAO;EACP,QAAQ;EACR,OAAO;;EAEP;;;;;;;;YASU;;EAEV;;EAEA;;EAEA;;EAEA;IAAO;IAAc;;;;;;;;;;;YAWX;;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;;EAEtB,MAAM,eAAe,QAAQ,mBAAmB;;;;;;EAMhD,WAAW,eAAe"}
@@ -0,0 +1,104 @@
1
+ import { GrimoireFinding } from "./findings.mjs";
2
+ import { GrimoireSettings } from "./settings.mjs";
3
+ import { FlowRef, WrittenGrimoire } from "./written.mjs";
4
+ import { ProofLine } from "./test-results.mjs";
5
+ import { Ownership } from "./bookmap.mjs";
6
+ import { DriftItem } from "./shots.mjs";
7
+ import { ChangedFile, ChangedFileStatus, CommitInfo } from "../git/index.mjs";
8
+ //#region ../../packages/grimoire/src/contracts/guard.d.ts
9
+ /**
10
+ * One `Removes:` entry of a task: what the task may delete.
11
+ * `catalog` (a feature), `catalog/new-arrivals` (a flow),
12
+ * `catalog/new-arrivals AC-2` (a criterion) or
13
+ * `catalog/new-arrivals case duplicate` (a case).
14
+ */
15
+ export type RemoveEntry = {
16
+ feature: string;
17
+ flow: string | null;
18
+ /** `AC-<n>`, upper-case, or `null`. */
19
+ criterion: string | null;
20
+ /** The case question, lower-case, or `null`. */
21
+ case: string | null;
22
+ /** The entry as written. */
23
+ text: string;
24
+ };
25
+ /** What a task allows, read from its front matter and its `- Key: value` body lines. */
26
+ export type TaskScope = {
27
+ /** `T-<n>`. */
28
+ id: string;
29
+ /** The task file, project-relative. */
30
+ file: string;
31
+ /** The task's own `feature` and `flow` (`<feature>/<flow>`), or `null`. */
32
+ feature: string | null;
33
+ flow: FlowRef | null;
34
+ /** The feature, plus the `Features:` entries (a `<feature>/<flow>` entry names a flow). */
35
+ features: string[];
36
+ /** `Files:` globs. */
37
+ files: string[];
38
+ /** `Locked:` globs: test files no one may edit. */
39
+ locked: string[];
40
+ /** `Touches:` names: the protected areas the task may change (lower-case). */
41
+ touches: string[];
42
+ removes: RemoveEntry[];
43
+ };
44
+ /** The approved public API, `grimoire/approved/api.json`. */
45
+ export type ApiSnapshot = {
46
+ schemaVersion: 1;
47
+ /** ISO time of the approval. */
48
+ approvedAt: string;
49
+ /** Sorted `METHOD /path` lines, with ` [auth]` appended when the route needs a signed-in user. */
50
+ routes: string[];
51
+ };
52
+ /** The text of a changed file at the base and now; `null` when it does not exist there. */
53
+ export type GuardFileText = {
54
+ base: string | null;
55
+ current: string | null;
56
+ };
57
+ /** Everything the pure guard rules read. No git and no files are read inside them. */
58
+ export type GuardInput = {
59
+ /** The task(s) the change is checked against, merged; `null` when none was found (`GR9008`). */
60
+ scope: TaskScope | null;
61
+ changed: ChangedFile[];
62
+ /** Text of the changed code, test and manifest files, by project-relative path (the new path of a rename). */
63
+ texts: Record<string, GuardFileText>;
64
+ ownership: Ownership;
65
+ /** Flow ref → every file its steps reach. */
66
+ flowFiles: Record<FlowRef, string[]>;
67
+ /** The `@proves` lines of the working tree. */
68
+ proofs: ProofLine[];
69
+ /** The written files at the base (only their features), or `null` when none changed. */
70
+ baseWritten: WrittenGrimoire | null;
71
+ written: WrittenGrimoire;
72
+ settings: GrimoireSettings;
73
+ /** Test files the book knows. */
74
+ testFiles: string[];
75
+ api: {
76
+ approved: ApiSnapshot | null;
77
+ routes: string[] | null;
78
+ };
79
+ /** The commits to check, or `null` when `--commits` was not given. */
80
+ commits: CommitInfo[] | null;
81
+ /** Every task id the project has (`T-12`). */
82
+ taskIds: string[];
83
+ };
84
+ /** What `warlock grimoire guard --json` prints. */
85
+ export type GuardReport = {
86
+ schemaVersion: 1;
87
+ /** The task id(s) checked, joined by a comma, or `null` when none was found. */
88
+ task: string | null;
89
+ /** The commit the change was compared with. */
90
+ base: string;
91
+ changed: ChangedFile[];
92
+ findings: GrimoireFinding[];
93
+ /** Changes since the approved baseline that nobody approved yet. They never fail the guard. */
94
+ notApproved: DriftItem[];
95
+ counts: {
96
+ errors: number;
97
+ warnings: number;
98
+ expected: number;
99
+ };
100
+ ok: boolean;
101
+ };
102
+ //#endregion
103
+ export type { ChangedFile, ChangedFileStatus, CommitInfo };
104
+ //# sourceMappingURL=guard.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guard.d.mts","names":[],"sources":["../../../../../../../../packages/grimoire/src/contracts/guard.ts"],"mappings":";;;;;;;;;;;;;;YAsBY;EACV;EACA;;EAEA;;EAEA;;EAEA;;;YAIU;;EAEV;;EAEA;;EAEA;EACA,MAAM;;EAEN;;EAEA;;EAEA;;EAEA;EACA,SAAS;;;YAIC;EACV;;EAEA;;EAEA;;;YAIU;EAAkB;EAAqB;;;YAGvC;;EAEV,OAAO;EACP,SAAS;;EAET,OAAO,eAAe;EACtB,WAAW;;EAEX,WAAW,OAAO;;EAElB,QAAQ;;EAER,aAAa;EACb,SAAS;EACT,UAAU;;EAEV;EACA;IAAO,UAAU;IAAoB;;;EAErC,SAAS;;EAET;;;YAIU;EACV;;EAEA;;EAEA;EACA,SAAS;EACT,UAAU;;EAEV,aAAa;EACb;IAAU;IAAgB;IAAkB;;EAC5C"}
@@ -0,0 +1,5 @@
1
+ import { BOOK_SCHEMA_VERSION } from "./book.mjs";
2
+ import { CODE_RULES, DEFAULT_GRIMOIRE_SETTINGS, DEFAULT_PROTECTED_AREAS, SCREENSHOT_MODES } from "./settings.mjs";
3
+ import { CASE_QUESTIONS, COLLECTED_END_MARKER, COLLECTED_START_MARKER, UI_CASE_QUESTIONS } from "./written.mjs";
4
+
5
+ export { BOOK_SCHEMA_VERSION, CASE_QUESTIONS, CODE_RULES, COLLECTED_END_MARKER, COLLECTED_START_MARKER, DEFAULT_GRIMOIRE_SETTINGS, DEFAULT_PROTECTED_AREAS, SCREENSHOT_MODES, UI_CASE_QUESTIONS };
@@ -0,0 +1,75 @@
1
+ import { ScreenshotMode } from "./settings.mjs";
2
+ import { CriterionId, FlowRef, WrittenStatus } from "./written.mjs";
3
+ import { CriterionStatus } from "./test-results.mjs";
4
+ import { DriftItem } from "./shots.mjs";
5
+ //#region ../../packages/grimoire/src/contracts/matrix.d.ts
6
+ /** The colour of a cell, worst first: a rejected change, a failure, a change not approved, then the test states. */
7
+ export type MatrixCellState = "rejected" | "fail" | "changed" | "stale" | "not-run" | "no-test" | "pass";
8
+ /** One criterion in one language. */
9
+ export type MatrixCell = {
10
+ /** `""` when the app names no language (one column). */
11
+ language: string;
12
+ /** The criterion's `@proves` tests; the same in every language. */
13
+ test: CriterionStatus;
14
+ /** The criterion's `@shows` scene in this language, or `null` when it has none. */
15
+ shown: {
16
+ outcome: "pass" | "fail" | "not-run";
17
+ /** The captured image, a path under `grimoire/screenshots/`, or `null`. */
18
+ shot: string | null;
19
+ /** The approved image, or `null`. */
20
+ approved: string | null;
21
+ ranAt: string | null;
22
+ } | null;
23
+ /** `null` when there is no baseline yet. */
24
+ approval: "approved" | "changed" | "rejected" | null;
25
+ /** Ids of the drift items about this cell (open them side by side). */
26
+ drift: string[];
27
+ state: MatrixCellState;
28
+ };
29
+ export type MatrixCriterionRow = {
30
+ id: CriterionId;
31
+ text: string;
32
+ /** The app the criterion is scoped to (`AC-n [app]`), or `null` for every app. */
33
+ app: string | null;
34
+ /** `true` for a criterion of the baseline that is no longer written. */
35
+ removed: boolean;
36
+ cells: MatrixCell[];
37
+ };
38
+ export type MatrixFlowRow = {
39
+ ref: FlowRef;
40
+ id: string;
41
+ title: string;
42
+ status: WrittenStatus | null;
43
+ /** Apps named under `## Differs by app`. */
44
+ differsIn: string[];
45
+ /** `false` when the flow opted out with `screenshots: false`. */
46
+ screenshots: boolean;
47
+ removed: boolean;
48
+ criteria: MatrixCriterionRow[];
49
+ /** Drift ids of the flow itself (added, removed, case and proof changes). */
50
+ drift: string[];
51
+ };
52
+ export type MatrixFeatureRow = {
53
+ id: string;
54
+ title: string;
55
+ /** `true` for the `design-system` feature, listed first. */
56
+ designSystem: boolean;
57
+ flows: MatrixFlowRow[];
58
+ };
59
+ /** `GET /matrix`. */
60
+ export type GrimoireMatrix = {
61
+ /** The columns: the app's languages, or `[""]` when it names none. */
62
+ languages: string[];
63
+ mode: ScreenshotMode;
64
+ /** `null` until the first approval. */
65
+ baseline: {
66
+ approvedAt: string;
67
+ } | null;
68
+ features: MatrixFeatureRow[];
69
+ /** Every drift item, for the side-by-side panel. */
70
+ drift: DriftItem[];
71
+ /** Cells per state, over every criterion and language. */
72
+ counts: Record<MatrixCellState, number>;
73
+ };
74
+ //#endregion
75
+ //# sourceMappingURL=matrix.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"matrix.d.mts","names":[],"sources":["../../../../../../../../packages/grimoire/src/contracts/matrix.ts"],"mappings":";;;;;;YAYY;;YAUA;;EAEV;;EAEA,MAAM;;EAEN;IACE;;IAEA;;IAEA;IACA;;;EAGF;;EAEA;EACA,OAAO;;YAGG;EACV,IAAI;EACJ;;EAEA;;EAEA;EACA,OAAO;;YAGG;EACV,KAAK;EACL;EACA;EACA,QAAQ;;EAER;;EAEA;EACA;EACA,UAAU;;EAEV;;YAGU;EACV;EACA;;EAEA;EACA,OAAO;;;YAIG;;EAEV;EACA,MAAM;;EAEN;IAAY;;EACZ,UAAU;;EAEV,OAAO;;EAEP,QAAQ,OAAO"}
@@ -174,6 +174,17 @@ export type ScryHit = {
174
174
  */
175
175
  matched?: string;
176
176
  };
177
+ /** A file that usually changes with the top search hits. */
178
+ export type ScryAlsoChange = {
179
+ file: string;
180
+ /**
181
+ * `imports`: the file imports a hit's file. `imported-by`: a hit's file imports it.
182
+ * `test`: a spec that imports a hit's file or proves a hit's flow. `step`: a file a hit's flow starts from.
183
+ */
184
+ reason: "imports" | "imported-by" | "test" | "step";
185
+ /** The ids of the top hits that brought the file in. */
186
+ via: string[];
187
+ };
177
188
  export type ScrySearchResult = ScryNotes & {
178
189
  type: "search";
179
190
  text: string;
@@ -181,6 +192,16 @@ export type ScrySearchResult = ScryNotes & {
181
192
  counts: Partial<Record<ScryHitType, number>>;
182
193
  /** Best first, whatever the type; on an equal score features and flows come first. */
183
194
  hits: ScryHit[];
195
+ /**
196
+ * Files that usually change with the top hits (the top three that map to files): their imports and importers in the
197
+ * same owning feature, plus their tests, most shared first, at most 10, none already a hit. Absent in stored answers
198
+ * from before it existed.
199
+ */
200
+ alsoChanges?: ScryAlsoChange[];
201
+ /** The best hit is not a name match and holds fewer than half of the request's words: use grep for literal text. */
202
+ weak?: boolean;
203
+ /** The command to run next: `warlock scry --impact <top file>`. Absent when no top hit maps to a file. */
204
+ next?: string;
184
205
  };
185
206
  export type ScryResult = ScryFileResult | ScryImpactResult | ScryRouteResult | ScryFeatureResult | ScryFlowResult | ScrySearchResult;
186
207
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"scry.d.mts","names":[],"sources":["../../../../../../../../packages/grimoire/src/contracts/scry.ts"],"mappings":";;;;;;YAWY;;;EAEN;EAAc;;;;EAEd;EAAgB;;;;EAEhB;EAAe;EAAgB;EAAc;;;;EAE7C;EAAiB;;;;EAEjB;EAAc;EAAiB;;;;EAE/B;EAAgB;EAAc;EAAgB;;;YAGxC;EACV,QAAQ;EACR;;;YAIU;EAAgB;EAAa;EAAe;EAAc;;YAE1D,iBAAiB;EAC3B;EACA,OAAO;;EAEP;;YAIU,mBAAmB,KAAK;EAClC;EACA;;EAEA;IAAa;IAAkB;;;;;;EAK/B,QAAQ,KAAK;EACb,OAAO;;EAEP;;EAEA;IAAY;IAAY;;;EAExB;;YAGU,kBAAkB;EAC5B;;EAEA,OAAO;;EAEP;;EAEA;IAAS;IAAc;;;EAEvB,MAAM;;EAEN,OAAO;;;YAIG,gBAAgB;;EAE1B;EACA;EACA;EACA;;;YAIU;EACV;;EAEA;EACA;;EAEA;;;YAIU;EACV;EACA;EACA;EACA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;YAGU,oBAAoB;EAC9B;EACA,QAAQ;EACR,OAAO;EACP,SAAS;;EAET,SAAS;;EAET,OAAO;EACP,UAAU;;YAGA,iBAAiB;EAC3B;EACA,MAAM;EACN,SAAS;;EAET,SAAS;EACT,UAAU;;;YAIA;;YAcA;EACV,MAAM;;;;;;EAMN;;EAEA;;EAEA;;EAEA;;;;;EAKA;;YAGU,mBAAmB;EAC7B;EACA;;EAEA,QAAQ,QAAQ,OAAO;;EAEvB,MAAM;;YAGI,aACR,iBACA,mBACA,kBACA,oBACA,iBACA"}
1
+ {"version":3,"file":"scry.d.mts","names":[],"sources":["../../../../../../../../packages/grimoire/src/contracts/scry.ts"],"mappings":";;;;;;YAWY;;;EAEN;EAAc;;;;EAEd;EAAgB;;;;EAEhB;EAAe;EAAgB;EAAc;;;;EAE7C;EAAiB;;;;EAEjB;EAAc;EAAiB;;;;EAE/B;EAAgB;EAAc;EAAgB;;;YAGxC;EACV,QAAQ;EACR;;;YAIU;EAAgB;EAAa;EAAe;EAAc;;YAE1D,iBAAiB;EAC3B;EACA,OAAO;;EAEP;;YAIU,mBAAmB,KAAK;EAClC;EACA;;EAEA;IAAa;IAAkB;;;;;;EAK/B,QAAQ,KAAK;EACb,OAAO;;EAEP;;EAEA;IAAY;IAAY;;;EAExB;;YAGU,kBAAkB;EAC5B;;EAEA,OAAO;;EAEP;;EAEA;IAAS;IAAc;;;EAEvB,MAAM;;EAEN,OAAO;;;YAIG,gBAAgB;;EAE1B;EACA;EACA;EACA;;;YAIU;EACV;;EAEA;EACA;;EAEA;;;YAIU;EACV;EACA;EACA;EACA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;YAGU,oBAAoB;EAC9B;EACA,QAAQ;EACR,OAAO;EACP,SAAS;;EAET,SAAS;;EAET,OAAO;EACP,UAAU;;YAGA,iBAAiB;EAC3B;EACA,MAAM;EACN,SAAS;;EAET,SAAS;EACT,UAAU;;;YAIA;;YAcA;EACV,MAAM;;;;;;EAMN;;EAEA;;EAEA;;EAEA;;;;;EAKA;;;YAIU;EACV;;;;;EAKA;;EAEA;;YAGU,mBAAmB;EAC7B;EACA;;EAEA,QAAQ,QAAQ,OAAO;;EAEvB,MAAM;;;;;;EAMN,cAAc;;EAEd;;EAEA;;YAGU,aACR,iBACA,mBACA,kBACA,oBACA,iBACA"}