Skip to content

fix(metadata,docs): align the protocol declaration and the inventory counts with the stack (#728 #729) - #1010

Merged
yinlianghui merged 1 commit into
mainfrom
claude/issue-728-729-version-count-drift
Aug 7, 2026
Merged

fix(metadata,docs): align the protocol declaration and the inventory counts with the stack (#728 #729)#1010
yinlianghui merged 1 commit into
mainfrom
claude/issue-728-729-version-count-drift

Conversation

@yinlianghui

Copy link
Copy Markdown
Collaborator

Fixes #728
Fixes #729

并单处理(修复线 R39)。两单同族:rc.2 验收时点记录的「版本/数量宣称漂移」。文件面不相交,一个改 config、一个改 README 与文档面。

两单的 premise 都在 fresh origin/mainacc37e65,平台依赖已由 #901 / PR #910 升至 17.0.0-rc.3)上重新实测后 仍然成立 —— 而且 #728 的漂移在这期间还扩大了。


#728engines.protocol 与 manifest/依赖不一致

现值实测

来源 字段 issue 记录(rc.2 时点) 本次实测(rc.3 main)
objectstack.config.ts:45 manifest.engines.protocol ^17.0.0-rc.1 ^17.0.0-rc.1(未动)
objectstack.manifest.json specVersion / engines.protocol ^17.0.0-rc.2 ^17.0.0-rc.3
package.json @objectstack/* 17.0.0-rc.2 17.0.0-rc.3
dist/objectstack.json manifest.engines.protocol ^17.0.0-rc.1 ^17.0.0-rc.1

结论:premise 成立。#910 升级时抬了 manifest 与依赖、再一次漏抬了 objectstack.config.ts —— 也就是说这一处连续两次平台升级都被落下,差距从「rc.1 vs rc.2」扩大到「rc.1 vs rc.3」。协议握手只看 major,两边都是 17,所以从来没有报错,这正是它能连过两个发布的原因;但它是随产物分发给客户的元数据。

改动

objectstack.config.tsengines.protocol 改为 ^17.0.0-rc.3,与 template manifest 及已安装依赖对齐。修后重跑 issue 给出的复现命令,产物 manifest.engines.protocol = ^17.0.0-rc.3


#729 — 对象/flow 数量宣称仍是旧值

现值实测(一切以 rc.3 fresh main 为准,不沿用 issue 的数字)

口径说明:以 注册进 objectstack.config.ts 的元数据为准,与 pnpm build 摘要及 dist/objectstack.json 三者一致。对象按 src/objects/index.ts 导出计(17,与 17 个 *.object.ts 文件一一对应);flow 按 allFlows 数组计(24),不是按文件数计 —— src/flows/ 只有 21 个 .flow.ts,其中 case-escalationcase-actionsopportunity-approval 三个文件各导出 2 个 flow。

pnpm build 摘要:Data: 17 Objects 344 Fields / UI: … 5 Dashboards … / Logic: 24 Flows,产物 objects=17、flows=24、dashboards=5、datasets=9。

文档宣称 实测
对象 15(getting-started 面上是 13) 17
flow 23 24
仪表盘 4 5
dataset 8 9

改动(逐处,含多语言面)

  • README.md:banner(L8)、「What you get」标题(L48)、对象表补 crm_event / crm_event_attendee、汇总句(L60)、仓库结构树的三条计数注释。
  • content/docs/marketplace/fork-hotcrm.mdx + .zh-Hans + .zh-Hant:15 → 17。
  • content/docs/index.mdx + .zh-Hans + .zh-Hant:4 → 5 个仪表盘,并把第五个 Sales Activity 写进括号里的清单。
  • content/docs/getting-started/introduction.mdx + .zh-Hans + .zh-Hant:13 → 17。这一处 issue 的落点分析未列出,是本次全面搜数量宣称时发现的,比其余各处还旧一代,属同一 drift 面,一并修掉。

仪表盘计数:issue 建议让 #672 / #610 那条线一并修以免抢改同文件。核对后两单均已 closed(#672 completed、#610 completed),而 index.mdx:69 与 README 仍是 4 —— 交接对象已不存在,且这两行正是本单必须改的同一行,故本单接手。

刻意不改的两处

  • content/docs/whats-new.mdx(及两个中文面)的「15 business objects」:该页是带版本号的发布记录(## v1.0## v5.0),这句在「### What's in v1.0」小节内,陈述的是 v1.0 当时发了什么,不是对今天的宣称。同一份文件在 test/docs-drift.test.tsDocs drift (round 2 leftovers): ~39 product pages still name "Sales/Service Copilot" as a persona; config comment and RELEASE_STRATEGY.md still stale #612 人格化守卫里也正是以「the v1.0 release record」为由豁免的,本次守卫沿用同一豁免与同一理由。
  • 13 actions:产物注册 26,两者口径不同(一个 action 绑 5 个对象就注册 5 次),该给读者看哪一个是产品口径决策 —— issue 自身也只提示未断言。本 PR 不选边,守卫也不覆盖该数字,并在守卫注释里写明这是刻意留白而非遗漏。另见下方范围外发现。

防再犯守卫

沿 test/docs-drift.test.ts#1001 版本漂移断言的既有形态(含它的 vacuity guard 与「豁免必须仍然活着」两条纪律),新增两个 describe 块:

1. one protocol version, declared in three files (#728) —— 把 objectstack.config.ts 里那句「Bump together with specVersion」的注释从约定升级为门禁。四条断言:三处声明可读(vacuity)、config ↔ template manifest 一致、template manifest 自身两个字段一致、以及声明的版本 == package.json 实际安装的 @objectstack/spec(AGENTS.md §Dependencies 的要求)。最后一条是真正有牙的一条:它对 rc.2 和 rc.3 两次升级都会当场变红。

2. product docs state the metadata counts the stack registers (#729) —— 扫 README.mdcontent/docs/**/*.mdx 全量,把每一处数量宣称与测试时从注册 stack 现读的计数比对。期望值不写进测试文件:写死就是把同一个手工维护的数字搬了个家,下一个对象一加就同样过期,守卫也跟着一起死。中英文拼法各一条 pattern(17 business objects / 17 个业务对象 / 17 個業務物件 / 17 objects across / data model (17 objects) / semantic layer (9) …),只读英文就只守住了三分之一的面(#725 在磁贴规则上教过这一课)。三条 vacuity guard:每个 kind 都注册到了非零计数、每个 kind 都至少被某处文档宣称到(改写措辞会当场变红,而不是静默失守)、以及每条豁免都仍然指向一段真实存在的宣称。

反证(先定方向,再实测)

五处逐一临时改错,每处的预期方向都是 改前红/改后绿,五处实测方向与预期一致:

# 临时改动 实测结果
A config protocol 退回 ^17.0.0-rc.1 红:objectstack.config.ts declares ^17.0.0-rc.1, objectstack.manifest.json declares ^17.0.0-rc.3
B README 对象数退回 15 红:README.md:48 says "15 business objects", the stack registers 17 objects
C 仅改 zh-Hant fork 指南 17 → 15 红:content/docs/marketplace/fork-hotcrm.zh-Hant.mdx:77 says "15 個物件" —— 证明 CJK pattern 是活的而非装饰
D 把两处 dataset 宣称改写成不匹配的措辞 红:vacuity guard 报 no doc states a count for: datasets —— 证明改写措辞不能静默让规则失效
E 抹掉豁免页 whats-new.mdx 里的计数 红:HISTORICAL exempts pages that no longer state any count —— 证明豁免不会比它所豁免的文本活得更久

C 与 D 两条第一次跑时因还原方式失误(用了 git checkout 把本次真实修改一并回退)导致输出被 README 的噪声淹没、结论不成立,已单独重跑并取得上表中的干净证据。


验证

六门自检全绿(均在 fresh worktree、依赖已构建的前提下跑):

结果
pnpm validate exit=0 —— 17 Objects / 5 Dashboards / 24 Flows
pnpm typecheck exit=0,无输出
pnpm lint exit=0(13 warning / 14 suggestion 均为既有项,与本次改动无关)
pnpm hygiene ✓ source hygiene clean(含控制字节扫描)
pnpm build exit=0 —— 产物 manifest.engines.protocol = ^17.0.0-rc.3objects/flows/dashboards/datasets = 17/24/5/9
pnpm test exit=0 —— 77 files / 1830 passed, 1 skippeddocs-drift.test.ts 65 passed

pnpm test 输出里若干 ✗ source hygiene failed … 行是 test/source-hygiene-scan-surface.test.ts 故意打坏扫描器后对其报错文案的断言(负向路径的 stdout),不是失败项 —— 该文件本身 passed。

另按字节纪律对全部改动文件自查了网关扫不到的控制字节:grep -naP '[\x00-\x08\x0b\x0c\x0e-\x1f]' 无命中。

changeset:.changeset/version-and-count-claims-match-the-stack.md(patch,一份覆盖两单)。


Generated by Claude Code

…counts with the stack (#728 #729)

`objectstack.config.ts` declared `engines.protocol: "^17.0.0-rc.1"` while
`objectstack.manifest.json` and the `@objectstack/*` dependency line had both
moved to `17.0.0-rc.3`. Two consecutive platform upgrades bumped the manifest
and the dependencies and left the config behind, so `dist/objectstack.json`
advertised a protocol the app was not authored against. Only the major
participates in the handshake, so nothing failed — which is why it survived
two releases.

The README banner, the "What you get" table, the fork guide and the docs
overview still advertised 15 objects / 23 flows / 4 dashboards. Measured on
this tree: 17 objects, 24 flows, 5 dashboards, 9 datasets. `crm_event` and
`crm_event_attendee` join the README object table; the getting-started page,
a generation further behind at 13 objects, is brought along. Every affected
page is updated in all three locale faces. `whats-new` keeps its numbers — it
is a dated record of what v1.0 shipped, not a claim about today.

`actions` is deliberately left alone: the docs say 13 and the stack registers
26, and the two count different things (an action bound to five objects
registers five times). Which number a reader should be told is a product call.

Both classes are now gated in `test/docs-drift.test.ts`. One rule holds the
config, the template manifest and the installed `@objectstack/spec` to a single
protocol version. The other compares every count a doc states — English and
Chinese spellings alike — against counts read from the registered stack at test
time, never against a number written into the test.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHrPAGEgFDoHjphqYG4BMa
@vercel

vercel Bot commented Aug 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
hotcrm Ignored Ignored Aug 6, 2026 6:51pm

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants