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.
- package/.env.example +13 -3
- package/.framework/cli/commands/bootstrap.ts +392 -0
- package/.framework/cli/commands/dev.ts +91 -218
- package/.framework/cli/commands/doctor.ts +132 -26
- package/.framework/cli/commands/generate.ts +38 -298
- package/.framework/cli/commands/init.ts +20 -1
- package/.framework/cli/commands/migrate.ts +36 -30
- package/.framework/cli/commands/migrations.ts +16 -56
- package/.framework/cli/commands/upgrade.ts +35 -0
- package/.framework/cli/commands/validate-schema.ts +147 -0
- package/.framework/cli/context.ts +223 -110
- package/.framework/cli/index.ts +6 -0
- package/.framework/cli/lib/project-files.ts +241 -1
- package/.framework/functions/_shared/agent-runner.ts +1000 -81
- package/.framework/functions/_shared/cil.ts +2 -1
- package/.framework/functions/_shared/db.ts +3 -6
- package/.framework/functions/_shared/hash-api-key.ts +183 -79
- package/.framework/functions/_shared/kb.ts +61 -7
- package/.framework/functions/_shared/logging.ts +562 -224
- package/.framework/functions/_shared/message-sequence.ts +53 -0
- package/.framework/functions/_shared/middleware.ts +47 -44
- package/.framework/functions/_shared/pipeline-runner.ts +150 -37
- package/.framework/functions/_shared/principal.ts +9 -6
- package/.framework/functions/_shared/trigger-engine.ts +149 -40
- package/.framework/functions/admin-data.ts +48 -31
- package/.framework/functions/ai-agents.ts +103 -33
- package/.framework/functions/api-keys.ts +301 -122
- package/.framework/functions/apps.ts +43 -26
- package/.framework/functions/cil-ingest.ts +48 -15
- package/.framework/functions/debug-auth.ts +14 -8
- package/.framework/functions/deliveries.ts +39 -12
- package/.framework/functions/embeddings.ts +145 -76
- package/.framework/functions/integration-outbound.ts +67 -27
- package/.framework/functions/integrations.ts +254 -127
- package/.framework/functions/logs.ts +273 -133
- package/.framework/functions/observability.ts +277 -147
- package/.framework/functions/pipeline-executions.ts +1 -1
- package/.framework/functions/pipeline-runner-background.ts +120 -0
- package/.framework/functions/pipelines.ts +14 -9
- package/.framework/functions/prompt-configs.ts +7 -4
- package/.framework/functions/roles.ts +8 -5
- package/.framework/functions/security.ts +30 -17
- package/.framework/functions/system-cron.ts +250 -128
- package/.framework/functions/tests.ts +7 -6
- package/.framework/functions/timers.ts +310 -107
- package/.framework/functions/trigger-scheduler.ts +65 -5
- package/.framework/functions/triggers.ts +28 -13
- package/.framework/functions/types.ts +13 -10
- package/.framework/migrations/064_episode_leases.sql +196 -0
- package/.framework/migrations/065_execution_tables_updated_at.sql +20 -0
- package/.framework/migrations/066_episode_steal_thread_merge.sql +148 -0
- package/.framework/migrations/067_episode_lease_stale_steal.sql +93 -0
- package/.framework/migrations/068_cron_schedule_timer_rpcs.sql +251 -0
- package/.framework/migrations/069_log_stats_window.sql +54 -0
- package/.framework/migrations/070_app_type_schema_rpcs.sql +166 -0
- package/.framework/migrations/071_timer_interval_keys.sql +96 -0
- package/.framework/migrations/072_slug_autofill.sql +77 -0
- package/.framework/migrations/073_seed_member_roles.sql +26 -0
- package/.framework/schemas/spine.config.schema.json +62 -0
- package/.framework/src/App.tsx +3 -1
- package/.framework/src/apps/admin/index.tsx +1141 -775
- package/.framework/src/components/ErrorBoundary.tsx +136 -0
- package/.framework/src/components/admin/AdminListPage.tsx +81 -73
- package/.framework/src/components/admin/AdminSidebar.tsx +92 -81
- package/.framework/src/components/admin/EntitySelect.tsx +181 -0
- package/.framework/src/components/admin/PageInstructions.tsx +86 -127
- package/.framework/src/components/app-shell/GenericAppShell.tsx +3 -1
- package/.framework/src/components/app-shell/GenericDetailPage.tsx +37 -13
- package/.framework/src/components/app-shell/GenericListPage.tsx +28 -32
- package/.framework/src/components/auth/TurnstileWidget.tsx +9 -6
- package/.framework/src/components/kb/KBArticleEditor.tsx +49 -6
- package/.framework/src/components/layout/Layout.tsx +4 -2
- package/.framework/src/components/layout/Sidebar.tsx +304 -179
- package/.framework/src/components/runtime/DataDetailPage.tsx +67 -35
- package/.framework/src/components/runtime/DataHeader.tsx +96 -48
- package/.framework/src/components/runtime/DataListPage.tsx +3 -26
- package/.framework/src/components/runtime/DataStats.tsx +10 -10
- package/.framework/src/components/runtime/DataTable.tsx +12 -10
- package/.framework/src/components/ui/sheet.tsx +24 -26
- package/.framework/src/components/ui/textarea.tsx +74 -48
- package/.framework/src/hooks/useBranding.ts +47 -0
- package/.framework/src/hooks/useEntityList.ts +12 -9
- package/.framework/src/hooks/useListSchema.ts +108 -58
- package/.framework/src/instructions/README.md +57 -0
- package/.framework/src/instructions/ai-agents.md +69 -0
- package/.framework/src/instructions/alerts.md +80 -0
- package/.framework/src/instructions/api-keys.md +87 -0
- package/.framework/src/instructions/apps.md +77 -0
- package/.framework/src/instructions/concepts/ai-and-prompts.md +150 -0
- package/.framework/src/instructions/concepts/apps-and-renderers.md +162 -0
- package/.framework/src/instructions/concepts/auth-and-api-keys.md +133 -0
- package/.framework/src/instructions/concepts/automation.md +186 -0
- package/.framework/src/instructions/concepts/concurrency-and-idempotency.md +125 -0
- package/.framework/src/instructions/concepts/core-vs-custom.md +124 -0
- package/.framework/src/instructions/concepts/design-schema.md +152 -0
- package/.framework/src/instructions/concepts/integrations-and-webhooks.md +127 -0
- package/.framework/src/instructions/concepts/observability.md +116 -0
- package/.framework/src/instructions/concepts/permissions.md +150 -0
- package/.framework/src/instructions/concepts/runtime-records.md +111 -0
- package/.framework/src/instructions/concepts/scope-and-accounts.md +112 -0
- package/.framework/src/instructions/concepts/spine-way.md +172 -0
- package/.framework/src/instructions/deliveries.md +59 -0
- package/.framework/src/instructions/guide/00-orientation.md +106 -0
- package/.framework/src/instructions/guide/01-install-and-first-run.md +253 -0
- package/.framework/src/instructions/guide/02-project-map.md +147 -0
- package/.framework/src/instructions/guide/03-domain-model.md +223 -0
- package/.framework/src/instructions/guide/04-first-app.md +227 -0
- package/.framework/src/instructions/guide/05-glossary.md +183 -0
- package/.framework/src/instructions/integrations.md +96 -0
- package/.framework/src/instructions/internal/cil-markers.md +83 -0
- package/.framework/src/instructions/invites.md +60 -0
- package/.framework/src/instructions/kb.md +80 -0
- package/.framework/src/instructions/logs.md +77 -0
- package/.framework/src/instructions/observability.md +61 -0
- package/.framework/src/instructions/operations/deployment.md +115 -0
- package/.framework/src/instructions/operations/migrations.md +125 -0
- package/.framework/src/instructions/operations/security-checklist.md +148 -0
- package/.framework/src/instructions/operations/troubleshooting.md +170 -0
- package/.framework/src/instructions/operations/upgrade.md +116 -0
- package/.framework/src/instructions/pipeline-executions.md +62 -0
- package/.framework/src/instructions/pipelines.md +78 -0
- package/.framework/src/instructions/prompts.md +95 -0
- package/.framework/src/instructions/reference/api/admin-data.md +162 -0
- package/.framework/src/instructions/reference/api/auth.md +113 -0
- package/.framework/src/instructions/reference/api/errors-and-envelopes.md +113 -0
- package/.framework/src/instructions/reference/app-manifest.md +150 -0
- package/.framework/src/instructions/reference/cli.md +124 -0
- package/.framework/src/instructions/reference/database.md +132 -0
- package/.framework/src/instructions/reference/design-schema.md +280 -0
- package/.framework/src/instructions/reference/env-vars.md +133 -0
- package/.framework/src/instructions/reference/functions/account-nodes.md +75 -0
- package/.framework/src/instructions/reference/functions/admin-data.md +195 -0
- package/.framework/src/instructions/reference/functions/admin-funnel.md +90 -0
- package/.framework/src/instructions/reference/functions/admin-install-funnel.md +107 -0
- package/.framework/src/instructions/reference/functions/admin-signals.md +102 -0
- package/.framework/src/instructions/reference/functions/ai-agents.md +148 -0
- package/.framework/src/instructions/reference/functions/ai-interactions.md +156 -0
- package/.framework/src/instructions/reference/functions/api-keys.md +130 -0
- package/.framework/src/instructions/reference/functions/apps.md +140 -0
- package/.framework/src/instructions/reference/functions/auth.md +99 -0
- package/.framework/src/instructions/reference/functions/debug-auth.md +91 -0
- package/.framework/src/instructions/reference/functions/deliveries.md +110 -0
- package/.framework/src/instructions/reference/functions/embeddings.md +166 -0
- package/.framework/src/instructions/reference/functions/eval-harness.md +149 -0
- package/.framework/src/instructions/reference/functions/index.md +103 -0
- package/.framework/src/instructions/reference/functions/integration-outbound.md +200 -0
- package/.framework/src/instructions/reference/functions/integration-routes.md +151 -0
- package/.framework/src/instructions/reference/functions/integrations.md +130 -0
- package/.framework/src/instructions/reference/functions/invites.md +182 -0
- package/.framework/src/instructions/reference/functions/item-progress.md +107 -0
- package/.framework/src/instructions/reference/functions/kb.md +166 -0
- package/.framework/src/instructions/reference/functions/logs.md +141 -0
- package/.framework/src/instructions/reference/functions/observability.md +105 -0
- package/.framework/src/instructions/reference/functions/pipeline-executions.md +132 -0
- package/.framework/src/instructions/reference/functions/pipeline-runner-background.md +121 -0
- package/.framework/src/instructions/reference/functions/pipelines.md +136 -0
- package/.framework/src/instructions/reference/functions/prompt-configs.md +121 -0
- package/.framework/src/instructions/reference/functions/roles.md +121 -0
- package/.framework/src/instructions/reference/functions/security.md +140 -0
- package/.framework/src/instructions/reference/functions/system-cron.md +136 -0
- package/.framework/src/instructions/reference/functions/system.md +106 -0
- package/.framework/src/instructions/reference/functions/tests.md +97 -0
- package/.framework/src/instructions/reference/functions/timers.md +117 -0
- package/.framework/src/instructions/reference/functions/trigger-scheduler.md +102 -0
- package/.framework/src/instructions/reference/functions/triggers.md +140 -0
- package/.framework/src/instructions/reference/functions/types.md +146 -0
- package/.framework/src/instructions/reference/seeds.md +126 -0
- package/.framework/src/instructions/reference/shared-modules.md +127 -0
- package/.framework/src/instructions/reference/spine-config.md +114 -0
- package/.framework/src/instructions/roles.md +80 -0
- package/.framework/src/instructions/runtime-detail.md +70 -0
- package/.framework/src/instructions/runtime-list.md +77 -0
- package/.framework/src/instructions/security.md +67 -0
- package/.framework/src/instructions/tasks/add-a-pipeline.md +110 -0
- package/.framework/src/instructions/tasks/add-a-role.md +96 -0
- package/.framework/src/instructions/tasks/add-a-timer.md +114 -0
- package/.framework/src/instructions/tasks/add-a-trigger.md +106 -0
- package/.framework/src/instructions/tasks/add-a-type.md +151 -0
- package/.framework/src/instructions/tasks/add-a-webhook.md +108 -0
- package/.framework/src/instructions/tasks/add-an-ai-agent.md +108 -0
- package/.framework/src/instructions/tasks/add-an-integration.md +124 -0
- package/.framework/src/instructions/tasks/build-a-custom-page.md +118 -0
- package/.framework/src/instructions/tasks/package-and-install-an-app.md +127 -0
- package/.framework/src/instructions/tasks/test-your-code.md +108 -0
- package/.framework/src/instructions/tasks/write-a-function.md +132 -0
- package/.framework/src/instructions/tasks/write-a-migration.md +110 -0
- package/.framework/src/instructions/testing.md +59 -0
- package/.framework/src/instructions/timers.md +82 -0
- package/.framework/src/instructions/triggers.md +69 -0
- package/.framework/src/instructions/types.md +93 -0
- package/.framework/src/lib/branding.ts +128 -0
- package/.framework/src/pages/NoAppPage.tsx +3 -1
- package/.framework/src/pages/NotFoundPage.tsx +62 -31
- package/.framework/src/pages/SetupPage.tsx +5 -2
- package/.framework/src/pages/admin/AIAgentDetailPage.tsx +117 -106
- package/.framework/src/pages/admin/AIAgentsPage.tsx +86 -48
- package/.framework/src/pages/admin/APIKeyDetailPage.tsx +153 -152
- package/.framework/src/pages/admin/APIKeysPage.tsx +91 -90
- package/.framework/src/pages/admin/AlertsConfigPage.tsx +29 -18
- package/.framework/src/pages/admin/AppDetailPage.tsx +6 -60
- package/.framework/src/pages/admin/AppsPage.tsx +104 -66
- package/.framework/src/pages/admin/DeliveriesPage.tsx +5 -5
- package/.framework/src/pages/admin/EmbeddingDetailPage.tsx +5 -23
- package/.framework/src/pages/admin/EmbeddingsPage.tsx +5 -26
- package/.framework/src/pages/admin/IntegrationDetailPage.tsx +7 -7
- package/.framework/src/pages/admin/IntegrationsPage.tsx +85 -43
- package/.framework/src/pages/admin/LogsPage.tsx +144 -76
- package/.framework/src/pages/admin/ObservabilityDashboard.tsx +223 -140
- package/.framework/src/pages/admin/PipelineDetailPage.tsx +134 -113
- package/.framework/src/pages/admin/PipelineExecutionsPage.tsx +108 -45
- package/.framework/src/pages/admin/PipelinesPage.tsx +160 -115
- package/.framework/src/pages/admin/PromptConfigDetailPage.tsx +96 -98
- package/.framework/src/pages/admin/PromptConfigsPage.tsx +101 -59
- package/.framework/src/pages/admin/RoleDetailPage.tsx +90 -79
- package/.framework/src/pages/admin/RolesPage.tsx +86 -43
- package/.framework/src/pages/admin/SecurityPage.tsx +1 -1
- package/.framework/src/pages/admin/TestingDashboard.tsx +16 -28
- package/.framework/src/pages/admin/TimerDetailPage.tsx +117 -100
- package/.framework/src/pages/admin/TimersPage.tsx +90 -62
- package/.framework/src/pages/admin/TriggerDetailPage.tsx +90 -83
- package/.framework/src/pages/admin/TriggersPage.tsx +124 -99
- package/.framework/src/pages/admin/TypeDetailPage.tsx +152 -138
- package/.framework/src/pages/admin/TypesPage.tsx +90 -48
- package/.framework/src/pages/admin/cil/CILAgentPage.tsx +17 -25
- package/.framework/src/pages/admin/cil/CILChunkDetailPage.tsx +17 -27
- package/.framework/src/pages/admin/cil/CILDashboardPage.tsx +72 -40
- package/.framework/src/pages/admin/cil/CILFileListPage.tsx +321 -129
- package/.framework/src/pages/admin/cil/CILFileSelectPage.tsx +18 -29
- package/.framework/src/pages/admin/cil/CILGraphPage.tsx +26 -38
- package/.framework/src/pages/admin/cil/CILIngestionPage.tsx +34 -46
- package/.framework/src/pages/admin/cil/CILProjectsPage.tsx +189 -103
- package/.framework/src/pages/admin/cil/CILSearchPage.tsx +246 -136
- package/.framework/src/pages/admin/cil/CILSuggestionsPage.tsx +11 -22
- package/.framework/src/pages/admin/cil/CILVersionsPage.tsx +9 -20
- package/.framework/src/pages/admin/cil/FlexiblePipelinePage.tsx +26 -38
- package/.framework/src/pages/admin/kb/KBAdminPage.tsx +7 -26
- package/.framework/src/pages/auth/AuthConfirmPage.tsx +3 -1
- package/.framework/src/pages/auth/ForgotPasswordPage.tsx +3 -1
- package/.framework/src/pages/auth/LoginPage.tsx +4 -2
- package/.framework/src/pages/auth/RegisterPage.tsx +3 -1
- package/.framework/templates/agent/AGENTS.md +150 -0
- package/.framework/templates/agent/skills/spine-add-ai-agent/SKILL.md +58 -0
- package/.framework/templates/agent/skills/spine-add-automation/SKILL.md +62 -0
- package/.framework/templates/agent/skills/spine-add-integration/SKILL.md +63 -0
- package/.framework/templates/agent/skills/spine-architect/SKILL.md +86 -0
- package/.framework/templates/agent/skills/spine-install-app/SKILL.md +72 -0
- package/.framework/templates/agent/skills/spine-migration/SKILL.md +75 -0
- package/.framework/templates/agent/skills/spine-new-app/SKILL.md +67 -0
- package/.framework/templates/agent/skills/spine-new-function/SKILL.md +65 -0
- package/.framework/templates/agent/skills/spine-new-type/SKILL.md +65 -0
- package/.framework/templates/agent/skills/spine-schema/SKILL.md +77 -0
- package/.framework/templates/agent/skills/spine-test/SKILL.md +67 -0
- package/.framework/templates/agent/skills/spine-troubleshoot/SKILL.md +74 -0
- package/.framework/templates/agent/skills/spine-upgrade/SKILL.md +69 -0
- package/.framework/templates/project.json +5 -1
- package/.framework/tests/unit/account-scoping-gates.test.ts +392 -0
- package/.framework/tests/unit/agent-files.test.ts +355 -0
- package/.framework/tests/unit/agent-runner.test.ts +496 -47
- package/.framework/tests/unit/api-keys-create-scope-gate.test.ts +160 -0
- package/.framework/tests/unit/api-keys-omit-secret-fields.test.ts +38 -0
- package/.framework/tests/unit/bootstrap.test.ts +242 -0
- package/.framework/tests/unit/cli-context-api-key.test.ts +114 -0
- package/.framework/tests/unit/debug-auth.test.ts +38 -0
- package/.framework/tests/unit/deliveries-account-scoping.test.ts +185 -0
- package/.framework/tests/unit/episode-lease.test.ts +695 -0
- package/.framework/tests/unit/integration-outbound-credentials.test.ts +167 -0
- package/.framework/tests/unit/integrations-audit-redaction.test.ts +130 -0
- package/.framework/tests/unit/kb-ingest-lease.test.ts +19 -0
- package/.framework/tests/unit/logging-app-id.test.ts +75 -0
- package/.framework/tests/unit/pipeline-runner-background.test.ts +120 -0
- package/.framework/tests/unit/pipeline-runner.test.ts +153 -1
- package/.framework/tests/unit/principal-cache.test.ts +15 -0
- package/.framework/tests/unit/system-context-denial.test.ts +145 -0
- package/.framework/tests/unit/system-cron.test.ts +240 -0
- package/.framework/tests/unit/timers.test.ts +159 -0
- package/.framework/tests/unit/trigger-engine.test.ts +278 -91
- package/.framework/tests/unit/trigger-scheduler.test.ts +78 -0
- package/README.md +125 -166
- package/config/tsconfig.cli.json +2 -2
- package/netlify.toml +5 -0
- package/package.json +15 -4
- package/templates/project/package-lock.json +2 -2
- package/.framework/docs/admin-routes.md +0 -76
- package/.framework/docs/api-docs-progress.md +0 -38
- package/.framework/docs/api-governance.md +0 -146
- package/.framework/docs/api-testing-results.md +0 -212
- package/.framework/docs/assembly-launch-guide.md +0 -138
- package/.framework/docs/audit-results.md +0 -590
- package/.framework/docs/db-api-inventory.md +0 -95
- package/.framework/docs/gap-remediation-backlog.md +0 -103
- package/.framework/docs/ui-adoption-verification.md +0 -111
- package/.framework/docs/ui-api-coverage.md +0 -84
- package/.framework/docs/v2-compatibility-audit.md +0 -228
- package/.framework/mcp/index.ts +0 -133
- package/.framework/mcp/load-env.ts +0 -60
- package/.framework/mcp/shared/app-manifest.ts +0 -275
- package/.framework/mcp/shared/db.ts +0 -477
- package/.framework/mcp/shared/kb.ts +0 -118
- package/.framework/mcp/tools/architect.ts +0 -431
- package/.framework/mcp/tools/cil/context.ts +0 -345
- package/.framework/mcp/tools/cil/graph.ts +0 -242
- package/.framework/mcp/tools/cil/ingest.ts +0 -1217
- package/.framework/mcp/tools/cil/pipeline-orchestrator.ts +0 -693
- package/.framework/mcp/tools/cil/pipeline.ts +0 -767
- package/.framework/mcp/tools/cil/project.ts +0 -791
- package/.framework/mcp/tools/cil/retrieval.ts +0 -336
- package/.framework/mcp/tools/cil/search-core.ts +0 -454
- package/.framework/mcp/tools/cil/search.ts +0 -97
- package/.framework/mcp/tools/cil/suggest.ts +0 -186
- package/.framework/mcp/tools/cil/validate.ts +0 -1369
- package/.framework/mcp/tools/kb/delete.ts +0 -139
- package/.framework/mcp/tools/kb/index.ts +0 -52
- package/.framework/mcp/tools/kb/ingest.ts +0 -84
- package/.framework/mcp/tools/kb/list-types.ts +0 -102
- package/.framework/mcp/tools/kb/publish.ts +0 -100
- package/.framework/mcp/tools/kb/reindex.ts +0 -86
- package/.framework/mcp/tools/kb/revoke.ts +0 -85
- package/.framework/mcp/tools/kb/search.ts +0 -101
- package/.framework/mcp/tools/kb/upsert.ts +0 -125
- package/.framework/mcp/tools/observability.ts +0 -510
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: deliveries
|
|
3
|
+
audience: both
|
|
4
|
+
kind: reference
|
|
5
|
+
verified_against: f69c37d
|
|
6
|
+
verified_on: 2026-10-30
|
|
7
|
+
source_files:
|
|
8
|
+
- .framework/functions/deliveries.ts
|
|
9
|
+
- .framework/functions/integration-outbound.ts
|
|
10
|
+
- .framework/functions/_shared/middleware.ts
|
|
11
|
+
- .framework/migrations/004_core_rpc_and_broker.sql
|
|
12
|
+
- .framework/public/_redirects
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# deliveries
|
|
16
|
+
|
|
17
|
+
## What it does
|
|
18
|
+
|
|
19
|
+
Read access to `public.webhook_deliveries` — the delivery log for
|
|
20
|
+
inbound and outbound webhook traffic — plus `action=retry`, which
|
|
21
|
+
re-executes a failed **outbound** delivery through
|
|
22
|
+
`integration-outbound` (see
|
|
23
|
+
[Integrations and webhooks](../../concepts/integrations-and-webhooks.md)).
|
|
24
|
+
|
|
25
|
+
The table is `webhook_deliveries` — there is no `deliveries` table.
|
|
26
|
+
|
|
27
|
+
## Route and methods
|
|
28
|
+
|
|
29
|
+
`/.netlify/functions/deliveries`, reachable as `/api/deliveries`
|
|
30
|
+
(`/api/*` → `/.netlify/functions/:splat`,
|
|
31
|
+
`.framework/public/_redirects`). Dispatch is by `?action=` then method:
|
|
32
|
+
|
|
33
|
+
| Call | Handler |
|
|
34
|
+
|---|---|
|
|
35
|
+
| `GET /api/deliveries` | `list` |
|
|
36
|
+
| `GET /api/deliveries?id=<uuid>` | `get` |
|
|
37
|
+
| `POST /api/deliveries?action=retry` | `retry` |
|
|
38
|
+
|
|
39
|
+
Anything else (including `PATCH`/`DELETE`) → `Invalid action or method`.
|
|
40
|
+
|
|
41
|
+
## Authentication
|
|
42
|
+
|
|
43
|
+
Standard `createHandler` auth: `x-api-key` → machine principal,
|
|
44
|
+
`x-internal-secret` → internal principal, `Bearer <jwt>` → human;
|
|
45
|
+
anonymous → 401.
|
|
46
|
+
|
|
47
|
+
- `list` requires `ctx.accountId` and always filters
|
|
48
|
+
`.eq('account_id', ctx.accountId)`.
|
|
49
|
+
- `get`/`retry` have no explicit account check — for human callers RLS
|
|
50
|
+
on `ctx.db` bounds what the row lookup can see; machine principals run
|
|
51
|
+
`ctx.db` as the service role and can fetch any delivery by id.
|
|
52
|
+
- No `sanitizeRecordData` is applied — rows are returned raw.
|
|
53
|
+
|
|
54
|
+
## Request contract
|
|
55
|
+
|
|
56
|
+
**list** (query): `direction`, `status`, `integration_id`,
|
|
57
|
+
`api_key_id`, `limit` (default 100), `offset` (default 0). Ordered
|
|
58
|
+
`created_at` desc; always account-scoped.
|
|
59
|
+
|
|
60
|
+
**get** (query): `id`.
|
|
61
|
+
|
|
62
|
+
**retry** (body): `id` — the delivery must exist and have
|
|
63
|
+
`direction === 'outbound'` (inbound retries throw).
|
|
64
|
+
|
|
65
|
+
## Response contract
|
|
66
|
+
|
|
67
|
+
Standard `{ data, error, meta }` envelope.
|
|
68
|
+
|
|
69
|
+
- `list`/`get` → raw `webhook_deliveries` row(s).
|
|
70
|
+
- `retry` → the return value of `integration-outbound`'s `execute` for
|
|
71
|
+
`{ delivery_id }` — the delivery attempt result, not a new delivery
|
|
72
|
+
row.
|
|
73
|
+
|
|
74
|
+
## Side effects
|
|
75
|
+
|
|
76
|
+
- `retry` re-executes the delivery by calling
|
|
77
|
+
`.framework/functions/integration-outbound.ts` `execute` in-process
|
|
78
|
+
with `principal: SYSTEM_PRINCIPAL` and `accountId` taken from **the
|
|
79
|
+
delivery's** `account_id` (not the caller's). Outbound execution
|
|
80
|
+
writes its own attempt/status bookkeeping onto `webhook_deliveries`.
|
|
81
|
+
- `emitLog` writes a `delivery.manual_retry` audit row to `public.logs`
|
|
82
|
+
with the delivery's `direction` and `integration_id`.
|
|
83
|
+
- `list`/`get` are pure reads.
|
|
84
|
+
|
|
85
|
+
## Errors
|
|
86
|
+
|
|
87
|
+
| Condition | HTTP | Message |
|
|
88
|
+
|---|---|---|
|
|
89
|
+
| No account context (list) | 500 | `Account context required` |
|
|
90
|
+
| Missing `id` | 500 | `Delivery ID is required` |
|
|
91
|
+
| Missing row | 500 | `Delivery not found` / PostgREST message |
|
|
92
|
+
| Retrying an inbound delivery | 500 | `Manual retry is only supported for outbound deliveries in this release` |
|
|
93
|
+
| Bad action/method | 500 | `Invalid action or method` |
|
|
94
|
+
|
|
95
|
+
Validation failures surface as HTTP 500 — thrown `Error`s without a
|
|
96
|
+
`statusCode` map to 500 in the shared error path.
|
|
97
|
+
|
|
98
|
+
## Agent notes
|
|
99
|
+
|
|
100
|
+
- Retry runs the delivery under `SYSTEM_PRINCIPAL` — the caller's
|
|
101
|
+
identity is not propagated into the outbound execution, and the
|
|
102
|
+
delivery's own `account_id` decides the execution account. A caller
|
|
103
|
+
who can `get` a delivery id can retry it.
|
|
104
|
+
- There is no redelivery of inbound payloads — inbound rows are
|
|
105
|
+
observability only; outbound retries go through the integration
|
|
106
|
+
adapter again and may produce real external HTTP calls.
|
|
107
|
+
- `webhook_deliveries` is created by
|
|
108
|
+
`.framework/migrations/004_core_rpc_and_broker.sql`; automatic retry
|
|
109
|
+
sweeps happen in `system-cron` via
|
|
110
|
+
`.framework/functions/_shared/retry-deliveries.ts`, not here.
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: embeddings
|
|
3
|
+
audience: both
|
|
4
|
+
kind: reference
|
|
5
|
+
verified_against: f69c37d
|
|
6
|
+
verified_on: 2026-10-30
|
|
7
|
+
source_files:
|
|
8
|
+
- .framework/functions/embeddings.ts
|
|
9
|
+
- .framework/functions/_shared/middleware.ts
|
|
10
|
+
- .framework/functions/_shared/llm.ts
|
|
11
|
+
- .framework/migrations/001_core_schema.sql
|
|
12
|
+
- .framework/migrations/044_match_embeddings_filtered_knn.sql
|
|
13
|
+
- .framework/public/_redirects
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
# embeddings
|
|
17
|
+
|
|
18
|
+
## What it does
|
|
19
|
+
|
|
20
|
+
Lifecycle management for `public.embeddings` — per-document vector rows
|
|
21
|
+
(`UNIQUE(model_id, document_id, chunk_index)`, pgvector
|
|
22
|
+
`embedding vector(1536)`) used by knowledge retrieval. Beyond basic
|
|
23
|
+
CRUD it can **generate** an item's vector set from its type schema,
|
|
24
|
+
**search** by vector similarity or full-text, and gate visibility with
|
|
25
|
+
`approved_at`/`revoked_at`.
|
|
26
|
+
|
|
27
|
+
## Route and methods
|
|
28
|
+
|
|
29
|
+
`/.netlify/functions/embeddings`, reachable as `/api/embeddings`
|
|
30
|
+
(`/api/*` → `/.netlify/functions/:splat`,
|
|
31
|
+
`.framework/public/_redirects`). Dispatch is by `?action=` + method:
|
|
32
|
+
|
|
33
|
+
| Call | Handler |
|
|
34
|
+
|---|---|
|
|
35
|
+
| `GET /api/embeddings` | `list` |
|
|
36
|
+
| `GET /api/embeddings?id=<uuid>` | `get` |
|
|
37
|
+
| `GET /api/embeddings?action=stats` | `getStats` |
|
|
38
|
+
| `POST /api/embeddings` | `create` |
|
|
39
|
+
| `PATCH /api/embeddings` (`id` in body or query) | `update` |
|
|
40
|
+
| `POST /api/embeddings?action=generate` | `generate` |
|
|
41
|
+
| `POST /api/embeddings?action=batch-create` | `batchCreate` |
|
|
42
|
+
| `POST /api/embeddings?action=delete-document` | `deleteByDocument` |
|
|
43
|
+
| `POST /api/embeddings?action=cleanup` | `cleanup` |
|
|
44
|
+
| `POST /api/embeddings?action=search-similar` | `searchSimilar` |
|
|
45
|
+
| `POST /api/embeddings?action=search-semantic` | `searchSemantic` |
|
|
46
|
+
| `POST /api/embeddings?action=revoke` | `revoke` |
|
|
47
|
+
| `POST /api/embeddings?action=approve` | `approve` |
|
|
48
|
+
|
|
49
|
+
There is no `DELETE` route — `delete-document` is a POST action.
|
|
50
|
+
|
|
51
|
+
## Authentication
|
|
52
|
+
|
|
53
|
+
Standard `createHandler` auth: `x-api-key` → machine principal,
|
|
54
|
+
`x-internal-secret` → internal principal, `Bearer <jwt>` → human;
|
|
55
|
+
anonymous → 401.
|
|
56
|
+
|
|
57
|
+
- `list`/`create`/`batchCreate`/`getStats`/`searchSemantic` require
|
|
58
|
+
`ctx.accountId`.
|
|
59
|
+
- **No role check anywhere.** `generate`, `revoke`, and `approve` read
|
|
60
|
+
and write through `adminDb` (service role) for any authenticated
|
|
61
|
+
caller — including cross-account, since `generate` accepts an
|
|
62
|
+
`account_id_override`. Treat these actions as trusted-surface
|
|
63
|
+
operations.
|
|
64
|
+
|
|
65
|
+
## Request contract
|
|
66
|
+
|
|
67
|
+
**list** (query): `model_id`, `document_id`, `limit` (default 100),
|
|
68
|
+
`offset` (default 0). Ordered `created_at` desc.
|
|
69
|
+
|
|
70
|
+
**get** (query): `id`. **getStats**: none → `{ total_embeddings }`.
|
|
71
|
+
|
|
72
|
+
**create** (body): `model_id`, `document_id`, `content` required;
|
|
73
|
+
`chunk_index` (default 0), `metadata` `{}`. `account_id` stamped from
|
|
74
|
+
context. (Does **not** compute a vector — it stores a row.)
|
|
75
|
+
|
|
76
|
+
**update** (`id` + body): `content`, `metadata` only.
|
|
77
|
+
|
|
78
|
+
**generate** (body): `item_id` required; `force_regenerate` (deletes and
|
|
79
|
+
rebuilds all vectors for the document), `account_id_override` (defaults
|
|
80
|
+
to the item's account, then the `spine-system` platform account).
|
|
81
|
+
|
|
82
|
+
**batchCreate** (body): `embeddings_data` array — rows inserted verbatim
|
|
83
|
+
with `account_id` stamped.
|
|
84
|
+
|
|
85
|
+
**deleteByDocument** (body): `document_id` — hard-deletes all its rows.
|
|
86
|
+
|
|
87
|
+
**cleanup** (body): `days_to_keep` (default 365) — hard-deletes rows
|
|
88
|
+
older than the cutoff.
|
|
89
|
+
|
|
90
|
+
**searchSimilar** (body): `query_embedding` required; `limit` (default
|
|
91
|
+
10), `threshold` (default 0.7), `filter_account_ids`,
|
|
92
|
+
`filter_vector_type`, `filter_item_types`, `filter_document_ids` — calls
|
|
93
|
+
the `match_embeddings` RPC
|
|
94
|
+
(`.framework/migrations/044_match_embeddings_filtered_knn.sql`).
|
|
95
|
+
|
|
96
|
+
**searchSemantic** (body): `query` required; `model_id`,
|
|
97
|
+
`document_ids`, `limit` (default 10) — Postgres `textSearch`
|
|
98
|
+
(`websearch`, `english`) over `content`, scoped to `ctx.accountId`.
|
|
99
|
+
|
|
100
|
+
**revoke** / **approve** (body): `document_id`.
|
|
101
|
+
|
|
102
|
+
## Response contract
|
|
103
|
+
|
|
104
|
+
Standard `{ data, error, meta }` envelope.
|
|
105
|
+
|
|
106
|
+
- `generate` → `{ item_id, embeddings_created, embeddings_skipped,
|
|
107
|
+
errors }` (unchanged content is skipped by hash, not re-embedded).
|
|
108
|
+
- `searchSimilar` → `{ results, count, model_id, threshold }`;
|
|
109
|
+
`searchSemantic` → `{ results, count, method: 'text_search', query }`.
|
|
110
|
+
- `revoke` → `{ document_id, revoked_count }`; `approve` →
|
|
111
|
+
`{ document_id, approved_count }`; `deleteByDocument`/`cleanup` →
|
|
112
|
+
`{ deleted_count }`; `batchCreate` → inserted rows.
|
|
113
|
+
- `list`/`get` sanitize via `sanitizeRecordData` — full row for system
|
|
114
|
+
admins, `{ id }` for non-admins (rows carry no `design_schema`).
|
|
115
|
+
|
|
116
|
+
## Side effects
|
|
117
|
+
|
|
118
|
+
- `generate` reads the item + its type's `design_schema` (`vector_types`
|
|
119
|
+
— a flat array or a per-`kb_type` map defaulting to
|
|
120
|
+
`['semantic','structure']` — and `embedding_fields.structure`), builds
|
|
121
|
+
one text per vector type via `CONTENT_BUILDERS`, calls the OpenAI
|
|
122
|
+
embeddings API (`text-embedding-3-small`), and upserts
|
|
123
|
+
`public.embeddings` rows keyed by fixed `chunk_index` slots
|
|
124
|
+
(`VECTOR_TYPE_SLOTS`: semantic 0, structure 1, context 2, …) so the
|
|
125
|
+
`(model_id, document_id, chunk_index)` unique constraint never
|
|
126
|
+
collides across vector types.
|
|
127
|
+
- `generate` deletes stale rows left over from a previously larger
|
|
128
|
+
vector-type set, and skips re-embedding rows whose `content_hash`
|
|
129
|
+
matches (16-char SHA-256 prefix).
|
|
130
|
+
- `generate` sets `approved_at` only when the item's `status` is
|
|
131
|
+
`'published'`; `metadata` carries `vector_type`, `item_type`,
|
|
132
|
+
`kb_type`, `security_level`, `source_item_id`.
|
|
133
|
+
- A `'summary'` vector type is generated via `callOpenAIChat`
|
|
134
|
+
(`LLM_DEFAULT_MODEL` or `gpt-4o-mini`) with a sync title+description
|
|
135
|
+
fallback.
|
|
136
|
+
- `revoke` sets `revoked_at` on all non-revoked rows for the document;
|
|
137
|
+
`approve` sets `approved_at` and clears `revoked_at` — both via
|
|
138
|
+
`adminDb` regardless of caller role.
|
|
139
|
+
- `emitLog` writes `embedding.created`, `embedding.updated`,
|
|
140
|
+
`embeddings.generated`, `embeddings.batch_created`,
|
|
141
|
+
`embeddings.document_deleted`, `embeddings.cleaned`,
|
|
142
|
+
`embeddings.revoked`, `embeddings.approved` to `public.logs`.
|
|
143
|
+
|
|
144
|
+
## Errors
|
|
145
|
+
|
|
146
|
+
| Condition | HTTP | Message |
|
|
147
|
+
|---|---|---|
|
|
148
|
+
| Missing fields | 500 | `model_id, document_id, and content are required` / `item_id is required` / `document_id is required` / `embeddings_data array is required` |
|
|
149
|
+
| Item missing (generate) | 500 | `Item <id> not found` |
|
|
150
|
+
| Embedding API failure | 500 | `Embedding API call failed: <message>` |
|
|
151
|
+
| Missing search inputs | 500 | `query_embedding is required for similarity search` / `query is required for semantic search` |
|
|
152
|
+
| Bad action/method | 500 | `Invalid action or method` |
|
|
153
|
+
|
|
154
|
+
## Agent notes
|
|
155
|
+
|
|
156
|
+
- Vectors are stored as the pgvector string literal `[v1,v2,…]`
|
|
157
|
+
produced by `callEmbeddingApi` — the `embedding` column is
|
|
158
|
+
`vector(1536)` (`.framework/migrations/001_core_schema.sql`).
|
|
159
|
+
- `metadata.vector_type` is the discriminator retrieval filters use;
|
|
160
|
+
`chunk_index` is a slot convention, not a sequence of text chunks.
|
|
161
|
+
- `generate`'s `account_id_override` plus unconditional `adminDb` means
|
|
162
|
+
any authenticated caller can regenerate embeddings into another
|
|
163
|
+
account — and `revoke`/`approve`/`cleanup`/`deleteByDocument` are
|
|
164
|
+
equally ungated. Do not expose this endpoint to untrusted principals.
|
|
165
|
+
- Retrieval-time search is `match_embeddings` (vector) or `textSearch`
|
|
166
|
+
(keyword) — semantic ranking lives in the RPC, not here.
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: eval-harness
|
|
3
|
+
audience: both
|
|
4
|
+
kind: reference
|
|
5
|
+
verified_against: f69c37d
|
|
6
|
+
verified_on: 2026-10-30
|
|
7
|
+
source_files:
|
|
8
|
+
- .framework/functions/eval-harness.ts
|
|
9
|
+
- .framework/functions/_shared/llm.ts
|
|
10
|
+
- .framework/functions/_shared/middleware.ts
|
|
11
|
+
- .framework/functions/_shared/resolve-ids.ts
|
|
12
|
+
- .framework/functions/admin-data.ts
|
|
13
|
+
- .framework/migrations/034_match_embeddings_knn.sql
|
|
14
|
+
- public/_redirects
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# eval-harness
|
|
18
|
+
|
|
19
|
+
## What it does
|
|
20
|
+
|
|
21
|
+
`eval-harness` (`.framework/functions/eval-harness.ts`) is an internal
|
|
22
|
+
retrieval-quality harness. It stores test cases as `eval_test_case` `items`
|
|
23
|
+
rows, replays each question against the `embeddings` corpus via the
|
|
24
|
+
`match_embeddings` RPC, scores the retrieval, and records the run as a
|
|
25
|
+
`pipeline_executions` row so results show up in the executions UI.
|
|
26
|
+
|
|
27
|
+
This is a dev/QA tool, not a production path — nothing else calls it.
|
|
28
|
+
|
|
29
|
+
Actions (dispatched on `?action=`):
|
|
30
|
+
|
|
31
|
+
| Action | Method | Purpose |
|
|
32
|
+
|---|---|---|
|
|
33
|
+
| `create_test_case` | POST | Insert an `eval_test_case` item via admin-data. |
|
|
34
|
+
| `list_test_cases` | GET | List active cases (default action for any GET). |
|
|
35
|
+
| `run_eval` | POST | Score all (or one `test_type` of) active cases. |
|
|
36
|
+
| `get_results` | GET | Recent eval runs (`pipeline_executions` rows). |
|
|
37
|
+
| `get_coverage` | GET | Case count per `test_type`, with gaps listed. |
|
|
38
|
+
|
|
39
|
+
`test_type` values: `easy`, `medium`, `hard`, `security`, `hallucination`,
|
|
40
|
+
`stale`, `account_gating`.
|
|
41
|
+
|
|
42
|
+
## Route and methods
|
|
43
|
+
|
|
44
|
+
- `/api/eval-harness?action=<action>` — `public/_redirects` maps `/api/*` to
|
|
45
|
+
`/.netlify/functions/:splat`. The method guard is `ctx.query.method`
|
|
46
|
+
(populated from the HTTP method): creates/runs are POST, reads are GET.
|
|
47
|
+
- GET with no `action` (or an unrecognized action on GET) falls through to
|
|
48
|
+
`list_test_cases`; anything else throws `Invalid action or method`.
|
|
49
|
+
|
|
50
|
+
## Authentication
|
|
51
|
+
|
|
52
|
+
`createHandler` resolves a principal and rejects anonymous requests with 401.
|
|
53
|
+
`run_eval` and `get_results` additionally require `ctx.accountId`
|
|
54
|
+
(`Account context required`). There is **no system-admin gate** — any
|
|
55
|
+
authenticated principal can create cases and run evals, which is part of why
|
|
56
|
+
this page treats the surface as internal-facing.
|
|
57
|
+
|
|
58
|
+
## Request contract
|
|
59
|
+
|
|
60
|
+
`create_test_case` (POST):
|
|
61
|
+
|
|
62
|
+
| Field | Default | Notes |
|
|
63
|
+
|---|---|---|
|
|
64
|
+
| `question` | — | Required; also becomes the item `title` (120 chars). |
|
|
65
|
+
| `expected_tier` | `'medium'` | `high` / `medium` / `low`. |
|
|
66
|
+
| `expected_escalate` | `false` | Stored, not currently scored. |
|
|
67
|
+
| `expected_source_ids` | `[]` | Document ids retrieval should hit. |
|
|
68
|
+
| `excluded_source_ids` | `[]` | Document ids retrieval must not hit (boundary). |
|
|
69
|
+
| `test_type` | `'medium'` | One of the categories above. |
|
|
70
|
+
|
|
71
|
+
`list_test_cases` (GET): query params `test_type`, `limit` (200), `offset`.
|
|
72
|
+
|
|
73
|
+
`run_eval` (POST): `{ test_type?, similarity_threshold = 0.15,
|
|
74
|
+
match_count = 8 }`.
|
|
75
|
+
|
|
76
|
+
`get_results` (GET): query param `limit` (5).
|
|
77
|
+
|
|
78
|
+
`get_coverage` (GET): no inputs.
|
|
79
|
+
|
|
80
|
+
## Response contract
|
|
81
|
+
|
|
82
|
+
- `create_test_case` → the created `items` record (admin-data `create`
|
|
83
|
+
result).
|
|
84
|
+
- `run_eval` →
|
|
85
|
+
`{ run_id, summary, results }` where `summary` is `{ total, passed,
|
|
86
|
+
failed, skipped, pass_rate, run_at, account_id }` and each result is
|
|
87
|
+
`{ id, question, test_type, status, retrieval_recall, boundary_safe,
|
|
88
|
+
boundary_violations, tier_correct, inferred_tier, expected_tier,
|
|
89
|
+
mean_similarity, retrieved_count }`. With no cases it returns
|
|
90
|
+
`{ run_id: null, message: 'No test cases found', total: 0 }`.
|
|
91
|
+
- `get_results` → recent `pipeline_executions` rows (`id`, `status`,
|
|
92
|
+
`result`, `started_at`, `completed_at`, `trigger_data`) filtered to
|
|
93
|
+
`trigger_data->>eval_run = 'true'`.
|
|
94
|
+
- `get_coverage` → `{ total_cases, coverage: [{ test_type, case_count,
|
|
95
|
+
has_cases }], recommendation: [<test_types with no cases>] }`.
|
|
96
|
+
|
|
97
|
+
Scoring per case: **boundary safe** means no `excluded_source_ids` appear in
|
|
98
|
+
the retrieved set; **retrieval recall** is the fraction of
|
|
99
|
+
`expected_source_ids` retrieved (`null` when none declared); **inferred
|
|
100
|
+
tier** maps mean match similarity to `high` ≥ 0.85, `medium` ≥ 0.60, else
|
|
101
|
+
`low`. A case passes when boundary-safe AND (recall is null OR ≥ 0.5) AND
|
|
102
|
+
inferred tier equals expected tier. Cases with `data.needs_source_review`
|
|
103
|
+
are skipped — they're diagnostic captures awaiting human promotion to
|
|
104
|
+
golden cases. Embed-API errors skip the case (`skipped`, reason
|
|
105
|
+
`embed_api_error`), as does any per-case exception.
|
|
106
|
+
|
|
107
|
+
## Side effects
|
|
108
|
+
|
|
109
|
+
- `create_test_case` inserts an `items` row through admin-data — type
|
|
110
|
+
`eval_test_case`, `status: 'active'` — so validation, audit, and triggers
|
|
111
|
+
run.
|
|
112
|
+
- `run_eval` calls `callOpenAIEmbeddings` (`text-embedding-3-small`) once per
|
|
113
|
+
case — that routes through `integration-outbound` with the `openai`
|
|
114
|
+
integration — then `match_embeddings` with `filter_vector_type:
|
|
115
|
+
'semantic'` over the caller's account plus the `spine-system` platform
|
|
116
|
+
account.
|
|
117
|
+
- `run_eval` inserts a `pipeline_executions` row with the sentinel
|
|
118
|
+
`pipeline_id` `00000000-0000-0000-0000-000000000000`,
|
|
119
|
+
`trigger_data.eval_run: true`, `status: 'completed'` when zero failures
|
|
120
|
+
else `'failed'`, and the full `{ summary, results }` in `result` — then
|
|
121
|
+
emits an `eval.run_completed` audit event.
|
|
122
|
+
|
|
123
|
+
## Errors
|
|
124
|
+
|
|
125
|
+
| Condition | Error |
|
|
126
|
+
|---|---|
|
|
127
|
+
| Missing question | `question is required` |
|
|
128
|
+
| Type not installed | `eval_test_case type not found — run app install first` |
|
|
129
|
+
| No account context | `Account context required` |
|
|
130
|
+
| Bad dispatch | `Invalid action or method` |
|
|
131
|
+
|
|
132
|
+
## Agent notes
|
|
133
|
+
|
|
134
|
+
- **Internal-facing.** This is a QA harness shipped with the framework, not
|
|
135
|
+
a product surface: no admin gate, results land in `pipeline_executions`
|
|
136
|
+
rather than a dedicated table, and `run_eval` synchronously embeds up to
|
|
137
|
+
500 questions in one request — slow and costly on large suites. Run it in
|
|
138
|
+
dev/staging or behind your own gate.
|
|
139
|
+
- `expected_escalate` is stored but never read by scoring — only
|
|
140
|
+
recall/boundary/tier count.
|
|
141
|
+
- Recall uses `document_id` equality against `expected_source_ids` — fill
|
|
142
|
+
those with `embeddings.document_id` values (items UUIDs for knowledge
|
|
143
|
+
records), not item titles.
|
|
144
|
+
- Eval runs share the `spine-system` platform corpus with search — account
|
|
145
|
+
isolation is tested by `account_gating` cases whose
|
|
146
|
+
`excluded_source_ids` cover other tenants' documents.
|
|
147
|
+
- The `eval_test_case` item type must be installed for creation to work;
|
|
148
|
+
`resolveTypeId` failure throws the "run app install first" error rather
|
|
149
|
+
than skipping.
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Functions index
|
|
3
|
+
audience: both
|
|
4
|
+
kind: index
|
|
5
|
+
verified_against: f69c37d
|
|
6
|
+
verified_on: 2026-10-30
|
|
7
|
+
source_files:
|
|
8
|
+
- .framework/functions/
|
|
9
|
+
- .framework/public/_redirects
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Functions index
|
|
13
|
+
|
|
14
|
+
All 47 Netlify functions in `.framework/functions/`, grouped by domain.
|
|
15
|
+
Every function is reachable publicly as `/api/<name>` (`/api/*` →
|
|
16
|
+
`/.netlify/functions/:splat`, `.framework/public/_redirects`), and all
|
|
17
|
+
JSON responses use the `{ data, error, meta }` envelope from
|
|
18
|
+
`.framework/functions/_shared/middleware.ts`.
|
|
19
|
+
|
|
20
|
+
Pages linked below are full references; everything else is a one-line
|
|
21
|
+
summary.
|
|
22
|
+
|
|
23
|
+
## Data & access
|
|
24
|
+
|
|
25
|
+
| Function | What it does |
|
|
26
|
+
|---|---|
|
|
27
|
+
| [admin-data](./admin-data.md) | Generic CRUD + stats over the entity allowlist, with record permissions, schema stamping, and trigger firing. |
|
|
28
|
+
| [account-nodes](./account-nodes.md) | One account plus its ancestors, children, and descendants for hierarchy views. |
|
|
29
|
+
| [api-keys](./api-keys.md) | Mint, validate, revoke, and list `sk_…` machine API keys plus usage logs. |
|
|
30
|
+
| [auth](./auth.md) | The caller's user context — person, role, permissions, accessible accounts — plus a health probe. |
|
|
31
|
+
| [invites](./invites.md) | Registration placement, invite lifecycle, join-request approval, and member management. |
|
|
32
|
+
| [item-progress](./item-progress.md) | Per-person pipeline progress on items with enforced status transitions. |
|
|
33
|
+
|
|
34
|
+
## Config CRUD
|
|
35
|
+
|
|
36
|
+
| Function | What it does |
|
|
37
|
+
|---|---|
|
|
38
|
+
| [apps](./apps.md) | App registry CRUD plus schema, availability, and version actions. |
|
|
39
|
+
| [prompt-configs](./prompt-configs.md) | Prompt configuration CRUD — model, context template, escalation, output fields. |
|
|
40
|
+
| [roles](./roles.md) | Role CRUD (`system_admin`-gated). |
|
|
41
|
+
| [types](./types.md) | Type CRUD plus `getBySlug`/`getSchema`; derives `validation_schema` from `design_schema`. |
|
|
42
|
+
|
|
43
|
+
## Automation
|
|
44
|
+
|
|
45
|
+
| Function | What it does |
|
|
46
|
+
|---|---|
|
|
47
|
+
| [pipelines](./pipelines.md) | Pipeline CRUD plus `toggle`, `by-trigger` lookup, and execution listing. |
|
|
48
|
+
| [pipeline-executions](./pipeline-executions.md) | Run bookkeeping — list/get, start/complete/cancel, `running`, `stats`, `cleanup`. |
|
|
49
|
+
| [pipeline-runner-background](./pipeline-runner-background.md) | Netlify background function that executes one dispatched pipeline run. |
|
|
50
|
+
| [system-cron](./system-cron.md) | Cron tick: sweeps stale executions, fires due schedules and timers, evaluates threshold alerts, retries deliveries, cleans logs. |
|
|
51
|
+
| [timers](./timers.md) | Timer CRUD + `toggle` for scheduled pipeline firing. |
|
|
52
|
+
| [trigger-scheduler](./trigger-scheduler.md) | Netlify scheduled function (`* * * * *`) that bridges Clockwork invocations to `system-cron`. |
|
|
53
|
+
| [triggers](./triggers.md) | Trigger CRUD plus `toggle`, `listByEvent`, and execution listing. |
|
|
54
|
+
|
|
55
|
+
## Integrations & AI
|
|
56
|
+
|
|
57
|
+
| Function | What it does |
|
|
58
|
+
|---|---|
|
|
59
|
+
| [ai-agents](./ai-agents.md) | Agent CRUD plus `action=run` multi-turn inference. |
|
|
60
|
+
| [ai-interactions](./ai-interactions.md) | Feedback and interaction capture (`submit_feedback`, `create_interaction`, CIL learning proposals). |
|
|
61
|
+
| [deliveries](./deliveries.md) | `webhook_deliveries` list/get plus outbound `action=retry`. |
|
|
62
|
+
| [embeddings](./embeddings.md) | Embedding lifecycle — `generate`, `search-similar`/`search-semantic`, `revoke`, `approve`, `cleanup`. |
|
|
63
|
+
| [eval-harness](./eval-harness.md) | AI eval cases, runs, results, and coverage reporting. |
|
|
64
|
+
| [integration-outbound](./integration-outbound.md) | Executes outbound deliveries through integration adapters with retry bookkeeping. |
|
|
65
|
+
| [integration-routes](./integration-routes.md) | Public inbound webhook receiver — machine-principal auth, handler registry, record creation. |
|
|
66
|
+
| [integrations](./integrations.md) | Integration registry CRUD (providers, credentials, config). |
|
|
67
|
+
| [kb](./kb.md) | Knowledge-base `ingest`, `search`, `publish`, `reindex`, `revoke`. |
|
|
68
|
+
|
|
69
|
+
## Observability & system
|
|
70
|
+
|
|
71
|
+
| Function | What it does |
|
|
72
|
+
|---|---|
|
|
73
|
+
| [admin-funnel](./admin-funnel.md) | Visitor→user→install funnel metrics. Dormant: no `handler` export — nothing routes to it. |
|
|
74
|
+
| [admin-install-funnel](./admin-install-funnel.md) | Install-funnel metrics plus `exportData`. Dormant: no `handler` export. |
|
|
75
|
+
| [admin-signals](./admin-signals.md) | Product-signal metrics and audit listing. Dormant: no `handler` export. |
|
|
76
|
+
| [debug-auth](./debug-auth.md) | Auth diagnostics — resolved principal type and env flags. Debug endpoint; not gated beyond authentication. |
|
|
77
|
+
| [logs](./logs.md) | Log query API — `account`/`target`/`person`/`stats`/`search`/`cleanup` — plus log writes. |
|
|
78
|
+
| [observability](./observability.md) | Metrics API — event volume, error rate, latency percentiles, pipeline stats, top actors, AI support metrics, cleanup. |
|
|
79
|
+
| [security](./security.md) | Flagged accounts, ban/unban across blocklist + Supabase + edge firewall, blocklist management. |
|
|
80
|
+
| [system](./system.md) | Deployment `manifest`, `health`, and `openapi` descriptors. |
|
|
81
|
+
| [tests](./tests.md) | `test_runs`/`test_results` reporting — list, get, 30-day per-suite stats. |
|
|
82
|
+
|
|
83
|
+
## Internal — `cil-*` tooling
|
|
84
|
+
|
|
85
|
+
The Code Intelligence Layer functions. These are internal tooling for
|
|
86
|
+
Spine's code-understanding index (chunks, docs, links, embeddings stored
|
|
87
|
+
as runtime records); they are not part of the app-facing API and have no
|
|
88
|
+
reference pages.
|
|
89
|
+
|
|
90
|
+
| Function | What it does |
|
|
91
|
+
|---|---|
|
|
92
|
+
| cil-agent | LLM tool-use agent over the CIL index (chunk lookup, contracts, blast radius, hash validation). |
|
|
93
|
+
| cil-agent-ingest | Ingests agent session/doc content into CIL chunk fields. |
|
|
94
|
+
| cil-callmap | Derives file-level call/import links into the CIL graph. |
|
|
95
|
+
| cil-config | CIL project config extraction and status (`run`/`extract`/`status`). |
|
|
96
|
+
| cil-context | Context-brief assembly for a chunk (contract, callers, tests, dependencies). |
|
|
97
|
+
| cil-doc | LLM-backed doc generation/sync for chunks. |
|
|
98
|
+
| cil-embeddings | Embedding generation for CIL chunks. |
|
|
99
|
+
| cil-graph | Graph queries over CIL `links` (callers/callees, blast radius). |
|
|
100
|
+
| cil-ingest | AST chunking and marker sync for source files. |
|
|
101
|
+
| cil-pipeline | CIL pipeline status and per-step file readiness. |
|
|
102
|
+
| cil-project | CIL project CRUD (method-dispatched). |
|
|
103
|
+
| cil-validate | Doc/freshness validation and hash updates for CIL chunks. |
|