You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Data import: no way to write a column only when the row is created (re-running an upsert reverts state written since) #25475
area:recordsBusiness objects, records, the views that show data, usable forms, searchdomain:specDomain lane — seat card indexed by label:pm:seatenhancementNew feature or requestpriority:p2Medium: important, M3
Ruled: 6377846440 · batch #9 item 3c · letter B · 2026-10-24T00:43:45Z (proposal 2 applyOn; not proposal 1)
Context
hotsrm (an SRM app built purely from metadata) migrates legacy suppliers with the platform import (POST /data/:object/import, writeMode: 'upsert'). Migrations are run more than once (rehearsal, corrections), so the import must be idempotent: a re-run may refresh master-data columns, but it must not overwrite fields that the app's own flows or users have changed since the first run.
Example: legacy suppliers are created with status = qualified and legacy_imported = true. Between two runs a supplier gets frozen (status = frozen) and reviewed. A second upsert that carries the same status column silently moves it back to qualified (the state machine allows frozen → qualified), and treatAsHistorical is system-only anyway, so a signed-in admin cannot even send the first-run status through the import door.
Gap
ImportRequest has insert / update / upsert, but nothing between them:
no "create missing rows, skip existing ones" mode (insert has no match step, so re-runs fail with duplicate-key errors instead of reporting skipped);
no per-column "on create only" flag in FieldMappingEntry (like defaultValue but applied only when the row is inserted).
Proposal (either would do)
writeMode: 'insert_missing' (or upsert + onExisting: 'skip'): match on matchFields, report existing rows as skipped, create the rest. (not chosen — row-level skip would need two imports to also refresh master data; ruling 6377846440)
FieldMappingEntry.applyOn: 'create' | 'always' (default always), so one sheet can carry "initial" columns that an update ignores.
Workaround in hotsrm (temporary)
status.defaultValue = cel\has(record.legacy_imported) && record.legacy_imported == true ? 'qualified' : 'potential'`so the sheet never carriesstatus`;
legacy_imported.readonlyWhen = previous.legacy_imported != true so a re-run cannot mark an existing supplier;
initialStates widened to include qualified, guarded by an insert-only script rule.
It works, but it spreads one import rule over three field declarations and is easy to get wrong (an expression default reading a field declared after it evaluates against an unset key unless guarded with has()).
Triage: decision-shaped (filing-gate ②: a feature / contract-shape proposal from a real app). Lands in packages/spec (ImportRequest.writeMode / FieldMappingEntry) first, then the import runner in packages/rest. Marked needs-user-decision; not dispatchable until ruled.
Path: records · 把客户的存量数据搬进来 | records-forms.named-import-mapping (P2: "re-imports idempotently") | step ⑥
Type: Feature
推荐 A:在已有的闭合枚举上加一个值,语义最窄,和 upsert 对称;B 可以等有第二个应用要逐列控制时再议。问:A / B / C?
os-decision-facets
① 项目长远合理性:A 在已有闭合枚举上加一值,契约增量最小、语义清楚;B 给每列加开关,面更宽;C 把一条导入规则摊到三处字段声明,长期是每个应用各写一遍。
② 实际业务拉动:hotsrm#10 迁移彩排实测撞上;今天的绕行写在 hotsrm 三个字段声明里,标明是临时的。
③ 防 AI 犯错:A 是闭合枚举值,写错即响亮拒绝;现绕行要 has() 防护的表达式默认值,AI 极易写出静默错。
④ 创业阶段不扩散:A 新增一个枚举值;B 新增一个逐列键;C 零新增但复杂度转嫁给应用。
Governing text: AGENTS.md "Platform-first"; ImportRequestSchema (packages/spec) is the contract.
Prior rulings read: "import writeMode insert skip existing" → not searched with check-prior-rulings.mjs; unresolved.
Batch note: one of five import / automation proposals from hotsrm's trial import filed on 2026-10-23 (#25475, #25476, #25477, #25481, #25493); the earlier hotsrm platform evaluation is the decision card #25496. They can be ruled as one batch.
Session: session_01AkmasAfXt3cu83xGzkuKhe (objectstack triage, run on the maintainer's request in the project thread)
Closed 2026-10-24T01:37Z. Superseded by #25577 — the same card ("no way to write an import column only when the row is created"), re-filed as objectstack-fleet[bot] with this body and these labels. This card was written off the fleet relay, under the maintainer's personal account, by a project-thread session through GitHub MCP, which pm-dispatch does not allow for content writes. The thread above stays here for reference; the queue continues on #25577.
Instruction: the maintainer 田騏, in the Objectstack project thread, 2026-10-24T01:19:49Z: 「我看到有一些使用个人账户而不是车队账户提交的issue,应该严格按照 pm-dispatch 的规则处理」
Session: session_018fnREjMeK9XQeHDwkJXKMW
area:recordsBusiness objects, records, the views that show data, usable forms, searchdomain:specDomain lane — seat card indexed by label:pm:seatenhancementNew feature or requestpriority:p2Medium: important, M3
Activity
objectstack-fleet commentedon Oct 23, 2026
Triage: decision-shaped (filing-gate ②: a feature / contract-shape proposal from a real app). Lands in
packages/spec(ImportRequest.writeMode/FieldMappingEntry) first, then the import runner inpackages/rest. Markedneeds-user-decision; not dispatchable until ruled.Path: records · 把客户的存量数据搬进来 | records-forms.named-import-mapping (P2: "re-imports idempotently") | step ⑥
Type: Feature
维护者速读
客户迁移数据要重跑几次(彩排、更正)。现在重跑 upsert 会把用户后来改过的状态冲回去,比如已冻结的供应商又变回"合格"。
writeMode加一个值insert_missing:已存在的行跳过并报 skipped,只建缺的。applyOn: 'create',某些列只在新建时写。推荐 A:在已有的闭合枚举上加一个值,语义最窄,和 upsert 对称;B 可以等有第二个应用要逐列控制时再议。问:A / B / C?
os-decision-facets
has()防护的表达式默认值,AI 极易写出静默错。Governing text: AGENTS.md "Platform-first";
ImportRequestSchema(packages/spec) is the contract.Prior rulings read: "import writeMode insert skip existing" → not searched with check-prior-rulings.mjs; unresolved.
Batch note: one of five import / automation proposals from hotsrm's trial import filed on 2026-10-23 (#25475, #25476, #25477, #25481, #25493); the earlier hotsrm platform evaluation is the decision card #25496. They can be ruled as one batch.
Session:
session_01AkmasAfXt3cu83xGzkuKhe(objectstack triage, run on the maintainer's request in the project thread)Generated by Claude Code
os-elon-musk commentedon Oct 24, 2026
Ruling: batch #9 item 3c · letter B · maintainer 「#9 同意」 2026-10-24T00:43:45Z
B =
FieldMappingEntry.applyOn: 'create' | 'always'(默认always):标create的列只在新建行时写,已有行不动;一次upsert即幂等(主数据列刷新,状态列不冲回)。不加insert_missing(A,分诊倾向):需求是列级的,A 换成行级「已有行不碰」后更正进不去,要两次导入。工作量 spec + server S。先 spec 后 server,可与 #25476 同 PR;hotsrm 发版后拆掉三处字段声明绕行。标签
needs-user-decision→pm:queue,分级按协议变更口径由分诊定;裁不派。简报:https://claude.ai/artifact/XKBVwFLq2V5nBTNy3enkbz(卡 3)。Generated by Claude Code
objectstack-fleet commentedon Oct 24, 2026
Closed 2026-10-24T01:37Z. Superseded by #25577 — the same card ("no way to write an import column only when the row is created"), re-filed as
objectstack-fleet[bot]with this body and these labels. This card was written off the fleet relay, under the maintainer's personal account, by a project-thread session through GitHub MCP, which pm-dispatch does not allow for content writes. The thread above stays here for reference; the queue continues on #25577.Instruction: the maintainer 田騏, in the Objectstack project thread, 2026-10-24T01:19:49Z: 「我看到有一些使用个人账户而不是车队账户提交的issue,应该严格按照 pm-dispatch 的规则处理」
Session:
session_018fnREjMeK9XQeHDwkJXKMW