|
1 | 1 | # ObjectStack Protocol — Road Map |
2 | 2 |
|
3 | | -> **Last Updated:** 2026-02-16 |
| 3 | +> **Last Updated:** 2026-02-18 |
4 | 4 | > **Current Version:** v3.0.6 |
5 | 5 | > **Status:** Protocol Specification Complete · Runtime Implementation In Progress |
6 | 6 |
|
@@ -64,6 +64,25 @@ the ecosystem for enterprise workloads. |
64 | 64 | 12 of 25 service contracts are specification-only (no runtime implementation). |
65 | 65 | These are the backbone of ObjectStack's enterprise capabilities. |
66 | 66 |
|
| 67 | +### Minimal Implementation Strategy |
| 68 | + |
| 69 | +ObjectStack follows a **minimal-first** approach to service implementation: |
| 70 | + |
| 71 | +1. **Implement the smallest possible working version first** — Each service starts with the minimal viable implementation that unblocks real-world use cases. |
| 72 | + |
| 73 | +2. **In-memory fallbacks via dev-plugin** — All non-critical services already have working in-memory fallbacks provided by `@objectstack/plugin-dev`, allowing development and testing to proceed while production implementations are built incrementally. |
| 74 | + |
| 75 | +3. **DatabaseLoader is the single P0 blocker** — The only critical gap preventing production deployment is `DatabaseLoader` in the metadata service. This component enables: |
| 76 | + - Platform-level metadata editing in Studio |
| 77 | + - User overlay persistence across sessions |
| 78 | + - Multi-instance metadata synchronization |
| 79 | + - Production-grade metadata storage |
| 80 | + |
| 81 | +4. **Independent upgrade path** — Each service can be independently upgraded from: |
| 82 | + - **Stub** (dev-plugin fallback) → **MVP** (minimal working implementation) → **Production** (full-featured with adapters) |
| 83 | + |
| 84 | +This strategy ensures rapid iteration while maintaining a clear path to production readiness. |
| 85 | + |
67 | 86 | --- |
68 | 87 |
|
69 | 88 | ## Codebase Metrics |
@@ -197,67 +216,92 @@ The following renames are planned for packages that implement core service contr |
197 | 216 |
|
198 | 217 | ## Phase 4: Service Implementations (🔴 In Progress) |
199 | 218 |
|
200 | | -> **Goal:** Implement the remaining 19 service contracts as production-ready packages. |
| 219 | +> **Goal:** Implement the remaining service contracts following the minimal-first strategy. |
201 | 220 | > **Naming:** All contract implementations use `service-*` prefix (see [Package Naming Convention](#package-naming-convention)). |
202 | 221 |
|
203 | | -### Priority 1 — Essential Services |
| 222 | +### Phase 4a: Metadata Persistence (P0 — Weeks 1-2) |
| 223 | + |
| 224 | +**The single critical blocker preventing production deployment.** |
| 225 | + |
| 226 | +**DatabaseLoader Implementation:** |
| 227 | +- [ ] **Implement `DatabaseLoader`** in `packages/metadata/src/loaders/database-loader.ts` |
| 228 | + - [ ] Implement `MetadataLoader` interface with protocol `datasource:` |
| 229 | + - [ ] Accept `IDataDriver` instance via kernel DI |
| 230 | + - [ ] Map to `sys_metadata` table CRUD operations |
| 231 | + - [ ] Support `scope` filtering (system/platform/user) |
| 232 | + - [ ] Auto-create `sys_metadata` table on first use |
| 233 | + - [ ] Implement upsert semantics for `save()` operations |
| 234 | + - [ ] Support optimistic concurrency via `version` field |
| 235 | + - [ ] Implement `list()` with type filtering and pagination |
| 236 | + - [ ] Declare capabilities: `{ read: true, write: true, watch: false, list: true }` |
| 237 | + |
| 238 | +**Metadata Manager Integration:** |
| 239 | +- [ ] Auto-configure `DatabaseLoader` when `config.datasource` is set |
| 240 | +- [ ] Resolve datasource → `IDataDriver` via kernel service registry |
| 241 | +- [ ] Implement fallback strategy per `config.fallback` setting |
| 242 | +- [ ] Persist overlay customizations to database |
| 243 | +- [ ] Support multi-tenant isolation via `tenantId` filter |
| 244 | + |
| 245 | +**Tests:** |
| 246 | +- [ ] Unit tests with mock `IDataDriver` |
| 247 | +- [ ] Integration tests with `MemoryDriver` |
| 248 | +- [ ] Fallback behavior tests (datasource unavailable → filesystem/memory) |
| 249 | + |
| 250 | +**This unblocks:** |
| 251 | +- Platform-level metadata editing in Studio |
| 252 | +- User overlay persistence across sessions |
| 253 | +- Multi-instance metadata synchronization |
| 254 | +- Production-grade metadata storage |
| 255 | + |
| 256 | +### Phase 4b: Infrastructure Service Upgrades (P1 — Weeks 3-4) |
| 257 | + |
| 258 | +**Upgrade existing services from in-memory fallbacks to production adapters.** |
| 259 | + |
| 260 | +| Contract | Current Status | Upgrade Path | |
| 261 | +|:---|:---|:---| |
| 262 | +| `ICacheService` | ✅ Memory adapter + Redis skeleton | Add Redis adapter implementation | |
| 263 | +| `IQueueService` | ✅ Memory adapter + BullMQ skeleton | Add BullMQ adapter implementation | |
| 264 | +| `IJobService` | ✅ Interval scheduler + cron skeleton | Add cron adapter implementation | |
| 265 | +| `IStorageService` | ✅ Local FS + S3 skeleton | Add S3 adapter implementation | |
204 | 266 |
|
205 | | -| Contract | Priority | Package | Notes | |
206 | | -|:---|:---:|:---|:---| |
207 | | -| `ICacheService` | **P0** | `@objectstack/service-cache` | Memory cache + Redis adapter skeleton | |
208 | | -| `IQueueService` | **P0** | `@objectstack/service-queue` | Memory queue + BullMQ adapter skeleton | |
209 | | -| `IJobService` | **P0** | `@objectstack/service-job` | setInterval scheduler + cron adapter skeleton | |
210 | | -| `IStorageService` | **P1** | `@objectstack/service-storage` | Local filesystem + S3 adapter skeleton | |
211 | | -| `ISchemaDriver` | **P1** | — | DDL operations — needed for `objectstack migrate` CLI command | |
| 267 | +- [ ] `service-cache` — Implement Redis adapter with connection pooling |
| 268 | +- [ ] `service-queue` — Implement BullMQ adapter with job persistence |
| 269 | +- [ ] `service-job` — Implement cron adapter with distributed coordination |
| 270 | +- [ ] `service-storage` — Implement S3 adapter with multipart upload |
212 | 271 |
|
213 | | -- [x] `service-cache` — Implement `ICacheService` with memory adapter + Redis skeleton |
214 | | -- [x] `service-queue` — Implement `IQueueService` with memory adapter + BullMQ skeleton |
215 | | -- [x] `service-job` — Implement `IJobService` with interval scheduling + cron skeleton |
216 | | -- [x] `service-storage` — Implement `IStorageService` with local filesystem + S3 skeleton |
217 | | -- [ ] Schema driver integration into PostgreSQL/MongoDB drivers |
| 272 | +### Phase 4c: Communication & Search Services (P1 — Weeks 5-6) |
218 | 273 |
|
219 | | -### Priority 2 — Communication Services |
| 274 | +**Implement new service contracts with minimal viable implementations.** |
220 | 275 |
|
221 | 276 | | Contract | Priority | Package | Notes | |
222 | 277 | |:---|:---:|:---|:---| |
223 | | -| `IRealtimeService` | **P1** | `@objectstack/service-realtime` | WebSocket/SSE pub/sub for live data | |
224 | | -| `INotificationService` | **P2** | `@objectstack/service-notification` | Email/SMS/Push/Slack/Teams/Webhook | |
225 | | -| `IGraphQLService` | **P2** | `@objectstack/service-graphql` | Auto-generated GraphQL from object schemas | |
226 | | -| `II18nService` | **P2** | `@objectstack/service-i18n` | Runtime i18n with locale loading and translation | |
227 | | - |
228 | | -- [ ] `service-realtime` — Implement `IRealtimeService` with WebSocket + Redis pub/sub |
229 | | -- [ ] `service-notification` — Implement `INotificationService` with channel adapters |
230 | | -- [ ] `service-graphql` — Implement `IGraphQLService` with auto-schema generation from objects |
| 278 | +| `II18nService` | **P1** | `@objectstack/service-i18n` | Map-backed translation with locale resolution | |
| 279 | +| `IRealtimeService` | **P1** | `@objectstack/service-realtime` | WebSocket/SSE push (replaces Studio setTimeout hack) | |
| 280 | +| `ISearchService` | **P1** | `@objectstack/service-search` | In-memory search first, then Meilisearch driver | |
| 281 | +| `INotificationService` | **P2** | `@objectstack/service-notification` | Email adapter (console logger in dev mode) | |
| 282 | + |
231 | 283 | - [ ] `service-i18n` — Implement `II18nService` with file-based locale loading |
| 284 | +- [ ] `service-realtime` — Implement `IRealtimeService` with WebSocket + in-memory pub/sub |
| 285 | +- [ ] `service-search` — Implement `ISearchService` with in-memory search + Meilisearch adapter |
| 286 | +- [ ] `service-notification` — Implement `INotificationService` with email adapter |
232 | 287 |
|
233 | | -### Priority 3 — Business Logic Services |
| 288 | +### Phase 4d: Business Logic Services (P2 — Future) |
| 289 | + |
| 290 | +**Advanced services for workflow automation and business intelligence.** |
234 | 291 |
|
235 | 292 | | Contract | Priority | Package | Notes | |
236 | 293 | |:---|:---:|:---|:---| |
237 | | -| `IAutomationService` | **P2** | `@objectstack/service-automation` | Flow execution engine — depends on queue/job | |
| 294 | +| `IAutomationService` | **P2** | `@objectstack/service-automation` | Flow execution engine | |
238 | 295 | | `IWorkflowService` | **P2** | `@objectstack/service-workflow` | State machine + approval processes | |
239 | | -| `ISearchService` | **P2** | `@objectstack/service-search` | Full-text search via MeiliSearch/Elasticsearch | |
240 | | -| ~~`IUIService`~~ | **Deprecated** | — | Merged into `IMetadataService` — use `metadata.getView()`, `metadata.getEffective('view', name, { userId })` | |
241 | | -| `IAnalyticsService` | **P3** | `@objectstack/service-analytics` | BI/OLAP queries (memory impl exists as reference) | |
| 296 | +| `IGraphQLService` | **P2** | `@objectstack/service-graphql` | Auto-generated GraphQL from objects | |
| 297 | +| `IAIService` | **P2** | `@objectstack/service-ai` | LLM integration (OpenAI/Anthropic/local) | |
| 298 | +| `IAnalyticsService` | **P3** | `@objectstack/service-analytics` | BI/OLAP queries | |
242 | 299 |
|
243 | 300 | - [ ] `service-automation` — Implement `IAutomationService` with flow execution engine |
244 | 301 | - [ ] `service-workflow` — Implement `IWorkflowService` with state machine runtime |
245 | | -- [ ] `service-search` — Implement `ISearchService` with MeiliSearch adapter |
246 | | -- [ ] ~~Enhance `IUIService` runtime implementation~~ (merged into IMetadataService) |
247 | | -- [ ] `service-analytics` — Implement full `IAnalyticsService` beyond memory reference |
248 | | - |
249 | | -### Priority 4 — Platform Services |
250 | | - |
251 | | -| Contract | Priority | Package | Notes | |
252 | | -|:---|:---:|:---|:---| |
253 | | -| `IAIService` | **P2** | `@objectstack/service-ai` | LLM integration (OpenAI/Anthropic/local) | |
254 | | -| `IStartupOrchestrator` | **P3** | — | Advanced startup coordination (current kernel handles basics) | |
255 | | -| `IPluginValidator` | **P3** | — | Plugin marketplace validation | |
256 | | -| `IPluginLifecycleEvents` | **P3** | — | Typed event emitter (partial in kernel) | |
257 | | - |
| 302 | +- [ ] `service-graphql` — Implement `IGraphQLService` with auto-schema generation |
258 | 303 | - [ ] `service-ai` — Implement `IAIService` with multi-provider LLM routing |
259 | | -- [ ] Advanced startup orchestrator for large plugin graphs |
260 | | -- [ ] Plugin marketplace validator for community plugins |
| 304 | +- [ ] `service-analytics` — Implement full `IAnalyticsService` beyond memory reference |
261 | 305 |
|
262 | 306 | --- |
263 | 307 |
|
|
0 commit comments