Expand description
summary — the deterministic default-summary composer.
Used by dbmd fm init and dbmd write when the agent doesn’t supply a
summary. compose_default dispatches on type to the per-type
composers, matching SPEC.md’s “Deterministic defaults per type” table.
Contract every composer upholds: deterministic (same
(type, frontmatter, body) → same string), single-line (newlines
collapsed to spaces), and capped at 200 chars (the SPEC readability
bound). The tool generates a deterministic floor; the agent provides the
ceiling via dbmd fm set <file> summary='...'.
Constants§
- MAX_
SUMMARY_ LEN - The SPEC’s
summarylength bound, in characters.
Functions§
- compose_
company company→<relationship>; <industry>.- compose_
contact contact→<role> at <company-name> (last_touch: <date>). Resolves thecompanywiki-link to read the company’sname.- compose_
decision decision→<decided_by>: <title-or-first-heading>.- compose_
default - Compose a deterministic default
summaryfor a file from itstype, frontmatter, and body. Dispatches to the per-type composer; unknown/custom types fall back to the first non-heading paragraph of the body. The result is always single-line and ≤MAX_SUMMARY_LENchars. - compose_
email email→<from> → <to> — <subject>.- compose_
expense expense→<date> — <amount> <currency> — <vendor>.- compose_
from_ body - Unknown / custom types → the file’s first non-heading paragraph, truncated
to
MAX_SUMMARY_LENchars (the truncation is applied bynormalize). - compose_
invoice invoice→<vendor> — <amount> — <status>.- compose_
meeting meeting→<date> — <first 3 attendees> (+N more)when more than three attendees are present.- compose_
pdf_ source pdf-source→<doc_type> from <received_from>.- compose_
transcript transcript→<recorded_at> — <attendees>.- compose_
wiki_ page wiki-page→ thetopicfrontmatter field, else the file’s first non-heading paragraph.- normalize
- Normalize any candidate summary to the contract: collapse runs of
whitespace (including newlines) to single spaces, trim, and truncate to
MAX_SUMMARY_LENchars (never splitting a UTF-8 codepoint). Every composer runs its output through this.