spine-framework 0.4.4 → 0.5.0-rc.4

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 (283) hide show
  1. package/.env.example +13 -3
  2. package/.framework/cli/commands/bootstrap.ts +392 -0
  3. package/.framework/cli/commands/dev.ts +91 -218
  4. package/.framework/cli/commands/doctor.ts +132 -26
  5. package/.framework/cli/commands/generate.ts +38 -298
  6. package/.framework/cli/commands/init.ts +20 -1
  7. package/.framework/cli/commands/migrate.ts +36 -30
  8. package/.framework/cli/commands/migrations.ts +16 -56
  9. package/.framework/cli/commands/upgrade.ts +35 -0
  10. package/.framework/cli/commands/validate-schema.ts +147 -0
  11. package/.framework/cli/context.ts +223 -110
  12. package/.framework/cli/index.ts +6 -0
  13. package/.framework/cli/lib/project-files.ts +241 -1
  14. package/.framework/functions/_shared/hash-api-key.ts +183 -79
  15. package/.framework/functions/_shared/logging.ts +562 -224
  16. package/.framework/functions/_shared/middleware.ts +47 -44
  17. package/.framework/functions/admin-data.ts +39 -28
  18. package/.framework/functions/ai-agents.ts +10 -6
  19. package/.framework/functions/api-keys.ts +301 -122
  20. package/.framework/functions/apps.ts +43 -26
  21. package/.framework/functions/cil-ingest.ts +48 -15
  22. package/.framework/functions/debug-auth.ts +14 -8
  23. package/.framework/functions/deliveries.ts +39 -12
  24. package/.framework/functions/embeddings.ts +145 -76
  25. package/.framework/functions/integration-outbound.ts +67 -27
  26. package/.framework/functions/integrations.ts +254 -127
  27. package/.framework/functions/logs.ts +273 -133
  28. package/.framework/functions/observability.ts +277 -147
  29. package/.framework/functions/pipeline-executions.ts +1 -1
  30. package/.framework/functions/pipelines.ts +14 -9
  31. package/.framework/functions/prompt-configs.ts +7 -4
  32. package/.framework/functions/roles.ts +8 -5
  33. package/.framework/functions/security.ts +30 -17
  34. package/.framework/functions/system-cron.ts +240 -127
  35. package/.framework/functions/tests.ts +7 -6
  36. package/.framework/functions/timers.ts +310 -107
  37. package/.framework/functions/triggers.ts +28 -13
  38. package/.framework/functions/types.ts +13 -10
  39. package/.framework/migrations/069_log_stats_window.sql +54 -0
  40. package/.framework/migrations/070_app_type_schema_rpcs.sql +166 -0
  41. package/.framework/migrations/071_timer_interval_keys.sql +96 -0
  42. package/.framework/migrations/072_slug_autofill.sql +77 -0
  43. package/.framework/migrations/073_seed_member_roles.sql +26 -0
  44. package/.framework/src/apps/admin/index.tsx +1141 -775
  45. package/.framework/src/components/ErrorBoundary.tsx +136 -0
  46. package/.framework/src/components/admin/AdminListPage.tsx +81 -73
  47. package/.framework/src/components/admin/AdminSidebar.tsx +88 -79
  48. package/.framework/src/components/admin/EntitySelect.tsx +181 -0
  49. package/.framework/src/components/admin/PageInstructions.tsx +86 -127
  50. package/.framework/src/components/app-shell/GenericDetailPage.tsx +37 -13
  51. package/.framework/src/components/app-shell/GenericListPage.tsx +28 -32
  52. package/.framework/src/components/layout/Sidebar.tsx +300 -177
  53. package/.framework/src/components/runtime/DataDetailPage.tsx +67 -35
  54. package/.framework/src/components/runtime/DataHeader.tsx +96 -48
  55. package/.framework/src/components/runtime/DataListPage.tsx +3 -26
  56. package/.framework/src/components/runtime/DataStats.tsx +10 -10
  57. package/.framework/src/components/runtime/DataTable.tsx +12 -10
  58. package/.framework/src/components/ui/sheet.tsx +24 -26
  59. package/.framework/src/components/ui/textarea.tsx +74 -48
  60. package/.framework/src/hooks/useEntityList.ts +12 -9
  61. package/.framework/src/hooks/useListSchema.ts +108 -58
  62. package/.framework/src/instructions/README.md +57 -0
  63. package/.framework/src/instructions/ai-agents.md +69 -0
  64. package/.framework/src/instructions/alerts.md +80 -0
  65. package/.framework/src/instructions/api-keys.md +87 -0
  66. package/.framework/src/instructions/apps.md +77 -0
  67. package/.framework/src/instructions/concepts/ai-and-prompts.md +150 -0
  68. package/.framework/src/instructions/concepts/apps-and-renderers.md +162 -0
  69. package/.framework/src/instructions/concepts/auth-and-api-keys.md +133 -0
  70. package/.framework/src/instructions/concepts/automation.md +186 -0
  71. package/.framework/src/instructions/concepts/concurrency-and-idempotency.md +125 -0
  72. package/.framework/src/instructions/concepts/core-vs-custom.md +124 -0
  73. package/.framework/src/instructions/concepts/design-schema.md +152 -0
  74. package/.framework/src/instructions/concepts/integrations-and-webhooks.md +127 -0
  75. package/.framework/src/instructions/concepts/observability.md +116 -0
  76. package/.framework/src/instructions/concepts/permissions.md +150 -0
  77. package/.framework/src/instructions/concepts/runtime-records.md +111 -0
  78. package/.framework/src/instructions/concepts/scope-and-accounts.md +112 -0
  79. package/.framework/src/instructions/concepts/spine-way.md +172 -0
  80. package/.framework/src/instructions/deliveries.md +59 -0
  81. package/.framework/src/instructions/guide/00-orientation.md +106 -0
  82. package/.framework/src/instructions/guide/01-install-and-first-run.md +253 -0
  83. package/.framework/src/instructions/guide/02-project-map.md +147 -0
  84. package/.framework/src/instructions/guide/03-domain-model.md +223 -0
  85. package/.framework/src/instructions/guide/04-first-app.md +227 -0
  86. package/.framework/src/instructions/guide/05-glossary.md +183 -0
  87. package/.framework/src/instructions/integrations.md +96 -0
  88. package/.framework/src/instructions/internal/cil-markers.md +83 -0
  89. package/.framework/src/instructions/invites.md +60 -0
  90. package/.framework/src/instructions/kb.md +80 -0
  91. package/.framework/src/instructions/logs.md +77 -0
  92. package/.framework/src/instructions/observability.md +61 -0
  93. package/.framework/src/instructions/operations/deployment.md +115 -0
  94. package/.framework/src/instructions/operations/migrations.md +125 -0
  95. package/.framework/src/instructions/operations/security-checklist.md +148 -0
  96. package/.framework/src/instructions/operations/troubleshooting.md +170 -0
  97. package/.framework/src/instructions/operations/upgrade.md +116 -0
  98. package/.framework/src/instructions/pipeline-executions.md +62 -0
  99. package/.framework/src/instructions/pipelines.md +78 -0
  100. package/.framework/src/instructions/prompts.md +95 -0
  101. package/.framework/src/instructions/reference/api/admin-data.md +162 -0
  102. package/.framework/src/instructions/reference/api/auth.md +113 -0
  103. package/.framework/src/instructions/reference/api/errors-and-envelopes.md +113 -0
  104. package/.framework/src/instructions/reference/app-manifest.md +150 -0
  105. package/.framework/src/instructions/reference/cli.md +124 -0
  106. package/.framework/src/instructions/reference/database.md +132 -0
  107. package/.framework/src/instructions/reference/design-schema.md +280 -0
  108. package/.framework/src/instructions/reference/env-vars.md +133 -0
  109. package/.framework/src/instructions/reference/functions/account-nodes.md +75 -0
  110. package/.framework/src/instructions/reference/functions/admin-data.md +195 -0
  111. package/.framework/src/instructions/reference/functions/admin-funnel.md +90 -0
  112. package/.framework/src/instructions/reference/functions/admin-install-funnel.md +107 -0
  113. package/.framework/src/instructions/reference/functions/admin-signals.md +102 -0
  114. package/.framework/src/instructions/reference/functions/ai-agents.md +148 -0
  115. package/.framework/src/instructions/reference/functions/ai-interactions.md +156 -0
  116. package/.framework/src/instructions/reference/functions/api-keys.md +130 -0
  117. package/.framework/src/instructions/reference/functions/apps.md +140 -0
  118. package/.framework/src/instructions/reference/functions/auth.md +99 -0
  119. package/.framework/src/instructions/reference/functions/debug-auth.md +91 -0
  120. package/.framework/src/instructions/reference/functions/deliveries.md +110 -0
  121. package/.framework/src/instructions/reference/functions/embeddings.md +166 -0
  122. package/.framework/src/instructions/reference/functions/eval-harness.md +149 -0
  123. package/.framework/src/instructions/reference/functions/index.md +103 -0
  124. package/.framework/src/instructions/reference/functions/integration-outbound.md +200 -0
  125. package/.framework/src/instructions/reference/functions/integration-routes.md +151 -0
  126. package/.framework/src/instructions/reference/functions/integrations.md +130 -0
  127. package/.framework/src/instructions/reference/functions/invites.md +182 -0
  128. package/.framework/src/instructions/reference/functions/item-progress.md +107 -0
  129. package/.framework/src/instructions/reference/functions/kb.md +166 -0
  130. package/.framework/src/instructions/reference/functions/logs.md +141 -0
  131. package/.framework/src/instructions/reference/functions/observability.md +105 -0
  132. package/.framework/src/instructions/reference/functions/pipeline-executions.md +132 -0
  133. package/.framework/src/instructions/reference/functions/pipeline-runner-background.md +121 -0
  134. package/.framework/src/instructions/reference/functions/pipelines.md +136 -0
  135. package/.framework/src/instructions/reference/functions/prompt-configs.md +121 -0
  136. package/.framework/src/instructions/reference/functions/roles.md +121 -0
  137. package/.framework/src/instructions/reference/functions/security.md +140 -0
  138. package/.framework/src/instructions/reference/functions/system-cron.md +136 -0
  139. package/.framework/src/instructions/reference/functions/system.md +106 -0
  140. package/.framework/src/instructions/reference/functions/tests.md +97 -0
  141. package/.framework/src/instructions/reference/functions/timers.md +117 -0
  142. package/.framework/src/instructions/reference/functions/trigger-scheduler.md +102 -0
  143. package/.framework/src/instructions/reference/functions/triggers.md +140 -0
  144. package/.framework/src/instructions/reference/functions/types.md +146 -0
  145. package/.framework/src/instructions/reference/seeds.md +126 -0
  146. package/.framework/src/instructions/reference/shared-modules.md +127 -0
  147. package/.framework/src/instructions/reference/spine-config.md +114 -0
  148. package/.framework/src/instructions/roles.md +80 -0
  149. package/.framework/src/instructions/runtime-detail.md +70 -0
  150. package/.framework/src/instructions/runtime-list.md +77 -0
  151. package/.framework/src/instructions/security.md +67 -0
  152. package/.framework/src/instructions/tasks/add-a-pipeline.md +110 -0
  153. package/.framework/src/instructions/tasks/add-a-role.md +96 -0
  154. package/.framework/src/instructions/tasks/add-a-timer.md +114 -0
  155. package/.framework/src/instructions/tasks/add-a-trigger.md +106 -0
  156. package/.framework/src/instructions/tasks/add-a-type.md +151 -0
  157. package/.framework/src/instructions/tasks/add-a-webhook.md +108 -0
  158. package/.framework/src/instructions/tasks/add-an-ai-agent.md +108 -0
  159. package/.framework/src/instructions/tasks/add-an-integration.md +124 -0
  160. package/.framework/src/instructions/tasks/build-a-custom-page.md +118 -0
  161. package/.framework/src/instructions/tasks/package-and-install-an-app.md +127 -0
  162. package/.framework/src/instructions/tasks/test-your-code.md +108 -0
  163. package/.framework/src/instructions/tasks/write-a-function.md +132 -0
  164. package/.framework/src/instructions/tasks/write-a-migration.md +110 -0
  165. package/.framework/src/instructions/testing.md +59 -0
  166. package/.framework/src/instructions/timers.md +82 -0
  167. package/.framework/src/instructions/triggers.md +69 -0
  168. package/.framework/src/instructions/types.md +93 -0
  169. package/.framework/src/pages/NotFoundPage.tsx +62 -31
  170. package/.framework/src/pages/admin/AIAgentDetailPage.tsx +117 -106
  171. package/.framework/src/pages/admin/AIAgentsPage.tsx +86 -48
  172. package/.framework/src/pages/admin/APIKeyDetailPage.tsx +153 -152
  173. package/.framework/src/pages/admin/APIKeysPage.tsx +91 -90
  174. package/.framework/src/pages/admin/AlertsConfigPage.tsx +29 -18
  175. package/.framework/src/pages/admin/AppDetailPage.tsx +6 -60
  176. package/.framework/src/pages/admin/AppsPage.tsx +104 -66
  177. package/.framework/src/pages/admin/DeliveriesPage.tsx +5 -5
  178. package/.framework/src/pages/admin/EmbeddingDetailPage.tsx +5 -23
  179. package/.framework/src/pages/admin/EmbeddingsPage.tsx +5 -26
  180. package/.framework/src/pages/admin/IntegrationDetailPage.tsx +7 -7
  181. package/.framework/src/pages/admin/IntegrationsPage.tsx +85 -43
  182. package/.framework/src/pages/admin/LogsPage.tsx +144 -76
  183. package/.framework/src/pages/admin/ObservabilityDashboard.tsx +223 -140
  184. package/.framework/src/pages/admin/PipelineDetailPage.tsx +134 -113
  185. package/.framework/src/pages/admin/PipelineExecutionsPage.tsx +108 -45
  186. package/.framework/src/pages/admin/PipelinesPage.tsx +160 -115
  187. package/.framework/src/pages/admin/PromptConfigDetailPage.tsx +96 -98
  188. package/.framework/src/pages/admin/PromptConfigsPage.tsx +101 -59
  189. package/.framework/src/pages/admin/RoleDetailPage.tsx +90 -79
  190. package/.framework/src/pages/admin/RolesPage.tsx +86 -43
  191. package/.framework/src/pages/admin/SecurityPage.tsx +1 -1
  192. package/.framework/src/pages/admin/TestingDashboard.tsx +16 -28
  193. package/.framework/src/pages/admin/TimerDetailPage.tsx +117 -100
  194. package/.framework/src/pages/admin/TimersPage.tsx +90 -62
  195. package/.framework/src/pages/admin/TriggerDetailPage.tsx +90 -83
  196. package/.framework/src/pages/admin/TriggersPage.tsx +124 -99
  197. package/.framework/src/pages/admin/TypeDetailPage.tsx +152 -138
  198. package/.framework/src/pages/admin/TypesPage.tsx +90 -48
  199. package/.framework/src/pages/admin/cil/CILAgentPage.tsx +17 -25
  200. package/.framework/src/pages/admin/cil/CILChunkDetailPage.tsx +17 -27
  201. package/.framework/src/pages/admin/cil/CILDashboardPage.tsx +72 -40
  202. package/.framework/src/pages/admin/cil/CILFileListPage.tsx +321 -129
  203. package/.framework/src/pages/admin/cil/CILFileSelectPage.tsx +18 -29
  204. package/.framework/src/pages/admin/cil/CILGraphPage.tsx +26 -38
  205. package/.framework/src/pages/admin/cil/CILIngestionPage.tsx +34 -46
  206. package/.framework/src/pages/admin/cil/CILProjectsPage.tsx +189 -103
  207. package/.framework/src/pages/admin/cil/CILSearchPage.tsx +246 -136
  208. package/.framework/src/pages/admin/cil/CILSuggestionsPage.tsx +11 -22
  209. package/.framework/src/pages/admin/cil/CILVersionsPage.tsx +9 -20
  210. package/.framework/src/pages/admin/cil/FlexiblePipelinePage.tsx +26 -38
  211. package/.framework/src/pages/admin/kb/KBAdminPage.tsx +7 -26
  212. package/.framework/templates/agent/AGENTS.md +150 -0
  213. package/.framework/templates/agent/skills/spine-add-ai-agent/SKILL.md +58 -0
  214. package/.framework/templates/agent/skills/spine-add-automation/SKILL.md +62 -0
  215. package/.framework/templates/agent/skills/spine-add-integration/SKILL.md +63 -0
  216. package/.framework/templates/agent/skills/spine-architect/SKILL.md +86 -0
  217. package/.framework/templates/agent/skills/spine-install-app/SKILL.md +72 -0
  218. package/.framework/templates/agent/skills/spine-migration/SKILL.md +75 -0
  219. package/.framework/templates/agent/skills/spine-new-app/SKILL.md +67 -0
  220. package/.framework/templates/agent/skills/spine-new-function/SKILL.md +65 -0
  221. package/.framework/templates/agent/skills/spine-new-type/SKILL.md +65 -0
  222. package/.framework/templates/agent/skills/spine-schema/SKILL.md +77 -0
  223. package/.framework/templates/agent/skills/spine-test/SKILL.md +67 -0
  224. package/.framework/templates/agent/skills/spine-troubleshoot/SKILL.md +74 -0
  225. package/.framework/templates/agent/skills/spine-upgrade/SKILL.md +69 -0
  226. package/.framework/templates/project.json +4 -1
  227. package/.framework/tests/unit/account-scoping-gates.test.ts +392 -0
  228. package/.framework/tests/unit/agent-files.test.ts +355 -0
  229. package/.framework/tests/unit/agent-runner.test.ts +479 -44
  230. package/.framework/tests/unit/api-keys-create-scope-gate.test.ts +160 -0
  231. package/.framework/tests/unit/api-keys-omit-secret-fields.test.ts +38 -0
  232. package/.framework/tests/unit/bootstrap.test.ts +242 -0
  233. package/.framework/tests/unit/cli-context-api-key.test.ts +114 -0
  234. package/.framework/tests/unit/debug-auth.test.ts +38 -0
  235. package/.framework/tests/unit/deliveries-account-scoping.test.ts +185 -0
  236. package/.framework/tests/unit/integration-outbound-credentials.test.ts +167 -0
  237. package/.framework/tests/unit/integrations-audit-redaction.test.ts +130 -0
  238. package/.framework/tests/unit/logging-app-id.test.ts +75 -0
  239. package/.framework/tests/unit/system-context-denial.test.ts +145 -0
  240. package/.framework/tests/unit/system-cron.test.ts +240 -0
  241. package/.framework/tests/unit/timers.test.ts +159 -0
  242. package/README.md +125 -166
  243. package/config/tsconfig.cli.json +2 -2
  244. package/package.json +15 -4
  245. package/templates/project/package-lock.json +2 -2
  246. package/.framework/docs/admin-routes.md +0 -76
  247. package/.framework/docs/api-docs-progress.md +0 -38
  248. package/.framework/docs/api-governance.md +0 -146
  249. package/.framework/docs/api-testing-results.md +0 -212
  250. package/.framework/docs/assembly-launch-guide.md +0 -138
  251. package/.framework/docs/audit-results.md +0 -590
  252. package/.framework/docs/db-api-inventory.md +0 -95
  253. package/.framework/docs/gap-remediation-backlog.md +0 -103
  254. package/.framework/docs/ui-adoption-verification.md +0 -111
  255. package/.framework/docs/ui-api-coverage.md +0 -84
  256. package/.framework/docs/v2-compatibility-audit.md +0 -228
  257. package/.framework/mcp/index.ts +0 -133
  258. package/.framework/mcp/load-env.ts +0 -60
  259. package/.framework/mcp/shared/app-manifest.ts +0 -275
  260. package/.framework/mcp/shared/db.ts +0 -477
  261. package/.framework/mcp/shared/kb.ts +0 -118
  262. package/.framework/mcp/tools/architect.ts +0 -431
  263. package/.framework/mcp/tools/cil/context.ts +0 -345
  264. package/.framework/mcp/tools/cil/graph.ts +0 -242
  265. package/.framework/mcp/tools/cil/ingest.ts +0 -1217
  266. package/.framework/mcp/tools/cil/pipeline-orchestrator.ts +0 -693
  267. package/.framework/mcp/tools/cil/pipeline.ts +0 -767
  268. package/.framework/mcp/tools/cil/project.ts +0 -791
  269. package/.framework/mcp/tools/cil/retrieval.ts +0 -336
  270. package/.framework/mcp/tools/cil/search-core.ts +0 -454
  271. package/.framework/mcp/tools/cil/search.ts +0 -97
  272. package/.framework/mcp/tools/cil/suggest.ts +0 -186
  273. package/.framework/mcp/tools/cil/validate.ts +0 -1369
  274. package/.framework/mcp/tools/kb/delete.ts +0 -139
  275. package/.framework/mcp/tools/kb/index.ts +0 -52
  276. package/.framework/mcp/tools/kb/ingest.ts +0 -84
  277. package/.framework/mcp/tools/kb/list-types.ts +0 -102
  278. package/.framework/mcp/tools/kb/publish.ts +0 -100
  279. package/.framework/mcp/tools/kb/reindex.ts +0 -86
  280. package/.framework/mcp/tools/kb/revoke.ts +0 -85
  281. package/.framework/mcp/tools/kb/search.ts +0 -101
  282. package/.framework/mcp/tools/kb/upsert.ts +0 -125
  283. package/.framework/mcp/tools/observability.ts +0 -510
@@ -1,14 +1,29 @@
1
1
  // CIL[BEGIN stable_id="~/.framework/src/pages/admin/cil/CILSearchPage.tsx:module_header:module_header" type="module_header" identity="module_header" parent="~/.framework/src/pages/admin/cil/CILSearchPage.tsx"]
2
- // CIL[DOC-MACRO purpose="Provides the React page for searching indexed CIL code chunks across projects with hybrid, semantic, or text modes."]
3
- // CIL[DOC-RESPONSIBILITY responsibility="Import dependencies, define shared types and helper components, and export the default CILSearchPage component."]
4
- // CIL[DOC-CONTEXT module="admin/cil" layer="ui" related_files=".framework/src/components/admin/PageInstructions.tsx,.framework/src/components/ui/badge.tsx,.framework/src/components/ui/button.tsx,.framework/src/components/ui/card.tsx,.framework/src/components/ui/input.tsx,.framework/src/components/ui/label.tsx,.framework/src/components/ui/select.tsx,.framework/src/lib/api.ts"]
5
- // CIL[DOC-CONTRACT inputs="none" outputs="default export CILSearchPage React component" errors="none" side_effects="none"]
6
- // CIL[DOC-MICRO logic_summary="Sets up the CIL search UI layout, search controls, result list and filters." notable_decisions="[]"]
7
- // CIL[DOC-CONFIDENCE pass="second" score="0.90" flags="none"]
8
- // CIL[DOC-STABILITY stability="stable"]
9
- // CIL[DOC-AUDIENCE audience="admin UI developers maintaining the CIL search interface"]
10
-
11
- import { useState, useRef, useMemo } from 'react'
2
+ /**
3
+ * @module CILSearchPage
4
+ * @audience both
5
+ * @layer shared-core
6
+ * @stability stable
7
+ *
8
+ * CILSearchPage is a React component that facilitates searching within the CIL (Common Intermediate Language) context in the admin panel. It integrates various UI components to provide a user-friendly interface for inputting search criteria and displaying results.
9
+ * INVARIANT: The component relies on the correct configuration of API endpoints for fetching data.
10
+ *
11
+ * @seeAlso apiFetch (used for making API calls).
12
+ * @seeAlso PageInstructions (provides contextual guidance for users).
13
+ *
14
+ * @cil-generated
15
+ */
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+ import { useState, useRef, useMemo, useEffect } from 'react'
12
27
  import { apiFetch } from '@core/lib/api'
13
28
  import { Card, CardContent } from '@core/components/ui/card'
14
29
  import { Button } from '@core/components/ui/button'
@@ -16,6 +31,7 @@ import { Badge } from '@core/components/ui/badge'
16
31
  import { Input } from '@core/components/ui/input'
17
32
  import { Label } from '@core/components/ui/label'
18
33
  import {
34
+ // CIL[END stable_id="~/.framework/src/pages/admin/cil/CILSearchPage.tsx:module_header:module_header"]
19
35
  Select,
20
36
  SelectContent,
21
37
  SelectItem,
@@ -34,24 +50,32 @@ import {
34
50
 
35
51
 
36
52
 
37
- import { PageInstructions } from '../../../components/admin/PageInstructions'
38
53
 
39
- // CIL[DOC-VECTOR type="context" content="purpose='Provides the React page for searching indexed CIL code chunks across projects with hybrid, semantic, or text modes.'; No verified external callers; imports: .framework/src/lib/api.ts,.framework/src/components/ui/card.tsx,.framework/src/components/ui/button.tsx"]
40
- // CIL[DOC-VECTOR type="blast_radius" content="No direct caller data from CIL graph; local impact only"]
41
- // CIL[DOC-VECTOR type="configuration" content="No environment or build configuration dependencies identified"]
42
- // CIL[DOC-VECTOR type="constraint" content="Standard runtime; no special invariants documented"]
43
- // CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
44
- // CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
45
- // CIL[END stable_id="~/.framework/src/pages/admin/cil/CILSearchPage.tsx:module_header:module_header"]
46
- // CIL[BEGIN stable_id="~/.framework/src/pages/admin/cil/CILSearchPage.tsx:SearchResult:interface" type="interface" identity="SearchResult" parent="~/.framework/src/pages/admin/cil/CILSearchPage.tsx"]
47
- // CIL[DOC-MACRO purpose="Defines the shape of a CIL search result returned by the code intelligence search API."]
48
- // CIL[DOC-RESPONSIBILITY responsibility="Declare the data contract for search result objects including metadata and similarity scores."]
49
- // CIL[DOC-CONTEXT module="admin/cil" layer="type" related_files=".framework/src/components/admin/PageInstructions.tsx,.framework/src/components/ui/badge.tsx,.framework/src/components/ui/button.tsx,.framework/src/components/ui/card.tsx,.framework/src/components/ui/input.tsx,.framework/src/components/ui/label.tsx,.framework/src/components/ui/select.tsx,.framework/src/lib/api.ts,.framework/src/pages/admin/cil/CILSearchPage.tsx"]
50
- // CIL[DOC-CONTRACT inputs="none" outputs="SearchResult interface type" errors="none" side_effects="none"]
51
- // CIL[DOC-MICRO logic_summary="Specifies fields: id, chunk_name, file_path, macro, micro, chunk_type, doc_confidence, similarity, match_type." notable_decisions="[]"]
52
- // CIL[DOC-CONFIDENCE pass="second" score="0.90" flags="none"]
53
- // CIL[DOC-STABILITY stability="stable"]
54
54
 
55
+
56
+
57
+
58
+
59
+
60
+
61
+
62
+
63
+
64
+
65
+
66
+
67
+
68
+
69
+
70
+
71
+ // CIL[BEGIN stable_id="~/.framework/src/pages/admin/cil/CILSearchPage.tsx:SearchResult:interface" type="interface" identity="SearchResult" parent="~/.framework/src/pages/admin/cil/CILSearchPage.tsx"]
72
+ /**
73
+ * The SearchResult interface defines the structure of search results returned from a search operation, encapsulating essential metadata about each result. It exists to standardize the representation of search results across the application.
74
+ *
75
+ * @sideEffects none
76
+ * @stability internal
77
+ * @cil-generated
78
+ */
55
79
  interface SearchResult {
56
80
  id: string
57
81
  chunk_name: string
@@ -63,12 +87,6 @@ interface SearchResult {
63
87
  similarity: number | null
64
88
  match_type: 'semantic' | 'text'
65
89
  }
66
- // CIL[DOC-VECTOR type="context" content="purpose='Defines the shape of a CIL search result returned by the code intelligence search API.'; No verified external callers; imports: .framework/src/lib/api.ts,.framework/src/components/ui/card.tsx,.framework/src/components/ui/button.tsx"]
67
- // CIL[DOC-VECTOR type="blast_radius" content="No direct caller data from CIL graph; local impact only"]
68
- // CIL[DOC-VECTOR type="configuration" content="No environment or build configuration dependencies identified"]
69
- // CIL[DOC-VECTOR type="constraint" content="Standard runtime; no special invariants documented"]
70
- // CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
71
- // CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
72
90
  // CIL[END stable_id="~/.framework/src/pages/admin/cil/CILSearchPage.tsx:SearchResult:interface"]
73
91
 
74
92
 
@@ -77,15 +95,32 @@ interface SearchResult {
77
95
 
78
96
 
79
97
 
80
- // CIL[BEGIN stable_id="~/.framework/src/pages/admin/cil/CILSearchPage.tsx:CHUNK_TYPE_COLORS:constant" type="constant" identity="CHUNK_TYPE_COLORS" parent="~/.framework/src/pages/admin/cil/CILSearchPage.tsx"]
81
- // CIL[DOC-MACRO purpose="Maps chunk type names to Tailwind CSS color class strings used in result badges."]
82
- // CIL[DOC-RESPONSIBILITY responsibility="Provide visual styling classes for chunk type badges in search results."]
83
- // CIL[DOC-CONTEXT module="admin/cil" layer="ui" related_files=".framework/src/components/admin/PageInstructions.tsx,.framework/src/components/ui/badge.tsx,.framework/src/components/ui/button.tsx,.framework/src/components/ui/card.tsx,.framework/src/components/ui/input.tsx,.framework/src/components/ui/label.tsx,.framework/src/components/ui/select.tsx,.framework/src/lib/api.ts,.framework/src/pages/admin/cil/CILSearchPage.tsx"]
84
- // CIL[DOC-CONTRACT inputs="chunk_type: string" outputs="Tailwind class string" errors="unknown type falls back to config style" side_effects="none"]
85
- // CIL[DOC-MICRO logic_summary="Record of style classes keyed by chunk type for consistent badge rendering." notable_decisions="[]"]
86
- // CIL[DOC-CONFIDENCE pass="second" score="0.90" flags="none"]
87
- // CIL[DOC-STABILITY stability="stable"]
88
98
 
99
+
100
+
101
+
102
+
103
+
104
+
105
+
106
+
107
+
108
+
109
+
110
+
111
+
112
+
113
+
114
+
115
+
116
+ // CIL[BEGIN stable_id="~/.framework/src/pages/admin/cil/CILSearchPage.tsx:CHUNK_TYPE_COLORS:constant" type="constant" identity="CHUNK_TYPE_COLORS" parent="~/.framework/src/pages/admin/cil/CILSearchPage.tsx"]
117
+ /**
118
+ * CHUNK_TYPE_COLORS is a constant that maps various chunk types to their corresponding CSS class strings for styling purposes. It provides a centralized way to manage the visual representation of different code elements in the admin interface.
119
+ *
120
+ * @sideEffects none
121
+ * @stability internal
122
+ * @cil-generated
123
+ */
89
124
  const CHUNK_TYPE_COLORS: Record<string, string> = {
90
125
  function: 'bg-indigo-100 text-indigo-700 border-indigo-200',
91
126
  class: 'bg-violet-100 text-violet-700 border-violet-200',
@@ -96,12 +131,6 @@ const CHUNK_TYPE_COLORS: Record<string, string> = {
96
131
  route: 'bg-red-100 text-red-700 border-red-200',
97
132
  config: 'bg-slate-100 text-slate-700 border-slate-200',
98
133
  }
99
- // CIL[DOC-VECTOR type="context" content="purpose='Maps chunk type names to Tailwind CSS color class strings used in result badges.'; No verified external callers; imports: .framework/src/lib/api.ts,.framework/src/components/ui/card.tsx,.framework/src/components/ui/button.tsx"]
100
- // CIL[DOC-VECTOR type="blast_radius" content="No direct caller data from CIL graph; local impact only"]
101
- // CIL[DOC-VECTOR type="configuration" content="No environment or build configuration dependencies identified"]
102
- // CIL[DOC-VECTOR type="constraint" content="Standard runtime; no special invariants documented"]
103
- // CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
104
- // CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
105
134
  // CIL[END stable_id="~/.framework/src/pages/admin/cil/CILSearchPage.tsx:CHUNK_TYPE_COLORS:constant"]
106
135
 
107
136
 
@@ -112,26 +141,37 @@ const CHUNK_TYPE_COLORS: Record<string, string> = {
112
141
 
113
142
 
114
143
 
115
- // CIL[BEGIN stable_id="~/.framework/src/pages/admin/cil/CILSearchPage.tsx:DOC_CONFIDENCE_LABEL:constant" type="constant" identity="DOC_CONFIDENCE_LABEL" parent="~/.framework/src/pages/admin/cil/CILSearchPage.tsx"]
116
- // CIL[DOC-MACRO purpose="Maps documentation confidence levels to badge labels and Tailwind CSS classes."]
117
- // CIL[DOC-RESPONSIBILITY responsibility="Render confidence badges in search result cards."]
118
- // CIL[DOC-CONTEXT module="admin/cil" layer="ui" related_files=".framework/src/components/admin/PageInstructions.tsx,.framework/src/components/ui/badge.tsx,.framework/src/components/ui/button.tsx,.framework/src/components/ui/card.tsx,.framework/src/components/ui/input.tsx,.framework/src/components/ui/label.tsx,.framework/src/components/ui/select.tsx,.framework/src/lib/api.ts,.framework/src/pages/admin/cil/CILSearchPage.tsx"]
119
- // CIL[DOC-CONTRACT inputs="doc_confidence: string" outputs="{ label: string; className: string }" errors="unknown key falls back to unverified_legacy style" side_effects="none"]
120
- // CIL[DOC-MICRO logic_summary="Record of display labels and styling classes for each documentation confidence tier." notable_decisions="[]"]
121
- // CIL[DOC-CONFIDENCE pass="second" score="0.90" flags="none"]
122
- // CIL[DOC-STABILITY stability="stable"]
123
144
 
145
+
146
+
147
+
148
+
149
+
150
+
151
+
152
+
153
+
154
+
155
+
156
+
157
+
158
+
159
+
160
+
161
+
162
+ // CIL[BEGIN stable_id="~/.framework/src/pages/admin/cil/CILSearchPage.tsx:DOC_CONFIDENCE_LABEL:constant" type="constant" identity="DOC_CONFIDENCE_LABEL" parent="~/.framework/src/pages/admin/cil/CILSearchPage.tsx"]
163
+ /**
164
+ * DOC_CONFIDENCE_LABEL is a constant that maps document confidence statuses to their corresponding labels and CSS class names for styling. It provides a standardized way to display the confidence level of documents in the user interface.
165
+ *
166
+ * @sideEffects none
167
+ * @stability internal
168
+ * @cil-generated
169
+ */
124
170
  const DOC_CONFIDENCE_LABEL: Record<string, { label: string; className: string }> = {
125
171
  human_verified: { label: 'Verified', className: 'bg-green-100 text-green-700 border-green-200' },
126
172
  ai_generated: { label: 'AI Docs', className: 'bg-blue-100 text-blue-700 border-blue-200' },
127
173
  unverified_legacy: { label: 'No Docs', className: 'bg-slate-100 text-slate-500 border-slate-200' },
128
174
  }
129
- // CIL[DOC-VECTOR type="context" content="purpose='Maps documentation confidence levels to badge labels and Tailwind CSS classes.'; No verified external callers; imports: .framework/src/lib/api.ts,.framework/src/components/ui/card.tsx,.framework/src/components/ui/button.tsx"]
130
- // CIL[DOC-VECTOR type="blast_radius" content="No direct caller data from CIL graph; local impact only"]
131
- // CIL[DOC-VECTOR type="configuration" content="No environment or build configuration dependencies identified"]
132
- // CIL[DOC-VECTOR type="constraint" content="Standard runtime; no special invariants documented"]
133
- // CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
134
- // CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
135
175
  // CIL[END stable_id="~/.framework/src/pages/admin/cil/CILSearchPage.tsx:DOC_CONFIDENCE_LABEL:constant"]
136
176
 
137
177
 
@@ -139,15 +179,37 @@ const DOC_CONFIDENCE_LABEL: Record<string, { label: string; className: string }>
139
179
 
140
180
 
141
181
 
142
- // CIL[BEGIN stable_id="~/.framework/src/pages/admin/cil/CILSearchPage.tsx:SimilarityBar:component" type="component" identity="SimilarityBar" parent="~/.framework/src/pages/admin/cil/CILSearchPage.tsx"]
143
- // CIL[DOC-MACRO purpose="Render a small progress bar showing the semantic search similarity score percentage."]
144
- // CIL[DOC-RESPONSIBILITY responsibility="Display a visual percentage bar for a single result score."]
145
- // CIL[DOC-CONTEXT module="admin/cil" layer="ui" related_files=".framework/src/components/admin/PageInstructions.tsx,.framework/src/components/ui/badge.tsx,.framework/src/components/ui/button.tsx,.framework/src/components/ui/card.tsx,.framework/src/components/ui/input.tsx,.framework/src/components/ui/label.tsx,.framework/src/components/ui/select.tsx,.framework/src/lib/api.ts,.framework/src/pages/admin/cil/CILSearchPage.tsx"]
146
- // CIL[DOC-CONTRACT inputs="score: number | null" outputs="JSX progress bar or null" errors="none" side_effects="none"]
147
- // CIL[DOC-MICRO logic_summary="Converts score to percentage and renders a fixed-width bar with an inline numeric label." notable_decisions="[]"]
148
- // CIL[DOC-CONFIDENCE pass="second" score="0.90" flags="none"]
149
- // CIL[DOC-STABILITY stability="stable"]
150
182
 
183
+
184
+
185
+
186
+
187
+
188
+
189
+
190
+
191
+
192
+
193
+
194
+
195
+
196
+
197
+
198
+
199
+
200
+ // CIL[BEGIN stable_id="~/.framework/src/pages/admin/cil/CILSearchPage.tsx:SimilarityBar:component" type="component" identity="SimilarityBar" parent="~/.framework/src/pages/admin/cil/CILSearchPage.tsx"]
201
+ /**
202
+ * The SimilarityBar component visually represents a similarity score as a percentage bar, enhancing user experience in the CIL search page. It provides a quick visual indication of similarity.
203
+ *
204
+ * @macro UI component for displaying similarity scores.
205
+ * @micro Calculates the percentage from a score and renders a progress bar accordingly.
206
+ * @inputSpec
207
+ * score: number | null — the similarity score to be displayed, or null to indicate no score.
208
+ * @outputSpec JSX.Element | null — returns a visual representation of the score or null if the score is null.
209
+ * @sideEffects none
210
+ * @stability internal
211
+ * @cil-generated
212
+ */
151
213
  function SimilarityBar({ score }: { score: number | null }) {
152
214
  if (score === null) return null
153
215
  const pct = Math.round(score * 100)
@@ -157,44 +219,82 @@ function SimilarityBar({ score }: { score: number | null }) {
157
219
  <div
158
220
  className="h-full bg-indigo-500 rounded-full"
159
221
  style={{ width: `${pct}%` }}
222
+
160
223
  />
161
224
  </div>
162
225
  <span className="text-xs text-muted-foreground tabular-nums">{pct}%</span>
163
226
  </div>
164
227
  )
165
228
  }
166
- // CIL[DOC-VECTOR type="context" content="purpose='Render a small progress bar showing the semantic search similarity score percentage.'; No verified external callers; imports: .framework/src/lib/api.ts,.framework/src/components/ui/card.tsx,.framework/src/components/ui/button.tsx"]
167
- // CIL[DOC-VECTOR type="blast_radius" content="No direct caller data from CIL graph; local impact only"]
168
- // CIL[DOC-VECTOR type="configuration" content="No environment or build configuration dependencies identified"]
169
- // CIL[DOC-VECTOR type="constraint" content="Standard runtime; no special invariants documented"]
170
- // CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
171
- // CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
172
229
  // CIL[END stable_id="~/.framework/src/pages/admin/cil/CILSearchPage.tsx:SimilarityBar:component"]
173
230
 
174
- // CIL[BEGIN stable_id="~/.framework/src/pages/admin/cil/CILSearchPage.tsx:ResultCard:component" type="component" identity="ResultCard" parent="~/.framework/src/pages/admin/cil/CILSearchPage.tsx"]
175
- // CIL[DOC-MACRO purpose="Display a single CIL search result as a clickable card with metadata and similarity score."]
176
- // CIL[DOC-RESPONSIBILITY responsibility="Render chunk name, type, confidence, file path, macro preview, and link to chunk detail."]
177
- // CIL[DOC-CONTEXT module="admin/cil" layer="ui" related_files=".framework/src/components/admin/PageInstructions.tsx,.framework/src/components/ui/badge.tsx,.framework/src/components/ui/button.tsx,.framework/src/components/ui/card.tsx,.framework/src/components/ui/input.tsx,.framework/src/components/ui/label.tsx,.framework/src/components/ui/select.tsx,.framework/src/lib/api.ts,.framework/src/pages/admin/cil/CILSearchPage.tsx"]
178
- // CIL[DOC-CONTRACT inputs="result: SearchResult, projectId: string" outputs="JSX clickable card" errors="none" side_effects="navigates on click to chunk detail"]
179
- // CIL[DOC-MICRO logic_summary="Builds an app path, selects style classes, and returns a Card linking to the chunk detail view." notable_decisions="[]"]
180
- // CIL[DOC-CONFIDENCE pass="second" score="0.90" flags="none"]
181
- // CIL[DOC-STABILITY stability="stable"]
231
+
232
+
233
+
234
+
235
+
236
+
237
+
238
+
239
+
240
+
241
+
242
+
243
+
244
+
245
+
182
246
 
183
247
  function ResultCard({ result, projectId }: { result: SearchResult; projectId: string }) {
184
248
 
185
249
 
250
+
251
+ // CIL[BEGIN stable_id="~/.framework/src/pages/admin/cil/CILSearchPage.tsx:appPath:function" type="function" identity="appPath" parent="~/.framework/src/pages/admin/cil/CILSearchPage.tsx:ResultCard:component"]
252
+ /**
253
+ * The appPath function constructs a complete application path by appending a given path to a base URL. It ensures that the resulting path is correctly formatted with a leading slash if necessary.
254
+ *
255
+ * @inputSpec
256
+ * path: string (required) — the path to append to the base URL.
257
+ * @outputSpec string — the complete application path.
258
+ * @sideEffects none
259
+ * @stability internal
260
+ * @cil-generated
261
+ */
186
262
  const appPath = (path: string) => '/spine-framework/admin' + (path.startsWith('/') ? path : '/' + path)
263
+ // CIL[END stable_id="~/.framework/src/pages/admin/cil/CILSearchPage.tsx:appPath:function"]
264
+
187
265
 
188
266
 
189
267
 
190
268
 
269
+
270
+ // CIL[BEGIN stable_id="~/.framework/src/pages/admin/cil/CILSearchPage.tsx:typeClass:constant" type="constant" identity="typeClass" parent="~/.framework/src/pages/admin/cil/CILSearchPage.tsx:ResultCard:component"]
271
+ /**
272
+ * The constant 'typeClass' determines the color associated with a specific chunk type from the CHUNK_TYPE_COLORS mapping. It provides a default color for configuration chunks when the result's chunk type is not found in the mapping.
273
+ *
274
+ * @sideEffects none
275
+ * @stability internal
276
+ * @cil-generated
277
+ */
191
278
  const typeClass = CHUNK_TYPE_COLORS[result.chunk_type] || CHUNK_TYPE_COLORS.config
279
+ // CIL[END stable_id="~/.framework/src/pages/admin/cil/CILSearchPage.tsx:typeClass:constant"]
280
+
281
+
192
282
 
193
283
 
194
284
 
195
285
 
196
286
 
287
+ // CIL[BEGIN stable_id="~/.framework/src/pages/admin/cil/CILSearchPage.tsx:docCfg:constant" type="constant" identity="docCfg" parent="~/.framework/src/pages/admin/cil/CILSearchPage.tsx:ResultCard:component"]
288
+ /**
289
+ * The constant 'docCfg' retrieves the configuration for document confidence based on the result's confidence level, providing a fallback to an unverified legacy label if the confidence level is not defined.
290
+ *
291
+ * @sideEffects none
292
+ * @stability internal
293
+ * @cil-generated
294
+ */
197
295
  const docCfg = DOC_CONFIDENCE_LABEL[result.doc_confidence] || DOC_CONFIDENCE_LABEL.unverified_legacy
296
+ // CIL[END stable_id="~/.framework/src/pages/admin/cil/CILSearchPage.tsx:docCfg:constant"]
297
+
198
298
 
199
299
 
200
300
  return (
@@ -238,13 +338,6 @@ function ResultCard({ result, projectId }: { result: SearchResult; projectId: st
238
338
  </a>
239
339
  )
240
340
  }
241
- // CIL[DOC-VECTOR type="context" content="purpose='Display a single CIL search result as a clickable card with metadata and similarity score.'; No verified external callers; imports: .framework/src/lib/api.ts,.framework/src/components/ui/card.tsx,.framework/src/components/ui/button.tsx"]
242
- // CIL[DOC-VECTOR type="blast_radius" content="No direct caller data from CIL graph; local impact only"]
243
- // CIL[DOC-VECTOR type="configuration" content="No environment or build configuration dependencies identified"]
244
- // CIL[DOC-VECTOR type="constraint" content="Standard runtime; no special invariants documented"]
245
- // CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
246
- // CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
247
- // CIL[END stable_id="~/.framework/src/pages/admin/cil/CILSearchPage.tsx:ResultCard:component"]
248
341
 
249
342
 
250
343
 
@@ -254,35 +347,49 @@ function ResultCard({ result, projectId }: { result: SearchResult; projectId: st
254
347
 
255
348
 
256
349
 
257
- // CIL[BEGIN stable_id="~/.framework/src/pages/admin/cil/CILSearchPage.tsx:SortBy:type" type="type" identity="SortBy" parent="~/.framework/src/pages/admin/cil/CILSearchPage.tsx"]
258
- // CIL[DOC-MACRO purpose="Declare union types for search result sorting, type filtering, and documentation confidence filtering."]
259
- // CIL[DOC-RESPONSIBILITY responsibility="Constrain filter and sort state values to allowed string literals."]
260
- // CIL[DOC-CONTEXT module="admin/cil" layer="type" related_files=".framework/src/components/admin/PageInstructions.tsx,.framework/src/components/ui/badge.tsx,.framework/src/components/ui/button.tsx,.framework/src/components/ui/card.tsx,.framework/src/components/ui/input.tsx,.framework/src/components/ui/label.tsx,.framework/src/components/ui/select.tsx,.framework/src/lib/api.ts,.framework/src/pages/admin/cil/CILSearchPage.tsx"]
261
- // CIL[DOC-CONTRACT inputs="none" outputs="SortBy, ChunkTypeFilter, DocConfidenceFilter type aliases" errors="none" side_effects="none"]
262
- // CIL[DOC-MICRO logic_summary="Defines union type literals for sort keys, chunk type and documentation confidence filters." notable_decisions="[]"]
263
- // CIL[DOC-CONFIDENCE pass="second" score="0.90" flags="none"]
264
- // CIL[DOC-STABILITY stability="stable"]
265
350
 
351
+
352
+
353
+
354
+
355
+
356
+
357
+
358
+
359
+
360
+
361
+
362
+
363
+
364
+
365
+
366
+ // CIL[BEGIN stable_id="~/.framework/src/pages/admin/cil/CILSearchPage.tsx:SortBy:type" type="type" identity="SortBy" parent="~/.framework/src/pages/admin/cil/CILSearchPage.tsx"]
266
367
  type SortBy = 'relevance' | 'name' | 'file' | 'doc_confidence'
368
+ // CIL[END stable_id="~/.framework/src/pages/admin/cil/CILSearchPage.tsx:SortBy:type"]
369
+ // CIL[BEGIN stable_id="~/.framework/src/pages/admin/cil/CILSearchPage.tsx:ChunkTypeFilter:type" type="type" identity="ChunkTypeFilter" parent="~/.framework/src/pages/admin/cil/CILSearchPage.tsx"]
267
370
  type ChunkTypeFilter = 'all' | 'function' | 'class' | 'interface' | 'type' | 'component' | 'hook' | 'route' | 'config'
371
+ // CIL[END stable_id="~/.framework/src/pages/admin/cil/CILSearchPage.tsx:ChunkTypeFilter:type"]
372
+ // CIL[BEGIN stable_id="~/.framework/src/pages/admin/cil/CILSearchPage.tsx:DocConfidenceFilter:type" type="type" identity="DocConfidenceFilter" parent="~/.framework/src/pages/admin/cil/CILSearchPage.tsx"]
268
373
  type DocConfidenceFilter = 'all' | 'human_verified' | 'ai_generated' | 'unverified_legacy'
269
- // CIL[DOC-VECTOR type="context" content="purpose='Declare union types for search result sorting, type filtering, and documentation confidence filtering.'; No verified external callers; imports: .framework/src/lib/api.ts,.framework/src/components/ui/card.tsx,.framework/src/components/ui/button.tsx"]
270
- // CIL[DOC-VECTOR type="blast_radius" content="No direct caller data from CIL graph; local impact only"]
271
- // CIL[DOC-VECTOR type="configuration" content="No environment or build configuration dependencies identified"]
272
- // CIL[DOC-VECTOR type="constraint" content="Standard runtime; no special invariants documented"]
273
- // CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
274
- // CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
275
- // CIL[END stable_id="~/.framework/src/pages/admin/cil/CILSearchPage.tsx:SortBy:type"]
374
+ // CIL[END stable_id="~/.framework/src/pages/admin/cil/CILSearchPage.tsx:DocConfidenceFilter:type"]
375
+
376
+
377
+
378
+
379
+
380
+
381
+
382
+
383
+
384
+
385
+
276
386
 
277
- // CIL[BEGIN stable_id="~/.framework/src/pages/admin/cil/CILSearchPage.tsx:CILSearchPage:component" type="component" identity="CILSearchPage" parent="~/.framework/src/pages/admin/cil/CILSearchPage.tsx"]
278
- // CIL[DOC-MACRO purpose="Render the full CIL chunk search page with query controls, filters, and result list."]
279
- // CIL[DOC-RESPONSIBILITY responsibility="Manage search state, fetch results, apply client-side filters and sorting, and render the UI."]
280
- // CIL[DOC-CONTEXT module="admin/cil" layer="ui" related_files=".framework/src/components/admin/PageInstructions.tsx,.framework/src/components/ui/badge.tsx,.framework/src/components/ui/button.tsx,.framework/src/components/ui/card.tsx,.framework/src/components/ui/input.tsx,.framework/src/components/ui/label.tsx,.framework/src/components/ui/select.tsx,.framework/src/lib/api.ts,.framework/src/pages/admin/cil/CILSearchPage.tsx"]
281
- // CIL[DOC-CONTRACT inputs="none" outputs="JSX search page" errors="Sets error state on API failure" side_effects="Calls /api/cil-graph search endpoint"]
282
- // CIL[DOC-MICRO logic_summary="Maintains query, project, mode, filters and sort state; performs apiFetch to /api/cil-graph; filters and sorts results; renders suggestions and result cards." notable_decisions="[]"]
283
- // CIL[DOC-CONFIDENCE pass="second" score="0.90" flags="none"]
284
- // CIL[DOC-STABILITY stability="stable"]
285
387
 
388
+
389
+
390
+
391
+
392
+ // CIL[BEGIN stable_id="~/.framework/src/pages/admin/cil/CILSearchPage.tsx:CILSearchPage:component" type="component" identity="CILSearchPage" parent="~/.framework/src/pages/admin/cil/CILSearchPage.tsx"]
286
393
  export default function CILSearchPage() {
287
394
  const appPath = (path: string) => '/spine-framework/admin' + (path.startsWith('/') ? path : '/' + path)
288
395
  const [query, setQuery] = useState('')
@@ -296,8 +403,16 @@ export default function CILSearchPage() {
296
403
  const [loading, setLoading] = useState(false)
297
404
  const [searched, setSearched] = useState(false)
298
405
  const [error, setError] = useState<string | null>(null)
406
+ const [projects, setProjects] = useState<{ id: string; title: string }[]>([])
299
407
  const inputRef = useRef<HTMLInputElement>(null)
300
408
 
409
+ useEffect(() => {
410
+ apiFetch('/api/cil-project?action=list')
411
+ .then(r => r.json())
412
+ .then(data => setProjects(data?.projects || []))
413
+ .catch(() => {})
414
+ }, [])
415
+
301
416
  const handleSearch = async () => {
302
417
  if (!query.trim()) return
303
418
  setLoading(true)
@@ -361,17 +476,6 @@ export default function CILSearchPage() {
361
476
  Semantic + text search across all indexed code chunks
362
477
  </p>
363
478
  </div>
364
-
365
- <PageInstructions
366
- description="Search the Code Intelligence Layer index by meaning or text."
367
- sections={[
368
- { title: 'What this page is for', content: 'This page lets you find indexed code chunks across projects using hybrid, semantic, or text search.' },
369
- { title: 'How to use this page', content: 'Enter a query, choose a mode, and click the search button or press Enter. Use the Project ID, Type, Docs, and Sort filters to narrow results.' },
370
- { title: 'How to read the results', content: 'Each result shows the chunk name, file, type, documentation confidence, and a relevance score. Semantic mode ranks by vector similarity; text mode matches literal terms.' },
371
- { title: 'Important notes', content: 'Hybrid mode combines vector and text ranking. Filters can exclude results, and the count line indicates how many of the total results are displayed after filtering.' },
372
- ]}
373
- />
374
-
375
479
  {}
376
480
  <div className="space-y-3">
377
481
  <div className="flex gap-2">
@@ -410,13 +514,18 @@ export default function CILSearchPage() {
410
514
  </div>
411
515
 
412
516
  <div className="flex items-center gap-2">
413
- <Label className="text-xs text-muted-foreground">Project ID</Label>
414
- <Input
415
- placeholder="(all projects)"
416
- value={projectId}
417
- onChange={e => setProjectId(e.target.value)}
418
- className="h-7 w-48 text-xs font-mono"
419
- />
517
+ <Label className="text-xs text-muted-foreground">Project</Label>
518
+ <Select value={projectId || 'all'} onValueChange={v => setProjectId(v === 'all' ? '' : v)}>
519
+ <SelectTrigger className="h-7 w-48 text-xs">
520
+ <SelectValue placeholder="All projects" />
521
+ </SelectTrigger>
522
+ <SelectContent>
523
+ <SelectItem value="all">All projects</SelectItem>
524
+ {projects.map(p => (
525
+ <SelectItem key={p.id} value={p.id}>{p.title || p.id}</SelectItem>
526
+ ))}
527
+ </SelectContent>
528
+ </Select>
420
529
  </div>
421
530
 
422
531
  <div className="flex items-center gap-2">
@@ -575,10 +684,11 @@ export default function CILSearchPage() {
575
684
  </div>
576
685
  )
577
686
  }
578
- // CIL[DOC-VECTOR type="context" content="purpose='Render the full CIL chunk search page with query controls, filters, and result list.'; No verified external callers; imports: .framework/src/lib/api.ts,.framework/src/components/ui/card.tsx,.framework/src/components/ui/button.tsx"]
579
- // CIL[DOC-VECTOR type="blast_radius" content="No direct caller data from CIL graph; local impact only"]
580
- // CIL[DOC-VECTOR type="configuration" content="No environment or build configuration dependencies identified"]
581
- // CIL[DOC-VECTOR type="constraint" content="Standard runtime; no special invariants documented"]
582
- // CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
583
- // CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
584
687
  // CIL[END stable_id="~/.framework/src/pages/admin/cil/CILSearchPage.tsx:CILSearchPage:component"]
688
+
689
+
690
+
691
+
692
+
693
+
694
+