Skip to content

Releases: ForLegalAI/LegalDown

LegalDown v0.2

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.

LegalDown v0.1

Choose a tag to compare

@dvejsada dvejsada released this 14 Aug 11:06
59854d8

First published version of the LegalDown specification — a plain-text markup language for legal documents. A CommonMark superset with legal-specific constructs: structured sections, stable cross-references, defined terms, typed field specs, and party references, so legal documents are human-readable, machine-parseable, and version-control native.

Highlights

  • No hardcoded numbers, ever. Section numbering, list enumeration, and cross-reference text are generated at render time — reorder freely, nothing breaks. Anchors work on headings, list items, and paragraphs, so clause-level references ("Section 4.2(b)") stay stable too.
  • Definitions the way lawyers write them — in a definitions article or inline at first use, with eight quotation-mark conventions covering the major Western legal languages.
  • A formal directive grammar with quoted values and defined recognition contexts, and a deterministic identifier algorithm, so independent implementations agree byte-for-byte.
  • 98 validation rules with stable rule ids (heading-skip, ref-broken, include-cycle…), each with a severity and a conformance level (Core / Rendering / Full).
  • Bilingual documents as linked files with a primary/translation model; amendments that import the original's definitions; includes and attachments on one shared fragment model; templates via inline and frontmatter placeholders.

In this repository

spec/legaldown-spec.md The specification (18 sections)
llm/legaldown-spec-llm.md Condensed reference for language models
examples/ Working documents — a simple tier and an advanced tier exercising every feature
fixtures/ Conformance corpus: 95 cases, one per mechanically testable validation rule
CONTRIBUTING.md How to propose changes

Status

v0.1 is an early draft standard: complete and internally consistent, published to gather implementation experience and community feedback. Breaking changes remain possible before v1.0 and will be recorded in the CHANGELOG with migration notes. Deliberate deferrals are listed in the specification's §18 (Roadmap and Known Limitations).

Feedback via Discussions; errors and ambiguities via Issues.

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