Repository navigation
Commit 67154ed
docs(skills): lookupAutofill copies a currency amount only between fields in the same currency (#37044)
repo:objectstack#4 · os-justin · session_01QSeKYo86w1wqy2z2fMrryr
Fixes #36349
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 用户能看到什么变化:用户无感;读「数据建模」技能的 AI
助手现在知道,选取关联记录时金额只在两边币种相同的情况下才会自动带出,不同币种时目标字段保持原值并说明原因,平台不做换算。
- 为什么做:这是「选产品不跨币种抄价格」那项改动欠下的技能文字,替按技能写应用的 AI 助手补上,免得它继续承诺一定会带出价格。
- 出错会怎样:只是技能里的两句说明、一处指引和几处表格用词,不影响任何运行行为;可以直接撤回这一个合并。
- 要你做什么:无。
## What changes
`skills/objectstack-data/rules/field-types.md`, the `lookupAutofill`
paragraph. It ended at the sentence about the grid's same-named
`autofill` copy and stated no currency condition. Two sentences are
appended there, covering the declared pair and the same-named copy
together:
> Either copy moves a `currency` amount only between fields in the same
currency (`fixed` or per-record); else the target is left as it was and
the form says why. Nothing is converted.
This is what the merged code does (`crossCurrencyRefusal` and
`judgePickWrites` in `ui/packages/fields/src/widgets/lookupAutofill.ts`,
used by the record form and by the grid's `planLookupAutofill`; the spec
describe of `FieldSchema.lookupAutofill` states the same rule for both
copies).
`skills/objectstack-data/rules/relationships.md`, the "Catalog
auto-fill" bullet (the grid's same-named copy), now ends "picking a
record fills those cells (a `currency` amount only in the same currency:
field-types.md → `lookupAutofill`)": a pointer to the sentence above
instead of a second statement of the rule. It fits that file's headroom
(4180 to 4202 of 4203 tokens); nothing was deleted there.
`field-types.md` sat at its token ceiling (3541 of 3541), so its
sentences are paid for in the same file, by deletion and with no ceiling
moved:
- the paragraph's own example is shortened from the full pair literal to
"`unit_price` from a product's `list_price`" (the heading already spells
the pair shape), and "(single-value `lookup` / `master_detail`)" becomes
"(single-value only)" (the table rows directly above name the two
types);
- fourteen "When to Use" cells that only restated the type name lose the
restating words: `date`, `time`, `datetime`, `number`, `file`,
`markdown`, `html`, `richtext`, `boolean`, `signature`, `location`,
`avatar`, `tags`, `slider` keep a shorter cell with the same meaning
(for example "Date only (no time component)" is now "Date only").
Published-skill size, measured at `b01d8f97e9` (before) and `a141c91fb2`
(after): `rules/field-types.md` lines 267 / 270; `rules/field-types.md`
tokens 3541 / 3540 (ceiling 3541); `rules/relationships.md` tokens 4180
/ 4202 (ceiling 4203); whole `skills/` tree lines 22996 / 23000; whole
bundle tokens 294236 / 294257.
A `patch` changeset for `@objectstack/skills` is included: the skill
text ships in that package.
Read first: the appended sentence (the risk is a promise the runtime
does not keep); then the trimmed table cells (the risk is a lost hint).
## Tests
No code or test changes. No case under `skills/objectstack-data/evals/`
mentions `lookupAutofill` or the grid `autofill` copy, so no eval
asserts the old promise and none was edited. The evals are model-graded
fixtures and were not run live here: NOT MEASURED, reason: no local
runner.
<details><summary>Local gates at a141c91</summary>
The gate list was derived with `node scripts/pm/dispatch-gates.mjs
--commands` (48 families). 43 ran and exited 0, among them:
- `node scripts/check-skills-token-ratchet.mjs`: exit 0, "60 authored
bundle file(s) within their ceilings"; the rows read `field-types.md
3540 / 3541 (-1)` and `relationships.md 4202 / 4203 (-1)`
- `pnpm --filter @objectstack/spec run check:skill-served-sections`,
`pnpm check:skill-links`, `pnpm check:skill-identifier-liveness`, `pnpm
check:skill-compatibility`, `pnpm check:skill-frame-sync`, `pnpm
check:doc-authoring`, `pnpm check:nul-bytes`, `pnpm
check:pm-skill-id-lint`, `pnpm check:role-word`: exit 0
- `node scripts/check-empty-changeset.mjs --base origin/main`, `node
scripts/check-changeset-no-major.mjs --base origin/main`, `node
scripts/check-adr-0087-registration.mjs --base origin/main`, `pnpm
check:published-files`: exit 0
Five exited 3 (PREREQUISITE NOT MET, they read built output and nothing
was built for a text-only diff) and are NOT MEASURED locally, left to
CI: `check:doc-formula-expressions`, `check:dts-closure`,
`check:dual-build-cjs-loads`, `check:lean-entry-closure`,
`check:sourcemap-no-sources-content`.
`node scripts/pm/overlap-check.mjs` at a141c91: "VERDICT clean exit
0" against `origin/main` and against the other open pull that edits both
files.
</details>
## Acceptance notes
- The card's wording is "the target stays empty". The merged code leaves
the target as it was: empty on a fresh line, and holding its earlier
value on a re-pick or an `overwrite: true` pair. The sentence says "left
as it was" so that it promises only what the runtime does.
- "The same currency" also covers two amounts that both sit in the home
currency (neither declares one), which copy as before.
- The rule also has finer cases the sentence does not spell out (a
target whose record holds no code yet, a parent code that could not be
read): each is the same outcome, target left as it was with a stated
reason.
- The grid's catalog auto-fill bullet points at the field-types sentence
rather than restating it. The grid leaves a refused cell as it was and
shows a note under the line (`planLookupAutofill`'s `withheld` list,
drawn by `GridFieldWidget`).
## Verification
`node scripts/check-skills-token-ratchet.mjs` prints `field-types.md
3540 / 3541 (-1)` and `relationships.md 4202 / 4203 (-1)` and ends with
a line starting with a check mark.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01QSeKYo86w1wqy2z2fMrryr)_
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: objectstack-fleet[bot] <332303061+objectstack-fleet[bot]@users.noreply.github.com>1 parent 3691a5c commit 67154ed
3 files changed
Lines changed: 37 additions & 23 deletions
File tree
- .changeset
- skills/objectstack-data/rules
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
44 | | - | |
45 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
60 | | - | |
61 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
105 | 108 | | |
106 | 109 | | |
107 | 110 | | |
108 | 111 | | |
109 | 112 | | |
110 | 113 | | |
111 | | - | |
112 | | - | |
| 114 | + | |
| 115 | + | |
113 | 116 | | |
114 | 117 | | |
115 | 118 | | |
| |||
135 | 138 | | |
136 | 139 | | |
137 | 140 | | |
138 | | - | |
| 141 | + | |
139 | 142 | | |
140 | 143 | | |
141 | 144 | | |
142 | 145 | | |
143 | 146 | | |
144 | | - | |
145 | | - | |
| 147 | + | |
| 148 | + | |
146 | 149 | | |
147 | 150 | | |
148 | | - | |
| 151 | + | |
149 | 152 | | |
150 | 153 | | |
151 | 154 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
333 | 333 | | |
334 | 334 | | |
335 | 335 | | |
336 | | - | |
| 336 | + | |
| 337 | + | |
337 | 338 | | |
338 | 339 | | |
339 | 340 | | |
| |||
0 commit comments