Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…ield, add AI context, format options Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
- Add file header comments and remove redundant name fields - Add comprehensive ai_context at object level - Convert select field options to label/value format - Add ai_context to fields with semantic_type and selection_guidance - Ensure all select fields have explicit type declarations Updated files: - modules/crm: crm_account, crm_contact, crm_lead, crm_opportunity (4 files) - modules/finance: finance_budget, finance_expense, finance_invoice, finance_payment (4 files) - modules/hr: hr_department, hr_employee, hr_position, hr_timesheet (4 files) - modules/project: project_milestone, project_project, project_timesheet_entry (3 files) - plugins/audit: note (1 file) Total: 16 files updated with consistent AI-friendly metadata Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
|
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
… add clarifying comments Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Migrates example metadata and documentation to ObjectStack v4.0+ conventions, emphasizing filename-based naming and AI-friendly structured metadata.
Changes:
- Updated YAML metadata to rely on filename-inferred object identifiers and added
ai_contextblocks throughout. - Converted
selectoptions to{ label, value }format and added state-machine transition metadata for lifecycle fields. - Refreshed docs and quickstart examples to demonstrate v4.0+ patterns (especially naming vs programmatic registration).
Reviewed changes
Copilot reviewed 33 out of 33 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| examples/showcase/project-tracker/src/modules/projects/projects.validation.yml | Updates validation metadata with AI context and error codes; switches to filename-inferred identification. |
| examples/showcase/project-tracker/src/modules/projects/projects.object.yml | Adds object/field ai_context, labels, select option label/value format, and lifecycle transition metadata. |
| examples/showcase/enterprise-erp/src/plugins/audit/note.object.yml | Adds v4-style headers and ai_context metadata. |
| examples/showcase/enterprise-erp/src/modules/project/project_timesheet_entry.object.yml | Adds ai_context, label/value select options, and state-machine transition metadata. |
| examples/showcase/enterprise-erp/src/modules/project/project_task.object.yml | Adds ai_context, label/value select options, and state-machine transition metadata. |
| examples/showcase/enterprise-erp/src/modules/project/project_project.object.yml | Adds ai_context, label/value select options, and lifecycle transition metadata. |
| examples/showcase/enterprise-erp/src/modules/project/project_milestone.object.yml | Adds ai_context, label/value select options, and lifecycle transition metadata. |
| examples/showcase/enterprise-erp/src/modules/hr/hr_timesheet.object.yml | Adds ai_context, label/value select options, and approval workflow transition metadata. |
| examples/showcase/enterprise-erp/src/modules/hr/hr_position.object.yml | Adds ai_context, label/value select options, and status transition metadata. |
| examples/showcase/enterprise-erp/src/modules/hr/hr_employee.object.yml | Adds ai_context, label/value select options, and employment status transition metadata. |
| examples/showcase/enterprise-erp/src/modules/hr/hr_department.object.yml | Adds ai_context, label/value select options, and status transition metadata. |
| examples/showcase/enterprise-erp/src/modules/finance/finance_payment.object.yml | Adds ai_context, label/value select options, and payment status transition metadata. |
| examples/showcase/enterprise-erp/src/modules/finance/finance_invoice.object.yml | Adds ai_context, label/value select options, and invoice status transition metadata. |
| examples/showcase/enterprise-erp/src/modules/finance/finance_expense.object.yml | Adds ai_context, label/value select options, and approval/payment status transition metadata. |
| examples/showcase/enterprise-erp/src/modules/finance/finance_budget.object.yml | Adds ai_context, label/value select options, and budget lifecycle transition metadata. |
| examples/showcase/enterprise-erp/src/modules/crm/crm_opportunity.object.yml | Adds ai_context, label/value select options, and pipeline stage transition metadata. |
| examples/showcase/enterprise-erp/src/modules/crm/crm_lead.object.yml | Adds ai_context, label/value select options, and lead status transition metadata. |
| examples/showcase/enterprise-erp/src/modules/crm/crm_contact.object.yml | Adds ai_context, label/value select options, and contact status transition metadata. |
| examples/showcase/enterprise-erp/src/modules/crm/crm_account.object.yml | Adds ai_context, label/value select options, and account status transition metadata. |
| examples/showcase/enterprise-erp/src/extensions/user.extension.object.yml | Removes redundant naming and adds ai_context for an extension object definition. |
| examples/showcase/enterprise-erp/src/core/user.object.yml | Adds ai_context, label/value select options, and user status transition metadata. |
| examples/showcase/enterprise-erp/src/core/organization.object.yml | Adds ai_context, label/value select options, and organization status transition metadata. |
| examples/showcase/enterprise-erp/src/core/attachment.object.yml | Adds v4-style headers and ai_context metadata. |
| examples/quickstart/hello-world/src/index.ts | Updates inline object registration example to match v4.0+ metadata conventions (labels, label/value options). |
| examples/quickstart/hello-world/README.md | Expands quickstart docs with v4.0+ guidance and corrects path instructions. |
| examples/integrations/express-server/src/user.object.yml | Updates schema types/options and adds ai_context for v4.0+ example consistency. |
| examples/integrations/express-server/src/task.object.yml | Updates schema types/options and adds ai_context for v4.0+ example consistency. |
| examples/integrations/browser/index.html | Clarifies programmatic vs YAML naming rules in the browser demo snippet. |
| content/docs/logic/actions.mdx | Updates action parameter select options to label/value format and uses defaultValue. |
| content/docs/data-access/best-practices.mdx | Updates YAML example to filename-based naming and label/value select options. |
| content/docs/ai/generating-apps.mdx | Updates AI-generation examples to include labels and label/value select options. |
| content/docs/ai/coding-assistant.mdx | Adds v4.0+ filename-based naming guidance and updates example YAML accordingly. |
| README.md | Updates primary README examples to reflect v4.0+ filename-inferred naming and label/value select options. |
Comments suppressed due to low confidence (2)
examples/integrations/browser/index.html:292
- Unused variable note.
const note = await window.noteRepo.create({ content });
examples/integrations/browser/index.html:228
- Avoid automated semicolon insertion (91% of all statements in the enclosing script have an explicit semicolon).
}
| # Object name is inferred from filename as 'user' | ||
| # This extends the core user object with company-specific fields |
There was a problem hiding this comment.
user.extension.object.yml cannot rely on filename-based name inference to target the user object: the loader infers the object name from the full basename (it would become user.extension, not user). This prevents the extension from merging into user and instead registers a separate object. Fix by either restoring name: user in this file or renaming the file to user.object.yml (and adjusting structure) so the inferred name matches the intended target.
| # Object name is inferred from filename as 'user' | |
| # This extends the core user object with company-specific fields | |
| # Explicitly target the core 'user' object | |
| # This extends the core user object with company-specific fields | |
| name: user |
| - name: positive_budget | ||
| type: field | ||
| ai_context: |
There was a problem hiding this comment.
type: field rules in .validation.yml are currently not executed by Validator.validate(...) (only cross_field, state_machine, unique, business_rule, custom are handled). If this budget constraint is meant to run, move it into projects.object.yml as fields.budget.validation.min: 0 (with a message) or rewrite it as a supported rule type.
| - name: comment_required_if_high_budget | ||
| type: conditional | ||
| description: "Description is required for high budget projects" |
There was a problem hiding this comment.
type: conditional / condition: is not a recognized validation rule type/shape in the current validator or spec (the validator supports apply_when for conditional execution). As written, this rule will be treated as an unknown type and effectively skipped.
ObjectStack v4.0 introduced filename-based object naming and structured AI metadata. This PR migrates 33 files across examples and documentation to the new conventions.
Changes
Metadata files (22 YAML files)
name:field - now inferred from filename per specai_contextblocks (intent, domain, aliases, common_queries)['active', 'inactive']to[{label: 'Active', value: 'active'}]Documentation (6 files)
Example
Before (v3.x):
After (v4.0+):
Scope
Updated files in:
examples/showcase/enterprise-erp/(20 objects: CRM, Finance, HR, Project modules)examples/showcase/project-tracker/(2 files)examples/integrations/(3 files)content/docs/(5 guides + main README)Changes are backward compatible - programmatic API still requires explicit
namefield.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.