Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .claude/agents/os-dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,8 @@ model: opus
- 认领的 `Clause-②:`、`Metadata-protocol:` 两行照抄进 PR 正文行首;无则零写,⛔ 不自造。
- 两行同抄进 changeset 正文行首;`Check Changeset` 读 PR 正文:kind 即 `minor`,`none` 即 `patch`。
- 种类非 `none` 或带 `(narrowing)` ⇒ 按 diff 加写 `Skills-docs:` 行;拼法与分工住认领模板。
- diff 触根 `.claude/**` ⇒ PR 正文写行首 `Rule-change:` 行,按 diff 自判。
- `none` 未改车队规则(agent 不经维护者可做什么、做什么与先后、什么须交他);`yes` 改了;`ruled` 照抄已裁条文,写行首 `Ruling-ref:` 引维护者原话、出处、时间。缺行同 `yes`:Tier H。
- ⛔ 永不 `Fixes` 一张还在决策箱的卡:合并会静默关掉它,而收件箱过滤只读 open。
- ⛔ 不写否定式的关单句,它照样关掉点名的卡:解析器无视否定,只匹配关键词 + `#<n>`。
- 关键词是 `fix/fixes/fixed/close/closes/closed` 与 `resolve/resolves/resolved`;让它们远离其它卡号。
Expand Down Expand Up @@ -340,11 +342,9 @@ model: opus
- 两条合法出路:在轮内同步等它(资源纪律的排队条款:限时获取 ⇒ 无锁工作 ⇒ 再取)。
- 或者收窄这次检查的范围并在报告里申报:已申报的收窄是被接受的偏差,CI 跑满农场。
- PM L1 审核的是 CI 收敛,不是你本地的覆盖面;未申报的收窄不在此列,那是漏跑。
- 唯一同时反轮询又不停轮的形状是一次前台阻塞等待:前台跑完,或 `tail --pid` 等它退出。
- 比回合长的门禁在写报告那一刻读日志(重定向目标);未完成的记 NOT MEASURED 并写原因。
- 自检是机械的,不看你怎么形容这次等待:终消息只能是报告 JSON 或 `blocked` 报告。
- 结束一轮之前自检:最后一条消息是否在描述你不拥有的进程给你的唤醒?
- 排队的锁、别的 agent 的 build、脱管的 watcher 都不会来;保持这一轮活着,自己收退出码。

## 何时停手不写码

Expand Down Expand Up @@ -397,8 +397,7 @@ model: opus
- 不是 NUL 的控制字节也不是把门禁命中读成误报的理由。
- 危害的论证在 `scripts/check-nul-bytes.mjs` 头部,引用它,别重推;push 前跑它。
- 改动只要提到控制字符,就在门禁之外自扫:`grep -naP '[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]' <files>`。
- GitHub 正文 sanitizer 是同一纪律的另一半:形状、触发条件与作者纪律归 AGENTS.md。
- 归属条款是 AGENTS.md 的 GitHub mutates body BYTES 条;署名页脚两形如下。
- GitHub 正文 sanitizer 的作者纪律归 AGENTS.md 的 GitHub mutates body BYTES 条;署名页脚两形如下。

```text
--- ← 规则线,前留一空行;平台只认整块
Expand Down
18 changes: 8 additions & 10 deletions .claude/skills/pm-dispatch/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,28 +187,26 @@ PM 的工作是循环:选卡 → 认领 → 派发 → 收集 → L1 审核 →

## 路径分叉

- **ACCEPT 之后的路径分叉**:翻 ready / 挂 auto-merge / 入队前先取一次 PR 的路径面。
- 路径面用 `get_files` 取,⛔ 不看报告自述;动手之前先分,不是事后对照。
- governed 面(定 Tier,非车道):`docs/adr/**`+`.claude/**`+`skills/**`+`docs/NORTH-STAR.md`+`.github/workflows/**`。
- governed 面同含 `AGENTS.md`+`CLAUDE.md`;`GOVERNED_REPOS` 同治理、行可限仓,执行席恒随落地仓车道。
- 另含 `ui/docs/adr/**`+`ui/.claude/**`+`ui/skills/**`+`ui/AGENTS.md`+`ui/CLAUDE.md`+`ui/.github/workflows/**`。
- **ACCEPT 之后的路径分叉**:翻 ready/挂 auto-merge/入队前 `get_files` 取路径面,⛔ 不看报告自述。
- governed 面(定 Tier,非车道):`docs/adr/**`+`.claude/**`+`skills/**`+`docs/NORTH-STAR.md`+`.github/workflows/**`+`AGENTS.md`+`CLAUDE.md`+`ui/docs/adr/**`+`ui/.claude/**`+`ui/skills/**`+`ui/AGENTS.md`+`ui/CLAUDE.md`+`ui/.github/workflows/**`。
- `GOVERNED_REPOS` 同治理、行可限仓,执行席恒随落地仓车道。
- 恒 H:守卫仪器 `scripts/pm/check-governed-merges.mjs`+`scripts/pm/check-governed-queue-guard.mjs`+`scripts/pm/record-recognisers.mjs`+`scripts/pm/dispatch-gates.mjs`+守卫 workflow+settings+hooks。
- 定档 Tier H ⇒ ACCEPT 换终局四件套,混合 diff ⛔ 不按比例判;要拆让 dev 单独开 PR。
- 改动 >3000 行(含生成物)同换终局四件套含③请审,⛔ 无 Tier S 例外;读数=PR additions+deletions。
- >3000 行(含生成物,additions+deletions)或申报收窄同换终局四件套含③请审,⛔ 无 Tier S 例外。
- ① 席位记录落 PR 先于 `pr_ready`/入队且钉 head:速读四行+席位意见,其下 `## 席位核对`。
- ② PR 悬着等人批,同笔挂 `pm:awaiting-merge`;人工直合即审核记录,授权批准 ⇒ 席位落地。
- 指针 `ACCEPT → PR #n comment <id>`;受管/spec 面欠 ①–④,席只达档补审现 head 记录未盖处。
- 核对六项:形态/前提实测/门禁 check-runs/接受的偏差/范围外去向+`Skills-docs:`/落地条款。
- 草稿归 dev:PR 正文带 `## 维护者速读` 四行(见 os-dev.md),中文业务话,不写席位意见。
- 终稿 = 席位对照自己读的 diff 校正四行、加席位意见行,置顶席位记录;维护者只读评论。
- 终稿 = 席位照自己读的 diff 校正 dev 草稿、加席位意见行,置顶席位记录;维护者只读评论。
- `pm:awaiting-merge` 只挂 PR、不入六态,与请审同为等人批清单,随获批或撤回判决离开。
- 批准后再推亦不过期;席位落地 = 过落地前检、清标、ready、auto-merge,踢出/变基同法。
- ③ 请审 = 席位交棒:ACCEPT 与现 head 同形 PASS 俱在案,同轮中继 `pr_request_reviewers` 请审批人。
- 作者是审批人 ⇒ `assign` 它、请其余(请它必 422);⛔ 永不请席位自身账号;Tier S 不交人。
- `pr_create` 派不请;`pr_ready` 只补交棒漏;非例外 head 移 ⇒ 撤挂回等;脱中继 PR 自读请/派。
- 速读「要你做什么」求批点名 PASS 评论 id+`Head-sha`;无 PASS ⇒ 写 contract review owed 不求批。
- ④ 轮报单列 awaiting a human merge 并现读请审人;⛔ 未请审不在 chat 报「等你批」,先补请。
- skills 车道自有 PR:纯代码面如 `scripts/pm/` 由本席自读(清单不减)后落地。
- 受管面两层:Tier S = `.claude/**`+下行 S 面(该面独占),余皆 Tier H;S 经达档 PASS 后 ready→入队。
- skills 车道自有 PR:纯代码面如 `scripts/pm/` 由本席自读(清单不减)后落地,守卫除外。
- Tier S = `Rule-change: none`/`ruled` 记录核过的 `.claude/**`+下行面,余皆 H;达档 PASS 后 ready→入队。
- 本仓 workflows 读 `readWorkflowDiff`(发布面/C2/拒读⇒H),技能与只增 ADR `lowRiskArmVerdict`,未读⇒H。
- 入队资格:每 check 绿或预期 skip,⛔ 非必查子集;名单 check-expected-skips.mjs 只判 objectstack。
- 非必查红是真缺陷或坏门,归 PM 入队前处置;第三种按设计而红,三条全立才可带红入队:
Expand Down
2 changes: 1 addition & 1 deletion .claude/skills/pm-dispatch/references/contract-review.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
- 另记作者:PR `user.login` 非 `objectstack-fleet[bot]` ⇒ ③ 注点名该 login(脱中继写),落地前读。
- ③ 恒查(席位自读同):SQL 可下推处新增 id 物化或应用内 join 而无因由 ⇒ 记发现(AGENTS.md)。
- 简报从 `record-recognisers.mjs --brief-template` 起稿:只读条款与输入集内建,⛔ 不删 ⛔ 行。
- 独立性对与低风险臂读的 `Security-touching:` 行,取值同见 `--template`;子代理记采纳它的席位。
- 独立性对、`Security-touching:`、`Rule-change-verified:` 行取值见 `--template`;子代理记采纳席位。
- ④ 恒由起草者之外的 agent 达档跑,起草已达档不免;喂入同上,⛔ 不喂起草者的结论。
- 卡线程隔离子代理照上落现 head 记录并贴简报 ⇒ 席核简报、`Scope:` 与独立性对后采纳,
ACCEPT 点名其评论 id;`Scope:` 窄于 `hits` 不采纳;席的补缺记录只管缺口,⛔ 不单充 head 记录。
Expand Down
20 changes: 16 additions & 4 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
# `node scripts/pm/check-governed-queue-guard.mjs --self-test` reads this file
# (`codeownersMirrorVerdict`) and reds when a Tier H row has no line here, when
# any line names fewer or other owners than that constant, or when a Tier S row
# (`.claude/**`, which lands on a seat's review of record) is routed here. A
# (`.claude/**`, which lands on a seat's review of record) is routed here. That
# row splits by declaration since 2026-11-19, and the two paths under it that
# no declaration moves to a seat — the hooks and the settings files — each
# carry a line of their own, which the same self-test demands. A
# Tier H row carrying the register's low-risk arm (`lowRisk`: the two skills
# catalogs and the root ADR tree) has NO line here and reds if one is added:
# the relay's per-pull review plan reads the arm and decides who is asked
Expand Down Expand Up @@ -48,14 +51,25 @@
# The enforcement chain is routed the same way, deliberately: a PR that edits
# the audit script, the approver constant or this file is a governance change —
# without these entries the rule could be lifted by editing the enforcers
# instead of the surfaces.
# instead of the surfaces. Since 2026-11-19 the four guard scripts are register
# rows themselves (Tier H) and sit with the surfaces below; this file is the one
# enforcer still routed as a chain row.

# Tier H governed surfaces — the register's rows with tier H, less the
# low-risk arm's `/docs/adr/` and `/skills/` rows (see the header)
/AGENTS.md @os-zhuang
/CLAUDE.md @os-zhuang
/docs/NORTH-STAR.md @os-zhuang
/.github/workflows/ @os-zhuang
/scripts/pm/check-governed-merges.mjs @os-zhuang
/scripts/pm/check-governed-queue-guard.mjs @os-zhuang
/scripts/pm/record-recognisers.mjs @os-zhuang
/scripts/pm/dispatch-gates.mjs @os-zhuang

# Always Tier H under the root `.claude/` row, whatever a pull declares — the
# row itself has no line, since its other paths can land on a seat's record
/.claude/hooks/ @os-zhuang
/.claude/settings*.json @os-zhuang

# Tier H governed surfaces of the nested `ui/` workspace (#25712) — the same
# register rows, under `ui/`; `ui/.claude/` is Tier H, unlike the root tree;
Expand All @@ -68,5 +82,3 @@

# The enforcement chain
/.github/CODEOWNERS @os-zhuang
/scripts/pm/check-governed-merges.mjs @os-zhuang
/scripts/pm/check-governed-queue-guard.mjs @os-zhuang
5 changes: 5 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ _Keep one value on each of the two lines above, each line starting with its key.
[Human Minimum](https://github.com/objectstack-ai/objectstack/blob/main/CONTRIBUTING.md#human-minimum)
item 5 says what they mean._

_Only when this pull request changes a file under `.claude/`: add one more line there. It starts with the key
word `Rule-change` and a colon, then `none` (no fleet rule changes), `yes` (one does) or `ruled` (it copies a
maintainer ruling, quoted on a second line that starts with `Ruling-ref` and a colon). Every other pull request
leaves it out._

## Human Minimum

Each item is one rule from
Expand Down
58 changes: 29 additions & 29 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,40 +273,40 @@ See `ui/AGENTS.md` for the app-id / localStorage / auth gotchas.
14. **⛔ A governed surface lands only the way its tier allows — Tier H by the maintainer's hand (merge or enqueue)
or an authorized approval, Tier S by the owning seat on a contract-tier review of record; before that record no AI
seat merges, queues, or arms auto-merge on a PR whose diff touches one.** The governed surfaces are `docs/adr/**`,
`docs/NORTH-STAR.md`, `.claude/**` (agents, hooks and settings — not only skills), `skills/**`, `AGENTS.md`,
`CLAUDE.md` and `.github/workflows/**`, and under `ui/` `ui/docs/adr/**`, `ui/.claude/**`, `ui/skills/**`,
`ui/AGENTS.md`, `ui/CLAUDE.md` and `ui/.github/workflows/**`. The register is `GOVERNED_SURFACES` in
`scripts/pm/check-governed-merges.mjs`, each row carrying its tier; adding a surface is an edit *there*, never here,
and `pnpm check:pm-governed-prose` reds per-PR when this paragraph names fewer surfaces than the register — or
more. A fork PR (head repo ≠ base repo) is a proposal, never a delivery, whatever its paths: no AI seat readies,
`docs/NORTH-STAR.md`, `.claude/**`, `skills/**`, `AGENTS.md`, `CLAUDE.md`, `.github/workflows/**`, under `ui/`
`ui/docs/adr/**`, `ui/.claude/**`, `ui/skills/**`, `ui/AGENTS.md`, `ui/CLAUDE.md` and `ui/.github/workflows/**`, and
the guard itself: `scripts/pm/check-governed-queue-guard.mjs`, `scripts/pm/record-recognisers.mjs`,
`scripts/pm/dispatch-gates.mjs` and the register, `GOVERNED_SURFACES` in `scripts/pm/check-governed-merges.mjs`,
each row carrying its tier; adding a surface is an edit *there*, never here (`pnpm check:pm-governed-prose` pins the
list). A fork PR (head repo ≠ base repo) is a proposal, never a delivery, whatever its paths: no AI seat readies,
queues, arms auto-merge on or approves it; the owning seat adopts the diff onto an internal branch and lands that.

**Authoring stays open to every seat** — drafting, pushing, opening and revising the PR. What is reserved is the
**landing**: on a PR whose diff touches a governed surface ⛔ never merge, ⛔ never queue, ⛔ never arm
auto-merge, ⛔ never flip it out of draft to make any of those possible — judged on the PR's **file list**, not
its description; a **mixed diff is not a proportion question**, one path hit is enough; to land the rest, split off
the governed files. **The landing is tiered by the register; one Tier H path makes the whole PR Tier H.** **Tier H**
(人合: every row outside Tier S): those four lift only for an authorized APPROVED review by an account in
`GOVERNED_APPROVERS`, on ANY commit and not dismissed; that word is spent once per PR — the OWNING seat then lands
it, later pushes included; the click stays the maintainer's. **Tier S** (席内达档 L2 审核落地: `.claude/**`,
objectstack workflow edits (`readWorkflowDiff`), skills-only wording and add-only ADR notes (`lowRiskArmVerdict`, on
a `Security-touching: no` record, no named card ever labelled `security`; the seat labels unnamed security teaching)
read as S): those four lift once the PR thread or its card carries a PASS `## Contract review` record for the PR's
current head with `Served-tier: CONTRACT_REVIEW_TIER` and every check is green — the owning seat queues it. A PR
whose only governed paths are register rows the queue leg regenerates byte-exact clears with zero approvals — an
uncertified recompute, drift or a hand-authored sibling keeps it governed. ⛔ **No agent seat submits an approving
review on a governed-surface PR, under any account** — an authorized account is agent-operated too; "CI is green"
says nothing about a governance change. An authorized account's enqueue is a review record too: ⛔ never a seat's.
**landing**: on such a PR ⛔ never merge, ⛔ never queue, ⛔ never arm auto-merge, ⛔ never flip it out of draft
to make any of those possible — judged on the PR's **file list**, not its description; a **mixed diff is not a
proportion question**, one path hit is enough; to land the rest, split off the governed files. **One Tier H path
makes the whole PR Tier H.** **Tier H** (人合: every row outside Tier S): those four lift only for an authorized
APPROVED review by an account in `GOVERNED_APPROVERS`, on ANY commit and not dismissed; that word is spent once per
PR — the OWNING seat then lands it, later pushes included; the click stays the maintainer's. **Tier S**
(席内达档 L2 审核落地: `.claude/**`, objectstack workflow edits (`readWorkflowDiff`), skills-only wording
and add-only ADR notes (`lowRiskArmVerdict`, on a `Security-touching: no` record, no named card ever labelled
`security`; the seat labels unnamed security teaching) read as S): those four lift once the PR thread or its card
carries a PASS `## Contract review` record for the PR's current head with `Served-tier: CONTRACT_REVIEW_TIER` and
every check is green — the owning seat queues it. `.claude/**` is S only on a line-start `Rule-change: none` in
the PR body (or `ruled` with a `Ruling-ref:` line quoting the maintainer) repeated on the record's
`Rule-change-verified:` line; no line, `yes`, settings and hooks are Tier H. A PR whose only governed paths are
register rows the queue leg regenerates byte-exact clears with zero approvals — an uncertified recompute, drift or
a hand-authored sibling keeps it governed. ⛔ **No agent seat submits an approving review on a governed-surface PR,
under any account**. An authorized account's enqueue is a review record too: ⛔ never a seat's.

**Already armed or queued when you read this?** Disable auto-merge AND convert it back to **draft**, which disarms
an unqueued PR; a queued one's landing seat sends the relay's `pr_dequeue` (measured live, comment 6902190812); any
other seat, or a stroke that does not land, asks the maintainer at once — then confirm from the remote that it is
in neither the queue nor `origin/main`. **Draft is no barrier by itself — the barrier is this directive**, and a
spent approval or a standing record IS the review record, ⛔ not a relaxation. Behind it: the queue guard refuses a
governed diff without its tier's record; CODEOWNERS routes every Tier H surface but the low-risk arm's rows to the
approvers, the relay asks per pull on drafts (no barrier); the post-merge audit (`check-governed-merges.mjs`) lists
every governed-surface merge with its approver and merger — a merger the maintainer does not recognise, any agent
approval, or a Tier S merge without a PASS record is a seat violation, filed and rolled back. No seat judges this.
an unqueued PR; a queued one's landing seat sends the relay's `pr_dequeue`; any other seat, or a stroke that does
not land, asks the maintainer at once — then confirm from the remote that it is in neither the queue nor
`origin/main`. **Draft is no barrier by itself — the barrier is this directive**, and a spent approval or a
standing record IS the review record, ⛔ not a relaxation. Behind it: the queue guard refuses a governed diff
without its tier's record; the post-merge audit (`check-governed-merges.mjs`) lists every governed-surface merge
with its approver and merger — a merger the maintainer does not recognise, any agent approval, or a Tier S merge
without a PASS record is a seat violation, filed and rolled back. No seat judges this.

15. **⛔ A version release is performed by the maintainer, by hand — no AI seat publishes, tags, cuts a Release, or
triggers a release, and none merges the Version Packages PR.** A rule that binds every seat lives here,
Expand Down
Loading
Loading