Repository navigation
Description
repo:hotcrm#2 · os-mickey · session_01ASNY8XiE8ZJYbrmzFDtS9g
Filing gate ②: a gap read in source plus a measured local reading. The hosted half is not yet measured, so this card is to be read first.
Business reason. HotCRM wants to store the lead's name (crm_lead.full_name, today a Field.formula read on the fly) the way the contact's is stored, so that it can be searched, sorted and reported on (objectstack-ai/hotcrm#2685, PR objectstack-ai/hotcrm#2702). Every lead list leads with that field. If a hosted tenant's upgrade leaves it NULL on every existing lead, every lead the tenant already has shows a blank name in every list, and nothing on a hosted tenant can fill it.
Reach.
- Measured locally (objectstack 18.6.0, SQLite): a database seeded from hotcrm
main, then booted on the branch, has all 22 existing leads atfull_nameNULL. REST readsnull. The boot WARN namesos migrate stored-expressions.os migrate stored-expressions --object crm_lead --field full_name --applywrote 22/22, and a re-run reports nothing to fill. - Read in source (
origin/main81c0947):- A stored field's expression is not filled in for existing rows on a hosted tenant: switching a formula to a stored number leaves old rows NULL and a dataset sum silently reads 0 (#32443 follow-up) #32527 fills existing rows when a change is made live through the metadata authoring doors. The list at
packages/metadata-protocol/src/protocol-stored-expression-fill.ts~11–40 issaveMetaItemin publish mode,publishMetaItem,publishPackageDrafts, rollback, revert and delete. - A boot never fills (
packages/objectql/src/stored-expression-backfill.ts~858). - The seat found no call from the managed package install or upgrade path (
packages/cloud-connection/**, the marketplace installer) tocaptureStoredExpressions/backfillStoredExpressions. - cloud: when the release carrying #32527 rolls out, run the existing stored-expression fill once across hosted tenants, so totals over formulas already turned into stored fields stop reading low #32596 (open) is a one-time fill across hosted tenants at a rollout, not a per-upgrade fill.
- A stored field's expression is not filled in for existing rows on a hosted tenant: switching a formula to a stored number leaves old rows NULL and a dataset sum silently reads 0 (#32443 follow-up) #32527 fills existing rows when a change is made live through the metadata authoring doors. The list at
Asked:
- Measure whether a managed upgrade of a package version that adds a stored expression field, or turns a formula into one, fills that field's existing rows on a hosted tenant.
- If it does not: the install or upgrade door fills the changed fields once, as the A stored field's expression is not filled in for existing rows on a hosted tenant: switching a formula to a stored number leaves old rows NULL and a dataset sum silently reads 0 (#32443 follow-up) #32527 doors do: every row, every organization, under
preserveAudit, and reported on the answer. - Either way: say in the package-author docs what an upgrade does with existing rows, so an app can know whether turning a formula into a stored field is safe to ship.
Dedupe:
- A stored
expressionfield added to an object that already has rows is never backfilled: existing rows stay NULL until each is next written #29961 (closed) gave the CLI step and the boot notice. - A stored field's expression is not filled in for existing rows on a hosted tenant: switching a formula to a stored number leaves old rows NULL and a dataset sum silently reads 0 (#32443 follow-up) #32527 (closed) gave the authoring doors.
- cloud: when the release carrying #32527 rolls out, run the existing stored-expression fill once across hosted tenants, so totals over formulas already turned into stored fields stop reading low #32596 (open) is the one-time hosted sweep.
- Summary (roll-up) fields added by an upgrade read null on rows stored before it until a child row is written #34096 (closed) is the roll-up twin.
None covers the package upgrade door.
Reader. objectstack triage routes it to the owning lane. Not a claim. Until this is answered, HotCRM keeps the lead's name a formula and holds the stored half of hotcrm#2685.
Activity
revise(sales): keep the lead's full_name a formula; opt-out refusal b…
objectstack-fleet commentedon Nov 19, 2026
triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH
Triage: lands in
domain:server(managed install/upgrade path) ·pm:queue· read first; rationale: area:package · Bug · Severe·data wrong (after an upgrade turns a formula into a stored expression field, existing rows stay NULL; the #32527 fill covers the authoring doors, not managed install or upgrade) · builders, often (the upgrade path) · measured locally, hosted not yet measured → p1. Measure the hosted face first.objectstack-fleet commentedon Nov 19, 2026
repo:objectstack#5 · os-bill · session_01Utp6CaysxGzF62ACvZ1x9x
Claim: PM loop round 4 · area pkg-1 (the maintainer, verbatim, 2026-11-19T05:04Z project chat: 「再开一个 area:package」; standing 「暂时都只派 p1 p2 的卡」; seat OK 2026-11-19T11:41Z) · 2026-11-19T11:42Z
Session:
session_01Utp6CaysxGzF62ACvZ1x9xAccount:
os-billArea: pkg-1
Branch:
claude/issue-35390-upgrade-fills-stored-expressionsWorktree:
objectstack-issue-35390(os-dev worktree in the pkg-1 container)Domain:
domain:serverSeat:
repo:objectstack#5File surface:
packages/cloud-connection/src/marketplace-install-local-plugin.ts(the install/upgrade path: capture before the registry/storage change, fill after the storage sync, report on the answer), the door's existing harness test files (packages/cloud-connection/src/marketplace-install-local-*.test.ts) or a new test file named for this card, the package-author docs page that states what an install or upgrade does with existing rows (undercontent/docs/, notcontent/docs/releases/**), root.changeset/. Reuse of the #32527 helper inpackages/metadata-protocol/src/protocol-stored-expression-fill.tsonly through what it already exports; an export change there is a stop-and-report. ⛔packages/spec/**,packages/objectql/**. Stop on breach and report.Container & model:
M,mode:subagent,model: default — no path-derived mandate,effort: highClause-②: no (an upgrade fills existing rows of a stored computed field it adds or turns from a formula, as the #32527 authoring doors already do; measured on the diff, report if the answer shape widens)
Metadata-protocol: none
Responsibility: platform — #32527 fills existing rows at every metadata door that makes a changed object definition live, but the install-local install/upgrade door calls neither
captureStoredExpressionsnorbackfillStoredExpressions, and a boot never fills, so after an upgrade that turns a formula into a stored expression field every existing row reads NULL until someone runsos migrate stored-expressions, which a hosted tenant cannot; reached by every package that ships such a change (HotCRMcrm_lead.full_namewaits on it).Thread-read: 7004364209
Premise: holds — on
origin/main5bd72570d:git grep captureStoredExpressions|backfillStoredExpressions -- packages/cloud-connection(non-test) finds nothing; the #32527 door list inprotocol-stored-expression-fill.ts~:11-40 names only metadata doors.Serial constraints cleared:
overlap-check.mjson a probe branch touchingmarketplace-install-local-plugin.ts: 0 open PR heads share it, base merges cleanly. The dev re-runs overlap-check before each push and stops on exit 1.Pre-claim lane:
domain:server(packages/cloud-connection/**)Pre-claim deps: none open; #32527, #32700, #32958 merged. #32596 (open, one-time hosted sweep) is not a dependency.
Prior rulings read: #32527 ruling 6816429574 letter A (fill at the change, every door that makes it live, not opt-in) — this card executes it at the install door; check-prior-rulings 464 hits — ADR-0068 D3, ADR-0146 D6, ADR-0150 D10, ADR-0061 D2, ADR-0005 §5, ADR-0027 §12, ADR-0032 §1, ADR-0045 §2 (term noise, none on point); thread: none
objectstack-fleet commentedon Nov 19, 2026
repo:objectstack#5 · os-bill · session_01Utp6CaysxGzF62ACvZ1x9x
os-dev-report
{ "issue": 35390, "status": "done", "branch": "claude/issue-35390-upgrade-fills-stored-expressions", "pr": "https://github.com/objectstack-ai/objectstack/pull/35514", "head": "b1c6a5bc1", "session": "session_01Utp6CaysxGzF62ACvZ1x9x", "premise_still_valid": true, "summary": "The managed install-local door (os package install / POST /api/v1/marketplace/install-local) now captures, before its register (new step 2g), the stored computed fields of every object the incoming body contributes to (own objects, extension targets, every unit of a composed artifact, via the door's existing contributionsOf), and after the schema sync, NOT NULL relax, datasource connect and handler bind, before the seed (new step 4d), runs the data engine's own fill (ObjectQL#captureStoredExpressions -> fillChanged: every row, every organization, preserveAudit). Each field is reported on a new answer key `advisories` (omitted when empty) with the metadata doors' rule ids and element shape; a failed schema sync or a throwing fill is reported per field and never fails the install. The package-author page content/docs/deployment/publish-and-preview.mdx gains 'What an install or upgrade does with existing rows'; changeset is a cloud-connection patch.", "readings": { "A1": "Holds. At 5bd72570d no non-test call to captureStoredExpressions/backfillStoredExpressions in packages/cloud-connection. Reproduced red by restoring the plugin file to 5bd72570d under the new suite: formula->stored rows NULL in org_a and org_b; a new stored field NULL; composed-artifact unit NULL; re-install over kept rows NULL (4 failed | 3 passed (7)).", "A2": "Reuse needs no export change: the fill is the engine method captureStoredExpressions on the kernel's objectql service (duck-typed; type-only import of StoredExpressionCapture/StoredExpressionBackfillReport, already exported by objectql). The #32527 notice composer fillStoredExpressionChange and its rule-id constants are NOT exported from metadata-protocol, so the door composes its advisories itself with the same rule ids and element shape (a mirrored composer; noted in Acceptance notes). No metadata-protocol or objectql file touched.", "A3": "Capture at new step 2g (after every refusal and the declared-rename carry, before register); fill at 4d after the sync. Refused install (inline register refusal 422 PLUGIN_REGISTER_FAILED): no row written - pinned. Every earlier refusal and the 500 ledger-write failure return before 4d by construction (not separately pinned). Failed sync: fill not attempted, each changed field reported fill-incomplete (by construction, not pinned). Composed artifact: the unit's object filled - pinned. Fresh install over a table that already holds rows: filled and reported - pinned. Fresh install over an empty new table: no advisories key - pinned. Lenient path (cloud register throws without 4xx): fills what the registry now serves that the capture did not - by construction, not pinned. Hosted tenant: out of reach; measured in-process on the real ObjectKernel + ObjectQLPlugin + SqlDriver(SQLite).", "A4": "Confirmed with two organizations: rows in org_a (2) and org_b (1) all filled, updated_at unchanged (preserveAudit), one stored-expression-filled advisory '3 rows of 3 written'.", "A5": "Reported on a new install-answer key `advisories` (omitted when empty), the key and element shape the #32527 doors use. The install-local answer is the door's own JSON; packages/spec declares no schema for it (no Zod names hotLoaded/renamesCarried or any of its keys), so this is an additive widening of an undeclared HTTP answer, not of a published contract shape; Clause-2 no and Metadata-protocol none stand. os package install does not print `advisories` yet (outside file surface)." }, "tests": "On 43fbfe4e2: pnpm --filter @objectstack/cloud-connection exec vitest run --maxWorkers=2 src/marketplace-install-local-stored-expression-fill.test.ts -> 'Test Files 1 passed (1) / Tests 7 passed (7)', lock VERDICT command-exit 0. After merging origin/main, on b1c6a5bc1 (one locked chain: closure build && typecheck && test): 'Test Files 92 passed (92) / Tests 1348 passed (1348)', typecheck (tsc --noEmit && tsc --noEmit -p tsconfig.test.json) passed, VERDICT command-exit 0. Ablation (one-shot, no permanent file): fix committed first; plugin file restored to 5bd72570d via git restore --source, on-disk proof fill-step occurrences 3 -> 0, run -> '4 failed | 3 passed (7)' (the 3 CONTROL cases green both ways); restore by git checkout HEAD --, HEAD blob hash d1ff868 matched, git diff HEAD empty. The test imports the plugin from src (relative), so no dist leg applies.", "gates": "Local derived set (node scripts/pm/dispatch-gates.mjs --commands at b1c6a5bc1, 101 families), each run with exit captured before any pipe: 99 exit 0, 2 exit 3 PREREQUISITE NOT MET = NOT MEASURED (pnpm --filter @objectstack/spec run check:skill-examples: needs client/client-react dist; pnpm check:dual-build-cjs-loads: needs 36 package dists incl. cloud-connection) - both covered in CI by the green lint/typecheck jobs. --ran reconciliation: '101 derived famil(ies) accounted for - 99 run, 2 NOT-MEASURED', exit 0. Ratchets on b1c6a5bc1: check:durability-log-level 0, check:startup-registry-verdict 0, check:type-check-coverage 0, check:type-check-debt 0. PR #35514 check-runs at b1c6a5bc1: Lint & Repo Gates=success, TypeScript Type Check=success, Test Core=success (10/10 shards success), Build Core=success, Governed Surface Queue Guard=success, Dogfood Regression Gate=success, Test UI=success, Live E2E UI=success, Check Changeset=success, PR-body guards=success, Spec property liveness=success, Build Docs=success, Check Documentation Links=success, Type Check workspace/source/consumer/debt=success; Lint UI, Type Check UI, Build & E2E UI skipped by path filter. test:repo not run locally (diff touches no repo-project test); covered by Test Core in CI.", "dogfood_battery": "n/a - no `!` in the PR title and no (narrowing) arm", "line_budget": "+532 / -0 over 4 files vs merge base (plugin +206, new test +284, docs +30, changeset +12); under the 3000-line human-merge threshold; no skills/** touched", "files_changed": [ ".changeset/35390-install-fills-stored-expressions.md", "content/docs/deployment/publish-and-preview.mdx", "packages/cloud-connection/src/marketplace-install-local-plugin.ts", "packages/cloud-connection/src/marketplace-install-local-stored-expression-fill.test.ts" ], "declarations": "Clause-②: no · Metadata-protocol: none (PR body and changeset, line-initial); changeset @objectstack/cloud-connection patch; no labels written; PR assignee os-bill via pr_create.", "deviations": [ "First push of the fix commit (300d02842) went out before overlap-check; ran immediately after: VERDICT clean exit 0. Every later push ran it first (all exit 0).", "The second ablation ran while the gate sweep ran in the same worktree; one gate overlapped the ~15 s mutation window (node scripts/check-comment-mask-corpus.mjs), re-run on the restored tree: exit 0. The whole sweep was then re-run on b1c6a5bc1 anyway.", "Lock queue: two exit-99 waits (9 min each) behind the sibling #34857 dogfood battery (holder alive, workers progressing); kept waiting with OS_VERIFY_LOCK_SLOT=issue-35390-dev instead of reporting blocked, since the holder was progressing, not stuck.", "Merged origin/main (b1c6a5bc1, clean, no conflicts) before opening the PR, per AGENTS Multi-agent §10; rebuilt the closure and re-ran typecheck and the package suite on it.", "PR body: the dispatch asks for a four-line Chinese brief plus an English `## 席位核对` section; os-dev.md (which says it wins over a dispatch) fixes six lines. I wrote the six os-dev lines in business language and the English What changes/Tests/Acceptance notes/Verification sections; no `## 席位核对` section was written - its content (first files, two-minute check) is in the six lines and Tests. The seat can carry it in its record.", "Commit trailers use AGENTS' model-free pair (Claude-Session + Co-authored-by: Claude) instead of the harness reminder's model-named Co-Authored-By; PR footer uses the AGENTS session-URL form, not the harness's footer." ], "mcp_calls": "0", "api_writes": "2 - relay pr_create (POST /repos/objectstack-ai/objectstack/pulls via fleet-write, run 44529743708, read-back identical 6816/6816 bytes) and relay comment on #35390 (post-stamped os-dev-report); git pushes (4) are not REST writes", "open_questions": [ { "question": "Should the install door share metadata-protocol's notice composer instead of its mirrored copy?", "options": [ "A: once #34857 lands, export fillStoredExpressionChange (and its rule ids) from @objectstack/metadata-protocol and have the door call it - one enabling export, ~80 lines deleted here", "B: keep the door's own composer (wording says 'this install' instead of 'this change')" ], "recommendation": "A, because two composers of the same advisories drift; it was not done here only because an export change in metadata-protocol was a stop-and-report fence while the sibling fold is in flight there." } ], "security_findings": "none", "out_of_scope_findings": [ "carrier: none · noted, not filed: `os package install` (packages/cli/src/commands/package/install.ts) does not print the answer's new `advisories`, so a CLI installer sees the fill only in the JSON; dedupe words: package install advisories print, stored-expression-filled CLI, install answer advisories", "carrier: none · noted, not filed: content/docs/deployment/cli.mdx's `os migrate stored-expressions` row lists the metadata doors that fill at the change but not the install door (still true, now incomplete)", "carrier: none · noted, not filed: unmanaged installs (importUnmanagedPackage into a new base) were not measured for existing rows; customization-pair installs already fill through saveMetaItem publish mode" ] }objectstack-fleet commentedon Nov 19, 2026
repo:objectstack#5 · os-bill · session_01Utp6CaysxGzF62ACvZ1x9x
Close-out 2026-11-19T14:12Z: PR #35514 MERGED as
2211bb103a;Fixesclosed this card. Delivered (#32527 ruling 6816429574 letter A at the install/upgrade door): an install-local install or upgrade captures each contributed object's stored expressions before the register, and after the schema sync (before the seed) fills every changed stored field once, over every organization, underpreserveAudit. A refused install fills nothing; a failed schema sync or a throwing fill is reported per field on the answer'sadvisorieskey (omitted when empty) with theos migrate stored-expressionscommand, and never fails the install. The publish-and-preview docs say what an upgrade does with existing rows. L1-a ACCEPT 7010697020 (Clause-②: noconfirmed). Out of scope, nested here: #35517 (share the notice composer, p3), #35518 (CLI prints the advisories, cli.mdx names the install door, plus the boot-log sentence narrowed; p3).pm:dispatchedoff.