|
| 1 | +# ObjectStack Project Master Plan & Status Report |
| 2 | + |
| 3 | +**Date:** 2026-02-05 |
| 4 | +**Version:** 1.0.0 |
| 5 | + |
| 6 | +## 1. Project Master Scheme (项目总体方案) |
| 7 | + |
| 8 | +ObjectStack is designed as a **metadata-driven, post-SaaS operating system**. It virtualizes the application stack into strict Zod protocols, allowing business logic, UI, and data structures to be defined as code and executed by a universal runtime. |
| 9 | + |
| 10 | +### 1.1 Architectural Layers |
| 11 | + |
| 12 | +1. **Protocol Layer (`@objectstack/spec`)** |
| 13 | + * **Role:** The "DNA" of the system. |
| 14 | + * **Technology:** Pure TypeScript + Zod. |
| 15 | + * **Status:** **Complete**. Covers UI, Data, Security, Automation, AI, System. |
| 16 | + |
| 17 | +2. **Kernel Layer (`@objectstack/core`)** |
| 18 | + * **Role:** The Microkernel. Handles plugin lifecycle, dependency injection, event bus, and logging. |
| 19 | + * **Status:** **Stable**. |
| 20 | + |
| 21 | +3. **Engine Layer** |
| 22 | + * **ObjectQL (`@objectstack/objectql`)**: Universal data access abstraction. |
| 23 | + * **Runtime (`@objectstack/runtime`)**: The execution brain. Contains the `HttpDispatcher` which unifies request handling. |
| 24 | + * **Status:** **Stable (Memory-only)**. |
| 25 | + |
| 26 | +4. **Interface Layer (Adapters & Plugins)** |
| 27 | + * **Server**: `@objectstack/plugin-hono-server` (Production HTTP), `@objectstack/adapter-nextjs` (Frontend Backend). |
| 28 | + * **Client**: `@objectstack/plugin-msw` (Browser Mocking), `@objectstack/client` (SDK). |
| 29 | + * **Status:** **Unified Architecture Implemented**. |
| 30 | + |
| 31 | +5. **Infrastructure Layer (Drivers)** |
| 32 | + * **Data**: `driver-memory` (Dev/Test), `driver-sqlite` (Local), `driver-postgres` (Scale). |
| 33 | + * **Status:** **Partial** (Memory only). |
| 34 | + |
| 35 | +--- |
| 36 | + |
| 37 | +## 2. Current Development Progress (当前开发进度) |
| 38 | + |
| 39 | +### ✅ Completed Milestones |
| 40 | + |
| 41 | +* **Protocol Definition:** All major protocols (UI, Data, API, security) are defined in Zod. |
| 42 | +* **Unified Dispatcher Architecture:** |
| 43 | + * Refactored `plugin-hono-server` to use `@objectstack/hono` factory. |
| 44 | + * Refactored `plugin-msw` to use shared `HttpDispatcher`. |
| 45 | + * **Result:** The mock server now behaves identically to the production server. |
| 46 | +* **CI/CD Stabilization:** |
| 47 | + * Fixed build and test pipelines for the monorepo. |
| 48 | + * Resolved integration test environment issues (skipping live-server tests in CI). |
| 49 | +* **Documentation:** |
| 50 | + * Updated `packages.mdx` with correct plugin architecture descriptions. |
| 51 | + |
| 52 | +### 🚧 Works in Progress |
| 53 | + |
| 54 | +* **Client SDK**: Basic structure exists, but needs stronger typing inference from Zod schemas. |
| 55 | +* **React Components**: `@objectstack/client-react` exists but is minimal. |
| 56 | + |
| 57 | +--- |
| 58 | + |
| 59 | +## 3. Next Development Roadmap (下一步开发计划) |
| 60 | + |
| 61 | +The immediate focus shifts from **Architecture/Kernel** stability to **Feature/Persistence** implementation. |
| 62 | + |
| 63 | +### Phase 1: Persistence Strategy (Week 1-2) |
| 64 | +**Objective:** Move beyond in-memory data to persistent storage. |
| 65 | +1. **Create `@objectstack/driver-sqlite`**: |
| 66 | + * Implement `ObjectStackDriver` interface. |
| 67 | + * Target: `better-sqlite3` for fast local development. |
| 68 | + * Compliance: Pass the standard `driver-test-suite` (which runs on memory driver currently). |
| 69 | +2. **Create `@objectstack/driver-postgres`**: |
| 70 | + * Target: `pg` or `postgres.js`. |
| 71 | + * Support JSONB for flexible metadata storage. |
| 72 | + |
| 73 | +### Phase 2: Metadata UI Engine (Week 3-4) |
| 74 | +**Objective:** Render UI directly from Zod Protocol definitions. |
| 75 | +1. **Enhance `@objectstack/client-react`**: |
| 76 | + * Implement `useObject(objectName)` hook. |
| 77 | + * Implement `useView(viewName)` hook. |
| 78 | +2. **Dynamic Form Builder**: |
| 79 | + * Create a component that takes a `ZodSchema` or Field Protocol and renders a form. |
| 80 | + * Support `auto-layout` based on field types. |
| 81 | + |
| 82 | +### Phase 3: Automation Runtime (Week 5-6) |
| 83 | +**Objective:** Make the system "Active". |
| 84 | +1. **Implement `@objectstack/plugin-automation`**: |
| 85 | + * **Triggers:** Listen to `data:create`, `data:update` events. |
| 86 | + * **Flow Engine:** Interpreter for `src/automation/flow.zod.ts`. |
| 87 | + * **Actions:** Execute server-side logic defined in metadata. |
| 88 | + |
| 89 | +### Phase 4: AI Agent Integration (Week 7+) |
| 90 | +**Objective:** Activate the "Post-SaaS" AI capabilities. |
| 91 | +1. **Agent Runtime**: |
| 92 | + * Implement `AgentExecutor` using `src/ai/agent.zod.ts`. |
| 93 | + * Connect Agents to `HttpDispatcher` as Tools. |
| 94 | + |
| 95 | +--- |
| 96 | + |
| 97 | +## 4. Immediate Action Items (Today/Tomorrow) |
| 98 | + |
| 99 | +1. **Scaffold `packages/plugins/driver-sqlite`**. |
| 100 | +2. **Extract Standard Driver Test Suite**: Ensure `packages/core/src/qa` has a reusable test suite that can be applied to new drivers immediately. |
0 commit comments