@objectstack/spec Metadata Capability Evaluation
Detailed analysis of @objectstack/spec v3.0.0 metadata capabilities used and unused in HotCRM, with improvement recommendations.
@objectstack/spec Metadata Capability Evaluation
Version: @objectstack/spec v3.0.0 | Evaluated: February 12, 2026 | Last Updated: Phase 8
Scope: All 12 spec modules evaluated against HotCRM's 7 business packages + AI package
Validation Engine: Zod 4.3.6
v3.0.0 Breaking Changes: Removedhub,auth,driver,permissionmodules. Newstudiomodule added withdefineStudioPlugin()and contributions API.
This document provides a comprehensive gap analysis between the metadata capabilities offered by @objectstack/spec and their actual adoption in HotCRM. It covers all 12 exported modules in v3.0.0 (data, system, kernel, ai, automation, api, ui, contracts, integration, security, studio), categorizes each capability as Used, Partially Used, or Not Used, and proposes an actionable improvement plan.
v3.0.0 Module List (12 modules)
| Module | Import Path | Primary Purpose |
|---|---|---|
| data | @objectstack/spec/data | Object schemas, fields, hooks |
| system | @objectstack/spec/system | Caching, notifications, audit |
| kernel | @objectstack/spec/kernel | Plugin system, events, manifests |
| ai | @objectstack/spec/ai | MCP tools, agents, RAG |
| automation | @objectstack/spec/automation | Workflows, state machines |
| api | @objectstack/spec/api | API endpoints, webhooks |
| ui | @objectstack/spec/ui | Pages, views, dashboards, forms |
| contracts | @objectstack/spec/contracts | Service contracts, typed interfaces |
| integration | @objectstack/spec/integration | Connectors, external systems |
| security | @objectstack/spec/security | Permissions, sharing rules |
| studio | @objectstack/spec/studio | Studio plugins, contributions API |
Note on
ObjectSchema.create()vsObjectSchema.parse(): v3.0.0 introducedObjectSchema.create()as the recommended lightweight API for defining objects. It provides the same type safety with less overhead thanparse(). All 94 HotCRM objects useObjectSchema.create().
Zod 4 Compatibility:
@objectstack/specv3.0.0 uses Zod 4.3.6 as its validation engine. Zod 4 is largely backward-compatible with Zod 3 patterns (z.string(),z.object(),z.enum(), etc.). Nine files across HotCRM importzoddirectly (see Zod 4 Compatibility section below). All existing patterns are compatible with Zod 4.
Executive Summary
| Category | Used | Partially Used | Not Used | Adoption Rate |
|---|---|---|---|---|
Data Layer (/data) | 8 | 2 | 10 | 40% |
UI Layer (/ui) | 7 | 1 | 11 | 37% |
Automation (/automation) | 3 | 1 | 7 | 27% |
AI Layer (/ai) | 5 | 1 | 17 | 22% |
System (/system) | 3 | 0 | 8 | 27% |
API (/api) | 1 | 1 | 14 | 6% |
Integration (/integration) | 0 | 0 | 10 | 0% |
Security (/security) | 1 | 0 | 5 | 17% |
Kernel (/kernel) | 2 | 1 | 7 | 20% |
Contracts (/contracts) | 0 | 0 | 4 | 0% |
Studio (/studio) | 1 | 0 | 3 | 25% |
| Total | 31 | 7 | 96 | ~25% |
Key Finding: With Phase 8 work, HotCRM has significantly improved its spec adoption from ~13% to ~25%. UI schemas are now fully adopted (PageSchema, ViewSchema, DashboardSchema, FormViewSchema all validated). The studio module is adopted via defineStudioPlugin(). System-level configs (cache, notifications, audit) and API configs (webhooks) are now formally defined. The data layer remains the most heavily used module with expanded field type usage.
Module-by-Module Analysis
1. @objectstack/spec/data — Data Layer
The data module is HotCRM's most heavily used spec module, imported in all 94 object files and 71 hook files.
| Capability | Status | Usage Details |
|---|---|---|
ObjectSchema.create() | ✅ Used | All 94 objects defined via ObjectSchema.create() — the recommended v3.0.0 lightweight API |
Field.* type builders | ✅ Used | 22 of 44 field types used (see Field Types section below) |
Hook / HookContext types | ✅ Used | All 47 hook files import Hook and HookContext types |
ObjectCapabilities (enable config) | ✅ Used | 91 of 94 objects use enable config with searchable, trackHistory, activities, feeds, files |
Field.masterDetail() | ✅ Used | Used in invoice_line→invoice, case_comment→case, product_bundle_component→bundle, quote_line_item→quote |
Field.summary() | ✅ Used | Used in invoice (line_item_count, calculated_subtotal), account (total_opportunities, total_open_opportunities_amount), product_bundle (component_count) |
Field.image() / Field.file() | ✅ Used | employee.photo, product.product_image (image); case.attachments, knowledge_article.attachment (file) |
Field.location() / Field.address() | ✅ Used | account.headquarters_location, account.billing_address, account.shipping_address, employee.home_address |
QuerySchema / FilterSchema | ⚠️ Partial | ObjectQL queries are used in hooks via ctx.ql.find(), but no direct use of QuerySchema.parse() for validation |
ValidationRule schemas | ⚠️ Partial | Field-level validations (required, unique, maxLength, min, max) used; cross-field and data quality validations defined in CRM package |
Datasource / Dataset | ❌ Not Used | External data source configuration not implemented |
Document / DocumentTemplate | ❌ Not Used | Document generation/management not implemented |
ESignatureConfig | ❌ Not Used | Electronic signature not implemented |
ExternalDataSource / ExternalLookup | ❌ Not Used | External system lookup not implemented |
VectorConfig | ❌ Not Used | Vector field type and vector search not used |
FullTextSearch config | ❌ Not Used | Full-text search configuration not utilized |
AggregationPipeline / Cube / AnalyticsQuery | ❌ Not Used | Analytics/OLAP capabilities not configured |
ComputedFieldCache | ❌ Not Used | Computed field caching not configured |
ObjectExtension | ❌ Not Used | Object extension declarations not used |
SoftDeleteConfig / VersioningConfig / PartitioningConfig | ❌ Not Used | Advanced data lifecycle configurations not used |
Field Types: Used vs Available
| Used (22/44) | Not Used (22/44) |
|---|---|
text, textarea, number, boolean, select, select({multiple:true}), date, datetime, currency, percent, lookup, masterDetail, summary, email, phone, url, formula, autonumber, file, image, location, address | radio, checkboxes, toggle, time, password, markdown, html, richtext, json, code, avatar, video, audio, tree, color, rating, slider, signature, qrcode, progress, tags, vector |
Progress: Field type usage has increased from 15 to 22 types. All CRM-critical relationship types (masterDetail, summary, lookup) are now in use. Geographic (location, address), media (file, image), and multi-select patterns are adopted.
2. @objectstack/spec/ui — UI Layer
| Capability | Status | Usage Details |
|---|---|---|
PageSchema (record detail pages) | ✅ Used | Page files use satisfies Page type and validate with PageSchema.parse(). Components include record:highlights, record:details, page:tabs, record:related_list |
ViewSchema (list views) | ✅ Used | View files use satisfies View type and validate with ViewSchema.parse(). Support columns, filters, sorting, pagination, conditional formatting, bulk actions |
DashboardSchema / DashboardWidget | ✅ Used | Dashboard files use satisfies Dashboard type and validate with DashboardSchema.parse(). Widget types: metric, kpi, funnel, line, bar, table |
FormViewSchema / FormField / FormSection | ✅ Used | Form files use satisfies FormView type and validate with FormViewSchema.parse(). Support sections, columns, required fields, colSpan |
conditionalFormatting | ✅ Used | Used in list views for visual status indicators (e.g., Hot Accounts, Needs Attention) |
pagination / bulkActions / inlineEdit | ✅ Used | List views configure pageSize, pageSizeOptions, bulk delete/update/export, inline editing |
record:related_list components | ✅ Used | Page layouts include related lists with filters, sorting, and actions (opportunities, contacts, cases, contracts) |
AppSchema (navigation/branding) | ⚠️ Partial | Navigation configured in plugin files but not fully using AppSchema |
ChartConfig / ChartSeries / ChartAxis | ❌ Not Used | Dashboard widgets use simplified chart types; full chart config not used |
Report / ReportColumn / ReportGrouping | ❌ Not Used | No report definitions |
Theme / ColorPalette / Typography | ❌ Not Used | No theme customization |
KanbanConfig / CalendarConfig / GanttConfig | ❌ Not Used | No specialized view type configurations |
Action (UI action buttons) | ❌ Not Used | Page actions defined as plain objects |
WidgetManifest / custom widgets | ❌ Not Used | No custom widget registrations |
Animation / Breakpoints / ZIndex | ❌ Not Used | Design system tokens not configured |
ComponentProps variants | ❌ Not Used | Advanced component prop types not used |
Key Finding: UI schema adoption is now complete for core metadata types. All page layouts, list views, dashboards, and forms validate against their respective schemas using satisfies type checking and .parse() runtime validation.
3. @objectstack/spec/automation — Automation Layer
| Capability | Status | Usage Details |
|---|---|---|
WorkflowRule (trigger-based rules) | ✅ Used | 6 workflow files define workflow rules with triggerType, condition, actions. Validated with WorkflowRuleSchema.parse() |
WorkflowAction types (fieldUpdate, emailAlert, taskCreation, httpCall, customAction) | ✅ Used | All 5 action types used across workflows |
StateMachineConfig / state machines | ✅ Used | State machines formally defined via StateMachineSchema for case status, lead lifecycle |
ApprovalProcess / ApprovalStep | ⚠️ Partial | Approval workflows exist in products but don't fully use formal approval schema |
Flow / FlowNode / FlowEdge (visual flows) | ❌ Not Used | No visual flow definitions |
TimeTrigger (scheduled triggers) | ❌ Not Used | Schedule defined inline in workflows |
Webhook / WebhookReceiver | ❌ Not Used | Webhook configurations not defined via automation module |
Connector / ConnectorInstance | ❌ Not Used | External system connectors not configured |
ETLPipeline / ETLTransformation | ❌ Not Used | ETL pipelines not defined |
DataSyncConfig / Sync | ❌ Not Used | Data sync configurations not used |
Key Finding: Workflow definitions are now validated with WorkflowRuleSchema. State machines have been formally adopted for status lifecycle management.
4. @objectstack/spec/ai — AI Layer
| Capability | Status | Usage Details |
|---|---|---|
MCPServerConfig / MCPServerConfigSchema | ✅ Used | Full MCP server config in ai/src/mcp_server.config.ts with .parse() validation |
MCPTool / MCPToolSchema | ✅ Used | 8 MCP tools defined (lead_scoring, opportunity_forecast, etc.) |
MCPResource / MCPResourceSchema | ✅ Used | 4 MCP resources defined (account_context, pipeline_summary, etc.) |
MCPPrompt / MCPPromptSchema | ✅ Used | 3 MCP prompts defined (sales_briefing, case_resolution, candidate_evaluation) |
AgentSchema | ✅ Used | AI agent definitions validated with AgentSchema.parse() |
Agent / AgentWorkflow | ⚠️ Partial | 6 AI agent workflows exist — core agents use formal schema, some use custom classes |
RAGPipelineConfig / DocumentChunk / VectorStoreConfig | ❌ Not Used | RAG pipeline not configured via spec |
NLQRequest / NLQResponse (Natural Language Query) | ❌ Not Used | NLQ not configured |
ModelConfig / ModelRegistry / PromptTemplate | ❌ Not Used | Model registry defined in custom code |
PredictiveModel / TrainingConfig | ❌ Not Used | ML model definitions not using spec |
DevOpsAgent / DevOpsTool | ❌ Not Used | DevOps AI not configured |
AIOrchestration / AITask | ❌ Not Used | AI orchestration not using spec schemas |
ConversationSession / ConversationMessage | ❌ Not Used | Conversation management not formalized |
CostAnalytics / CostReport | ❌ Not Used | AI cost tracking not configured |
CodeGenerationConfig | ❌ Not Used | Code generation not configured |
PluginComposition / PluginRecommendation | ❌ Not Used | AI-powered plugin suggestions not implemented |
Key Finding: MCP integration is well-implemented and validated. Agent definitions now use AgentSchema for formal validation.
5. @objectstack/spec (root) + @objectstack/spec/kernel — Configuration & Plugin System
| Capability | Status | Usage Details |
|---|---|---|
defineStack() helper | ✅ Used | Used in root objectstack.config.ts and all 6 package configs |
ManifestSchema (app/plugin manifest) | ✅ Used | Manifest with id, namespace, version, type, name, description |
PluginSchema / PluginContext | ⚠️ Partial | Plugins use PluginSchema in most packages; some legacy plugins still typed as any |
PluginCapability / PluginCapabilityManifest | ❌ Not Used | Plugin capabilities not declared |
EventSchema / EventBusConfig | ❌ Not Used | Event bus not configured |
FeatureFlag | ❌ Not Used | Feature flags not implemented |
MetadataLoaderContract / MetadataManagerConfig | ❌ Not Used | Metadata management not formalized |
PluginHealthCheck / PluginHealthReport | ❌ Not Used | Plugin health monitoring not configured |
PluginDependencyResolution | ❌ Not Used | Dependency resolution not formalized |
StartupOptions / startup orchestration | ❌ Not Used | Startup not configured |
6. @objectstack/spec/system — System Layer
| Capability | Status | Usage Details |
|---|---|---|
CacheConfig / CacheStrategy | ✅ Used | Cache configuration defined in products/src/system/cache.config.ts |
NotificationConfig / NotificationChannel | ✅ Used | Notification configuration defined in support/src/system/notification.config.ts |
AuditConfig / AuditEvent | ✅ Used | Audit configuration defined in crm/src/system/audit.config.ts |
MessageQueueConfig / TopicConfig | ❌ Not Used | No message queue setup |
StorageProvider / ObjectStorageConfig | ❌ Not Used | No storage configuration |
SearchConfig / SearchProvider | ❌ Not Used | No search engine configuration |
LoggerConfig / LoggingConfig | ❌ Not Used | No logging configuration |
MetricsConfig / MetricDefinition | ❌ Not Used | No metrics/observability setup |
TracingConfig / TraceContext | ❌ Not Used | No distributed tracing |
ServerCapabilities / HttpServerConfig | ❌ Not Used | No server capabilities declared |
EncryptionConfig / FieldEncryption | ❌ Not Used | No encryption configuration |
7. @objectstack/spec/api — API Layer
| Capability | Status | Usage Details |
|---|---|---|
WebhookConfig | ✅ Used | Webhook configuration defined in crm/src/system/webhook.config.ts |
ApiEndpoint / ApiRoutes | ⚠️ Partial | API endpoint configuration defined in crm/src/system/api.config.ts; not all packages have API configs |
GraphQLConfig / GraphQLQueryConfig | ❌ Not Used | No GraphQL configuration |
OData / ODataQuery | ❌ Not Used | No OData support |
WebSocketConfig / realtime events | ❌ Not Used | No WebSocket/realtime configuration |
BatchConfig / BatchOperationResult | ❌ Not Used | No batch API configuration |
CacheControl / ETag | ❌ Not Used | No HTTP caching |
ApiVersioningConfig | ❌ Not Used | No API versioning |
DispatcherConfig / route registration | ❌ Not Used | No route dispatcher |
OpenApiSpec / API documentation | ❌ Not Used | No OpenAPI spec generation |
RestApiConfig / endpoint patterns | ❌ Not Used | No REST API configuration |
8. @objectstack/spec/security — Security Layer
| Capability | Status | Usage Details |
|---|---|---|
PermissionSet / ObjectPermission / FieldPermission | ✅ Used | Permission sets defined in CRM package via PermissionSetSchema |
SharingRule / SharingLevel | ❌ Not Used | No sharing rules |
RLSConfig (Row-Level Security) | ❌ Not Used | No RLS policies |
TerritoryModel / Territory | ❌ Not Used | No territory management |
Policy (session, password, network, audit) | ❌ Not Used | No security policies |
9. @objectstack/spec/integration — Integration Layer
| Capability | Status | Usage Details |
|---|---|---|
Connector / ConnectorSchema (SaaS connectors) | ❌ Not Used | No external connectors |
WebhookConfig / WebhookEvent | ❌ Not Used | No webhook configurations |
RateLimitConfig / RetryConfig | ❌ Not Used | No rate limiting |
FileStorageConnector | ❌ Not Used | No file storage integration |
MessageQueueConnector | ❌ Not Used | No message queue integration |
GitHubConnector / VercelConnector | ❌ Not Used | No CI/CD integration |
ApiVersionConfig | ❌ Not Used | No API versioning |
DatabaseConnector | ❌ Not Used | No external DB connectors |
10. @objectstack/spec/studio — Studio Module (New in v3.0.0)
| Capability | Status | Usage Details |
|---|---|---|
defineStudioPlugin() | ✅ Used | Studio plugin contributions defined for HotCRM admin extensions |
contributions API (sidebar, panels) | ❌ Not Used | Studio sidebar and panel contributions not configured |
StudioTheme / StudioLayout | ❌ Not Used | Studio theme customization not used |
StudioCommand / CommandPalette | ❌ Not Used | Studio command palette not extended |
11. @objectstack/spec/contracts — Service Contracts
| Capability | Status | Usage Details |
|---|---|---|
ServiceContract / typed interfaces | ❌ Not Used | Service contracts not defined |
ContractVersion / versioning | ❌ Not Used | Contract versioning not used |
ContractTest / contract testing | ❌ Not Used | Contract testing not configured |
ContractRegistry | ❌ Not Used | Contract registry not used |
v3.0.0 Note: The
hub,auth,driver, andpermissionmodules were removed in v3.0.0. Their functionality has been consolidated into other modules (securityabsorbed permission,kernelabsorbed auth/driver, hub functionality is deprecated).
Gap Analysis Summary
Resolved Gaps (Completed in Phase 7–8)
These gaps from the original evaluation have been addressed:
| # | Gap | Module | Resolution |
|---|---|---|---|
| 1 | UI Schema Typing | ui | ✅ All pages, views, dashboards, and forms now validate with PageSchema, ViewSchema, DashboardSchema, FormViewSchema |
| 2 | Workflow Schema Validation | automation | ✅ Workflows validated via WorkflowRuleSchema.parse() |
| 3 | Plugin Type Safety | kernel | ✅ Most plugins use PluginSchema (some legacy any remains) |
| 4 | State Machine Definitions | automation | ✅ Case status and lead lifecycle use StateMachineSchema |
| 5 | Advanced Field Types | data | ✅ masterDetail, summary, select({multiple:true}), file, image, location, address adopted |
| 7 | Agent Schema Adoption | ai | ✅ AI agents use formal AgentSchema definitions |
| 8 | Permission Model | security | ✅ Permission sets defined via PermissionSetSchema |
| 9 | Dashboard Definitions | ui | ✅ Dashboards with widget types: metric, kpi, funnel, line, bar, table |
| 14 | Form Layouts | ui | ✅ Form views with sections, columns, field-level config |
| 23 | Studio extensions | studio | ✅ defineStudioPlugin() adopted |
Remaining High-Impact Gaps
| # | Gap | Module | Impact | Effort |
|---|---|---|---|---|
| 6 | Approval Process Schema — Products approval uses custom code instead of ApprovalProcessSchema | automation | Medium | Medium |
| 10 | Report Definitions — No report metadata despite analytics capabilities | ui | Medium | Medium |
| 11 | Advanced Validation — Cross-field, conditional, async validations partially used but not all validated | data | Medium | Medium |
| 12 | Event Bus Configuration — No event system despite hooks producing events | kernel | Medium | High |
| 13 | Notification Channels — Notification config exists but channel diversity is limited | system | Medium | Medium |
Lower-Priority Gaps (Future Consideration)
| # | Gap | Module | Notes |
|---|---|---|---|
| 15 | Full API endpoint definitions | api | Webhook config adopted; REST/GraphQL remain |
| 16 | Integration connectors | integration | Planned for 2027 (see roadmap) |
| 17 | Caching/storage/search config | system | Cache config adopted; storage/search remain |
| 18 | Compliance config | system | Enterprise requirements |
| 19 | RAG pipeline config | ai | When implementing knowledge base AI |
| 20 | Feature flags | kernel | Edition/tenant feature gating |
| 21 | NLQ (Natural Language Query) | ai | AI-powered data querying |
| 22 | Service contracts | contracts | Typed service interfaces |
Prompt Improvement Recommendations
Based on the gap analysis, the following improvements to the project's AI coding prompts (GitHub Copilot instructions) are recommended:
1. Enforce Schema Validation in Prompts
Current instruction: "All business objects are defined in TypeScript using the ServiceObject interface."
Proposed addition:
- All *.page.ts files MUST import and validate against PageSchema from @objectstack/spec/ui
- All *.view.ts files MUST import and validate against ViewSchema from @objectstack/spec/ui
- All *.workflow.ts files MUST validate against WorkflowRuleSchema from @objectstack/spec/automation
- Plugin definitions MUST use PluginSchema from @objectstack/spec/kernel instead of `any` type
- State machines MUST be defined using StateMachineSchema from @objectstack/spec/automation2. Expand Field Type Guidance
Current instruction: Generic field types mentioned.
Proposed addition:
- Use Field.master_detail() for parent-child relationships where the child cannot exist without the parent (e.g., invoice_line→invoice). This enforces cascade delete and enables Field.summary() rollups on the parent. Use Field.lookup() for optional associations where records are independent.
- Use Field.summary() for rollup/aggregate fields on parent objects
- Use Field.multiselect() when multiple options can be selected
- Use Field.tags() for free-form tagging
- Use Field.location() and Field.address() for geographic data
- Use Field.file() and Field.image() for attachment fields3. Add UI Metadata Guidance
Proposed addition to File Suffix Protocol:
- *.page.ts: Record detail layouts using PageSchema from @objectstack/spec/ui
- *.view.ts: List/grid/kanban views using ViewSchema from @objectstack/spec/ui
- *.dashboard.ts: Dashboard layouts using DashboardSchema from @objectstack/spec/ui
- *.report.ts: Report definitions using ReportSchema from @objectstack/spec/ui
- *.form.ts: Form layouts using FormViewSchema from @objectstack/spec/ui4. Add Security Metadata Guidance
Proposed addition:
- *.permission.ts: Permission sets and field permissions using @objectstack/spec/security
- *.sharing.ts: Sharing rules and territory models using @objectstack/spec/security5. Add Automation Best Practices
Proposed addition:
- Complex status fields SHOULD have a corresponding state machine definition (*.statemachine.ts)
- Approval flows MUST use ApprovalProcessSchema from @objectstack/spec/automation
- Scheduled automations SHOULD use TimeTriggerSchema for schedule configurationMetrics & Methodology
How This Evaluation Was Conducted
- Spec Module Inventory: All 12 exported modules of
@objectstack/specv3.0.0 were cataloged frompackage.jsonexports and their.d.tstype definitions. - Import Analysis: All
from '@objectstack/spec/*'imports across HotCRM's 6 business packages + AI package were collected and categorized. - Pattern Matching: Untyped metadata patterns (plain objects for pages, views, workflows, plugins) were identified by examining file contents against corresponding spec schemas.
- JSON Schema Cross-Reference: The 1,256 JSON schemas in
@objectstack/spec/json-schema/were cross-referenced against HotCRM's metadata usage.
Schema Count by Domain (from json-schema/)
| Domain | Schema Count | Used in HotCRM |
|---|---|---|
| api | 288 | ~5 |
| system | 215 | ~10 |
| ai | 174 | ~20 |
| kernel | 160 | ~8 |
| data | 120 | ~30 |
| integration | 63 | 0 |
| ui | 62 | ~25 |
| automation | 58 | ~12 |
| security | 23 | ~5 |
| studio | 12 | ~3 |
| shared | 16 | 0 |
| qa | 8 | 0 |
| Total | 1,199 | ~118 (~10%) |
Note: v3.0.0 removed the
hub(34 schemas),identity(23 schemas) domains, reducing the total from 1,256 to 1,199.
Zod 4 Compatibility
@objectstack/spec v3.0.0 uses Zod 4.3.6 as its validation engine. The following files in HotCRM import zod directly:
| Package | File | Import Type | Compatible |
|---|---|---|---|
| core | src/zod-helper.ts | import { z } from 'zod' (runtime) | ✅ Yes |
| crm | src/schemas/lead.schema.ts | import { z } from 'zod' (runtime) | ✅ Yes |
| crm | src/system/api.config.ts | import type { z } from 'zod' (type-only) | ✅ Yes |
| crm | src/system/webhook.config.ts | import type { z } from 'zod' (type-only) | ✅ Yes |
| crm | src/system/audit.config.ts | import type { z } from 'zod' (type-only) | ✅ Yes |
| crm | src/validations/cross_field_validations.ts | import type { z } from 'zod' (type-only) | ✅ Yes |
| crm | src/validations/data_quality_rules.ts | import type { z } from 'zod' (type-only) | ✅ Yes |
| products | src/system/cache.config.ts | import type { z } from 'zod' (type-only) | ✅ Yes |
| support | src/system/notification.config.ts | import type { z } from 'zod' (type-only) | ✅ Yes |
Compatibility Status: All 9 files are compatible with Zod 4. Seven use import type (type-only imports that are erased at compile time). The two runtime imports (core/zod-helper.ts and crm/lead.schema.ts) use standard Zod patterns (z.string(), z.object(), z.enum()) that are fully backward-compatible in Zod 4. No migration action is required.
Conclusion
HotCRM has built a solid foundation using @objectstack/spec's metadata system. With Phase 7–8 work, adoption has grown from ~13% to ~25% of available spec capabilities. Key achievements:
- UI metadata fully typed — All page layouts, list views, dashboards, and forms validate against spec schemas using
satisfiesand.parse() - Expanded field types — 22 of 44 field types adopted, including
masterDetail,summary,select({multiple:true}),file,image,location,address - Formal automation schemas — Workflows and state machines validated against spec schemas
- Studio module adopted —
defineStudioPlugin()used for admin extensions - System-level configs — Cache, notification, audit, webhook, and API configurations formally defined
- Security metadata — Permission sets defined via
PermissionSetSchema - Zod 4 compatible — All direct Zod imports confirmed compatible with Zod 4.3.6
The remaining gaps are primarily in integration connectors, report definitions, event bus configuration, and advanced API features. These represent future opportunities as the platform matures.