spine-framework 0.4.3 → 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 (320) 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/agent-runner.ts +1000 -81
  15. package/.framework/functions/_shared/cil.ts +2 -1
  16. package/.framework/functions/_shared/db.ts +3 -6
  17. package/.framework/functions/_shared/hash-api-key.ts +183 -79
  18. package/.framework/functions/_shared/kb.ts +61 -7
  19. package/.framework/functions/_shared/logging.ts +562 -224
  20. package/.framework/functions/_shared/message-sequence.ts +53 -0
  21. package/.framework/functions/_shared/middleware.ts +47 -44
  22. package/.framework/functions/_shared/pipeline-runner.ts +150 -37
  23. package/.framework/functions/_shared/principal.ts +9 -6
  24. package/.framework/functions/_shared/trigger-engine.ts +149 -40
  25. package/.framework/functions/admin-data.ts +48 -31
  26. package/.framework/functions/ai-agents.ts +103 -33
  27. package/.framework/functions/api-keys.ts +301 -122
  28. package/.framework/functions/apps.ts +43 -26
  29. package/.framework/functions/cil-ingest.ts +48 -15
  30. package/.framework/functions/debug-auth.ts +14 -8
  31. package/.framework/functions/deliveries.ts +39 -12
  32. package/.framework/functions/embeddings.ts +145 -76
  33. package/.framework/functions/integration-outbound.ts +67 -27
  34. package/.framework/functions/integrations.ts +254 -127
  35. package/.framework/functions/logs.ts +273 -133
  36. package/.framework/functions/observability.ts +277 -147
  37. package/.framework/functions/pipeline-executions.ts +1 -1
  38. package/.framework/functions/pipeline-runner-background.ts +120 -0
  39. package/.framework/functions/pipelines.ts +14 -9
  40. package/.framework/functions/prompt-configs.ts +7 -4
  41. package/.framework/functions/roles.ts +8 -5
  42. package/.framework/functions/security.ts +30 -17
  43. package/.framework/functions/system-cron.ts +250 -128
  44. package/.framework/functions/tests.ts +7 -6
  45. package/.framework/functions/timers.ts +310 -107
  46. package/.framework/functions/trigger-scheduler.ts +65 -5
  47. package/.framework/functions/triggers.ts +28 -13
  48. package/.framework/functions/types.ts +13 -10
  49. package/.framework/migrations/064_episode_leases.sql +196 -0
  50. package/.framework/migrations/065_execution_tables_updated_at.sql +20 -0
  51. package/.framework/migrations/066_episode_steal_thread_merge.sql +148 -0
  52. package/.framework/migrations/067_episode_lease_stale_steal.sql +93 -0
  53. package/.framework/migrations/068_cron_schedule_timer_rpcs.sql +251 -0
  54. package/.framework/migrations/069_log_stats_window.sql +54 -0
  55. package/.framework/migrations/070_app_type_schema_rpcs.sql +166 -0
  56. package/.framework/migrations/071_timer_interval_keys.sql +96 -0
  57. package/.framework/migrations/072_slug_autofill.sql +77 -0
  58. package/.framework/migrations/073_seed_member_roles.sql +26 -0
  59. package/.framework/schemas/spine.config.schema.json +62 -0
  60. package/.framework/src/App.tsx +3 -1
  61. package/.framework/src/apps/admin/index.tsx +1141 -775
  62. package/.framework/src/components/ErrorBoundary.tsx +136 -0
  63. package/.framework/src/components/admin/AdminListPage.tsx +81 -73
  64. package/.framework/src/components/admin/AdminSidebar.tsx +92 -81
  65. package/.framework/src/components/admin/EntitySelect.tsx +181 -0
  66. package/.framework/src/components/admin/PageInstructions.tsx +86 -127
  67. package/.framework/src/components/app-shell/GenericAppShell.tsx +3 -1
  68. package/.framework/src/components/app-shell/GenericDetailPage.tsx +37 -13
  69. package/.framework/src/components/app-shell/GenericListPage.tsx +28 -32
  70. package/.framework/src/components/auth/TurnstileWidget.tsx +9 -6
  71. package/.framework/src/components/kb/KBArticleEditor.tsx +49 -6
  72. package/.framework/src/components/layout/Layout.tsx +4 -2
  73. package/.framework/src/components/layout/Sidebar.tsx +304 -179
  74. package/.framework/src/components/runtime/DataDetailPage.tsx +67 -35
  75. package/.framework/src/components/runtime/DataHeader.tsx +96 -48
  76. package/.framework/src/components/runtime/DataListPage.tsx +3 -26
  77. package/.framework/src/components/runtime/DataStats.tsx +10 -10
  78. package/.framework/src/components/runtime/DataTable.tsx +12 -10
  79. package/.framework/src/components/ui/sheet.tsx +24 -26
  80. package/.framework/src/components/ui/textarea.tsx +74 -48
  81. package/.framework/src/hooks/useBranding.ts +47 -0
  82. package/.framework/src/hooks/useEntityList.ts +12 -9
  83. package/.framework/src/hooks/useListSchema.ts +108 -58
  84. package/.framework/src/instructions/README.md +57 -0
  85. package/.framework/src/instructions/ai-agents.md +69 -0
  86. package/.framework/src/instructions/alerts.md +80 -0
  87. package/.framework/src/instructions/api-keys.md +87 -0
  88. package/.framework/src/instructions/apps.md +77 -0
  89. package/.framework/src/instructions/concepts/ai-and-prompts.md +150 -0
  90. package/.framework/src/instructions/concepts/apps-and-renderers.md +162 -0
  91. package/.framework/src/instructions/concepts/auth-and-api-keys.md +133 -0
  92. package/.framework/src/instructions/concepts/automation.md +186 -0
  93. package/.framework/src/instructions/concepts/concurrency-and-idempotency.md +125 -0
  94. package/.framework/src/instructions/concepts/core-vs-custom.md +124 -0
  95. package/.framework/src/instructions/concepts/design-schema.md +152 -0
  96. package/.framework/src/instructions/concepts/integrations-and-webhooks.md +127 -0
  97. package/.framework/src/instructions/concepts/observability.md +116 -0
  98. package/.framework/src/instructions/concepts/permissions.md +150 -0
  99. package/.framework/src/instructions/concepts/runtime-records.md +111 -0
  100. package/.framework/src/instructions/concepts/scope-and-accounts.md +112 -0
  101. package/.framework/src/instructions/concepts/spine-way.md +172 -0
  102. package/.framework/src/instructions/deliveries.md +59 -0
  103. package/.framework/src/instructions/guide/00-orientation.md +106 -0
  104. package/.framework/src/instructions/guide/01-install-and-first-run.md +253 -0
  105. package/.framework/src/instructions/guide/02-project-map.md +147 -0
  106. package/.framework/src/instructions/guide/03-domain-model.md +223 -0
  107. package/.framework/src/instructions/guide/04-first-app.md +227 -0
  108. package/.framework/src/instructions/guide/05-glossary.md +183 -0
  109. package/.framework/src/instructions/integrations.md +96 -0
  110. package/.framework/src/instructions/internal/cil-markers.md +83 -0
  111. package/.framework/src/instructions/invites.md +60 -0
  112. package/.framework/src/instructions/kb.md +80 -0
  113. package/.framework/src/instructions/logs.md +77 -0
  114. package/.framework/src/instructions/observability.md +61 -0
  115. package/.framework/src/instructions/operations/deployment.md +115 -0
  116. package/.framework/src/instructions/operations/migrations.md +125 -0
  117. package/.framework/src/instructions/operations/security-checklist.md +148 -0
  118. package/.framework/src/instructions/operations/troubleshooting.md +170 -0
  119. package/.framework/src/instructions/operations/upgrade.md +116 -0
  120. package/.framework/src/instructions/pipeline-executions.md +62 -0
  121. package/.framework/src/instructions/pipelines.md +78 -0
  122. package/.framework/src/instructions/prompts.md +95 -0
  123. package/.framework/src/instructions/reference/api/admin-data.md +162 -0
  124. package/.framework/src/instructions/reference/api/auth.md +113 -0
  125. package/.framework/src/instructions/reference/api/errors-and-envelopes.md +113 -0
  126. package/.framework/src/instructions/reference/app-manifest.md +150 -0
  127. package/.framework/src/instructions/reference/cli.md +124 -0
  128. package/.framework/src/instructions/reference/database.md +132 -0
  129. package/.framework/src/instructions/reference/design-schema.md +280 -0
  130. package/.framework/src/instructions/reference/env-vars.md +133 -0
  131. package/.framework/src/instructions/reference/functions/account-nodes.md +75 -0
  132. package/.framework/src/instructions/reference/functions/admin-data.md +195 -0
  133. package/.framework/src/instructions/reference/functions/admin-funnel.md +90 -0
  134. package/.framework/src/instructions/reference/functions/admin-install-funnel.md +107 -0
  135. package/.framework/src/instructions/reference/functions/admin-signals.md +102 -0
  136. package/.framework/src/instructions/reference/functions/ai-agents.md +148 -0
  137. package/.framework/src/instructions/reference/functions/ai-interactions.md +156 -0
  138. package/.framework/src/instructions/reference/functions/api-keys.md +130 -0
  139. package/.framework/src/instructions/reference/functions/apps.md +140 -0
  140. package/.framework/src/instructions/reference/functions/auth.md +99 -0
  141. package/.framework/src/instructions/reference/functions/debug-auth.md +91 -0
  142. package/.framework/src/instructions/reference/functions/deliveries.md +110 -0
  143. package/.framework/src/instructions/reference/functions/embeddings.md +166 -0
  144. package/.framework/src/instructions/reference/functions/eval-harness.md +149 -0
  145. package/.framework/src/instructions/reference/functions/index.md +103 -0
  146. package/.framework/src/instructions/reference/functions/integration-outbound.md +200 -0
  147. package/.framework/src/instructions/reference/functions/integration-routes.md +151 -0
  148. package/.framework/src/instructions/reference/functions/integrations.md +130 -0
  149. package/.framework/src/instructions/reference/functions/invites.md +182 -0
  150. package/.framework/src/instructions/reference/functions/item-progress.md +107 -0
  151. package/.framework/src/instructions/reference/functions/kb.md +166 -0
  152. package/.framework/src/instructions/reference/functions/logs.md +141 -0
  153. package/.framework/src/instructions/reference/functions/observability.md +105 -0
  154. package/.framework/src/instructions/reference/functions/pipeline-executions.md +132 -0
  155. package/.framework/src/instructions/reference/functions/pipeline-runner-background.md +121 -0
  156. package/.framework/src/instructions/reference/functions/pipelines.md +136 -0
  157. package/.framework/src/instructions/reference/functions/prompt-configs.md +121 -0
  158. package/.framework/src/instructions/reference/functions/roles.md +121 -0
  159. package/.framework/src/instructions/reference/functions/security.md +140 -0
  160. package/.framework/src/instructions/reference/functions/system-cron.md +136 -0
  161. package/.framework/src/instructions/reference/functions/system.md +106 -0
  162. package/.framework/src/instructions/reference/functions/tests.md +97 -0
  163. package/.framework/src/instructions/reference/functions/timers.md +117 -0
  164. package/.framework/src/instructions/reference/functions/trigger-scheduler.md +102 -0
  165. package/.framework/src/instructions/reference/functions/triggers.md +140 -0
  166. package/.framework/src/instructions/reference/functions/types.md +146 -0
  167. package/.framework/src/instructions/reference/seeds.md +126 -0
  168. package/.framework/src/instructions/reference/shared-modules.md +127 -0
  169. package/.framework/src/instructions/reference/spine-config.md +114 -0
  170. package/.framework/src/instructions/roles.md +80 -0
  171. package/.framework/src/instructions/runtime-detail.md +70 -0
  172. package/.framework/src/instructions/runtime-list.md +77 -0
  173. package/.framework/src/instructions/security.md +67 -0
  174. package/.framework/src/instructions/tasks/add-a-pipeline.md +110 -0
  175. package/.framework/src/instructions/tasks/add-a-role.md +96 -0
  176. package/.framework/src/instructions/tasks/add-a-timer.md +114 -0
  177. package/.framework/src/instructions/tasks/add-a-trigger.md +106 -0
  178. package/.framework/src/instructions/tasks/add-a-type.md +151 -0
  179. package/.framework/src/instructions/tasks/add-a-webhook.md +108 -0
  180. package/.framework/src/instructions/tasks/add-an-ai-agent.md +108 -0
  181. package/.framework/src/instructions/tasks/add-an-integration.md +124 -0
  182. package/.framework/src/instructions/tasks/build-a-custom-page.md +118 -0
  183. package/.framework/src/instructions/tasks/package-and-install-an-app.md +127 -0
  184. package/.framework/src/instructions/tasks/test-your-code.md +108 -0
  185. package/.framework/src/instructions/tasks/write-a-function.md +132 -0
  186. package/.framework/src/instructions/tasks/write-a-migration.md +110 -0
  187. package/.framework/src/instructions/testing.md +59 -0
  188. package/.framework/src/instructions/timers.md +82 -0
  189. package/.framework/src/instructions/triggers.md +69 -0
  190. package/.framework/src/instructions/types.md +93 -0
  191. package/.framework/src/lib/branding.ts +128 -0
  192. package/.framework/src/pages/NoAppPage.tsx +3 -1
  193. package/.framework/src/pages/NotFoundPage.tsx +62 -31
  194. package/.framework/src/pages/SetupPage.tsx +5 -2
  195. package/.framework/src/pages/admin/AIAgentDetailPage.tsx +117 -106
  196. package/.framework/src/pages/admin/AIAgentsPage.tsx +86 -48
  197. package/.framework/src/pages/admin/APIKeyDetailPage.tsx +153 -152
  198. package/.framework/src/pages/admin/APIKeysPage.tsx +91 -90
  199. package/.framework/src/pages/admin/AlertsConfigPage.tsx +29 -18
  200. package/.framework/src/pages/admin/AppDetailPage.tsx +6 -60
  201. package/.framework/src/pages/admin/AppsPage.tsx +104 -66
  202. package/.framework/src/pages/admin/DeliveriesPage.tsx +5 -5
  203. package/.framework/src/pages/admin/EmbeddingDetailPage.tsx +5 -23
  204. package/.framework/src/pages/admin/EmbeddingsPage.tsx +5 -26
  205. package/.framework/src/pages/admin/IntegrationDetailPage.tsx +7 -7
  206. package/.framework/src/pages/admin/IntegrationsPage.tsx +85 -43
  207. package/.framework/src/pages/admin/LogsPage.tsx +144 -76
  208. package/.framework/src/pages/admin/ObservabilityDashboard.tsx +223 -140
  209. package/.framework/src/pages/admin/PipelineDetailPage.tsx +134 -113
  210. package/.framework/src/pages/admin/PipelineExecutionsPage.tsx +108 -45
  211. package/.framework/src/pages/admin/PipelinesPage.tsx +160 -115
  212. package/.framework/src/pages/admin/PromptConfigDetailPage.tsx +96 -98
  213. package/.framework/src/pages/admin/PromptConfigsPage.tsx +101 -59
  214. package/.framework/src/pages/admin/RoleDetailPage.tsx +90 -79
  215. package/.framework/src/pages/admin/RolesPage.tsx +86 -43
  216. package/.framework/src/pages/admin/SecurityPage.tsx +1 -1
  217. package/.framework/src/pages/admin/TestingDashboard.tsx +16 -28
  218. package/.framework/src/pages/admin/TimerDetailPage.tsx +117 -100
  219. package/.framework/src/pages/admin/TimersPage.tsx +90 -62
  220. package/.framework/src/pages/admin/TriggerDetailPage.tsx +90 -83
  221. package/.framework/src/pages/admin/TriggersPage.tsx +124 -99
  222. package/.framework/src/pages/admin/TypeDetailPage.tsx +152 -138
  223. package/.framework/src/pages/admin/TypesPage.tsx +90 -48
  224. package/.framework/src/pages/admin/cil/CILAgentPage.tsx +17 -25
  225. package/.framework/src/pages/admin/cil/CILChunkDetailPage.tsx +17 -27
  226. package/.framework/src/pages/admin/cil/CILDashboardPage.tsx +72 -40
  227. package/.framework/src/pages/admin/cil/CILFileListPage.tsx +321 -129
  228. package/.framework/src/pages/admin/cil/CILFileSelectPage.tsx +18 -29
  229. package/.framework/src/pages/admin/cil/CILGraphPage.tsx +26 -38
  230. package/.framework/src/pages/admin/cil/CILIngestionPage.tsx +34 -46
  231. package/.framework/src/pages/admin/cil/CILProjectsPage.tsx +189 -103
  232. package/.framework/src/pages/admin/cil/CILSearchPage.tsx +246 -136
  233. package/.framework/src/pages/admin/cil/CILSuggestionsPage.tsx +11 -22
  234. package/.framework/src/pages/admin/cil/CILVersionsPage.tsx +9 -20
  235. package/.framework/src/pages/admin/cil/FlexiblePipelinePage.tsx +26 -38
  236. package/.framework/src/pages/admin/kb/KBAdminPage.tsx +7 -26
  237. package/.framework/src/pages/auth/AuthConfirmPage.tsx +3 -1
  238. package/.framework/src/pages/auth/ForgotPasswordPage.tsx +3 -1
  239. package/.framework/src/pages/auth/LoginPage.tsx +4 -2
  240. package/.framework/src/pages/auth/RegisterPage.tsx +3 -1
  241. package/.framework/templates/agent/AGENTS.md +150 -0
  242. package/.framework/templates/agent/skills/spine-add-ai-agent/SKILL.md +58 -0
  243. package/.framework/templates/agent/skills/spine-add-automation/SKILL.md +62 -0
  244. package/.framework/templates/agent/skills/spine-add-integration/SKILL.md +63 -0
  245. package/.framework/templates/agent/skills/spine-architect/SKILL.md +86 -0
  246. package/.framework/templates/agent/skills/spine-install-app/SKILL.md +72 -0
  247. package/.framework/templates/agent/skills/spine-migration/SKILL.md +75 -0
  248. package/.framework/templates/agent/skills/spine-new-app/SKILL.md +67 -0
  249. package/.framework/templates/agent/skills/spine-new-function/SKILL.md +65 -0
  250. package/.framework/templates/agent/skills/spine-new-type/SKILL.md +65 -0
  251. package/.framework/templates/agent/skills/spine-schema/SKILL.md +77 -0
  252. package/.framework/templates/agent/skills/spine-test/SKILL.md +67 -0
  253. package/.framework/templates/agent/skills/spine-troubleshoot/SKILL.md +74 -0
  254. package/.framework/templates/agent/skills/spine-upgrade/SKILL.md +69 -0
  255. package/.framework/templates/project.json +5 -1
  256. package/.framework/tests/unit/account-scoping-gates.test.ts +392 -0
  257. package/.framework/tests/unit/agent-files.test.ts +355 -0
  258. package/.framework/tests/unit/agent-runner.test.ts +496 -47
  259. package/.framework/tests/unit/api-keys-create-scope-gate.test.ts +160 -0
  260. package/.framework/tests/unit/api-keys-omit-secret-fields.test.ts +38 -0
  261. package/.framework/tests/unit/bootstrap.test.ts +242 -0
  262. package/.framework/tests/unit/cli-context-api-key.test.ts +114 -0
  263. package/.framework/tests/unit/debug-auth.test.ts +38 -0
  264. package/.framework/tests/unit/deliveries-account-scoping.test.ts +185 -0
  265. package/.framework/tests/unit/episode-lease.test.ts +695 -0
  266. package/.framework/tests/unit/integration-outbound-credentials.test.ts +167 -0
  267. package/.framework/tests/unit/integrations-audit-redaction.test.ts +130 -0
  268. package/.framework/tests/unit/kb-ingest-lease.test.ts +19 -0
  269. package/.framework/tests/unit/logging-app-id.test.ts +75 -0
  270. package/.framework/tests/unit/pipeline-runner-background.test.ts +120 -0
  271. package/.framework/tests/unit/pipeline-runner.test.ts +153 -1
  272. package/.framework/tests/unit/principal-cache.test.ts +15 -0
  273. package/.framework/tests/unit/system-context-denial.test.ts +145 -0
  274. package/.framework/tests/unit/system-cron.test.ts +240 -0
  275. package/.framework/tests/unit/timers.test.ts +159 -0
  276. package/.framework/tests/unit/trigger-engine.test.ts +278 -91
  277. package/.framework/tests/unit/trigger-scheduler.test.ts +78 -0
  278. package/README.md +125 -166
  279. package/config/tsconfig.cli.json +2 -2
  280. package/netlify.toml +5 -0
  281. package/package.json +15 -4
  282. package/templates/project/package-lock.json +2 -2
  283. package/.framework/docs/admin-routes.md +0 -76
  284. package/.framework/docs/api-docs-progress.md +0 -38
  285. package/.framework/docs/api-governance.md +0 -146
  286. package/.framework/docs/api-testing-results.md +0 -212
  287. package/.framework/docs/assembly-launch-guide.md +0 -138
  288. package/.framework/docs/audit-results.md +0 -590
  289. package/.framework/docs/db-api-inventory.md +0 -95
  290. package/.framework/docs/gap-remediation-backlog.md +0 -103
  291. package/.framework/docs/ui-adoption-verification.md +0 -111
  292. package/.framework/docs/ui-api-coverage.md +0 -84
  293. package/.framework/docs/v2-compatibility-audit.md +0 -228
  294. package/.framework/mcp/index.ts +0 -133
  295. package/.framework/mcp/load-env.ts +0 -60
  296. package/.framework/mcp/shared/app-manifest.ts +0 -275
  297. package/.framework/mcp/shared/db.ts +0 -477
  298. package/.framework/mcp/shared/kb.ts +0 -118
  299. package/.framework/mcp/tools/architect.ts +0 -431
  300. package/.framework/mcp/tools/cil/context.ts +0 -345
  301. package/.framework/mcp/tools/cil/graph.ts +0 -242
  302. package/.framework/mcp/tools/cil/ingest.ts +0 -1217
  303. package/.framework/mcp/tools/cil/pipeline-orchestrator.ts +0 -693
  304. package/.framework/mcp/tools/cil/pipeline.ts +0 -767
  305. package/.framework/mcp/tools/cil/project.ts +0 -791
  306. package/.framework/mcp/tools/cil/retrieval.ts +0 -336
  307. package/.framework/mcp/tools/cil/search-core.ts +0 -454
  308. package/.framework/mcp/tools/cil/search.ts +0 -97
  309. package/.framework/mcp/tools/cil/suggest.ts +0 -186
  310. package/.framework/mcp/tools/cil/validate.ts +0 -1369
  311. package/.framework/mcp/tools/kb/delete.ts +0 -139
  312. package/.framework/mcp/tools/kb/index.ts +0 -52
  313. package/.framework/mcp/tools/kb/ingest.ts +0 -84
  314. package/.framework/mcp/tools/kb/list-types.ts +0 -102
  315. package/.framework/mcp/tools/kb/publish.ts +0 -100
  316. package/.framework/mcp/tools/kb/reindex.ts +0 -86
  317. package/.framework/mcp/tools/kb/revoke.ts +0 -85
  318. package/.framework/mcp/tools/kb/search.ts +0 -101
  319. package/.framework/mcp/tools/kb/upsert.ts +0 -125
  320. package/.framework/mcp/tools/observability.ts +0 -510
@@ -1,103 +0,0 @@
1
- # Gap Remediation Backlog
2
-
3
- ## Priority 1: Critical v2-Incompatible Endpoints
4
-
5
- ### 1. Quarantine v2-Incompatible Endpoints
6
- **Files to quarantine:**
7
- - `ai-orchestrator.ts` - References non-existent `ai_orchestrator` table
8
- - `pending-actions.ts` - References non-existent `pending_actions` table
9
- - `apps-accounts.ts` - References non-existent `apps_accounts` table
10
- - `apps-integrations.ts` - References non-existent `apps_integrations` table
11
- - `impersonation.ts` - References non-existent impersonation tables
12
- - `integration-health.ts` - References non-existent integration log tables
13
- - `thread-participants.ts` - References non-existent `thread_participants` table
14
- - `outbox.ts` - References non-existent `outbox` table
15
- - `webhooks.ts` - References non-existent `webhooks` table
16
-
17
- **Action:**
18
- 1. Move these files to `v2-core/functions/_quarantine/` directory
19
- 2. Update any routing that might call these endpoints
20
- 3. Document what functionality needs replacement
21
-
22
- ## Priority 2: UI Adoption Issues
23
-
24
- ### 2. Fix TimersPage Mock Data
25
- **Issue:** TimersPage uses mock data instead of calling timers.ts API
26
- **File:** `v2-core/src/pages/admin/TimersPage.tsx`
27
- **Action:** Replace mock data with `apiFetch('/.netlify/functions/timers')`
28
-
29
- ## Priority 3: API Standardization
30
-
31
- ### 3. Add Role Guards to Config Endpoints
32
- **Files to update:**
33
- - `types.ts` - Admin-only for create/update/delete
34
- - `apps.ts` - Admin-only for create/update/delete
35
- - `pipelines.ts` - Admin-only for create/update/delete
36
- - `triggers.ts` - Admin-only for create/update/delete
37
- - `ai-agents.ts` - Admin-only for create/update/delete
38
- - `embeddings.ts` - Admin-only for create/update/delete
39
- - `timers.ts` - Admin-only for create/update/delete
40
- - `integrations.ts` - Admin-only for create/update/delete
41
- - `prompt-configs.ts` - Admin-only for create/update/delete
42
- - `roles.ts` - Admin-only for create/update/delete
43
-
44
- **Action:** Add `requireAuth` middleware to all config mutation endpoints
45
-
46
- ### 4. Verify Soft Delete Implementation
47
- **Files to check:**
48
- - All endpoints should use `is_active=false` for delete
49
- - Ensure `updated_at` is set on soft delete
50
- - Verify audit logging before soft delete
51
-
52
- ## Priority 4: Documentation
53
-
54
- ### 5. Add Inline API Documentation
55
- **All endpoint files need:**
56
- - Purpose and domain documentation
57
- - Auth requirements
58
- - Account scoping rules
59
- - Request/response contracts
60
- - Soft delete behavior
61
- - v2 table dependencies
62
-
63
- ### 6. Generate API Reference Docs
64
- **Create files in `v2-core/docs/apis/`:**
65
- - `admin-data.md`
66
- - `admin-configs.md`
67
- - `runtime.md`
68
- - `internal.md`
69
- - `index.md` (top-level)
70
-
71
- ## Implementation Order
72
-
73
- ### Phase 1: Critical Fixes (Immediate)
74
- 1. Quarantine v2-incompatible endpoints
75
- 2. Fix TimersPage mock data issue
76
-
77
- ### Phase 2: Security & Standards (High)
78
- 1. Add role guards to config endpoints
79
- 2. Verify soft delete implementation
80
- 3. Add basic inline documentation
81
-
82
- ### Phase 3: Documentation (Medium)
83
- 1. Complete inline documentation for all endpoints
84
- 2. Generate split API reference docs
85
- 3. Create top-level index
86
-
87
- ### Phase 4: Verification (Low)
88
- 1. Verify UI adoption for all completed APIs
89
- 2. Final compliance check against API rulebook
90
-
91
- ## Success Criteria
92
-
93
- - [ ] No v2-incompatible endpoints in active routing
94
- - [ ] All admin UIs use proper APIs (no mock data)
95
- - [ ] All config endpoints have admin-only role guards
96
- - [ ] All endpoints use soft delete correctly
97
- - [ ] All endpoints have inline documentation
98
- - [ ] API reference docs generated and indexed
99
- - [ ] UI adoption verified for all APIs
100
-
101
- ## Blocked Items
102
-
103
- None currently identified.
@@ -1,111 +0,0 @@
1
- # UI Adoption Verification Report
2
-
3
- ## Data Management UIs (admin/data/*)
4
-
5
- ### Accounts Management
6
- - **AccountsPage**: Uses `apiFetch('/.netlify/functions/accounts')` - ADOPTED
7
- - **AccountCreatePage**: Uses accounts API - ADOPTED
8
- - **AccountDetailPage**: Uses accounts API - ADOPTED
9
- - **Status**: Complete API adoption
10
-
11
- ### People Management
12
- - **PeoplePage**: Uses `apiFetch('/.netlify/functions/people')` - ADOPTED
13
- - **PersonCreatePage**: Uses people API - ADOPTED
14
- - **PersonDetailPage**: Uses people API - ADOPTED
15
- - **Status**: Complete API adoption
16
-
17
- ### Items Management
18
- - **ItemsPage**: Uses `apiFetch('/.netlify/functions/items')` - ADOPTED
19
- - **ItemCreatePage**: Uses items API - ADOPTED
20
- - **ItemDetailPage**: Uses items API - ADOPTED
21
- - **Status**: Complete API adoption
22
-
23
- ## Configuration Management UIs (admin/configs/*)
24
-
25
- ### Type Definitions
26
- - **TypesPage**: Uses `apiFetch('/.netlify/functions/types')` - ADOPTED
27
- - **TypeDetailPage**: Uses types API - ADOPTED
28
- - **AccountTypesPage**: Uses `apiFetch('/.netlify/functions/types')` - ADOPTED
29
- - **AccountTypeDetailPage**: Uses types API - ADOPTED
30
- - **PersonTypesPage**: Uses `apiFetch('/.netlify/functions/types')` - ADOPTED
31
- - **PersonTypeDetailPage**: Uses types API - ADOPTED
32
- - **Status**: Complete API adoption
33
-
34
- ### App Definitions
35
- - **AppsPage**: Uses `apiFetch('/.netlify/functions/apps')` - ADOPTED
36
- - **AppDetailPage**: Uses apps API - ADOPTED
37
- - **Status**: Complete API adoption
38
-
39
- ### Workflow Definitions
40
- - **PipelinesPage**: Uses `apiFetch('/.netlify/functions/pipelines')` - ADOPTED
41
- - **PipelineDetailPage**: Uses pipelines API - ADOPTED
42
- - **TriggersPage**: Uses `apiFetch('/.netlify/functions/triggers')` - ADOPTED
43
- - **TriggerDetailPage**: Uses triggers API - ADOPTED
44
- - **Status**: Complete API adoption
45
-
46
- ### AI & Integration Definitions
47
- - **AIAgentsPage**: Uses `apiFetch('/.netlify/functions/ai-agents')` - ADOPTED
48
- - **AIAgentDetailPage**: Uses ai-agents API - ADOPTED
49
- - **EmbeddingsPage**: Uses `apiFetch('/.netlify/functions/embeddings')` - ADOPTED
50
- - **EmbeddingDetailPage**: Uses embeddings API - ADOPTED
51
- - **IntegrationsPage**: Uses `apiFetch('/.netlify/functions/integrations')` - ADOPTED
52
- - **IntegrationDetailPage**: Uses integrations API - ADOPTED
53
- - **Status**: Complete API adoption
54
-
55
- ### Scheduling Definitions
56
- - **TimersPage**: Previously used mock data - NOW ADOPTED
57
- - **TimerDetailPage**: Uses timers API - ADOPTED
58
- - **Status**: Complete API adoption (FIXED)
59
-
60
- ## Legacy Routes (Removed)
61
-
62
- All legacy routes have been removed from routing and will now return 404:
63
- - ~~`/admin/accounts`~~ -> Use `/admin/data/accounts`
64
- - ~~`/admin/people`~~ -> Use `/admin/data/people`
65
- - ~~`/admin/types`~~ -> Use `/admin/configs/types`
66
- - ~~`/admin/apps`~~ -> Use `/admin/configs/apps`
67
- - ~~`/admin/pipelines`~~ -> Use `/admin/configs/pipelines`
68
- - ~~`/admin/triggers`~~ -> Use `/admin/configs/triggers`
69
- - ~~`/admin/ai-agents`~~ -> Use `/admin/configs/ai-agents`
70
- - ~~`/admin/embeddings`~~ -> Use `/admin/configs/embeddings`
71
- - ~~`/admin/timers`~~ -> Use `/admin/configs/timers`
72
-
73
- **Status**: All legacy routes removed - will return 404
74
-
75
- ## Issues Resolved
76
-
77
- ### Fixed: TimersPage Mock Data
78
- - **Issue**: TimersPage was using mock data instead of API
79
- - **Action**: Replaced mock data with `fetch('/.netlify/functions/timers')`
80
- - **Status**: RESOLVED
81
- - **Impact**: TimersPage now properly uses timers API
82
-
83
- ## Compliance Status
84
-
85
- ### Complete Adoption: 100%
86
- - All 25 active admin UI routes now use proper APIs
87
- - No remaining mock data usage
88
- - All CRUD operations go through API layer
89
- - Proper error handling implemented
90
-
91
- ### Security Status: Good
92
- - Config endpoints have admin-only role guards
93
- - Data endpoints respect account scoping
94
- - Auth middleware applied where needed
95
-
96
- ### Standards Compliance: Good
97
- - All endpoints use soft delete
98
- - Consistent response formats
99
- - Proper audit logging
100
- - v2 schema compliance verified
101
-
102
- ## Recommendations
103
-
104
- 1. **Redirect Legacy Routes**: Consider adding redirects from legacy to new routes
105
- 2. **Monitor API Usage**: Track which endpoints are actually used by UIs
106
- 3. **Performance Review**: Ensure API calls are properly cached/debounced
107
- 4. **Error Handling**: Verify consistent error handling across all UIs
108
-
109
- ## Summary
110
-
111
- All admin UIs are now properly adopting APIs with no mock data remaining. The critical issue with TimersPage has been resolved. The system is ready for production use with proper API-driven architecture.
@@ -1,84 +0,0 @@
1
- # UI-to-API Coverage Matrix
2
-
3
- ## Data Management (admin/data/*)
4
-
5
- | Route | Page | Domain | Endpoint | Operations | Coverage | Test Results |
6
- |-------|------|--------|----------|------------|----------|-------------|
7
- | `/admin/data/accounts` | AccountsPage | data | accounts.ts | list | complete | **FULLY FUNCTIONAL** - All CRUD operations work |
8
- | `/admin/data/accounts/new` | AccountCreatePage | data | accounts.ts | create | complete | **SUCCESS** - Creates without auth required |
9
- | `/admin/data/accounts/:id` | AccountDetailPage | data | accounts.ts | get/update/delete | complete | **SUCCESS** - All operations work |
10
- | `/admin/data/people` | PeoplePage | data | people.ts | list | complete | **FULLY FUNCTIONAL** - All CRUD operations work |
11
- | `/admin/data/people/new` | PersonCreatePage | data | people.ts | create | complete | **SUCCESS** - Creates with account context |
12
- | `/admin/data/people/:id` | PersonDetailPage | data | people.ts | get/update/delete | complete | **SUCCESS** - All operations work |
13
- | `/admin/data/items` | ItemsPage | data | items.ts | list | complete | **FUNCTIONAL** - Requires account context |
14
- | `/admin/data/items/new` | ItemCreatePage | data | items.ts | create | complete | **SUCCESS** - Creates with account context |
15
- | `/admin/data/items/:id` | ItemDetailPage | data | items.ts | get/update/delete | complete | **SUCCESS** - All operations work |
16
-
17
- ## Configuration Management (admin/configs/*)
18
-
19
- | Route | Page | Domain | Endpoint | Operations | Coverage | Test Results |
20
- |-------|------|--------|----------|------------|----------|-------------|
21
- | `/admin/configs/types` | TypesPage | config | types.ts | list (kind='item') | complete | **READ-ONLY** - Mutations need admin auth |
22
- | `/admin/configs/types/new` | TypeDetailPage | config | types.ts | create | complete | **FAIL** - Requires admin auth |
23
- | `/admin/configs/types/:id` | TypeDetailPage | config | types.ts | get/update/delete | complete | **READ-ONLY** - Mutations need admin auth |
24
- | `/admin/configs/accounts` | AccountTypesPage | config | types.ts | list (kind='account') | complete | **READ-ONLY** - Mutations need admin auth |
25
- | `/admin/configs/accounts/new` | AccountTypeDetailPage | config | types.ts | create | complete | **FAIL** - Requires admin auth |
26
- | `/admin/configs/accounts/:id` | AccountTypeDetailPage | config | types.ts | get/update/delete | complete | **READ-ONLY** - Mutations need admin auth |
27
- | `/admin/configs/people` | PersonTypesPage | config | types.ts | list (kind='person') | complete | **READ-ONLY** - Mutations need admin auth |
28
- | `/admin/configs/people/new` | PersonTypeDetailPage | config | types.ts | create | complete | **FAIL** - Requires admin auth |
29
- | `/admin/configs/people/:id` | PersonTypeDetailPage | config | types.ts | get/update/delete | complete | **READ-ONLY** - Mutations need admin auth |
30
- | `/admin/configs/apps` | AppsPage | config | apps.ts | list | complete | **FAIL** - Requires account context |
31
- | `/admin/configs/apps/new` | AppDetailPage | config | apps.ts | create | complete | **FAIL** - Requires admin auth |
32
- | `/admin/configs/apps/:id` | AppDetailPage | config | apps.ts | get/update/delete | complete | **READ-ONLY** - Mutations need admin auth |
33
- | `/admin/configs/pipelines` | PipelinesPage | config | pipelines.ts | list | complete | **FAIL** - Requires account context |
34
- | `/admin/configs/pipelines/new` | PipelineDetailPage | config | pipelines.ts | create | complete | **FAIL** - Requires admin auth |
35
- | `/admin/configs/pipelines/:id` | PipelineDetailPage | config | pipelines.ts | get/update/delete | complete | **READ-ONLY** - Mutations need admin auth |
36
- | `/admin/configs/triggers` | TriggersPage | config | triggers.ts | list | complete | **FAIL** - Requires account context |
37
- | `/admin/configs/triggers/new` | TriggerDetailPage | config | triggers.ts | create | complete | **FAIL** - Requires admin auth |
38
- | `/admin/configs/triggers/:id` | TriggerDetailPage | config | triggers.ts | get/update/delete | complete | **READ-ONLY** - Mutations need admin auth |
39
- | `/admin/configs/ai-agents` | AIAgentsPage | config | ai-agents.ts | list | complete | **FAIL** - Requires account context |
40
- | `/admin/configs/ai-agents/new` | AIAgentDetailPage | config | ai-agents.ts | create | complete | **FAIL** - Requires admin auth |
41
- | `/admin/configs/ai-agents/:id` | AIAgentDetailPage | config | ai-agents.ts | get/update/delete | complete | **READ-ONLY** - Mutations need admin auth |
42
- | `/admin/configs/embeddings` | EmbeddingsPage | config | embeddings.ts | list | complete | **FAIL** - Requires account context |
43
- | `/admin/configs/embeddings/new` | EmbeddingDetailPage | config | embeddings.ts | create | complete | **FAIL** - Requires admin auth |
44
- | `/admin/configs/embeddings/:id` | EmbeddingDetailPage | config | embeddings.ts | get/update/delete | complete | **READ-ONLY** - Mutations need admin auth |
45
- | `/admin/configs/timers` | TimersPage | config | timers.ts | list | complete | **FAIL** - Requires account context |
46
- | `/admin/configs/timers/new` | TimerDetailPage | config | timers.ts | create | complete | **FAIL** - Requires admin auth |
47
- | `/admin/configs/timers/:id` | TimerDetailPage | config | timers.ts | get/update/delete | complete | **READ-ONLY** - Mutations need admin auth |
48
- | `/admin/configs/integrations` | IntegrationsPage | config | integrations.ts | list | complete | **FAIL** - Requires account context |
49
- | `/admin/configs/integrations/new` | IntegrationDetailPage | config | integrations.ts | create | complete | **FAIL** - Requires admin auth |
50
- | `/admin/configs/integrations/:id` | IntegrationDetailPage | config | integrations.ts | get/update/delete | complete | **READ-ONLY** - Mutations need admin auth |
51
-
52
- ## Issues Identified
53
-
54
- ### Authentication Issues
55
- - **Config Mutations**: All require admin authentication (proper session token)
56
- - **Config Reads**: Most require account context (X-Account-Id header)
57
- - **Items Endpoint**: Requires account context for all operations
58
-
59
- ### Partial Coverage
60
- - **TimersPage**: Fixed - Now uses API instead of mock data
61
-
62
- ### Complete Coverage
63
- All routes have proper API integration with:
64
- - Correct endpoint mapping
65
- - Full CRUD operations (where auth allows)
66
- - Proper error handling
67
- - Account scoping where applicable
68
-
69
- ## Test Results Summary
70
-
71
- ### Fully Functional Endpoints (11)
72
- - accounts, people, items (with context), threads, messages, attachments, watchers, links, people-accounts, people-roles, account-nodes, logs, pipeline-executions
73
-
74
- ### Read-Only Without Auth (8 endpoints)
75
- - types, apps, pipelines, triggers, ai-agents, embeddings, timers, integrations, roles, link-types
76
-
77
- ### Next Actions
78
- 1. Implement proper admin authentication for config mutations
79
- 2. Add account context validation for config reads
80
- 3. Test with valid admin session tokens
81
- 4. Verify role-based access control enforcement
82
-
83
- ## Detailed Test Results
84
- See [API Testing Results](./api-testing-results.md) for complete test methodology and detailed results.
@@ -1,228 +0,0 @@
1
- # v2 Schema Compatibility Audit
2
-
3
- ## Core Entity Endpoints
4
-
5
- ### accounts.ts
6
- - **v2 Schema**: `accounts` table exists
7
- - **Fields**: All referenced fields match v2 schema
8
- - **Joins**: `types` relation valid
9
- - **Soft Delete**: Uses `is_active=false` correctly
10
- - **Status**: PASS
11
-
12
- ### people.ts
13
- - **v2 Schema**: `people` table exists
14
- - **Fields**: All referenced fields match v2 schema
15
- - **Joins**: `types` relation valid
16
- - **Soft Delete**: Uses `is_active=false` correctly
17
- - **Status**: PASS
18
-
19
- ### items.ts
20
- - **v2 Schema**: `items` table exists
21
- - **Fields**: All referenced fields match v2 schema
22
- - **Joins**: `types` relation valid
23
- - **Soft Delete**: Uses `is_active=false` correctly
24
- - **Status**: PASS
25
-
26
- ### types.ts
27
- - **v2 Schema**: `types` table exists
28
- - **Fields**: All referenced fields match v2 schema
29
- - **Joins**: `apps` relation valid
30
- - **Soft Delete**: Uses `is_active=false` correctly
31
- - **Status**: PASS
32
-
33
- ## Configuration Endpoints
34
-
35
- ### apps.ts
36
- - **v2 Schema**: `apps` table exists
37
- - **Fields**: All referenced fields match v2 schema
38
- - **Soft Delete**: Uses `is_active=false` correctly
39
- - **Status**: PASS
40
-
41
- ### roles.ts
42
- - **v2 Schema**: `roles` table exists
43
- - **Fields**: All referenced fields match v2 schema
44
- - **Joins**: `apps` relation valid
45
- - **Soft Delete**: Uses `is_active=false` correctly
46
- - **Status**: PASS
47
-
48
- ### pipelines.ts
49
- - **v2 Schema**: `pipelines` table exists
50
- - **Fields**: All referenced fields match v2 schema
51
- - **Joins**: `apps`, `people`, `accounts` relations valid
52
- - **Soft Delete**: Uses `is_active=false` correctly
53
- - **Status**: PASS
54
-
55
- ### triggers.ts
56
- - **v2 Schema**: `triggers` table exists
57
- - **Fields**: All referenced fields match v2 schema
58
- - **Joins**: `apps`, `people`, `pipelines` relations valid
59
- - **Soft Delete**: Uses `is_active=false` correctly
60
- - **Status**: PASS
61
-
62
- ### ai-agents.ts
63
- - **v2 Schema**: `ai_agents` table exists
64
- - **Fields**: All referenced fields match v2 schema
65
- - **Joins**: `apps`, `people` relations valid
66
- - **Soft Delete**: Uses `is_active=false` correctly
67
- - **Status**: PASS
68
-
69
- ### embeddings.ts
70
- - **v2 Schema**: `embeddings` table exists
71
- - **Fields**: All referenced fields match v2 schema
72
- - **Soft Delete**: Uses `is_active=false` correctly
73
- - **Status**: PASS
74
-
75
- ### timers.ts
76
- - **v2 Schema**: `timers` table exists
77
- - **Fields**: All referenced fields match v2 schema
78
- - **Joins**: `apps`, `people`, `pipelines` relations valid
79
- - **Soft Delete**: Uses `is_active=false` correctly
80
- - **Status**: PASS
81
-
82
- ### integrations.ts
83
- - **v2 Schema**: `integrations` table exists
84
- - **Fields**: All referenced fields match v2 schema
85
- - **Joins**: `apps`, `people`, `accounts` relations valid
86
- - **Soft Delete**: Uses `is_active=false` correctly
87
- - **Status**: PASS
88
-
89
- ### prompt-configs.ts
90
- - **v2 Schema**: `prompt_configs` table exists
91
- - **Fields**: All referenced fields match v2 schema
92
- - **Joins**: `apps` relation valid
93
- - **Soft Delete**: Uses `is_active=false` correctly
94
- - **Status**: PASS
95
-
96
- ## Runtime Endpoints
97
-
98
- ### threads.ts
99
- - **v2 Schema**: `threads` table exists
100
- - **Fields**: All referenced fields match v2 schema
101
- - **Joins**: `people` relation valid
102
- - **Soft Delete**: Uses `is_active=false` correctly
103
- - **Status**: PASS
104
-
105
- ### messages.ts
106
- - **v2 Schema**: `messages` table exists
107
- - **Fields**: All referenced fields match v2 schema
108
- - **Joins**: `threads`, `people` relations valid
109
- - **Status**: PASS
110
-
111
- ### attachments.ts
112
- - **v2 Schema**: `attachments` table exists
113
- - **Fields**: All referenced fields match v2 schema
114
- - **Joins**: `people` relation valid
115
- - **Soft Delete**: Uses `is_active=false` correctly
116
- - **Status**: PASS
117
-
118
- ### watchers.ts
119
- - **v2 Schema**: `watchers` table exists
120
- - **Fields**: All referenced fields match v2 schema
121
- - **Joins**: `people` relation valid
122
- - **Status**: PASS
123
-
124
- ### links.ts
125
- - **v2 Schema**: `links` table exists
126
- - **Fields**: All referenced fields match v2 schema
127
- - **Joins**: `link_types`, `people` relations valid
128
- - **Status**: PASS
129
-
130
- ### link_types.ts
131
- - **v2 Schema**: `link_types` table exists
132
- - **Fields**: All referenced fields match v2 schema
133
- - **Joins**: `apps` relation valid
134
- - **Soft Delete**: Uses `is_active=false` correctly
135
- - **Status**: PASS
136
-
137
- ## Access Control Endpoints
138
-
139
- ### people-accounts.ts
140
- - **v2 Schema**: `people_accounts` table exists
141
- - **Fields**: All referenced fields match v2 schema
142
- - **Joins**: `people`, `accounts`, `roles` relations valid
143
- - **Status**: PASS
144
-
145
- ### people-roles.ts
146
- - **v2 Schema**: `people_roles` table exists
147
- - **Fields**: All referenced fields match v2 schema
148
- - **Joins**: `people`, `roles` relations valid
149
- - **Status**: PASS
150
-
151
- ### account-nodes.ts
152
- - **v2 Schema**: `accounts` table exists
153
- - **RPC Usage**: Uses `get_account_ancestors`, `get_account_descendants`
154
- - **Status**: PASS
155
-
156
- ## System Endpoints
157
-
158
- ### logs.ts
159
- - **v2 Schema**: `logs` table exists
160
- - **Fields**: All referenced fields match v2 schema
161
- - **Joins**: `people`, `accounts` relations valid
162
- - **Status**: PASS
163
-
164
- ### pipeline-executions.ts
165
- - **v2 Schema**: `pipeline_executions` table exists
166
- - **Fields**: All referenced fields match v2 schema
167
- - **Joins**: `pipelines` relation valid
168
- - **Status**: PASS
169
-
170
- ## v2-Incompatible Endpoints
171
-
172
- ### ai-orchestrator.ts
173
- - **Issue**: References `ai_orchestrator` table (not in v2)
174
- - **Status**: FAIL
175
- - **Action**: Quarantine or rewrite
176
-
177
- ### pending-actions.ts
178
- - **Issue**: References `pending_actions` table (not in v2)
179
- - **Status**: FAIL
180
- - **Action**: Quarantine or rewrite
181
-
182
- ### apps-accounts.ts
183
- - **Issue**: References `apps_accounts` table (not in v2)
184
- - **Status**: FAIL
185
- - **Action**: Quarantine or rewrite
186
-
187
- ### apps-integrations.ts
188
- - **Issue**: References `apps_integrations` table (not in v2)
189
- - **Status**: FAIL
190
- - **Action**: Quarantine or rewrite
191
-
192
- ### impersonation.ts
193
- - **Issue**: References `impersonation_sessions`, `impersonation_policies`, `impersonation_logs` (not in v2)
194
- - **Status**: FAIL
195
- - **Action**: Quarantine or rewrite
196
-
197
- ### integration-health.ts
198
- - **Issue**: References `integration_sync_logs`, `oauth_connections`, `api_keys`, `api_key_usage_logs` (not in v2)
199
- - **Status**: FAIL
200
- - **Action**: Quarantine or rewrite
201
-
202
- ### thread-participants.ts
203
- - **Issue**: References `thread_participants` table (not in v2)
204
- - **Status**: FAIL
205
- - **Action**: Quarantine or rewrite
206
-
207
- ### outbox.ts
208
- - **Issue**: References `outbox` table (not in v2)
209
- - **Status**: FAIL
210
- - **Action**: Quarantine or rewrite
211
-
212
- ### webhooks.ts
213
- - **Issue**: References `webhooks` table (not in v2)
214
- - **Status**: FAIL
215
- - **Action**: Quarantine or rewrite
216
-
217
- ## Summary
218
-
219
- ### PASS: 18 endpoints
220
- All core v2 schema endpoints are compatible and properly implemented.
221
-
222
- ### FAIL: 9 endpoints
223
- These endpoints reference tables that don't exist in v2 schema and will cause runtime errors.
224
-
225
- ### Immediate Actions Required
226
- 1. Quarantine all v2-incompatible endpoints
227
- 2. Update any routing that might call these endpoints
228
- 3. Determine if functionality should be reimplemented with existing v2 tables
@@ -1,133 +0,0 @@
1
- // CIL[BEGIN stable_id="~/.framework/mcp/index.ts:module_header:module_header" type="module_header" identity="module_header" parent="none"]
2
- // CIL[DOC-MACRO purpose="Initialize and wire up the Spine MCP server with all registered tool modules."]
3
- // CIL[DOC-RESPONSIBILITY responsibility="Load environment configuration, create the McpServer instance, and import and register every tool module."]
4
- // CIL[DOC-CONTEXT module="mcp" layer="entry-point" related_files=".framework/mcp/load-env.ts,.framework/mcp/tools/architect.ts,.framework/mcp/tools/cil/context.ts,.framework/mcp/tools/cil/graph.ts,.framework/mcp/tools/cil/ingest.ts,.framework/mcp/tools/cil/pipeline-orchestrator.ts,.framework/mcp/tools/cil/pipeline.ts,.framework/mcp/tools/cil/project.ts,.framework/mcp/tools/cil/retrieval.ts,.framework/mcp/tools/cil/search.ts,.framework/mcp/tools/cil/validate.ts,.framework/mcp/tools/kb/index.ts,.framework/mcp/tools/observability.ts"]
5
- // CIL[DOC-CONTRACT inputs="none" outputs="none" errors="[]" side_effects="[]"]
6
- // CIL[DOC-MICRO logic_summary="Imports the environment loader, McpServer SDK, all tool modules, and registers each module with a shared server instance." notable_decisions="[]"]
7
- // CIL[DOC-CONFIDENCE pass="second" score="0.90" flags="none"]
8
- // CIL[DOC-STABILITY stability="stable"]
9
- // CIL[DOC-AUDIENCE audience="framework"]
10
- import './load-env.js'
11
- import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'
12
- import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'
13
-
14
- import * as contextTools from './tools/cil/context.js'
15
- import * as searchTools from './tools/cil/search.js'
16
- import * as graphTools from './tools/cil/graph.js'
17
- import * as validateTools from './tools/cil/validate.js'
18
- import * as projectTools from './tools/cil/project.js'
19
- import * as pipelineTools from './tools/cil/pipeline.js'
20
- import * as pipelineOrchestratorTools from './tools/cil/pipeline-orchestrator.js'
21
- import * as ingestTools from './tools/cil/ingest.js'
22
- import * as retrievalTools from './tools/cil/retrieval.js'
23
- import * as architectTools from './tools/architect.js'
24
- import * as kbTools from './tools/kb/index.js'
25
- import * as observabilityTools from './tools/observability.js'
26
- // CIL[DOC-VECTOR type="context" content="purpose='Initialize and wire up the Spine MCP server with all registered tool modules.'; No verified external callers; imports: .framework/mcp/load-env.ts,.framework/mcp/tools/cil/context.ts,.framework/mcp/tools/cil/search.ts"]
27
- // CIL[DOC-VECTOR type="blast_radius" content="No direct caller data from CIL graph; local impact only"]
28
- // CIL[DOC-VECTOR type="configuration" content="No environment or build configuration dependencies identified"]
29
- // CIL[DOC-VECTOR type="constraint" content="Standard runtime; no special invariants documented"]
30
- // CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
31
- // CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
32
- // CIL[END stable_id="~/.framework/mcp/index.ts:module_header:module_header"]
33
-
34
- // CIL[BEGIN stable_id="~/.framework/mcp/index.ts:server:constant" type="constant" identity="server" parent="none"]
35
- // CIL[DOC-MACRO purpose="Define the configured McpServer instance used by the framework."]
36
- // CIL[DOC-RESPONSIBILITY responsibility="Instantiate the shared McpServer with the framework name and version."]
37
- // CIL[DOC-CONTEXT module="mcp" layer="server" related_files=".framework/mcp/index.ts,.framework/mcp/load-env.ts,.framework/mcp/tools/architect.ts,.framework/mcp/tools/cil/context.ts,.framework/mcp/tools/cil/graph.ts,.framework/mcp/tools/cil/ingest.ts,.framework/mcp/tools/cil/pipeline-orchestrator.ts,.framework/mcp/tools/cil/pipeline.ts,.framework/mcp/tools/cil/project.ts,.framework/mcp/tools/cil/retrieval.ts,.framework/mcp/tools/cil/search.ts,.framework/mcp/tools/cil/validate.ts,.framework/mcp/tools/kb/index.ts,.framework/mcp/tools/observability.ts"]
38
- // CIL[DOC-CONTRACT inputs="none" outputs="server: McpServer" errors="[]" side_effects="[]"]
39
- // CIL[DOC-MICRO logic_summary="Constructs a new McpServer named 'spine-framework' at version '1.0.0'." notable_decisions="[]"]
40
- // CIL[DOC-CONFIDENCE pass="second" score="0.90" flags="none"]
41
- // CIL[DOC-STABILITY stability="stable"]
42
- const server = new McpServer({
43
- name: 'spine-framework',
44
- version: '1.0.0',
45
- })
46
- // CIL[DOC-VECTOR type="context" content="purpose='Define the configured McpServer instance used by the framework.'; No verified external callers; imports: .framework/mcp/load-env.ts,.framework/mcp/tools/cil/context.ts,.framework/mcp/tools/cil/search.ts"]
47
- // CIL[DOC-VECTOR type="blast_radius" content="No direct caller data from CIL graph; local impact only"]
48
- // CIL[DOC-VECTOR type="configuration" content="No environment or build configuration dependencies identified"]
49
- // CIL[DOC-VECTOR type="constraint" content="Standard runtime; no special invariants documented"]
50
- // CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
51
- // CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
52
- // CIL[END stable_id="~/.framework/mcp/index.ts:server:constant"]
53
-
54
- // CIL[BEGIN stable_id="~/.framework/mcp/index.ts:tool_registrations:block" type="block" identity="tool_registrations" parent="none"]
55
- // CIL[DOC-MACRO purpose="Register all imported tool modules with the McpServer."]
56
- // CIL[DOC-RESPONSIBILITY responsibility="Attach CIL, architect, KB, and observability tool handlers to the McpServer."]
57
- // CIL[DOC-CONTEXT module="mcp" layer="registration" related_files=".framework/mcp/index.ts,.framework/mcp/load-env.ts,.framework/mcp/tools/architect.ts,.framework/mcp/tools/cil/context.ts,.framework/mcp/tools/cil/graph.ts,.framework/mcp/tools/cil/ingest.ts,.framework/mcp/tools/cil/pipeline-orchestrator.ts,.framework/mcp/tools/cil/pipeline.ts,.framework/mcp/tools/cil/project.ts,.framework/mcp/tools/cil/retrieval.ts,.framework/mcp/tools/cil/search.ts,.framework/mcp/tools/cil/validate.ts,.framework/mcp/tools/kb/index.ts,.framework/mcp/tools/observability.ts"]
58
- // CIL[DOC-CONTRACT inputs="server: McpServer" outputs="server with tool handlers registered" errors="[]" side_effects="mutates the McpServer"]
59
- // CIL[DOC-MICRO logic_summary="Calls register(server) for each imported tool module in turn." notable_decisions="Registration order follows import order."]
60
- // CIL[DOC-CONFIDENCE pass="second" score="0.90" flags="none"]
61
- // CIL[DOC-STABILITY stability="stable"]
62
- contextTools.register(server)
63
- searchTools.register(server)
64
- graphTools.register(server)
65
- validateTools.register(server)
66
- projectTools.register(server)
67
- pipelineTools.register(server)
68
- pipelineOrchestratorTools.register(server)
69
- ingestTools.register(server)
70
- retrievalTools.register(server)
71
- architectTools.register(server)
72
- kbTools.register(server)
73
- observabilityTools.register(server)
74
- // CIL[DOC-VECTOR type="context" content="purpose='Register all imported tool modules with the McpServer.'; No verified external callers; imports: .framework/mcp/load-env.ts,.framework/mcp/tools/cil/context.ts,.framework/mcp/tools/cil/search.ts"]
75
- // CIL[DOC-VECTOR type="blast_radius" content="No direct caller data from CIL graph; local impact only"]
76
- // CIL[DOC-VECTOR type="configuration" content="No environment or build configuration dependencies identified"]
77
- // CIL[DOC-VECTOR type="constraint" content="Standard runtime; no special invariants documented"]
78
- // CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
79
- // CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
80
- // CIL[END stable_id="~/.framework/mcp/index.ts:tool_registrations:block"]
81
-
82
- // CIL[BEGIN stable_id="~/.framework/mcp/index.ts:main:function" type="function" identity="main" parent="none"]
83
- // CIL[DOC-MACRO purpose="Start the MCP server after validating required environment variables."]
84
- // CIL[DOC-RESPONSIBILITY responsibility="Verify SPINE_URL and SPINE_API_KEY, create a stdio transport, connect the server, and log startup."]
85
- // CIL[DOC-CONTEXT module="mcp" layer="runtime" related_files=".framework/mcp/index.ts,.framework/mcp/load-env.ts,.framework/mcp/tools/architect.ts,.framework/mcp/tools/cil/context.ts,.framework/mcp/tools/cil/graph.ts,.framework/mcp/tools/cil/ingest.ts,.framework/mcp/tools/cil/pipeline-orchestrator.ts,.framework/mcp/tools/cil/pipeline.ts,.framework/mcp/tools/cil/project.ts,.framework/mcp/tools/cil/retrieval.ts,.framework/mcp/tools/cil/search.ts,.framework/mcp/tools/cil/validate.ts,.framework/mcp/tools/kb/index.ts,.framework/mcp/tools/observability.ts"]
86
- // CIL[DOC-CONTRACT inputs="process.env" outputs="stdio transport connection" errors="Missing required environment variables" side_effects="process.exit(1) on validation failure; writes to stderr"]
87
- // CIL[DOC-MICRO logic_summary="Collect missing environment variables; if any are missing, log an error and exit. Otherwise connect the server to stdio and log a startup message." notable_decisions="Fails fast when SPINE_URL or SPINE_API_KEY are unset."]
88
- // CIL[DOC-CONFIDENCE pass="second" score="0.90" flags="none"]
89
- // CIL[DOC-STABILITY stability="stable"]
90
- async function main() {
91
- const missingEnv = []
92
- if (!process.env.SPINE_URL) missingEnv.push('SPINE_URL')
93
- if (!process.env.SPINE_API_KEY) missingEnv.push('SPINE_API_KEY')
94
-
95
- if (missingEnv.length > 0) {
96
- process.stderr.write(
97
- `[spine-framework-mcp] ERROR: Missing required environment variables: ${missingEnv.join(', ')}\n` +
98
- `Set SPINE_URL and SPINE_API_KEY in the MCP host config (env block).\n`
99
- )
100
- process.exit(1)
101
- }
102
-
103
- const transport = new StdioServerTransport()
104
- await server.connect(transport)
105
- process.stderr.write('[spine-framework-mcp] Server running on stdio\n')
106
- }
107
- // CIL[DOC-VECTOR type="context" content="purpose='Start the MCP server after validating required environment variables.'; No verified external callers; imports: .framework/mcp/load-env.ts,.framework/mcp/tools/cil/context.ts,.framework/mcp/tools/cil/search.ts"]
108
- // CIL[DOC-VECTOR type="blast_radius" content="No direct caller data from CIL graph; local impact only"]
109
- // CIL[DOC-VECTOR type="configuration" content="No environment or build configuration dependencies identified"]
110
- // CIL[DOC-VECTOR type="constraint" content="Standard runtime; no special invariants documented"]
111
- // CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
112
- // CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
113
- // CIL[END stable_id="~/.framework/mcp/index.ts:main:function"]
114
-
115
- // CIL[BEGIN stable_id="~/.framework/mcp/index.ts:error_handling:block" type="block" identity="error_handling" parent="none"]
116
- // CIL[DOC-MACRO purpose="Catch unhandled fatal errors from main() and terminate the process."]
117
- // CIL[DOC-RESPONSIBILITY responsibility="Wrap main() execution, log any rejection, and exit with a fatal error code."]
118
- // CIL[DOC-CONTEXT module="mcp" layer="error-handling" related_files=".framework/mcp/index.ts,.framework/mcp/load-env.ts,.framework/mcp/tools/architect.ts,.framework/mcp/tools/cil/context.ts,.framework/mcp/tools/cil/graph.ts,.framework/mcp/tools/cil/ingest.ts,.framework/mcp/tools/cil/pipeline-orchestrator.ts,.framework/mcp/tools/cil/pipeline.ts,.framework/mcp/tools/cil/project.ts,.framework/mcp/tools/cil/retrieval.ts,.framework/mcp/tools/cil/search.ts,.framework/mcp/tools/cil/validate.ts,.framework/mcp/tools/kb/index.ts,.framework/mcp/tools/observability.ts"]
119
- // CIL[DOC-CONTRACT inputs="main(): Promise<void>" outputs="none" errors="[]" side_effects="process.stderr.write; process.exit(1)"]
120
- // CIL[DOC-MICRO logic_summary="Attaches a catch handler to main() that writes the error to stderr and exits." notable_decisions="[]"]
121
- // CIL[DOC-CONFIDENCE pass="second" score="0.90" flags="none"]
122
- // CIL[DOC-STABILITY stability="stable"]
123
- main().catch(err => {
124
- process.stderr.write(`[spine-framework-mcp] Fatal error: ${err}\n`)
125
- process.exit(1)
126
- })
127
- // CIL[DOC-VECTOR type="context" content="purpose='Catch unhandled fatal errors from main() and terminate the process.'; No verified external callers; imports: .framework/mcp/load-env.ts,.framework/mcp/tools/cil/context.ts,.framework/mcp/tools/cil/search.ts"]
128
- // CIL[DOC-VECTOR type="blast_radius" content="No direct caller data from CIL graph; local impact only"]
129
- // CIL[DOC-VECTOR type="configuration" content="No environment or build configuration dependencies identified"]
130
- // CIL[DOC-VECTOR type="constraint" content="Standard runtime; no special invariants documented"]
131
- // CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
132
- // CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
133
- // CIL[END stable_id="~/.framework/mcp/index.ts:error_handling:block"]