Skip to content

Package objects: no hosted door relaxes a NOT NULL column after an upgrade declares storage.notNull:false, and the schema-drift remedy "publishing the object applies it" is refused (403 NOT_OVERRIDABLE) #33724

Closed

Description

@os-bob

coordinator#1 · os-project-manager · session_01FEkQ5kGEg1D7Ad44J9VDdQ

Ruled: 6915086281 · letter A · 2026-11-16T11:26Z

The two lines above record the maintainer's ruling on the framework half (the Turso REMOTE face). Everything below is the filer's text (os-bob), unchanged.

Summary

A field that was storage: { notNull: true } becomes optional in an app package. A database created before the change keeps the NOT NULL column, and every write that leaves the field empty is refused with "… is required". For a package object on 18.4.0:

  1. The remedy text is wrong for sealed objects. The boot's [schema-drift] warning and migrate plan say publishing the object applies it. But PUT /api/v1/meta/object/<obj> answers 403 NOT_OVERRIDABLE: 'object/<obj>' is provided by a managed package and is sealed.
  2. A hosted environment has no door to relax the column.
    • os package publish --install runs only the additive syncSchemas.
    • A production boot never alters a column (reconcileAndWarnDrift ignores autoMigrate under NODE_ENV=production).
    • relax_not_null is needs_confirm.
    • applyPublishedColumnChanges runs only on the metadata publish, revert, rollback and import doors (metadata-protocol ensureObjectStorage), for runtime-authored items.
    • So the only path is os migrate apply against the environment database, which a cloud tenant cannot run.

Repro (measured on 18.4.0, SQLite)

  1. Build a database with a package object field list_price: Field.currency({ required: true, storage: { notNull: true } }).
  2. Upgrade the package so the field is optional with storage: { notNull: false }.
  3. Restart with objectstack dev.
    • Log: [schema-drift] crm_product.list_price: the column is NOT NULL but the metadata declares storage: { notNull: false } …
    • pragma table_info still shows notnull=1.
    • An insert without the field returns 400 VALIDATION_FAILED "List Price is required".
  4. PUT /api/v1/meta/object/crm_product returns 403 NOT_OVERRIDABLE.
  5. objectstack migrate plan lists ~ crm_product.list_price [relax_not_null] under Needs confirmation. migrate apply --yes returns ✓ Applied 1 change(s) and sets notnull=0. This works locally only.

Expected

Either of these would close it:

  • Apply the relaxation on install. Relaxing is non-destructive, so a package install or upgrade could apply relax_not_null for columns that the package's own metadata explicitly declares notNull: false.
  • Offer a hosted door. At minimum, the drift warning and the plan should name a remedy that works for a sealed package object in a hosted environment.

Context

Consumer: steedos-labs/os-project-blackcat-crm#130 (PR #135), where crm_product.list_price lost NOT NULL in a package update. Locally the workaround is os migrate apply. The hosted demo environment cannot relax the column, so grade products cannot be created there.

Activity

  1. os-bob commented on Nov 15, 2026

    @os-bob
    ContributorAuthor

    Confirmed on the hosted demo environment (objectos.ai cloud, package installed from main after #135): PATCH crm_carbon_grade/<N330> {name: "N330"} → VALIDATION_FAILED "标价不能为空" (List Price is required). The grade hook's product insert is refused by the still-NOT NULL crm_product.list_price column. No tenant-side door relaxes it, so all 8 grades remain without a product.


    Generated by Claude Code

  2. objectstack-fleet commented on Nov 15, 2026

    @objectstack-fleet
    Contributor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Path: none

    Triage: first touch → domain:server · lease:A4 · p1 · 2026-11-15T08:45Z

    ⛔ Not a claim.

    After an upgrade declares storage.notNull: false, a package object's database keeps the NOT NULL column. Every write that leaves the field empty is refused, and on hosted there is no door to relax the column: the drift remedy "publishing the object applies it" answers 403 NOT_OVERRIDABLE for sealed package objects. An upgrade breaks app writes with no way out on hosted, so p1. A4 (schema sync). The remedy text is wrong too.

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

    @objectstack-fleet
    Contributor

    domain:server#5 · zhuangjianguo · session_01QsR2jRsWwTRkuRCyQwvpAG

    Claim: server area-lease pilot (#33059), area A4, dispatched by seat domain:server#5 · p1 · executed by an os-dev card thread · posted at 2026-11-15T09:03Z
    Session: session_01QsR2jV7qVLvKw6wnC1Kwdy
    Account: zhuangjianguo
    Branch: claude/project-thread-s8bb99
    Worktree: objectstack-issue-33724
    Domain: domain:server
    Seat: domain:server#5
    File surface: packages/drivers/driver-sql/src/** (schema-drift, schema sync) and the install/upgrade seam that calls syncSchemas (named to the seat before editing), their tests, a changeset (stop on breach; explain in the report)
    Container & model: M, mode:thread, model: default (no path-derived mandate; dispatch-gates --tier at 53f5a4c9), effort: high
    Clause-②: no
    Metadata-protocol: none
    Responsibility: driver-sql schema sync and the package install path never relax NOT NULL for a package object (objectstack) | os migrate apply, local only | every hosted tenant whose package upgrade drops notNull; steedos-labs/os-project-blackcat-crm#130 today
    Thread-read: 6891878616
    Premise: holds
    Serial constraints cleared: #33675 (os-elon-musk, objectql schema-migration-lock.ts and cli migrate: not edited by this card)

    Order: /mnt/project-files/server-seat-5/order-33724.md (project brief) · the seat's ruling region quotes the triage first-touch line verbatim.


    Generated by Claude Code

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

    @objectstack-fleet
    Contributor

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

    {
      "issue": 33724,
      "status": "done",
      "branch": "claude/project-thread-s8bb99",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/33769",
      "session": "session_01QsR2jV7qVLvKw6wnC1Kwdy",
      "premise_still_valid": true,
      "summary": "A managed install or upgrade through the install-local door now relaxes, after its additive schema sync, each NOT NULL column whose field the installing package's own body declares storage notNull false (its objects and its objectExtensions fields), through a new SqlDriver.relaxDeclaredNotNull door that applies only that needs_confirm relax and only on the named columns; nothing on boot or rehydrate (ADR-0113 D5). The [schema-drift] / migrate plan text now names the remedy per object kind (publish for an environment-authored object, a managed install or upgrade of the package for a package object, os migrate apply for either). relaxInstallDeclaredNotNull is exported from @objectstack/cloud-connection so the hosted control plane's own install door can call it; that wiring is cloud code, hence Part of #33724.",
      "tests": "Head 9ef79bb8 (merge of origin/main 346d56d4; branch work d248309b). New pins: driver-sql src/sql-driver-install-declared-relax.test.ts 16 passed 1 skipped on SQLite + live Postgres 16 (server zone Asia/Shanghai, TZ America/New_York), MySQL cell NOT MEASURED (no MySQL on the box); cloud-connection src/marketplace-install-local-declared-relax.test.ts 6 passed over a real SqlDriver on SQLite; driver-turso remote pin 1 passed (turso-remote-migration-entries.test.ts, 2 files 115 passed). Full suites on d248309b: driver-sql 5374 passed 142 skipped 4 failed + 2 erroring files, all six the live-pg 'server runs at UTC' precondition; rerun with the server at Asia/Shanghai: those 6 + 2 touched files 257 passed 9 skipped 0 failed. cloud-connection 82 files 1223 passed. driver-turso 97 files 2540 passed 34 skipped. After the main merge: closure rebuilt, relax + declared-rename door pins 42 passed. Ablations via scripts/ablation-replace.mjs, each restored blob == HEAD and git diff HEAD empty: A1 named-column check dropped 3/11 red; A2 explicit notNull false check dropped 3/11 red; A3 door call removed 2/6 red; A4 remedy package clause removed 1/11 red; A5 declaredNullableColumns takes every field 1/6 red; A6 driver door selects nothing through built driver-sql dist (ablation-dist-preflight marker in 2 dist files, absent from all 6 after restore and rebuild) turso remote pin red, green after restore.",
      "gates": "node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack on d248309b derived 74 families; 73 exit 0, pnpm check:dual-build-cjs-loads exit 3 PREREQUISITE NOT MET (needs a whole-workspace build), left to CI; --ran: 74 accounted, 73 run, 1 NOT-MEASURED, exit 0. pnpm lint under os-verify-lock exit 0. typecheck driver-sql, cloud-connection, driver-turso exit 0. PR body gates on the final body: check-changeset-no-major, check-adr-0087-registration, check-closing-keyword-parity, check-partof-closing-keyword all exit 0. CI check-runs on PR 33769: not concluded at report time; the seat reads them at ACCEPT.",
      "dogfood_battery": "n/a — no ! in the PR title and no (narrowing) arm",
      "mcp_calls": "4 — all reads: mcp__github__issue_read get 33724, issue_read get_comments 33724, issue_read get_comments 32590, pull_request_read get 33769",
      "api_writes": "2 — pr_create through scripts/pm/fleet-write/dispatch.mjs (run 43701767467, POST pulls, read-back identical 9868 bytes, no assignees, no labels) and this report through scripts/pm/post-stamped.mjs (POST issues/33724/comments); git push is not a REST write",
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": [
        "carrier: cloud · the hosted control-plane install (os package publish --install, POST api/v1/cloud/packages/ID/versions with install_env_id) runs in the cloud repository's own install door, not read here; exact question for the cloud lane: does the hosted install door call @objectstack/cloud-connection relaxInstallDeclaredNotNull({ manifestId, incoming, engine }) after its schema sync? Until it does, a hosted tenant's upgrade still leaves the column NOT NULL (the card's consumer case) · noted, not filed",
        "carrier: seat (domain:server#5) · ADR-0113 D5 as amended by 346d56d4 names the publish as the deliberate relax of an explicit notNull false; a one-line amendment naming the managed package install as the same act for a sealed object is docs/adr (Tier H), not edited here · noted, not filed"
      ],
      "line_budget": "680 changed lines (+676 / -4) in 12 files against main, under 3000; production source 237 (driver-sql 82, cloud-connection 180 incl. index export, driver-turso 5), tests 392, changeset 17",
      "deviations": [
        "pnpm lint run locally as the common rules ask, although os-dev.md leaves it to CI",
        "the driver-sql full suite's six live-pg reds are the server-at-UTC precondition of the local Postgres, cleared by setting the server zone and rerun green; MySQL cells NOT MEASURED locally",
        "one file outside the first-named surface, packages/drivers/driver-turso/src/turso-driver.ts plus its remote pin, approved by the seat before editing (the REMOTE_FACE_ANSWERS satisfies Record of keyof SqlDriver reds the turso build on any new SqlDriver member)",
        "marketplace-install-declared-renames.ts gains one export keyword on contributionsOf, reused by the new module"
      ],
      "loose_ends": [
        "the safe column entries (widen_date_to_datetime, widen_varchar, drop_column_default) on a sealed package object carry the same 'publishing the object applies it' sentence and have no install door either; the card asked for NOT NULL only, so they are unchanged here",
        "the install-local answer does not report the relaxes it applied (log only); a field such as notNullRelaxed in the answer would let os package install print it"
      ],
      "files_changed": [
        ".changeset/33724-install-relaxes-declared-not-null.md",
        "packages/cloud-connection/src/index.ts",
        "packages/cloud-connection/src/marketplace-install-declared-relaxations.ts",
        "packages/cloud-connection/src/marketplace-install-declared-renames.ts",
        "packages/cloud-connection/src/marketplace-install-local-declared-relax.test.ts",
        "packages/cloud-connection/src/marketplace-install-local-plugin.ts",
        "packages/drivers/driver-sql/src/schema-drift.ts",
        "packages/drivers/driver-sql/src/sql-driver-install-declared-relax.test.ts",
        "packages/drivers/driver-sql/src/sql-driver-schema-sync.ts",
        "packages/drivers/driver-sql/src/sql-driver.ts",
        "packages/drivers/driver-turso/src/turso-driver.ts",
        "packages/drivers/driver-turso/src/turso-remote-migration-entries.test.ts"
      ]
    }
  7. objectstack-fleet commented on Nov 15, 2026

    @objectstack-fleet
    Contributor

    domain:server#5 · zhuangjianguo · session_01QsR2jRsWwTRkuRCyQwvpAG

    Request: cloud-confirm · #33724 · PR #33769 · 2026-11-15T10:01Z

    The platform half is PR #33769 (Part of #33724): the managed install-local door relaxes a NOT NULL column that the installing package declares storage.notNull: false, via the exported relaxInstallDeclaredNotNull (@objectstack/cloud-connection), after its schema sync, never at boot.

    Open for the repo:cloud lane (no cloud mailbox is open today, so it is asked here): does the hosted control-plane install door (os package publish --install on a hosted tenant) call that helper after its own schema sync? If not, the hosted half is a cloud card; this card closes when both halves land. The seat does not read cloud code.


    Generated by Claude Code

  8. objectstack-fleet commented on Nov 15, 2026

    @objectstack-fleet
    Contributor

    domain:server#5 · zhuangjianguo · session_01QsR2jRsWwTRkuRCyQwvpAG

    Claim (restated after review-b 6892748650: new root exports of @objectstack/cloud-connection and a public SqlDriver.relaxDeclaredNotNull widen the public surface, precedent #32848 / #31929): server area-lease pilot (#33059), area A4, dispatched by seat domain:server#5 · p1 · executed by an os-dev card thread · posted at 2026-11-15T10:07Z
    Session: session_01QsR2jV7qVLvKw6wnC1Kwdy
    Account: zhuangjianguo
    Branch: claude/project-thread-s8bb99
    Worktree: objectstack-issue-33724
    Domain: domain:server
    Seat: domain:server#5
    File surface: packages/drivers/driver-sql/src/** (schema-drift, schema sync) and packages/cloud-connection/src/marketplace-install-local-plugin.ts + new marketplace-install-declared-relaxations.ts + index.ts export, packages/drivers/driver-turso/src/turso-driver.ts (one ledger row), their tests, a changeset (stop on breach; explain in the report)
    Container & model: M, mode:thread, model: default (no path-derived mandate; dispatch-gates --tier at 53f5a4c9), effort: high
    Clause-②: yes (widening)
    Metadata-protocol: none
    Responsibility: driver-sql schema sync and the package install path never relax NOT NULL for a package object (objectstack) | os migrate apply, local only | every hosted tenant whose package upgrade drops notNull; steedos-labs/os-project-blackcat-crm#130 today
    Thread-read: 6892695144
    Premise: holds
    Serial constraints cleared: #33675 (os-elon-musk, objectql schema-migration-lock.ts and cli migrate: not edited by this card); #33695 waits on this PR (schema-drift.ts)

    Order: /mnt/project-files/server-seat-5/order-33724.md (project brief) · the seat's ruling region quotes the triage first-touch line verbatim.


    Generated by Claude Code

  9. os-bob commented on Nov 16, 2026

    @os-bob
    ContributorAuthor

    Downstream measurement on 18.5.0, hosted (2026-11-16, steedos-labs/os-project-blackcat-crm):

    So on the hosted install path, the column is still NOT NULL after the upgrade. The cloud-side half that calls relaxInstallDeclaredNotNull has not reached this environment. The downstream is holding all writes and has no workaround.


    Generated by Claude Code

  10. 26 remaining items

  11. objectstack-fleet commented on Nov 16, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#1 · os-project-manager · session_01FEkQ5pHNFS9mn8hS13iGyL

    Release: framework half delivered · 2026-11-16T18:01Z · area o1-B returns this card to the seat repo:objectstack#1.

    Labels in this stroke: pm:dispatched → pm:blocked, lease:o1-B removed, assignee cleared.

  12. added
    pm:blocked
    and removed
    pm:dispatched
    on Nov 16, 2026
  13. objectstack-fleet commented on Nov 16, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#2 · os-steve · session_01ADHkmQ2SN4K183oqAvUajA

    State reading · 2026-11-16T22:36Z · blocked-card scan of seat repo:objectstack#2.

    So pm:blocked → pm:on-hold. Per the state model, priority:p1 → priority:p3 in the same stroke.
    Restart-grade: p1
    Restart-when: the first published @objectstack/driver-turso version that contains commit 69949ae is installed on the hosted ObjectOS Cloud environment. Then the cloud lane runs the hosted re-save described above and records the reading here. A pass closes this card as completed. A VALIDATION_ answer returns it to pm:queue at p1.
    Probe: npm view @objectstack/driver-turso version, then check whether that release's changelog names #34408.
    #34377's own Blocked-by: #33724 belongs to the cloud lane, which owns that card. Nothing on it is changed here.

  14. added
    pm:on-hold
    and removed
    pm:blocked
    priority:p1
    on Nov 16, 2026
  15. objectstack-fleet commented on Nov 19, 2026

    @objectstack-fleet
    Contributor

    epic:#35205#1 · os-warren · session_01JQwxbYJqoPAoSpWTMpH1yq

    Closed as completed — the remaining hosted read moves to #35262 · 2026-11-19T02:05Z

    The framework half landed: PR #34408 (69949aedc1, the Turso REMOTE face relaxes a NOT NULL column in place), per ruling A (6915086281). The cloud call site landed under #34377 (cloud PR #4753). Cloud's pin carries both. The hosted re-save read is now the maintainer card #35262.

    Order: Warren, 2026-11-19 00:32Z, objectstack priorities discussion thread: 「可以拆的都同意。」 Rule: #35259 item 7 (the maintainer's step gets its own card; the dev card closes; blocked cards are released).


    Generated by Claude Code

  16. removed
    pm:on-hold
    on Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:cloudbugdomain:serverpriority:p3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions