commentary Card

Commentary Cards

A commentary card holds the boxholder's anchored remarks about a host card. It is attach-only: it lives in the host's .attach/ scope (<host-basename>.attach/<name>.commentary.card) and the host's view surfaces the remarks inline. The host is whatever the commentary annotates:

A commentary card carries no target of its own — no defaultHref, defaultRef, or targets. The containing host card is the target, and bare {% source %} anchors point at it.

Body — anchor-then-remark

Each comment is a {% source %} anchor (the span being commented on) followed by your remark as ordinary prose:

the exact span the user selected

This overstates it — placement is composer-only, so it isn't a clean superset.

The {% source %} body holds the selected span, verbatim (escaped to valid Markdoc — see below). Your comment is the prose after the tag, outside it. Do not wrap the span in {% quote %}: that tag is reserved for the user's own words (THE LAW OF QUOTING), not a document excerpt you're pointing at.

Turning a <user-selection> into an anchor

When the boxholder selects text in a rendered target and sends it (a <user-selection ref|href="…" pos="…">…</user-selection> in their message), append a {% source %} block:

Your own framing stays outside the tag, as prose. One commentary card per host.

The contains: field

Give this card a one-sentence contains: — the prime retrieval field for bbx search and listings. How to write a good one (carry the information when it's concise, never a list of parts, under 200 characters) is in the agent guide's ABOUT_CARDS section.