@canonical/pragma-cli 0.35.0 → 0.37.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 (295) hide show
  1. package/README.md +2 -2
  2. package/bundled-skills/add-standard/SKILL.md +338 -0
  3. package/bundled-skills/adoption-a1-styles/SKILL.md +269 -0
  4. package/bundled-skills/adoption-a2-components/SKILL.md +291 -0
  5. package/bundled-skills/adoption-a3-forms/SKILL.md +260 -0
  6. package/bundled-skills/anatomy-author/ANATOMY_DSL_SPEC.md +406 -0
  7. package/bundled-skills/anatomy-author/SKILL.md +1226 -0
  8. package/bundled-skills/design-auditor/SKILL.md +455 -0
  9. package/bundled-skills/implement-component/SKILL.md +333 -0
  10. package/bundled-skills/specify-component/SKILL.md +331 -0
  11. package/bundled-skills/specify-pattern/SKILL.md +292 -0
  12. package/dist/package.json +24 -20
  13. package/dist/pragma.conf.js +266 -34
  14. package/dist/pragma.conf.js.map +1 -1
  15. package/dist/src/bin.js +1 -1
  16. package/dist/src/bin.js.map +1 -1
  17. package/dist/src/capabilities/capabilities/hints.js +1 -1
  18. package/dist/src/capabilities/capabilities/hints.js.map +1 -1
  19. package/dist/src/capabilities/colophon/colophon.render.js +1 -1
  20. package/dist/src/capabilities/colophon/colophon.render.js.map +1 -1
  21. package/dist/src/capabilities/create/create.verb.js +2 -1
  22. package/dist/src/capabilities/create/create.verb.js.map +1 -1
  23. package/dist/src/capabilities/create/createSurface.generated.js +23 -1
  24. package/dist/src/capabilities/create/createSurface.generated.js.map +1 -1
  25. package/dist/src/capabilities/create/mount.js +4 -3
  26. package/dist/src/capabilities/create/mount.js.map +1 -1
  27. package/dist/src/capabilities/doctor/checks/checkNodeVersion.js +11 -6
  28. package/dist/src/capabilities/doctor/checks/checkNodeVersion.js.map +1 -1
  29. package/dist/src/capabilities/doctor/checks/checkPackageRefs.js +60 -4
  30. package/dist/src/capabilities/doctor/checks/checkPackageRefs.js.map +1 -1
  31. package/dist/src/capabilities/doctor/checks/checkShellCompletions.js +8 -8
  32. package/dist/src/capabilities/doctor/checks/checkShellCompletions.js.map +1 -1
  33. package/dist/src/capabilities/doctor/checks/harnessInventory.js +195 -0
  34. package/dist/src/capabilities/doctor/checks/harnessInventory.js.map +1 -0
  35. package/dist/src/capabilities/doctor/checks/index.js +6 -6
  36. package/dist/src/capabilities/doctor/checks/isSupportedNodeVersion.js +38 -0
  37. package/dist/src/capabilities/doctor/checks/isSupportedNodeVersion.js.map +1 -0
  38. package/dist/src/capabilities/doctor/checks/targetHealth.js +194 -50
  39. package/dist/src/capabilities/doctor/checks/targetHealth.js.map +1 -1
  40. package/dist/src/capabilities/doctor/doctor.render.js +43 -64
  41. package/dist/src/capabilities/doctor/doctor.render.js.map +1 -1
  42. package/dist/src/capabilities/doctor/doctor.verb.js +6 -2
  43. package/dist/src/capabilities/doctor/doctor.verb.js.map +1 -1
  44. package/dist/src/capabilities/doctor/runChecks.js +14 -11
  45. package/dist/src/capabilities/doctor/runChecks.js.map +1 -1
  46. package/dist/src/capabilities/graph/query.render.js +2 -2
  47. package/dist/src/capabilities/graph/query.render.js.map +1 -1
  48. package/dist/src/capabilities/info/collectInfo.js +8 -2
  49. package/dist/src/capabilities/info/collectInfo.js.map +1 -1
  50. package/dist/src/capabilities/info/info.render.js +6 -2
  51. package/dist/src/capabilities/info/info.render.js.map +1 -1
  52. package/dist/src/capabilities/prompt/prompt.render.js +2 -2
  53. package/dist/src/capabilities/prompt/prompt.render.js.map +1 -1
  54. package/dist/src/capabilities/setup/buildPlan.js +43 -39
  55. package/dist/src/capabilities/setup/buildPlan.js.map +1 -1
  56. package/dist/src/capabilities/setup/mode.js +2 -2
  57. package/dist/src/capabilities/setup/operations/index.js +4 -4
  58. package/dist/src/capabilities/setup/operations/index.js.map +1 -1
  59. package/dist/src/capabilities/setup/operations/setupCompletions.js +6 -2
  60. package/dist/src/capabilities/setup/operations/setupCompletions.js.map +1 -1
  61. package/dist/src/capabilities/setup/operations/setupConfig.js +4 -2
  62. package/dist/src/capabilities/setup/operations/setupConfig.js.map +1 -1
  63. package/dist/src/capabilities/setup/operations/setupGenerator.js +156 -58
  64. package/dist/src/capabilities/setup/operations/setupGenerator.js.map +1 -1
  65. package/dist/src/capabilities/setup/operations/setupLsp.js +136 -38
  66. package/dist/src/capabilities/setup/operations/setupLsp.js.map +1 -1
  67. package/dist/src/capabilities/setup/operations/setupMcp.js +101 -52
  68. package/dist/src/capabilities/setup/operations/setupMcp.js.map +1 -1
  69. package/dist/src/capabilities/setup/operations/setupSkills.js +329 -49
  70. package/dist/src/capabilities/setup/operations/setupSkills.js.map +1 -1
  71. package/dist/src/capabilities/setup/plan.js.map +1 -1
  72. package/dist/src/capabilities/setup/plan.render.js +144 -66
  73. package/dist/src/capabilities/setup/plan.render.js.map +1 -1
  74. package/dist/src/capabilities/setup/setup.render.js +1 -1
  75. package/dist/src/capabilities/setup/setup.verb.js +165 -63
  76. package/dist/src/capabilities/setup/setup.verb.js.map +1 -1
  77. package/dist/src/capabilities/setup/targets.js +122 -51
  78. package/dist/src/capabilities/setup/targets.js.map +1 -1
  79. package/dist/src/capabilities/shared/index.js +7 -6
  80. package/dist/src/capabilities/shared/index.js.map +1 -1
  81. package/dist/src/capabilities/shared/packageManager.js +300 -54
  82. package/dist/src/capabilities/shared/packageManager.js.map +1 -1
  83. package/dist/src/capabilities/skill/discover.js +97 -11
  84. package/dist/src/capabilities/skill/discover.js.map +1 -1
  85. package/dist/src/capabilities/skill/render.js +2 -2
  86. package/dist/src/capabilities/skill/render.js.map +1 -1
  87. package/dist/src/capabilities/sources/installSkills.js +145 -3
  88. package/dist/src/capabilities/sources/installSkills.js.map +1 -1
  89. package/dist/src/capabilities/sources/runUpdate.js +68 -2
  90. package/dist/src/capabilities/sources/runUpdate.js.map +1 -1
  91. package/dist/src/capabilities/sources/update.verb.js +3 -3
  92. package/dist/src/capabilities/sources/update.verb.js.map +1 -1
  93. package/dist/src/capabilities/upgrade/runUpgrade.js +43 -7
  94. package/dist/src/capabilities/upgrade/runUpgrade.js.map +1 -1
  95. package/dist/src/capabilities/upgrade/upgrade.render.js +10 -2
  96. package/dist/src/capabilities/upgrade/upgrade.render.js.map +1 -1
  97. package/dist/src/constants.js +13 -2
  98. package/dist/src/constants.js.map +1 -1
  99. package/dist/src/kernel/index.js +11 -2
  100. package/dist/src/kernel/index.js.map +1 -1
  101. package/dist/src/kernel/interactivity.js +68 -0
  102. package/dist/src/kernel/interactivity.js.map +1 -0
  103. package/dist/src/kernel/packs/renderPack.js +3 -3
  104. package/dist/src/kernel/packs/renderPack.js.map +1 -1
  105. package/dist/src/kernel/packs/resolveEntity.js +63 -12
  106. package/dist/src/kernel/packs/resolveEntity.js.map +1 -1
  107. package/dist/src/kernel/packs/runBodies.js +57 -4
  108. package/dist/src/kernel/packs/runBodies.js.map +1 -1
  109. package/dist/src/kernel/packs/schema.js +54 -2
  110. package/dist/src/kernel/packs/schema.js.map +1 -1
  111. package/dist/src/kernel/packs/sparql/applyFilters.js +104 -5
  112. package/dist/src/kernel/packs/sparql/applyFilters.js.map +1 -1
  113. package/dist/src/kernel/packs/sparql/buildLookupQuery.js +310 -43
  114. package/dist/src/kernel/packs/sparql/buildLookupQuery.js.map +1 -1
  115. package/dist/src/kernel/packs/types.js.map +1 -1
  116. package/dist/src/kernel/project/cli/buildProgram.js +1 -1
  117. package/dist/src/kernel/project/cli/buildProgram.js.map +1 -1
  118. package/dist/src/kernel/project/cli/dispatch.js +46 -24
  119. package/dist/src/kernel/project/cli/dispatch.js.map +1 -1
  120. package/dist/src/kernel/project/cli/globalFlags.js +4 -1
  121. package/dist/src/kernel/project/cli/globalFlags.js.map +1 -1
  122. package/dist/src/kernel/project/cli/helpFormat.js +1 -2
  123. package/dist/src/kernel/project/cli/helpFormat.js.map +1 -1
  124. package/dist/src/kernel/project/cli/rootHelp.js +42 -9
  125. package/dist/src/kernel/project/cli/rootHelp.js.map +1 -1
  126. package/dist/src/kernel/project/mcp/registerVerb.js +16 -1
  127. package/dist/src/kernel/project/mcp/registerVerb.js.map +1 -1
  128. package/dist/src/kernel/render/renderers.js +1 -1
  129. package/dist/src/kernel/render/style.js +29 -9
  130. package/dist/src/kernel/render/style.js.map +1 -1
  131. package/dist/src/kernel/render/vocabulary.js +174 -0
  132. package/dist/src/kernel/render/vocabulary.js.map +1 -0
  133. package/dist/src/kernel/runtime/graphpack/embedded/pack.generated.js +2 -3
  134. package/dist/src/kernel/runtime/graphpack/embedded/pack.generated.js.map +1 -1
  135. package/dist/src/kernel/runtime/graphpack/embedded/pack.index.generated.js +1 -1
  136. package/dist/src/kernel/runtime/graphpack/embedded/pack.index.generated.js.map +1 -1
  137. package/dist/src/kernel/runtime/graphpack/embedded/pack.manifest.generated.js +4 -0
  138. package/dist/src/kernel/runtime/graphpack/embedded/pack.manifest.generated.js.map +1 -0
  139. package/dist/src/kernel/runtime/graphpack/embedded.js +13 -6
  140. package/dist/src/kernel/runtime/graphpack/embedded.js.map +1 -1
  141. package/dist/src/kernel/runtime/graphpack/read.js +14 -9
  142. package/dist/src/kernel/runtime/graphpack/read.js.map +1 -1
  143. package/dist/src/kernel/runtime/loadSession.js +3 -1
  144. package/dist/src/kernel/runtime/loadSession.js.map +1 -1
  145. package/dist/src/kernel/runtime/probe.js +1 -1
  146. package/dist/src/kernel/runtime/probe.js.map +1 -1
  147. package/dist/src/kernel/runtime/refs/parseRef.js +17 -1
  148. package/dist/src/kernel/runtime/refs/parseRef.js.map +1 -1
  149. package/dist/src/kernel/runtime/refs/resolve.js +9 -3
  150. package/dist/src/kernel/runtime/refs/resolve.js.map +1 -1
  151. package/dist/src/kernel/spec/emitReference.js +1 -1
  152. package/dist/src/kernel/spec/emitReference.js.map +1 -1
  153. package/package.json +24 -20
  154. package/pragma.conf.ts +272 -34
  155. package/src/bin.ts +8 -1
  156. package/src/capabilities/block.parity.test.ts +25 -11
  157. package/src/capabilities/block.shipped.exec.test.ts +282 -0
  158. package/src/capabilities/block.tierRank.exec.test.ts +300 -0
  159. package/src/capabilities/capabilities/hints.ts +1 -1
  160. package/src/capabilities/colophon/colophon.render.ts +1 -2
  161. package/src/capabilities/colophon/colophon.test.ts +2 -2
  162. package/src/capabilities/config/collectConfigShow.test.ts +1 -0
  163. package/src/capabilities/create/byteEquality.test.ts +28 -1
  164. package/src/capabilities/create/create.test.ts +1 -0
  165. package/src/capabilities/create/create.verb.ts +2 -1
  166. package/src/capabilities/create/createGrammar.test.ts +5 -2
  167. package/src/capabilities/create/createSurface.generated.ts +23 -1
  168. package/src/capabilities/create/crossCli.subprocess.test.ts +10 -3
  169. package/src/capabilities/create/mount.ts +3 -3
  170. package/src/capabilities/distribution.parity.test.ts +4 -0
  171. package/src/capabilities/doctor/checks/checkNodeVersion.test.ts +49 -0
  172. package/src/capabilities/doctor/checks/checkNodeVersion.ts +11 -7
  173. package/src/capabilities/doctor/checks/checkPackageRefs.ts +69 -4
  174. package/src/capabilities/doctor/checks/checkShellCompletions.test.ts +6 -4
  175. package/src/capabilities/doctor/checks/checkShellCompletions.ts +8 -8
  176. package/src/capabilities/doctor/checks/harnessInventory.test.ts +219 -0
  177. package/src/capabilities/doctor/checks/harnessInventory.ts +298 -0
  178. package/src/capabilities/doctor/checks/index.ts +6 -6
  179. package/src/capabilities/doctor/checks/isSupportedNodeVersion.test.ts +111 -0
  180. package/src/capabilities/doctor/checks/isSupportedNodeVersion.ts +34 -0
  181. package/src/capabilities/doctor/checks/mcpCommand.test.ts +7 -1
  182. package/src/capabilities/doctor/checks/targetHealth.ts +229 -59
  183. package/src/capabilities/doctor/doctor.render.test.ts +108 -32
  184. package/src/capabilities/doctor/doctor.render.ts +56 -80
  185. package/src/capabilities/doctor/doctor.test.ts +247 -35
  186. package/src/capabilities/doctor/doctor.verb.ts +7 -2
  187. package/src/capabilities/doctor/runChecks.ts +14 -11
  188. package/src/capabilities/doctor/types.ts +15 -24
  189. package/src/capabilities/emptyRecovery.test.ts +10 -2
  190. package/src/capabilities/graph/query.render.ts +2 -2
  191. package/src/capabilities/info/collectInfo.ts +8 -1
  192. package/src/capabilities/info/info.render.ts +6 -2
  193. package/src/capabilities/info/info.test.ts +37 -1
  194. package/src/capabilities/info/types.ts +10 -2
  195. package/src/capabilities/lazy.test.ts +26 -2
  196. package/src/capabilities/listLookup.shipped.exec.test.ts +340 -0
  197. package/src/capabilities/prompt/prompt.render.ts +2 -2
  198. package/src/capabilities/renderVocabularySync.test.ts +82 -0
  199. package/src/capabilities/resources/resources.test.ts +38 -2
  200. package/src/capabilities/scopeTypeSync.test.ts +29 -15
  201. package/src/capabilities/setup/buildPlan.ts +45 -41
  202. package/src/capabilities/setup/index.ts +1 -1
  203. package/src/capabilities/setup/mode.ts +2 -2
  204. package/src/capabilities/setup/operations/index.ts +6 -1
  205. package/src/capabilities/setup/operations/setupCompletions.ts +9 -2
  206. package/src/capabilities/setup/operations/setupConfig.ts +7 -2
  207. package/src/capabilities/setup/operations/setupGenerator.ts +227 -84
  208. package/src/capabilities/setup/operations/setupLsp.ts +203 -38
  209. package/src/capabilities/setup/operations/setupMcp.ts +139 -62
  210. package/src/capabilities/setup/operations/setupSkills.ts +399 -60
  211. package/src/capabilities/setup/plan.render.ts +171 -76
  212. package/src/capabilities/setup/plan.ts +17 -12
  213. package/src/capabilities/setup/setup.mcp.correctness.test.ts +9 -9
  214. package/src/capabilities/setup/setup.render.test.ts +50 -36
  215. package/src/capabilities/setup/setup.render.ts +1 -1
  216. package/src/capabilities/setup/setup.test.ts +1126 -50
  217. package/src/capabilities/setup/setup.verb.ts +174 -68
  218. package/src/capabilities/setup/targets.ts +138 -60
  219. package/src/capabilities/setup/types.ts +10 -18
  220. package/src/capabilities/shared/index.ts +18 -6
  221. package/src/capabilities/shared/packageManager.test.ts +421 -6
  222. package/src/capabilities/shared/packageManager.ts +394 -59
  223. package/src/capabilities/skill/bundledSkills.test.ts +347 -0
  224. package/src/capabilities/skill/discover.ts +100 -11
  225. package/src/capabilities/skill/render.ts +2 -2
  226. package/src/capabilities/skill/skill.test.ts +17 -4
  227. package/src/capabilities/sources/installSkills.ts +181 -3
  228. package/src/capabilities/sources/runUpdate.ts +78 -2
  229. package/src/capabilities/sources/sources.test.ts +228 -0
  230. package/src/capabilities/sources/update.verb.ts +3 -3
  231. package/src/capabilities/surface.test.ts +14 -6
  232. package/src/capabilities/upgrade/runUpgrade.ts +45 -6
  233. package/src/capabilities/upgrade/types.ts +10 -2
  234. package/src/capabilities/upgrade/upgrade.render.ts +9 -2
  235. package/src/capabilities/upgrade/upgrade.test.ts +72 -0
  236. package/src/constants.ts +14 -1
  237. package/src/identity.test.ts +18 -5
  238. package/src/kernel/completion/entitySource.test.ts +15 -2
  239. package/src/kernel/completion/safety.test.ts +16 -9
  240. package/src/kernel/config/defaults.test.ts +19 -3
  241. package/src/kernel/config/readConfig.test.ts +1 -1
  242. package/src/kernel/index.ts +11 -2
  243. package/src/kernel/interactivity.test.ts +76 -0
  244. package/src/kernel/interactivity.ts +69 -0
  245. package/src/kernel/packs/compile.test.ts +92 -0
  246. package/src/kernel/packs/renderPack.ts +3 -3
  247. package/src/kernel/packs/resolveEntity.test.ts +75 -14
  248. package/src/kernel/packs/resolveEntity.ts +88 -24
  249. package/src/kernel/packs/runBodies.ts +84 -19
  250. package/src/kernel/packs/schema.ts +60 -4
  251. package/src/kernel/packs/sparql/applyFilters.ts +125 -4
  252. package/src/kernel/packs/sparql/buildLookupQuery.test.ts +290 -0
  253. package/src/kernel/packs/sparql/buildLookupQuery.ts +327 -45
  254. package/src/kernel/packs/toolDescription.test.ts +35 -1
  255. package/src/kernel/packs/types.ts +125 -2
  256. package/src/kernel/project/cli/buildProgram.test.ts +73 -2
  257. package/src/kernel/project/cli/buildProgram.ts +8 -1
  258. package/src/kernel/project/cli/dispatch.test.ts +5 -4
  259. package/src/kernel/project/cli/dispatch.ts +48 -25
  260. package/src/kernel/project/cli/globalFlags.ts +4 -1
  261. package/src/kernel/project/cli/helpFormat.ts +1 -2
  262. package/src/kernel/project/cli/rootHelp.ts +44 -8
  263. package/src/kernel/project/mcp/registerVerb.ts +20 -1
  264. package/src/kernel/render/prefixes.test.ts +2 -0
  265. package/src/kernel/render/renderers.ts +1 -1
  266. package/src/kernel/render/style.ts +32 -9
  267. package/src/kernel/render/vocabulary.ts +276 -0
  268. package/src/kernel/runtime/graphpack/embedded/pack.generated.ts +2 -3
  269. package/src/kernel/runtime/graphpack/embedded/pack.index.generated.ts +1 -1
  270. package/src/kernel/runtime/graphpack/embedded/pack.manifest.generated.ts +3 -0
  271. package/src/kernel/runtime/graphpack/embedded.ts +14 -6
  272. package/src/kernel/runtime/graphpack/graphpack.test.ts +31 -5
  273. package/src/kernel/runtime/graphpack/read.ts +14 -12
  274. package/src/kernel/runtime/loadSession.ts +3 -1
  275. package/src/kernel/runtime/probe.ts +1 -1
  276. package/src/kernel/runtime/refs/parseRef.test.ts +49 -1
  277. package/src/kernel/runtime/refs/parseRef.ts +25 -1
  278. package/src/kernel/runtime/refs/resolve.ts +9 -3
  279. package/src/kernel/runtime/types.ts +17 -0
  280. package/src/kernel/spec/emitReference.ts +1 -1
  281. package/src/kernel/spec/types.ts +35 -6
  282. package/src/testing/PARITY_GAPS.ts +9 -3
  283. package/src/testing/behavioral/docExamples.test.ts +4 -2
  284. package/src/testing/behavioral/errorMatrix.mcp.test.ts +110 -7
  285. package/src/testing/behavioral/journeys.firstInstall.test.ts +7 -2
  286. package/src/testing/behavioral/journeys.packageStories.test.ts +6 -3
  287. package/src/testing/eval/__snapshots__/eval.test.ts.snap +26 -1
  288. package/src/testing/eval/cases/readNouns.ts +245 -9
  289. package/src/testing/fixtures/blockGraph.ts +28 -13
  290. package/src/testing/fixtures/graph/canonical.ts +95 -12
  291. package/src/testing/helpers/runCli.test.ts +44 -0
  292. package/src/testing/helpers/runCli.ts +27 -3
  293. package/dist/src/capabilities/shared/bands.js +0 -16
  294. package/dist/src/capabilities/shared/bands.js.map +0 -1
  295. package/src/capabilities/shared/bands.ts +0 -16
@@ -8,17 +8,44 @@
8
8
  * the input is a free term matched the same way. A row lacking the variable never
9
9
  * matches. Several filters combine conjunctively; several values for one
10
10
  * filter (a repeated flag) combine as a union.
11
+ *
12
+ * A filter declaring `match: "set"` reads its cell as a space-separated SET and
13
+ * matches any member — the shape a query produces for a dimension a row belongs
14
+ * to several values of at once (a category and its ancestors, say). The
15
+ * comparison is otherwise identical, so exactly one code path decides what a
16
+ * match is.
17
+ *
18
+ * A value-free filter still REJECTS a value the data does not carry, with the
19
+ * admissible values as `validOptions` — the same courtesy a declared-`values`
20
+ * filter has always extended, without copying the vocabulary into the consumer.
21
+ * The vocabulary is read from the graph, because the graph IS the vocabulary; a
22
+ * story that hard-coded the slugs would go stale the first time the data grew a
23
+ * category. Before this, a typo'd `--category` returned
24
+ * `{"ok":true,"data":[],"meta":{}}` — indistinguishable, over MCP, from a
25
+ * genuinely empty category.
26
+ *
27
+ * WHICH part of the graph is the vocabulary matters, and it is NOT the rows.
28
+ * Rows are a population: a value can be perfectly real while no row carries it —
29
+ * `standard categories` lists a category with count 0, `ds:ConceptType` declares
30
+ * "Decision guide" before any concept uses it. Validating against rows called
31
+ * those `INVALID_INPUT`, when the documented answer is a calm empty list. So a
32
+ * filter DECLARES where its vocabulary lives ({@link PackFilter.vocabulary},
33
+ * resolved by the caller and handed in here), and the observed rows are the
34
+ * fallback for a filter that declares none — the only evidence there is, and
35
+ * knowingly narrower than the truth.
11
36
  */
12
37
  import { PragmaError } from "../../error/index.js";
13
38
  /**
14
39
  * @param rows - Rows produced by the pack's list query.
15
40
  * @param filters - Declared filters (absent means no filtering).
16
41
  * @param params - Story parameters as provided by the surface.
42
+ * @param vocabularies - Authoritative values per filter param, resolved from
43
+ * each filter's declared `vocabulary` (see {@link FilterVocabularies}).
17
44
  * @returns Rows matching every provided filter.
18
45
  * @throws PragmaError INVALID_INPUT when a value is not in a filter's declared
19
46
  * set, or when a value-free filter receives a non-string value.
20
47
  */
21
- export function applyPackFilters(rows, filters, params) {
48
+ export function applyPackFilters(rows, filters, params, vocabularies) {
22
49
  let result = rows;
23
50
  for (const filter of filters ?? []) {
24
51
  const provided = params[filter.param];
@@ -34,13 +61,85 @@ export function applyPackFilters(rows, filters, params) {
34
61
  const terms = occurrences.map((occurrence) => values === undefined
35
62
  ? requireStringValue(occurrence, filter).toLowerCase()
36
63
  : canonicalizeFilterValue(occurrence, filter, values).toLowerCase());
37
- result = result.filter((row) => {
38
- const cell = row[filter.variable]?.normalize("NFC").toLowerCase();
39
- return cell !== undefined && terms.includes(cell);
40
- });
64
+ // The fallback vocabulary is read from the UNFILTERED rows: a value that
65
+ // exists but is excluded by a conjunction is a legitimately empty answer,
66
+ // not a bad argument.
67
+ if (values === undefined)
68
+ rejectUnknownValue(vocabularies?.get(filter.param) ?? observedValues(rows, filter), filter, occurrences, terms);
69
+ result = result.filter((row) => cellValues(row, filter).some((value) => terms.includes(value.toLowerCase())));
41
70
  }
42
71
  return result;
43
72
  }
73
+ /**
74
+ * The values the rows themselves carry — the fallback vocabulary for a filter
75
+ * that declares no authoritative one, in the data's own DISPLAY spelling.
76
+ */
77
+ function observedValues(rows, filter) {
78
+ const observed = new Map();
79
+ for (const row of rows) {
80
+ for (const value of cellValues(row, filter)) {
81
+ const key = value.toLowerCase();
82
+ if (!observed.has(key))
83
+ observed.set(key, value);
84
+ }
85
+ }
86
+ return [...observed.values()];
87
+ }
88
+ /**
89
+ * Reject a value-free filter value the vocabulary does not admit, naming the
90
+ * ones it does.
91
+ *
92
+ * Silent when the vocabulary is EMPTY: an unbuilt or genuinely-empty store is
93
+ * not the caller's mistake, and the list's own `emptyRecovery` is the right
94
+ * voice for it.
95
+ *
96
+ * A value the vocabulary admits is never rejected here even when no row carries
97
+ * it — a real slug with zero standards is a calm empty list, which is what the
98
+ * tool descriptions document and what `standard categories` reporting count 0
99
+ * promises.
100
+ *
101
+ * @throws PragmaError INVALID_INPUT when a term matches none of the admissible
102
+ * values, carrying them as `validOptions`.
103
+ */
104
+ function rejectUnknownValue(vocabulary, filter, occurrences, terms) {
105
+ const admissible = new Map();
106
+ for (const value of vocabulary) {
107
+ const key = value.normalize("NFC").toLowerCase();
108
+ if (!admissible.has(key))
109
+ admissible.set(key, value.normalize("NFC"));
110
+ }
111
+ if (admissible.size === 0)
112
+ return;
113
+ const index = terms.findIndex((term) => !admissible.has(term));
114
+ if (index === -1)
115
+ return;
116
+ const validOptions = [...admissible.values()].sort();
117
+ throw PragmaError.invalidInput(filter.param, String(occurrences[index]), {
118
+ validOptions,
119
+ recovery: {
120
+ message: `Values allowed for --${filter.param}: ${validOptions.join(", ")}.`,
121
+ },
122
+ });
123
+ }
124
+ /**
125
+ * The values a row offers for one filter, in their DISPLAY spelling (NFC).
126
+ *
127
+ * One value for an ordinary filter; every space-separated member for a `"set"`
128
+ * one. A row lacking the variable offers none, so it never matches. Kept in the
129
+ * data's own casing because these are also what an INVALID_INPUT lists back as
130
+ * `validOptions` — lowercasing here would hand the caller a value the graph does
131
+ * not spell that way. Comparison lowercases at the point of comparison instead.
132
+ */
133
+ function cellValues(row, filter) {
134
+ const cell = row[filter.variable];
135
+ if (cell === undefined)
136
+ return [];
137
+ const normalized = cell.normalize("NFC");
138
+ if (filter.match !== "set") {
139
+ return normalized === "" ? [] : [normalized];
140
+ }
141
+ return normalized.split(/\s+/).filter((value) => value !== "");
142
+ }
44
143
  /** @throws PragmaError INVALID_INPUT when a value-free filter value is not a string. */
45
144
  function requireStringValue(provided, filter) {
46
145
  if (typeof provided !== "string") {
@@ -1 +1 @@
1
- {"version":3,"file":"applyFilters.js","sourceRoot":"","sources":["../../../../../src/kernel/packs/sparql/applyFilters.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGnD;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAC9B,IAAe,EACf,OAA0C,EAC1C,MAA+B;IAE/B,IAAI,MAAM,GAAG,IAAI,CAAC;IAClB,KAAK,MAAM,MAAM,IAAI,OAAO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CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AAC1C,CAAC;AAED,mFAAmF;AACnF,SAAS,uBAAuB,CAC9B,QAAiB,EACjB,MAAkB,EAClB,MAAyB;IAEzB,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;QACjC,MAAM,UAAU,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QACpD,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CACvB,CAAC,KAAK,EAAE,EAAE,CACR,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,KAAK,UAAU,CAAC,WAAW,EAAE,CACpE,CAAC;QACF,IAAI,KAAK,KAAK,SAAS;YAAE,OAAO,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IACzD,CAAC;IACD,MAAM,WAAW,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,EAAE;QAC7D,YAAY,EAAE,CAAC,GAAG,MAAM,CAAC;QACzB,QAAQ,EAAE;YACR,OAAO,EAAE,wBAAwB,MAAM,CAAC,KAAK,KAAK,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG;SACvE;KACF,CAAC,CAAC;AACL,CAAC"}
@@ -5,15 +5,47 @@
5
5
  * and which properties to read; the query text is generated here so
6
6
  * user-supplied names are always escaped SPARQL string literals, and level-gated
7
7
  * fields below the active level are excluded from the projection (fetch-gating).
8
- * Matching on the `by` property is exact and case-insensitive.
8
+ * Matching on the name is exact and case-insensitive.
9
9
  *
10
- * Every name-addressed resolve is TOTALLY ORDERED before its `LIMIT 1`. A name
11
- * can recur across tiers, and an unordered `LIMIT 1` hands the tie to the
12
- * store's enumeration order — a different answer on a different machine, or
13
- * after a repack. `ORDER BY STR(?uri)` is a total, engine-independent order over
14
- * a variable that is always bound (`?uri` carries the `by` triple), so it needs
15
- * no unbound-value sentinel. It fixes WHICH answer is arbitrary, not WHETHER:
16
- * declaring a precedence between tiers is an ontology change, tracked separately.
10
+ * WHAT an entity's name IS lives in one place — {@link nameBinding} — and every
11
+ * form here uses it: the asserted `by` value, plus, for a lookup that DECLARES
12
+ * `nameFallback: "iri"`, the IRI-derived name its class constraint can vouch
13
+ * for. That single binding is what makes the population a `list` publishes and
14
+ * the population a `lookup` answers to the same population.
15
+ *
16
+ * A name-addressed resolve RANKS, and returns every row it ranked. A name can
17
+ * reach several entities (25 of the live design system's block names do), and
18
+ * the `LIMIT 1` that used to sit under the ordering discarded all but the first
19
+ * inside the STORE, where nothing downstream could see that it had happened —
20
+ * `block lookup button` answered with Launchpad's Button and gave no sign the
21
+ * global one existed, because `apps_launchpad…` sorts before `global…`.
22
+ *
23
+ * The limit is gone from the NAME forms so the resolver can see what it is
24
+ * choosing between. It still answers with one entity — the arity is the tool's
25
+ * contract — but the rows it did not take become the IRIs of its notice, which
26
+ * is the only address that reaches them. (An IRI-addressed form keeps its
27
+ * `LIMIT 1`: an IRI is one entity by construction, so there is nothing to rank
28
+ * and nothing set aside.)
29
+ *
30
+ * The losers are NOT free, and an earlier draft of this comment claimed they
31
+ * were. `lookupProjection`'s optionals sit in the same SELECT as the ranking, so
32
+ * every matching URI has its declared fields projected, and a multi-valued field
33
+ * multiplies rows per entity before `firstRowPerEntity` throws them away. On the
34
+ * live graph that is small — 25 shared names, two entities each — but it is a
35
+ * product, not a constant, and the honest shape is a two-phase resolve: rank the
36
+ * URIs in a minimal SELECT, then project fields for the ones actually answered
37
+ * with. That restructure is deliberately not done here: it is the same query the
38
+ * pending no-limit change would rewrite again, and doing it twice would land two
39
+ * migrations on one seam.
40
+ *
41
+ * The order is {@link rankingClause}'s `?score`, then `STR(?uri)`. The score
42
+ * multiplies the two things a pack may declare about which entity a bare name
43
+ * MEANS — `weights` (which KIND of thing) and `scopeWeight` (WHOSE) — and a
44
+ * story that declares neither falls through to `STR(?uri)` alone, a total,
45
+ * engine-independent order over a variable that is always bound (`?uri` carries
46
+ * the class constraint, or the `by` triple when the name is not derived), so it
47
+ * needs no unbound-value sentinel. That final key is what makes the ranking a
48
+ * TOTAL order rather than a better arbitrary one.
17
49
  */
18
50
  import { activeExpands, activeFields } from "../disclosure.js";
19
51
  import { escapeSparqlString, formatTerm } from "./escape.js";
@@ -39,6 +71,10 @@ function buildTypeConstraint(lookup) {
39
71
  * differ ONLY in how `?uri` is bound (a `FILTER` on the escaped name vs a `BIND`
40
72
  * of the resolved IRI), so both thread the active level through here and gate
41
73
  * identically — an IRI-addressed lookup honours `--detail` just like a name one.
74
+ *
75
+ * `constraint` and `optionals` are handed back SEPARATELY because the `?name`
76
+ * binding has to sit between them: it reads `?uri`, which the class constraint
77
+ * binds, and a SPARQL `BIND` may only name variables already in scope.
42
78
  */
43
79
  function lookupProjection(lookup, level) {
44
80
  const fields = activeFields(lookup, level);
@@ -48,49 +84,268 @@ function lookupProjection(lookup, level) {
48
84
  .join("\n");
49
85
  return {
50
86
  header: `SELECT ?uri ?name${vars.length > 0 ? ` ${vars}` : ""} WHERE {`,
51
- body: buildTypeConstraint(lookup) + optionals,
87
+ constraint: buildTypeConstraint(lookup).trimEnd(),
88
+ optionals,
89
+ };
90
+ }
91
+ /**
92
+ * The IRI-derived display name, in ONE spelling every relaxed form shares.
93
+ *
94
+ * The local name is everything after the last `#` or `/`, and its dot-separated
95
+ * hierarchy segments are published with slashes — `cs:react.component.props` →
96
+ * `react/component/props`. That is not an invention here: it is the derivation
97
+ * the `standard` list story already performs to PUBLISH a row's name, so this is
98
+ * the same rule read from the other side. Written once, so the name a list hands
99
+ * out and the name a lookup answers to cannot drift apart.
100
+ */
101
+ const DERIVED_NAME = 'REPLACE(REPLACE(STR(?uri), "^.*[#/]", ""), "\\\\.", "/")';
102
+ /**
103
+ * The `?name` binding shared by every lookup form.
104
+ *
105
+ * By DEFAULT the `by` triple is required, and that is the honest default: `by`
106
+ * is documented as "the property whose value names the entity", so an entity
107
+ * without one has no name, is not addressable, and is not drawn by `sample`.
108
+ * It is also the one thing standing between a typo'd IRI and an empty entity.
109
+ *
110
+ * A story whose `list` SYNTHESIZES a name instead of reading one declares
111
+ * `nameFallback: "iri"`, and then the triple becomes OPTIONAL with
112
+ * {@link DERIVED_NAME} behind it. `standard` is the case that exists. When the
113
+ * defect was measured, 22 of the then-156 live code standards carried a
114
+ * `cs:name`, and the code-standards ontology said so deliberately — "an
115
+ * optional human-readable display title" that "never participates in
116
+ * identity". `standard list` published `react/component/tsdoc` while
117
+ * `standard lookup react/component/tsdoc` answered ENTITY_NOT_FOUND with
118
+ * empty suggestions, because the only addressable population was the ~13%
119
+ * carrying an asserted name. (Upstream has since retired `cs:name` for
120
+ * `rdfs:label`, which every standard carries; the fallback stays because a
121
+ * pack is data, and a dropped label must degrade to the derived name rather
122
+ * than become unaddressable.)
123
+ *
124
+ * INFERRING the fallback from the mere PRESENCE of a class constraint is what
125
+ * this option replaced, and it was over-reach in both directions of the same
126
+ * defect: `token list` requires `ds:tokenId`, so an inferred fallback made a
127
+ * `ds:Token` without one addressable and sampleable under a name `token list`
128
+ * never publishes. The declaration is per story because the list/lookup
129
+ * agreement is per story.
130
+ *
131
+ * The class constraint is still required for the fallback (the schema rejects
132
+ * the pairing, and this guard keeps a statically-compiled story from generating
133
+ * a query with nothing bounding `?uri`): a derived name is only as trustworthy
134
+ * as the class vouching for the entity it came from.
135
+ *
136
+ * One binding then serves the name resolve, the miss-suggestion pool, glob
137
+ * expansion and `sample`'s draw pool alike — every form that decides WHICH
138
+ * entities a name can reach. (The IRI-addressed forms reach an entity without
139
+ * going through a name at all: see {@link iriNameBinding}.)
140
+ */
141
+ function nameBinding(lookup) {
142
+ if (!derivesNames(lookup))
143
+ return ` ?uri ${formatTerm(lookup.by)} ?name .`;
144
+ return [
145
+ ` OPTIONAL { ?uri ${formatTerm(lookup.by)} ?byName . }`,
146
+ ` BIND(COALESCE(?byName, ${DERIVED_NAME}) AS ?name)`,
147
+ ].join("\n");
148
+ }
149
+ /**
150
+ * Whether this lookup names an entity that carries no `by` value.
151
+ *
152
+ * The class constraint is part of the condition, not merely a schema rule the
153
+ * builders trust: without one there is no triple bounding `?uri`, so a derived
154
+ * name would be scanned over the whole graph. The schema rejects the pairing
155
+ * for declared packs; this keeps a statically-compiled story from generating
156
+ * that query.
157
+ */
158
+ function derivesNames(lookup) {
159
+ return (lookup.nameFallback === "iri" &&
160
+ Boolean(lookup.type ?? lookup.types?.length));
161
+ }
162
+ /**
163
+ * The `?name` binding for an IRI-ADDRESSED form.
164
+ *
165
+ * An IRI names the entity by itself, so here the `by` value is a LABEL to
166
+ * project, not the thing that identifies it — and the class constraint is
167
+ * already a sufficient existence check. So the triple is OPTIONAL wherever a
168
+ * class vouches for the entity, and `?name` is simply left unbound when there is
169
+ * no label; it is REQUIRED only for a lookup constraining no class, where it is
170
+ * the one thing standing between a typo'd IRI and an empty entity.
171
+ *
172
+ * A story that {@link derivesNames} gets the same COALESCE the name forms use,
173
+ * so an entity reached by IRI reports the name `list` published for it rather
174
+ * than a blank.
175
+ */
176
+ function iriNameBinding(lookup) {
177
+ if (derivesNames(lookup))
178
+ return nameBinding(lookup);
179
+ const named = `?uri ${formatTerm(lookup.by)} ?name .`;
180
+ const constrained = Boolean(lookup.type ?? lookup.types?.length);
181
+ return constrained ? ` OPTIONAL { ${named} }` : ` ${named}`;
182
+ }
183
+ /**
184
+ * Render a declared weight as a SPARQL numeric literal (never exponential).
185
+ *
186
+ * `toFixed` is the wrong instrument twice over, and both bite inside the 0–1
187
+ * range the schema allows. It ROUNDS — `0.1234567` became `0.123457`, silently
188
+ * altering a ranking a pack author declared — and stripping the trailing zeros
189
+ * off its output turns `0.0000001` into `0.`, which is not a numeric literal at
190
+ * all and makes the query a parse error rather than a wrong answer.
191
+ *
192
+ * `String` already prints the shortest exact round-trip, so it is the right
193
+ * source of digits; the only thing it does that SPARQL cannot read is
194
+ * exponent notation, which xsd:decimal's grammar has no form for. Expand that
195
+ * case and pass everything else through untouched.
196
+ */
197
+ function sparqlNumber(value) {
198
+ if (Number.isInteger(value))
199
+ return String(value);
200
+ const text = String(value);
201
+ const exponent = /e-(\d+)$/i.exec(text);
202
+ if (exponent === null)
203
+ return text;
204
+ // `1e-7` / `1.5e-7`: the decimal places needed are the exponent plus whatever
205
+ // the mantissa already carried, which is exact — no rounding can occur.
206
+ const mantissaPlaces = text.split("e")[0]?.split(".")[1]?.length ?? 0;
207
+ return value.toFixed(Number(exponent[1]) + mantissaPlaces);
208
+ }
209
+ /**
210
+ * `left * right`, guarded where an operand may be ZERO.
211
+ *
212
+ * Not defensiveness — a MEASURED engine defect, and the top scope hits it every
213
+ * time. oxigraph raises on an xsd:decimal times a zero (`0.2 * 0` errors, while
214
+ * `0.2 * 1` is `0.2`), and a raising expression inside a `BIND` leaves its
215
+ * variable unbound. Written the arithmetic way, the depth-0 scope — the one that
216
+ * is supposed to WIN — is the only one whose weight never binds, and what
217
+ * happens next is decided by whatever the surrounding `COALESCE` falls back to.
218
+ * The same expression on the `block list` side fell back to 0 and sorted every
219
+ * top-tier row LAST, which is how this was found. Both sides now say what they
220
+ * mean. Only VARIABLE operands are tested; a declared literal is resolved at
221
+ * build time by the callers.
222
+ */
223
+ function sparqlProduct(left, right) {
224
+ const guards = [left, right]
225
+ .filter((operand) => operand.startsWith("?"))
226
+ .map((operand) => `${operand} = 0`);
227
+ const product = `${left} * ${right}`;
228
+ return guards.length === 0
229
+ ? product
230
+ : `IF(${guards.join(" || ")}, 0, ${product})`;
231
+ }
232
+ /**
233
+ * The type factor: the LOWEST weight declared for any class the entity belongs
234
+ * to, 1 when none is.
235
+ *
236
+ * An IF-ladder over `EXISTS` rather than a weight column on the class VALUES,
237
+ * because a join would multiply rows for an entity in two weighted classes and
238
+ * the resolve now returns every row it finds. Lowest weight tested FIRST, so the
239
+ * ladder means MIN — the same rule the MCP listing's `effectiveWeight` states in
240
+ * prose: a demotion any membership asks for is not cancelled by a membership
241
+ * that asked for nothing.
242
+ */
243
+ function typeWeightBind(lookup) {
244
+ const declared = Object.entries(lookup.weights ?? {});
245
+ if (declared.length === 0)
246
+ return "";
247
+ const ladder = [...declared]
248
+ .sort(([aType, aWeight], [bType, bWeight]) => aWeight === bWeight ? aType.localeCompare(bType) : aWeight - bWeight)
249
+ .reduceRight((fallback, [type, weight]) => `IF(EXISTS { ?uri a ${formatTerm(type)} }, ${sparqlNumber(weight)}, ${fallback})`, "1");
250
+ return ` BIND(${ladder} AS ?rankType)`;
251
+ }
252
+ /**
253
+ * The scope factor: how much the entity's containing scope is worth, DERIVED
254
+ * from the depth of that scope's own path-shaped name.
255
+ *
256
+ * Nested OPTIONALs, not a flat sequence: `?rankScope` is unbound for an entity
257
+ * outside any scope, and a following top-level `OPTIONAL { ?rankScope <by> ?n }`
258
+ * would then match every such triple in the graph and multiply the row.
259
+ *
260
+ * The depth is the separator count, so nothing is enumerated and a scope the
261
+ * ontology adds tomorrow inherits its place. `COALESCE` states the retirement
262
+ * path in the query itself: an ASSERTED weight wins, the derived one answers
263
+ * until there is one, and an entity with no scope at all scores a neutral 1
264
+ * rather than dropping below entities that have one.
265
+ */
266
+ function scopeWeightBinds(lookup) {
267
+ const scope = lookup.scopeWeight;
268
+ if (!scope)
269
+ return "";
270
+ const name = "?rankScopeName";
271
+ const asserted = scope.asserted
272
+ ? [
273
+ ` OPTIONAL { ?rankScope ${formatTerm(scope.asserted)} ?rankAsserted . }`,
274
+ ]
275
+ : [];
276
+ // A falloff of 0 ranks every scope alike, so the derived weight is the
277
+ // constant — and the depth it would multiply is never computed.
278
+ const derived = scope.falloff === 0
279
+ ? "1"
280
+ : `1 - ${sparqlProduct(sparqlNumber(scope.falloff), "?rankDepth")}`;
281
+ return [
282
+ " OPTIONAL {",
283
+ ` ?uri ${formatTerm(scope.via)} ?rankScope .`,
284
+ ` OPTIONAL { ?rankScope ${formatTerm(scope.by)} ${name} . }`,
285
+ ...asserted,
286
+ " }",
287
+ ` BIND(STRLEN(${name}) - STRLEN(REPLACE(${name}, "/", "")) AS ?rankDepth)`,
288
+ ` BIND(${derived} AS ?rankDerived)`,
289
+ // Floored at 0: a scope deep enough to drive the factor negative would
290
+ // otherwise INVERT the type factor it multiplies, promoting a part of a
291
+ // block above a whole one.
292
+ ` BIND(COALESCE(${scope.asserted ? "?rankAsserted, " : ""}IF(?rankDerived < 0, 0, ?rankDerived), 1) AS ?rankScopeWeight)`,
293
+ ].join("\n");
294
+ }
295
+ /**
296
+ * The `?score` a name resolve orders by, and the ORDER BY that reads it.
297
+ *
298
+ * The two factors MULTIPLY rather than tiebreak, and that is the editorial
299
+ * ruling, not an implementation convenience: neither question subsumes the
300
+ * other. A whole component in a nested scope (1 × 0.8) outranks a mere PART of a
301
+ * block in the widest one (0.6 × 1), while two components of equal kind are
302
+ * separated by their scopes alone (1 × 1 beats 1 × 0.8). Both live cases fall
303
+ * out of one product.
304
+ *
305
+ * @returns The BIND lines to splice into the WHERE clause, and the ORDER BY
306
+ * line — a story declaring neither factor gets no BINDs and `STR(?uri)` alone.
307
+ */
308
+ function rankingClause(lookup) {
309
+ const factors = [typeWeightBind(lookup), scopeWeightBinds(lookup)].filter((line) => line !== "");
310
+ if (factors.length === 0)
311
+ return { binds: "", orderBy: "ORDER BY STR(?uri)" };
312
+ const terms = [
313
+ lookup.weights && Object.keys(lookup.weights).length > 0 ? "?rankType" : "",
314
+ lookup.scopeWeight ? "?rankScopeWeight" : "",
315
+ ].filter((term) => term !== "");
316
+ return {
317
+ binds: [
318
+ ...factors,
319
+ ` BIND(${terms.length === 2 ? sparqlProduct(terms[0], terms[1]) : terms.join("")} AS ?score)`,
320
+ ].join("\n"),
321
+ orderBy: "ORDER BY DESC(?score) STR(?uri)",
52
322
  };
53
323
  }
54
324
  /**
55
- * Build the SELECT retrieving one named entity with its declared fields.
325
+ * Build the SELECT retrieving the entities a name reaches, with their declared
326
+ * fields, best first. The caller answers with the first and names the rest.
56
327
  *
57
328
  * @param lookup - The pack's lookup declaration.
58
329
  * @param name - User-supplied entity name (escaped here).
59
330
  * @param level - Active canonical level; gated fields below it are excluded.
60
- * @returns SPARQL SELECT text.
331
+ * @returns SPARQL SELECT text, ranked and unlimited.
61
332
  */
62
333
  export function buildLookupQuery(lookup, name, level) {
63
- const { header, body } = lookupProjection(lookup, level);
334
+ const { header, constraint, optionals } = lookupProjection(lookup, level);
335
+ const ranking = rankingClause(lookup);
64
336
  return [
65
337
  header,
66
- ` ?uri ${formatTerm(lookup.by)} ?name .`,
67
- body,
338
+ constraint,
339
+ nameBinding(lookup),
340
+ ranking.binds,
341
+ optionals,
68
342
  ` FILTER (LCASE(STR(?name)) = LCASE("${escapeSparqlString(name)}"))`,
69
343
  "}",
70
- "ORDER BY STR(?uri)",
71
- "LIMIT 1",
344
+ ranking.orderBy,
72
345
  ]
73
346
  .filter((line) => line !== "")
74
347
  .join("\n");
75
348
  }
76
- /**
77
- * The `?name` clause for an IRI-addressed form.
78
- *
79
- * An IRI names the entity by itself, so the `by` value is a LABEL to project,
80
- * not the thing that identifies it — and a class constraint is already a
81
- * sufficient existence check. Requiring the `by` triple here made every entity
82
- * that carries no name unaddressable by any means at all: 131 of the 144 live
83
- * code standards have no `cs:name` (their displayed name is synthesized from the
84
- * IRI by the list story), and shell completion offers their IRIs. So the triple
85
- * is OPTIONAL wherever a class constraint can vouch for the entity, and
86
- * REQUIRED only for a lookup that declares no `type`/`types` — where it is the
87
- * one thing standing between a typo'd IRI and an empty entity.
88
- */
89
- function iriNameClause(lookup) {
90
- const named = `?uri ${formatTerm(lookup.by)} ?name .`;
91
- const constrained = Boolean(lookup.type ?? lookup.types?.length);
92
- return constrained ? ` OPTIONAL { ${named} }` : ` ${named}`;
93
- }
94
349
  /**
95
350
  * Build the SELECT retrieving one entity addressed directly by IRI.
96
351
  *
@@ -105,12 +360,13 @@ function iriNameClause(lookup) {
105
360
  * @param level - Active canonical level; gated fields below it are excluded.
106
361
  */
107
362
  export function buildLookupByIriQuery(lookup, iri, level) {
108
- const { header, body } = lookupProjection(lookup, level);
363
+ const { header, constraint, optionals } = lookupProjection(lookup, level);
109
364
  return [
110
365
  header,
111
366
  ` BIND(<${iri}> AS ?uri)`,
112
- iriNameClause(lookup),
113
- body,
367
+ constraint,
368
+ iriNameBinding(lookup),
369
+ optionals,
114
370
  "}",
115
371
  "LIMIT 1",
116
372
  ]
@@ -120,18 +376,25 @@ export function buildLookupByIriQuery(lookup, iri, level) {
120
376
  /**
121
377
  * Build the minimal name→URI resolve for a graphql-sourced lookup (and the
122
378
  * shared entry point for the sparql path's name form): maps the user-supplied
123
- * name to the entity IRI, everything else comes from the field fetch. The name
379
+ * name to the entity IRIs, everything else comes from the field fetch. The name
124
380
  * is an escaped literal; all terms are validated pack terms.
381
+ *
382
+ * Ranked and unlimited, exactly like {@link buildLookupQuery} — the two paths
383
+ * differ in where the VALUES come from, never in which entities a name reaches.
384
+ * `?score` is deliberately NOT projected: it orders the rows and is none of the
385
+ * caller's business, and projecting it would leak a ranking artefact into
386
+ * `--format json`.
125
387
  */
126
388
  export function buildNameResolveQuery(lookup, name) {
389
+ const ranking = rankingClause(lookup);
127
390
  return [
128
391
  "SELECT ?uri ?name WHERE {",
129
- ` ?uri ${formatTerm(lookup.by)} ?name .`,
130
392
  buildTypeConstraint(lookup).trimEnd(),
393
+ nameBinding(lookup),
394
+ ranking.binds,
131
395
  ` FILTER (LCASE(STR(?name)) = LCASE("${escapeSparqlString(name)}"))`,
132
396
  "}",
133
- "ORDER BY STR(?uri)",
134
- "LIMIT 1",
397
+ ranking.orderBy,
135
398
  ]
136
399
  .filter((line) => line !== "")
137
400
  .join("\n");
@@ -149,8 +412,8 @@ export function buildIriResolveQuery(lookup, iri) {
149
412
  return [
150
413
  "SELECT ?uri ?name WHERE {",
151
414
  ` BIND(<${iri}> AS ?uri)`,
152
- iriNameClause(lookup),
153
415
  buildTypeConstraint(lookup).trimEnd(),
416
+ iriNameBinding(lookup),
154
417
  "}",
155
418
  "LIMIT 1",
156
419
  ]
@@ -205,8 +468,12 @@ export function buildLookupNamesQuery(lookup) {
205
468
  // `block lookup 'Butt*'` listed one Button twice while the other Button
206
469
  // never appeared at all.
207
470
  "SELECT DISTINCT ?name WHERE {",
208
- ` ?uri ${formatTerm(lookup.by)} ?name .`,
209
471
  buildTypeConstraint(lookup).trimEnd(),
472
+ // Same {@link nameBinding} the resolves use, so the addressable population
473
+ // and the resolvable population are the same population. When they were
474
+ // not, a name a miss-suggestion offered could itself miss, and a glob
475
+ // expanded over a pool the resolve could not answer from.
476
+ nameBinding(lookup),
210
477
  "}",
211
478
  ]
212
479
  .filter((line) => line !== "")
@@ -1 +1 @@
1
- {"version":3,"file":"buildLookupQuery.js","sourceRoot":"","sources":["../../../../../src/kernel/packs/sparql/buildLookupQuery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAE/D,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE7D;;;;GAIG;AACH,SAAS,mBAAmB,CAAC,MAAkB;IAC7C,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;QAChB,OAAO,YAAY,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;IACnD,CAAC;IACD,IAAI,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC5C,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACtD,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;IACpE,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,gBAAgB,CACvB,MAAkB,EAClB,KAAyB;IAEzB,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC3C,MAAM,IAAI,GAAG,MAAM,CAAC,G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,IAAI,CAAC,CAAC;AACf,CAAC;AAED,2EAA2E;AAC3E,MAAM,UAAU,qBAAqB,CAAC,MAAkB;IACtD,OAAO;QACL,2EAA2E;QAC3E,4EAA4E;QAC5E,yEAAyE;QACzE,mEAAmE;QACnE,wEAAwE;QACxE,yBAAyB;QACzB,+BAA+B;QAC/B,mBAAmB,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE;QACrC,2EAA2E;QAC3E,wEAAwE;QACxE,sEAAsE;QACtE,0DAA0D;QAC1D,WAAW,CAAC,MAAM,CAAC;QACnB,GAAG;KACJ;SACE,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,EAAE,CAAC;SAC7B,IAAI,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC;AAGD,gFAAgF;AAChF,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/kernel/packs/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAqEH,4EAA4E;AAC5E,MAAM,UAAU,cAAc,CAC5B,KAAuB;IAEvB,OAAO,UAAU,IAAI,KAAK,CAAC;AAC7B,CAAC;AA+RD,+EAA+E;AAC/E,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,KAAa,EAAe,EAAE,CAAC,CAAC;IACjE,KAAK;IACL,MAAM,EAAE,cAAc;CACvB,CAAC,CAAC"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/kernel/packs/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAqEH,4EAA4E;AAC5E,MAAM,UAAU,cAAc,CAC5B,KAAuB;IAEvB,OAAO,UAAU,IAAI,KAAK,CAAC;AAC7B,CAAC;AA0ZD,+EAA+E;AAC/E,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,KAAa,EAAe,EAAE,CAAC,CAAC;IACjE,KAAK;IACL,MAAM,EAAE,cAAc;CACvB,CAAC,CAAC"}
@@ -225,7 +225,7 @@ export function buildProgram(verbs, options) {
225
225
  program.helpOption("--help", "Show help (works on any command)");
226
226
  program.enablePositionalOptions();
227
227
  program.exitOverride();
228
- useDesignedHelp(program, () => formatRootHelp(programName, description, live, version, issuesUrl));
228
+ useDesignedHelp(program, () => formatRootHelp(programName, description, live, version, issuesUrl, options.globalFlags));
229
229
  const groups = new Map();
230
230
  for (const verb of live) {
231
231
  const noun = verb.path[0];