Skip to content

LegalDown v0.2

Latest

Choose a tag to compare

@dvejsada dvejsada released this 23 Sep 10:43
5f3fceb

The template release. LegalDown v0.2 brings template logic into the format itself — questions, optional and alternative clauses, inline choices, drafting guidance, and a deterministic way to turn a template and a set of answers into a finished document. A user who moves their .lgd files to another tool now takes their template logic with them (#38).

Highlights

  • Questions (§15.2) — declare what a template asks: prompts and defaults for blanks, plus yes/no and multiple-choice decisions.
  • Conditions on whole clauses (§15.3) — # Non-Solicitation {#non-solicit when=non-solicit}, when=!q, when=forum:arbitration on sections, list items, paragraphs, includes, and attachments. One test per condition, no expression language, no English keywords.
  • Alternatives (§15.4) — either/or clauses can share one identifier, so {{ref: disputes}} always resolves to the version that was chosen.
  • Inline choices (§15.5) — {{choose: forum, courts="…", arbitration="…"}} for a phrase that varies inside a sentence; every answer must be listed.
  • Drafting notes (§15.6) — > [!DRAFTING] guidance for the template user, shown in template views and removed on assembly.
  • Assembly (§15.7) — template + answers set → ordinary LegalDown, byte-identical across implementations. A template that validates without Errors assembles into a document without Errors for every valid answers set.
  • A final check (§15.9) that rejects any blank, drafting note, or template construct left in a document meant for signature, and a new Assembly conformance capability (§17.6).

Upgrading from v0.1

Most v0.1 documents are unaffected. A few now draw Errors or Warnings — one blank with two different currencies, a non-date placeholder in a date field, a blank glued to Markdown punctuation, an anchor on an include-only line. Sections 15–18 are renumbered 16–19; rule ids are unchanged. See Migration from 0.1 in the CHANGELOG.

In this repository

spec/legaldown-spec.md The specification (19 sections; templates are §15)
llm/legaldown-spec-llm.md Condensed reference for language models
examples/ Working documents, including a full template with an answers set
fixtures/ Conformance corpus: 113 rule cases plus six byte-exact template assembly cases
proposals/templates.md Design record for the template language

Status

v0.2 is an early draft standard, published to gather implementation experience. Template assembly (§15.7) especially would benefit from a reference implementation and a larger corpus — feedback via Discussions, errors and ambiguities via Issues. Breaking changes remain possible before v1.0 and will be recorded in the CHANGELOG with migration notes.

The specification is licensed under CC BY 4.0. Implementations may use any license.