SysOps: deploy-all — 2026-06-09 10:41 UTC
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
-- RetailDetail Food category feed + trending focus
|
||||
|
||||
UPDATE rss_feeds SET
|
||||
name = 'RetailDetail Food',
|
||||
url = 'https://www.retaildetail.nl/category/food/feed/',
|
||||
category = 'food',
|
||||
is_active = TRUE
|
||||
WHERE name IN ('RetailDetail', 'RetailDetail Food');
|
||||
|
||||
INSERT INTO rss_feeds (name, url, category, is_active) VALUES
|
||||
('RetailDetail Food', 'https://www.retaildetail.nl/category/food/feed/', 'food', TRUE)
|
||||
ON CONFLICT (name) DO UPDATE SET
|
||||
url = EXCLUDED.url,
|
||||
category = EXCLUDED.category,
|
||||
is_active = TRUE;
|
||||
@@ -0,0 +1,45 @@
|
||||
-- Agent action approval workflow (query gate before execution)
|
||||
|
||||
CREATE TABLE IF NOT EXISTS agent_action_requests (
|
||||
id SERIAL PRIMARY KEY,
|
||||
agent_key VARCHAR(64) NOT NULL,
|
||||
action_type VARCHAR(64) NOT NULL DEFAULT 'query',
|
||||
title VARCHAR(255) NOT NULL,
|
||||
query_payload JSONB DEFAULT '{}'::jsonb,
|
||||
status VARCHAR(32) DEFAULT 'pending',
|
||||
approved_by VARCHAR(64),
|
||||
rejection_reason TEXT,
|
||||
result JSONB DEFAULT '{}'::jsonb,
|
||||
created_at TIMESTAMPTZ DEFAULT NOW(),
|
||||
reviewed_at TIMESTAMPTZ,
|
||||
executed_at TIMESTAMPTZ
|
||||
);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_agent_action_requests_status ON agent_action_requests(status, created_at DESC);
|
||||
CREATE INDEX IF NOT EXISTS idx_agent_action_requests_agent ON agent_action_requests(agent_key, created_at DESC);
|
||||
|
||||
UPDATE agent_souls SET
|
||||
role_title = 'Co-CEO · Takenverdeler',
|
||||
soul_md = '# Herman — Soul
|
||||
|
||||
Je bent Herman, AI Co-CEO van Foodlinkk. Warm, direct, zakelijk.
|
||||
|
||||
## Karakter
|
||||
- Co-CEO naast Aissa (CEO) — delegeert taken naar gespecialiseerde agents
|
||||
- Alle agent-output wordt geaggregeerd; jij rapporteert naar CEO en CTO
|
||||
- Geen autonome acties zonder goedgekeurde approval requests
|
||||
|
||||
## Werkzaamheden
|
||||
- CEO briefing · orchestratie · mesh hub · goedkeuringsflow bewaken
|
||||
- Taken verdelen over retail, marketing, ops, research, packaging
|
||||
|
||||
## Samenwerking
|
||||
- Agents → Herman → CEO / CTO
|
||||
- Externe queries: altijd via approval queue',
|
||||
responsibilities = 'Co-CEO · takenverdeler · briefing · orchestratie · mesh hub · approvals'
|
||||
WHERE agent_key = 'herman';
|
||||
|
||||
UPDATE agent_souls SET
|
||||
role_title = 'Markt Research · Intel',
|
||||
responsibilities = 'Web research · concurrenten · retail trends · markt intel (via approval)'
|
||||
WHERE agent_key = 'research';
|
||||
@@ -0,0 +1,56 @@
|
||||
-- Unified projects, assets linking, UI preferences (layout + viz modes)
|
||||
|
||||
CREATE TABLE IF NOT EXISTS cockpit_projects (
|
||||
id SERIAL PRIMARY KEY,
|
||||
name VARCHAR(255) NOT NULL,
|
||||
client_id INTEGER REFERENCES clients(id) ON DELETE SET NULL,
|
||||
description TEXT,
|
||||
status VARCHAR(32) DEFAULT 'active',
|
||||
created_by VARCHAR(64) DEFAULT 'ceo',
|
||||
metadata JSONB DEFAULT '{}'::jsonb,
|
||||
created_at TIMESTAMPTZ DEFAULT NOW(),
|
||||
updated_at TIMESTAMPTZ DEFAULT NOW()
|
||||
);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_cockpit_projects_client ON cockpit_projects(client_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_cockpit_projects_status ON cockpit_projects(status, updated_at DESC);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS project_assets (
|
||||
id SERIAL PRIMARY KEY,
|
||||
project_id INTEGER NOT NULL REFERENCES cockpit_projects(id) ON DELETE CASCADE,
|
||||
asset_type VARCHAR(64) NOT NULL,
|
||||
ref_id VARCHAR(128),
|
||||
title VARCHAR(255),
|
||||
file_path TEXT,
|
||||
payload JSONB DEFAULT '{}'::jsonb,
|
||||
created_by VARCHAR(64) DEFAULT 'ceo',
|
||||
source_agent VARCHAR(64),
|
||||
created_at TIMESTAMPTZ DEFAULT NOW()
|
||||
);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_project_assets_project ON project_assets(project_id, created_at DESC);
|
||||
CREATE INDEX IF NOT EXISTS idx_project_assets_type ON project_assets(asset_type, ref_id);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS packaging_outputs (
|
||||
id VARCHAR(64) PRIMARY KEY,
|
||||
project_id INTEGER REFERENCES cockpit_projects(id) ON DELETE SET NULL,
|
||||
spec JSONB NOT NULL,
|
||||
svg TEXT NOT NULL,
|
||||
created_by VARCHAR(64) DEFAULT 'packaging',
|
||||
created_at TIMESTAMPTZ DEFAULT NOW()
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS user_ui_preferences (
|
||||
user_key VARCHAR(64) PRIMARY KEY DEFAULT 'ceo',
|
||||
dashboard_layout JSONB DEFAULT '[]'::jsonb,
|
||||
viz_modes JSONB DEFAULT '{}'::jsonb,
|
||||
global_viz_mode VARCHAR(32) DEFAULT 'neo-bars',
|
||||
updated_at TIMESTAMPTZ DEFAULT NOW()
|
||||
);
|
||||
|
||||
INSERT INTO user_ui_preferences (user_key, dashboard_layout, global_viz_mode) VALUES
|
||||
('ceo', '["kpis","executive","briefing","retail","analytics","approvals","feed"]'::jsonb, 'neo-bars')
|
||||
ON CONFLICT (user_key) DO NOTHING;
|
||||
|
||||
ALTER TABLE photo_imports ADD COLUMN IF NOT EXISTS project_id INTEGER REFERENCES cockpit_projects(id) ON DELETE SET NULL;
|
||||
ALTER TABLE photo_imports ADD COLUMN IF NOT EXISTS created_by VARCHAR(64) DEFAULT 'ceo';
|
||||
@@ -0,0 +1,58 @@
|
||||
-- SysOps daily config backup, maintenance notes, permissions
|
||||
|
||||
CREATE TABLE IF NOT EXISTS config_backups (
|
||||
id SERIAL PRIMARY KEY,
|
||||
approval_request_id INTEGER REFERENCES agent_action_requests(id) ON DELETE SET NULL,
|
||||
commit_ref VARCHAR(128),
|
||||
files_count INTEGER DEFAULT 0,
|
||||
status VARCHAR(32) DEFAULT 'pending',
|
||||
message TEXT,
|
||||
payload JSONB DEFAULT '{}'::jsonb,
|
||||
created_at TIMESTAMPTZ DEFAULT NOW()
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS idx_config_backups_created ON config_backups(created_at DESC);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS ops_maintenance_notes (
|
||||
id SERIAL PRIMARY KEY,
|
||||
severity VARCHAR(16) DEFAULT 'info',
|
||||
title VARCHAR(255) NOT NULL,
|
||||
body TEXT,
|
||||
source VARCHAR(64) DEFAULT 'sysops',
|
||||
resolved BOOLEAN DEFAULT FALSE,
|
||||
created_at TIMESTAMPTZ DEFAULT NOW()
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS idx_ops_maintenance_created ON ops_maintenance_notes(created_at DESC);
|
||||
CREATE INDEX IF NOT EXISTS idx_ops_maintenance_open ON ops_maintenance_notes(resolved, created_at DESC);
|
||||
|
||||
UPDATE agent_souls SET
|
||||
soul_md = '# SysOps — Soul
|
||||
|
||||
Je bewaakt en onderhoudt de Foodlinkk IT-omgeving op **Dell PowerEdge R340** met **Proxmox VE**.
|
||||
|
||||
## Karakter
|
||||
- Nuchter, alert, rapporteert feiten zonder paniek
|
||||
- Geen destructieve acties zonder CEO-goedkeuring via approval queue
|
||||
|
||||
## Werkzaamheden
|
||||
- Proxmox node + VM106 (Command Center) monitoren
|
||||
- Docker container health op 10.4.7.18
|
||||
- **Dagelijks config-backup naar Gitea** (na CEO approval)
|
||||
- Dagelijks maintenance-rapport in IT Ops tab
|
||||
- Infra topologie live bijhouden
|
||||
|
||||
## Rechten
|
||||
- `config_backup` — backup docker-compose, migraties, monitoring naar Gitea
|
||||
- `proxmox_read` — status uitlezen via Proxmox API/SSH
|
||||
- `maintenance_report` — updates/patches rapporteren
|
||||
|
||||
## Samenwerking
|
||||
- Herman: infra alerts en goedkeuringen
|
||||
- Research: geen infra-mutaties',
|
||||
responsibilities = 'Proxmox R340 · VM106 · Docker · dagelijkse Gitea backup · maintenance',
|
||||
permissions = '{"config_backup": true, "proxmox_read": true, "gitea_push": true, "maintenance_report": true}'::jsonb,
|
||||
updated_at = NOW()
|
||||
WHERE agent_key = 'sysops';
|
||||
|
||||
INSERT INTO herman_permissions (module_key, module_label, description, granted) VALUES
|
||||
('ops', 'IT Ops', 'Infra topologie, backups, maintenance', true)
|
||||
ON CONFLICT (module_key) DO UPDATE SET granted = true, module_label = EXCLUDED.module_label;
|
||||
@@ -0,0 +1,3 @@
|
||||
-- UI locale preference (nl | en)
|
||||
ALTER TABLE user_ui_preferences ADD COLUMN IF NOT EXISTS locale VARCHAR(8) DEFAULT 'nl';
|
||||
UPDATE user_ui_preferences SET locale = 'nl' WHERE locale IS NULL;
|
||||
@@ -0,0 +1,11 @@
|
||||
-- Projects: type, NAS paths, client folder roots
|
||||
|
||||
ALTER TABLE clients ADD COLUMN IF NOT EXISTS nas_folder TEXT;
|
||||
|
||||
ALTER TABLE cockpit_projects ADD COLUMN IF NOT EXISTS project_type VARCHAR(64) DEFAULT 'general';
|
||||
ALTER TABLE cockpit_projects ADD COLUMN IF NOT EXISTS nas_path TEXT;
|
||||
ALTER TABLE cockpit_projects ADD COLUMN IF NOT EXISTS nas_client_root TEXT;
|
||||
ALTER TABLE cockpit_projects ADD COLUMN IF NOT EXISTS priority VARCHAR(16) DEFAULT 'normal';
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_cockpit_projects_type ON cockpit_projects(project_type, status);
|
||||
CREATE INDEX IF NOT EXISTS idx_cockpit_projects_client ON cockpit_projects(client_id, updated_at DESC);
|
||||
@@ -0,0 +1,16 @@
|
||||
-- SysOps activiteitenlog — verslagen voor IT Ops UI en Herman briefing
|
||||
|
||||
CREATE TABLE IF NOT EXISTS sysops_activity (
|
||||
id SERIAL PRIMARY KEY,
|
||||
action_type VARCHAR(64) NOT NULL,
|
||||
title VARCHAR(255) NOT NULL,
|
||||
body TEXT,
|
||||
commit_ref VARCHAR(128),
|
||||
files_changed INTEGER DEFAULT 0,
|
||||
status VARCHAR(32) DEFAULT 'success',
|
||||
source VARCHAR(64) DEFAULT 'sysops',
|
||||
metadata JSONB DEFAULT '{}'::jsonb,
|
||||
created_at TIMESTAMPTZ DEFAULT NOW()
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS idx_sysops_activity_created ON sysops_activity(created_at DESC);
|
||||
CREATE INDEX IF NOT EXISTS idx_sysops_activity_type ON sysops_activity(action_type, created_at DESC);
|
||||
Reference in New Issue
Block a user