Coverage for app / documents / __init__.py: 100%

2 statements  

« prev     ^ index     » next       coverage.py v7.13.4, created at 2026-10-31 11:23 +0000

1""" 

2Documents — structured reports an agent or a skill produces, and their PDF 

3rendering. 

4 

5A document is data first: :class:`~.spec.DocumentSpec`, a title, a summary, 

6findings, a Markdown body with ``[n]`` citations and the sources those cite. 

7The ``render_document`` tool validates one and returns it as a ```document 

8fence, which fe-core draws as a card. The PDF is a *rendering* of that data, 

9made on request by :mod:`.pdf` with no model involved in the layout. 

10 

11- :mod:`.spec` — the schema, and the fence it travels in 

12- :mod:`.images` — the copies of the images a body shows: fetched once when 

13 the document is made, normalised, stored by hash 

14- :mod:`.pdf` — ``render_pdf(spec, images=…)`` → bytes (reportlab; fetches 

15 nothing — the route hands it the stored copies) 

16""" 

17 

18from .spec import ( 

19 DOCUMENT_FENCE_LANGUAGE, 

20 DocumentImage, 

21 DocumentSpec, 

22 StoredDocument, 

23 document_fence, 

24 parse_document_fences, 

25) 

26 

27__all__ = [ 

28 "DOCUMENT_FENCE_LANGUAGE", 

29 "DocumentImage", 

30 "DocumentSpec", 

31 "StoredDocument", 

32 "document_fence", 

33 "parse_document_fences", 

34]