Skip to content

cli: os migrate summary-nulls refuses to boot an app that declares queues and assignmentRules ("no 'ownership-queue' service is registered"), so the summary backfill cannot run on a queue-using app #33608

Closed

Description

@objectstack-fleet

repo:hotcrm#1 · huangyiirene · session_01J8VVAnPkgK6CWrJa6t7Fk5

What happens (@objectstack 18.4.0, HotCRM, 2026-11-15)

HotCRM 1b (hotcrm#2464) adds summary fields to crm_contract and crm_account through objectExtensions. A summary declared after its parent rows exist reads blank on those rows until a child row is written, and os migrate summary-nulls is the documented backfill. Run against the HotCRM stack, it refuses to boot:

declares queues (2) and assignmentRules (2), but no 'ownership-queue' service is registered

HotCRM adopted ADR-0142 queues (hotcrm#2402). os serve registers the ownership-queue service, but the migrate command's boot does not. So any app that uses queues cannot run the summary backfill.

Ask

The os migrate boot registers the services that the stack's declared metadata needs (here ownership-queue), or treats queue and assignment-rule metadata as inert for a data migration. Either way, os migrate summary-nulls must run on a queue-using app.

Acceptance

  1. os migrate summary-nulls (preview and apply) runs on a stack that declares queues and assignmentRules, and fills the new summaries on existing parent rows.
  2. Other os migrate subcommands that boot the stack get the same fix, or each is shown not to need it.
  3. A regression test boots a fixture app with one queue and one assignment rule through the migrate path.

Activity

  1. objectstack-fleet commented on Nov 15, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Path: none

    Triage: first touch → domain:server · lease:A5 · p2 · 2026-11-15T02:45Z

    ⛔ Not a claim.

    os migrate summary-nulls refuses to boot an app that declares queues and assignment rules, so the documented summary backfill cannot run on HotCRM (hotcrm#2464). The pre-grade p2 is confirmed: a real user is blocked, with no data loss. A5 (cli).

  2. added
    bug
    domain:server
    pm:queue
    on Nov 15, 2026
  3. objectstack-fleet commented on Nov 15, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#5 · zhuangjianguo · session_01QsR2jTEivi2wogPpeo3xd5

    Claim: server area-lease mode (#33751 §2), area S3 lease A5, dispatched by seat domain:server#5 area thread · executed by an os-dev sub-agent (mode:subagent) · posted at 2026-11-15T09:22Z
    Session: session_01QsR2jTEivi2wogPpeo3xd5
    Account: zhuangjianguo
    Branch: claude/area-A5-33608
    Worktree: objectstack-issue-33608
    Domain: domain:server
    Seat: domain:server#5
    File surface: packages/cli/src/commands/migrate/** boot path, packages/cli/src/utils/** migrate boot helpers, their tests, a changeset (stop on breach; explain in the report)
    Container & model: M, mode:subagent, model: default (no path-derived mandate; dispatch-gates --tier at bd96ec9c), effort: high
    Clause-②: no
    Metadata-protocol: none
    Responsibility: objectstack cli: the os migrate boot omits the ownership-queue service os serve registers | none | every queue-using app's operator running os migrate summary-nulls (HotCRM, hotcrm#2464)
    Thread-read: 6888132974
    Premise: holds
    Serial constraints cleared: PR #33675 (os-elon-musk, cli migrate audit-* files + utils/audit-seal-lock.ts): not edited


    Generated by Claude Code

  4. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 15, 2026
  5. objectstack-fleet commented on Nov 15, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#5 · zhuangjianguo · session_01QsR2jTEivi2wogPpeo3xd5
    os-dev-report

    {
     "issue": 33608,
     "status": "done",
     "branch": "claude/area-A5-33608",
     "pr": "https://github.com/objectstack-ai/objectstack/pull/33879",
     "head_sha": "52306356d",
     "session": "session_01QsR2jTEivi2wogPpeo3xd5",
     "premise_still_valid": true,
     "summary": "Every os migrate subcommand that boots the stack goes through bootSchemaStack (packages/cli/src/utils/schema-migrate.ts). Only the served-platform composition (plan, apply, unmapped-columns, organization-ownership, stored-references) carried the sharing provider, so on a stack declaring queues or assignmentRules every other subcommand hit the engine's kernel:ready refusal. bootSchemaStack now adds one small plugin (packages/cli/src/utils/migrate-ownership-queue.ts) when no composed plugin provides the sharing capability. Its init() registers an OwnershipQueueService under OWNERSHIP_QUEUE_SERVICE and does nothing else: no sharing objects, no start(), no hooks. A regression test runs os migrate summary-nulls (dry run, apply, re-run) on a fixture app with one queue and one assignment rule, and boots each of the four compositions.",
     "hypotheses": {
      "H1": "Holds. The thrower is packages/objectql/src/plugin.ts:724-738 (assertOwnershipQueueServicePresent), called from its kernel:ready hook at plugin.ts:1257; the text comes from describeMissingOwnershipQueueService at packages/objectql/src/assignment-rules.ts:738-754. os serve satisfies it because 'sharing' is on PLATFORM_ALWAYS_ON_CAPABILITIES (packages/spec/src/kernel/platform-capabilities.ts:372), and SharingServicePlugin.init() registers the service (packages/plugins/plugin-sharing/src/sharing-plugin.ts:770). The migrate boot is bootSchemaStack: stack.plugins, then the composition, then extraPlugins (schema-migrate.ts:1442-1451 at base). For the data family the extra plugins come from buildDataMigrationPlugins (packages/cli/src/utils/data-migration-plugins.ts), which has no sharing provider. The ablation reproduces the card's refusal text.",
      "H2": "Half holds. Every booting subcommand shares ONE boot helper, bootSchemaStack, but in four plugin compositions. (1) buildDataMigrationPlugins, which refused before: summary-nulls, value-shapes, recorded-by, resume, option-codes, blank-single-values, blank-multi-values, text-scalars, stored-expressions, record-currency-codes, recompute-home-amounts, files-to-references, meta --stored, activity-changed-fields, comment-parent-pair, comment-reactions and the four audit-* subcommands. (2) The plain data stack, which refused: account-issuer, duplicates, multi-value-columns. (3) The host composition, which refused: packageless-overlays, security-catalog-overlays. (4) The served platform, which already composed sharing and booted: plan (and bare os migrate), apply, unmapped-columns, organization-ownership, stored-references, stored-references bind. meta without --stored boots nothing. The fix sits in bootSchemaStack, so one change covers all of them, and the non-migrate bootSchemaStack callers too."
     },
     "route_and_four_axes": "The suggested first arm was measured first: composeProviderForDeclarations(new SharingServicePlugin()) in bootSchemaStack (commit a255c3ce7). That plugin's init() also declares the sharing objects. Every one-shot boot then examined more tables, and two integration pins went red: schema-migrate.host-composition.integration.test.ts 'still examines exactly the data-stack tables and composes nothing', and data-commands.absent-database.integration.test.ts 'value-shapes --json walks the stored record, exit 0'. An --apply boot would also have created any missing sharing tables. That arm is the side-effect case the dispatch named, so the landed route is the first arm narrowed to the service alone (09686a587). Option B, the full provider for its declarations, scored as follows. Business need: unblocks HotCRM. Long-term: the most faithful mirror, but it moves the object set of every one-shot boot and adds DDL that rides along on apply. AI-error: neutral. Startup focus: widest. Option C, the service alone, which landed. Business need: unblocks HotCRM; the summary backfill only updates rows, so routing never runs. Long-term: cli-only; the registered service is the real class and the engine check stays strict; the cost is a 6-line copy of the SharingServicePlugin.init() construction, named in a comment. AI-error: no stub and no inert mode, so a declared queue is served truthfully, and the refusal still guards every serving composition. Startup focus: smallest. Option D, treating the metadata as inert: it needs an objectql option, which is outside the cli surface (needs_area), and it would weaken a strict boot check. Rejected. Long-term carries the most weight and favours C over B, because B changes calibrated baselines for every app to unblock one class.",
     "tests": "Final head 52306356d differs from 5878b6074 only in the changeset text. At 5878b6074: pnpm --filter @objectstack/cli typecheck exit 0 (check:test-typecheck: OK). vitest run on summary-nulls.ownership-queue.integration.test.ts + migrate-ownership-queue.test.ts + test/vitest-tiers-partition.test.ts: Test Files 3 passed (3), Tests 29 passed (29). At 6738e859e (the merge of origin/main; later commits touch only these two test files and the changeset): full cli unit tier Test Files 422 passed (422), Tests 6003 passed (6003); full cli integration tier, run locally because the diff changes the one-shot boot path, Test Files 222 passed | 2 skipped (224), Tests 2021 passed | 10 skipped (2031). pnpm lint exit 0. Ablations, all landed through scripts/ablation-replace.mjs, each restored with git diff HEAD empty. (1) The provider is never used: the integration file goes red in its fixture boot with the card's refusal '[ObjectQLPlugin] the stack declares queues (1) and assignmentRules (1), but no ownership-queue service is registered' (Tests 5 skipped). (2) The already-composed guard is disabled: Tests 3 failed | 5 passed (8). The unit case reads 'expected SharingServicePlugin to be null'; the served-platform case reads \"[Kernel] Service 'ownership-queue' already registered\", which also proves plan/apply registered it before. (3) First design, declarations wrapper removed: the unit case goes red because the hook was called. No dist ablation was needed: the subject resolves to cli src, and plugin-sharing is aliased to src in vitest.config.ts.",
     "gates": "dispatch-gates --commands --repo objectstack-ai/objectstack gave 68 commands at 6738e859e; the list was identical at c7af1ee3. All 68 ran and 64 exited 0. check:test-source-alias was exit 1 (a real finding: both new test files lacked module-top imports). Fixed at 5878b6074, and the re-run exits 0. check:type-check-debt was exit 3 in the sweep (no lock turn); re-run under the lock at 5878b6074 it exits 0 ('--re-measure: OK, none above its recorded number'). check:dual-build-cjs-loads: NOT MEASURED, exit 3 PREREQUISITE NOT MET, because it needs every package built. check:i18n-coverage: NOT MEASURED, exit 3, partial lint round, nothing compared. Both are CI's. check-plugin-teardown-shape --self-test needed a pinned fixture commit that the shallow clone lacked; after fetching that one object it exits 0. Re-run at 5878b6074, all exit 0: cross-package-test-inputs, nul-bytes, tier-file-adoption, undeclared-dep-imports, issue-citations, doc-authoring, startup-registry-verdict, type-check-coverage. Changeset and PR-body gates at 52306356d, all exit 0: check-changeset-no-major, check-adr-0087-registration, check-empty-changeset, check-closing-keyword-parity, check-partof-closing-keyword, check:doc-authoring. CI check-runs on 5878b6074 at report time: Check Changeset, Lint (all lanes), Type Check (all lanes), Governed Surface Queue Guard and PR-body guards were all in_progress or queued; skipped-by-design: Borrowed queue verdict, Queue verdict, Packed-tarball smoke, 18.x upgrade harness, Schedule gate.",
     "dogfood_battery": "n/a: the PR title has no exclamation mark and Clause-2 is 'no' with no (narrowing) arm",
     "files_changed": [
      ".changeset/33608-migrate-ownership-queue.md",
      "packages/cli/src/utils/migrate-ownership-queue.ts",
      "packages/cli/src/utils/schema-migrate.ts",
      "packages/cli/src/utils/migrate-ownership-queue.test.ts",
      "packages/cli/src/commands/migrate/summary-nulls.ownership-queue.integration.test.ts"
     ],
     "line_budget": "+437 / -0 across 5 files vs origin/main: source 89 (74 helper + 15 boot), tests 332, changeset 16; no skills/** and no governed surface",
     "deviations": [
      "PR body readings name head 5878b6074. Commit 52306356d then rewrote only the changeset paragraph, because the first changeset text still described the dropped declarations-only design. A dev may not PATCH the body. Suggested seat amendment: append to Verification 'Head 52306356d changes only the changeset text; changeset gates re-run there exit 0.'",
      "PR body opens with the harness attribution HTML-comment line that the dispatch's dev-common ordered; it was left as written.",
      "Commit trailers use the model-free pair dev-common names (Co-Authored-By: Claude), not the model-named form of the harness reminder.",
      "To run check-plugin-teardown-shape --self-test, one commit object (621a487607881c66b2899b7e3477115229a156b4) was fetched into the shared object store; nothing else was fetched or deepened.",
      "test:repo (vitest repo project) was not run locally: CI's Test Core runs it, and the diff touches no file in it."
     ],
     "mcp_calls": "0",
     "api_writes": "2: (1) the pr_create stroke through the fleet-write relay (POST /repos/objectstack-ai/objectstack/dispatches, run 43717855450, which created PR 33879); (2) this os-dev-report comment through scripts/pm/post-stamped.mjs (POST /repos/objectstack-ai/objectstack/issues/33608/comments). git push is not counted.",
     "open_questions": [],
     "security_findings": "none",
     "out_of_scope_findings": [
      "carrier: none · noted, not filed. plugin-sharing offers no service-only composition of the ownership-queue service, so cli copies the six-line construction from SharingServicePlugin.init(). If that construction gains options, the copy drifts silently. A factory exported by plugin-sharing would hold it in one place, but that is outside this cli surface. Dedupe words: ownership-queue service factory, SharingServicePlugin init copy, migration boot sharing.",
      "carrier: none · noted, not filed. On a one-shot boot the service cannot read authored queues or members (sys_queue / sys_queue_member are not registered objects there). It warns once and answers from declarations. Only an insert-routing migration would notice, and none of today's migrate subcommands inserts into an object that carries assignment rules. Recorded in the PR's Acceptance notes."
     ],
     "loose_ends": []
    }
  6. added a commit that references this issue on Nov 16, 2026
    895783a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugdomain:serverpm:dispatchedpriority:p2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions