Skip to content

Align metadata files and documentation with ObjectStack v4.0+ specification#198

Merged
hotlong merged 5 commits intomainfrom
copilot/update-code-documentation-examples
Jan 25, 2026
Merged

Align metadata files and documentation with ObjectStack v4.0+ specification#198
hotlong merged 5 commits intomainfrom
copilot/update-code-documentation-examples

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 25, 2026

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)

  • Remove redundant name: field - now inferred from filename per spec
  • Add ai_context blocks (intent, domain, aliases, common_queries)
  • Convert select options from ['active', 'inactive'] to [{label: 'Active', value: 'active'}]
  • Add state machine transitions to status fields
  • Add semantic types to relationship fields (hierarchy, ownership, association)

Documentation (6 files)

  • Update code examples to show v4.0+ patterns
  • Add clarifying comments distinguishing programmatic vs YAML-based naming

Example

Before (v3.x):

name: user
fields:
  status:
    type: select
    options: [active, inactive]

After (v4.0+):

# File: user.object.yml
# Object name inferred as 'user'
fields:
  status:
    type: select
    options:
      - label: Active
        value: active
      - label: Inactive
        value: inactive
    ai_context:
      is_state_machine: true
      transitions:
        active: [inactive]
        inactive: [active]

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 name field.

Original prompt

按照最新的objectstack规范更新所有的代码文档和例子


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@vercel
Copy link
Copy Markdown

vercel Bot commented Jan 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
objectql-site Ready Ready Preview, Comment Jan 25, 2026 9:40am

Request Review

…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>
@github-actions
Copy link
Copy Markdown
Contributor

⚠️ No Changeset Found

This PR does not include a changeset file.
If this PR includes user-facing changes, please add a changeset by running:

pnpm changeset

Copilot AI and others added 2 commits January 25, 2026 09:37
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
… add clarifying comments

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot AI changed the title [WIP] Update code documentation and examples for objectstack standard Align metadata files and documentation with ObjectStack v4.0+ specification Jan 25, 2026
Copilot AI requested a review from hotlong January 25, 2026 09:43
@hotlong hotlong marked this pull request as ready for review January 25, 2026 09:51
Copilot AI review requested due to automatic review settings January 25, 2026 09:51
@hotlong hotlong merged commit 45fea83 into main Jan 25, 2026
3 checks passed
@hotlong hotlong deleted the copilot/update-code-documentation-examples branch January 25, 2026 09:51
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_context blocks throughout.
  • Converted select options 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).
        }

Comment on lines +2 to 3
# Object name is inferred from filename as 'user'
# This extends the core user object with company-specific fields
Copy link

Copilot AI Jan 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
# 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

Copilot uses AI. Check for mistakes.
Comment on lines 19 to +21
- name: positive_budget
type: field
ai_context:
Copy link

Copilot AI Jan 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines 31 to 33
- name: comment_required_if_high_budget
type: conditional
description: "Description is required for high budget projects"
Copy link

Copilot AI Jan 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants