Skip to main content

Module summary

Module summary 

Source
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 summary length bound, in characters.

Functions§

compose_company
company<relationship>; <industry>.
compose_contact
contact<role> at <company-name> (last_touch: <date>). Resolves the company wiki-link to read the company’s name.
compose_decision
decision<decided_by>: <title-or-first-heading>.
compose_default
Compose a deterministic default summary for a file from its type, 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_LEN chars.
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_LEN chars (the truncation is applied by normalize).
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 → the topic frontmatter 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_LEN chars (never splitting a UTF-8 codepoint). Every composer runs its output through this.