Directus Collections — SSOT
Directus Collections — SSOT
Version: 1.2 Date: 2026-03-08 (S107 update) Nguồn: Audit Claude Code 2026-02-28 + Sprint 1-4 (2026-03-03→03-08) Tổng: ~135+ collections (thêm S105-S107: table_registry, meta_catalog, collection_registry, dot_tools, ui_pages, agents, checkpoint_sets, checkpoint_set_items, entity_dependencies + auto-ID flows) ⚠️ Collection count liên tục tăng. Dùng
collection_registryquery Directus cho số chính xác.
I. COLLECTIONS BY GROUP
Group: blocks (16 collections)
Page builder blocks — Agency OS content blocks system.
| Collection | Mô tả |
|---|---|
| block_button_group | Button group container |
| block_columns | Multi-column layout |
| block_cta | Call to action |
| block_divider | Section divider |
| block_faqs | FAQ accordion |
| block_form | Form embed |
| block_gallery | Image gallery |
| block_hero | Hero banner |
| block_html | Raw HTML |
| block_logocloud | Logo cloud/partners |
| block_quote | Blockquote |
| block_richtext | Rich text content |
| block_steps | Step-by-step guide |
| block_team | Team members |
| block_testimonials | Testimonials slider |
| block_video | Video embed |
Sub-groups (child collections): block_button (1), block_columns_rows (1), block_gallery_files (1), block_logocloud_logos (1), block_step_items (1), block_testimonial_slider_items (1).
Group: website (10 collections)
Core website content management.
| Collection | Mô tả |
|---|---|
| categories | Content categories |
| forms | Form definitions |
| globals | Site-wide settings |
| navigation | Navigation menus |
| pages | CMS pages |
| posts | Blog posts |
| redirects | URL redirects |
| seo | SEO metadata |
| team | Team member profiles |
| testimonials | Testimonial entries |
Sub-groups: navigation_items (1), post_gallery_items (1).
Group: os_settings (6 collections)
Agency OS business settings.
| Collection | Mô tả |
|---|---|
| os_deal_stages | Sales pipeline stages |
| os_email_templates | Email templates |
| os_items | Generic items |
| os_payment_terms | Payment terms |
| os_project_templates | Project templates |
| os_tax_rates | Tax rate configs |
Group: billing (3 collections)
| Collection | Mô tả |
|---|---|
| os_expenses | Expense records |
| os_invoices | Invoice management |
| os_payments | Payment records |
Sub-group: os_invoice_items (1).
Group: sales (3 collections)
| Collection | Mô tả |
|---|---|
| os_activities | Sales activities/calls |
| os_deals | Sales deals pipeline |
| os_proposals | Business proposals |
Sub-groups: os_activity_contacts (1), os_deal_contacts (1), os_proposal_approvals (1), os_proposal_blocks (1), os_proposal_contacts (1).
Group: help (3 collections)
| Collection | Mô tả |
|---|---|
| help_articles | Help/support articles |
| help_collections | Help article categories |
| help_feedback | Help feedback entries |
Group: pages (3 collections)
| Collection | Mô tả |
|---|---|
| page_blocks | Page ↔ block junction |
| pages_blog | Blog page configs |
| pages_projects | Project page configs |
Group: organizations (2 collections)
| Collection | Mô tả |
|---|---|
| organization_addresses | Organization addresses |
| organizations_contacts | Organization ↔ contact junction |
Group: os_projects (2 collections)
| Collection | Mô tả |
|---|---|
| os_project_contacts | Project ↔ contact junction |
| os_project_updates | Project status updates |
Group: conversations (1)
| Collection | Mô tả |
|---|---|
| messages | Chat messages |
Group: os_tasks (1)
| Collection | Mô tả |
|---|---|
| os_task_files | Task file attachments |
II. KEY OPERATIONAL COLLECTIONS (không thuộc group)
Các collections quan trọng cho AI Operations và Business Logic.
tasks — Task Manager + Planning (25 fields)
| Field | Type | AI Write | Mô tả |
|---|---|---|---|
| id | int | ❌ | PK |
| name | string | ❌ Blocked | Task name |
| status | dropdown | ❌ Blocked | draft, active, in_review, completed, archived |
| priority | dropdown | ❌ Blocked | low, medium, high, critical |
| assigned_to | string | ❌ Blocked | user, claude, gpt |
| deadline | timestamp | ❌ Blocked | Target deadline |
| task_type | dropdown | ❌ | task / planning |
| plan_document_path | string | ✅ | Agent Data path |
| lead_ai | string | ✅ | AI lead |
| critic_ai | string | ✅ | AI critic |
| content_targets | text | ✅ | Tab content (8 tabs) |
| content_rules | text | ✅ | " |
| content_checklist | text | ✅ | " |
| content_plan | text | ✅ | " |
| content_prompt | text | ✅ | " |
| content_reports | text | ✅ | " |
| content_verify | text | ✅ | " |
| content_test | text | ✅ | " |
| checklist_version | int | ✅ | Version tracking |
task_comments — Feedback Stream (10 fields, +2 Sprint 1)
| Field | Type | Mô tả |
|---|---|---|
| id | int | PK |
| task_id | int (FK→tasks) | Parent task |
| tab_scope | dropdown | targets, rules, checklist, plan, prompt, reports, verify, test, general |
| agent_type | dropdown | user, claude_ai, gpt, gemini, claude_code, codex, antigravity, system |
| content | text | Comment content (markdown) |
| action | dropdown | approve, reject, request_changes, escalate |
| workflow_id | int (FK→workflows) | nullable, liên kết workflow — Sprint 1 |
| bpmn_element_id | string | nullable, node/edge ID trên BPMN — Sprint 1 |
| date_created | timestamp | Auto |
| user_created | uuid | Auto |
AI Agent: Full CRUD.
workflows — BPMN 2.0 Workflow Definitions (10 fields) — Sprint 1 2026-03-03
| Field | Type | Mô tả |
|---|---|---|
| id | int | PK |
| title | string | Tên workflow |
| description | text | nullable |
| bpmn_xml | text | BPMN 2.0 XML content |
| status | enum: draft/active/archived | default: draft |
| task_id | int (FK→tasks) | nullable, SET NULL |
| version | int | default: 1 |
| user_created | uuid | Auto |
| date_created | timestamp | Auto |
| date_updated | timestamp | Auto |
Permissions: public READ, AI agent READ. OPS Proxy: ⚠️ CHƯA whitelist (TD-055).
task_checkpoints — 3-Layer Checkpoint Tracking (9 fields) — Sprint 1 2026-03-03
| Field | Type | Mô tả |
|---|---|---|
| id | int | PK |
| task_id | int (FK→tasks) | required, CASCADE |
| checkpoint_key | string | VD: L0_ci_green, L1_code_review |
| layer | enum: L0/L1/L2 | Tầng checkpoint |
| status | enum: pending/passed/failed/skipped | default: pending |
| verified_by | string | nullable, agent_type hoặc "user" |
| comment_id | int (FK→task_comments) | nullable, SET NULL |
| date_created | timestamp | Auto |
| date_updated | timestamp | Auto |
Permissions: public READ, AI agent READ+CREATE+UPDATE. OPS Proxy: ⚠️ CHƯA whitelist (TD-055).
ai_tasks — AI Agent Job Queue (20 fields)
| Field | Type | AI Write | Mô tả |
|---|---|---|---|
| id | int | ❌ | PK |
| name | string | ❌ Blocked | Task name |
| task_id | FK→tasks | ❌ Blocked | Parent task |
| round | int | ❌ Blocked | Execution round |
| work_type | dropdown | ❌ Blocked | Type of work |
| assigned_agent | dropdown | ❌ Blocked | claude_desktop, claude_code, gpt, gemini |
| agent_role | dropdown | ❌ Blocked | lead, reviewer, supervisor |
| prompt_payload | text | ❌ Blocked | Prompt content |
| status | dropdown | ✅ | queued → dispatched → in_progress → completed/failed/needs_revision |
| result_summary | text | ✅ | Result |
| result_evidence | text | ✅ | Evidence |
| review_verdict | dropdown | ✅ | Verdict |
| review_notes | text | ✅ | Review notes |
| next_action | string | ✅ | Next step |
| completed_at | timestamp | ✅ | Completion time |
knowledge_documents — Knowledge Base (117 rows)
Sync từ Agent Data → Directus. Agent Data là source of truth.
checkpoint_types + checkpoint_instances + checkpoint_rules
Checkpoint system cho Layer 0/Layer 1 automation.
agent_views — Rendered Knowledge (22 rows)
Content pre-rendered cho Nuxt frontend.
ai_discussions / ai_discussion_comments
Legacy AI-to-AI discussion (trước ai_tasks).
content_requests
Content request workflow (E1 plan).
contacts / organizations
CRM data.
III. VIRTUAL/FOLDER COLLECTIONS (5)
Không có schema, chỉ dùng để group trong Admin UI: billing, blocks, help, sales, website.
IV. SYSTEM COLLECTIONS (26)
Directus internal: directus_activity, directus_collections, directus_dashboards, directus_fields, directus_files, directus_flows, directus_folders, directus_migrations, directus_notifications, directus_operations, directus_panels, directus_permissions, directus_policies, directus_presets, directus_relations, directus_revisions, directus_roles, directus_sessions, directus_settings, directus_shares, directus_translations, directus_users, directus_versions, directus_webhooks, directus_extensions, directus_comments.
V. JUNCTION TABLES
| Junction | Relationship |
|---|---|
| pages_blocks | pages ↔ blocks |
| pages_translations | pages ↔ languages |
| navigation_navigation_items | navigation ↔ navigation_items |
| organizations_contacts | organizations ↔ contacts |
| os_project_contacts | os_projects ↔ contacts |
| os_deal_contacts | os_deals ↔ contacts |
| os_activity_contacts | os_activities ↔ contacts |
| os_proposal_contacts | os_proposals ↔ contacts |
VI. DATA COUNTS (2026-02-28)
| Table | Rows |
|---|---|
| directus_activity | 8,763 |
| directus_revisions | 4,400 |
| directus_fields | 941 |
| directus_sessions | 229 |
| directus_relations | 183 |
| directus_permissions | 167 |
| knowledge_documents | 117 |
| directus_migrations | 95 |
| directus_collections | 89 |
| directus_operations | 69 |
| task_comments | 53 |
| checkpoint_types | 31 |
| directus_flows | 26 |
| agent_views | 22 |
| ai_discussion_comments | 17 |
| directus_users | 11 |
| feedbacks | 9 |
| languages | 8 |
| directus_roles | 7 |
| ai_discussions | 7 |