Repository navigation
Description
Problem
A .md file that starts with YAML front matter is destroyed by one open → save cycle in the id web editor. The front matter is not preserved, hidden, or rejected — it is silently rewritten into unrelated document structure.
Evidence (verified this run on main 0cbb91b1)
Probe: verbatim copy of pkgs/id/src/web/markdown.rs in a standalone crate (comrak 0.56.0), markdown_to_prosemirror → prosemirror_to_markdown round-trip. Logs: fleet bookkeeping probe-2026-10-27-creator-a/out.log + out4.log.
Input:
---
title: Hello World
date: 2026-01-02
tags: [a, b]
---
# Heading
Body text.Parsed PM doc: a horizontal_rule, then a level-2 heading whose text is title: Hello World date: 2026-01-02 tags: [a, b] (the YAML lines fused by soft breaks; the closing --- became the setext underline), then the real heading and body.
Saved output:
-----
## title: Hello World date: 2026-01-02 tags: \[a, b\]
# Heading
Body text.The front matter is gone as metadata: any static-site/tooling consumer of the file loses title/date/tags, and the document gains a spurious rule and a nonsense heading. The mangled form is a fixpoint, so the loss is silent and permanent after the first save. A blank line inside the YAML block mangles differently again (first key becomes a paragraph, a later key becomes the heading) — no front-matter shape survives.
Root cause: commonmark_options (pkgs/id/src/web/markdown.rs:81-91) enables strikethrough/tasklist/table/footnotes but not comrak's front-matter support, and the codec has no node representation for front matter, so the --- fences parse as a thematic break + setext heading.
Why it matters
Front matter is the default header format for markdown notes and docs (Obsidian, Hugo, Jekyll, Astro, Docusaurus, GitHub Pages). id is a general markdown file editor; any user who opens such a file and saves — including an unrelated one-character edit, or autosave — silently corrupts the file's metadata and structure. Same loss class as #1306/#1307 (plain-mode fidelity), but for the much more common .md path.
Acceptance criteria
- A
.mddoc beginning with YAML front matter round-trips byte-identically (or semantically identically with the front-matter block verbatim) through open → save, including multi-key blocks, blocks containing blank lines, and a doc whose body starts with a heading or with plain text. - The front matter is not editable-as-body by accident: whatever representation is chosen (dedicated PM node, codec-level strip-and-restore, or equivalent), the editor does not present the YAML lines as a heading/paragraph the user can half-delete.
- A leading
---that is NOT front matter (e.g. a thematic break after a paragraph,Para one.\n\n---\n\nPara two.) still round-trips as a horizontal rule — verified control case in the probe. - Regression tests in
pkgs/id/src/web/markdown.rscover the shapes above (round-trip + fixpoint), mirroring the existing codec test style. - TOML (
+++) front matter is either supported the same way or explicitly documented as out of scope in the fix PR.
Activity
developing-today commentedon Oct 27, 2026
CODE-465
dezren39 commentedon Oct 27, 2026
🤖 Agent note · filed
---must keep round-tripping as a rule.dezren39 commentedon Oct 27, 2026
Intake review
Front matter is destroyed by one open-save cycle: fences become a horizontal rule plus a setext heading and the YAML lines fuse into body text (probe on main 0cbb91b). Silent data corruption on a common file shape. Risk: a fix must not break documents that legitimately start with
---. Suggested approach: detect a leading front-matter block in the codec, carry it as an opaque/preserved node (or out-of-band metadata) through the PM doc, and re-emit it verbatim on save; round-trip regression test with the probed input.Related: Related: #1370 (same codec round-trip family).
Still live: checked this run — no merged PR in the recent merged list of this repo implements or resolves this issue, and no closing reference was found; the issue stays open.
🤖 Agent note · filed
50 remaining items
dezren39 commentedon Nov 3, 2026
Handed off: task 7467 (triage, issue #1369) was re-claimed by lane code-l and assigned to the opencode execution lane. The laptop claimant launches the bound opencode session, which drives task 7467 to its terminal state. Lead preserved from the prior checkpoint: triage was done under task 1340 and the fix task 1675 was parked 2026-10-28 on a laptop SSH outage — verify task 1675's state and the latest notes on issue #1369, and fix any desynced labels. Labels synced to this claim (queue/claimed + status/in-progress + work/assigned; stale queue/needs-review + status/needs-review removed). This note also replaces the handoff note for issue #1369 that failed with a GitHub secondary rate limit 403 at 2026-11-03T11:44Z.
dezren39 commentedon Nov 3, 2026
🤖 Agent note · handed off
dezren39 commentedon Nov 3, 2026
🤖 Agent note · handed off
ses_e5e5df8d0d5ffeNn6FW4jz2mLYrepo-worker-code(bound worker uses this id for all queue helper verbs)opencode-route/workhorse, agentbuilddeveloping-today commentedon Nov 3, 2026
agent-note:v1
state: reviewed (coverage loop-back)
Coverage pass 2026-11-03, loop-back review: this issue was re-reviewed (drift / overlap / already-handled / stale / blockers / ordering) so every open issue in the four repos is reviewed and in the system. Verdict: still live; in the system as task 7467 (triage, claimed, priority 30) in repo-health-code-pilot. Labels audited and synced. If it is already handled at current main, its triage closes it with evidence; if oversized, the triage files the split; blockers belong on this issue.
Found via: coverage loop-back 2026-11-03