Repository navigation
Commit 2feee83
docs(ui): ui/AGENTS.md becomes a normative core; local-dev and flaky-test narrative move to the contributor guides (#27576)
domain:devx#2 · os-justin · session_01QSeKYmTYfaPbLQD4BJfomW
Part of #25919 (PR 2: the `ui/AGENTS.md` restructure. PR 1 landed as
#26023.)
Ruling-ref: 6435359095 · 6485892110
Clause-②: no
Metadata-protocol: none
skip-changeset: the diff touches only `ui/AGENTS.md` and
`ui/.claude/**`. No package ships either.
## 维护者速读
- 改了什么:`ui/AGENTS.md` 收成规范核心。本地开发、端口和多栈流程原样搬进
`console-development.md`,flaky 测试的成因、读数和前情原样搬进新的
`guides/flaky-tests.md`,核心里各留一行指针。新增两条写法规则,不加门禁。修了 5 处过期说法,并按契约复核的 S1
修正了 console 指南里的 MSW 说法。
- 为什么改:裁决 6435359095 和 6485892110 定了这次重构。核心只写规则,叙事放到主题页,过期说法会把 agent
带错路。
- 风险与回滚:只动文档,不动代码。27 行 ⛔ / never 全数留在核心。其中 26 行逐字节不变,第 27 行(#8)只按派发令补了
`packages/` 路径前缀。回滚就是 revert 这个 PR。
- 先看:① `ui/AGENTS.md` §9 的两行新指针,加上 §5 新增的 #12 和 #13;②
`guides/console-development.md` 末尾新增的「Local dev and per-agent stacks」节;③
`guides/flaky-tests.md`;④ `ui/CLAUDE.md` 的一句话;⑤
`console-development.md`「Debugging & Browser Simulation Strategy」的 Rule
#1(S1)。
- 两分钟验证:在仓根跑 `git diff origin/main...HEAD --color-moved=dimmed-zebra --
ui`。预期搬迁的行显示为 moved。没标 moved 的增删行只有下文列出的修正行和新写的指针、规则行。
- 需要你做的:审批这个 Tier H PR(`ui/AGENTS.md`、`ui/.claude/**`)。
## What changes
`ui/AGENTS.md` goes from 36,140 bytes over 261 lines to **32,591 bytes
over 221 lines**, measured at head `dbb5e1cb`. There is no cap
(6485892110).
**Stays in the core:** §1–§8 in full, plus the rule-bearing parts of §9:
Housekeeping, the test-running subsection, and the 测试纪律 rules. Each rule
appears once. Where a rule already named its instrument (`pnpm check:*`,
a test file, a lint rule), the pointer stays where it was. No pointer
was added to an existing line, because that would reword it.
**New text:**
- §5 gets two writing rules from 6407900763 item 2, written as prose:
- **#12**: a comment in a workflow or a script is one line of why plus a
link.
- **#13**: code comments state invariants, not incident history.
Each says that no gate holds it and that existing comments are not
swept. Neither contains ⛔ or "never", so the census is unchanged.
- `ui/CLAUDE.md`: its one line now reads "AGENTS.md is the source of
truth for what differs under ui/ — it and the topic pages it links to
are one instruction set, maintained in one place, under the root
AGENTS.md" (6407900763 item 1; contract-review S3 6502595750, ruling
6503029051; surface widened by the seat for this file only). No rule is
restated there.
- One pointer line per topic page, in §9: one under 测试纪律 and one in a
new `### Local dev and per-agent stacks` stub.
- One row in the `objectui-contributor` SKILL.md topic table for the new
guide.
### Moved-block map (byte-preserving)
| From `ui/AGENTS.md` | To |
|---|---|
| §9 `### Local dev — console UI ↔ backend (read before debugging UI)`:
the heading and its 7 bullets |
`ui/.claude/skills/objectui-contributor/guides/console-development.md`,
under a new `## Local dev and per-agent stacks` |
| §9 `### 每个 agent 独立测试栈(端口隔离,多 agent 并行的推荐做法)`: the whole subsection, 4
steps and the **纪律** paragraph | same new section, after the block above
|
| §9 测试纪律, the opening paragraph (the 976 ms / 1000 ms measurement) |
new `ui/.claude/skills/objectui-contributor/guides/flaky-tests.md` |
| §9 测试纪律, the 「失败现场会直接指认根因」 bullet and the 「顺手体检」 bullet |
`guides/flaky-tests.md` |
| §9 测试纪律, the 「前情:objectui#3010」 line | `guides/flaky-tests.md` |
Nothing went to `docs/postmortems/`. The only incident write-up in the
file is the one-line 前情 note, and it went with its section's reasoning
into `flaky-tests.md`.
**Move proof.** Run `git diff origin/main...HEAD --color-moved=plain --
ui`. Of the 134 changed lines (blank lines included), 103 are marked
moved. A second script compared the 57 removed lines against the added
lines. Every removed non-blank line reappears byte-identical, except 9,
and those 9 are exactly the stale-claim lines below. The full
`dimmed-zebra` output is reproducible with the command in 维护者速读.
### Stale claims fixed (the only rewording; reading 6455483141)
1. **The `:3001/_console` claim (moved to `console-development.md`).**
It now says the backend serves `/_console` on its own port (`:3000` in
the single-stack setup). The built Console is still named as real, by
its package: 「仓根 `@objectstack/console` 包的 `dist/`」. The package
spelling replaces the literal root path because
`ui/scripts/check-skills-paths.mjs` resolves a `packages/` token against
`ui/`. Once the line moved under its scan root, that gate went red on
the root-relative path, which is unbuilt in a fresh checkout anyway. The
package spelling keeps the claim and resolves cleanly.
2. **§7 MSW bullet.** It now says there is no `@objectstack/plugin-msw`
package and no `msw` dependency in the workspace. It points to the
real-backend stacks in the console guide and keeps the instruction not
to hand-roll fetch interceptors.
3. **§2 styling path.** `skills/objectui/rules/styling.md` now says "at
the repository root". The file's preamble reads paths relative to `ui/`.
4. **§5 #8.** `app-shell/src/urlParams.ts` →
`packages/app-shell/src/urlParams.ts`. This is a census line. The
dispatch ordered this fix, so the line differs from before by exactly
those 9 bytes.
5. **§6 registry snippet.** The path is now
`packages/core/src/registry/Registry.ts`. The invented
`registerComponent` / `resolveComponent` Map snippet is replaced by an
abridged view of the real `Registry` class (`register`, `registerLazy`,
`get`) and the `ComponentRegistry` singleton. The renderer-loop
snippet's one call to the removed `resolveComponent` becomes
`ComponentRegistry.get(schema.type)`, which is what `SchemaRenderer.tsx`
calls. Without that change the snippet would name a function that no
longer exists anywhere in the file.
6. **Contract-review S1 (6502595750, ruling 6503029051).**
`console-development.md` § Debugging & Browser Simulation Strategy no
longer claims a mock mode or an MSW plugin. Rule #1 is retitled «No MSW
plugin — debug against a real backend» and points to «Local dev and
per-agent stacks». The MSWPlugin Configuration bullet is removed. Rule
#2 Alignment now names the `/api` proxy target (`DEV_PROXY_TARGET`)
instead of a mock server. The SKILL.md row says «debugging against a
real backend».
### ⛔ / never census (case-insensitive `⛔|never`, one count per line)
| | lines | bytes of those lines | sha256 of the line set (first 16) |
|---|---|---|---|
| before, `origin/main` `72b08eec` (identical to `ad3a640e35` for this
file) | **27** | 16,789 | `5c6693bd42200de7` |
| after, head `261449bc` (byte-identical to `ccc751c5` and `dbb5e1cb`
for this file, 32,591 B), all in the core | **27** | 16,798 |
`4a9f74261366934b` |
27 = 27: 26 lines byte-identical and in the same order, plus 1 that
differs only by the ordered path fix. That line is §5 #8 ("UI state
lives where it can survive"): its path `app-shell/src/urlParams.ts`
gained the 9-byte prefix `packages/`, which is why the line set grows
16,789 → 16,798 bytes. The fix was ordered by the dispatch (reading
6455483141) because the old path does not resolve from `ui/`, and the
seat kept it (OQ2 → A). No ⛔ / never line moved out of the core.
### Dependent reader
`scripts/check-agent-test-spelling.mjs` `COUNTER_EXAMPLE_FILES` names
`ui/AGENTS.md` for trap two (陷阱二). That bullet stays in the core with
the rest of the test-running subsection, so the script and its test need
no edit. `pnpm check:agent-test-spelling` passes and reports `1 declared
counter-example(s)`.
## Tests
- `pnpm --dir ui exec vitest run --maxWorkers=2
scripts/__tests__/check-skills-paths.test.ts
scripts/__tests__/check-shell-escape-residue.test.ts
scripts/__tests__/check-doc-links.test.ts`: Test Files 3 passed (3),
Tests 196 passed (196). The lock printed `VERDICT command-exit 0`.
- Under `ui/`, three scripts exit 0:
- `node scripts/check-skills-paths.mjs`: 86/87 stated paths resolve, 1
baselined.
- `node scripts/check-shell-escape-residue.mjs`
- `node scripts/check-doc-links.mjs`: "Links are valid across 14 scan
roots."
## Acceptance notes
- **The core is still large.** It is about 32.6 KB, because the 27 whole
⛔ / never lines alone are 16.8 KB and §5 carries most of them. The
test-running subsection and the i18n-regex bullet stay whole. The first
holds the dependent reader's counter-example and a 「上面的形态」
back-reference. The second states a rule inside the incident that proved
it, and splitting it would reword a line.
- **Stale claims outside this card's list were left alone:**
- The published `skills/objectui/guides/data-integration.md` still names
`@objectstack/plugin-msw` (the seat files it). The
`console-development.md` half was fixed here as S1.
- The heading «Which console `:3001/_console` serves» in root-side
`docs/agents/build-and-test.md` still names `:3001`.
- §7's surviving census line still says "matches the mock server".
Census lines stay verbatim.
- **Trailers.** The commits carry the model-free pair the root
`AGENTS.md` requires.
## Verification
<details><summary>dispatch-gates --commands (13 derived) and --ran
reconciliation, head ccc751c (re-run after the ui/CLAUDE.md commit and
the origin/main merge; same 13 commands, all exit 0)</summary>
```
node scripts/check-closing-keyword-parity.mjs :: exit 0
node scripts/check-closing-keyword-parity.mjs --self-test :: exit 0
node scripts/check-comment-mask-corpus.mjs :: exit 0
pnpm check:agent-test-spelling :: exit 0
pnpm check:driver-memory-census :: exit 0
pnpm check:gitlink-declared :: exit 0
pnpm check:nul-bytes :: exit 0
pnpm check:pm-governed-merges :: exit 0
pnpm check:published-files :: exit 0
pnpm check:refd-timer-probe :: exit 0
pnpm check:tier-file-adoption :: exit 0
pnpm check:undeclared-dep-imports :: exit 0
pnpm check:watch-hint-literal :: exit 0
✓ dispatch-gates --ran: 13 derived famil(ies) accounted for — 13 run, 0 NOT-MEASURED (a DERIVED zero — all 13 recorded an exit code and none of them is 3).
```
The first pass ran before `pnpm install` and four families exited 3
(PREREQUISITE NOT MET). All 13 were re-run after the install and are
shown above.
</details>
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01QSeKYoC3JrEqdXJwZ69A8m
---
_Generated by [Claude
Code](https://claude.ai/code/session_01QSeKYoC3JrEqdXJwZ69A8m)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent a5d7098 commit 2feee83
5 files changed
Lines changed: 83 additions & 64 deletions
File tree
- ui
- .claude/skills/objectui-contributor
- guides
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
498 | 498 | | |
499 | 499 | | |
500 | 500 | | |
501 | | - | |
| 501 | + | |
502 | 502 | | |
503 | | - | |
| 503 | + | |
504 | 504 | | |
505 | | - | |
506 | | - | |
| 505 | + | |
507 | 506 | | |
508 | 507 | | |
509 | 508 | | |
510 | 509 | | |
511 | | - | |
| 510 | + | |
512 | 511 | | |
513 | 512 | | |
514 | 513 | | |
515 | 514 | | |
516 | 515 | | |
517 | 516 | | |
518 | 517 | | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
0 commit comments