Roadmap & Task Breakdown
Scope: This roadmap covers LumiBase Studio — the admin panel for managing data, collections, permissions, etc. — and the LumiBase CMS API, which runs on both Cloudflare Workers and Docker.
The Consumer app (the end-user frontend) in
apps/consumer(Next.js) is a demo that uses the SDK to call the Delivery API — it is not the CMS Studio.Task language: short, ready to drop straight into an issue tracker. Each task has a clear scope, a deliverable, and a link to related docs.
Conventions:
[BE]apps/cms (Backend API - Hono)[FE]apps/studio (Admin panel - React + Vite)[DB]packages/database[RT]packages/runtime (the Cloudflare/Docker abstraction layer)[AI]packages/ai-skills + AI Copilot[SDK]packages/sdk (a type-safe client for both Studio and consumer apps)[DOC]apps/docs or docs indocs/[OPS]infra/deploy/CI- Each PR should be on a
feature/<phase>-<short-name>branch per the Git hygiene rule.
Overall status: Phase 0 → Phase G (GA hardening) is done. POST-GA and Dual Deployment + AI Copilot are complete. The current focus is polish, developer experience, and expanding the marketplace.
Active Ops Hardening Tasks
Sources: apps/docs/content/deployment/docker.md, apps/docs/content/guides/backup-recovery.md.
-
[OPS]Docker image runs as a non-root user. -
[BE]Validate the production config whenNODE_ENV=productionorLUMIBASE_ENV=production. -
[BE]Support Docker secret files via*_FILEbefore migration/server startup. -
[BE]CORS allowlist viaCORS_ALLOWED_ORIGINS; reject a wildcard in production. -
[BE]RequireENCRYPTION_KEYin production and validate the AES key format. -
[BE]Require DB TLSsslmode=require|verify-ca|verify-fullin production, unlessDATABASE_SSL_MODE=disableis explicit. -
[OPS]docker-compose.prod.ymldoes not publish ports for stateful internal services. -
[DOC]Update the Docker deployment docs and the environment reference. -
[DOC]Add a restore drill, row-count verification, app health check after restore, media/search rebuild, and RTO/RPO documentation. -
[DOC]Add Cloudflare DR validation for Workers, Hyperdrive, R2, KV, Queues, MeiliSearch Cloud, DNS/WAF/Access. -
[OPS]Configure real TLS termination at the deploy environment's load balancer/reverse proxy. -
[OPS]Automate a periodic restore drill for the Docker and Cloudflare restore environments.
Phase 0 — Foundation (DONE)
Goal: a working monorepo skeleton, the core schema, Logto auth, CI.
-
[OPS]Createapps/cms(Hono + Cloudflare Workers template + wrangler config). -
[OPS]Createapps/studio(Vite + React + TS + Tailwind + shadcn init). -
[OPS]Createpackages/shared,packages/sdk,packages/ui,packages/extension-sdk(boilerplate + tsconfig + lint). -
[DB]Add schema:users,user_sites,teams,team_members,roles,policies,role_policies,user_policies,permissions(seedata-model.md). -
[DB]Drizzle migration runner for Hyperdrive (local + remote scripts). -
[BE]withAuthmiddleware (Logto JWKS),withTenant(site_idfrom subdomain/header),withLogger. -
[BE]GET /auth/me+GET /utils/health. -
[FE]App shell + module bar + routing skeleton + Logto login flow. -
[FE]API client inpackages/sdk(fetch wrapper, error format, site header). -
[OPS]CI pipeline (lint, typecheck, test, build) + preview deploy. -
[DOC]Updatearchitecture.md(root) when the structure changes.
Phase A — Schema engine (DONE)
Goal: create/manage collections & fields via API + UI.
-
[DB]Tablescollections,fields,relations. -
[BE]SchemaService(CRUD + compile cache). -
[BE]Endpoints/collections,/fields,/relations. -
[BE]Diff endpoint/collections/diff+PUT /collections/:name/schema. -
[BE]Validate collection/field names, check dependencies on delete. -
[SDK]Type-safe client for the schema. -
[BE]CLI scriptapps/cms/scripts/typegen.ts+ aliaslumibase typegen. -
[FE]Module Settings → Data Model (collection list). -
[FE]3-step collection wizard. -
[FE]Collection detail tabs (Fields, Display, Archive, Raw JSON). -
[FE]Basic field inspector (interfacesinput,input-multiline,toggle,select-dropdown,datetime,json-raw). -
[FE]Live JSON pane (Monaco) for the collection schema, two-way sync. -
[FE]Drag-drop field reorder (dnd-kit). -
[BE]EndpointGET /typegen/schema(manifest with permissions applied). -
[SDK]Generator corepackages/sdk/src/typegen/. -
[FE]Settings → Developer → Types page (preview + download).
Phase B — Items & extended Field system (DONE)
-
[DB]Tablesitems,revisions,activity+ GIN indexes. -
[BE]ItemServicebuilds Drizzle queries dynamically (fields, filter, sort, paginate, deep). -
[BE]Full/items/:collectionendpoints. -
[BE]Revision write + revert. -
[BE]Activity-log middleware for mutations. -
[BE]Validation pipeline (Zod + JSONata) running server-side. -
[BE]Conditions evaluator (server + a helper exported to the client). -
[BE]Per-field encryption service (AES-GCM, key in Workers Secret/env). -
[FE]Content module list view (tabular layout) + filter builder + sort + paginate. -
[FE]Detail editor + side-panel tabs (Revisions, Raw JSON). -
[FE]Complete interface registry: text, number, choice, boolean, date, relation, file, json-raw, code, wysiwyg, markdown, slug, color, tags, rating, repeater, presentation. -
[FE]Display registry: formatted-value, raw, boolean-icon, datetime, image, labels, mustache-template. -
[FE]Raw toggle component (Monaco) for every interface. -
[FE]Bulk raw editor for the whole item. -
[FE]Revisions diff viewer. -
[FE]Mustache display-template editor. -
[BE]POST /utils/render-template(mustache only in Phase B).
Phase C — Permissions & Access (DONE)
-
[BE]PermissionService(compile rule, cache, field mask). -
[BE]CRUD endpoints/roles,/policies,/policies/:id/permissions, attach/detach. -
[BE]GET /permissions/me+POST /permissions/check(trace). -
[BE]Integrate Permissions into ItemService (where injection + post-check). -
[BE]Magic vars$CURRENT_USER,$CURRENT_SITE,$CURRENT_ROLE,$NOW,$IP,$HEADERS.*. -
[BE]Time-bound + IP allow/deny at the policy level. -
[BE]Permission compose rules. -
[FE]Access Control module: Roles, Policies (GUI + JSON Monaco), Permission matrix, Test sandbox. -
[FE]Field-level hide/disable in the form per/permissions/me. -
[FE]List view hides a column when there's no read permission on the field. -
[FE]Hide/disable bulk actions per permission.
Phase C2 — Presets, Bookmarks, basic Translations (DONE)
-
[DB]Tablespresets,translations. -
[BE]CRUD/presets, scope resolution (user > role > site). -
[BE]CRUD/translations(namespacesui,field,content). -
[BE]Locale settings (settings.locales.*). -
[FE]Preset switcher + save/edit dialog in the list view. -
[FE]Translations module (UI strings tab + content tab JSONB). -
[FE]translatable-textinterface (JSONB locale map). -
[FE]i18n for the Studio UI (react-i18next bound to the translations API).
Phase D — Users, Files, Settings (DONE)
-
[BE]/users,/users/invite,/users/:id/impersonate, sessions. -
[BE]/teams,/team_members. -
[BE]Files: presigned R2/S3 upload,/files,/assets/:idtransform,/media(StorageProvider abstraction). -
[BE]Settings storage + cache +settings.changedevent. -
[BE]Webhooks CRUD + dispatcher (Queues / BullMQ). -
[BE]Activity-log endpoint (filter, paginate). -
[FE]Users + Teams module. -
[FE]Files module (grid + folders + drag-drop upload). -
[FE]Settings module (general, locales, security, files, webhooks, activity). -
[FE]Notifications inbox (via realtime).
Phase E — Realtime / WebSocket (DONE)
-
[OPS]Create the Durable Object classSiteRoom(Wrangler binding). -
[BE]/realtimeendpoint upgrades WS, routes to the DO bysiteId. -
[BE]Subscribe/unsubscribe/presence protocol. -
[BE]Publish pipeline in ItemService.commit(). -
[BE]Permission re-check on event fan-out. -
[BE]Rate limit + heartbeat. -
[SDK]Realtime client inpackages/sdk. -
[FE]HooksuseRealtimeSubscription,usePresence. -
[FE]Presence chip in the topbar + detail editor. -
[FE]List view "Live mode" toggle. -
[FE]Smart preset subscribe. -
[FE]Realtime notifications.
Phase F — Advanced Extensions & Display Templates (DONE)
-
[DB]Tableextensions. -
[BE]Extension uploader (multipart → R2/S3) + manifest validator + capability registry. -
[BE]Sandbox loader (dynamic import + proxy ctx + capability gate). -
[BE]Hook dispatcher integrated with ItemService (before/after). -
[BE]Mount endpoint/extensions/:name/*fromendpoint-type extensions. -
[BE]/utils/render-templatesupports the component DSL. -
[FE]Settings → Extensions module (upload, review caps, enable/disable, version). -
[FE]Dynamic loader for UI extensions (interface/display/layout/panel/module). -
[FE]Display-template editor in component mode (block builder). -
[DOC]"Build your first extension" tutorial indocs/features/extensions-system.md.
Phase G — Hardening & GA (DONE)
-
[BE]Additional Postgres RLS policies via thewithRls()middleware (defense-in-depth). -
[BE]Complete tag-based invalidation (revalidateTag webhook → Next.js consumer). -
[BE]Backups + restore via the/api/v1/admin/backup+/api/v1/admin/restoreendpoints (NDJSON bundle). -
[BE]Config export/import CLI (apps/cms/scripts/config-cli.ts). -
[FE]Accessibility audit + fix. -
[FE]Bundle size audit, lazy module splitting (TanStack Router lazy-load). -
[OPS]Load test (k6) for the delivery API and realtime —apps/cms/k6/. -
[OPS]SLO dashboards (Workers Analytics Engine + Grafana for Docker). -
[DOC]Public docs site (apps/docs— Vite + React + Markdown).
Phase POST-GA1 — Translation Memory + MT (DONE)
-
[DB]Tablestranslation_memory+glossary. -
[BE]translation-memory.tsservice with providers: DeepL, OpenAI, Workers AI, echo fallback. -
[BE]Routes/api/v1/tm(list/upsert/fuzzy lookup/translate pipeline TM → glossary → MT). -
[FE]TM integration UI in the Translations module. -
[DOC]features/translation-memory.md.
Phase POST-GA2 — Collaborative cursors (DONE)
-
[BE]cursor-protocol.ts(CRDT-lite: last-write-wins position + Y-style update vector). -
[BE]Broadcast via the Durable Object SiteRoom (CF) or in-process (Docker). -
[FE]Render cursors + selection in WYSIWYG / text fields.
Phase POST-GA3 — Flows / Operations engine (DONE)
-
[DB]Tablesflows,flow_runs,operations. -
[BE]flow-service.tsrunner service with operation types:condition,transform,http,mail,log,sleep,run-extension,item.create|update|delete,notify. -
[BE]Routes/api/v1/flows+ manual/run+/runshistory. -
[BE]Trigger types:webhook,event(item.*),schedule(cron),manual. -
[FE]Automation → Flows module (list page). -
[DOC]features/flows-automation.md.
Phase POST-GA4 — SCIM 2.0 provisioning (DONE)
-
[BE]/scim/v2/Users+/Groups+ ServiceProviderConfig + Schemas + ResourceTypes (RFC 7644 subset). -
[BE]A separate Bearer token auth (SCIM_TOKEN), not using Logto JWT. -
[BE]Mapping: SCIM Group → LumiBase Team. -
[DOC]features/scim-provisioning.md.
Phase POST-GA5 — Marketplace extensions (DONE)
-
[DB]Add columnssignature,signatureAlg,publisherKeyId,publisher,marketplaceSlug,publishedAt,bundleSha256toextensions. -
[BE]Routes/api/v1/marketplace/extensions(list, detail, install, publish). -
[BE]Signature verification: SHA-256 bundle + ed25519/RSA-PSS via WebCrypto, public keys loaded from the envMARKETPLACE_PUBLIC_KEYS. -
[FE]Public Marketplace site using the real catalog API, SEO/static export/deploy checklist. -
[DOC]Revenue sharing settled on Free-first; commercial checkout/payout split into a later backlog. -
[DOC]features/marketplace.md.
Phase POST-GA6 — Materialized collections (DONE)
-
[DB]Tablematerialized_collections. -
[BE]Routes/api/v1/materialize(register, refresh, drop). -
[BE]Logical refresh strategy (count + lastRefreshedAt). Full denormalized write still open. -
[DOC]features/materialized-collections.md.
Phase POST-GA7 — Advanced Permission Builder & RBAC (TODO)
Goal: upgrade the existing Access Control into a Role / Policy / Permission system equivalent to Directus but more fail-closed, with conflict detection, policy flags, role-based API keys, JSON import/export, and seeded system permissions. Reference: docs/vi/features/permission-builder-directus-investigation.md.
Mandatory preparation
-
[BE]Audit the currentPermissionService: clearly document the existing compose behavior (ORrules, union fields, merge presets/validation) and cases that could silently widen permissions. -
[DB]Design a backward-compatible migration forroles.admin_access/app_access→ policy-leveladmin_access/app_access/enforce_tfa/ip_allow/ip_deny/valid_from/valid_until. -
[DB]Add a stablekey/system_keyfor roles/policies to support idempotent import/export. -
[DOC]Finalize the list of system collections included in the Permission Builder and the sensitive/admin-only groups before seeding. -
[BE]Define the JSON schema versionlumibase.access@v1for export/import of roles, policies, permission rows, bindings, and API key metadata.
Schema & evaluator hardening
-
[DB]Add a unique constraint(policy_id, collection, action)topermissions; the migration must detect/report existing duplicates before applying. -
[DB]Add auser_rolestable to support multiple roles/user/site; keepuser_sites.role_idas the primary/display role during the transition. -
[DB]Add explicit policy flags topolicies; keeppolicies.rulesfor custom/future guardrails. -
[BE]Extend the IP guard to support IPv4, IPv6, CIDR, and the precedenceipDenybeatsipAllow. -
[BE]Enforceupdate/deleteinItemServicewith action permission and row-level WHERE. -
[BE]Enforce field whitelist forcreate/update, including the structural fieldsstatus/sort. -
[BE]Enforce permission-levelvalidationin the write path. -
[BE]Enforce app access from effective active policies when entering Studio; API keys are always blocked from Studio. -
[BE]EnforceenforceTfa=true: the user must enroll and pass TFA; an API key attaching a TFA policy must be flagged as a conflict/warning. -
[BE]Extend magic vars:$CURRENT_ROLES,$CURRENT_POLICIES,$CURRENT_API_KEY, nested$CURRENT_USER.*,$NOW(+/- duration). -
[BE]Fail closed for unknown operator/magic var; add tests for_null,_nnull,_empty,_nempty,_regex, case-insensitive string ops.
Conflict detection
-
[BE]Create anAccessConflictServiceclassifyingcompatible,warning,blockingfor overlaps on the samecollection + action. -
[BE]Block conflicts of unconditional-vs-restricted rule,["*"]vs whitelisted fields, validation/preset on the same field with different values, admin bypass + granular policy. -
[BE]EndpointPOST /api/v1/access/conflicts/checktakes a target role/user/api_key + add/remove policies and returns a diff with the source policy. -
[BE]Integrate the conflict check into attaching role-policy, user-policy, api-key-policy; allow overriding a warning with an audit. -
[BE]Integrate the conflict check into attaching role-policy and user-policy; a warning override is audited. -
[FE]Role Detail calls the conflict check before attaching a policy; a blocking conflict prevents saving. -
[FE]The Permission Matrix adds an Effective View showing the final permissions and source policies. -
[TEST]Property tests for the conflict classifier with combinations of field/rule/preset/validation.
API Keys by Roles/Policies
-
[DB]Addapi_keys,api_key_roles,api_key_policieswith token hash, prefix, expire/revoke/last_used metadata. -
[BE]Bearer auth looks up the API key by hash; theapi_keyprincipal type compiles permissions like a user. -
[BE]Rotate/revoke an API key; the plaintext is only returned once at create/rotate. -
[BE]Audit create/rotate/revoke/use-denied for API keys, without logging the plaintext token. -
[SDK]Add client methods for API key CRUD, attach roles/policies, conflict preview. -
[FE]Studio API Keys page: create, rotate, revoke, attach roles/policies, preview effective permissions. -
[TEST]An API key cannot access Studio; a revoked/expired key gets 401; a key only sees the fields/rows allowed by policy.
Permission Builder Import / Export
-
[BE]GET /api/v1/access/exportexports roles, policies, permissions, bindings, API key metadata with stable keys, containing no secrets. -
[BE]POST /api/v1/access/import?dryRun=trueparses/validates/diffs/conflict-checks but does not write the DB. -
[BE]Import modes:merge,replace-managed,replace-all; applied in a transaction with an audited diff summary. -
[BE]Idempotency tests: importing the same manifest multiple times creates no duplicates. -
[SDK]Add access export/import client types. -
[FE]Import dialog shows the diff, warnings, blocking conflicts, and dry-run results. -
[OPS]CLIlumibase access export/importfor CI/CD between dev/staging/prod.
System permissions & seeding
-
[DB]Updateseed-dev.tsto seedpolicy_admin,role_administrator,policy_studio_self,policy_public. -
[DB]Seed explicit permissions for the schema/access manager group:collections,fields,relations,roles,policies,permissions. -
[DB]Ensure sensitive collections (system_state,audit_log,login_attempts,admin_backup_codes,scim_tokens,api_keys) are admin/security-only. -
[FE]The Permission Builder groups system collections and hides sensitive collections from non-admins. -
[TEST]The default public policy cannot read content/system collections without an explicit grant.
Extension access control
-
[DOC]Document the Directus extension permission layers: install/enable, sandbox scopes, accountability services, app module self-check. -
[DB]Add a stableextensions.keyand system access targetsextensions,extension_modules,extension_endpoints,extension_operations. -
[BE]Enforceextensions:read/configure/install/enable/delete/grant_capabilityon extension management routes. -
[BE]Enforceextensions:executebefore dispatching/api/v1/extensions/:name/*. -
[BE]Extension data access defaults to actor permissions; service-account mode needs its own policy/capability and audit. -
[FE]The Studio extension loader/module bar only shows extensions the principal is allowed to read. -
[FE]The Permission Builder adds an Extension Access group to grant users/roles access to extensions. -
[TEST]A user withoutextensions:executecannot call an extension endpoint even if the extension is enabled.
Share action
-
[DB]Add asharestable with a dedicated share role, password hash, validity window, max uses, revoke. -
[BE]Implement theshareaction: only a user with the share permission can create a share link; the read payload still goes through the share role's permissions. -
[FE]The Share dialog only allows selecting a role withappAccess=false,adminAccess=false, and minimal read permissions. -
[TEST]A share link only reads the fields/rows the share role is allowed; expired/max-uses/revoked are all denied.
Phase Docker Dual-Deployment (DONE)
Goal: run the entire stack on Docker without a Cloudflare account.
-
[RT]Create the@lumibase/runtimepackage with 6 interfaces:CacheProvider,StorageProvider,DatabaseProvider,SearchProvider,QueueProvider,MediaProcessor. -
[RT]Cloudflare adapters: KV, R2, Hyperdrive, MeiliSearch Cloud HTTP, CF Queues, CF Image Resizing. -
[RT]Docker adapters: Redis (ioredis), MinIO/S3 (@aws-sdk/client-s3), pg pool (postgres), self-hosted MeiliSearch, BullMQ on Redis, Imgproxy with signed URLs. -
[RT]FactorycreateRuntime(env)selects byLUMIBASE_RUNTIME. -
[BE]Refactor middleware/db.ts to use the DatabaseProvider. -
[BE]Refactor routes using KV/R2 toc.get('runtime').<provider>. -
[BE]Createapps/cms/src/serve.tsNode entrypoint with graceful shutdown (SIGTERM, 10s timeout). -
[BE]/healthendpoint tests connectivity (db, cache, search, storage, queue). -
[BE]/metricsendpoint in Prometheus exposition format. -
[BE]/api/v1/searchendpoint via the SearchProvider. -
[BE]Auto-index/remove items via the QueueProvider on item create/update/delete. -
[BE]Media processing hook: enqueue thumbnail generation (150/300/600) on upload. -
[OPS]docker/Dockerfilemulti-stage (Node 20 slim, non-root, HEALTHCHECK). -
[OPS]docker/Dockerfile.devfor hot-reload. -
[OPS]docker/scripts/entrypoint.shruns migrations with exponential-backoff retry. -
[OPS]docker/docker-compose.yml: Postgres 16, Redis 7, MinIO, MeiliSearch, Imgproxy, CMS, Bull Board. -
[OPS]docker/docker-compose.monitoring.yml: Prometheus + Grafana + Loki + pg-backup. -
[OPS]docker/docker-compose.prod.ymlfor production-like local testing. -
[OPS]Pre-provisioned Grafana dashboard (request rate, latency p50/p95/p99, error rate, queue depth, cache hit ratio). -
[OPS]docker/scripts/backup.sh+restore.sh(pg_dump → S3, retention 7 daily / 4 weekly). -
[OPS]CI workflow.github/workflows/docker.yml(build & push GHCR on main, build-only on PR, layer caching, health check verify). -
[DOC]apps/docs/content/deployment/{overview,cloudflare,docker,local-development,environment-variables}.md. -
[DOC]apps/docs/content/guides/{tooling-recommendations,backup-recovery}.md. -
[DOC]features/runtime-abstraction.md+features/observability.md+features/search.md.
Phase AI-First Copilot (DONE)
Goal: an AI Agent that interacts safely with the CMS via HITL.
-
[DB]Tableai_approvals(id nanoid 21 + siteId + agentName + skillName + arguments jsonb + status + context + decidedAt + decidedBy). -
[AI]Package@lumibase/ai-skillswithCORE_SKILLS(listCollections, createCollection, deleteCollection, createField, deleteField, listItems, createItem, updateItem, deleteItem) + OpenAI tool definitions. -
[BE]Serviceai-harness.ts(validateSkill, checkCapabilities with wildcard*, evaluateRisk, execute, executeApproved, rejectApproval, runSkill 30s timeout). -
[BE]Routes/api/v1/ai/chat,/api/v1/ai/approvals,/api/v1/ai/approvals/:id/decide. -
[BE]fast-check property tests (15 properties, 100+ iterations) + integration tests. -
[FE]components/ai-assistant.tsxfloating panel 320×480 glassmorphism, max 50 messages. -
[FE]modules/settings/ai-approvals.tsxcard list of pending approvals with Approve/Reject. -
[DOC]features/ai-copilot.md+ keep the historicalfeatures/ai-first-specification.md.
Phase POST-GA — Advanced (TODO / In progress)
-
[AI]Integrate a real LLM provider (OpenAI / Anthropic / Workers AI) instead of the mock intent parser in/ai/chat. -
[AI]Add context memory (conversation history) to the AI Copilot. -
[AI]SkillsaiSuggestField+aiContentAssist(RAG via embeddings). -
[BE]Real materialized collection writes (not just logical refresh) — a physical table + a refresh trigger. -
[BE]Multi-region Durable Objects sharding. -
[FE]Marketplace browser UI in Studio (browse, 1-click install). -
[FE]Flows visual editor (drag-drop graph) — currently only a list page. -
[BE]SCIM Token rotation + audit. -
[OPS]Automated multi-tenant isolation testing (k6 cross-site leak detection).
Phase Agent Harness Layer (DONE)
Goal: turn LumiBase into a control plane where humans, agents, data, workflows, and applications co-evolve under control. The detailed checklist is in agent-harness-implementation.md.
A. Foundational lifecycle
-
[DB]Addagent_goals,agent_runs,agent_plans,agent_tool_callswithsiteId, lifecycle status, policy snapshot, budget, audit metadata, and indexes bysiteId/runId/goalId. -
[BE]CreateAgentRunServiceto open/append/close/fail/retry a run; refactorAISecureHarnessso every runtime execute is tied to agoalId/runId. -
[TEST]Extended property tests for multi-tenant isolation, a failed run still keeps the audit trail, and retry does not duplicate tool calls/artifacts.
B. Tool Registry + capability policy
-
[DB]Addagent_toolsandagent_permissionsto declare input/output schema, required capabilities, risk policy, rate limit, and validity window. -
[BE]ImplementToolRegistryServiceto load core skills + DB overrides; enforce disabled tool, capability, risk policy, and rate limit. -
[FE]Studio "Agent Harness" page showing tools, risk, approvals, runs, artifacts, and memory. -
[SDK]Add types/client methods for tools, capabilities, and risk policies.
C. General approval
-
[DB]Addagent_approvalsforplan/tool_call/artifact/schema_diff; bridge backward-compatibly withai_approvals. -
[BE]Foundational approval policy engine:none,before_execute,before_commit,two_person_rule,owner_only,security_admin_onlyas a contract/policy field. -
[FE]Elevate the Studio surface into an Agent Harness queue with subject type, status, and a decision surface. -
[TEST]A dangerous plan does not execute before approval; a rejected/expired approval cannot commit.
D. Artifact Store + Evaluation Gate
-
[DB]Addagent_artifactsandagent_evaluationswith content hash, version, status, eval kind/status/score/details. -
[BE]First artifact writers:schema_diff,page_spec,component_spec,seed_data,api_spec,prompt,migration. -
[BE]First eval runners: JSON schema validation, schema/migration guard, generated API spec validation, prompt safety check. -
[FE]Minimal artifact review UI in the Studio Agent Harness: list artifacts, status, hash, generated app artifacts. -
[TEST]An artifact that fails eval cannot be published; the artifact hash is stable; publish/rollback is idempotent.
E. Memory + App Generation MVP
-
[DB]Addagent_memorywith scope, provenance, confidence, expiry, and an optional embedding. -
[BE]RAG context builder that respects expiry, provenance, and secret redaction. -
[AI]SkillsgenerateAppSpec,generateApiDocs,generateSeedDataproduce an artifact payload instead of writing directly to content/schema. -
[FE]A "Generate" action in the Agent Harness creates app artifacts fromproducts/orders/customerswith a budget and approval policy. -
[TEST]E2E demo: generate a storefront fromproducts/orders/customers→ plan → artifacts → eval → approval → publish.
F. Operations
-
[BE]Metrics for run success/fail, approval latency, tool latency, eval fail rate, token/cost estimate, and budget stop reason. -
[OPS]A Grafana "Agent Harness" dashboard and a dead-letter queue for repeatedly failing runs/tool calls. -
[DOC]Updatedata-model.md,architecture/overview.md, OpenAPI, SDK docs, and runtime limitations per phase.
Phase POST-GA8 — Directus Data Model Parity (DONE)
Goal: upgrade the Data Model / Collections Builder so a collection in LumiBase has a contract as clear as Directus's: full metadata, primary key strategy, system fields, advanced field config, relation metadata, schema permissions, atomic diff/apply, SDK/typegen/OpenAPI, and parity tests. Detailed reference: docs/en/features/directus-data-model-parity-tasks.md.
Milestone 1 — Correctness fixes before expansion (DONE)
-
[FE]The collection wizard sends the correct top-level payload (note,accountability,versioning,singleton,primaryKeyType,storageMode) instead of cramming it intometa. -
[BE]ItemService.patch/replace/softDeleteenforceupdate/deletepermission, row-level scope, and the field-level update allowlist. -
[BE]Relation delete/dependency checks cover bothmanyCollectionandoneCollectiondirections; block deleting a field/collection while a relation still points to it. -
[TEST]Add regression tests for the wizard payload, update/delete permission, and relation dependency checks.
Milestone 2 — Collection metadata + primary key contract (DONE)
-
[DB]Add first-class collection columns:label,pluralLabel,hidden,system,primaryKeyField,primaryKeyType,storageMode,unarchiveValue,itemDuplicationFields,translations. -
[BE]Backward-compatible backfill/migration; route validation andSchemaServiceuse the new fields, keepingmetafor extension/custom UI hints. -
[SDK]Update the collection input/output types and schema client methods for the new metadata. -
[FE]The wizard has Identity, Storage, System fields, Permissions defaults, and Review JSON steps. -
[BE]Implement the primary key strategy forjsonb:nanoid,uuid,string; explicitly defer or blockinteger/bigIntegerif there's no sequence yet. -
[TEST]Create item respects the primary key strategy; a duplicate user-provided ID returns409.
Milestone 3 — System fields and field configuration parity
-
[BE]Extend the compiled schema withsystemFields(id,status,sort,user_created,user_updated,created_at,updated_at,deleted_at). -
[FE]The Fields tab shows system fields in a locked group; allows configuring display/hidden/readonly/translations/width but not deletion. -
[DB]Add field metadata:label,note,defaultValue,nullable,unique,indexed,searchable,length,precision,scale,special. -
[FE]FieldInspector advanced tabs: Basics, Options, Display, Validation, Conditions, Layout, Storage, Translations. -
[BE]Separate the create/update/rename/delete/migration field paths; reject changing type/name when data exists without a migration plan. -
[TEST]FieldInspector does not lose unknownoptions/displayOptions/validation/conditions; risky changes return409or require confirmation.
Milestone 4 — Relations parity and deep read
-
[BE]Validate relation references: the collection/field exists, the relation name is not duplicated,onDeleteis valid for the storage mode. -
[DB]Extend relation metadata:type,aliasField,relatedDisplayTemplate,junctionManyField,junctionOneField. -
[BE]Support relation typesm2o,o2m,m2m; reservem2aand return "not implemented" if chosen. -
[BE]Implement relation expansion for item queries (fields=author.name,categories.*,deep[...]) with permission masking for related collections. -
[TEST]M2O returns an object on expand; O2M/M2M return an array; batching avoids N+1 in common cases.
Milestone 5 — Schema permissions, diff/apply, and storage positioning
-
[BE]Add schema permission actions:schema:read/create/update/delete/migrate. -
[BE]ApplyrequireSchemaPermissionto collections/fields/relations/compiled schema routes and AI schema skills. -
[BE]Expand the schema diff: collection metadata, field metadata, relation changes, risk classification, and runtime impact. -
[BE]PUT /collections/:name/schemavalidates everything, computes the diff, applies transactionally when the runtime supports it, invalidates schema/permission/typegen cache, and emitsschema.changed. -
[FE]The Raw JSON schema tab shows the diff/risk before applying. -
[DOC]Document the storage modesjsonb/materialized/physical/external, with a limitations badge in Studio. -
[DOC]Create the design docdocs/en/architecture/physical-collections.mdto decide on physical/external mode.
Milestone 6 — SDK, typegen, OpenAPI, docs, and parity tests
-
[SDK]Open the full schema resources: collections/fields/relations CRUD, field rename/delete options, schema diff/apply. -
[SDK]Keep legacy methods or a deprecation wrapper; preserve the errorcode/path/riskmetadata. -
[SDK]Typegen includes the primary key type, system fields, nullable/required, readonly/generated, and relation-expanded response types. -
[DOC]Updateapps/cms/openapi.yaml,docs/en/features/collections-builder.md,docs/en/features/field-types-and-config.md,docs/en/data-model.md. -
[DOC]Sync the Vietnamese version after the English contract stabilizes. -
[TEST]Backend/frontend/SDK parity suite covering the acceptance criteria indirectus-data-model-parity-tasks.md.
Cross-cutting checklist (every phase)
- Update
architecture.mdif the structure changes. - Write unit + integration tests before merging; for complex logic use property-based testing (fast-check).
- Update the OpenAPI spec (
apps/cms/openapi.yaml) for every new endpoint. - Update the corresponding
packages/sdktypes. - Update docs in
docs/features/orapps/docs/content/. - Work directly on
mainper the current repo guidance; commit with conventional commits and push directly to reduce conflicts with parallel workstreams. - Ensure new routes work on BOTH runtimes (Cloudflare + Docker) — if it depends on a specific API, gate it with a feature flag and document it in
features/runtime-abstraction.md.