Skip to content

Commit 93f9cd6

Browse files
authored
Merge pull request #636 from objectstack-ai/copilot/scan-code-analyze-issues
2 parents 4a888db + 6a71759 commit 93f9cd6

6 files changed

Lines changed: 144 additions & 68 deletions

File tree

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Changed
11+
- Updated ROADMAP.md for v3.0 release preparation with full codebase scan results
12+
- Audited all @deprecated items: 14 in spec, 9 in runtime packages (23 total)
13+
- Identified stale deprecation notices targeting v2.0.0 (current: v2.0.7)
14+
- Updated metrics: 172 schema files, 191 test files, 5,165 tests, 7,095 .describe() annotations
15+
16+
### Deprecated
17+
- The following items are scheduled for removal in v3.0.0 (see `packages/spec/V3_MIGRATION_GUIDE.md`):
18+
- `Hub.*` barrel re-exports from `hub/index.ts`
19+
- `location` (singular) on `ActionSchema` — use `locations` (array)
20+
- `definePlugin()` in spec — will move to `@objectstack/core`
21+
- `createErrorResponse()` / `getHttpStatusForCategory()` in spec — will move to `@objectstack/core`
22+
- `RateLimitSchema`, `RealtimePresenceStatus`, `RealtimeAction` aliases
23+
- Event bus helper functions (`createDefaultEventBusConfig`, `createDefaultDLQConfig`, `createDefaultEventHandlerConfig`)
24+
- `HttpDispatcher` class in `@objectstack/runtime`
25+
- `createHonoApp()` in `@objectstack/hono`
26+
1027
## [2.0.7] - 2026-02-11
1128

1229
### Added

ROADMAP.md

Lines changed: 121 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,35 @@
1-
# ObjectStack — Next-Phase Optimization & Improvement Roadmap
1+
# ObjectStack — v3.0 Release Roadmap
22

3-
> **Date:** 2026-02-10
4-
> **Current Version:** 2.0.3
5-
> **Based On:** Full codebase scan of 18 packages (96 Zod schemas, 73 test files, ~26,500 LOC in spec)
3+
> **Date:** 2026-02-12
4+
> **Current Version:** 2.0.7
5+
> **Target Version:** 3.0.0
6+
> **Based On:** Full codebase scan of 19 packages (172 Zod schemas, 191 test files, ~134,800 LOC in spec)
67
> **Previous Plan Status:** `packages/spec/DEVELOPMENT_PLAN.md` Phase 1–4 ✅ **Complete**
78
89
---
910

1011
## Executive Summary
1112

12-
ObjectStack v2.0.1 has achieved solid protocol-level maturity (B+ → A- grade after Phase 1–4). The spec package is well-typed, deduplicated, and documented. The next phase focuses on **runtime hardening**, **test coverage**, **developer experience**, and **production readiness** across the entire monorepo.
13+
ObjectStack v2.0.7 has achieved strong protocol-level maturity (A- grade). The spec package has comprehensive type safety, full test coverage, and thorough documentation. **Phase 5–7 are complete.** Phase 8 (deprecation cleanup) is partially done. The primary focus for v3.0 is **completing the breaking-change cleanup**, **developer experience**, and **production hardening** across the monorepo.
1314

14-
### Current State Snapshot
15+
### Current State Snapshot (v2.0.7 — Scanned 2026-02-12)
1516

1617
| Metric | Value | Target |
1718
|--------|-------|--------|
18-
| `z.any()` in spec | 8 (filter operators only) | 8 |
19-
| `z.unknown()` in spec | 180 | Stable ✅ |
19+
| `z.any()` in spec | 9 (8 filter + 1 i18n) | 8 (filter only) |
20+
| `z.unknown()` in spec | 404 | Stable ✅ |
2021
| `z.date()` in spec (serialization risk) | 12 (all in filter.zod.ts) | 0 in non-filter schemas ✅ |
21-
| `.describe()` annotations | 5,671+ | 5,600+ ✅ |
22-
| Spec test files | 150 / 142 schemas | 100% ✅ |
23-
| Runtime package test coverage | Sparse | Comprehensive |
24-
| Adapter implementations | 3 stubs | 3 functional |
22+
| `.describe()` annotations | 7,095 | 7,000+ ✅ |
23+
| Spec schema files (`.zod.ts`) | 172 | Stable ✅ |
24+
| Spec test files | 191 / 172 schemas | 100%+ ✅ |
25+
| Spec test count | 5,165 | 5,000+ ✅ |
26+
| Packages (all v2.0.7) | 19 | Unified ✅ |
27+
| Runtime package test coverage | REST 37, Metadata 45, Adapters 72 | Comprehensive ✅ |
28+
| Adapter implementations | 3 fully implemented + tested | 3 production-ready ✅ |
2529
| TODO/FIXME comments | 0 across monorepo | 0 ✅ |
26-
| Deprecated items pending removal | 5+ schemas/fields | Migration path documented |
27-
| z.instanceof() usage | 0 | 0 ✅ |
30+
| `@deprecated` items (spec) | 14 | 0 (for v3.0) |
31+
| `@deprecated` items (runtime packages) | 9 | 0 (for v3.0) |
32+
| `z.instanceof()` usage | 0 | 0 ✅ |
2833

2934
---
3035

@@ -183,53 +188,95 @@ Fully implemented with `ObjectStackModule.forRoot()`, `ObjectStackService`, `Obj
183188

184189
## Phase 8: Deprecation Cleanup & v3.0 Preparation (1 week)
185190

186-
> **Goal:** Remove deprecated items, finalize breaking changes for v3.0.
187-
188-
### 8.1 Deprecated Fields to Remove
189-
190-
| Field | File | Replacement |
191-
|-------|------|-------------|
192-
| `formula` | `data/field.zod.ts` | `expression` |
193-
| `encryption: z.boolean()` | `data/field.zod.ts` | `encryptionConfig` |
194-
| `geoSpatial` | `data/driver.zod.ts` | `geospatialQuery` |
195-
| `stateMachine` (singular) | `data/object.zod.ts` | `stateMachines` (plural) |
196-
| `TenantSchema` (hub) | `hub/tenant.zod.ts` | `system/tenant.zod.ts` |
197-
198-
### 8.2 Runtime Logic to Extract from Spec
199-
200-
| Function | Current Location | Move To |
201-
|----------|-----------------|---------|
202-
| `createErrorResponse()` | `api/errors.zod.ts` | `@objectstack/core` |
203-
| `getHttpStatusForCategory()` | `api/errors.zod.ts` | `@objectstack/core` |
204-
| `definePlugin()` | `kernel/plugin.zod.ts` | `@objectstack/core` |
205-
| `definePlugin()` | `kernel/manifest.zod.ts` | `@objectstack/core` |
206-
207-
### 8.3 Hub Module Consolidation
191+
> **Goal:** Remove all deprecated items, finalize breaking changes for v3.0.
192+
193+
### 8.1 Previously Removed Deprecated Fields ✅
194+
195+
| Field | File | Replacement | Status |
196+
|-------|------|-------------|--------|
197+
| `formula` | `data/field.zod.ts` | `expression` | ✅ Removed |
198+
| `encryption: z.boolean()` | `data/field.zod.ts` | `encryptionConfig` | ✅ Removed |
199+
| `geoSpatial` | `data/driver.zod.ts` | `geospatialQuery` | ✅ Removed |
200+
| `stateMachine` (singular) | `data/object.zod.ts` | `stateMachines` (plural) | ✅ Removed |
201+
202+
### 8.2 Remaining @deprecated Items in Spec (14 items)
203+
204+
> **Scan date:** 2026-02-12 — All 14 items documented with `@deprecated` JSDoc tags.
205+
206+
| # | Item | File | Replacement | Priority |
207+
|---|------|------|-------------|----------|
208+
| 1 | `Hub.*` barrel re-exports | `hub/index.ts` | Import from `system/` or `kernel/` directly | 🔴 High |
209+
| 2 | `TenantSchema` compat alias | `system/tenant.zod.ts` | Use canonical `TenantConfigSchema` | 🟡 Medium |
210+
| 3 | `location` (singular) | `ui/action.zod.ts` | `locations` (array) | 🔴 High |
211+
| 4 | `definePlugin()` | `kernel/plugin.zod.ts` | Move to `@objectstack/core/plugin` | 🔴 High |
212+
| 5 | `manifest.data` field | `kernel/manifest.zod.ts` | Top-level `data` field on Stack Definition | 🟡 Medium |
213+
| 6 | `createErrorResponse()` | `api/errors.zod.ts` | Move to `@objectstack/core/errors` | 🔴 High |
214+
| 7 | `getHttpStatusForCategory()` | `api/errors.zod.ts` | Move to `@objectstack/core/errors` | 🔴 High |
215+
| 8 | `RateLimitSchema` alias | `api/endpoint.zod.ts` | `RateLimitConfigSchema` from `shared/http.zod.ts` | 🟡 Medium |
216+
| 9 | `RealtimePresenceStatus` | `api/realtime.zod.ts` | `PresenceStatus` from `realtime-shared.zod.ts` | 🟡 Medium |
217+
| 10 | `RealtimeAction` alias | `api/realtime.zod.ts` | `RealtimeRecordAction` from `realtime-shared.zod.ts` | 🟡 Medium |
218+
| 11 | `capabilities` field | `api/discovery.zod.ts` | Derived from `services` map | 🟡 Medium |
219+
| 12 | `createDefaultEventBusConfig()` | `kernel/events/bus.zod.ts` | Move to `@objectstack/core` | 🟡 Medium |
220+
| 13 | `createDefaultDLQConfig()` | `kernel/events/bus.zod.ts` | Move to `@objectstack/core` | 🟡 Medium |
221+
| 14 | `createDefaultEventHandlerConfig()` | `kernel/events/bus.zod.ts` | Move to `@objectstack/core` | 🟡 Medium |
222+
223+
### 8.3 Remaining @deprecated Items in Runtime Packages (9 items)
224+
225+
| # | Item | Package / File | Replacement | Priority |
226+
|---|------|----------------|-------------|----------|
227+
| 1 | `createHonoApp()` | `@objectstack/hono` index.ts | `HonoServerPlugin` + `createRestApiPlugin()` | 🟡 Medium |
228+
| 2 | `HttpDispatcher` class | `@objectstack/runtime` http-dispatcher.ts | `createDispatcherPlugin()` | 🔴 High |
229+
| 3 | `HttpDispatcher` re-export | `@objectstack/runtime` index.ts | `createDispatcherPlugin()` | 🔴 High |
230+
| 4 | `validatePluginConfig()` | `@objectstack/core` plugin-loader.ts | `PluginConfigValidator` class | 🟡 Medium |
231+
| 5 | `data` response field | `@objectstack/client` index.ts | `records` | 🟡 Medium |
232+
| 6 | `count` response field | `@objectstack/client` index.ts | `total` | 🟡 Medium |
233+
| 7 | `getObject()` method | `@objectstack/client` index.ts | `getItem('object', name)` | 🟡 Medium |
234+
| 8 | `RestApiConfig` type | `@objectstack/rest` rest-api-plugin.ts | `RestApiPluginConfig` | 🟢 Low |
235+
| 9 | `createRestApi()` fn | `@objectstack/rest` rest-api-plugin.ts | `createRestApiPlugin()` | 🟢 Low |
236+
237+
### 8.4 Hub Module Consolidation
208238

209239
The `hub/` directory currently re-exports from `system/` and `kernel/`. In v3.0:
210240
- Remove `hub/index.ts` barrel re-exports entirely
211241
- Update all consumers to import directly from `system/` or `kernel/`
212242
- Remove `Hub.*` namespace from `src/index.ts`
213243

214-
### 8.4 Naming Consistency Audit
244+
### 8.5 Type Safety: Remaining z.any() in Non-Filter Schema
215245

216-
| Issue | Details | Fix |
217-
|-------|---------|-----|
218-
| `MetricType` collision history | Was split into `AggregationMetricType` + `LicenseMetricType` | Verify no consumers still use old name |
219-
| `service-registry.zod.ts` name collision | Was renamed to `core-services.zod.ts` in system/ | Verify no imports reference old path |
220-
| `Presence` schema duplication | Was in both realtime and websocket | Verify canonical location used everywhere |
246+
| File | Usage | Action |
247+
|------|-------|--------|
248+
| `ui/i18n.zod.ts:26` | `params: z.record(z.string(), z.any())` | Tighten to `z.record(z.string(), z.union([z.string(), z.number(), z.boolean()]))` |
249+
250+
### 8.6 Stale Deprecation Notices
251+
252+
Several deprecated items say "Will be removed in v2.0.0" but current version is v2.0.7. These need their deprecation notices updated to target v3.0.0:
253+
254+
| Item | Current Notice | Should Be |
255+
|------|---------------|-----------|
256+
| `definePlugin()` | "removed in v2.0.0" | "removed in v3.0.0" |
257+
| `createErrorResponse()` | "removed in v2.0.0" | "removed in v3.0.0" |
258+
| `getHttpStatusForCategory()` | "removed in v2.0.0" | "removed in v3.0.0" |
259+
| `location` field | "removed in v2.0.0" | "removed in v3.0.0" |
260+
| `HttpDispatcher` | "removed in v2" | "removed in v3.0.0" |
221261

222262
### Phase 8 Checklist
223263

224264
- [x] Remove deprecated `formula` field (use `expression`)
225265
- [x] Remove deprecated `encryption: z.boolean()` (use `encryptionConfig`)
226266
- [x] Remove deprecated `geoSpatial` + refinement (use `geospatialQuery`)
227267
- [x] Remove deprecated `stateMachine` singular (use `stateMachines` plural)
228-
- [ ] Extract runtime logic from spec → core
229-
- [ ] Remove hub/ re-export barrel
230-
- [x] Verify naming consistency across all imports — 0 TODO/FIXME, 10 deprecated items documented
231268
- [x] Create v3.0 migration guide (`packages/spec/V3_MIGRATION_GUIDE.md`)
232269
- [x] Update CHANGELOG.md with breaking changes
270+
- [x] Audit and document all 23 remaining @deprecated items (14 spec + 9 runtime)
271+
- [x] Identify stale deprecation notices targeting v2.0.0
272+
- [ ] Update stale deprecation notices to target v3.0.0
273+
- [ ] Extract runtime logic from spec → core (3 functions + 3 event helpers)
274+
- [ ] Remove hub/ re-export barrel + `Hub.*` namespace
275+
- [ ] Remove deprecated schema aliases (RateLimitSchema, RealtimePresenceStatus, RealtimeAction)
276+
- [ ] Remove deprecated `location` field from ActionSchema
277+
- [ ] Remove deprecated `capabilities` from DiscoverySchema
278+
- [ ] Remove deprecated compat aliases in runtime packages
279+
- [ ] Tighten `z.any()` in `ui/i18n.zod.ts` to typed union
233280

234281
---
235282

@@ -359,16 +406,18 @@ The `hub/` directory currently re-exports from `system/` and `kernel/`. In v3.0:
359406
## Timeline Summary
360407

361408
```
362-
2026 Q1 (Current)
363-
├── Phase 5: Spec Test Coverage [1 week] → 100% schema test coverage
364-
├── Phase 6: Runtime Hardening [2 weeks] 0 TODOs, comprehensive tests
365-
└── Phase 7: Adapter Implementation [1-2 weeks] 3 functional adapters
409+
2026 Q1 (Complete)
410+
├── Phase 5: Spec Test Coverage [1 week] ✅ 191 test files, 5,165 tests
411+
├── Phase 6: Runtime Hardening [2 weeks] 0 TODOs, comprehensive tests
412+
└── Phase 7: Adapter Implementation [1-2 weeks] 3 fully implemented + tested
366413
367-
2026 Q2
368-
├── Phase 8: Deprecation Cleanup [1 week] → v3.0 breaking change prep
414+
2026 Q2 (v3.0 Release)
415+
├── Phase 8: Deprecation Cleanup [1 week] 🔄 14 spec + 9 runtime deprecated items remaining
369416
├── Phase 9: Developer Experience [2 weeks] → Better DX, docs, tooling
370417
├── Phase 10: Performance Optimization [1 week] → Faster builds, smaller bundles
371418
└── Phase 11: Security Hardening [1 week] → Production-grade security
419+
420+
v3.0 Release Target: End of Q2 2026
372421
```
373422

374423
**Parallel Track:** Studio ROADMAP.md (see `apps/studio/ROADMAP.md`) runs independently:
@@ -379,20 +428,28 @@ The `hub/` directory currently re-exports from `system/` and `kernel/`. In v3.0:
379428

380429
## Success Criteria for v3.0
381430

382-
| Metric | v2.0.1 (Current) | v3.0 Target |
431+
| Metric | v2.0.7 (Current) | v3.0 Target |
383432
|--------|-------------------|-------------|
384-
| Spec test coverage | ~~76% (73/96)~~ **100% (175/150)** | 100% ✅ |
385-
| Spec test count | ~~3,000~~ **4,518 tests** | 4,500+ ✅ |
386-
| Runtime test coverage | ~~Sparse~~ **REST 37, Metadata 45, Adapters 72** | >80% per package |
387-
| TODO/FIXME count | ~~24~~ **0** | 0 ✅ |
388-
| Adapter maturity | ~~3 stubs~~ **3 fully implemented + tested** | 3 production-ready ✅ |
389-
| Deprecated items | ~~5+~~ **4 removed, 10 documented w/ migration guide** | 0 (removed or migrated) |
390-
| Events modularization | ~~765-line monolith~~ **6 sub-modules** | Modularized ✅ |
433+
| Spec schema files | 172 | 172+ (stable) ✅ |
434+
| Spec test files | 191 (111% coverage) | 100%+ ✅ |
435+
| Spec test count | 5,165 | 5,000+ ✅ |
436+
| `.describe()` annotations | 7,095 | 7,000+ ✅ |
437+
| Runtime test coverage | REST 37, Metadata 45, Adapters 72 | >80% per package ✅ |
438+
| TODO/FIXME count | 0 | 0 ✅ |
439+
| Adapter maturity | 3 fully implemented + tested | 3 production-ready ✅ |
440+
| Events modularization | 6 sub-modules | Modularized ✅ |
441+
| `@deprecated` items (spec) | 14 remaining | 0 (all removed or migrated) |
442+
| `@deprecated` items (runtime) | 9 remaining | 0 (all removed or migrated) |
443+
| `z.any()` in non-filter schemas | 1 (`ui/i18n.zod.ts`) | 0 |
444+
| `z.instanceof()` usage | 0 | 0 ✅ |
445+
| Hub module | Re-exporting (deprecated) | Removed |
446+
| Runtime logic in spec | 6 functions | 0 (all in `@objectstack/core`) |
391447
| `pnpm audit` vulnerabilities | Unknown | 0 |
392448
| Bundle size tracked | No | Yes, with CI gate |
393449
| Performance benchmarks | None | Baseline established |
394-
| JSON Schema count | 1,207 | 1,200+ with versioning |
450+
| JSON Schema count | 1,207+ | 1,200+ with versioning |
395451
| Supported field types | 46+ | 46+ (stable) |
452+
| Packages (unified version) | 19 @ v2.0.7 | 19 @ v3.0.0 |
396453

397454
---
398455

@@ -404,13 +461,15 @@ The `hub/` directory currently re-exports from `system/` and `kernel/`. In v3.0:
404461
| Spec Schema Audit Report | `packages/spec/ZOD_SCHEMA_AUDIT_REPORT.md` | ✅ Reference |
405462
| Protocol Registry | `packages/spec/PROTOCOL_MAP.md` | ✅ Current |
406463
| API Implementation Plan | `packages/spec/API_IMPLEMENTATION_PLAN.md` | 🔄 In Progress |
464+
| V3 Migration Guide | `packages/spec/V3_MIGRATION_GUIDE.md` | ✅ Current |
407465
| Studio Roadmap | `apps/studio/ROADMAP.md` | 🔄 Active (Phase 0–8) |
408466
| Plugin Standards | `packages/spec/PLUGIN_STANDARDS.md` | ✅ Established |
409467
| Architecture | `ARCHITECTURE.md` | ✅ Current |
410468
| Release Notes | `RELEASE_NOTES.md` | ✅ Current (v1.2.0) |
469+
| Changelog | `CHANGELOG.md` | ✅ Current (v2.0.7) |
411470

412471
---
413472

414-
**Last Updated:** 2026-02-09
473+
**Last Updated:** 2026-02-12
415474
**Maintainers:** ObjectStack Core Team
416-
**Status:** Active Roadmap
475+
**Status:** Active Roadmap — Preparing v3.0 Release

packages/runtime/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export type { DispatcherPluginConfig } from './dispatcher-plugin.js';
1515

1616
// Export HTTP Server Components
1717
export { HttpServer } from './http-server.js';
18-
/** @deprecated Use createDispatcherPlugin() instead. Will be removed in v2. */
18+
/** @deprecated Use createDispatcherPlugin() instead. Will be removed in v3.0.0. */
1919
export { HttpDispatcher } from './http-dispatcher.js';
2020
export type { HttpProtocolContext, HttpDispatcherResult } from './http-dispatcher.js';
2121
export { MiddlewareManager } from './middleware.js';

packages/spec/src/api/errors.zod.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,15 +273,15 @@ export type ErrorResponse = z.infer<typeof ErrorResponseSchema>;
273273

274274
/**
275275
* Get HTTP status code for an error category
276-
* @deprecated Move to @objectstack/core. Will be removed from spec in v2.0.0
276+
* @deprecated Move to @objectstack/core. Will be removed from spec in v3.0.0
277277
*/
278278
export function getHttpStatusForCategory(category: ErrorCategory): number {
279279
return ErrorHttpStatusMap[category] || 500;
280280
}
281281

282282
/**
283283
* Create a standardized error response
284-
* @deprecated Move to @objectstack/core. Will be removed from spec in v2.0.0
284+
* @deprecated Move to @objectstack/core. Will be removed from spec in v3.0.0
285285
*/
286286
export function createErrorResponse(
287287
code: StandardErrorCode,

packages/spec/src/kernel/plugin.zod.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export type PluginDefinition = z.infer<typeof PluginSchema>;
102102
/**
103103
* Define an ObjectStack Plugin
104104
* Helper function for creating type-safe plugin definitions
105-
* @deprecated Move to @objectstack/core. Will be removed from spec in v2.0.0
105+
* @deprecated Move to @objectstack/core. Will be removed from spec in v3.0.0
106106
*/
107107
export function definePlugin(config: PluginDefinition): PluginDefinition {
108108
return config;

packages/spec/src/ui/action.zod.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ export const ActionSchema = z.object({
6666
'action:group' // Button Group
6767
]).optional().describe('Visual component override'),
6868

69-
/** @deprecated Use `locations` instead. Will be removed in v2.0.0 */
69+
/** @deprecated Use `locations` instead. Will be removed in v3.0.0 */
7070
location: z.unknown().optional()
71-
.describe('DEPRECATED: Use `locations` field instead. Scheduled for removal in v2.0.0'),
71+
.describe('DEPRECATED: Use `locations` field instead. Scheduled for removal in v3.0.0'),
7272

7373
/** What type of interaction? */
7474
type: z.enum(['script', 'url', 'modal', 'flow', 'api']).default('script').describe('Action functionality type'),

0 commit comments

Comments
 (0)