pi-apexlang 0.2.2 → 0.4.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 (239) hide show
  1. package/README.md +22 -5
  2. package/THIRD_PARTY_NOTICES.md +2 -2
  3. package/UPSTREAM.json +2 -2
  4. package/docs/assets/overview.en.png +0 -0
  5. package/docs/assets/overview.en.svg +89 -0
  6. package/docs/assets/overview.uk.png +0 -0
  7. package/docs/assets/overview.uk.svg +89 -0
  8. package/docs/en/README.md +41 -0
  9. package/docs/en/architecture.md +73 -0
  10. package/docs/en/getting-started.md +77 -0
  11. package/docs/en/maintenance.md +83 -0
  12. package/docs/en/tool-reference.md +85 -0
  13. package/docs/uk/README.md +41 -0
  14. package/docs/uk/architecture.md +73 -0
  15. package/docs/uk/getting-started.md +77 -0
  16. package/docs/uk/maintenance.md +83 -0
  17. package/docs/uk/tool-reference.md +85 -0
  18. package/extensions/apexlang/index.ts +19 -10
  19. package/extensions/lib/apexlang-cli.d.mts +1 -2
  20. package/extensions/lib/apexlang-cli.mjs +18 -13
  21. package/extensions/lib/apexlang-local-validate.mjs +83 -0
  22. package/extensions/lib/apexlang-local-validator.py +116 -0
  23. package/extensions/lib/apexlang-runtime-validate.mjs +76 -0
  24. package/package.json +2 -1
  25. package/skills/apexlang/APEXlang Skills and Workflows.md +325 -0
  26. package/skills/apexlang/README.md +6 -6
  27. package/skills/apexlang/RELEASE-NOTES.md +2 -2
  28. package/skills/apexlang/SKILL.md +24 -19
  29. package/skills/apexlang/agents/openai.yaml +4 -3
  30. package/skills/apexlang/assets/apex-generation/components.registry.json +1001 -16
  31. package/skills/apexlang/assets/apexlang/domains-catalog.json +6 -1
  32. package/skills/apexlang/assets/component-attributes.json +1924 -180
  33. package/skills/apexlang/assets/component-policies.json +19 -10
  34. package/skills/apexlang/assets/contracts/grammar-semantic-rules.json +134 -0
  35. package/skills/apexlang/assets/contracts/package-layers.json +56 -0
  36. package/skills/apexlang/assets/contracts/page-construction-packs.json +154 -0
  37. package/skills/apexlang/assets/contracts/page-patterns.json +119 -0
  38. package/skills/apexlang/assets/grammar/apexlang.ebnf +11743 -0
  39. package/skills/apexlang/assets/indexes/font-apex-icon-index.json +1699 -0
  40. package/skills/apexlang/assets/routing-catalog-main.json +11 -10
  41. package/skills/apexlang/assets/routing-load-policy.json +35 -9
  42. package/skills/apexlang/assets/rules-mapping.json +110 -2
  43. package/skills/apexlang/assets/rules.catalog.json +1298 -0
  44. package/skills/apexlang/assets/validator-fix-recipes.json +372 -17
  45. package/skills/apexlang/assets/workspace-intelligence.json +7 -10
  46. package/skills/apexlang/manifest.json +268 -12
  47. package/skills/apexlang/references/domains/README.md +1 -1
  48. package/skills/apexlang/references/domains/page-components/buttons.md +2 -2
  49. package/skills/apexlang/references/domains/page-components/page-items.md +3 -3
  50. package/skills/apexlang/references/domains/page-components/regions/region-display-selector/workflow-region-display-selector.md +69 -0
  51. package/skills/apexlang/references/domains/page-components/regions.md +1 -0
  52. package/skills/apexlang/references/domains/template-components/comments.md +61 -0
  53. package/skills/apexlang/references/domains/template-components/registry.md +2 -0
  54. package/skills/apexlang/references/domains/template-components/templates.md +47 -0
  55. package/skills/apexlang/references/domains/template-components/timeline.md +51 -0
  56. package/skills/apexlang/references/ops/one-message-router-contract.md +2 -2
  57. package/skills/apexlang/references/ops/runtime-gates/01-direct-sqlcl-import.md +1 -1
  58. package/skills/apexlang/references/ops/runtime-gates/02-direct-sqlcl-validate-gate.md +1 -1
  59. package/skills/apexlang/references/ops/runtime-gates.md +17 -16
  60. package/skills/apexlang/references/ops/sqlcl-agents/00-connection-gate.md +7 -7
  61. package/skills/apexlang/references/ops/sqlcl.md +7 -8
  62. package/skills/apexlang/references/policies/compiler-prop-map.md +6 -4
  63. package/skills/apexlang/references/policies/governance/00-governance.md +2 -2
  64. package/skills/apexlang/references/policies/memory-bank/00-guard/ai.guard.md +126 -922
  65. package/skills/apexlang/references/policies/memory-bank/20-data/apex.logic.md +3 -3
  66. package/skills/apexlang/references/policies/memory-bank/20-data/db.connection.md +9 -11
  67. package/skills/apexlang/references/policies/memory-bank/30-pages/apex.cards-page.md +95 -0
  68. package/skills/apexlang/references/policies/memory-bank/30-pages/apex.page.md +2 -2
  69. package/skills/apexlang/references/policies/memory-bank/30-pages/apex.smart-filter-search.md +145 -74
  70. package/skills/apexlang/references/policies/memory-bank/40-components/apex.region-interactions.md +9 -2
  71. package/skills/apexlang/references/policies/memory-bank/40-components/apex.region-media.md +6 -5
  72. package/skills/apexlang/references/policies/memory-bank/systemPatterns.md +9 -1
  73. package/skills/apexlang/references/workflows/apex-generation/agents/20-agent-draft.md +51 -232
  74. package/skills/apexlang/references/workflows/apex-generation/agents/30-agent-critique.md +49 -449
  75. package/skills/apexlang/references/workflows/apex-generation/agents/40-agent-revision.md +38 -238
  76. package/skills/apexlang/references/workflows/apex-generation/nlu/nlu-routing-test-matrix.md +8 -2
  77. package/skills/apexlang/references/workflows/apex-generation/nlu/nlu-routing-validation-notes.md +19 -3
  78. package/skills/apexlang/references/workflows/apex-generation/registry.md +15 -1
  79. package/skills/apexlang/references/workflows/apex-generation/templates.md +1 -1
  80. package/skills/apexlang/references/workflows/apex-generation.md +1 -1
  81. package/skills/apexlang/references/workflows/apexlang/apexlang-execution-model.md +5 -5
  82. package/skills/apexlang/references/workflows/apexlang/prompt-contracts.md +81 -10
  83. package/skills/apexlang/references/workflows/apexlang/workflow-create-app-from-fr-and-model.md +18 -7
  84. package/skills/apexlang/release-notes.json +156 -0
  85. package/skills/apexlang/runtime/grammar_contract.mjs +1166 -0
  86. package/skills/apexlang/runtime/internal/python/format_apexlang.py +210 -0
  87. package/skills/apexlang/runtime/internal/python/validate_apexlang.py +14142 -5843
  88. package/skills/apexlang/runtime/internal/python/validator_common.py +2 -0
  89. package/skills/apexlang/runtime/lib/catalogs.mjs +1026 -0
  90. package/skills/apexlang/runtime/lib/common.mjs +35 -0
  91. package/skills/apexlang/runtime/runtime.bundle.mjs +457 -57
  92. package/skills/apexlang/templates/items/combobox/combobox.explicit-defaults.md +1 -1
  93. package/skills/apexlang/templates/items/date-picker/date-picker._common.md +1 -1
  94. package/skills/apexlang/templates/items/date-picker/date-picker.explicit-defaults.md +1 -1
  95. package/skills/apexlang/templates/items/file-upload/file-upload._common.md +30 -24
  96. package/skills/apexlang/templates/items/file-upload/file-upload.compact-template.md +6 -0
  97. package/skills/apexlang/templates/items/file-upload/file-upload.explicit-defaults.md +23 -8
  98. package/skills/apexlang/templates/items/file-upload/file-upload.minimal.md +6 -0
  99. package/skills/apexlang/templates/items/hidden-item/hidden-item._common.md +1 -1
  100. package/skills/apexlang/templates/items/hidden-item/hidden-item.explicit-defaults.md +1 -1
  101. package/skills/apexlang/templates/items/items._common.md +3 -2
  102. package/skills/apexlang/templates/items/list-manager/list-manager.explicit-defaults.md +1 -1
  103. package/skills/apexlang/templates/items/markdown-editor/markdown-editor._common.md +1 -1
  104. package/skills/apexlang/templates/items/markdown-editor/markdown-editor.explicit-defaults.md +1 -1
  105. package/skills/apexlang/templates/items/number-field/number-field._common.md +8 -6
  106. package/skills/apexlang/templates/items/number-field/number-field.explicit-defaults.md +12 -2
  107. package/skills/apexlang/templates/items/popup-lov/popup-lov.explicit-defaults.md +1 -1
  108. package/skills/apexlang/templates/items/rich-text-editor/rich-text-editor._common.md +1 -1
  109. package/skills/apexlang/templates/items/rich-text-editor/rich-text-editor.explicit-defaults.md +1 -1
  110. package/skills/apexlang/templates/items/select-many/standard.md +1 -1
  111. package/skills/apexlang/templates/items/shuttle/shuttle.explicit-defaults.md +1 -1
  112. package/skills/apexlang/templates/items/switch/switch._common.md +8 -8
  113. package/skills/apexlang/templates/items/switch/switch.explicit-defaults.md +1 -1
  114. package/skills/apexlang/templates/items/text-area/text-area._common.md +2 -3
  115. package/skills/apexlang/templates/items/text-area/text-area.explicit-defaults.md +1 -1
  116. package/skills/apexlang/templates/items/text-area/text-area.required-length.md +1 -3
  117. package/skills/apexlang/templates/items/text-autocomplete/text-autocomplete.explicit-defaults.md +1 -1
  118. package/skills/apexlang/templates/items/text-autocomplete/text-autocomplete.required-length.md +1 -3
  119. package/skills/apexlang/templates/items/text-field/text-field._common.md +2 -3
  120. package/skills/apexlang/templates/items/text-field/text-field.explicit-defaults.md +1 -1
  121. package/skills/apexlang/templates/items/text-field/text-field.required-length.md +1 -3
  122. package/skills/apexlang/templates/page-examples/faceted-search/faceted-search.example.md +0 -5
  123. package/skills/apexlang/templates/page-examples/form-page/form-page.example.md +0 -9
  124. package/skills/apexlang/templates/page-examples/interactive-report-page/interactive-report-page.example.md +2 -2
  125. package/skills/apexlang/templates/page-examples/login-page/login-page.example.md +0 -8
  126. package/skills/apexlang/templates/page-examples/task-definition-initiated-tasks-page/task-definition-initiated-tasks-page.example.md +7 -17
  127. package/skills/apexlang/templates/page-examples/task-definition-my-tasks-page/task-definition-my-tasks-page.example.md +7 -65
  128. package/skills/apexlang/templates/page-examples/task-definition-task-details/task-definition-task-details.example.md +38 -201
  129. package/skills/apexlang/templates/region-components/calendar/calendar.custom-styling.md +3 -1
  130. package/skills/apexlang/templates/region-components/calendar/calendar.faceted-search.md +3 -2
  131. package/skills/apexlang/templates/region-components/cards/README.md +12 -4
  132. package/skills/apexlang/templates/region-components/cards/cards._common.md +176 -37
  133. package/skills/apexlang/templates/region-components/cards/cards._index.md +2 -1
  134. package/skills/apexlang/templates/region-components/cards/cards.refresh-after-dialog.md +46 -0
  135. package/skills/apexlang/templates/region-components/cards/cards.refresh-on-change.md +58 -0
  136. package/skills/apexlang/templates/region-components/cards/cards.rest-source.md +54 -18
  137. package/skills/apexlang/templates/region-components/cards/cards.standard.md +37 -21
  138. package/skills/apexlang/templates/region-components/chart/chart._series._common.md +1 -4
  139. package/skills/apexlang/templates/region-components/chart/chart.pie.md +6 -2
  140. package/skills/apexlang/templates/region-components/chart/chart.status-meter-gauge.md +1 -1
  141. package/skills/apexlang/templates/region-components/chart/chart.stock.md +2 -0
  142. package/skills/apexlang/templates/region-components/chart/features/chart.feature-chart-links.md +9 -7
  143. package/skills/apexlang/templates/region-components/faceted-search/faceted-search._common.md +1 -14
  144. package/skills/apexlang/templates/region-components/form/form._items._common.md +1 -5
  145. package/skills/apexlang/templates/region-components/interactive-report/interactive-report._columns._common.md +2 -6
  146. package/skills/apexlang/templates/region-components/interactive-report/interactive-report.page-header-actions.md +1 -7
  147. package/skills/apexlang/templates/region-components/list/README.md +1 -1
  148. package/skills/apexlang/templates/region-components/list/list._common.md +1 -1
  149. package/skills/apexlang/templates/region-components/map/map.backgrounds.md +12 -10
  150. package/skills/apexlang/templates/region-components/map/map.layer.extruded-polygons.md +16 -12
  151. package/skills/apexlang/templates/region-components/map/map.layer.heat-map.md +10 -7
  152. package/skills/apexlang/templates/region-components/map/map.layer.lines.md +10 -8
  153. package/skills/apexlang/templates/region-components/map/map.layer.polygons.md +21 -18
  154. package/skills/apexlang/templates/region-components/map/map.region.background-custom.md +25 -19
  155. package/skills/apexlang/templates/region-components/map/map.region.background-shared.md +19 -13
  156. package/skills/apexlang/templates/region-components/map/map.region.bbox-sql.md +13 -13
  157. package/skills/apexlang/templates/region-components/map/map.region.bbox-static.md +2 -2
  158. package/skills/apexlang/templates/region-components/map/map.region.browser-location.md +3 -7
  159. package/skills/apexlang/templates/region-components/map/map.region.init-position-sql.md +7 -7
  160. package/skills/apexlang/templates/region-components/region-display-selector/README.md +5 -2
  161. package/skills/apexlang/templates/region-components/region-display-selector/region-display-selector._common.md +60 -7
  162. package/skills/apexlang/templates/region-components/region-display-selector/region-display-selector._index.md +4 -1
  163. package/skills/apexlang/templates/region-components/region-display-selector/region-display-selector.permutations.md +55 -0
  164. package/skills/apexlang/templates/region-components/region-display-selector/region-display-selector.standard.md +91 -5
  165. package/skills/apexlang/templates/region-components/smart-filter-search/README.md +6 -2
  166. package/skills/apexlang/templates/region-components/smart-filter-search/smart-filter-search._common.md +107 -46
  167. package/skills/apexlang/templates/region-components/smart-filter-search/smart-filter-search._index.md +4 -3
  168. package/skills/apexlang/templates/region-components/smart-filter-search/smart-filter-search.standard.md +33 -17
  169. package/skills/apexlang/templates/shared-components/component-settings/component-settings._common.md +1 -0
  170. package/skills/apexlang/templates/shared-components/component-settings.example.md +1 -0
  171. package/skills/apexlang/templates/shared-components/email-templates.example.md +1 -1
  172. package/skills/apexlang/templates/shared-components/rest-data-sources/example_rest_data_source.example.md +40 -46
  173. package/skills/apexlang/templates/shared-components/task-definitions/action-task.example.md +2 -30
  174. package/skills/apexlang/templates/shared-components/task-definitions/approve-request.example.md +3 -31
  175. package/skills/apexlang/templates/template-components/README.md +27 -15
  176. package/skills/apexlang/templates/template-components/avatar/README.md +56 -0
  177. package/skills/apexlang/templates/template-components/avatar/avatar._common.md +149 -0
  178. package/skills/apexlang/templates/template-components/avatar/avatar._index.md +42 -0
  179. package/skills/apexlang/templates/template-components/{avatar._template_options.md → avatar/avatar._template_options.md} +1 -1
  180. package/skills/apexlang/templates/template-components/avatar/avatar.report-icon.md +48 -0
  181. package/skills/apexlang/templates/template-components/avatar/avatar.report-image-url-column.md +62 -0
  182. package/skills/apexlang/templates/template-components/avatar/avatar.report-initials.md +54 -0
  183. package/skills/apexlang/templates/template-components/badge/README.md +38 -0
  184. package/skills/apexlang/templates/template-components/badge/badge._common.md +183 -0
  185. package/skills/apexlang/templates/template-components/badge/badge._index.md +20 -0
  186. package/skills/apexlang/templates/template-components/badge/badge.report-link.md +66 -0
  187. package/skills/apexlang/templates/template-components/badge/badge.report-minimal.md +76 -0
  188. package/skills/apexlang/templates/template-components/comments/README.md +20 -0
  189. package/skills/apexlang/templates/template-components/comments/comments._common.md +43 -0
  190. package/skills/apexlang/templates/template-components/comments/comments._index.md +25 -0
  191. package/skills/apexlang/templates/template-components/{comments._template_options.md → comments/comments._template_options.md} +2 -1
  192. package/skills/apexlang/templates/template-components/comments/comments.apex-task-comments.md +77 -0
  193. package/skills/apexlang/templates/template-components/comments/comments.partial-column.md +120 -0
  194. package/skills/apexlang/templates/template-components/comments/comments.permutations.md +425 -0
  195. package/skills/apexlang/templates/template-components/content-row/README.md +1 -1
  196. package/skills/apexlang/templates/template-components/content-row/content-row._common.md +1 -1
  197. package/skills/apexlang/templates/template-components/content-row/content-row._index.md +1 -1
  198. package/skills/apexlang/templates/template-components/content-row/content-row._template_options.md +1 -1
  199. package/skills/apexlang/templates/template-components/flexbox-container/README.md +9 -0
  200. package/skills/apexlang/templates/template-components/flexbox-container/flexbox-container._index.md +13 -0
  201. package/skills/apexlang/templates/template-components/media-list/README.md +100 -0
  202. package/skills/apexlang/templates/template-components/media-list/media-list._common.md +174 -0
  203. package/skills/apexlang/templates/template-components/media-list/media-list._index.md +50 -0
  204. package/skills/apexlang/templates/template-components/{media-list._template_options.md → media-list/media-list._template_options.md} +8 -2
  205. package/skills/apexlang/templates/template-components/media-list/media-list.partial.md +50 -0
  206. package/skills/apexlang/templates/template-components/media-list/media-list.report-avatar-badge.md +76 -0
  207. package/skills/apexlang/templates/template-components/media-list/media-list.report-base.md +71 -0
  208. package/skills/apexlang/templates/template-components/media-list/media-list.report-grouped.md +40 -0
  209. package/skills/apexlang/templates/template-components/media-list/media-list.report-layouts.md +50 -0
  210. package/skills/apexlang/templates/template-components/media-list/media-list.report-link.md +53 -0
  211. package/skills/apexlang/templates/template-components/metric-card/README.md +19 -4
  212. package/skills/apexlang/templates/template-components/metric-card/metric-card._common.md +122 -29
  213. package/skills/apexlang/templates/template-components/metric-card/metric-card._index.md +6 -0
  214. package/skills/apexlang/templates/template-components/metric-card/metric-card._template_options.md +47 -2
  215. package/skills/apexlang/templates/template-components/metric-card/metric-card.partial-minimal.md +51 -0
  216. package/skills/apexlang/templates/template-components/metric-card/metric-card.permutations.md +56 -0
  217. package/skills/apexlang/templates/template-components/metric-card/metric-card.report-avatar-badge.md +98 -0
  218. package/skills/apexlang/templates/template-components/metric-card/metric-card.report-grouping-selection.md +131 -0
  219. package/skills/apexlang/templates/template-components/metric-card/metric-card.report-link.md +66 -0
  220. package/skills/apexlang/templates/template-components/metric-card/metric-card.report-minimal.md +97 -0
  221. package/skills/apexlang/templates/template-components/template-components.registry.json +90 -1
  222. package/skills/apexlang/templates/template-components/timeline/README.md +19 -0
  223. package/skills/apexlang/templates/template-components/timeline/timeline._common.md +43 -0
  224. package/skills/apexlang/templates/template-components/timeline/timeline._index.md +24 -0
  225. package/skills/apexlang/templates/template-components/{timeline._template_options.md → timeline/timeline._template_options.md} +2 -1
  226. package/skills/apexlang/templates/template-components/timeline/timeline.permutations.md +399 -0
  227. package/skills/apexlang/templates/template-components/timeline/timeline.report-sample-data.md +168 -0
  228. package/skills/apexlang/templates/workspace-components/credentials/credentials-for-open-ai.example.md +1 -1
  229. package/skills/apexlang/templates/workspace-components/generative-ai-services/open-ai.example.md +8 -6
  230. package/skills/apexlang/tools/apexctl.mjs +167 -4
  231. package/skills/apexlang/tools/compiler-truth-audit.mjs +95 -63
  232. package/skills/apexlang/tools/query-valid-props-context.mjs +30 -0
  233. package/skills/apexlang/tools/query-valid-props-normalize.mjs +1 -0
  234. package/skills/apexlang/tools/query-valid-props-runtime.mjs +13 -8
  235. package/skills/apexlang/tools/query-valid-props-semantics.mjs +391 -0
  236. package/skills/apexlang/tools/query-valid-props-template-components.mjs +15 -1
  237. package/skills/apexlang/tools/query-valid-props.mjs +198 -216
  238. /package/skills/apexlang/templates/template-components/{badge._template_options.md → badge/badge._template_options.md} +0 -0
  239. /package/skills/apexlang/templates/template-components/{flexbox-container._template_options.md → flexbox-container/flexbox-container._template_options.md} +0 -0
@@ -42,8 +42,8 @@
42
42
  - Dynamic actions `DA_<purpose>`
43
43
  - SQL and PL/SQL must use named notation, and appear inside fenced blocks. Process-type policy split: page processes default to `invokeApi`, appProcess remains `executeCode`-only, and a thin page-level `executeCode` wrapper is allowed only for page-coupled loaders or branch-gated flows when direct page-item assignment is the reliable runtime-safe choice.
44
44
  - Prefer declarative shapes over PL/SQL when the workflow can be expressed through supported native APEX DSL/process constructs.
45
- - Advisory threshold: for any PL/SQL text block longer than 4000 raw characters, emit `PLSQL_LENGTH_WARN_001` and recommend extraction into a package API (`app_process_api` default) plus page-process `invokeApi` or a justified thin wrapper exception (appProcess stays `executeCode`). This warning is non-blocking.
46
- - Advisory threshold: for any inline SQL block longer than 4000 raw characters, emit `SQL_LENGTH_WARN_001` and recommend extraction into a secure view that the page artifact references instead of embedding the full query inline. This warning is non-blocking.
45
+ - Hard limit: a PL/SQL text block longer than 4000 raw characters violates `PLSQL_INLINE_BLOCK_001`; extract it into a package API (`app_process_api` default) plus page-process `invokeApi` or a justified thin wrapper exception (`appProcess` stays `executeCode`). This finding blocks final output.
46
+ - Hard limit: an inline SQL block longer than 4000 raw characters violates `SQL_INLINE_BLOCK_001`; extract it into a secure view that the page artifact references instead of embedding the full query inline. This finding blocks final output.
47
47
 
48
48
  ## 3. Processes
49
49
  - **Execution points:**
@@ -112,7 +112,7 @@ validation [validationStaticId] (
112
112
  - Server execution: `da-execute-server-side-code.apx`, `da-delete-with-notification.apx`
113
113
  - Alert/Confirm: `da-alert-confirm-cancel.apx`
114
114
  - Timer, slider, debounce/throttle, plugin styling: see dedicated templates
115
- - Server-side work should be packaged and referenced via `invokeApi` by default; use a thin page-level `executeCode` wrapper only when the page must assign items directly in a runtime-safe loader or branch flow, and keep inline business logic out of that wrapper. Critique must warn when inline PL/SQL exceeds 4000 raw characters and fail when existing non-negotiable rules are violated.
115
+ - Server-side work should be packaged and referenced via `invokeApi` by default; use a thin page-level `executeCode` wrapper only when the page must assign items directly in a runtime-safe loader or branch flow, and keep inline business logic out of that wrapper. Critique must hard-fail inline PL/SQL over 4000 raw characters under `PLSQL_INLINE_BLOCK_001`.
116
116
  - Use specific `itemsToSubmit`; avoid broad lists.
117
117
  - AI assistant settings note:
118
118
  - Prefer `genAI { agent: @AGENT }` referencing an existing AI agent alias (for example `@home`).
@@ -12,17 +12,15 @@ Startup and precedence
12
12
  - `40-components/`
13
13
 
14
14
  Connection contract
15
- - Use `db_connection_name` as the canonical saved SQLcl connection input and the corresponding APEX workspace name as required live APEXlang context.
15
+ - Use `db_connection_name` as the canonical saved SQLcl connection input. Resolve workspace identity from the active runtime for existing apps; require an exact destination workspace name before new-app materialization.
16
16
  - For DB-backed workflows, resolve prerequisite metadata source first:
17
17
  - inspect `assets/workspace-intelligence.json`
18
18
  - auto-select a single eligible schema dictionary
19
19
  - prompt the user to choose when multiple eligible schema dictionaries exist
20
20
  - scan saved SQLcl connections before any DB-mode prompt
21
- - use discovered saved connections as candidates, not as automatic approval for live work
22
- - use discovered saved connections as candidates, not as automatic approval for live work
21
+ - auto-bind exactly one deterministic saved connection for live work
23
22
  - prompt the user to choose when multiple saved SQLcl connections exist
24
- - require the user to specify `db_connection_name` and the corresponding APEX workspace name before live metadata validation, `apex validate`, `apex import`, runtime diagnostics, or new-app materialization
25
- - require the user to specify `db_connection_name` and the corresponding APEX workspace name before live metadata validation, `apex validate`, `apex import`, runtime diagnostics, or new-app materialization
23
+ - request manual `db_connection_name` only when saved-connection discovery cannot resolve one; require an exact workspace name only for new-app materialization or after runtime-reported ambiguity
26
24
  - treat `offline` as an explicit override when the user asks for offline-only behavior
27
25
  - Record one machine-readable prerequisite state:
28
26
  - `prereq_source: schema_doc`
@@ -34,10 +32,10 @@ Connection contract
34
32
  - `connection_source: user_prompt`
35
33
  - `connection_source: unresolved`
36
34
  - Resolve `db_mode` after deterministic discovery for interactive DB-backed runs:
37
- - `db_mode: online` requires `db_connection_name` and the corresponding APEX workspace name
35
+ - `db_mode: online` requires a resolved `db_connection_name`
38
36
  - `db_mode: offline` is explicit and blocks live metadata/runtime work
39
37
  - Do not infer offline mode.
40
- - Treat `prereq_source: schema_doc` as sufficient for offline metadata reasoning only; live runtime/import still requires `db_connection_name` and the corresponding APEX workspace name.
38
+ - Treat `prereq_source: schema_doc` as sufficient for offline metadata reasoning only; live runtime/import still requires a resolved `db_connection_name`.
41
39
  - Allow `prereq_source: schema_doc` and `connection_source: saved_connection` to coexist when offline schema metadata is preferred for evidence and a deterministic live connection was also discovered.
42
40
 
43
41
  How to use SQLcl
@@ -66,7 +64,7 @@ Canonical roundtrip commands
66
64
  - `apex export -applicationid <application_id> -exptype APEXLANG -split -dir <absolute_export_dir>`
67
65
  - Allow validate/import only when the capability probe confirms the required commands exist in the selected runtime path.
68
66
  - Do not add `-workspaceid` to the validate/import happy path. Only add it after the active SQLcl session explicitly reports multiple-workspace ambiguity and blocks the command without a workspace override. When that happens, resolve the workspace id automatically for the active `db_connection_name` and rerun immediately.
69
- - When workspace-id resolution is in progress, send the user this exact short status sentence before continuing: `Identifying workspace ID for DB connection, please bare with me...`
67
+ - When workspace-id resolution is in progress, send the user this exact short status sentence before continuing: `Identifying workspace ID for the DB connection, please bear with me...`
70
68
  - Treat standalone bridge or wrapper execution as diagnostic only; the real SQLcl session is the source of truth when they disagree.
71
69
  - Do not count sandbox-only build-root filesystem/setup failures as real validate attempts for the live retry budget; only real SQLcl/compiler outcomes should feed the fix loop.
72
70
 
@@ -75,7 +73,7 @@ Same-session requirement
75
73
  - If the session changes between validate and import, STOP and re-run validation before import.
76
74
 
77
75
  Policy and quality gates
78
- - Never perform live DB work if `db_connection_name` or the corresponding APEX workspace name is missing or ambiguous.
76
+ - Never perform live DB work if `db_connection_name` is unresolved. Require workspace input only for new-app materialization or when runtime ambiguity cannot be resolved deterministically.
79
77
  - Never run live metadata validation, `apex validate`, or `apex import` in offline mode.
80
78
  - Never treat APEX build-root inference or SQLcl version alone as sufficient proof that live validate/import can run.
81
79
  - Ask for an environment-specific APEX build path only when automatic build-root resolution fails and the user still wants build-root runtime or diagnostics.
@@ -85,9 +83,9 @@ Policy and quality gates
85
83
  Prompt pattern
86
84
  - For interactive DB-backed workflows:
87
85
  - first run deterministic discovery: inspect offline schema dictionaries and scan saved SQLcl connections
88
- - if exactly one saved SQLcl connection exists, present it as the default candidate before prompting
86
+ - if exactly one saved SQLcl connection exists, auto-bind it
89
87
  - if multiple saved SQLcl connections exist, present them as selectable options
90
- - use `Provide db_connection_name and the corresponding APEX workspace name for this workflow.` when live DB context is still unresolved after discovery
88
+ - use `Provide db_connection_name for this workflow.` when live DB context is still unresolved after discovery
91
89
  - accept `offline` only when the user explicitly asks for offline-only execution
92
90
 
93
91
  Tags: db, connection, sqlcl, oracle, connect, schema, validate, apex, roundtrip
@@ -0,0 +1,95 @@
1
+ # APEX Visual Summary Cards Page
2
+
3
+ ## Purpose
4
+
5
+ Defines the deterministic page pattern for visual summaries of people, products, statuses, or other entities rendered with one native APEX Cards region. This pattern owns Cards composition only; it does not orchestrate filtering or search.
6
+
7
+ ## Pattern Selection
8
+
9
+ - Select this pattern for people cards, product cards, status tiles, entity cards, or an explicit native Cards region.
10
+ - Use a Metric Card template-component region instead for aggregate KPIs or a normalized metric strip unless the request explicitly requires native Cards.
11
+ - Use a report pattern instead when dense comparison, sorting, or tabular scanning is the primary task.
12
+ - Do not add Faceted Search, Smart Filters, search items, facets, or filter dynamic actions under this pattern. Route a separate filtering/search request to its owning pattern.
13
+
14
+ Rule ID: `CARDS_VISUAL_SUMMARY_PATTERN_REQUIRED_001`.
15
+
16
+ ## Source-to-Attribute Plan
17
+
18
+ Before rendering APEXlang, record one mapping row for every requested Cards role:
19
+
20
+ | Cards role | Required evidence | Native mapping |
21
+ |---|---|---|
22
+ | Title | SQL projection alias or REST data-profile column | `title.column`, or `title.htmlExpression` with `advancedFormatting: true` |
23
+ | Subtitle | SQL projection alias or REST data-profile column | `subtitle.column` or advanced formatting |
24
+ | Body | SQL projection alias or REST data-profile column | `body.column` or advanced formatting |
25
+ | Secondary body | SQL projection alias or REST data-profile column | `secondaryBody.column` or advanced formatting |
26
+ | Row identity | Proven primary-key or stable REST identity field | `card.primaryKeyColumn1` and optional `primaryKeyColumn2` when the source has a composite identity or BLOB media requires it |
27
+ | Icon | Pinned Font APEX token, projected icon-class column, or projected initials | `iconAndBadge` |
28
+ | Image | Raw BLOB alias, projected URL alias, or explicit direct URL | `media`, plus `blobAttributes` only for BLOB media |
29
+ | Badge | Projected metric or status alias | `iconAndBadge.badgeColumn` with optional label/classes |
30
+ | Link | Proven target page and target-item/source-column mapping | Native Cards `action` with declarative `behavior.target` |
31
+ | Conditional style | Projected, allowlisted semantic class token | The narrowest compiler-proven `cssClasses` property; never raw user-authored CSS |
32
+
33
+ - SQL-backed Cards use exactly `location: localDatabase`, `type: sqlQuery`, and a fenced `sqlQuery`; they must not also declare `restSource`. Every mapped alias must be present in the query projection and every referenced object/column must have DB object evidence.
34
+ - REST-backed Cards use exactly `location: restSource` plus `restSource: @alias`; they omit SQL `type` and `sqlQuery`. They require an existing REST Data Source plus an authoritative data profile. Map the profile's actual column names; do not infer JSON paths or aliases.
35
+ - A requested role with no proven source field is `unresolved`. Omit an optional unresolved role or stop with `Missing Inputs` when it is required by the request.
36
+ - Prefer direct `column` mapping with `advancedFormatting: false`. Use `htmlExpression` only for a requested composition that cannot be represented by one native column, set `advancedFormatting: true`, and escape text substitutions with `!HTML`.
37
+
38
+ Rule ID: `CARDS_SOURCE_MAPPING_REQUIRED_001`.
39
+
40
+ ## Icons, Badges, and Conditional Styles
41
+
42
+ - Prefer `iconSource: iconClassColumn` for row-dependent icons and `iconSource: initials` for people cards with initials. A fixed icon must come from the pinned Font APEX catalog.
43
+ - Prefer `badgeColumn` for row-dependent status or metric text. Keep the badge label concise and omit it when the value is self-explanatory.
44
+ - For conditional styling, project only `u-normal`, `u-hot`, `u-info`, `u-success`, `u-warning`, `u-danger`, or `NULL`. Map the proven alias to `card.cssClasses`; do not accept a raw class column. For REST profiles, record the exact finite set in the mapped profile column's `comments.comments` as `authoritative-profile-enum: [...]`; absence of that evidence blocks conditional styling.
45
+ - Do not concatenate arbitrary CSS, accept CSS tokens from untrusted end-user input, invent Universal Theme classes, or use HTML badge markup when native badge mapping is sufficient.
46
+ - If compiler truth for the active build does not expose a safe property for the requested conditional style, preserve the status as text/badge content and stop before inventing a styling workaround.
47
+
48
+ ## Interactivity
49
+
50
+ - Clickable cards use a native Cards action with `type: fullCard`, `layout.sequence`, `behavior.type: redirectThisApp`, and a declarative same-app target. Every source substitution used by the target must be projected by the Cards source.
51
+ - Other supported action presentations are `title`, `subtitle`, `media`, and `button`. Only `button` requires a concise `label` and `layout.position: primary | secondary`; non-button actions omit both fields.
52
+ - Button actions may use `appearance.displayType: text | icon | textWithIcon`, with `appearance.icon` required for icon presentations, plus `hot` and `cssClasses`. Any action may carry `advanced.staticId` and a compiler-backed `serverSideCondition`.
53
+ - `behavior.type: triggerAction` omits `behavior.target` and `behavior.targetUrl` and requires a nested `triggerAction` child with its supported UI action reference. Redirect actions use only their matching target shape.
54
+ - If full-card navigation and a decision button compete for the same card, document the intended precedence and evidence-backed conditions in the UX contract. Do not infer mutually exclusive business conditions from the presence of both actions.
55
+ - Dynamic refresh must name both the trigger and the Cards region static ID. Use the supported dynamic-action Refresh capability and target only that Cards region.
56
+ - When refreshed SQL depends on page items, list those items in `source.pageItemsToSubmit`. Do not rely on stale browser or session state.
57
+ - A refresh after a modal create/edit closes is required when the changed row should appear in or disappear from the Cards result set.
58
+ - Use Cards-owned `cards.refresh-on-change.md` for item-change refresh and `cards.refresh-after-dialog.md` for dialog-close refresh. Do not modify or synthesize behavior from shared Dynamic Action templates.
59
+
60
+ ## Security
61
+
62
+ - Cards pages inherit the authenticated-page and session-protection baseline. Add an existing region authorization scheme when the Cards source is more restricted than the page, and authorize target pages/processes independently.
63
+ - Prefer native text mappings. Every database or REST value inserted into an advanced HTML expression must use `&COLUMN!HTML.`; never use unescaped `&COLUMN.` for untrusted text.
64
+ - Prefer declarative same-app targets. A literal external target must use HTTPS. Reject HTTP, dynamic target substitutions, `javascript:`, `data:`, protocol-relative, credential-bearing, or path-traversal URLs unless a future application-specific allowlist contract proves them.
65
+ - SQL-backed media URL columns must be statically proven by literal or `CASE` projection results. REST media URL columns must declare `authoritative-profile-url-prefixes: [...]` in the mapped profile column's `comments.comments`; use `application-static-relative` for a relative-path-only field or list exact HTTPS prefixes.
66
+ - REST-backed Cards reference a declared shared REST Data Source, HTTPS REST Data Source Server, and APEX Web Credential. Credentials stay in the shared credential, and `advanced.validForUrls` must include the exact resolved server plus source-path prefix.
67
+
68
+ Rule ID: `CARDS_SECURITY_REQUIRED_001`.
69
+
70
+ ## Responsive Universal Theme Layout
71
+
72
+ - Emit `componentAppearance.layout: grid` for the standard responsive layout, `float` when cards should wrap to available width, or `horizontal` when cards should stack. Choose from explicit layout intent.
73
+ - Emit `componentAppearance.gridColumns` only with `layout: grid` and an explicit fixed count of `2`, `3`, `4`, or `5`.
74
+ - Use `componentAppearance.cssClasses` only for a proven Cards-container class. Do not use custom CSS, row spans, or invented breakpoints to force responsiveness.
75
+ - Use `appearance.template: @/cards-container` and exact build-pinned template option values.
76
+
77
+ ## Interaction Boundary
78
+
79
+ - This pattern may emit a card link/action, a Cards-region refresh dynamic action, and the page items required by that refresh.
80
+ - This pattern must not emit Faceted Search, Smart Filters, search fields, facets, filter blocks, results-region orchestration, or filter-specific dynamic actions.
81
+ - If the request combines Cards with filtering/search, route to the Faceted Search or Smart Filters page pattern and treat Cards only as that pattern's results region. In an application UX contract, declare that filtering pattern as the page owner rather than leaving `visual-summary-cards` as the sole pattern.
82
+ - Routing precedence: generic Cards filtering or `cards search` -> Faceted Search; direct Smart Filter Search wording -> Smart Filter Search; never co-own both.
83
+
84
+ Rule ID: `CARDS_INTERACTION_BOUNDARY_REQUIRED_001`.
85
+
86
+ ## Verification Checklist
87
+
88
+ 1. The normalized intent selects `visual-summary-cards`, not Dashboard, Metric Card, or Interactive Grid by synonym alone.
89
+ 2. Source mode is exactly SQL query or REST Data Source and every requested mapping has evidence.
90
+ 3. Native title/subtitle/body, media, icon, badge, and action blocks are used before HTML fallbacks.
91
+ 4. Conditional style values are proven to return only the six allowed Universal Theme semantic tokens or `NULL` and are mapped only through `card.cssClasses`.
92
+ 5. Refresh wiring names the trigger, region static ID, and any page items to submit.
93
+ 6. Automatic responsive layout is the default; fixed columns are explicit and within `2` through `5`.
94
+ 7. No filtering/search components are emitted by this pattern.
95
+ 8. Page, region/action, target, HTML escaping, URL, and REST credential controls match the Cards security boundary.
@@ -161,8 +161,8 @@ Critique Gate — Navigation & Grouping (non-modal)
161
161
  - Allow a thin `type: executeCode` wrapper for packaged routines only when the block is a small named-notation package call plus direct page-item assignment required for a page-coupled loader or before-header branch-gated flow.
162
162
  - DO NOT use `type: executeCode` to re-embed business logic that belongs in the package; non-compliant wrappers must be flagged by critique (see 00-guard and 20-data/apex.logic.md).
163
163
  - This section governs page processes only. Application processes (`appProcess`) must use `type: executeCode` per 00-guard and 10-global policies.
164
- - Advisory threshold: if any inline PL/SQL body in page-level artifacts exceeds 4000 raw characters, critique should emit warning `PLSQL_LENGTH_WARN_001` and recommend extracting logic into `app_process_api` (or justified alternative). For processes, the preferred target shape is `type: invokeApi`, with the thin-wrapper exception used only when it is explicitly justified by runtime-safe page-item orchestration.
165
- - Advisory threshold: if any inline SQL body in page-level artifacts exceeds 4000 raw characters, critique should emit warning `SQL_LENGTH_WARN_001` and recommend extracting the query into a secure view that page-level artifacts reference instead of embedding inline.
164
+ - Hard limit: if an inline PL/SQL body in a page-level artifact exceeds 4000 raw characters, critique must hard-fail `PLSQL_INLINE_BLOCK_001` and require extraction into `app_process_api` (or a justified alternative). For processes, the preferred target shape is `type: invokeApi`, with the thin-wrapper exception used only when justified by runtime-safe page-item orchestration.
165
+ - Hard limit: if an inline SQL body in a page-level artifact exceeds 4000 raw characters, critique must hard-fail `SQL_INLINE_BLOCK_001` and require extraction into a secure view referenced by the page artifact.
166
166
  - Dynamic Content regions may use plsqlFunctionBody for rendering HTML/CLOB; they must not perform DML or manage transactions.
167
167
 
168
168
  ## Linking Patterns
@@ -1,107 +1,178 @@
1
- ## Smart Filter & Search Page Standards
1
+ ## Smart Filter Search Page Standards
2
2
 
3
- Rules and conventions for Oracle APEX pages that center on the Smart Filters component paired with a tabular or card-based results region.
3
+ Canonical rules for a non-modal Oracle APEX page built around one Smart Filters region and one authoritative results region.
4
4
 
5
- Keywords: smart filter, smart filters, smart search, quick search, multi-attribute search
5
+ Keywords: smart filter, smart filters, smart filter search, searchable attributes, suggestion chips, refinements
6
6
 
7
7
  ---
8
8
 
9
- ## Purpose and Scope
10
- - Deliver a deterministic recipe for implementing Smart Filter & Search experiences that combine a Smart Filters region with a single authoritative results region.
11
- - Ensure consistency with Universal Theme defaults, guardrails defined in `00-guard`, and the component template at `templates/region-components/smart-filter-search/smart-filter-search._common.md`.
12
- - Apply to non-modal pages whose primary interaction is searching/list filtering rather than data entry.
9
+ ## Purpose and Authority
10
+
11
+ - Use the `smart-filter-search` pattern and construction pack before loading this page standard or its template family.
12
+ - Use compiler metadata for APEXlang legality. Ticket fields are requirements, not proof that a same-named DSL property exists.
13
+ - Use the exact Smart Filter family contract at `templates/region-components/smart-filter-search/smart-filter-search._common.md` after the structured pack is selected.
14
+
15
+ ### Deterministic routing precedence
16
+
17
+ - `Smart Filter Search` or `Smart Filters region` -> `smart-filter-search`; exclude `faceted-search`.
18
+ - `Faceted Search`, `facets`, or generic filtering -> `faceted-search`.
19
+ - `Cards` + generic filtering or `cards search` -> `faceted-search`; Cards are results only.
20
+ - `Cards` + direct Smart Filter Search wording -> `smart-filter-search`; no co-ownership.
21
+
22
+ These precedence rules are routing behavior and are covered by resolver tests; they do not authorize mixing Faceted Search and Smart Filters on one page.
13
23
 
14
24
  ---
15
25
 
16
- ## Page Template & Navigation (Non-Negotiable)
17
- 1. Use the Standard page template (`pageTemplate: @/standard`) unless a documented exception requires another layout. Keep `templateOptions: #DEFAULT#`.
18
- Keep each value exact. `#DEFAULT#` remains standalone, and documented composites such as `t-Region--hideHeader js-addHiddenHeadingRoleDesc` remain one atomic entry.
19
- 2. Include a Breadcrumb region using the title-bar template. Position it in `slot: REGION_POSITION_01` with `sequence: 10`.
20
- - Primary page-level create actions, such as Create Product or Create Customer, belong on the breadcrumb/title-bar region, not inside the filtered report region toolbar.
21
- 3. Follow `apex.page.md` for page naming, alias, title, breadcrumb entry, and navigation list updates.
22
- 4. Disable form autocomplete on search-driven pages unless business requirements state otherwise.
26
+ ## Required Generation Plan
27
+
28
+ Do not generate until the plan records all of the following:
29
+
30
+ | Decision | Required evidence |
31
+ |----------|-------------------|
32
+ | `base_region_static_id` | One exact, page-unique results-region static id. |
33
+ | `base_source` | Secured view or canonical SQL plus `object_evidence_source: schema_doc | live_db | user_asserted`. |
34
+ | `searchable_attributes` | Explicit non-empty allowlist proven in the base projection. |
35
+ | `match_semantics` | One of `contains`, `starts`, or `exact`, plus supported per-attribute overrides if any. |
36
+ | `min_chars` / `max_len` | Positive integers with `max_len >= min_chars`. |
37
+ | `tokenization_policy` | Frozen trimming, whitespace, punctuation, case/accent, and token-order behavior. |
38
+ | `settings_contract` | Requested values and property-level compiler evidence for the target build. |
39
+ | `security_scope` | Effective authorization and server-side condition for the Smart Filters region, base region, suggestions, and refinements. |
40
+ | `performance_readiness` | Index/search strategy, statistics status, and expected cardinality. |
41
+
42
+ Stop with Missing Inputs while any required decision or evidence source is unresolved.
43
+
44
+ Persist the structured plan as JSON beside the app (for auto-discovery) or pass it through the generation gate. Keep ordinary `apexlang validate --app-path <path>` flag-free; use `--require-smart-filter-generation-plan` only at a mandatory generation gate. A plan may contain one direct page object or a `pages` array keyed by page number.
45
+
46
+ Validation layers:
47
+
48
+ - `artifact`: topology, target type/order, source mode/projection, wildcard rejection, allowlist order, scope inheritance, refinement shape, compiler-supported settings.
49
+ - `plan`: object evidence, `no_rewrite`, match/length/tokenization/compiler evidence, index strategy, statistics, cardinality.
50
+ - `runtime`: focus/announcement behavior, no-reload refresh, filtered exports under active scope.
51
+
52
+ Templates and ticket prose are not evidence for `plan` or `runtime`.
23
53
 
24
54
  ---
25
55
 
26
- ## Core Composition (Top → Bottom)
27
- 1. **Breadcrumb / Header** – Optional wrapper region for breadcrumbs and page-level actions.
28
- 2. **Smart Filters Region** – Region type `smartFilters`, parented to the breadcrumb/header region when using the PLUGIN_SEARCH slot, otherwise place in BODY with `sequence: 10`.
29
- 3. **Results Region** – Classic Report (preferred), approved alternative (Cards, Interactive Report/Grid), or a companion report/cards region for map pages.
30
- 4. **Optional Export / Download** – When exports are enabled, expose them via the results region (e.g., PDF download button) rather than standalone buttons.
56
+ ## Page Composition
57
+
58
+ 1. Use the Standard page template unless a higher-precedence page contract proves another layout.
59
+ 2. Place page-level navigation and create actions in the breadcrumb/title-bar region when present.
60
+ 3. Declare exactly one Smart Filters region before exactly one authoritative base results region.
61
+ 4. Bind `source.filteredRegion` to `@<base_region_static_id>` and to no other region.
62
+ 5. Keep optional maps/charts as sibling visualizations; they are not additional Smart Filter base regions.
63
+ 6. Keep keyboard order from page guidance to Smart Filters to results.
31
64
 
32
- Maintain the page grid so that Smart Filters sits visually above or beside the results region while respecting UT responsive behavior.
65
+ The APEX 24.2 base-region allowlist is Classic Report, Cards, Map, and Calendar. Interactive Report, Interactive Grid, and Content Row are not supported by this pinned contract. See [Oracle APEX 24.2 Smart Filters](https://docs.oracle.com/en/database/oracle/apex/24.2/htmdb/creating-smart-filters-page-manually.html). Target the Map region static id, not a layer; this single-dataset contract requires exactly one Map layer with a provable source. Additional visualizations may remain siblings. Preserved Markdown syntax examples from other compiler releases are not APEX 24.2 compatibility evidence; the pinned allowlist is enforced on generated `.apx` artifacts.
33
66
 
34
67
  ---
35
68
 
36
- ## Smart Filters Configuration (Non-Negotiable)
37
- 1. `filteredRegion` must point to the static ID of the results region.
38
- The filtered target must be the page's actual report/cards-style results region. Do not target map regions or map layers directly; on map pages, target the companion result region and refresh the sibling map explicitly.
39
- Declare the Smart Filters region before the referenced results region in the page file.
40
- 2. Preserve `templateOptions: #DEFAULT#` unless a documented template-option exception exists. Do not invent classes.
41
- 3. Emit optional Smart Filters settings only when compiler metadata for the active build proves the property is valid.
42
- 4. Order filters: primary search first, then categorical filters (checkbox/radio), then range or other specialty filters.
43
- 5. Use `suggestions.type: dynamic` for facet filters unless a static list is mandated.
44
- 6. Provide semantic labels and placeholders; if the Smart Filters region is the primary search control, set `accessibility.landmarkType: search`.
45
-
46
- ### Filter Types
47
- - **Search Filter** – Consolidate free-text search across key columns via the canonical `source.dbColumns` list. Do not collapse the search filter into a single-column shortcut shape or other undocumented source variant.
48
- - **Categorical Filters** – Prefer checkbox group or radio group facets with `lov.type: distinctValues` for table-backed columns. Provide `listEntries.zeroCountEntries: disable` to hide empty facets.
49
- - **LOV Source** – For demo/sample data, distinct values are acceptable; for production, use curated LOVs or SQL views to control display order.
69
+ ## Base Region and Source Contract
70
+
71
+ - The page has exactly one base region for search, suggestions, refinements, and result count semantics.
72
+ - `base_region_static_id` is mandatory and must resolve to that region's exact static id.
73
+ - The base source is a secured view or supplied canonical SQL. Prove all objects and projected columns before generation.
74
+ - Record named `base_source.object_evidence` entries with `object` and `source` (`schema_doc`, `live_db`, or `user_asserted`) matching every emitted source object. Booleans, bare evidence labels, and unrelated object names do not qualify.
75
+ - For `secured_view`, the entry matching `tableName` must additionally declare `object_type: view` and `secured: true`; a `tableView` source or a column dictionary alone does not prove a secured view.
76
+ - For `canonical_sql`, store the supplied SQL in `base_source.canonical_sql`. Validation compares it to the emitted SQL unchanged, apart from outer whitespace. The local object-scope checker supports simple SELECTs, joins, subqueries, and named function calls; CTEs, database links, and opaque table functions stop with Missing Inputs until their object scope can be proven.
77
+ - Do not auto-modify, widen, wrap, or inject predicates into canonical SQL to satisfy Smart Filter requirements.
78
+ - Do not use `select *`; keep the projection explicit so searchable and display columns can be proven.
79
+ - Preserve bind variables and the security predicates owned by the supplied source.
80
+ - Results-region pagination, download, no-data messaging, and column presentation remain owned by the selected exact results-region contract.
81
+ - `SMART_FILTER_BASE_SOURCE_CONTRACT_REQUIRED_001` blocks generation unless the source mode, object evidence, explicit projection, and no-rewrite decision are recorded.
50
82
 
51
83
  ---
52
84
 
53
- ## Results Region Requirements
54
- 1. **Classic Report Defaults**
55
- - `appearance.template: @/standard`
56
- - `appearance.templateOptions: [ #DEFAULT#, t-Region--noPadding, t-Region--hideHeader js-addHiddenHeadingRoleDesc, t-Region--scrollBody ]` when scrollable body is desired.
57
- - `componentAppearance.template: @/standard` with stretch/static row color options as needed.
58
- 2. Include `messages.whenNoDataFound` with user-friendly copy (e.g., `no data found`).
59
- 3. Default pagination for a Classic Report results region is `rowRangesXToYNoPagination`. Switch to another catalog option (see `20-data/apex.sql.md`) only when the user asks for paging controls or when dataset volume requires them.
60
- 4. Apply end alignment to numeric columns and hide surrogate keys with `type: hidden`.
61
- 5. When exports are required, enable them via the region’s Download attributes instead of custom buttons; respect security guardrails for file generation.
62
-
63
- ### Alternative Result Types
64
- - Cards: follow card policies from `apex.dashboard.md` and the Cards policy section.
65
- - Interactive Report/Grid: ensure all controlling filters are listed in `pageItemsToSubmit` and the IR/IG configuration follows its respective memory-bank rule.
66
- - Content Row / Metric Card: allowed only when the page still has one authoritative row-based results region with compatible filterable source columns.
67
-
68
- ### Map + Filter Pages
69
- - Smart Filters must target an authoritative report/cards region on map pages.
70
- - Keep sibling maps synchronized with explicit refresh behavior after Smart Filter changes. Do not target the map directly and do not add unsupported map-layer `source.pageItemsToSubmit` to force the filter state into the layer.
85
+ ## Searchable Attributes and Filter Children
86
+
87
+ - Emit at least one `type: search` child using `source.dbColumns`.
88
+ - Populate `source.dbColumns` only from the ordered `searchable_attributes` allowlist. Never infer the allowlist from every projected column.
89
+ - Every allowlisted attribute must exist in the security-trimmed base projection. Hidden, sensitive, tenant-key, and authorization-control columns are not searchable unless explicitly approved.
90
+ - Order the primary search child before categorical and range refinements.
91
+ - Use page-scoped filter tokens such as `P{page}_F_SEARCH`; avoid generic or colliding names.
92
+ - Categorical/range LOVs and values must be subsets of the same base dataset and must follow the compiler-valid child shape.
71
93
 
72
94
  ---
73
95
 
74
- ## Optional Header Actions
75
- - Primary/secondary buttons should live in the header region slots (`PLUGIN_PRIMARY_ACTIONS`, `PLUGIN_SECONDARY_ACTIONS`).
76
- - Use shared button templates (`@/button`) with `templateOptions: #DEFAULT#`. Keep action layout within template and slot defaults; do not add ad hoc classes.
77
- - Actions must be wired via dynamic actions or navigation that respects checksum policies.
96
+ ## Search Semantics and Tokenization
97
+
98
+ - Record one default semantic: `contains`, `starts`, or `exact`. Do not leave matching behavior implicit.
99
+ - `contains` matches a normalized token within a value; `starts` matches when the normalized value starts with the token; `exact` matches the complete normalized value.
100
+ - Do not execute searches or suggestions below `min_chars`.
101
+ - Reject input above `max_len` predictably; do not silently mutate it in SQL.
102
+ - Apply the same frozen tokenization policy to search, suggestions, and refinements. Define trimming, repeated whitespace, punctuation boundaries, case normalization, accent normalization, duplicate tokens, and token order.
103
+ - Use bind values for user input. Never concatenate search text into SQL.
104
+ - `SMART_FILTER_SEARCH_BEHAVIOR_CONTRACT_REQUIRED_001` blocks generation unless exactly one semantic, positive integer bounds with `max_len >= min_chars`, every tokenization decision, and property-level compiler evidence are recorded.
105
+ - If the active compiler cannot represent a required behavior, stop with Missing Inputs instead of inventing a property or rewriting the base source.
78
106
 
79
107
  ---
80
108
 
81
- ## Data, Performance & Sample Data
82
- - Keep Smart Filter results backed by performant SQL (views or packaged APIs per `20-data/apex.sql.md`).
83
- - For normal report/card targets, leverage `filteredRegion` so APEX handles predicate composition. For sibling maps, use an explicit refresh pattern backed by live-valid map metadata for the active compiler.
84
- - Demo/skeleton pages may use `sampleData` sources (e.g., `employees`); production pages must point to actual schema objects.
109
+ ## Compiler-Gated UI Settings
110
+
111
+ The required UI contract is:
112
+
113
+ - `maxSuggestionChips: 100`
114
+ - `moreFiltersSuggestionChip: true`
115
+ - `compactNosThreshold: 10000`
116
+ - `showTotalRowCount`: explicitly `true` or `false`
117
+ - `totalRowCountLabel: Results` when `showTotalRowCount` is `true`; omit it when false
118
+
119
+ For each property, record the target compiler build and active-property evidence. Emit only properties exposed by that compiler. `SMART_FILTER_SETTINGS_VALUE_REQUIRED_001` enforces the values above for every supported property, including the conditional count label. Missing evidence raises `SMART_FILTER_SETTINGS_COMPILER_EVIDENCE_REQUIRED_001`; unsupported properties raise `SMART_FILTER_SETTINGS_UNSUPPORTED_001` and remain unresolved until the target build or an approved alternative satisfies the requirement. Never silently discard requested values.
120
+
121
+ ---
122
+
123
+ ## Security and Data-Leakage Contract
124
+
125
+ - The Smart Filters and base regions must share the same effective authorization scheme and server-side condition.
126
+ - Apply the same checks recursively to `filterGroup` containers and their `checkbox` children. Groups inherit scope from their parent, and children inherit from the group. Validate group suggestion sources even when the group has no source column; validate every child column against the base projection.
127
+ - Both may omit authorization/condition only when the page contract explicitly permits the same public scope for both.
128
+ - Suggestion chips, suggestions, refinement values, counts, and result rows must derive from the same security-trimmed base dataset.
129
+ - Do not query a broader table for convenience, bypass a secured view, or omit tenant/row-level predicates in suggestion/refinement sources.
130
+ - Treat a suggestion value or count visible outside the base security scope as a data leak and a merge blocker.
85
131
 
86
132
  ---
87
133
 
88
- ## Accessibility & UX
89
- - Ensure every filter has a concise label; avoid abbreviations unless registered in `apex.acronyms.md`.
90
- - Provide accessible text for export links and total count indicators through the filtered results region. Do not emit Smart Filters `settings.showTotalRowCount` for APEX 26.1 unless compiler metadata for the active build proves that property exists.
91
- - Maintain consistent sequencing so keyboard navigation progresses from filters into results.
134
+ ## Performance Readiness
135
+
136
+ - Record expected base cardinality and the data-volume assumption used for UX and query decisions.
137
+ - Confirm optimizer statistics status for the base objects and relevant indexes.
138
+ - Record an index/search strategy for every searchable attribute and selected semantic.
139
+ - Do not claim that a normal B-tree index optimizes substring `contains` behavior. Prove a compatible text/function-based strategy or record the accepted scan cost.
140
+ - `SMART_FILTER_PERFORMANCE_READINESS_REQUIRED_001` blocks readiness while index strategy, statistics status, or expected-cardinality evidence is missing.
141
+ - Avoid applying functions to indexed searchable columns unless matching function-based index evidence exists.
142
+ - Do not mark the implementation ready while index strategy, statistics status, or expected cardinality is unresolved.
143
+ - The validator rejects duplicate `source.dbColumns` entries and, when a Generation Plan is supplied, requires the emitted order to equal the declared ordered allowlist.
92
144
 
93
145
  ---
94
146
 
95
- ## Testing & Validation Checklist
96
- - Smart Filters refreshes results region without page reload.
97
- - Filters display only relevant values (no orphan facets with zero results).
98
- - Download/export actions honor current filters.
99
- - Breadcrumb and navigation entries route to the correct page with checksum protection.
147
+ ## Accessibility and UX
148
+
149
+ - Give every search/refinement child a concise visible label and useful help when behavior is not self-evident.
150
+ - Use the search landmark when compiler truth supports the selected Smart Filters accessibility shape.
151
+ - Keep total-count labeling consistent: `Results` only when total row count is shown.
152
+ - Preserve visible focus order and announce result changes through supported native region behavior.
153
+ - Add help/comments to every search and refinement child. Record compiler-supported landmark/focus behavior in the plan; do not invent accessibility properties.
100
154
 
101
155
  ---
102
156
 
103
- ## References & Assets
104
- - Template: `templates/region-components/smart-filter-search/smart-filter-search._common.md`
105
- - Example page: `applications/apexlang-skeleton-test-application101/pages/p00010-smart-filter-search.apx`
106
- - Oracle APEX Smart Filters documentation
107
- - Pair with related rules: `apex.dashboard.md` (filters section) and `apex.faceted-search.md` for alternate filtering patterns.
157
+ ## Validation Checklist
158
+
159
+ - Exactly one Smart Filters region targets exactly one existing base region and appears before it.
160
+ - `base_region_static_id` matches the target static id.
161
+ - Base source and every searchable attribute have accepted object evidence.
162
+ - `source.dbColumns` equals the explicit allowlist and contains no extra column.
163
+ - Match semantics, `min_chars`, `max_len`, and tokenization are explicit and consistent.
164
+ - Every requested setting has property-level compiler evidence and the required value.
165
+ - Authorization, server-side conditions, suggestions, refinements, counts, and results share one effective security scope.
166
+ - Index strategy, statistics status, and expected cardinality are recorded.
167
+ - Search refreshes results without page reload and exports honor the active filters.
168
+ - Runtime acceptance records both result refresh without page reload and filtered export behavior.
169
+
170
+ ---
171
+
172
+ ## References
173
+
174
+ - Structured contracts: `assets/contracts/page-patterns.json`, `assets/contracts/page-construction-packs.json`
175
+ - Template family: `templates/region-components/smart-filter-search/`
176
+ - Cross-region constraints: `references/policies/memory-bank/40-components/apex.region-interactions.md`
177
+ - SQL and evidence rules: `references/policies/memory-bank/20-data/apex.sql.md`, `references/policies/memory-bank/00-guard/ai.guard.md`
178
+ - Alternative filtering pattern: `references/policies/memory-bank/30-pages/apex.faceted-search.md`
@@ -4,9 +4,13 @@
4
4
  Defines reusable APEXlang region interaction contracts for links, actions, filters, contextual regions, parent-child layout, and comments.
5
5
 
6
6
  ## Interaction and Action Constraints
7
- - Metric Card and Chart regions do not own links or actions; use adjacent cards, reports, buttons, or list entries for navigation.
7
+ - Chart regions do not own links or actions; use adjacent cards, reports, buttons, or list entries for navigation.
8
+ - Metric Card supports one row-level action position, `link`. Use a declarative behavior target, deterministic action sequence, projected row mappings, and no action template or label.
9
+ - Metric Card `redirectThisApp` and `redirectOtherApp` link behaviors require `target`; `redirectUrl` requires a reviewed safe `targetUrl`; `triggerAction` emits neither target property and requires a matching event consumer. Reject dangerous URL schemes, protocol-relative or wholly dynamic destinations, substitutions outside query parameters, inline handlers, URL overrides in `linkAttributes`, and unsafe new-window attributes. The URL scheme, host, path, and fragment must remain static.
10
+ - Metric Card grouping requires grouped child-column metadata plus deterministic static ordering; native single/multiple selection requires correctly typed same-page selection items and a primary-key child column.
8
11
  - Cards `fullCard` links must not emit a label; Cards `button` links must emit a concise label.
9
- - Native Cards actions are row navigation actions using `label` plus declarative `behavior.target`; do not emit `position` or attach processes directly to Cards actions.
12
+ - Native Cards actions are row navigation or decision actions using explicit `layout.sequence`; `button` actions use `label`, `layout.position`, and optional native `appearance`, while full-card/title/subtitle/media actions omit button-only fields. Use declarative `behavior.target` for redirects, and use a nested `triggerAction` child only with `behavior.type: triggerAction`, omitting navigation targets.
13
+ - When full-card navigation and a decision button coexist, document the intended precedence and evidence-backed conditions in the UX contract. Do not infer mutually exclusive business conditions from the action set.
10
14
  - List regions are navigation-only; they bind to shared list entries and must not emit data sources, filters, hidden page items, columns, links, or actions.
11
15
  - Management and launcher hub shared list entries should include `icon.imageIconCssClasses` with a conservative `fa-*` token and `userDefinedAttributes { 1: ... }` description text so media-list hubs render as scannable launch cards.
12
16
  - Report drilldown should be modeled as report/column links or region-level links, not as unsupported report actions.
@@ -16,6 +20,9 @@ Defines reusable APEXlang region interaction contracts for links, actions, filte
16
20
  - Filter item names are page item tokens, not labels. Derive them from page number and database column: `P{page}_F_{UPPER_DB_COLUMN}`.
17
21
  - Range filters use the same single canonical filter name as the database column; do not create `_FROM` and `_TO` item pairs for one range filter.
18
22
  - Smart Filters search item token defaults to `P{page}_F_SEARCH`; avoid legacy `P{page}_SEARCH` for generated search items.
23
+ - A Smart Filters region must bind to exactly one APEX 24.2 Classic Report, Cards, Map, or Calendar base region through its explicit static id; sibling visualizations are not additional filter targets.
24
+ - Smart Filter search, suggestion, refinement, and count behavior must stay within the base region's effective authorization, server-side condition, and security-trimmed dataset.
25
+ - Treat `source.dbColumns` as an explicit searchable-attribute allowlist, not as permission to expose every base projection column.
19
26
  - Filter item names must not collide with same-page hidden items or form page item names; suffix deterministically only when there is a real collision.
20
27
 
21
28
  ## Contextual and Parent-Child Layout
@@ -11,12 +11,13 @@ Defines reusable APEXlang BLOB, file/image, storage companion, and visual-token
11
11
  - SQL-backed Classic Report and Interactive Report BLOB display aliases must project `dbms_lob.getlength(<blob_expr>)`; Cards and Content Row must project the raw BLOB expression for display-image aliases.
12
12
  - Raw LOB projection is display-only. Do not sort, group, distinct, join, analytically partition/order, or compare raw LOB aliases; follow `SQL_PLSQL_LOB_COMPARISON_KEY_FORBIDDEN_001` in `20-data/apex.sql.md`.
13
13
  - Cards image display uses the native Cards media block, not report-style child columns.
14
- - Cards BLOB display uses `media { source: blobColumn blobColumn: <BLOB_COLUMN_ALIAS> }`.
15
- - Cards URL-column display uses `media { source: urlColumn urlColumn: <URL_COLUMN_ALIAS> }`.
16
- - Cards direct URL display uses `media { source: imageUrl url: <STATIC_IMAGE_URL_OR_COLUMN_SUBSTITUTION> }`; `url` may be a static URL or an APEX substitution such as `&IMAGE_URL_COLUMN.`.
14
+ - Cards BLOB display uses `media { advancedFormatting: false source: blobColumn blobColumn: <BLOB_COLUMN_ALIAS> position: first sizing: cover }`.
15
+ - Cards URL-column display uses `media { advancedFormatting: false source: urlColumn urlColumn: <URL_COLUMN_ALIAS> position: first sizing: cover }`.
16
+ - Cards direct URL display uses `media { advancedFormatting: false source: imageUrl url: <STATIC_IMAGE_URL_OR_COLUMN_SUBSTITUTION> position: first sizing: cover }`; `url` may be a static URL or an APEX substitution such as `&IMAGE_URL_COLUMN.`.
17
17
  - Cards BLOB metadata uses `blobAttributes { mimeTypeColumn: <MIME_TYPE_ALIAS> lastUpdatedColumn: <LAST_UPDATED_ALIAS> }`, and that block is valid only when `media.source: blobColumn` is present.
18
- - Cards media presentation defaults are represented by omission; do not emit APEXlang-side `position`, `appearance`, or `sizing` for default Cards media.
19
- - Cards media presentation properties are valid optional controls only for explicit non-default requirements: `position: first | background`, `appearance: square | widescreen`, and `sizing: cover`. Never emit `position: first`, `appearance: square`, or `sizing: cover` just to mirror APEX defaults.
18
+ - Native Cards media requires `advancedFormatting`, `position`, and, when `source` is set, `sizing`. Use deterministic defaults `advancedFormatting: false`, `position: first`, and `sizing: cover`.
19
+ - Supported presentation values are `position: first | body | background`, optional `appearance: square | widescreen`, and `sizing: fit | cover`.
20
+ - Map accessible image text with `media.imageDescription`; `accessibleDescription` is not a Cards media property in the APEX 26.1 grammar.
20
21
  - Cards regions with BLOB media must define `card.primaryKeyColumn1` and keep companion image metadata columns projected in SQL when available, but must not invent additional `media` or `blobAttributes` properties.
21
22
  - `Storage -> File Types` is Form-only for upload render roles and must be a comma-separated MIME-type list; `File Name Column` must be normalized to `Filename Column`.
22
23
  - `Alt Text Column` applies only to image upload/display flows and must not be used for plain file upload.
@@ -27,7 +27,13 @@
27
27
  - `skills/`
28
28
  - Direct-entrypoint skills, domain skills, agents, references, and assets.
29
29
  - `templates/`
30
- - Canonical template families and scenario docs.
30
+ - Canonical exact-match example families and renderer reference docs. Templates are not the primary syntax oracle.
31
+ - APEXlang grammar asset
32
+ - Syntax oracle for generated DSL shape.
33
+ - Compiler prop-map tools
34
+ - Compiler-backed semantic oracle for property, enum, slot, template-option, and component-variant legality.
35
+ - APEXlang structured contracts
36
+ - Compact pattern, IR, and package-layer contracts used before broad Markdown loading.
31
37
  - `applications/app_###/`
32
38
  - Final output root for generated application artifacts.
33
39
  - `artifacts/`
@@ -42,8 +48,10 @@
42
48
 
43
49
  ## Deterministic Routing
44
50
  - Natural-language routing relies on:
51
+ - `assets/rules.catalog.json`
45
52
  - `assets/apex-generation/components.registry.json`
46
53
  - `assets/rules-mapping.json`
54
+ - Non-trivial routing should produce a compact trace from normalized intent to rule/contract, grammar/compiler evidence, and exact template path only when needed.
47
55
  - Direct-entrypoint skills that support one-message invocation should expose a `Router Contract` section in `SKILL.md`.
48
56
  - Secondary reference docs must not redefine router behavior; they should point back to the owning skill.
49
57