Repository navigation
feat(ci): A 类设计还原度门禁脚本化 + Agent 协作基建收口文档(P0) - #41
Conversation
A1/A2/A4 were described as machine-checkable in docs/development-workflow.md §7 but had no script and no CI step, so in practice they were self-attestation. Adds scripts/check-ui-fidelity.mjs (pure filesystem walk, no subprocess, sandbox-safe), a pnpm fidelity script, the verify chain and a CI step, plus docs/agent-workflow.md as the single source of truth for agent collaboration infrastructure.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c9cba44730
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Codex (PR #41, P2) showed the rule only recognised px/rem/em, so font-size:3vw, padding:5% and margin:2ch bypassed the token-only rule. The unit list now covers all CSS lengths and percentages with the zero-value allowance kept, the declaration parser no longer assumes one declaration per line (the regression spec caught that), the rules moved to scripts/lib/ui-fidelity-rules.mjs and are covered by scripts/lib/ui-fidelity-rules.spec.mjs collected via vitest.
|
按 Codex 审查修复( P2 · A4 只认
|
Summary
把
docs/development-workflow.md§7 的 A 类设计还原度门禁从"实现方自证"变成会红的检查——docs/agent-workflow.md立项后的 P0 首项。scripts/check-ui-fidelity.mjs:A1 零硬编码 hex、A2 零 emoji 当图标、A4 间距/圆角/阴影/字体只引 token。apps/<app>/src、modules/<module>/web/src、packages/ui/src;tokens.css是 hex 的唯一豁免。pnpm fidelity,并接入pnpm verify与 CI(verify job 在pnpm lint之后跑)。docs/agent-workflow.md(本仓「人 + 编码代理如何协作」的单一事实源:门禁清单、方言挂载、长任务 goal 纪律、skills / workflow 承载物、不搬清单、P0/P1/P2 落地顺序),并在docs/doc-index.md三处登记。Verification
pnpm fidelity现状通过:215 个文件,A1/A2/A4 无违规color: #ff0000;→[A1];padding: 13px;→[A4];emoji →[A2];三者同现时 exit 1components.css的 padding 全部走var(--sp-*);UI 源码里的 hex 仅存在于tokens.cssReview Focus
*.spec.tsx断言承担;A4 只覆盖padding|margin|gap|border-radius|box-shadow|font|font-size;letter-spacing/line-height/transform与 TSX 内联样式不在扫描内——这些边界已写进文档,改规则需同步脚本与文档tokens.css作为 hex 唯一豁免是否合理备注
连带更正:我先前对 PR #36 的技术结论("
@nx/enforce-module-boundaries在 CI 里从未执行")经受控负向实验证明是错的——pnpm -r/nx run-many/pnpm --filter三条路径都会抓出越界依赖并 exit 1。已在 #36 上发更正评论。教训已写进docs/agent-workflow.md第一原则:一行日志不是证据,会红的检查才是。