Skip to content

Commit 456c3d5

Browse files
authored
docs(skills): describe Comark authoring recovery and repairs (#1754)
Signed-off-by: phernandez <paul@basicmachines.co>
1 parent 58ae438 commit 456c3d5

3 files changed

Lines changed: 58 additions & 8 deletions

File tree

‎skills/memory-comark/SKILL.md‎

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,9 @@ Rules that matter:
6868
`bm-kanban`; people can tick boxes from the rendered note.
6969
- **Never put HTML, scripts, styles, or classes in a note**, and never wrap a
7070
component in a code fence (a fenced block stays literal code).
71-
- **Use only registered props.** An unknown attribute makes the directive
72-
unparseable, and it shows as raw text.
71+
- **Use only registered props.** An unknown attribute produces `prop-unknown`
72+
in a warning frame with the original source and registered props; it is never
73+
silently dropped.
7374

7475
A checklist and a board:
7576

@@ -158,8 +159,11 @@ as a snapshot in prose and keep them in the chart's row grammar.
158159
- The rich editor normalizes formatting when a person edits the note: attribute
159160
order changes and YAML blocks come back as JSON. Values survive; do not fight
160161
the formatting.
161-
- Keep the closing `::` lines. An unclosed component swallows the rest of the
162-
note into its body.
162+
- Keep the closing `::` lines. A block with a body but no close produces
163+
`directive-unclosed`; the opener and YAML props appear in a warning while
164+
following Markdown stays visible. Add the close at the intended boundary in
165+
source; the editor never guesses it. Standalone leaves with no body remain
166+
valid, though new components should use explicit closes.
163167

164168
## When a component shows an error
165169

@@ -172,6 +176,8 @@ codes you will meet most:
172176

173177
| Code | Meaning | Fix |
174178
| --- | --- | --- |
179+
| `prop-unknown` | A prop the component does not accept | Remove it or use a registered prop from the warning or reference |
180+
| `directive-unclosed` | A block with a body is missing its close | Add `::` at the intended boundary in Markdown source |
175181
| `query-measure` | The chart has no number per row | Add `group`, `count`, or `sum`, or use `search` |
176182
| `query-series` | A trend from one value | Use `group`, `daily`, or `search` with `limit` ≥ 2 |
177183
| `query-escaped-quote` | `\"` inside a query | Use single quotes inside the query |
@@ -180,8 +186,12 @@ codes you will meet most:
180186
| `chart-body-empty` | No rows in the body | Add `- label: value` rows |
181187
| `chart-body-number` | A row without a number | Every row needs a numeric value |
182188

183-
An unknown component or attribute is not drawn at all and shows as raw text;
184-
check names and props against the reference.
189+
Unknown props preserve the original directive and data through nearby rich
190+
edits. Closed malformed components can use a reviewed agent replacement and
191+
undo; missing-close repairs require source editing. Canonical validation and
192+
strict export reject malformed source until repaired. Never author internal
193+
recovery nodes such as `bm-problem`. Check component names and props against the
194+
reference.
185195

186196
## Checklist
187197

‎skills/memory-comark/references/components.md‎

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Of these, thirty-one form the deterministic Markdown Graphs vocabulary that stri
6161

6262
## Use the directive form
6363

64-
Every component is a block directive and must close:
64+
Author components as closed block directives:
6565

6666
```markdown
6767
::bm-meter{title="Migration" value="0.67" ticks="14" caption="Users table" tone="positive"}
@@ -70,6 +70,35 @@ Every component is a block directive and must close:
7070

7171
Do not put the directive inside a code fence when it should render. Do not treat a code fence as a component when parsing or exporting.
7272

73+
### Authoring errors and repairs
74+
75+
Unknown props produce `prop-unknown`, with the component name, source line and
76+
registered props. For example, `colour="red"` on `bm-bars` is rejected; it is
77+
never silently discarded. The reader and rich editor show the affected block in
78+
its own warning frame with the original directive and data. The rest of the note
79+
continues rendering, and editing nearby prose preserves the malformed source.
80+
Remove the unknown prop or replace it with a registered one in Markdown source.
81+
A closed malformed component also supports a reviewed component replacement and
82+
undo through the agent tools.
83+
84+
A block with a body but no closing `::` produces `directive-unclosed` near its
85+
opener. Its warning preserves the opener and any leading YAML properties while
86+
following headings, lists and prose stay visible outside the frame. Repair the
87+
source by adding `::` at the intended boundary; the editor never guesses where
88+
the block ends. Agent component replacements cannot safely claim the rest of an
89+
unclosed block, so use source editing for this repair.
90+
91+
Existing standalone leaf directives with no body remain valid, though new
92+
components should use the closed block form above. Nested blocks each need their
93+
own close. Directive lookalikes inside code fences and escaped literals remain
94+
literal Markdown.
95+
96+
These diagnostics use the same shared parser in browser rendering, WebMCP and
97+
the Cloud Comark analyzer. Canonical validation and strict Wiki export reject
98+
malformed source until repaired. Warning frames are recovery behavior, not a
99+
new authored vocabulary: never write `bm-problem` or other internal transport
100+
nodes in a note.
101+
73102
### Two attribute forms
74103

75104
Inline braces are the compact form. A leading YAML property block, fenced by `---` lines, is the equivalent long form and is required for structured array data.

‎src/basic_memory/man/man7/comark(7).md‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ message.
103103
| --- | --- |
104104
| `unknown-element` | The name is not a registered component |
105105
| `invalid-attribute` | An attribute the component does not accept |
106+
| `prop-unknown` | An unknown prop; the warning preserves source and lists registered props |
107+
| `directive-unclosed` | A block with a body has no closing `::`; repair its source boundary |
106108
| `invalid-attribute-value` | A value outside the attribute's closed set or range |
107109
| `missing-attribute` | A required attribute is absent |
108110
| `invalid-chart-body` | The body does not fit the chart; see the `chart-body-*` code |
@@ -118,6 +120,15 @@ message.
118120
Other `chart-body-*` and `query-*` codes follow the same pattern: the suffix
119121
names the part of the body or pipeline that is wrong.
120122

123+
Unknown props preserve the original directive and data in their warning frame,
124+
including through nearby rich edits. Missing-close warnings preserve the opener
125+
and YAML properties while following Markdown stays visible. Add the close at
126+
the intended boundary in source; the editor never inserts a guessed close.
127+
Reviewed agent replacements and undo can repair closed malformed components;
128+
an unclosed block requires source editing. Canonical validation and strict
129+
export reject malformed source. Internal recovery nodes such as `bm-problem`
130+
are never authored.
131+
121132
## CHECKING YOUR WORK
122133

123134
In Basic Memory Cloud:
@@ -146,7 +157,7 @@ The queue rewrite more than doubled steady-state throughput.
146157

147158
## GOTCHAS
148159

149-
- [gotcha] An unclosed component swallows the rest of the note into its body.
160+
- [gotcha] An unclosed block with a body shows `directive-unclosed`; following Markdown stays visible. Standalone leaves with no body remain valid, but author new components with explicit closes.
150161
- [gotcha] A component inside a code fence is literal code and is not drawn.
151162
- [gotcha] The rich editor normalizes attribute order and formatting; values survive.
152163
- [gotcha] A query over a field no note has renders an empty view, not an error.

0 commit comments

Comments
 (0)