Skip to content

Two readers of one file disagree: front matter, fence info strings, pipe-led setext text #116

Description

@rookslog

Three places where two readers of the SAME file disagree about the same
construct. That is the shape ADR-0016 and the column rule were both written
for: one file must have one reading, or a unit lands under an anchor no reader
sees.

All three are verified on main at a7444f0. None is touched by PR #112.

1. withoutFrontMatter and readFrontmatter disagree about the closer

readFrontmatter in src/catalog.js accepts a front-matter block closed with
----. withoutFrontMatter in src/ground.js wants exactly ---, so it
keeps scanning and takes the NEXT --- in the file as the closer.

---
name: probe
description: d
----

## Rules

Always wear the harness.

---

More prose.

The catalogue loads the skill. contentUnits returns one unit, More prose.
The heading and the directive are inside what the grounding check believes is
front matter, and no refusal fires. A whole section of rules leaves the audit
in silence.

2. A fence info string carrying a backtick

## Rules

```a`b
Always preserve safety.

A reader closes no fence there, because an info string may not contain a
backtick, so the whole thing is a paragraph and the trailing marker opens an
empty code block. The walk opens a fence on the first line and swallows the
directive into a code digest:

units: {"text":"Rules"} {"text":"[code 5e88cfb7]"}
refusals: []


`Always preserve safety.` is a directive a reader sees as prose, and one
designator disposes of it.

## 3. `sections` excludes a pipe-led line from being setext heading text

`src/markdown.js` excludes a line matching `^\s*[-*+|>]` from being the text
above a setext underline. The pipe is in that set, and GFM does not agree.

```markdown
## Rules

| A | B |
---

Always preserve safety.

A reader sees <h2>| A | B |</h2>. The walk reads a table, then a stray ---
unit, then the directive, all under the Rules anchor:

units: "Rules"  "[table 4da27a8d]"  "---"  "Always preserve safety."
refusals: []

Two readings of one file, and the anchor a reader would use never exists.

Reproductions

node p6.mjs for the first, node p1.mjs for the second and third, from the
review scratchpad. Each prints the render beside the units, so the divergence
is a parser fact rather than a reading of the specification.

Found by an independent product review of src/ground.js and
src/markdown.js during PR #112.

Metadata

Metadata

Assignees

No one assigned

    Labels

    defectSomething behaves wronglyengineThe CLI, install, update, uninstall, doctor

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions