Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Empty paragraphs make room projection non-canonical, failing document descriptions

オープン
#211 コメント 0 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@lavaman131 がすでに取り組んでいます。

2026年9月28日 から。

評価

この issue はまだ評価されていません。

説明

Summary

If a document contains an empty paragraph, its generated description never refreshes. The document-summary background job fails both attempts with:

chopin: background job document-summary <id> attempt 1 failed - Error: Document source is not canonical.
chopin: background job document-summary <id> attempt 2 failed - Error: Document source is not canonical.

The job ends as failed with reason attempts-exhausted:attempt-error. The failing check (apps/server/src/jobs/document-summary.ts:338) runs before any harness call, so this happens with every HARNESS value.

Reproduction

  1. Run with AGENT=on BACKGROUND_JOBS=on, open a document, and type a paragraph.
  2. Leave an empty paragraph anywhere in the document. Pressing Enter at the end is enough, and so is inserting a /research card, which leaves an empty paragraph after it.
  3. Wait for the description debounce (30 s).

The stored snapshot source ends with an extra blank line:

"The harp needs new strings before the spring recital. We have a budget for one octave.\n\n<Research id=\"d5a1b471-…\" />\n\n"

Running serialize(parse(source)) returns the same text with a single trailing \n, so the job's canonical check rejects the source.

This was observed while verifying background workers under HARNESS=atomic (#210). The parent description job succeeded before the Research card was inserted and failed after it. The research jobs themselves completed.

Cause

$exportPlanTree in packages/dialect/src/convert.ts exports each empty Lexical paragraph as an MDAST paragraph with no children. serialize writes that as an extra blank line. parse never produces an empty paragraph, so the room persists source that doesn't survive its own round trip. This violates the "projected to canonical MDX" invariant in AGENTS.md. It happens at the root, between blocks, and inside containers such as blockquotes (> Quoted\n>\n>\n).

Block addressing already ignores these paragraphs. addressable() in apps/server/src/plan/room.ts skips root-level empty paragraphs, and digests() goes through parse.

Expected

Room projection is canonical, and serialize(parse(project(room))) === project(room) holds when the live tree contains empty paragraphs. Description jobs then succeed for these documents.

主要言語
TypeScript
スター
351
フォーク
20
平均マージ
1日 34分
マージ済み PR(30日)
34

環境構築

このプロジェクトの環境構築ファイルはまだ確認していません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

githubnext/chopin のほかの issue

githubnext/chopin の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。