3.4 KiB
FAIL
Ran python3 tests/scripts/agents_md.py: exit 0, "agents.md: 116 component names are public". The component library is at b54500b.
Round 1 defects:
- The script missed bare names. Fixed. Every map entry is now in brace form:
editor::{FindWidget}, andTheme::set_palettewas removed. Changing the map toeditor::{NoSuchWidget}now exits 1. - The script grepped the whole module tree. Partly fixed. It now reads only
mod.rs, sogit::newanddocuments::Markare rejected. Methods inimplblocks insidemod.rsstill pass. See the first entry below. - The script comment was too long. Fixed. The docstring is now nine words.
- The gpui rules were missing. Fixed. agents.md:66-79 holds the consumer rules. I checked each one against upstream
AGENTS.md,src/lib.rs:54-59andexamples/docs/hello.rs:40-44.motion::duration,primitives::raise,FocusScope::root,i18n::I18n,Theme::set_modeandTheme::set_mode_nowall exist.
The gap claims still hold. tables::Spreadsheet, documents::FixedFormatToolbar and documents::DocumentViewer are exported. No formula bar or name box exists in src. PERF-05 is at PRD.md:732.
tests/scripts/agents_md.py:9 — The ITEM regex is ^\s*pub\s+(?:struct|enum|fn|...) and allows leading whitespace. It therefore collects pub fn methods inside impl blocks in mod.rs as module items. Scenario: on a scratch copy, changing agents.md:52 to theme::{Theme, Mode, set_mode_now, set_palette} gives exit 0 and "118 component names are public". Both names are associated functions of impl Theme (theme/mod.rs:140, :163), so use ely_gpui_component::theme::set_palette does not compile. This is round 1's "methods inside impl blocks" scenario, still open. Fix: count only top-level items (no indentation, outside any impl or inline mod). Better: compile a generated use ely_gpui_component::module::{...}; file against the pinned crate.
tests/scripts/agents_md.py:26 — A glob re-export yields the literal name *. Names it brings in are then reported as not public. Scenario: motion/mod.rs:18 has pub use curve::*;, which exports motion::duration, the function agents.md:77 tells apps to use. Adding motion::{duration, ...} to the map gives "FAIL: motion::duration is not public", which is false. Fix: the compile check above handles this too. Otherwise resolve name::* by reading that submodule's top-level pub items.
agents.md:100 — The documented command for script tests is tests/scripts/*.sh. The new check is agents_md.py (renamed from agents-md.sh in round 1), so that glob no longer runs it. Scenario: for t in tests/scripts/*.sh; do bash "$t"; done runs only doctor.sh and references.sh. A map name that drifted from the library goes unnoticed. Fix: list tests/scripts/agents_md.py in the commands section, or make the documented glob cover it.
agents.md:68 / agents.md:73 — The section says its rules are "取自组件库 AGENTS.md". Upstream AGENTS.md contains no rule "不用 request_animation_frame 轮询布局". Its own inspector requests a frame on each render while picking (upstream AGENTS.md:229). The startup chain and the Assets panic come from src/lib.rs:57 and the examples, not from AGENTS.md. Scenario: someone checking the source of the polling ban finds nothing upstream that backs it. Fix: name the real source of each rule. If the polling ban is this project's own rule (it follows from rule 9), state it as that.