v2 platform foundation (docs 01/02/03): Action Runtime + Registry + unified API

- v2 foundation: ActionResult/DevError/ActorContext/ResourceRef/Execution types
- ActionRegistry + ResourceRegistry (namespaced types, FAIL FAST on duplicates)
- ActionRuntime pipeline: validate -> authorize -> middleware -> handler ->
  output validation -> audit -> event -> execution persisted (devos_action_executions)
- Legacy bridge: v1 services registered as devops.*/core.* resources & actions (47 actions, 9 resources)
- Unified Action API: POST /api/v2/actions/:actionId, GET discovery (actions/resources)
- 10 v2 unit tests (registry fail-fast, validation, authz, failure audit, events)
This commit is contained in:
phptits
2026-09-10 21:09:44 +00:00
parent 0d6cd37579
commit b1f17cf637
30 changed files with 60110 additions and 3 deletions
+26
View File
@@ -732,3 +732,29 @@ model Certificate {
@@index([workspaceId])
}
// ============ v2 Action Runtime ============
/// # 数据库表 devos_action_executions:v2 Action 执行记录(docs 03 §31)
model ActionExecution {
id String @id
actionId String
actorType String
actorId String?
resourceType String?
resourceId String?
status String
input Json?
output Json?
error Json?
requestId String?
rootExecutionId String?
parentExecutionId String?
durationMs Int?
startedAt DateTime?
completedAt DateTime?
createdAt DateTime @default(now())
@@index([actionId, createdAt])
@@index([status])
}