Skip to content

Commit b308ea8

Browse files
committed
Merge remote-tracking branch 'origin/main' into claude/project-thread-bimizv
2 parents 8c5d68f + 1b3e22f commit b308ea8

7 files changed

Lines changed: 104 additions & 17 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
'@objectstack/spec': patch
3+
---
4+
5+
docs(spec): the protocol upgrade guide names a dataset or cube dimension over a formula field, which the dataset compile and the authoring rules now refuse (#30822)
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
- **What.** A new semantic migration entry, `dataset-dimension-virtual-field-refused`, in protocol 18's step of the upgrade guide and `os migrate meta`: a `datasets[].dimensions[].field` or an `analyticsCubes[].dimensions.KEY.sql` naming a `formula` field. It quotes both refusals as they ship: the dataset compile's `400 DATASET_INVALID` and the authoring rule `dimension-virtual-field-refused` (`os validate` / `os build` / `os lint`, and `422` at the runtime dataset save).
11+
- **No automatic rewrite.** Which stored field should carry the value is the author's judgement. The remedy: store the value in a field of its own on the object (written by a hook or a flow when its source changes) and point the dimension at that field, or remove the dimension.
12+
- **Relevance.** `os migrate meta` lists the entry unless the stack provably declares no `datasets` and no `analyticsCubes`.
13+
- **Not changed.** No schema, export or accepted input moves: the refusal itself shipped with `@objectstack/service-analytics` and `@objectstack/lint`, and this is its guide entry, the dimension-side sibling of `dataset-measure-aggregate-field-type-refused`.

‎.claude/agents/os-dev.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,12 @@ model: opus
9797
4. **清理是任务的一步**:PR 开出后 `rm -rf <path>/node_modules && git worktree remove <path>`。
9898
- ⛔ 永不上来就 `--force`:拒绝移除说明有东西没提交,那是本容器未提交工作的唯一守卫。
9999
- 可能是你没推的工作,或路径打错敲进了别的 agent 的活 worktree;先去那里读 `git status`。
100-
5. ⛔ 永不按进程名杀(`pkill -f` 会带走并行 agent 的运行);记下你启动的 PID,只对它操作。
101-
6. **整条流水线在前台跑。** build 与 test 都是本任务的步骤:阻塞运行、读真实输出、继续。
100+
5. **整条流水线在前台跑。** build 与 test 都是本任务的步骤:阻塞运行、读真实输出、继续。
102101
- 宿主事实:你启动的后台作业、watcher、你请求的通知都不会唤醒你;结束一轮就是结束。
103102
- 每个可编译小步即 commit + push;有可展示内容即开 draft PR;接管只认远程分支最后 sha。
104103
- 带具名缺口的 PR 是交付进行中的常态,未读到的判决写 `NOT MEASURED: <family>, reason: …`。
105104
- 平台事实:容器把前台命令钉在约 10 分钟上限,超时 SIGTERM 杀掉(`exit 143`)。
106-
7. **排队不是停摆,在轮内主动等。** 持锁的是你不拥有的进程,其完成同样不会唤醒你。
105+
6. **排队不是停摆,在轮内主动等。** 持锁的是你不拥有的进程,其完成同样不会唤醒你。
107106
- 99 专指没排到,读作 NOT MEASURED;把间隔花在无锁工作上(写测试、changeset、PR 正文)。
108107
- 再取以同名续位,⛔ 不从队尾重排:`OS_VERIFY_LOCK_SLOT=<稳定名>` 在第一次尝试前就设好。
109108
- 没排到的调用把排位寄存,同名再来续原到达戳;不设它,每次离开都从队尾重排。
@@ -298,7 +297,8 @@ model: opus
298297
- 发布面动了要 changeset;`skip-changeset` 判据是没动:已发布 = 各包 `files[]` 实际发运内容。
299298
- 快速通道:`docs/adr/**` · `.claude/**` · `scripts/pm/**` · 仓根配置 · 私有包 · 注释,不发布。
300299
- 其余实测:构建后 grep `files[]` 所列路径找符号,带正控;符号零命中、正控命中 ⇒ 不发布。
301-
- PR 改到已有的 `.changeset/*.md`:⛔ 永不打 `skip-changeset`,门禁红着是对的,确认走 PR 文字。
300+
- 改已有 `.changeset/*.md`:⛔ 永不打 `skip-changeset`,红着是对的;正文申报 DELIBERATE CORRECTION。
301+
- 逐 note 点名并引改后句;⛔ 不请维护者确认,确认件是派发席记录(`landing-operations.md`)。
302302
- objectstack:`skip-changeset` 以 `pr_create` 的 `labels` 同笔申报;后发现的标签才走 `label-write.mjs`。
303303
- 范围 = 派发词点名的标签 + 上文判据下的 `skip-changeset`;禁写或交集为空 ⇒ 零写并报告。
304304
- 该腿的回读是中继回报的行:答案须列出每个送出的标签,缺者该笔 FAILED、不发后续动作。

‎.claude/skills/pm-dispatch/references/execution-duties.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@
177177

178178
- 你是记录在案的复核人:对 GitHub 核验,⛔ 不对报告的自述核验。
179179
- 逐项判据展开在 `references/review-checklist.md`,每份报告对着它过。
180-
- 改到已有 `.changeset/*.md` 的 PR ⛔ 不打 `skip-changeset`;确认取同 head 达档 PASS 或维护者原话。
180+
- PR 改已有 `.changeset/*.md` ⛔ 不打 `skip-changeset`;确认件只认派发席记录(`landing-operations.md`)。
181181
- 绿色输出≠ 该绿证明了被测风险:拒收断言、全绿方向与时序、pin 翻转、边界后收益。
182182
- 触 `skills/**` 的 PR 加问整包价值密度:从整包加载的客户 agent 座位读,⛔ 不从作者座位读。
183183
- 超派发预算或小功能大扩写 ⇒ REWORK,⛔ 不因已经写好了放行。

‎.claude/skills/pm-dispatch/references/security-findings.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@
3737

3838
- dev 把安全发现只写进终报私有字段 `security_findings`,⛔ 不进 `out_of_scope_findings`。
3939
- 报告评论里该字段只写 `withheld` 或 `none`。
40-
- 席位在会话与公告里处理它(第 3 节),⛔ 永不当 `out_of_scope_findings` 立卡。
4140

4241
## 6. 修复 PR
4342

4443
- 标题、正文与 changeset 只写加固规则,形如 「the door reads in the caller's scope first」。
44+
- 正文、验证、消融只写规则与计数(红、后复原);未守卫代码做什么只进 `security_findings`。
4545
- 契约复核记录停在规则层;机制只进复核者本地的 `security-note.md`,⛔ 不提交。
4646
- 修复要定契约的,交维护者。
4747

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
2+
3+
import type { SemanticMigration } from '../../types.js';
4+
5+
// The dimension-side sibling of `dataset-measure-aggregate-field-type-refused`:
6+
// a group key over a field no driver stores. The narrowing itself registered
7+
// `not-required (no-migration-prescription)` — no key is added, removed or
8+
// re-shaped — so this entry carries no conversion and has no automatic
9+
// rewrite: which stored field should carry the value is the author's call.
10+
export const entry: SemanticMigration = {
11+
id: 'dataset-dimension-virtual-field-refused',
12+
surface: 'dataset and cube dimensions over a VIRTUAL field — `datasets[].dimensions[].field` '
13+
+ '(`DatasetDimensionSchema`) and `analyticsCubes[].dimensions.KEY.sql` naming a field whose '
14+
+ 'declared type is `formula` (`SEARCH_VIRTUAL_TYPES`, `isVirtualSearchField`), whatever its '
15+
+ '`returnType`, on the base object or, for a dotted path, on the leaf\'s own object',
16+
replacement: 'store the value in a field of its own on the object (written by a hook or a flow '
17+
+ 'when its source changes) and point the dimension at that field, or remove the dimension. '
18+
+ 'There is no automatic rewrite: which stored field should carry the value, and what writes '
19+
+ 'it, is the author\'s judgement. A stored field the formula already reads is a candidate only '
20+
+ 'when grouping by it answers the same question the formula did',
21+
reason:
22+
'A dimension is a GROUP KEY: a dataset dimension compiles to a cube dimension whose `sql` is '
23+
+ 'its `field`, and a query selecting it groups (or date-buckets) by that column. A `formula` '
24+
+ 'is computed on read and never stored, so no driver materialises a column for it and there is '
25+
+ 'nothing to group by. Before this narrowing the dataset compiled, registered and published, '
26+
+ 'and its stored dimensions were served; only a query grouping by the formula dimension was '
27+
+ 'refused — `400 INVALID_FIELD` at `groupBy.N`, in front of whoever opened the dashboard tile — '
28+
+ 'and authoring reported nothing. The measure side already refused a total over a formula at '
29+
+ 'both doors; this is the dimension half. ⚠️ The refusal is the WHOLE dataset, not the one '
30+
+ 'member: a dataset carrying such a dimension no longer compiles, so its other, stored '
31+
+ 'dimensions stop being served with it until the dimension moves',
32+
acceptanceCriteria:
33+
'Every dataset compiles and `os validate` / `os build` / `os lint` report no '
34+
+ '`dimension-virtual-field-refused`. The two doors that refuse it, in their own words: the '
35+
+ 'dataset compile (`registerDataset`, `queryDataset` and every door that compiles through '
36+
+ 'them) answers `400 DATASET_INVALID` with "[dataset-compiler] dataset "NAME" dimension "DIM" (dimensions.N) '
37+
+ 'groups by field "FIELD", which object "OBJECT" declares as `formula` — its value is computed '
38+
+ 'on read and never stored, so no driver materialises a column to group by, and every query '
39+
+ 'selecting this dimension is refused. Denormalise the value onto "OBJECT" (a stored field, '
40+
+ 'written when the source changes) and point the dimension at that field."; the authoring '
41+
+ 'rules — the three CLI commands and the runtime dataset save (`422`) — answer '
42+
+ '`dimension-virtual-field-refused` (error) at `datasets[N].dimensions[M].field` or '
43+
+ '`analyticsCubes[N].dimensions.KEY.sql` with "groups by field "FIELD" (`formula` on object "OBJECT"), a value '
44+
+ 'computed on read and never stored, so no query can group by it" and the hint "Store the '
45+
+ 'value in a stored field of "OBJECT" (written when its source changes) and point this '
46+
+ 'dimension at that field, or remove the dimension." `os explain '
47+
+ 'dimension-virtual-field-refused` gives the reasoning. A dimension over a stored field and a '
48+
+ 'date or datetime dimension, with or without `dateGranularity`, are unchanged, as is every '
49+
+ 'measure verdict. ⚠️ The compile does not judge a dotted dimension (it answers for the base '
50+
+ 'object only); the lint rule and the query-time refusal still do, so sweep with `os validate`',
51+
relevantWhen: { kind: 'stack-declares', keys: ['datasets', 'analyticsCubes'] },
52+
};

‎packages/spec/src/migrations/semantic-relevance.test.ts‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ const EXPECTED_RELEVANCE: Readonly<Record<string, readonly string[]>> = {
5555
'18:cube-refresh-key-retired': ['analyticsCubes'],
5656
'18:dashboard-header-modal-target-page-only': ['dashboards'],
5757
'18:dashboard-refresh-interval-unit-in-key': ['dashboards'],
58+
'18:dataset-dimension-virtual-field-refused': ['datasets', 'analyticsCubes'],
5859
'18:dataset-measure-aggregate-field-type-refused': ['datasets'],
5960
'18:dataset-measure-selecting-aggregate-field-type-refused': ['datasets'],
6061
'18:hook-timeout-unit-in-key': ['hooks'],
@@ -83,11 +84,11 @@ describe('which entries carry a relevance question (ENUMERATION)', () => {
8384
expect(actual).toEqual(EXPECTED_RELEVANCE);
8485
});
8586

86-
it('is 26 entries: 5 of protocol 17 and 21 of protocol 18', () => {
87+
it('is 27 entries: 5 of protocol 17 and 22 of protocol 18', () => {
8788
const keys = Object.keys(EXPECTED_RELEVANCE);
88-
expect(keys).toHaveLength(26);
89+
expect(keys).toHaveLength(27);
8990
expect(keys.filter((k) => k.startsWith('17:'))).toHaveLength(5);
90-
expect(keys.filter((k) => k.startsWith('18:'))).toHaveLength(21);
91+
expect(keys.filter((k) => k.startsWith('18:'))).toHaveLength(22);
9192
});
9293

9394
it('the table names only registered entries (anti-vacuity for the comparison above)', () => {

‎scripts/check-empty-changeset.mjs‎

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
// opposite (#18160, ruling D on #17712, 2026-09-14):
125125
//
126126
// COLLISION -> rename yours; restore theirs from base
127-
// DELIBERATE CORRECTION -> do NOT restore it; get it confirmed on the PR
127+
// DELIBERATE CORRECTION -> do NOT restore it; declare it on the PR, the seat's record confirms
128128
//
129129
// The second class is a PR that changed behaviour a PENDING release note
130130
// describes and corrected that note in the same stroke. It is refused exactly as
@@ -547,8 +547,17 @@ export const FOREIGN_REMEDY = 'rename yours; restore theirs from base';
547547
* `sum` / `avg` / `min` / `max` and rewrites
548548
* `.changeset/aggregate-field-type-compatibility.md`, whose base text stated
549549
* booleans were refused for exactly those four aggregates.
550+
*
551+
* The remedy NAMES the confirmer, by pointing at the record that confirms. A
552+
* remedy that only said "get it confirmed" sent devs to ask the maintainer in
553+
* the PR body and seats to hold the landing until the maintainer answered,
554+
* while the rule already placed the confirmation with the dispatching seat's
555+
* own record (pm-dispatch references/landing-operations.md): its ACCEPT for a
556+
* text-only diff, otherwise its same-head at-tier contract-review PASS. The
557+
* verdict is unchanged; only the way out is spelled so nobody waits.
550558
*/
551-
export const FOREIGN_CORRECTION_REMEDY = 'do NOT restore it -- say so on the PR and get it confirmed';
559+
export const FOREIGN_CORRECTION_REMEDY =
560+
'do NOT restore it -- declare the DELIBERATE CORRECTION on the PR, naming each note; the dispatching seat confirms it by its own record (its ACCEPT, or its same-head at-tier contract-review PASS: pm-dispatch references/landing-operations.md), never a maintainer wait';
552561

553562
// ONE source for the two-class remedy, rendered TWICE: as indented lines in the
554563
// human body, and joined into the single line a `::error` annotation has to be.
@@ -606,10 +615,13 @@ function reportForeign(rows) {
606615
'above is the one thing not to do: the note you rewrote describes behaviour THIS PR',
607616
'changed, so restoring it from the base republishes a sentence that is now false, and',
608617
'no label and no diff shape makes that safe. Correcting a pending release note is a',
609-
'decision about a release rather than a refactor -- say so on the PR, naming the note',
610-
'and what changed under it, and get it confirmed. That is the existing human path;',
611-
'this gate stays red either way, and staying red is what puts the decision in front of',
612-
'a person instead of routing around it.',
618+
'decision about a release rather than a refactor -- declare it on the PR as a',
619+
'DELIBERATE CORRECTION, naming each note and quoting the corrected sentences. Who',
620+
'confirms it is the dispatching seat, by its own record: its ACCEPT for a text-only',
621+
'diff, otherwise its same-head at-tier contract-review PASS (pm-dispatch',
622+
'references/landing-operations.md). Do not ask the maintainer to confirm it, and do',
623+
'not wait for one; this gate stays red either way, and staying red is what puts the',
624+
'correction in front of that record instead of routing around it.',
613625
].join('\n'),
614626
);
615627
for (const { file } of rows) {
@@ -688,7 +700,7 @@ const SELF_TEST_BATTERIES = Object.freeze({
688700
'#6129: main drift must not move the verdict, in EITHER direction': 6,
689701
'#6129, the other half: a base branch that DELETES': 2,
690702
"A' (#17712): a changeset the PR did not add is neither modified nor deleted": 29,
691-
'D (#18160): the refusal names BOTH classes, body and annotation pinned equal': 12,
703+
'D (#18160): the refusal names BOTH classes, body and annotation pinned equal': 14,
692704
'#4690, one step later: no merge base at all is a failure': 1,
693705
'The consumer: this gate\'s own CI step (#6129)': 34,
694706
'The second consumer: where THIS SELF-TEST runs (#6509)': 12,
@@ -1454,9 +1466,18 @@ function selfTest() {
14541466
'D two-class: the body names the second class in the ruling\'s own terms, not as a generic caveat',
14551467
);
14561468
assert(
1457-
text.includes('there is no second command to run') && text.includes('get it confirmed'),
1469+
text.includes('there is no second command to run') && text.includes('the dispatching seat, by its own record'),
14581470
'D two-class: the second class is ROUTED to the confirmation path rather than to the restore',
14591471
);
1472+
assert(
1473+
FOREIGN_CORRECTION_REMEDY.includes('the dispatching seat confirms it by its own record')
1474+
&& FOREIGN_CORRECTION_REMEDY.includes('references/landing-operations.md'),
1475+
'D two-class: the remedy NAMES the confirmer by pointing at the record that confirms -- "get it confirmed" with no confirmer sent devs to the maintainer',
1476+
);
1477+
assert(
1478+
text.includes('Do not ask the maintainer to confirm it'),
1479+
'D two-class: the body says in words that the maintainer is not the confirmer -- the wait this remedy exists to end',
1480+
);
14601481

14611482
// The equality pin, taken against the REAL rendered body.
14621483
{

0 commit comments

Comments
 (0)