test(footnotes): cover footnoteWarnings import plumbing + doc fixes (#169 second review) #171

Merged
vvzvlad merged 1 commits from fix/footnote-review-1227-followup into develop 2026-06-24 16:46:23 +03:00

Follow-up к смерженному #169 — закрывает второй прогон ревью (комментарий #169 (comment 1227)).

Каюсь: #169 я смержил, не увидев второй прогон ревью (1227). Это его правки, отдельным PR в develop.

Warnings

  • Проводка footnoteWarnings для import_page_markdown + контракт «анализ BODY после front-matter» — вынес единый хелпер footnoteWarningsField(markdown)footnote-analyze), используют все три точки (create_page/update_page/import_page_markdown). Новый юнит-тест footnote-warnings-import.test.mjs фиксирует: поле есть при проблемах / опущено на чистом входе, и импорт анализирует тело после блоков docmost:meta/docmost:comments[^x]-токен внутри этих JSON-блоков НЕ предупреждает, реальный маркер в теле — предупреждает. Проверяется той же чистой композицией, что и в импортёре (footnoteWarningsField(parseDocmostMarkdown(full).body)), без подъёма collab-сокета. Регресс, который начал бы анализировать fullMarkdown или пропустил split тела, теперь падает.
  • update_page проводка — закрыта тем же хелпером (S3).

Suggestions

  • footnote.marked.ts шапка — была неверной («Only definitions that have a matching reference are emitted»): orphan-определения эмитятся, sync-плагин редактора потом сверяет. Переписал под first-wins + reuse + reconciliation.
  • derive-id golden-тест — переименовал describe из «(cross-package drift guard)» в «(deterministic-scheme pin)»: второго пакета для дрейфа больше нет.

Architecture (forward-looking, из 1227 — НЕ в этом PR)

Ревьюер рекомендовал не менять в PR: golden-корпус для парности editor-ext↔mcp импорта (Вариант A) и развязку лексера оставить как есть. Если нужно — заведу отдельной задачей.

Проверки: editor-ext 129, MCP 304 (+3), client+server tsc чисто.

🤖 Generated with Claude Code

Follow-up к смерженному #169 — закрывает второй прогон ревью (комментарий #169 (comment 1227)). Каюсь: #169 я смержил, не увидев второй прогон ревью (1227). Это его правки, отдельным PR в develop. ## Warnings - **Проводка `footnoteWarnings` для `import_page_markdown` + контракт «анализ BODY после front-matter»** — вынес единый хелпер `footnoteWarningsField(markdown)` (в `footnote-analyze`), используют все три точки (`create_page`/`update_page`/`import_page_markdown`). Новый юнит-тест `footnote-warnings-import.test.mjs` фиксирует: поле есть при проблемах / опущено на чистом входе, и импорт анализирует **тело** после блоков `docmost:meta`/`docmost:comments` — `[^x]`-токен внутри этих JSON-блоков НЕ предупреждает, реальный маркер в теле — предупреждает. Проверяется той же чистой композицией, что и в импортёре (`footnoteWarningsField(parseDocmostMarkdown(full).body)`), без подъёма collab-сокета. Регресс, который начал бы анализировать `fullMarkdown` или пропустил split тела, теперь падает. - **`update_page` проводка** — закрыта тем же хелпером (S3). ## Suggestions - **`footnote.marked.ts` шапка** — была неверной («Only definitions that have a matching reference are emitted»): orphan-определения эмитятся, sync-плагин редактора потом сверяет. Переписал под first-wins + reuse + reconciliation. - **derive-id golden-тест** — переименовал `describe` из «(cross-package drift guard)» в «(deterministic-scheme pin)»: второго пакета для дрейфа больше нет. ## Architecture (forward-looking, из 1227 — НЕ в этом PR) Ревьюер рекомендовал не менять в PR: golden-корпус для парности editor-ext↔mcp импорта (Вариант A) и развязку лексера оставить как есть. Если нужно — заведу отдельной задачей. Проверки: editor-ext **129**, MCP **304** (+3), client+server `tsc` чисто. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Ghost added 1 commit 2026-06-24 16:45:27 +03:00
Follow-up to the merged #166/#169. Addresses the second review pass (comment
1227):

- footnoteWarnings plumbing: extract a single `footnoteWarningsField(markdown)`
  helper (footnote-analyze) and use it at all three call sites (create_page,
  update_page, import_page_markdown) so the field is attached identically.
- New unit test footnote-warnings-import.test.mjs pins the contract that was
  uncovered: the field is present on problems / omitted on clean input, and the
  IMPORT path analyzes the BODY after the docmost:meta / docmost:comments blocks
  (a footnote-like token inside those JSON blocks must NOT warn; a real body
  marker must). Tested via the same pure composition the importer uses
  (footnoteWarningsField(parseDocmostMarkdown(full).body)) — no collab socket
  needed; a regression that analyzed fullMarkdown or skipped the body split would
  now go red.
- footnote.marked.ts: correct the stale module header — it claimed "only
  definitions that have a matching reference are emitted", which was never true
  (orphan defs are emitted; the editor sync plugin reconciles). Now describes
  first-wins + reuse + sync reconciliation.
- derive-id golden test: rename the describe from "(cross-package drift guard)"
  to "(deterministic-scheme pin)" — there is no second package to drift against.

editor-ext 129, MCP 304 (+3), client+server tsc clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
vvzvlad merged commit 8c06553b49 into develop 2026-06-24 16:46:23 +03:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: vvzvlad/gitmost#171