Skip to content

feat!: move to ObjectStack 19.0.0-next.0 and protocol 19 - #2820

Draft
objectstack-fleet[bot] wants to merge 2 commits into
mainfrom
claude/project-thread-5vw6g9
Draft

objectstack-fleet[bot] wants to merge 2 commits into
mainfrom
claude/project-thread-5vw6g9

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Description

HotCRM moves to ObjectStack 19 (protocol 19). All 24 @objectstack/* packages go from 18.6.0 to 19.0.0-next.0, and the app manifest plus the seven module manifests declare engines.protocol: '^19.0.0-next.0' (from ^18.6.0). An 18.x host refuses this release with OS_PROTOCOL_INCOMPATIBLE, and a 19 host refuses HotCRM 6.6.0 and earlier, so the host and HotCRM upgrade together.

Metadata-impact: maintainer — platform major-version bump
Clause-②: yes
Metadata-protocol: protocol 19

Draft for the maintainer's merge. Do not publish from this PR: a ^19 HotCRM is refused by a marketplace on 18, so staging's control plane and runtime have to be on 19 before publish-staging runs.

Type of Change

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Related Issues

Related to objectstack-ai/cloud#5053 (the cloud half of the ObjectStack 19 move).

Changes Made

  • Dependencies and manifests: package.json and the lockfile move to 19.0.0-next.0, and objectstack.manifest.json plus src/{expense,marketing,o2c,psa,revenue,sales,service}/index.ts now declare ^19.0.0-next.0. The docs test requires the declared range to equal the installed spec version.
  • State machines (state-machine-no-initial-states, now an error): the 12 status state machines declare initialStates, and each one lists every state. Records, imports and integrations can still be created in any state, as on 18.6. Narrowing a list to the first state is a product decision and is not part of this upgrade.
  • Approval lock on lines (objectstack 1e018d6): while an approval is pending, the platform refuses writes to master-detail lines with its own RECORD_LOCKED 409. Its message is "This Opportunity is locked while an approval is in progress, and cannot be edited until that approval is complete". The tests now expect that message, and the hook test still pins HotCRM's sentence. A travel leg's booking reference can no longer be written while its request is pending.
  • Action selection read as the caller (objectstack#36132): the expense-submit test now expects "Record … not found" for an expense the submitter cannot see. That check runs before HotCRM's "not yours" check.
  • Body-table placement: isBodyTableRelationship now takes { placedByGroup }, and the project-budget test follows it.
  • Docs: Setup → Installed Apps was retired for Setup → Packages (系统设置 → 软件包), and the modules and sandbox pages are updated in en, zh-Hans and zh-Hant. whats-new gets a "Next release: ObjectStack 19" callout, and docs/STATUS.md is updated.
  • Changeset: .changeset/v19-objectstack-19-next.md (hotcrm: major).

Testing

Run in a shared container under the verify lock:

  • pnpm validate: green

  • pnpm typecheck: green

  • pnpm hygiene: green

  • pnpm build: green

  • pnpm test: the full run at 9e7bc7f gave 6487 passed, 58 skipped and 26 failed; 20 of the 26 were fixed in that commit, and the 8 affected files now give 182 passed, 6 failed. The 6 left are a framework regression in 19.0.0-next.0, filed as objectstack#37705, not a HotCRM bug: test/flow-record-change.test.ts (lead_assignment). The flow run finishes, then its run-history persist and audit writes fail with knex "Transaction query already complete" (the class of objectstack#22855 / #33651 / #33760). At 03a2647, the 21 test files the lint fixes touch (flows, schedules, skills, i18n, package ownership) pass: 328 passed, 6 skipped.

  • pnpm lint (--strict): red. 0 errors and 201 warnings, down from 1068, all from rules new in 19. 03a2647 clears the mechanical ones:

    • i18n/missing-flow 855 → 0: flow and step names in zh-CN, ja-JP and es-ES, in one translations/flow-steps.ts bundle per package (the platform deep-merges a package's bundles per locale)
    • flow-schedule-timezone-missing 8 → 0: each cron writes timezone: 'UTC', the zone it already fires in
    • ai-skill-tool-unresolved 4 → 0: customer_360, live_data and revenue_forecasting set mcpPrompt: false, since MCP already withholds them because they bind aggregate_data

    Waiting on the maintainer's ruling:

    • security-cross-set-field-reopen 182: a View All or Modify All set reopens a field another set hides or locks. On objectstack main after next.0 those bits stop voting on fields (permission-view-all-fields-beside-record-bypass), so the answer per set is viewAllFields: true or a narrower grant.
    • form-view-internal-not-loaded 14: create and edit no longer load the internal form views. All 14 objects already declare fieldGroups.
    • flow-create-update-pair 5: the *_on_create twins could each fold into one record-after-write flow. That is a refactor across about 59 references, not a rename.

Checklist

  • I have added a changeset
  • Metadata changes under src/ declare their class (Metadata-impact: maintainer — platform major-version bump)
  • English docs changed with their Chinese twins
  • I have performed a self-review of my own code
  • My changes generate no new warnings: see the lint line above
  • Any dependent changes have been merged and published: needs ObjectStack 19 on the staging control plane and runtime first (objectstack-ai/cloud#5067), and objectstack#37705 fixed or a ruling to republish with it known

Additional Notes

Republishing after merge, per docs/RELEASE_STRATEGY.md:

  1. pnpm changeset:version, then set the manifest versions in src/sales/index.ts and the module index files.
  2. Tag v*.*.*. release.yml refuses unconsumed changesets, and publish-staging.yml publishes to cloud.objectos.app.
  3. Run publish-production.yml by manual dispatch, which publishes to cloud.objectos.ai.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Q4EjjPMx1Am3jLCW4Zi8G6

Every @objectstack/* package moves 18.6.0 -> 19.0.0-next.0 and the app
manifest and the seven package manifests declare '^19.0.0-next.0'
(objectstack#37314 moved PROTOCOL_VERSION to 19.0.0; a runtime on 19
refuses '^18.6.0').

What the new platform forces:
- state-machine-no-initial-states (os validate, lint, build): the twelve
  status machines declare initialStates listing every state, so creation
  stays as open as on 18.6.0; narrowing it is its own product decision.
- objectstack 1e018d6: an approval lock now holds the master-detail lines
  too. The opportunity line, time entry and travel leg tests read the
  platform's RECORD_LOCKED refusal; a travel leg's booking reference is
  held while the request is pending (the leg object says so).
- objectstack#36132: an action's selection is read in the caller's scope,
  so another person's expense is "not found" before the body runs.
- isBodyTableRelationship now takes the group placement (placedByGroup).
- Setup -> Installed Apps is retired for Setup -> Packages; the admin docs
  point there. STATUS.md and the what's-new pages state 19.0.0-next.0.

Claude-Session: https://claude.ai/code/session_01Q4EjjPMx1Am3jLCW4Zi8G6
Co-authored-by: Claude <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
hotcrm Ignored Ignored Nov 26, 2026 9:39pm UTC

Request Review

@github-actions github-actions Bot added documentation Improvements or additions to documentation ci/cd CI plumbing and the verification pipeline dependencies Dependency bumps and lockfile changes metadata Declarative metadata — schema, security posture, UI surfaces labels Nov 26, 2026
…n-product skills say so

ObjectStack 19's lint checks flow and node labels per locale (i18n/missing-flow),
a cron with no timezone and a skill bound to a tool no MCP connection serves.
- 855 step names in zh-CN, ja-JP and es-ES, one flow-steps bundle per package.
- The 8 cron schedules write timezone: 'UTC', the zone they already fire in.
- customer_360, live_data and revenue_forecasting set mcpPrompt: false: MCP
  already withholds them because they bind aggregate_data.

Claude-Session: https://claude.ai/code/session_01Q4EjjPMx1Am3jLCW4Zi8G6
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:hotcrm#2 · sunhaolin · session_local397772e87c66479facaebb6d6e03687d

维护者速读

  • 这个 PR 的 CI 有 19 个测试失败,说明里只解释了 6 个,另外 13 个的原因都查清了,列在下面。
  • 其中 10 个只需改三个测试文件,补丁附在第 1 节,已在本分支上实测通过;3 个出自新增的流程步骤翻译包。
  • 分支落后 main 两个提交,合并无冲突、构建通过,但会多出 18 条未翻译的流程名称和 154 条字段权限告警。
  • 差旅申请和管理员手册等几处文档仍在描述 18 的行为,逐条列在第 4 节。

Where this comes from

The same upgrade, main 08a7451 to 19.0.0-next.0, was done independently in a local checkout before this PR was noticed. That work stays local: nothing was pushed and there is no second PR. Comparing the two trees left the points below. Each was measured on this branch at 03a2647, or on a temporary local merge of 03a2647 with main 08a7451 that was not pushed. This comment only reports; nothing was written to this branch.

1. Ten CI failures: three test files still read the 18 shapes

CI at 03a2647 fails 19 tests in 7 files. The description accounts for the six in test/flow-record-change.test.ts. Ten more sit in three test files this PR does not touch:

File Failing What it still reads
test/docs-drift.test.ts 6 the cron as schedule: '<cron>'; the six flows now write schedule: { type: 'cron', expression, timezone }
test/automation-docs-coverage.test.ts 3 config.schedule as the cron string
test/contract-terminal-states.test.ts 1 initialStates: undefined on contract_status_progression; the rule now names every status

With the patch below on 03a2647, vitest run on those three files gives 3 files passed, 60 tests passed. It also applies cleanly after merging main. The contract test keeps the fact it pins, that a contract imported straight into a late state still lands: it now checks that initialStates equals the status option list.

Patch: 3 files, 15 insertions, 12 deletions
diff --git a/test/automation-docs-coverage.test.ts b/test/automation-docs-coverage.test.ts
index 5f96b9d6..551bc721 100644
--- a/test/automation-docs-coverage.test.ts
+++ b/test/automation-docs-coverage.test.ts
@@ -148,7 +148,7 @@ const kindOf = (flow: AnyRec): string => flow.type as string;
 const eventOf = (flow: AnyRec): string | undefined => startOf(flow).config?.triggerType;
 
 /** The cron expression, for scheduled flows. */
-const cronOf = (flow: AnyRec): string | undefined => startOf(flow).config?.schedule;
+const cronOf = (flow: AnyRec): string | undefined => startOf(flow).config?.schedule?.expression;
 
 /**
  * How each page spells a cron. An unregistered cron is a deliberate failure —
diff --git a/test/contract-terminal-states.test.ts b/test/contract-terminal-states.test.ts
index e2b8363b..92c22e7e 100644
--- a/test/contract-terminal-states.test.ts
+++ b/test/contract-terminal-states.test.ts
@@ -28,8 +28,8 @@ import { hotcrmStack, signUpPerson, committedFile, type Person } from './helpers
  *   3. An edit that leaves the status as stored saves on an expired or a
  *      terminated contract, with the status re-sent (as a full form submit
  *      does) or not: the rule judges a status CHANGE, so it freezes no row.
- *   4. A create is not judged (the rule declares no `initialStates`): a
- *      contract imported straight into a late state still lands.
+ *   4. A create is not judged (the rule's `initialStates` name every
+ *      status): a contract imported straight into a late state still lands.
  *
  * The one automated edge, `contract_expiration` (activated → expired, as the
  * system), is pinned where the sweep is: `test/flow-scheduled.test.ts`.
@@ -97,10 +97,13 @@ const REFUSED = [
 ] as const;
 
 describe('the rule is the contract lifecycle’s hold (#2192)', () => {
-  it('blocks, over status, and declares no initial states', () => {
+  it('blocks, over status, and names every status an initial state', () => {
     expect(rule, 'contract_status_progression is not declared on crm_contract').toBeTruthy();
-    expect({ type: rule.type, field: rule.field, severity: rule.severity, initialStates: rule.initialStates })
-      .toEqual({ type: 'state_machine', field: 'status', severity: 'error', initialStates: undefined });
+    expect({ type: rule.type, field: rule.field, severity: rule.severity })
+      .toEqual({ type: 'state_machine', field: 'status', severity: 'error' });
+    // The whole option list, read off the field: a status left out is one an import can no longer land in.
+    const statuses = (Contract.fields.status as Rec).options.map((o: Rec) => o.value);
+    expect([...rule.initialStates].sort()).toEqual([...statuses].sort());
   });
 
   it('refuses each probed move by its own table — the precondition for the cases below', () => {
diff --git a/test/docs-drift.test.ts b/test/docs-drift.test.ts
index 881d8494..858efe4c 100644
--- a/test/docs-drift.test.ts
+++ b/test/docs-drift.test.ts
@@ -235,31 +235,31 @@ const RULES: Rule[] = [
   },
   {
     label: 'stalled-deal sweep schedule',
-    extract: () => cap('opportunity-stagnation.flow.ts', /schedule: '([^']+)'/),
+    extract: () => cap('opportunity-stagnation.flow.ts', /expression: '([^']+)'/),
     display: cronDisplay,
     docs: withZh(SALES_OPPS, ADMIN_KNOBS),
   },
   {
     label: 'quote-expiration sweep schedule',
-    extract: () => cap('quote-expiration.flow.ts', /schedule: '([^']+)'/),
+    extract: () => cap('quote-expiration.flow.ts', /expression: '([^']+)'/),
     display: cronDisplay,
     docs: withZh(QUOTES, ADMIN_KNOBS),
   },
   {
     label: 'case SLA sweep schedule',
-    extract: () => cap('case-sla-monitor.flow.ts', /schedule: '([^']+)'/),
+    extract: () => cap('case-sla-monitor.flow.ts', /expression: '([^']+)'/),
     display: cronDisplay,
     docs: withZh(CASES, ADMIN_KNOBS),
   },
   {
     label: 'contract renewal sweep schedule',
-    extract: () => cap('contract-renewal.flow.ts', /schedule: '([^']+)'/),
+    extract: () => cap('contract-renewal.flow.ts', /expression: '([^']+)'/),
     display: cronDisplay,
     docs: withZh(ADMIN_KNOBS),
   },
   {
     label: 'campaign auto-completion schedule',
-    extract: () => cap('campaign-completion.flow.ts', /schedule: '([^']+)'/),
+    extract: () => cap('campaign-completion.flow.ts', /expression: '([^']+)'/),
     display: cronDisplay,
     docs: withZh(CAMPAIGN_FLOWS),
   },
@@ -295,7 +295,7 @@ const RULES: Rule[] = [
   },
   {
     label: 'contract expiration sweep schedule',
-    extract: () => cap('contract-expiration.flow.ts', /schedule: '([^']+)'/),
+    extract: () => cap('contract-expiration.flow.ts', /expression: '([^']+)'/),
     display: cronDisplay,
     docs: withZh(ADMIN_KNOBS),
   },

2. Three CI failures come from the new translations/flow-steps.ts bundles

Test Why it fails
test/docs-language-matrix.test.ts, "every package registers a pack for each of them, and for no other" The check is per bundle. Each new flow-steps.ts bundle carries zh-CN, ja-JP and es-ES and no en, so it reads [es-ES, ja-JP, zh-CN] against [en, es-ES, ja-JP, zh-CN]. First hit: app.objectstack.hotcrm.service.
test/expense-module.test.ts:190, "its translations and manual name no project object or project flow" anti-phantom: four locale packs counts 7: the four packs plus the three locales of the new bundle.
test/deal-threshold-parity.test.ts:408, "the two amounts appear in source only where they are authored or explained" src/psa/translations/flow-steps.ts spells 100000 in the three check_budget labels (lines 23, 98, 173). The test asks for the constant from src/sales/objects/_thresholds.ts, or for the file in its ALLOWED list with the reason.

There is no patch for these three: the local tree has no such bundles.

3. Two commits behind main

main moved by #2823 and #2819 since the merge base fb8edeb. The merge is conflict-free. On the merged tree:

Step Result
pnpm validate exit 0
pnpm typecheck exit 0
pnpm build exit 0
pnpm lint exit 1: 373 warnings, against 201 at 03a2647
pnpm test, with the patch from section 1 9 failed, 6547 passed, 58 skipped; 4 of 341 files failed

The nine are the six of objectstack-ai/objectstack#37705 and the three of section 2. Nothing else is red.

The 172 extra lint warnings:

4. Docs that still describe 18

  • Travel legs. The changeset and test/expense-request-line.test.ts say a leg's booking reference is refused with 409 RECORD_LOCKED while the request is pending. These still say it takes a value from submission on, with no such exception: content/docs/(product)/expenses/travel-requests.mdx:71 ("The Booking Reference of each leg stays open.") and line 71 of its zh-Hans and zh-Hant twins; the in-app manual src/expense/docs/crm_expense_travel_request.md:107-109 ("from the moment you submit ... only the Booking Reference still takes a value") and crm_expense_travel_request.zh.md:27 and :64.
  • In-app Admin Manual, "Turning a module off". src/docs/crm_admin_access.md:122-126 and src/docs/crm_admin_access.zh.md:59 still say that no menu entry opens the Packages page, name Setup → Installed Apps, and send the administrator to the URL. The public modules.mdx was updated; this manual was not.
  • Menu path. modules.mdx:23, sandbox-and-releases.mdx:105 and the changeset say Setup → Packages. On a running 19.0.0-next.0 console, Packages sits in the Setup sidebar group Apps (应用 → 软件包 in the zh-CN interface). In the group-then-item form the other pages use, for example "Setup → Access Control → Queue Members", that is Setup → Apps → Packages. HotCRM is one row there, marked "6 modules", so the modules show only after the row is expanded. modules.mdx:25 still tells the administrator to open the URL and then "opens the module".
  • Old pin. docs/architecture/psa-module-plan.md:84 (engines.protocol ^18.6.0) and docs/MAINTENANCE.md:58 (example ^18.6.0). docs/architecture/module-split-plan.md:692 still names Setup → Installed Apps.
  • Schedule quote. content/docs/(product)/sales/quotes.mdx:179 quotes the source as schedule: '0 1 * * *'. The flow now reads schedule: { type: 'cron', expression: '0 1 * * *', timezone: 'UTC' }. The pages that give an hour (quotes.mdx:80 "every night at 1 AM", automation.mdx:105 "daily 3 AM") name no zone, while the flows now state UTC.
  • Skills. content/docs/(intelligence)/ai-copilot/connect-your-agent.mdx:20 lists "its skills" among what HotCRM adds for a connected agent, with no qualifier. Three of the eight skills (customer_360, live_data, revenue_forecasting) now set mcpPrompt: false.

5. Platform

The six test/flow-record-change.test.ts failures are objectstack-ai/objectstack#37705, as the description says. That issue is closed by objectstack-ai/objectstack#37742, which is merged. No published version carries the fix yet: the dist-tags of @objectstack/spec are latest: 18.6.0 and next: 19.0.0-next.0. #2822 tracks the release check.

Not covered

  • pnpm hygiene and the Playwright e2e suite were not run on the merged tree.
  • A module Disable and Enable round trip on 19 was not exercised.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Server-side behaviour — hooks, flows, actions ci/cd CI plumbing and the verification pipeline dependencies Dependency bumps and lockfile changes documentation Improvements or additions to documentation metadata Declarative metadata — schema, security posture, UI surfaces

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant