dsh-modern-web-guidance 0.5.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -68,8 +68,13 @@ calls. Usage counters have existed since 0.2.0, but they never leave the machine
68
68
  | Skill | `chrome-extensions` | Manifest V3 engineering and Chrome Web Store submission guidance |
69
69
 
70
70
  The scanner is report-only. `web_guidance_legacy_scan` takes `paths` (1–16 files or directories, no default target), an
71
- optional `rules` list of up to 30 rule ids, and `format: 'summary' | 'json'`; it reads at most 200 files, 512 kB per file
72
- and 8 MB per call, and returns at most 200 findings.
71
+ optional `rules` list of up to 33 rule ids, and `format: 'summary' | 'json'`; it reads at most 200 files, 512 kB per file
72
+ and 8 MB per call, and returns at most 200 findings. It carries 33 rules, 30 of them upstream's; the
73
+ [parity note](docs/notes/legacy-scan-parity.md) accounts for what is still missing and for the one real debt.
74
+
75
+ The same scan is a human command, `/guidance-scan <paths> [--rules ls-01,ls-13] [--format summary|json]`: it reuses the
76
+ tool's scanner, its refusals and its caps, and refuses to run without at least one explicit path. The panel's scan
77
+ button is the same operation with `.` already filled in.
73
78
 
74
79
  The catalog covers `css`, `ui-atoms`, `ui-components`, `ui-behaviors`, `forms`, `html`, `js`, `accessibility`,
75
80
  `visual-design`, `security`, `performance`, `built-in-ai`, `pwa`, `wasm`, `webmcp`, `privacy`, and `user-experience`.
@@ -118,6 +123,7 @@ reach for it. There are three ways to work with it.
118
123
  | "what is even in here?" | `web_guidance_list` | counts per category, or ids and titles for one category |
119
124
  | "is the catalog actually being used?" | `/guidance-stats` | the local report as text; `--json` is what the panel reads |
120
125
  | "will the code I am about to write or review use a legacy pattern?" | `web_guidance_legacy_scan` | findings for the paths you name explicitly, up to 200 per call |
126
+ | "do it myself, from the terminal" | `/guidance-scan src/` | the same findings as text; `--format json` gives the machine value, `--rules ls-01,ls-13` narrows the table |
121
127
 
122
128
  ### 1. Just ask for web work (default)
123
129
 
@@ -181,17 +187,17 @@ and security budget. The honest split:
181
187
 
182
188
  | | Google `modern-web-guidance` | This plugin |
183
189
  | --- | --- | --- |
184
- | Shape | npm package: a CLI plus skills, run as `npx -y modern-web-guidance@latest …` | DSH plugin: 4 tools, 2 skills, a sidebar panel |
190
+ | Shape | npm package: a CLI plus skills, run as `npx -y modern-web-guidance@latest …` | DSH plugin: 4 tools, 2 skills, 2 human commands, a sidebar panel |
185
191
  | Audience | any agent that can run a shell command | DeepSeek Harness sessions |
186
192
  | Guide corpus | 208 indexed guides (209 `.md` files, one byte-identical duplicate) | the same 208, byte-identical, snapshot `2026_11_09-5bcc021b` |
187
193
  | Lookup | precomputed assets in `gen/` — quantized word vectors (`query-words.i8`, 7.47 MB) and chunk embeddings, 9.16 MB together | BM25 built in-process from `guides.json` and the guide bodies: no assets, no model download (measured 29/30 top-1 on a 30-query probe) |
188
194
  | Runtime dependencies | Node plus the CLI engines shipped in the package | none |
189
195
  | Network | `npx` fetches the package, then works locally | never — the corpus is inside the package |
190
- | Legacy scan | a 4.99 MB `legacy-scan` engine with a four-step scan → verify → report → modernize workflow | shipped in 0.5.0: a dependency-free regex scanner over 30 rules, explicit paths only, report only |
196
+ | Legacy scan | a 4.99 MB `legacy-scan` engine with a four-step scan → verify → report → modernize workflow | shipped since 0.5.0: a dependency-free regex scanner over 33 rules, 30 of them upstream's, explicit paths only, report only — with `/guidance-scan` as its human command since 0.7.0 |
191
197
  | Experimental guides | gated inside the CLI | `[experimental]` marker in `web_guidance_search`, warning banner in `web_guidance_retrieve` |
192
- | Usage insight | none | local counters, `/guidance-stats`, and the sidebar panel |
198
+ | Usage insight | none | local counters, the `/guidance-stats` report, the `/guidance-scan` command and a panel that maps both |
193
199
  | Languages | English guides | the same guides; docs in EN/RU/ZH, panel in EN/RU/ZH |
194
- | Size | — | 256 files, 873 kB packed, 2.5 MB unpacked |
200
+ | Size | — | 256 files, 893 kB packed, 2.6 MB unpacked |
195
201
 
196
202
  What this means in practice: if you work outside DeepSeek Harness, use their package — it is the
197
203
  reference implementation and it owns the corpus. Inside Harness you want the tools in the model's tool
@@ -297,7 +303,9 @@ sides are bounded:
297
303
  - **The scanner reads only what it is given.** `web_guidance_legacy_scan` has no default target: the caller names 1–16
298
304
  paths, each must resolve inside the session workspace, and a symlink that escapes it is skipped rather than followed.
299
305
  It refuses absolute paths, paths outside the workspace and missing paths (`path-absolute`, `path-outside`,
300
- `path-missing`), caps the read at 200 files, 512 kB per file and 8 MB per call, and never writes a byte.
306
+ `path-missing`), caps the read at 200 files, 512 kB per file and 8 MB per call, and never writes a byte. The human
307
+ command `/guidance-scan` goes through the same scanner, so it refuses the same paths and applies the same caps; it
308
+ also refuses to run with no path at all, so nothing can walk the whole workspace by accident.
301
309
  - **The catalog cannot reach outside the package**: entry ids and categories must be slugs, and every resolved path is
302
310
  checked to stay inside the data directory. A tampered `guides.json` used to be able to read any `*.md` on disk.
303
311
  - **Failures retry and stay opaque**: a transient read error no longer poisons the tool for the session, and tool errors
@@ -328,7 +336,9 @@ The report is a human slash command, not a tool the agent can call:
328
336
  counts, per-category hit counts, per-guide retrieve counts, and the last 1000 calls with their query text and returned
329
337
  ids. Misses are the point — a count of misses that cannot be reproduced cannot be fixed.
330
338
 
331
- 0.5.0 adds a fourth row (`legacy-scan`) and a findings total to the same report.
339
+ 0.5.0 adds a fourth row (`legacy-scan`) and a findings total to the same report. 0.7.0 keeps the scan detail with it:
340
+ the rules and guides the findings pointed at, and the last completed scan (when, files read, findings), which the report
341
+ prints as `Most matched rules: …` and `Last scan: …`. That detail is ids and numbers, never a path and never a snippet.
332
342
 
333
343
  Where it lives: the profile's durable storage, the same trust boundary that already holds session logs. Retention
334
344
  defaults to 90 days, and `--reset --yes` erases it.
@@ -340,20 +350,27 @@ Turn it off: set `enabled: false` in the plugin config — no listener is regist
340
350
  ## 🖥 Sidebar panel
341
351
 
342
352
  The plugin adds a client half: a guidance icon in the left rail opens **Guidance Insights** in the central area. It
343
- shows the same counters `/guidance-stats` prints — four tools plus the finding total — as a view:
353
+ draws the counters `/guidance-stats` prints as a map, and answers four questions in that order:
354
+
355
+ - **how much, and how well** — total calls, and a hit rate over the calls that could hit (search hits, search misses and
356
+ unknown ids), with the report's own all-calls rate in the tile's tooltip; a `7 d` / `30 d` switch re-reads the window
357
+ - **when** — calls per day, one bar per day of the window
358
+ - **with what, and how it ended** — calls by tool and by outcome, side by side
359
+ - **what the scanner catches** — the last completed scan, the rules that matched most (up to 10) and the guides those
360
+ findings point at; the button below scans the session workspace folder and shows that run's result inline
344
361
 
345
- - total calls and hit rate for the last 7 days
346
- - the most frequent queries, with hit and miss counts
347
- - category coverage — retrieved guides against the 208 in the corpus
348
- - the queries that found nothing
349
- - how many guides were never retrieved
350
- - the scanner's finding total for the same window
362
+ Below those, the report's lists: the most frequent queries with hit and miss counts, category coverage against the 208
363
+ guides, the queries that found nothing, and the dead guides — listed by id, up to 20.
351
364
 
352
- A single refresh control re-reads the counters; there is nothing else to press.
365
+ Refresh re-reads the counters, and the `7 d` / `30 d` switch sends `/guidance-stats --json --days N` to the host. In a
366
+ conversation, a scan renders as a table — rule, place, confidence, guide — up to 16 rows and an "and N more" count,
367
+ whichever format the call asked for.
353
368
 
354
- The panel is read-only. It never changes a counter, never leaves the machine, and adds no network calls and no new
355
- tools — the same four tools stay exactly four. `/guidance-stats` remains the text and `--json` version for the
356
- terminal and for the agent; the panel is that report as a view.
369
+ The panel is read-only apart from the scan button: it changes no counter, never leaves the machine, and adds no network
370
+ calls and no new tools — the same four tools stay exactly four. A scan it starts is counted like any other scan. Paths
371
+ and snippets stay out of the panel by design: the panel shows counters, not evidence, and the chat row is where files
372
+ and lines appear. `/guidance-stats` remains the text and `--json` version for the terminal and the agent, and
373
+ `/guidance-scan` is the text twin of the button.
357
374
 
358
375
  <a id="configuration"></a>
359
376
 
@@ -361,7 +378,8 @@ terminal and for the agent; the panel is that report as a view.
361
378
 
362
379
  The plugin needs no configuration to work. It registers its tools and skills on the host context and is inert when the
363
380
  profile has no `tools` or `skills` service. The one setting is `enabled` on the plugin row: `false` turns the local
364
- counters off (see [Usage stats](#usage-stats)).
381
+ counters off, and `/guidance-stats` with them; `/guidance-scan` keeps working, because scanning is not counting (see
382
+ [Usage stats](#usage-stats)).
365
383
 
366
384
  <a id="updating-the-guide-corpus"></a>
367
385
 
@@ -397,8 +415,8 @@ dialog", "view transition", "container query"), not sentences. If a query still
397
415
  is volatile in one engine — see [Experimental guides](#experimental-guides). The guide is still the
398
416
  right shape; feature-detect it before shipping.
399
417
 
400
- **What can the legacy scanner actually do?** It is a regex marker scan, not a parser: 30 rules matched
401
- line by line, covering 30 of the 208 guides (14.4 %), with no AST, no data-flow analysis and no autofix —
418
+ **What can the legacy scanner actually do?** It is a regex marker scan, not a parser: 33 rules matched
419
+ line by line, covering 33 of the 208 guides (15.9 %), with no AST, no data-flow analysis and no autofix —
402
420
  it reports and stops. It makes no parity claim with Chrome's own `legacy-scan`, a 4.99 MB engine with a
403
421
  bundled TypeScript compiler; this one is a dependency-free pass that can produce false positives and
404
422
  misses, so treat a finding as a lead to verify, not as a verdict.
@@ -422,7 +440,9 @@ work on their own; the panel additionally needs the host's `slots`, `locale` and
422
440
  | --- | --- | --- |
423
441
  | 0.4.0 | shipped | the upstream v1.0.0 corpus (208 guides) plus experimental marking |
424
442
  | 0.4.1 | shipped | docs: navigation, the comparison, the catalog map |
425
- | 0.5.0 | this release | `legacy-scan` as the fourth tool: 30 regex rules, explicit paths only, report only — `web_guidance_legacy_scan`, with a fourth counter and a findings total in the panel. Design and verdict: [docs/notes/legacy-scan-feasibility.md](docs/notes/legacy-scan-feasibility.md) |
443
+ | 0.5.0 | shipped | `legacy-scan` as the fourth tool: 30 regex rules, explicit paths only, report only — `web_guidance_legacy_scan`, with a fourth counter and a findings total in the panel. Design and verdict: [docs/notes/legacy-scan-feasibility.md](docs/notes/legacy-scan-feasibility.md) |
444
+ | 0.6.0 | shipped | three more rules (`:host-context()`, text balancing, `select:invalid`) take the table to 33 rules, 30 of them upstream's, and a guide-hash guard keeps a rule honest after a corpus refresh |
445
+ | 0.7.0 | shipped | the panel becomes a map rather than a scoreboard — period switch, calls per day, per tool and per outcome, dead guides by id, an honest hit rate, what the scanner catches and a scan button — with `/guidance-scan` as the scanner's human command and a chat table for its findings |
426
446
 
427
447
  Deliberately **not** planned: shipping upstream's 9.16 MB embedding tables, or its 4.99 MB
428
448
  `legacy-scan` engine with a bundled TypeScript compiler. Both would break "zero runtime dependencies,
@@ -453,12 +473,14 @@ no network, no code generation" for a gain the lexical index does not show.
453
473
  npm test
454
474
  ```
455
475
 
456
- `npm test` runs 150 tests across twelve files: `guidance.test.mjs` covers the index, ranking, retrieval and the stemmer;
476
+ `npm test` runs 205 tests across fourteen files: `guidance.test.mjs` covers the index, ranking, retrieval and the stemmer;
457
477
  `plugin.test.mjs` mounts the plugin against a fake Cordis context; `hardening.test.mjs` guards the security invariants;
458
- `report.test.mjs`, `stats.test.mjs`, `store.test.mjs` and `telemetry.test.mjs` cover the counter pipeline;
459
- `scan-core.test.mjs`, `scan-rules.test.mjs` and `scan-tool.test.mjs` cover the scanner's containment, its rule table and
460
- the tool contract, and `scan.test.mjs` is the end-to-end scan; `client-locales.test.mjs` keeps the panel's three
461
- dictionaries in sync. In a sandbox that forbids child processes, run the files directly (`node test/hardening.test.mjs`).
478
+ `report.test.mjs`, `stats.test.mjs`, `store.test.mjs` and `telemetry.test.mjs` cover the counter pipeline and its 0.7.0
479
+ scan fields; `scan-core.test.mjs`, `scan-rules.test.mjs` and `scan-tool.test.mjs` cover the scanner's containment, its
480
+ rule table and the tool contract, `scan.test.mjs` is the end-to-end scan, and `scan-command.test.mjs` holds
481
+ `/guidance-scan` to the same refusals and the same values; `scan-guides.test.mjs` checks the guide hashes the rule table
482
+ points at, and `client-locales.test.mjs` keeps the panel's three dictionaries in sync. In a sandbox that forbids child
483
+ processes, run the files directly (`node test/hardening.test.mjs`).
462
484
 
463
485
  <a id="publishing"></a>
464
486
 
package/README.ru.md CHANGED
@@ -68,8 +68,14 @@ API платформы (нативные `<dialog>`/popover, anchor positioning,
68
68
  | Скилл | `chrome-extensions` | Разработка Manifest V3 и требования Chrome Web Store |
69
69
 
70
70
  Сканер работает только на чтение. `web_guidance_legacy_scan` принимает `paths` (1–16 файлов или каталогов, цели по
71
- умолчанию нет), необязательный список `rules` до 30 id правил и `format: 'summary' | 'json'`; за вызов он читает не
72
- более 200 файлов, до 512 kB на файл и 8 MB суммарно, и возвращает не более 200 находок.
71
+ умолчанию нет), необязательный список `rules` до 33 id правил и `format: 'summary' | 'json'`; за вызов он читает не
72
+ более 200 файлов, до 512 kB на файл и 8 MB суммарно, и возвращает не более 200 находок. В таблице 33 правила, из них
73
+ 30 — правила апстрима; чего до сих пор не хватает и в чём единственный настоящий долг — в
74
+ [заметке о соответствии](docs/notes/legacy-scan-parity.md).
75
+
76
+ Тот же скан доступен человеку командой `/guidance-scan <paths> [--rules ls-01,ls-13] [--format summary|json]`: она
77
+ ходит через тот же сканер, с теми же отказами и лимитами, и не запускается без хотя бы одного явного пути. Кнопка
78
+ сканирования в панели — та же операция, где `.` уже подставлен.
73
79
 
74
80
  Каталог покрывает `css`, `ui-atoms`, `ui-components`, `ui-behaviors`, `forms`, `html`, `js`, `accessibility`,
75
81
  `visual-design`, `security`, `performance`, `built-in-ai`, `pwa`, `wasm`, `webmcp`, `privacy` и `user-experience`.
@@ -117,6 +123,7 @@ dsh plugin --profile desktop add file:E:/path/to/dsh-modern-web-guidance
117
123
  | «что там вообще есть?» | `web_guidance_list` | счётчики по категориям или id и заголовки одной категории |
118
124
  | «каталог вообще используется?» | `/guidance-stats` | локальный отчёт текстом; `--json` — это то, что читает панель |
119
125
  | «код, который я собираюсь написать или проверить, не тянет legacy-паттерн?» | `web_guidance_legacy_scan` | находки по явно перечисленным путям, до 200 за вызов |
126
+ | «хочу прогнать проверку сам, из терминала» | `/guidance-scan src/` | те же находки текстом; `--format json` даёт машинное значение, `--rules ls-01,ls-13` сужает таблицу |
120
127
 
121
128
  ### 1. Просто попросить сделать веб-задачу (обычный режим)
122
129
 
@@ -179,17 +186,17 @@ DeepSeek Harness: инструменты для модели, боковую п
179
186
 
180
187
  | | Google `modern-web-guidance` | Этот плагин |
181
188
  | --- | --- | --- |
182
- | Форма | npm-пакет: CLI плюс скиллы, запуск как `npx -y modern-web-guidance@latest …` | плагин DSH: 4 инструмента, 2 скилла, боковая панель |
189
+ | Форма | npm-пакет: CLI плюс скиллы, запуск как `npx -y modern-web-guidance@latest …` | плагин DSH: 4 инструмента, 2 скилла, 2 человеческие команды, боковая панель |
183
190
  | Аудитория | любой агент, умеющий запускать команды в оболочке | сессии DeepSeek Harness |
184
191
  | Корпус гайдов | 208 проиндексированных гайдов (209 файлов `.md`, один побайтовый дубль) | те же 208, побайтово идентичны, срез `2026_11_09-5bcc021b` |
185
192
  | Поиск | предвычисленные ассеты в `gen/` — квантованные векторы слов (`query-words.i8`, 7.47 MB) и эмбеддинги чанков, 9.16 MB вместе | BM25 строится в процессе из `guides.json` и тел гайдов: без ассетов, без скачивания модели (измерено 29/30 top-1 на пробе из 30 запросов) |
186
193
  | Зависимости рантайма | Node плюс движки CLI, поставляемые в пакете | нет |
187
194
  | Сеть | `npx` скачивает пакет, дальше всё локально | никогда — корпус лежит внутри пакета |
188
- | Сканер legacy | движок `legacy-scan` на 4.99 MB с четырёхшаговым процессом scan → verify → report → modernize | вышел в 0.5.0: сканер регулярными выражениями без зависимостей, 30 правил, только явные пути, только отчёт |
195
+ | Сканер legacy | движок `legacy-scan` на 4.99 MB с четырёхшаговым процессом scan → verify → report → modernize | поставляется с 0.5.0: сканер регулярными выражениями без зависимостей, 33 правила, из них 30 — правила апстрима, только явные пути, только отчёт — а с 0.7.0 у него есть человеческая команда `/guidance-scan` |
189
196
  | Экспериментальные гайды | закрыты внутри CLI | маркер `[experimental]` в `web_guidance_search`, предупреждающий баннер в `web_guidance_retrieve` |
190
- | Анализ использования | нет | локальные счётчики, `/guidance-stats` и боковая панель |
197
+ | Анализ использования | нет | локальные счётчики, отчёт `/guidance-stats`, команда `/guidance-scan` и панель, которая показывает и то и другое |
191
198
  | Языки | гайды на английском | те же гайды; документация на EN/RU/ZH, панель на EN/RU/ZH |
192
- | Размер | — | 256 файлов, 873 kB в упаковке, 2.5 MB распакованного |
199
+ | Размер | — | 256 файлов, 893 kB в упаковке, 2.6 MB распакованного |
193
200
 
194
201
  Что это значит на практике: если вы работаете вне DeepSeek Harness, берите их пакет — это референсная реализация, и
195
202
  корпус принадлежит им. Внутри Harness нужны инструменты в списке инструментов модели, установка без сборки и без сети и
@@ -296,6 +303,8 @@ CLI через `npx`, сохраняет заметки про фреймвор
296
303
  1–16 путей, каждый обязан разрешаться внутри воркспейса сессии, а симлинк, уводящий наружу, пропускается, а не
297
304
  читается. Абсолютные пути, пути за пределами воркспейса и отсутствующие пути он отклоняет (`path-absolute`,
298
305
  `path-outside`, `path-missing`), чтение ограничено 200 файлами, 512 kB на файл и 8 MB на вызов, и он не пишет ни байта.
306
+ Человеческая команда `/guidance-scan` идёт через тот же сканер, поэтому отклоняет те же пути и держит те же лимиты;
307
+ она ещё и не запускается без пути, так что случайно пройтись по всему воркспейсу нечем.
299
308
  - **Каталог не может выйти за пределы пакета**: id и категории записей обязаны быть слагами, и каждый разрешённый путь
300
309
  проверяется на принадлежность каталогу данных. Подменённый `guides.json` раньше мог прочитать любой `*.md` на диске.
301
310
  - **Сбои повторяются и не раскрывают лишнего**: случайная ошибка чтения больше не отравляет инструмент на всю сессию,
@@ -325,7 +334,10 @@ CLI через `npx`, сохраняет заметки про фреймвор
325
334
  счётчики по дням, попадания по категориям, извлечения по гайдам и последние 1000 вызовов с текстом запроса и
326
335
  возвращёнными id. Промахи как раз и нужны — промах, который нельзя воспроизвести, нельзя исправить.
327
336
 
328
- 0.5.0 добавляет в тот же отчёт четвёртую строку (`legacy-scan`) и итог по находкам.
337
+ 0.5.0 добавляет в тот же отчёт четвёртую строку (`legacy-scan`) и итог по находкам. 0.7.0 добавляет к этому
338
+ детализацию: какие правила и гайды дали находки, и последнее завершённое сканирование — когда, сколько файлов
339
+ прочитано, сколько находок; в отчёте это строки `Most matched rules: …` и `Last scan: …`. Только id и числа, ни
340
+ путей, ни сниппетов.
329
341
 
330
342
  Где лежит: durable-хранилище профиля — та же граница доверия, где уже лежат логи сессий. Срок хранения по умолчанию
331
343
  90 дней, `--reset --yes` стирает всё.
@@ -337,22 +349,29 @@ CLI через `npx`, сохраняет заметки про фреймвор
337
349
  ## 🖥 Боковая панель
338
350
 
339
351
  Плагин добавляет клиентскую часть: иконка в левом рейле открывает в центральной области панель
340
- **Guidance Insights**. Это те же счётчики, что печатает `/guidance-stats` (четыре инструмента и итог по находкам),
341
- только в виде экрана:
342
-
343
- - вызовы и доля попаданий за последние 7 дней
344
- - самые частые запросы с числом попаданий и промахов
345
- - покрытие категорий — извлечённые гайды против 208 в корпусе
346
- - запросы, которые ничего не нашли
347
- - сколько гайдов не извлекали ни разу
348
- - итог по находкам сканера за то же окно
349
-
350
- Единственный элемент управления — обновление: одна кнопка перечитывает счётчики. Интерфейс панели переведён на
351
- английский, русский и китайский.
352
-
353
- Панель только читает. Она не меняет счётчики, не покидает машину и не добавляет ни сетевых вызовов, ни новых
354
- инструментов — четыре инструмента остаются ровно четырьмя. `/guidance-stats` остаётся текстовой версией (в том числе
355
- `--json`) для терминала и агента; панель — тот же отчёт в виде экрана.
352
+ **Guidance Insights**. Это те же счётчики, что печатает `/guidance-stats`, но в виде карты: панель отвечает на
353
+ четыре вопроса по порядку:
354
+
355
+ - **сколько и насколько удачно** — всего вызовов и доля попаданий, посчитанная по вызовам, которые вообще могли
356
+ попасть (попадания поиска, промахи поиска, неизвестные id); доля «по всем вызовам», как её считает отчёт, лежит в
357
+ подсказке плитки. Переключатель `7 дн.` / `30 дн.` перечитывает окно
358
+ - **когда** — вызовы по дням, по столбику на день окна
359
+ - **чем и с каким исходом** — вызовы по инструментам и по исходам, рядом
360
+ - **что находит сканер** — последнее завершённое сканирование, чаще всего сработавшие правила (до 10) и гайды, на
361
+ которые указывают эти находки; кнопка ниже сканирует рабочую папку сессии и показывает результат этого прогона тут же
362
+
363
+ Дальше идут списки из отчёта: частые запросы с попаданиями и промахами, покрытие категорий против 208 гайдов,
364
+ запросы без результата и непрочитанные гайды — списком id, до 20.
365
+
366
+ Обновление перечитывает счётчики, а переключатель `7 дн.` / `30 дн.` отправляет хосту
367
+ `/guidance-stats --json --days N`. В диалоге сканирование показывается таблицей — правило, место, уверенность,
368
+ гайд — до 16 строк и «и ещё N», в каком бы формате его ни запросили.
369
+
370
+ Панель только читает, кроме кнопки сканирования: она не меняет счётчики и не покидает машину, сетевых вызовов и
371
+ новых инструментов не добавляет — четыре инструмента остаются ровно четырьмя. Запущенное из неё сканирование
372
+ считается как любое другое. Путей и сниппетов в панели нет намеренно: панель показывает счётчики, а не
373
+ доказательства, — файлы и строки видны в строке вызова в диалоге. `/guidance-stats` остаётся текстовой версией (в том
374
+ числе `--json`) для терминала и агента, а `/guidance-scan` — текстовая пара кнопки.
356
375
 
357
376
  <a id="configuration"></a>
358
377
 
@@ -360,7 +379,8 @@ CLI через `npx`, сохраняет заметки про фреймвор
360
379
 
361
380
  Настройка не нужна, чтобы плагин работал. Он регистрирует инструменты и скиллы на контексте хоста и бездействует,
362
381
  если в профиле нет сервисов `tools` или `skills`. Единственная настройка — `enabled` в конфиге плагина: `false`
363
- выключает локальные счётчики (см. [Статистика использования](#usage-stats)).
382
+ выключает локальные счётчики, а вместе с ними и `/guidance-stats`; `/guidance-scan` продолжает работать, потому что
383
+ сканирование — не подсчёт (см. [Статистика использования](#usage-stats)).
364
384
 
365
385
  <a id="updating-the-guide-corpus"></a>
366
386
 
@@ -396,8 +416,8 @@ CLI через `npx`, сохраняет заметки про фреймвор
396
416
  движке — см. [Экспериментальные гайды](#experimental-guides). Гайд всё равно задаёт правильную форму; проверьте её
397
417
  фича-детектом, прежде чем отгружать.
398
418
 
399
- **Что сканер legacy вообще умеет?** Это маркерный скан регулярными выражениями, а не парсер: 30 правил проверяются
400
- построчно и покрывают 30 из 208 гайдов (14,4 %), без AST, без анализа потока данных и без автоисправлений — он
419
+ **Что сканер legacy вообще умеет?** Это маркерный скан регулярными выражениями, а не парсер: 33 правила проверяются
420
+ построчно и покрывают 33 из 208 гайдов (15,9 %), без AST, без анализа потока данных и без автоисправлений — он
401
421
  отчитывается и останавливается. Паритета с собственным `legacy-scan` Chrome он не заявляет: там движок на 4.99 MB со
402
422
  встроенным компилятором TypeScript, здесь — проход без зависимостей, который может и ошибиться, и пропустить; считайте
403
423
  находку зацепкой для проверки, а не вердиктом.
@@ -421,7 +441,9 @@ CLI через `npx`, сохраняет заметки про фреймвор
421
441
  | --- | --- | --- |
422
442
  | 0.4.0 | вышел | корпус апстрима v1.0.0 (208 гайдов) плюс пометка экспериментальных |
423
443
  | 0.4.1 | вышел | документация: навигация, сравнение, карта каталога |
424
- | 0.5.0 | этот выпуск | `legacy-scan` четвёртым инструментом: 30 правил-регулярок, только явные пути, только отчёт — `web_guidance_legacy_scan`, с четвёртым счётчиком и итогом по находкам в панели. Дизайн и вердикт: [docs/notes/legacy-scan-feasibility.md](docs/notes/legacy-scan-feasibility.md) |
444
+ | 0.5.0 | вышел | `legacy-scan` четвёртым инструментом: 30 правил-регулярок, только явные пути, только отчёт — `web_guidance_legacy_scan`, с четвёртым счётчиком и итогом по находкам в панели. Дизайн и вердикт: [docs/notes/legacy-scan-feasibility.md](docs/notes/legacy-scan-feasibility.md) |
445
+ | 0.6.0 | вышел | ещё три правила (`:host-context()`, балансировка текста, `select:invalid`) — в таблице 33 правила, 30 из них апстрима, плюс страховка по хешам гайдов: после обновления корпуса правило не устареет молча |
446
+ | 0.7.0 | вышел | панель из табло превращается в карту: переключатель окна, вызовы по дням, по инструментам и исходам, непрочитанные гайды списком id, честная доля попаданий, что находит сканер, и кнопка сканирования; плюс `/guidance-scan` — человеческая команда сканера — и таблица находок в диалоге |
425
447
 
426
448
  Намеренно **не** планируется: поставлять таблицы эмбеддингов апстрима на 9.16 MB или его движок `legacy-scan` на
427
449
  4.99 MB со встроенным компилятором TypeScript. И то и другое сломало бы «ноль зависимостей рантайма, никакой сети,
@@ -452,12 +474,14 @@ CLI через `npx`, сохраняет заметки про фреймвор
452
474
  npm test
453
475
  ```
454
476
 
455
- `npm test` запускает 150 тестов в двенадцати файлах: `guidance.test.mjs` покрывает индекс, ранжирование, извлечение и
456
- стеммер; `plugin.test.mjs` монтирует плагин на поддельном контексте Cordis; `hardening.test.mjs` защищает инварианты
457
- безопасности; `report.test.mjs`, `stats.test.mjs`, `store.test.mjs` и `telemetry.test.mjs` покрывают конвейер
458
- счётчиков; `scan-core.test.mjs`, `scan-rules.test.mjs` и `scan-tool.test.mjs` покрывают изоляцию сканера, его таблицу
459
- правил и контракт инструмента, а `scan.test.mjs` — сквозной скан; `client-locales.test.mjs` держит синхронными три
460
- словаря панели. В песочнице, где запрещены дочерние процессы, запускайте файлы напрямую (`node test/hardening.test.mjs`).
477
+ `npm test` запускает 205 тестов в четырнадцати файлах: `guidance.test.mjs` покрывает индекс, ранжирование, извлечение
478
+ и стеммер; `plugin.test.mjs` монтирует плагин на поддельном контексте Cordis; `hardening.test.mjs` защищает инварианты
479
+ безопасности; `report.test.mjs`, `stats.test.mjs`, `store.test.mjs` и `telemetry.test.mjs` покрывают конвейер счётчиков
480
+ и его поля сканера из 0.7.0; `scan-core.test.mjs`, `scan-rules.test.mjs` и `scan-tool.test.mjs` покрывают изоляцию
481
+ сканера, его таблицу правил и контракт инструмента, `scan.test.mjs` — сквозной скан, а `scan-command.test.mjs` держит
482
+ `/guidance-scan` на тех же отказах и тех же значениях; `scan-guides.test.mjs` сверяет хеши гайдов, на которые указывает
483
+ таблица правил; `client-locales.test.mjs` держит синхронными три словаря панели. В песочнице, где запрещены дочерние
484
+ процессы, запускайте файлы напрямую (`node test/hardening.test.mjs`).
461
485
 
462
486
  <a id="publishing"></a>
463
487
 
package/README.zh.md CHANGED
@@ -67,8 +67,11 @@
67
67
  | 技能 | `chrome-extensions` | Manifest V3 开发与 Chrome Web Store 上架要求 |
68
68
 
69
69
  扫描器只读不写。`web_guidance_legacy_scan` 接受 `paths`(1–16 个文件或目录,没有默认目标)、可选的 `rules`(最多
70
- 30 个规则 id)和 `format: 'summary' | 'json'`;每次调用最多读 200 个文件、单文件 512 kB、合计 8 MB,最多返回
71
- 200 条发现。
70
+ 33 个规则 id)和 `format: 'summary' | 'json'`;每次调用最多读 200 个文件、单文件 512 kB、合计 8 MB,最多返回
71
+ 200 条发现。表里一共 33 条规则,覆盖上游 35 条中的 30 条;剩下没覆盖的规则、以及唯一真正的一笔技术债,都记在[对照说明](docs/notes/legacy-scan-parity.md)里。
72
+
73
+ 同一套扫描也给人留了一条命令:`/guidance-scan <paths> [--rules ls-01,ls-13] [--format summary|json]`。它走同一个
74
+ 扫描器、同一套拒绝规则和上限,而且不给至少一个显式路径就不跑。面板上的扫描按钮就是这条操作,只是把 `.` 替你填好。
72
75
 
73
76
  目录覆盖 `css`、`ui-atoms`、`ui-components`、`ui-behaviors`、`forms`、`html`、`js`、`accessibility`、
74
77
  `visual-design`、`security`、`performance`、`built-in-ai`、`pwa`、`wasm`、`webmcp`、`privacy` 和
@@ -116,6 +119,7 @@ bundle 只插入一行(`modern-web-guidance`),不需要构建步骤、依
116
119
  | “这里到底有什么?” | `web_guidance_list` | 各分类数量,或某个分类下的 id 与标题 |
117
120
  | “目录真的有人在用吗?” | `/guidance-stats` | 文本形式的本地报告;`--json` 是面板读取的格式 |
118
121
  | “我正要写或要审的代码会不会用上过时写法?” | `web_guidance_legacy_scan` | 对显式列出的路径给出发现,每次最多 200 条 |
122
+ | “想自己在终端里跑一遍” | `/guidance-scan src/` | 同样的发现,文本形式;`--format json` 给出机器可读的原始值,`--rules ls-01,ls-13` 收窄规则表 |
119
123
 
120
124
  ### 1. 直接提出 Web 开发需求(默认方式)
121
125
 
@@ -176,17 +180,17 @@ web_guidance_search({"query": "view transition"}) → 取回之前的排序候
176
180
 
177
181
  | | Google `modern-web-guidance` | 本插件 |
178
182
  | --- | --- | --- |
179
- | 形态 | npm 包:一个 CLI 加技能,用 `npx -y modern-web-guidance@latest …` 运行 | DSH 插件:4 个工具、2 个技能、一个侧边栏面板 |
183
+ | 形态 | npm 包:一个 CLI 加技能,用 `npx -y modern-web-guidance@latest …` 运行 | DSH 插件:4 个工具、2 个技能、2 条给人用的命令、一个侧边栏面板 |
180
184
  | 受众 | 任何能执行 shell 命令的智能体 | DeepSeek Harness 会话 |
181
185
  | 指南语料 | 208 篇已索引的指南(209 个 `.md` 文件,其中一个是逐字节副本) | 同样的 208 篇,逐字节一致,快照 `2026_11_09-5bcc021b` |
182
186
  | 检索方式 | `gen/` 里预计算好的资源 —— 量化词向量(`query-words.i8`,7.47 MB)与分块 embedding,合计 9.16 MB | 在进程内用 `guides.json` 和指南正文构建 BM25:没有资源文件,不下载模型(在 30 条查询的探针上测得 29/30 的 top-1) |
183
187
  | 运行时依赖 | Node 加上包里附带的 CLI 引擎 | 无 |
184
188
  | 网络 | `npx` 先取包,之后本地运行 | 从不联网 —— 语料就在包里 |
185
- | legacy-scan 扫描 | 4.99 MB 的 `legacy-scan` 引擎,带扫描 → 校验 → 报告 → 现代化四步工作流 | 0.5.0 起内置:零依赖的正则扫描器,30 条规则,只接受显式路径,只输出报告 |
189
+ | legacy-scan 扫描 | 4.99 MB 的 `legacy-scan` 引擎,带扫描 → 校验 → 报告 → 现代化四步工作流 | 0.5.0 起内置:零依赖的正则扫描器,33 条规则(其中 30 条对应上游规则),只接受显式路径,只输出报告;0.7.0 起还多了一条给人用的命令 `/guidance-scan` |
186
190
  | 实验性指南 | 在 CLI 内部做门控 | `web_guidance_search` 结果里的 `[experimental]` 标记,`web_guidance_retrieve` 开头的警告横幅 |
187
- | 使用情况洞察 | 无 | 本地计数、`/guidance-stats` 和侧边栏面板 |
191
+ | 使用情况洞察 | 无 | 本地计数、`/guidance-stats` 报告、`/guidance-scan` 命令,以及把两者都画出来的侧边栏面板 |
188
192
  | 语言 | 英文指南 | 同样的指南;文档 EN/RU/ZH,面板 EN/RU/ZH |
189
- | 体积 | — | 256 个文件,打包 873 kB,解包 2.5 MB |
193
+ | 体积 | — | 256 个文件,打包 893 kB,解包 2.6 MB |
190
194
 
191
195
  实际意味着:如果你在 DeepSeek Harness 之外工作,就用他们的包 —— 它是参考实现,语料也归它所有。在 Harness
192
196
  里面,你要的是工具出现在模型的工具列表里、安装不需要构建步骤也不联网,以及一个能看出指南到底有没有人在用的
@@ -282,7 +286,8 @@ web_guidance_search({"query": "view transition"}) → 取回之前的排序候
282
286
  - **扫描器只读它被明确给定的内容。** `web_guidance_legacy_scan` 没有默认目标:调用方要给出 1–16 个路径,每个路径
283
287
  都必须落在会话工作区内,指向区外的符号链接会被跳过而不是跟随。绝对路径、工作区外的路径和不存在路径会被拒绝
284
288
  (`path-absolute`、`path-outside`、`path-missing`),读取上限为 200 个文件、单文件 512 kB、每次 8 MB,并且它不写
285
- 任何一个字节。
289
+ 任何一个字节。给人用的 `/guidance-scan` 走同一个扫描器,所以拒绝同样的路径、执行同样的上限;它也不接受空路径,
290
+ 因此没有任何命令会顺手把整个工作区扫一遍。
286
291
  - **目录无法越出包外**:条目 id 与分类必须是 slug,每个解析出的路径都会校验是否位于数据目录内。被篡改的
287
292
  `guides.json` 此前可以读取磁盘上任意 `*.md`。
288
293
  - **失败会重试,且不泄露信息**:一次临时的读取错误不再让工具在本次会话中永久失效,错误信息也不再暴露安装的
@@ -312,7 +317,9 @@ web_guidance_search({"query": "view transition"}) → 取回之前的排序候
312
317
  命中次数、各指南被取回次数,以及最近 1000 次调用携带的查询文本和返回的 id。未命中的查询才是重点 —— 无法复现的
313
318
  未命中就无法修复。
314
319
 
315
- 0.5.0 在同一份报告里加了第四行(`legacy-scan`)和一个发现总数。
320
+ 0.5.0 在同一份报告里加了第四行(`legacy-scan`)和一个发现总数。0.7.0 把扫描的细节也留在报告里:命中过哪些规则和
321
+ 指南,以及最近一次完成的扫描(时间、读了几个文件、多少条发现)—— 报告里就是 `Most matched rules: …` 与
322
+ `Last scan: …` 两行。只有 id 和数字,没有路径,也没有代码片段。
316
323
 
317
324
  存放位置:profile 的持久存储,也就是本来就存会话日志的那层信任边界。默认保留 90 天,`--reset --yes` 会立即清空。
318
325
 
@@ -322,27 +329,33 @@ web_guidance_search({"query": "view transition"}) → 取回之前的排序候
322
329
 
323
330
  ## 🖥 侧边栏面板
324
331
 
325
- 插件增加了客户端部分:左侧栏的图标会在中央区域打开 **Guidance Insights** 面板。它展示的就是
326
- `/guidance-stats` 打印的那些计数(四个工具加发现总数),只是换成了界面:
332
+ 插件增加了客户端部分:左侧栏的图标会在中央区域打开 **Guidance Insights** 面板。它把 `/guidance-stats` 打印的计数
333
+ 画成一张地图,按顺序回答四个问题:
334
+
335
+ - **用了多少、准不准** —— 总调用次数,以及按“本来可能命中”的调用算出的命中率(检索命中、检索未命中、未知 id);
336
+ 报告里那个“按全部调用算”的比例放在图块的提示里。`7 天` / `30 天` 开关重新读取时间窗口
337
+ - **什么时候用的** —— 每日调用,一天一根柱子
338
+ - **用什么、结果如何** —— 按工具和按结果的两列并列
339
+ - **扫描器发现了什么** —— 最近一次完成的扫描、命中最多(最多 10 条)的规则,以及这些发现指向的指南;下面的按钮
340
+ 扫描当前会话的工作区文件夹,并把这一次的结果就地显示出来
327
341
 
328
- - 最近 7 天的调用次数与命中率
329
- - 最常出现的查询,以及各自的命中与未命中次数
330
- - 分类覆盖情况 —— 已取回的指南对 208 篇语料
331
- - 什么都没找到的查询
332
- - 有多少篇指南从未被取回过
333
- - 同一时间窗口内扫描器的发现总数
342
+ 再往下是报告里的清单:热门查询及其各自的命中与未命中、对 208 篇指南的分类覆盖、没有结果的查询,以及从未被
343
+ 检索过的指南 —— 按 id 列出,最多 20 条。
334
344
 
335
- 操作只有一个刷新:重新读取一次计数。
345
+ 刷新会重新读取计数,`7 天` / `30 天` 开关则把 `/guidance-stats --json --days N` 发给宿主。对话里,扫描结果渲染成
346
+ 表格 —— 规则、位置、置信度、指南 —— 最多 16 行,多出来的显示“另有 N 条”,不管调用要的是哪种格式。
336
347
 
337
- 面板是只读的。它不改动计数、不离开这台机器,也不新增网络请求和工具 —— 四个工具仍然是四个。
338
- `/guidance-stats` 仍然是给终端和智能体用的文本版本(含 `--json`);面板是同一份报告的界面版本。
348
+ 面板除了扫描按钮之外只读:它不改计数、不离开这台机器,也不新增网络请求和工具 —— 四个工具仍然是四个。由它发起的
349
+ 扫描和别的扫描一样计数。面板里刻意不显示路径和代码片段:面板给的是计数,不是证据;文件和行号在对话的那条工具
350
+ 调用里。`/guidance-stats` 仍然是给终端和智能体用的文本版本(含 `--json`),而 `/guidance-scan` 是按钮的文本版本。
339
351
 
340
352
  <a id="configuration"></a>
341
353
 
342
354
  ## ⚙️ 配置
343
355
 
344
356
  插件不需要配置就能工作。它把工具与技能注册到宿主上下文;如果 profile 没有 `tools` 或 `skills` 服务,它就保持
345
- 静默。唯一的设置是插件配置里的 `enabled`:设为 `false` 就关闭本地统计(见[使用统计](#usage-stats))。
357
+ 静默。唯一的设置是插件配置里的 `enabled`:设为 `false` 就关闭本地统计,`/guidance-stats` 也随之消失;`/guidance-scan`
358
+ 照常可用,因为扫描不是计数(见[使用统计](#usage-stats))。
346
359
 
347
360
  <a id="updating-the-guide-corpus"></a>
348
361
 
@@ -374,8 +387,8 @@ web_guidance_search({"query": "view transition"}) → 取回之前的排序候
374
387
  **为什么结果里写着 `[experimental]`?** 指南讲的平台特性挂在 Origin Trial 后面,或者只在单一引擎里实现、仍
375
388
  不稳定 —— 见[实验性指南](#experimental-guides)。指南本身仍然是正确的方向;上线前先做特性检测。
376
389
 
377
- **legacy 扫描器到底能做什么?** 它是正则标记扫描,不是解析器:30 条规则逐行匹配,覆盖 208 篇指南中的 30 篇
378
- (14.4 %),没有 AST、没有数据流分析、也不自动修复 —— 它只报告,然后停下。它不声称与 Chrome 自己的
390
+ **legacy 扫描器到底能做什么?** 它是正则标记扫描,不是解析器:33 条规则逐行匹配,覆盖 208 篇指南中的 33 篇
391
+ (15.9%),没有 AST、没有数据流分析、也不自动修复 —— 它只报告,然后停下。它不声称与 Chrome 自己的
379
392
  `legacy-scan` 等价:那边是 4.99 MB、内置 TypeScript 编译器的引擎,这里是零依赖的扫描过程,既可能误报也可能漏报,
380
393
  所以把发现当成待核实的线索,而不是结论。
381
394
 
@@ -396,7 +409,9 @@ web_guidance_search({"query": "view transition"}) → 取回之前的排序候
396
409
  | --- | --- | --- |
397
410
  | 0.4.0 | 已发布 | 上游 v1.0.0 语料(208 篇指南)加实验性标记 |
398
411
  | 0.4.1 | 已发布 | 文档:导航、对比表、目录地图 |
399
- | 0.5.0 | 本次发布 | `legacy-scan` 作为第四个工具:30 条正则规则,只接受显式路径,只输出报告 —— `web_guidance_legacy_scan`,面板里多一个计数器和一个发现总数。设计与结论:[docs/notes/legacy-scan-feasibility.md](docs/notes/legacy-scan-feasibility.md) |
412
+ | 0.5.0 | 已发布 | `legacy-scan` 作为第四个工具:30 条正则规则,只接受显式路径,只输出报告 —— `web_guidance_legacy_scan`,面板里多一个计数器和一个发现总数。设计与结论:[docs/notes/legacy-scan-feasibility.md](docs/notes/legacy-scan-feasibility.md) |
413
+ | 0.6.0 | 已发布 | 再多三条规则(`:host-context()`、文本平衡、`select:invalid`),规则表增至 33 条,其中 30 条对应上游规则;另加指南哈希校验,语料更新后规则不会悄悄过期 |
414
+ | 0.7.0 | 已发布 | 面板从计分板变成地图:时间窗口开关、每日调用、按工具与按结果、按 id 列出的未读指南、诚实的命中率、扫描器发现了什么,外加一个扫描按钮;同时加入 `/guidance-scan` 这条给人用的扫描命令,以及对话里的发现表格 |
400
415
 
401
416
  刻意**不**做的:内置上游那 9.16 MB 的 embedding 表,或者它那个附带 TypeScript 编译器的 4.99 MB `legacy-scan`
402
417
  引擎。两者都会破坏“零运行时依赖、不联网、不生成代码”,而换来的收益在词法索引上根本看不出来。
@@ -426,11 +441,13 @@ web_guidance_search({"query": "view transition"}) → 取回之前的排序候
426
441
  npm test
427
442
  ```
428
443
 
429
- `npm test` 会跑 150 个测试,分布在十二个文件里:`guidance.test.mjs` 覆盖索引、排序、取回与词干器;
444
+ `npm test` 会跑 205 个测试,分布在十四个文件里:`guidance.test.mjs` 覆盖索引、排序、取回与词干器;
430
445
  `plugin.test.mjs` 用模拟的 Cordis 上下文挂载插件;`hardening.test.mjs` 守住安全不变量;`report.test.mjs`、
431
- `stats.test.mjs`、`store.test.mjs` 和 `telemetry.test.mjs` 覆盖计数管线;`scan-core.test.mjs`、`scan-rules.test.mjs`
432
- 和 `scan-tool.test.mjs` 覆盖扫描器的隔离、规则表与工具契约,`scan.test.mjs` 是端到端扫描;`client-locales.test.mjs`
433
- 保证面板的三份词典保持同步。在禁止子进程的沙箱里,请直接运行文件(`node test/hardening.test.mjs`)。
446
+ `stats.test.mjs`、`store.test.mjs` 和 `telemetry.test.mjs` 覆盖计数管线及其 0.7.0 的扫描字段;
447
+ `scan-core.test.mjs`、`scan-rules.test.mjs` 和 `scan-tool.test.mjs` 覆盖扫描器的隔离、规则表与工具契约,
448
+ `scan.test.mjs` 是端到端扫描,`scan-command.test.mjs` 则要求 `/guidance-scan` 拒绝同样的路径、返回同样的值;
449
+ `scan-guides.test.mjs` 校验规则表指向的指南哈希;`client-locales.test.mjs` 保证面板的三份词典保持同步。在禁止
450
+ 子进程的沙箱里,请直接运行文件(`node test/hardening.test.mjs`)。
434
451
 
435
452
  <a id="publishing"></a>
436
453