CI / UI Checks (pull_request) Successful in 11s
CI / Rust Checks (pull_request) Successful in 12m45s
CI / Rust Feature Validation (pull_request) Skipped
CI / Frontend E2E (pull_request) Skipped
CI / Community Image Smoke (pull_request) Skipped
CI / Required Checks (pull_request) Successful in 1s
CI / Deploy (pull_request) Skipped
Community Release / release (push) Successful in 40m35s
Tool Draft фиксирует synchronous/background/adaptive, deadline и fallback; runtime применяет единый снимок политики (concurrency, очередь, approval, deadline) до внешнего действия. Насыщение отклоняется typed overload с retry guidance, mandatory safety store fail closed, background/adaptive используют опубликованный synchronous/unsupported fallback. Refs: #29
417 lines
11 KiB
Rust
417 lines
11 KiB
Rust
//! Статические таблицы ожидаемой схемы (вынесены из `schema_guard.rs`, чтобы
|
|
//! файл оставался в пределах rust-code-health); поведение guard не меняется.
|
|
|
|
pub(crate) const OWNED_RELATIONS: &[&str] = &[
|
|
"__crank_core_migrations",
|
|
"__crank_migrations",
|
|
"__crank_migration_legacy_audit",
|
|
"__crank_mcp_migrations",
|
|
"__crank_ext_migrations",
|
|
"mcp_transport_sessions",
|
|
"workspaces",
|
|
"users",
|
|
"memberships",
|
|
"user_sessions",
|
|
"invitation_tokens",
|
|
"platform_api_keys",
|
|
"operations",
|
|
"operation_versions",
|
|
"published_operations",
|
|
"operation_samples",
|
|
"descriptors",
|
|
"agents",
|
|
"agent_versions",
|
|
"published_agents",
|
|
"agent_operation_bindings",
|
|
"secrets",
|
|
"secret_versions",
|
|
"master_key_identities",
|
|
"master_key_rotations",
|
|
"auth_profiles",
|
|
"workspace_upstreams",
|
|
"yaml_import_jobs",
|
|
"import_jobs",
|
|
"approval_requests",
|
|
"invocation_logs",
|
|
"usage_rollups",
|
|
"artifact_blobs",
|
|
"artifact_sources",
|
|
"import_plans",
|
|
"import_plan_applications",
|
|
"onboarding_import_selections",
|
|
"resources",
|
|
"resource_versions",
|
|
"resource_publications",
|
|
"agent_resource_bindings",
|
|
"resource_security_revocations",
|
|
"resource_template_sources",
|
|
"prompts",
|
|
"prompt_versions",
|
|
"prompt_arguments",
|
|
"prompt_messages",
|
|
"prompt_dependencies",
|
|
"prompt_message_resource_refs",
|
|
"execution_admission_controllers",
|
|
"execution_admission_entries",
|
|
];
|
|
|
|
pub(crate) const REQUIRED_COLUMNS: &[(&str, &[&str])] = &[
|
|
(
|
|
"__crank_core_migrations",
|
|
&["version", "description", "checksum", "applied_at"],
|
|
),
|
|
(
|
|
"__crank_migrations",
|
|
&[
|
|
"version",
|
|
"name",
|
|
"checksum",
|
|
"phase",
|
|
"compatibility",
|
|
"applied_at",
|
|
],
|
|
),
|
|
(
|
|
"__crank_migration_legacy_audit",
|
|
&["source", "source_version", "source_checksum", "imported_at"],
|
|
),
|
|
(
|
|
"__crank_mcp_migrations",
|
|
&["version", "checksum", "applied_at"],
|
|
),
|
|
(
|
|
"__crank_ext_migrations",
|
|
&["extension_name", "version", "checksum", "applied_at"],
|
|
),
|
|
(
|
|
"mcp_transport_sessions",
|
|
&[
|
|
"id",
|
|
"protocol_version",
|
|
"initialized",
|
|
"supports_elicitation",
|
|
"workspace_slug",
|
|
"agent_slug",
|
|
"created_at",
|
|
"updated_at",
|
|
"expires_at",
|
|
],
|
|
),
|
|
(
|
|
"master_key_identities",
|
|
&[
|
|
"epoch",
|
|
"fingerprint",
|
|
"cipher_contract",
|
|
"status",
|
|
"backup_ref",
|
|
"created_at",
|
|
"activated_at",
|
|
"retired_at",
|
|
],
|
|
),
|
|
(
|
|
"master_key_rotations",
|
|
&[
|
|
"id",
|
|
"source_epoch",
|
|
"target_epoch",
|
|
"target_fingerprint",
|
|
"state",
|
|
"backup_ref",
|
|
"checkpoint_secret_id",
|
|
"total_secret_versions",
|
|
"processed_secret_versions",
|
|
"verified_secret_versions",
|
|
"failure_code",
|
|
"created_at",
|
|
"updated_at",
|
|
],
|
|
),
|
|
(
|
|
"prompts",
|
|
&[
|
|
"workspace_id",
|
|
"prompt_id",
|
|
"name",
|
|
"description",
|
|
"status",
|
|
"sensitivity",
|
|
"current_draft_version",
|
|
"latest_published_version",
|
|
"created_at",
|
|
"updated_at",
|
|
],
|
|
),
|
|
(
|
|
"prompt_versions",
|
|
&["workspace_id", "prompt_id", "version", "created_at"],
|
|
),
|
|
(
|
|
"prompt_arguments",
|
|
&[
|
|
"workspace_id",
|
|
"prompt_id",
|
|
"version",
|
|
"argument_name",
|
|
"argument_type",
|
|
"required",
|
|
"default_value",
|
|
"enumeration",
|
|
"position",
|
|
],
|
|
),
|
|
(
|
|
"prompt_messages",
|
|
&[
|
|
"workspace_id",
|
|
"prompt_id",
|
|
"version",
|
|
"position",
|
|
"role",
|
|
"content",
|
|
],
|
|
),
|
|
(
|
|
"prompt_dependencies",
|
|
&[
|
|
"workspace_id",
|
|
"prompt_id",
|
|
"version",
|
|
"dependency_position",
|
|
"resource_id",
|
|
"resource_version",
|
|
"digest",
|
|
"kind",
|
|
"mime_type",
|
|
"source_class",
|
|
"sensitivity",
|
|
],
|
|
),
|
|
(
|
|
"prompt_message_resource_refs",
|
|
&[
|
|
"workspace_id",
|
|
"prompt_id",
|
|
"version",
|
|
"message_position",
|
|
"ref_position",
|
|
"dependency_position",
|
|
],
|
|
),
|
|
];
|
|
|
|
pub(crate) const REQUIRED_COLUMN_TYPES: &[(&str, &str, &str, bool)] = &[
|
|
("__crank_core_migrations", "version", "integer", false),
|
|
("__crank_core_migrations", "description", "text", false),
|
|
("__crank_core_migrations", "checksum", "text", false),
|
|
(
|
|
"__crank_core_migrations",
|
|
"applied_at",
|
|
"timestamp with time zone",
|
|
false,
|
|
),
|
|
("__crank_migrations", "version", "bigint", false),
|
|
("__crank_migrations", "name", "text", false),
|
|
("__crank_migrations", "checksum", "text", false),
|
|
("__crank_migrations", "phase", "text", false),
|
|
("__crank_migrations", "compatibility", "text", false),
|
|
(
|
|
"__crank_migrations",
|
|
"applied_at",
|
|
"timestamp with time zone",
|
|
false,
|
|
),
|
|
("__crank_migration_legacy_audit", "source", "text", false),
|
|
(
|
|
"__crank_migration_legacy_audit",
|
|
"source_version",
|
|
"bigint",
|
|
false,
|
|
),
|
|
(
|
|
"__crank_migration_legacy_audit",
|
|
"source_checksum",
|
|
"text",
|
|
false,
|
|
),
|
|
(
|
|
"__crank_migration_legacy_audit",
|
|
"imported_at",
|
|
"timestamp with time zone",
|
|
false,
|
|
),
|
|
("__crank_mcp_migrations", "version", "integer", false),
|
|
("__crank_mcp_migrations", "checksum", "text", false),
|
|
(
|
|
"__crank_mcp_migrations",
|
|
"applied_at",
|
|
"timestamp with time zone",
|
|
false,
|
|
),
|
|
("__crank_ext_migrations", "extension_name", "text", false),
|
|
("__crank_ext_migrations", "version", "integer", false),
|
|
("__crank_ext_migrations", "checksum", "text", true),
|
|
(
|
|
"__crank_ext_migrations",
|
|
"applied_at",
|
|
"timestamp with time zone",
|
|
false,
|
|
),
|
|
("mcp_transport_sessions", "id", "text", false),
|
|
("mcp_transport_sessions", "protocol_version", "text", false),
|
|
("mcp_transport_sessions", "initialized", "boolean", false),
|
|
(
|
|
"mcp_transport_sessions",
|
|
"supports_elicitation",
|
|
"boolean",
|
|
false,
|
|
),
|
|
("mcp_transport_sessions", "workspace_slug", "text", false),
|
|
("mcp_transport_sessions", "agent_slug", "text", false),
|
|
(
|
|
"mcp_transport_sessions",
|
|
"created_at",
|
|
"timestamp with time zone",
|
|
false,
|
|
),
|
|
(
|
|
"mcp_transport_sessions",
|
|
"updated_at",
|
|
"timestamp with time zone",
|
|
false,
|
|
),
|
|
(
|
|
"mcp_transport_sessions",
|
|
"expires_at",
|
|
"timestamp with time zone",
|
|
true,
|
|
),
|
|
("master_key_identities", "epoch", "bigint", false),
|
|
("master_key_identities", "fingerprint", "text", false),
|
|
("master_key_identities", "cipher_contract", "text", false),
|
|
("master_key_identities", "status", "text", false),
|
|
("master_key_identities", "backup_ref", "text", true),
|
|
(
|
|
"master_key_identities",
|
|
"created_at",
|
|
"timestamp with time zone",
|
|
false,
|
|
),
|
|
(
|
|
"master_key_identities",
|
|
"activated_at",
|
|
"timestamp with time zone",
|
|
true,
|
|
),
|
|
(
|
|
"master_key_identities",
|
|
"retired_at",
|
|
"timestamp with time zone",
|
|
true,
|
|
),
|
|
("master_key_rotations", "id", "text", false),
|
|
("master_key_rotations", "source_epoch", "bigint", false),
|
|
("master_key_rotations", "target_epoch", "bigint", false),
|
|
("master_key_rotations", "target_fingerprint", "text", false),
|
|
("master_key_rotations", "state", "text", false),
|
|
("master_key_rotations", "backup_ref", "text", true),
|
|
("master_key_rotations", "checkpoint_secret_id", "text", true),
|
|
(
|
|
"master_key_rotations",
|
|
"total_secret_versions",
|
|
"bigint",
|
|
false,
|
|
),
|
|
(
|
|
"master_key_rotations",
|
|
"processed_secret_versions",
|
|
"bigint",
|
|
false,
|
|
),
|
|
(
|
|
"master_key_rotations",
|
|
"verified_secret_versions",
|
|
"bigint",
|
|
false,
|
|
),
|
|
("master_key_rotations", "failure_code", "text", true),
|
|
(
|
|
"master_key_rotations",
|
|
"created_at",
|
|
"timestamp with time zone",
|
|
false,
|
|
),
|
|
(
|
|
"master_key_rotations",
|
|
"updated_at",
|
|
"timestamp with time zone",
|
|
false,
|
|
),
|
|
("prompts", "workspace_id", "text", false),
|
|
("prompts", "prompt_id", "text", false),
|
|
("prompts", "name", "text", false),
|
|
("prompts", "description", "text", false),
|
|
("prompts", "status", "text", false),
|
|
("prompts", "sensitivity", "text", false),
|
|
("prompts", "current_draft_version", "integer", false),
|
|
("prompts", "created_at", "timestamp with time zone", false),
|
|
("prompts", "updated_at", "timestamp with time zone", false),
|
|
("prompt_versions", "workspace_id", "text", false),
|
|
("prompt_versions", "prompt_id", "text", false),
|
|
("prompt_versions", "version", "integer", false),
|
|
(
|
|
"prompt_versions",
|
|
"created_at",
|
|
"timestamp with time zone",
|
|
false,
|
|
),
|
|
("prompt_arguments", "workspace_id", "text", false),
|
|
("prompt_arguments", "prompt_id", "text", false),
|
|
("prompt_arguments", "version", "integer", false),
|
|
("prompt_arguments", "argument_name", "text", false),
|
|
("prompt_arguments", "argument_type", "text", false),
|
|
("prompt_arguments", "required", "boolean", false),
|
|
("prompt_arguments", "default_value", "jsonb", true),
|
|
("prompt_arguments", "enumeration", "jsonb", true),
|
|
("prompt_arguments", "position", "integer", false),
|
|
("prompt_messages", "workspace_id", "text", false),
|
|
("prompt_messages", "prompt_id", "text", false),
|
|
("prompt_messages", "version", "integer", false),
|
|
("prompt_messages", "position", "integer", false),
|
|
("prompt_messages", "role", "text", false),
|
|
("prompt_messages", "content", "text", false),
|
|
("prompt_dependencies", "workspace_id", "text", false),
|
|
(
|
|
"prompt_dependencies",
|
|
"dependency_position",
|
|
"integer",
|
|
false,
|
|
),
|
|
("prompt_dependencies", "resource_id", "text", false),
|
|
("prompt_dependencies", "resource_version", "integer", false),
|
|
("prompt_dependencies", "digest", "text", false),
|
|
("prompt_dependencies", "kind", "text", false),
|
|
("prompt_dependencies", "mime_type", "text", false),
|
|
("prompt_dependencies", "source_class", "text", false),
|
|
("prompt_dependencies", "sensitivity", "text", false),
|
|
(
|
|
"prompt_message_resource_refs",
|
|
"message_position",
|
|
"integer",
|
|
false,
|
|
),
|
|
(
|
|
"prompt_message_resource_refs",
|
|
"ref_position",
|
|
"integer",
|
|
false,
|
|
),
|
|
(
|
|
"prompt_message_resource_refs",
|
|
"dependency_position",
|
|
"integer",
|
|
false,
|
|
),
|
|
];
|