Repository navigation
fix(objectql): a following amount whose parent code field is no longer served is refused with a message that says so - #34024
Conversation
… of asking for it to be written A following amount whose parent object no longer serves the code field (the package that contributed it disabled or uninstalled) is still refused ERR_CURRENCY_CODE_REQUIRED / 400, but the message now says the field is not served, naming the disabled package when the registry still holds its contribution. The blank-code text is unchanged. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jTEivi2wogPpeo3xd5
…after the message builder split Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jTEivi2wogPpeo3xd5
📓 Docs Drift CheckThis PR changes 1 package(s): 2 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 2 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 21 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 3bce20731e1d9d87de8f0c19d6d9f83e80380fd8 && git checkout 3bce20731e1d9d87de8f0c19d6d9f83e80380fd8
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 240e9ab597a9b9a2dc3f46fe0d4432b3030b5de9 d50cea4559b540e3bc7aa7ee10e2d33f2171fe97 && git checkout -B drift-repro 240e9ab597a9b9a2dc3f46fe0d4432b3030b5de9 && git merge --no-ff d50cea4559b540e3bc7aa7ee10e2d33f2171fe97
node scripts/docs-audit/affected-docs.mjs --json 240e9ab597a9b9a2dc3f46fe0d4432b3030b5de9
|
|
domain:server#5 · zhuangjianguo · session_01QsR2jTEivi2wogPpeo3xd5 Request: review · PR #34024 · area S3 · Fixes #33888 · head d50cea4 (green, final) Ordinary ACCEPT read. No contract face: objectql only, Clause-② no, Metadata-protocol none. Report: os-dev report 6897763776 on #33888. Generated by Claude Code |
|
domain:server#5 · zhuangjianguo · session_01QsR2jTjrNnh6b2BkCXFugM Review claim (review-a, S3) · head d50cea4 · 2026-11-15T17:16Z |
|
domain:server#5 · zhuangjianguo · session_01QsR2jTjrNnh6b2BkCXFugM Review — PASSHead-sha: What holds
Nits (no re-review needed)
Gates: at review time 35 success, 16 skipped, none red, so every check is green. |
|
domain:server#5 · zhuangjianguo · session_01QsR2jTEivi2wogPpeo3xd5 席位核对ACCEPT and landing · area S3 · 2026-11-15T17:18Z · head
Ready + auto-merge under the area S3 landing line (maintainer, project thread, 2026-11-15T11:06Z) and the pm-dispatch landing procedure (maintainer, 2026-11-15T15:56Z). Generated by Claude Code |
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 43740503263 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
|
domain:server#5 · zhuangjianguo · session_01QsR2jTEivi2wogPpeo3xd5 Queue triage and one re-arm · area S3 · 2026-11-15T17:40Z · head
Generated by Claude Code |
|
domain:server#5 · zhuangjianguo · session_01QsR2jTEivi2wogPpeo3xd5 Re-arm, after removal · area S3 · 2026-11-15T17:49Z · head My stroke 6898569066 ran while the PR was still in the queue. The timeline shows Generated by Claude Code |
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 43745625854 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
|
domain:server#5 · zhuangjianguo · session_01QsR2jTEivi2wogPpeo3xd5 Queue ejection 2 · area S3 · 2026-11-15T18:38Z · head The second ejection (queue build 43745625854) has the same signature as the first: Generated by Claude Code |
Requested by Steedos · project thread
Fixes #33888
Clause-②: no
Metadata-protocol: none
维护者速读
ERR_CURRENCY_CODE_REQUIRED/ 400 拒绝,但提示改为说明"父对象不再提供该字段",并在注册表仍记得时点名被停用的包。field、amountField不变,币种字段确实为空时的原文案一字不变。回滚即还原本 PR。packages/objectql/src/validation/record-currency-code.ts的parentCodeFieldServingOf与codeRequiredMessage新分支;再看record-currency-guards.test.ts末尾新增的 describe。pnpm --filter @objectstack/objectql exec vitest run --project local src/record-currency-guards.test.ts -t "no longer served",预期 2 个用例通过。What changes
RecordCurrencyCodeRequiredErrorgains a third case for a following amount (currencyField: 'MASTER_DETAIL.CODE'): the parent object, as served at the write, declares no field under the code segment. Before, that case fell into the blank-code text, which asks for a code to be written into the field that is not there. Now the refusal reads, for the measured disable path:extendcontribution, so on the disable path the package is named. An uninstall removes the contribution, so there the clause is the card's generic one: "(a package that contributed it may be disabled or uninstalled)".recordCurrencyPairs/recordCurrencyPathOffrom the child's own field map only, so the guard cannot know what the parent serves.assertRecordCurrencyCodestakes one new optional argument, aParentCodeFieldServingreader.parentCodeFieldServingOf(registry)builds it fromgetObject(the served fold, a disabled extension left out),getObjectContributorsandisPackageDisabled. The four write-side callers pass it: insert, by-id update, predicate update and thevalidate()preview, inengine-insert.ts,engine-update.ts(two sites) andengine-validate.ts. It is asked only after a pair is refused, about the first refused pair, so the accepted write path reads nothing new.ERR_CURRENCY_CODE_REQUIRED/ 400,field,fields,amountField, and the full text for a served code field that is blank. A parent object that is not served at all keeps today's text. The guard is not exported from the package entry, so the published API surface does not move.Tests
packages/objectql/src/record-currency-guards.test.ts(the shared harness for this guard) gains one top-level describe on the measured fixture:billingownssuite_invoiceandsuite_line,supplierextendssuite_invoicewithcurrency_code,suite_line.amountfollowsinvoice.currency_code.disablePackage(supplier)a child insert is refusedERR_CURRENCY_CODE_REQUIRED/ 400 withfieldinvoice.currency_code, the message carries the not-served clause naming the disabled package, and does not carry "has a blank". The same test then uninstalls the supplier and asserts the generic package clause.Ablation (committed fix first, mutation through
scripts/ablation-replace.mjs, which restored the blob to HEAD and foundgit diff HEADempty): replacing the reader callparentCodeServing?.(path.master, path.code)withundefinedturns the disable-path test red and leaves the blank-text CONTROL green.Acceptance notes
Clause-②: noconfirmed against the ADR-0112 ledger row forERR_CURRENCY_CODE_REQUIRED(packages/spec/src/api/error-code-ledger.zod.ts): it records the code and status, not the text.Verification
Readings at head
d50cea4559(branch merged withorigin/mainat0ac112fcd), each command underscripts/pm/os-verify-lock.shwhere it builds or tests:pnpm --filter @objectstack/objectql typecheck: tsc clean;check:test-typecheck: OK(39 files / 233 errors / 64 pinned signatures held, unchanged).pnpm --filter @objectstack/objectql exec vitest run --project local --maxWorkers=2: VERDICT command-exit 0, Test Files 598 passed (598), Tests 13235 passed (13235).record-currency-guards.test.tsalone: 73 passed (73), the two new tests included.node scripts/pm/dispatch-gates.mjs --commands, 68 families atd50cea4559): 66 run locally, every one exit 0.check:dual-build-cjs-loadsis left to CI;check:type-check-debtruns under the lock and its reading is in the report comment on objectql: a following amount whose parent code field is no longer served is refused as if the parent's code were blank (ERR_CURRENCY_CODE_REQUIRED message) #33888.eslint --no-inline-configon the five touched source files: exit 0.check-nul-bytes: OK.test:repois not run locally: the diff changes no repo-project test and the derivation names none; CI'sTest Coreruns it.Ablation output (disable-path test, mutation landed and restored)
Session: https://claude.ai/code/session_01QsR2jTEivi2wogPpeo3xd5
🤖 Generated with Claude Code