fix: enforce atomic agent registration contract
This commit is contained in:
1 parent
47d323c17b
commit
f64d00673c
58 files changed
+2692
-1667
No files matched your search
@@ -47,7 +47,14 @@ CREATE TABLE IF NOT EXISTS agents (
|
||||
org_id TEXT NOT NULL,
|
||||
display_name TEXT NOT NULL,
|
||||
responsible_entity TEXT NOT NULL,
|
||||
integration_type TEXT NOT NULL DEFAULT 'sdk',
|
||||
integration_type TEXT NOT NULL
|
||||
CONSTRAINT agents_integration_type_check
|
||||
CHECK (integration_type IN (
|
||||
'augment', 'claudecode', 'cline', 'codex', 'copilot',
|
||||
'cursor', 'droid', 'gemini', 'grok', 'kimi', 'kirocli',
|
||||
'kiroide', 'letta', 'opencode', 'qwen', 'enterprise',
|
||||
'gui', 'sdk', 'other'
|
||||
)),
|
||||
status TEXT NOT NULL DEFAULT 'active',
|
||||
created_at BIGINT NOT NULL,
|
||||
updated_at BIGINT NOT NULL
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
-- Require every agent to declare a supported integration type.
|
||||
|
||||
BEGIN;
|
||||
|
||||
ALTER TABLE agents
|
||||
ALTER COLUMN integration_type DROP DEFAULT;
|
||||
|
||||
ALTER TABLE agents
|
||||
DROP CONSTRAINT IF EXISTS agents_integration_type_check;
|
||||
|
||||
ALTER TABLE agents
|
||||
ADD CONSTRAINT agents_integration_type_check
|
||||
CHECK (integration_type IN (
|
||||
'augment', 'claudecode', 'cline', 'codex', 'copilot',
|
||||
'cursor', 'droid', 'gemini', 'grok', 'kimi', 'kirocli',
|
||||
'kiroide', 'letta', 'opencode', 'qwen', 'enterprise',
|
||||
'gui', 'sdk', 'other'
|
||||
));
|
||||
|
||||
INSERT INTO schema_versions (version, applied_at, description)
|
||||
VALUES (
|
||||
2,
|
||||
EXTRACT(EPOCH FROM NOW())::BIGINT * 1000,
|
||||
'Require a supported agent integration type'
|
||||
)
|
||||
ON CONFLICT (version) DO NOTHING;
|
||||
|
||||
COMMIT;
|
||||
Reference in new issue
Block a user