-
Notifications
You must be signed in to change notification settings - Fork 0
Add AI workflow automation and predictive analytics protocols #83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
…alytics Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
|
This PR is very large. Consider breaking it into smaller PRs for easier review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces AI workflow automation and predictive analytics protocol schemas to the ObjectStack spec, with matching JSON Schemas, documentation, and tests. It extends the AI surface area to support intelligent workflows (triggers, tasks, post-actions) and ML model definitions (features, training, evaluation, drift, prediction IO).
Changes:
- Added
AIWorkflowAutomationprotocol schemas, batch/execution result types, re-exports, and comprehensive scenario-based tests. - Added
PredictiveModel/ predictive analytics schemas (features, hyperparameters, training, metrics, prediction request/response, drift), plus exhaustive tests. - Generated and wired corresponding JSON Schema definitions and MDX reference documentation for all new AI protocol components.
Reviewed changes
Copilot reviewed 41 out of 41 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
packages/spec/src/ai/workflow-automation.zod.ts |
Defines Zod-first schemas and inferred types for AI workflow triggers, tasks, schedules, post-actions, workflow definition, batch execution, and execution results. |
packages/spec/src/ai/workflow-automation.test.ts |
Adds extensive Vitest coverage for workflow automation schemas, including edge cases and real-world workflows. |
packages/spec/src/ai/predictive.zod.ts |
Defines Zod schemas and inferred types for predictive model types, features, hyperparameters, training config, evaluation metrics, model definition, prediction IO, and drift detection. |
packages/spec/src/ai/predictive.test.ts |
Provides broad test coverage for predictive schemas across model types and realistic ML use cases. |
packages/spec/src/ai/index.ts |
Re-exports new workflow automation and predictive analytics schemas from the AI module entrypoint. |
packages/spec/json-schema/WorkflowSchedule.json |
JSON Schema for WorkflowSchedule, mirroring the schedule Zod schema used by AI workflows. |
packages/spec/json-schema/WorkflowFieldCondition.json |
JSON Schema for WorkflowFieldCondition, used to constrain field_changed workflow triggers. |
packages/spec/json-schema/TrainingConfig.json |
JSON Schema for TrainingConfig, representing training data splits, strategy, and resource limits. |
packages/spec/json-schema/PredictiveModelType.json |
JSON Schema enum for predictive model types (classification, regression, etc.). |
packages/spec/json-schema/PredictiveModel.json |
JSON Schema for PredictiveModel, aligning with the predictive model Zod schema. |
packages/spec/json-schema/PredictionResult.json |
JSON Schema for PredictionResult; currently treats prediction as optional, unlike the Zod schema (see comment). |
packages/spec/json-schema/PredictionRequest.json |
JSON Schema for PredictionRequest, describing model name, record IDs, direct input data, and return flags. |
packages/spec/json-schema/PostProcessingAction.json |
JSON Schema for PostProcessingAction, used in AI workflow post-action definitions. |
packages/spec/json-schema/ModelFeature.json |
JSON Schema for ModelFeature, capturing feature identity, source, type, and transformation. |
packages/spec/json-schema/ModelDrift.json |
JSON Schema for ModelDrift, mirroring drift detection configuration/result schema. |
packages/spec/json-schema/Hyperparameters.json |
JSON Schema for Hyperparameters, covering general, tree-based, NN, clustering, and time-series params. |
packages/spec/json-schema/EvaluationMetrics.json |
JSON Schema for EvaluationMetrics, including classification, regression, clustering, and time-series metrics. |
packages/spec/json-schema/BatchAIWorkflowExecution.json |
JSON Schema for BatchAIWorkflowExecution, specifying workflow name, record IDs, and batch options. |
packages/spec/json-schema/AIWorkflowTrigger.json |
JSON Schema enum for AIWorkflowTrigger values. |
packages/spec/json-schema/AIWorkflowExecutionResult.json |
JSON Schema for AIWorkflowExecutionResult, describing workflow run outcome and per-task results. |
packages/spec/json-schema/AIWorkflowAutomation.json |
JSON Schema for AIWorkflowAutomation, matching the workflow automation Zod schema. |
packages/spec/json-schema/AITaskType.json |
JSON Schema enum for AITaskType values. |
packages/spec/json-schema/AITask.json |
JSON Schema for AITask, reflecting the AI task Zod schema structure. |
content/docs/references/ai/WorkflowSchedule.mdx |
MDX reference doc for WorkflowSchedule, detailing schedule fields used by AI workflows. |
content/docs/references/ai/WorkflowFieldCondition.mdx |
MDX reference doc for WorkflowFieldCondition, describing field-based trigger conditions. |
content/docs/references/ai/TrainingConfig.mdx |
MDX reference doc for TrainingConfig, documenting training strategy and split fields. |
content/docs/references/ai/PredictiveModelType.mdx |
MDX listing the allowed PredictiveModelType enum values. |
content/docs/references/ai/PredictiveModel.mdx |
MDX reference for PredictiveModel, summarizing all model configuration properties. |
content/docs/references/ai/PredictionResult.mdx |
MDX doc for PredictionResult; currently documents prediction as optional, diverging from the Zod schema. |
content/docs/references/ai/PredictionRequest.mdx |
MDX reference for PredictionRequest, documenting request fields and semantics. |
content/docs/references/ai/PostProcessingAction.mdx |
MDX reference for PostProcessingAction, describing action types and configuration. |
content/docs/references/ai/ModelFeature.mdx |
MDX reference for ModelFeature, documenting feature identity, type, and transformation. |
content/docs/references/ai/ModelDrift.mdx |
MDX reference for ModelDrift, explaining drift types, severity, and metrics. |
content/docs/references/ai/Hyperparameters.mdx |
MDX reference for Hyperparameters, covering standard ML hyperparameter fields. |
content/docs/references/ai/EvaluationMetrics.mdx |
MDX reference for EvaluationMetrics, listing supported metric fields. |
content/docs/references/ai/BatchAIWorkflowExecution.mdx |
MDX reference for BatchAIWorkflowExecution, documenting batch execution options. |
content/docs/references/ai/AIWorkflowTrigger.mdx |
MDX listing allowed AIWorkflowTrigger values. |
content/docs/references/ai/AIWorkflowExecutionResult.mdx |
MDX reference for AIWorkflowExecutionResult, summarizing workflow run result properties. |
content/docs/references/ai/AIWorkflowAutomation.mdx |
MDX reference for AIWorkflowAutomation, documenting workflow identity, triggers, tasks, and options. |
content/docs/references/ai/AITaskType.mdx |
MDX listing allowed AITaskType values. |
content/docs/references/ai/AITask.mdx |
MDX reference for AITask, describing task configuration fields. |
content/docs/references/ai/WorkflowSchedule.mdx |
MDX reference for WorkflowSchedule, used by AIWorkflow docs. |
content/docs/references/ai/WorkflowFieldCondition.mdx |
MDX reference for workflow field conditions (used in AI workflows). |
| export const PredictionResultSchema = z.object({ | ||
| modelName: z.string(), | ||
| modelVersion: z.string(), | ||
| recordId: z.string().optional(), | ||
| prediction: z.any().describe('The predicted value'), | ||
| confidence: z.number().optional().describe('Confidence score (0-1)'), |
Copilot
AI
Jan 23, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PredictionResultSchema currently requires prediction (z.any()) at the Zod level, but the generated JSON Schema (PredictionResult.json) and MDX docs (PredictionResult.mdx) treat prediction as optional (not listed in required and documented without the required checkmark). This discrepancy means CLI/runtime validation and JSON-schema–driven tooling/IDE hints will disagree on whether prediction must be present. Consider aligning these by either making prediction optional in the Zod schema or marking it as required in the JSON schema/docs, depending on the intended contract for prediction results.
Adds two AI protocol specifications to enable intelligent automation and ML-powered decision making in ObjectStack applications.
AI Workflow Automation (
ai/workflow-automation.zod.ts)Core capabilities:
Example usage:
Predictive Analytics (
ai/predictive.zod.ts)Model types: classification, regression, clustering, forecasting, anomaly_detection, recommendation, ranking
Features:
Example usage:
Technical notes
Featureschema by usingModelFeatureOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.