Skip to content

Commit 8ddb6b7

Browse files
docs(skills): name --org / --all-organizations on the record-currency backfill hint (#30776)
<!-- claude-projects-attribution: {"github_login":"os-elon-musk"} --> _Requested by **Elon** · [project thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9D2Z6VkBkbrNXveRWdvVcvmX)_ domain:skills#1 · os-elon-musk · session_016WV4cwXJREc9CDS8E19UE5 Fixes #30740 Clause-②: no Metadata-protocol: none ## 维护者速读 - **改了什么**:`objectstack-data` 技能里 record 币种回填那句提示,补上 `--org ID`(一个组织)、`--all-organizations`(写入所有组织),并说明多组织数据库两个都不带会被拒绝。 - **为什么改**:PR #30737 已把 `os migrate record-currency-codes` 改成按组织执行;技能还写着不带旗标的旧命令,AI 照做会在多组织库上直接撞拒绝。 - **风险与回滚**:只改技能文案一句,另删一句重复的话来付 token 额度;无代码改动,回滚即撤这一个 commit。 - **先看**:① `skills/objectstack-data/rules/field-types.md` 第 173-176 行的回填提示;② 同文件第 228 行删掉的那半句。 - **两分钟验证**:对照 `packages/cli/src/commands/migrate/record-currency-codes.ts` 第 92-97 行与第 130-139 行,确认两个旗标与拒绝条件与提示一致。 - **需要你做的**:批准这个 Tier H PR(`skills/**` 需人工合并)。 ## What changes - `skills/objectstack-data/rules/field-types.md`, currency-resolution paragraph: the backfill hint now reads `os migrate record-currency-codes --org ID` (or `--all-organizations` for every one), and says that a multi-organization database refuses a run with neither. - Same file, autonumber rule 2: the closing sentence "The literal separator keeps distinct groups apart." is removed. It restated the rule's own heading ("Put a delimiter between adjacent variable tokens"), and removing it pays for the hint inside the token ceiling. - `.changeset/30740-field-types-record-currency-org-flag.md`: `'@objectstack/skills': patch`. ## Why PR #30737 (#30674) scoped `os migrate record-currency-codes` per organization. On `origin/main` `b3098661`, `packages/cli/src/commands/migrate/record-currency-codes.ts` declares `--org` and `--all-organizations` as mutually exclusive flags (L130-139), and its header (L92-97) says a run with neither, on a database whose rows belong to more than one organization, is refused before any write. The skill still named the command with no flag. ## Tests Skill prose only: no package code changed, and no eval case asserts this hint (`git grep record-currency-codes skills/` hits only this line), so no eval was edited. ## Acceptance notes - **Readings (skills/\*\*).** `field-types.md`: 250 → 252 lines, 3183 → 3198 tokens (ceiling 3207, headroom 24 → 9; no ceiling raised). Bundle (sum of every `skills/*/SKILL.md`): unchanged, 4523 lines, since no SKILL.md is touched. - **Out of scope, not fixed.** `content/docs/deployment/cli.mdx` L1311 still says "No flag; idempotent." for this command, while L1626 and L1716 of the same page name `--org`. `content/docs/**` is outside this card's file surface; reported to the seat. ## Verification <details><summary>dispatch-gates on head f9f3cda: 42 derived, 38 run green, 4 NOT MEASURED</summary> `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` derived 42 commands for the two changed paths. 38 exited 0 on head `f9f3cda2`, including `node scripts/check-skills-token-ratchet.mjs` (field-types.md 3198 / 3207) and `pnpm --filter @objectstack/lint run check:doc-formula-expressions` (after a turbo build of the `@objectstack/formula` and `@objectstack/lint` closures, lock VERDICT command-exit 0). Four exited 3 (prerequisite not met: they read every package's built `dist/`): `check:dts-closure`, `check:dual-build-cjs-loads`, `check:lean-entry-closure`, `check:sourcemap-no-sources-content`. A Markdown and changeset diff cannot move any `dist/`; a full workspace build was not run locally, and CI's build lane is the reading of record for those four. `node scripts/pm/dispatch-gates.mjs --ran FILE --repo objectstack-ai/objectstack`: "42 derived famil(ies) accounted for — 38 run, 4 NOT-MEASURED", exit 0. `pnpm lint`: exit 0. </details> 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_016WV4cwXJREc9CDS8E19UE5 --- _Generated by [Claude Code](https://claude.ai/code/session_016WV4cwXJREc9CDS8E19UE5)_ Co-authored-by: Claude <noreply@anthropic.com>
1 parent 4cfb351 commit 8ddb6b7

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/skills': patch
3+
---
4+
5+
docs(skills): the `objectstack-data` record-currency backfill hint names `--org` and `--all-organizations`
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
`skills/objectstack-data/rules/field-types.md` pointed an agent that switched a stored currency field to `'record'` at `os migrate record-currency-codes` with no flag. Since #30737 that command fills one organization's rows with `--org ID`, writes the one code into every organization only with `--all-organizations`, and refuses a run with neither on a database whose rows belong to more than one organization. The hint now says so. To stay inside the file's token ceiling, a sentence in the autonumber delimiter rule that restated the rule's own heading is removed.

‎skills/objectstack-data/rules/field-types.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,9 @@ dataset measure's own `currency` wins over a `'dynamic'` field; over a `'fixed'`
171171
or a derived sum/difference over one `'fixed'` code, it may only restate that code,
172172
else `DATASET_INVALID`: delete it, and the column takes the code (objectstack-ui →
173173
Dashboards). A `'fixed'` code is not judged against the tenant's. Switched a
174-
stored field to `'record'`? Backfill: `os migrate record-currency-codes`.
174+
stored field to `'record'`? Backfill: `os migrate record-currency-codes --org <id>`
175+
(or `--all-organizations` for every one); a multi-organization database refuses
176+
a run with neither.
175177

176178
`homeAmount` (`'record'` only, all three required): the engine stores the
177179
home-currency amount in `field` (a `'dynamic'` `currency`) at the `rateDate`
@@ -225,7 +227,7 @@ The `format` is literal text interleaved with `{...}` tokens:
225227
**Rules — get these wrong and records mis-number silently or fail to save:**
226228

227229
1. **Every `{field}` you interpolate must be `required: true`** and set before the record is created. An empty interpolated field makes the record number generation *throw* (the compile lint flags a non-existent field as an error, an optional one as a warning).
228-
2. **Put a delimiter between adjacent variable tokens** — `{section}-{zone}{000}`, not `{section}{zone}{000}`. Without one, `('AB','C')` and `('A','BC')` both render prefix `ABC` and share a counter (to keep numbers unique). The literal separator keeps distinct groups apart.
230+
2. **Put a delimiter between adjacent variable tokens** — `{section}-{zone}{000}`, not `{section}{zone}{000}`. Without one, `('AB','C')` and `('A','BC')` both render prefix `ABC` and share a counter (to keep numbers unique).
229231
3. **Pad width is a MINIMUM, not a cap.** `{000}` → `001`…`999`, then `1000` (it grows, never wraps). Size it for readability, not as a ceiling.
230232
4. **Only known tokens are interpolated.** Date tokens are **case-sensitive** — `{yyyy}` parses as a `{field}` reference and renders **empty** (rule 1 applies). Only a spelling no field could have — `{ YYYY }`, `{YYYY-MM}` — is emitted **literally**.
231233

0 commit comments

Comments
 (0)