Skip to content

Commit cf1927d

Browse files
committed
Merge remote-tracking branch 'origin/main' into claude/project-thread-2l0ab5
2 parents bd759bb + cd55df8 commit cf1927d

57 files changed

Lines changed: 3117 additions & 68 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
'@objectstack/scenarios': patch
3+
---
4+
5+
fix(scenarios): a confirmed write the server cannot take is not measured, clear declines read as declines, and the platform's user count is no leak
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
- **Confirmed write.** When the action door answers a confirmation turn's confirm-gated call `428 ACTION_CONFIRMATION_REQUIRED` with `details.reason: 'no_confirmation_service'`, the confirmed write is not measured. Before, it was graded `fail`. Such a server refuses every confirmed call, so no agent could pass. The ask ("asked first") is still graded. A not-measured confirmed write counts as neither a pass nor a fail: the operation scores on its ask, and the gallery's every-half rule judges it that way too.
11+
- **Declines.** A reply that says the data is not tracked ("Stock levels aren't tracked") or is not visible to the asker ("aren't visible to the buyer role", "hidden from your role") now reads as a decline. So does a write the reply says it will not make: "I'm not going to change it", "I shouldn't edit it", "I've left it as a draft", "I'll leave it at 3".
12+
- **Leaks.** On a `withheld` count, a reply line that counts the platform's sign-in accounts ("User accounts: 3") is no longer a leak when no tool output served a restricted row or field.
13+
- **Card.** `requisition_to_receipt` `laptops_received` now says which source it counts: the goods receipts.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
'@objectstack/objectql': minor
3+
'@objectstack/cli': minor
4+
'@objectstack/rest': minor
5+
'@objectstack/metadata-protocol': minor
6+
'@objectstack/spec': minor
7+
---
8+
9+
feat(units): `os migrate unit-codes` converts stored unit text into unit codes, from the operator's mapping
10+
11+
Clause-②: yes
12+
Metadata-protocol: added
13+
14+
ADR-0158 U7 R1, the backfill door (#35492). It is the twin of `os migrate record-currency-codes`.
15+
16+
**What it is for.** A field declared a unit code field after its rows were stored still holds free text such as `kg`, `公斤` or `lbs`. Since #35489 the engine checks each unit code it writes, so editing a quantity beside such a value is refused until the row holds a code. This door converts those rows in one run.
17+
18+
**`backfillUnitCodes`** (`@objectstack/objectql`, also exported: `formatUnitCodeBackfillReport`, `unitCodeBackfillComplete`, `unitCodeMappingOf` and the report types):
19+
20+
- **Which field.** `field` names the unit code field: the `text` field a quantity's `unitConfig.unitField` names, or a standalone `unitConfig: { unitMode: 'code' }` field. If you name the quantity, the refusal is `INVALID_FIELD` and names the field to use.
21+
- **The mapping.** It is the operator's, never derived. It maps stored text, exactly as written, to a unit code. Matching is exact: `kg ` and `KG` need their own entries.
22+
- **Targets are judged before any row is read**, as the write would judge them. A target that is not a standard UN/ECE Recommendation 20 code or one of the organization's own units, a retired unit, or a unit of another dimension than the field's `unitDimension` is refused `INVALID_FIELD` / 400 on the field. With no organization named, organization codes are judged in each organization the run would write them in, still before any write.
23+
- **Rows already holding a unit code are never rewritten**, so the run is idempotent: a second apply run writes nothing. That includes a unit the organization retired and a code of another dimension. Both are codes, not free text, and rewriting them from a mapping would change what the stored quantity means. Neither is a code the field admits: beside a quantity, the write check refuses each at the row's next quantity edit; a standalone unit field has no quantity, so the next write of the field must carry another code. So they are listed as `retired` and `other-dimension` and counted apart (`skippedRetired`, `skippedOtherDimension`), never as a code the field admits.
24+
- **A blank unit beside a quantity** is written only from an explicit `""` entry; without one it is counted (`blankBesideQuantity`) and named in the report. A blank unit with no quantity is left alone.
25+
- **Complete.** `unitCodeBackfillComplete` answers true only when every row holds a unit code the field admits: no unmatched value, no blank beside a quantity, no retired unit, no code of another dimension, no failed or unexamined row. The report prints its ✓ line only then.
26+
- **Dry run by default.** It lists each distinct stored value with its row count and what the mapping does with it, and writes nothing. With no mapping, the listing shows which spellings to map.
27+
- **Unmatched values.** An apply run that meets a value with no mapping entry is refused `VALIDATION_ERROR` / 400 on `mapping` before any write. The refusal names each value with its row count, and carries them as `unmatched`.
28+
- **Scope.** Scope is `organizationId` or `allOrganizations`, as on the currency backfill. An unscoped run over the rows of several organizations is refused with each organization's counts.
29+
- **Writes.** Each row is written through `engine.update` as a system write, so the unit check judges every converted code.
30+
31+
**`os migrate unit-codes --object O --field F [--map-file mapping.json] [--org ID | --all-organizations] [--apply] [--yes]`** (`@objectstack/cli`):
32+
33+
- It has the precedent's confirmation and exit behaviour: `--apply` asks first, and exits 1 under `--json` or with no terminal unless `--yes` is given.
34+
- A mapping file that is not JSON, or a mapping the engine refuses as malformed, is refused before the occupancy probe, the prompt and the boot.
35+
- Any refusal exits 1. Under `--json` it carries the code, the HTTP status, and `unmatched` or `organizations` where those apply.
36+
- It closes with a ✓ only when `unitCodeBackfillComplete` holds. A run that leaves a blank beside a quantity, a retired unit or a code of another dimension closes with a warning naming what is left.
37+
38+
**`POST /api/v1/meta/_migrate-unit-codes`** (`@objectstack/rest`) is the tenant-admin twin of `_migrate-record-currency-codes`.
39+
40+
- Its body is `{ object, field, mapping?, apply? }`, and any other key is refused 400.
41+
- It sits behind `metadata.endpoints.maintenance` and requires `setup.write`. It converts the caller's current organization only, and is a preview unless `apply: true`.
42+
- The report is the `data` of the shared envelope. A refusal over unmatched values answers 400 with `error.details.unmatched`.
43+
44+
**The unit refusals name the door** (`@objectstack/objectql`). The `ERR_UNIT_CODE_REQUIRED` and `ERR_UNIT_CODE_UNKNOWN` refusals of a quantity written beside a stored value the write did not supply now end with the remedy: the `os migrate unit-codes` command for that object and field, or the REST door. The refusal of a blank names the `""` entry. A refusal of a code the caller wrote carries no remedy.
45+
46+
**A metadata save that makes a stored field a unit code field is a destructive change** (`@objectstack/metadata-protocol`, `@objectstack/spec`). The detector judges the declaration and reads no row. Two findings sit beside `currency_mode_to_record` on the 409 `DESTRUCTIVE_CHANGE`, and `force: true` lifts them:
47+
48+
- `unit_code_field_declared`, on the code field: a stored field that is a unit code field after the save and was not one before. Any declaration can do it: a quantity, new or stored, whose `unitField` names the field; a `unitField` re-pointed at it; or its own `unitMode: 'code'`. A field that already was a unit code field raises nothing.
49+
- `unit_mode_to_record`, on the quantity: a stored quantity switched to `unitMode: 'record'`, whatever its `unitField`'s history (a unit code field already, or a field new in the same save). It names the blank units beside the quantity and the `""` entry that writes them. It is not raised when the same save raises `unit_code_field_declared` on that `unitField`, since that finding names the quantity, its blanks and the `""` entry, so each debt is reported once.
50+
51+
Each names the conversion run for that object and code field, CLI and REST.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
'@object-ui/components': patch
3+
'@object-ui/console': patch
4+
'@object-ui/cli': patch
5+
'@object-ui/plugin-gantt': patch
6+
---
7+
8+
fix(ui): danger text is readable in dark theme
9+
10+
Clause-②: no
11+
Metadata-protocol: none
12+
13+
In dark theme, `text-destructive` (a menu's Delete, error messages, danger links) used the deep red that is the fill of red buttons, about 1.6:1 on a dark menu. Text utilities now read their own token: each shipped `@theme` maps `--text-color-destructive` to `--destructive-text`, which only `.dark` defines (a brighter red that clears 4.5:1 on every dark surface). Light theme leaves it unset and falls back to `--destructive`, so it is unchanged; `bg-`, `border-` and `ring-destructive` and red buttons keep `--destructive`. New apps from `objectui init` carry the same split, and the Gantt resource view's over-capacity label reads the text token. A host that overrides `--destructive` for its own dark theme can set `--destructive-text` beside it.

‎.claude/skills/pm-dispatch/SKILL.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ PM 的工作是循环:选卡 → 认领 → 派发 → 收集 → L1 审核 →
6666
| `repo:<owner/name>` | 扫哪个仓的 backlog(单 issue 的落地仓看它自己的 `repo:*` 标签) | `objectstack-ai/objectstack` |
6767
| `batch:<n>` | 运行中槽位的上限:一槽 = 一个在跑的子代理(`Agent`、`create_session`)或卡线程,报告落地即释放;等人批、入队、等 CI、等裁决不占槽;dev、L1/L2 审核、普查皆计,⛔ 只读不豁免;p0 见 `priority:p0` 行 | 现值(默认、天花板、一容器 dev 上限)住项目记忆 |
6868
| `rounds:<n>` | 跑 N 轮后停 | 队列清空为止 |
69-
| `mode:subagent` \| `mode:cloud` \| `mode:thread` | 派发后端 | 按卡分流:S+M ⇒ `subagent`,`cloud` 只留 L/XL 等保留面;席位是项目线程时 M 及以上、p1、`security` 一律 `thread`;大卡判据照 `dispatch-runbook.md` 卡线程节 |
69+
| `mode:subagent` \| `mode:cloud` \| `mode:thread` | 派发后端 | 按卡分流:S+M ⇒ `subagent`,`cloud` 只留 L/XL 等保留面;席位是项目线程时大卡与无合适区的 M 卡 `thread`,p1、`security` 只定先后;判据照 `dispatch-runbook.md` 卡线程节 |
7070
| `#12 #34 …` | 显式 issue 清单,整体覆盖标签查询 | — |
7171

7272
- 无角色参数按执行姿态运行,车道由座位贴认定;角色参数令召唤词收敛为一行调用。
@@ -104,7 +104,7 @@ PM 的工作是循环:选卡 → 认领 → 派发 → 收集 → L1 审核 →
104104
- 写侧恒为 `objectstack-fleet[bot]`;`user.login` 记令牌不记席位,归属 = 文本里的 session ID。
105105
- 席位及其子代理 ⛔ 永不打印环境变量的值;判存在只用不印值的形式 `[ -n "${X+x}" ]`。
106106
- GitHub 上一切新内容用英文;中文只留三通道(维护者速读、轮报、裁决引文)。
107-
- 裁决引文照抄不译;四维分析写英文、归分析段,只管新记录;存量中文 ⛔ 不追溯改写。
107+
- 四维分析写英文、归分析段,只管新记录;存量中文 ⛔ 不追溯改写。
108108

109109
## 状态模型
110110

‎.claude/skills/pm-dispatch/references/dispatch-runbook.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,20 +117,20 @@
117117

118118
## 卡线程(`mode:thread`)
119119

120-
- 席位会话是项目线程(载 coordinator 通道工具)⇒ M 及以上、p1、`security` 卡一卡一线程。
120+
- 席位会话是项目线程(载 coordinator 通道工具)⇒ M 卡有合适区进区,无则一卡一线程;p1、`security` 只定先后,⛔ 单凭它们不开线程。
121121
- 大卡同上,先于下行,分区亦然,修复轮随卡;大卡 = L/XL,或欠全量验证(`!` 标题或 narrowing 臂),
122122
或改契约:`Clause-②: yes`、`Metadata-protocol` 非 `none`、非测试的 `packages/spec/src/**` 路径。
123-
- S 级机械卡留席内 `mode:subagent`:开线程要重新克隆、重读 `os-dev.md`,起步成本不值。
123+
- S 级机械卡留席内或进区 `mode:subagent`:开线程要重新克隆、重读 `os-dev.md`,起步成本不值。
124124
- 披露纪律卡(私密细节不得离开席位会话)也留席内,认领写明;卡线程照计 `batch`。
125125
- coordinator 调度卡线程(即 dev),候选与槽位照 `coordinator.md` 三;交回即告知它,REWORK 再占槽。
126126
- 档位与 effort 席位自推导 ⛔ 不等维护者原话:`--tier` 过路径,MANDATORY 即绑;effort 按难度。
127127
- 派发令写两者与推导(`--tier` 行或难度读数),协调者照令开线程;常设原话有则作 `reason:`。
128128
- 席位留认领/派发令/ACCEPT/落地/L2 采纳或补缺;线程实施、开 draft PR、驱动 CI 与可合并。
129-
- 线程 ⛔ 不做 harness 开 PR 后指派/请审:请审是席位交棒。
129+
- 线程 ⛔ 不做 harness 开 PR 后指派/请审。
130130
- 派发令由 coordinator 写进线程开场消息,`Writes:` 行逐字在内,⛔ 不落共享目录;卡上留指针。
131131
- coordinator 开线程即读线程分支交席位(读不到则线程自报);⛔ 线程不认领、不写卡 assignee。
132132
- 席位写 assignee+`pm:dispatched`+带该 `Branch:` 的认领;线程核对最新认领指向本分支方开工。
133-
- 分支约定仍是 `claude/issue-<n>-<slug>`;线程只能推指定分支是实测平台例外,认领如实写。
133+
- 线程只能推指定分支是实测平台例外,认领如实写。
134134
- worktree 照建;线程读 `os-dev.md`、派发令、卡与全部评论,⛔ 不读 `SKILL.md`;references 按需读。
135135
- 交回:PR 与报告落地后给席位线程发一条消息(PR、head、报告要点);L1/L2 期线程不关,接 FAIL。
136136
- PR 正文由线程自改(中继 `issue_patch`)再报要点,⛔ 不请席或区代发;线程已关才代改。

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
- 全序每级现读/现算,零逐卡维护;无级/无 area/无 type 轮报记分诊缺口。
5454
- 同级先非车队卡(作者非 `Bot` 且首行非席位签名),再 `Bug`、卡龄;⛔ 不升级、不越 p0。
5555
- 一车道多席按全序交替取卡:席 1 奇位、席 2 偶位;只为破交替才发 `split`;认领戳仲裁。
56+
- 周清扫卡归本车道席认领,一 PR 至多约十条互不相关的行;未做到的行滚入下周卡。
5657
- 空闲杂务:无卡可认领或等分诊的车道席对本车道卡做下四件;⛔ 不定级,自分诊例外照旧。
5758
- ① 交付卫生:交付卡补收尾记录;离手摘 `pm:*` 同笔设下一态;`Blocked-by:` 全关即重验回队。
5859
- ② 最老 open 卡对 `origin/main` 复读前提与修否并贴证据;已修交分诊或维护者关,⛔ 不自关。
@@ -105,7 +106,9 @@
105106
- 降档施工只经契约审核档 L2 审核到达维护者,⛔ 不新增标签不新增链。
106107
- 实施卡文件面 ⛔ 不含 `docs/adr/**`、`skills/**`、`SKILL.md`、`os-dev.md`:各立 `domain:skills` 卡。
107108
- 例外仅新增:枚举行(见 `lanes/skills.md`)随实施卡同笔,派发令文件面只点该行。
108-
- ADR 记账行(resolved by/修订注记)归落地席:ACCEPT 记 `carrier:` 注,合并后同轮立卡引合并 commit。
109+
- ADR 记账行(resolved by/修订注记)归落地席:ACCEPT 记 `carrier:` 注,合并后同轮在 open「ADR revisions, week of …」卡
110+
追加一行(ADR、节、原文所说、现在实情、落地 PR),无 open 卡则开下周卡;周卡以一个受管 `docs/adr/**` PR 落地。
111+
- 只收与 `main` 矛盾的 ADR 文本;纯补记 ⛔ 不立。
109112
- 强制条款②:放宽接受集或扩大公开面的卡默认判断档施工;命中即 spec 车道的活。
110113
- 负边界:运行时权限/安全行为变更不是条款②,归人工地板安全/权限边界类。
111114
- 条款②只指已发布契约面,拉回已声明契约不触它;卡面复述仍是条款②。

‎.claude/skills/pm-dispatch/references/filing-gate.md‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
- ⛔ 不是卡:既有卡一条评论能承载的指针/知会/请求;那条评论即其记录。
3030
- UI 卡写明所需通用块或 spec 契约门;要产品命名 widget/dialog/hook/命名空间的卡退回重立。
3131
- POST 前正文答四件:类别、业务理由、动手的读者(哪席哪步)、查重查询与命中数(含已关)。
32+
- 查重命中 open 卡且修复同机制或同文件:它无认领或归本席 ⇒ 在其下评论(何事、何处、证据、建议级),⛔ 不立卡;
33+
归他席认领 ⇒ 照常立卡,`Dedupe:` 行点名它。评论抬严重度或可达面由分诊下次触卡改级,⛔ 立卡人不改;只读现有查重返回的卡。
3234
- 车队立的卡(席位、代立发现、清单、分诊)建卡带 area、type、级与正文定级行,缺一拒收。
3335
- 维护者或外部人立的卡由分诊首触补齐 area 与 type;人定的级 ⛔ 不改,分诊与各席同此。
3436
- 改级前读现级末次 `labeled` 事件:带 `performed_via_github_app` 或 bot actor 才算车队,余人定。
@@ -43,10 +45,12 @@
4345
- 补不齐(四类皆非)者才因缺件首触即关 not_planned,一行点名所缺。
4446
- 「动手的读者」与 Acceptance notes 同一问:说得出具体 PR 或人 ⇒ 写进去,说不出 ⇒ 不立卡。
4547
- 说不出的形态:`.changeset/*`、无人在改的文档页、生成物、已扫完的批次,兜底不成立。
46-
- 配额:每 fire 不限张数,逐缺陷各立一张、各过本门;折清单卡可选、不强制;守批量写间隔。
48+
- 配额:每 fire 不限张数,逐缺陷各立一张(查重命中例外见上文)、各过本门;折清单卡可选、不强制;守批量写间隔。
49+
- 小、低风险、不急的活照常立卡,由分诊首触或日巡移成本车道周清扫卡(标题 `… · week of …`)一行并关卡:p3,及小、非错数据、
50+
非安全、非每日碰到的 p2(出货文本修正、有用户效应的审核后续、小文案);⛔ 不收 p1、size M 及以上、专题子卡、已认领卡。
4751
- 例外:L1/L2 后续(nit/接受的偏差/同车道 diff 外发现)每 PR 一卡 `review follow-ups of PR #N` 逐项勾,
48-
后轮追加 ⛔ 不另立;① 缺陷仍各立;p3 文案/文档 nit 入该区 `<area> loose ends` 卡,无则才立。
49-
- L1/L2 立卡前搜 open 卡 `PR #N` 与文件路径,同一发现追加;技能/ADR 文本卡照 `triage-duties.md`。
52+
后轮追加 ⛔ 不另立;① 缺陷仍各立;p3 文案/文档 nit 入该区 `<area> loose ends` 卡,无则才立;有用户效应的后续照清扫卡条。
53+
- L1/L2 查重另搜 open 卡 `PR #N` 与文件路径;技能/ADR 文本卡照 `triage-duties.md`。
5054
- 分诊席的存量清理仍走维护者确认的十张一组、只备下一组,⛔ 不因本门改批量。
5155
- 读到 `User` ⇒ 记座位贴、本 fire ⛔ 不立新卡;认领仍靠 assignee,署名仍是文本的 session ID。
5256

‎.claude/skills/pm-dispatch/references/lanes/triage.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# 席位章程:分诊席(Triage)
2-
见 triage-duties.md;本文是本席的岗位说明,现值状态恒在座位贴,⛔ 不迁入本文。
2+
见 triage-duties.md;现值状态恒在座位贴,⛔ 不迁入本文。
33

4-
- 维护者一句召入任一项目,默认总监席项目;只写标签、审计评论与关卡,⛔ 无 PR 无认领。
4+
- 维护者一句召入任一项目,默认总监席项目;只写标签、审计评论、关卡与折叠行(`issue_patch`),⛔ 无 PR 无认领。
55
- 每 fire 最旧优先;最旧未路由超 4h 的卡本轮先清。
66
- 补半状态前先确认无人在动,读后新现六态属他席即停手;席数与 fire 频率只照座位贴。
77
- 推维护者仅限需其出手,通道照 SKILL.md;⛔ 无进度表与聊天轮报,余只进座位贴轮次记录。

0 commit comments

Comments
 (0)