Implementation:7onez Cti expert House Report Build
| Knowledge Sources | |
|---|---|
| Domains | OSINT, Reporting |
| Last Updated | 2026-10-28 14:00 GMT |
Overview
Concrete tool for composing a case directory into a house-style PDF/DOCX report with figures, screenshots, and analytic charts, provided by the cti-expert IntelReport module.
Description
The build function in house_report.py is the deterministic (zero-LLM) report renderer. It reads a case directory (KB, raw evidence, assessment, clusters, timeline, captures), composes house-style markdown, and renders it to PDF + DOCX via pandoc/xelatex/weasyprint. The function:
- Generates figures (sector graph, relationship diagram, attribution chain, timeline) — or reuses existing ones under --no-figures.
- Captures missing landing pages through the egress policy (screenshots), reusing existing captures.
- Builds analytic charts (confidence scatter, heatmaps, entity map).
- Composes the markdown following IntelReport house rules (0–23), normalizes dashes, and writes <stem>.house.md.
- Renders via render_report.py to PDF + DOCX with --classification and --audience flags.
The mask_personas flag redacts PII in the neighbour personas table. The md_only flag skips rendering and returns the composed markdown.
Usage
Import this when you need to:
- Render a finished case into a house-style PDF + DOCX report.
- Compose the report markdown without rendering (md_only for review).
- Capture missing landing-page screenshots through the egress policy.
- Redact PII in persona tables (mask_personas).
Code Reference
Source Location
- Repository: cti-expert
- File: intel_engine/tools/house_report.py
- Lines: L1516-1648 (build), L1616 (main CLI)
Signature
def build(case_arg: str, stem: str | None, classification: str, audience: str,
no_figures: bool, md_only: bool, screenshots: bool = True,
max_screenshots: int = 40, screenshot_timeout: int = 30, archives: bool = True,
mask_personas: bool = False) -> dict:
"""Case dir -> house-style PDF + DOCX + figures + glossary + dossiers."""
Import
from house_report import build
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| case_arg | str | Yes | Case ID or case dir path |
| stem | str | None | Output filename stem (auto if None) |
| classification | str | Yes | TLP level (e.g. "TLP:AMBER") |
| audience | str | Yes /// "technical", "executive", "le" | |
| no_figures | bool | Yes | Skip figure generation, reuse existing |
| md_only | bool | Yes /// Compose markdown only, no render | |
| screenshots | bool | No /// Capture missing landing pages (default True) | |
| mask_personas | bool | No /// Redact PII in persona tables (default False) |
Outputs
| Name | Type | Description |
|---|---|---|
| out | dict | {markdown, pdf, docx, landing_pages, analytic_charts, ...} |
Usage Examples
Full Report Build
from house_report import build
out = build(
case_arg="CASE-0001",
stem=None, # auto: CTI-REPORT-CASE-0001-2026-10-28
classification="TLP:AMBER",
audience="technical",
no_figures=False,
md_only=False,
screenshots=True,
)
print(out["pdf"]) # cases/CASE-0001/report/CTI-REPORT-...pdf
print(out["docx"]) # cases/CASE-0001/report/CTI-REPORT-...docx
Markdown Only (Review Before Render)
out = build(
case_arg="CASE-0001",
stem="review-draft",
classification="TLP:RED",
audience="le",
no_figures=True, # reuse existing figures
md_only=True, # markdown only, no PDF/DOCX
)
print(out["markdown"]) # cases/CASE-0001/report/review-draft.house.md