A template pack is a document authored once and reused for every matter: an engagement letter, a board resolution, a filing form. Instead of someone re-typing the same document and pasting in names and dates, the pack declares the variables it needs, and Opbox fills them from the matter’s facts when the document is generated. Each pack is versioned, classified, and mapped, so a generated document is reproducible, auditable, and refuses to be produced with a required field left blank.
What it does
A pack is a body plus classified merge variables. When you register a template pack you give it a key, a title, the document body, and a set of merge variables. Every variable carries a classification: required, optional, computed, or system. That classification is not cosmetic, it is the source the coverage gate reads at generation time. The kernel validates the classification of each variable when the pack is registered, so a pack can never carry a malformed variable spec.
Generation runs under a coverage gate. Generate a document from a pack and Opbox walks the classified variables, resolving each from the payload you supply. If a required variable has no meaningful value, generation is blocked before any document is produced, and the structured error names the specific variables that are missing. An optional variable that is missing does not block, it leaves a visible marker in the output rather than disappearing silently. The result is that a generated document is either complete against its declared requirements or it does not exist.
The template version is pinned at generation time. A generation pins the pack’s current published version the moment it runs. Republishing the pack later with new wording never reshapes a document that was already generated, and a generation is recorded against the exact pack version that produced it. A pack that is still a draft (not published) cannot generate at all.
Every generation is recorded, success or failure. Each generation writes a snapshot carrying its status, the payload, the coverage report, and the fidelity check. A blocked generation records BLOCKED, a generation that fails the fidelity check records FAILED, and a successful one records COMMITTED and lands the produced content as a first-class document on the matter. Nothing about a generation is silent: the coverage verdict, the filled variables, and the missing ones are all on the record.
A self-re-parse fidelity guard. After producing its output, a generation re-parses what it produced. A generation whose output does not round-trip faithfully is failed rather than accepted, so a document that would not survive being re-read is never quietly committed.
Extraction mapping ties variables to source fields. A pack carries an extraction mapping: each merge variable mapped to the source field it draws from. This is the map that drives generation, and setting it is an admin authoring action because it determines the regulated render output. The mapping is replaced as a whole object, so the pack’s current mapping is always the one you last set.
Versioning, publishing, and archive. A pack moves through a lifecycle: a draft is registered, a version is minted, and publishing makes a version the current one (draft to active). Versions are the generic version primitive underneath, so you can read a version, list the versions, mint a new one, or roll back to an earlier one. A pack that is no longer in use can be archived out of the active listing.
AcroForm fill and PDF bundling. Beyond prose templates, the same area fills the named fields of a fillable PDF form (an AcroForm), and compiles an ordered set of PDFs into a single bundle with dividers and a paginated table of contents. Both produce finished files you can attach to the matter.
PDF annotation. A rendered PDF can carry typed page-geometry annotations (a bounding box, an arrow, a comment) anchored to an exact position on a page, and those annotations can be read back or removed.
How you use it
Open the template packs panel. The Document templates surface lists every pack, filterable by status (draft, active, archived). It is rendered from the kernel’s own list output, so the table you see is the pack roster as the kernel reports it.
Create a pack. Give it a key and a title to register a new draft. Open the draft to add its body and declare its merge variables with their classifications.
Set the mapping. In a pack’s detail, add merge-variable to source-field entries to build the extraction mapping that generation reads, and remove any entry you no longer want.
Version and publish. Cut a new version to snapshot the pack’s body, variables, and mapping, then publish to make a version current. Only a published (active) pack can generate, and an in-flight generation pinned to a prior version is never reshaped by a later publish.
Generate a document. Generate from a published pack with a payload of facts. If a required variable is unmapped the generation is refused with the offending variables named; otherwise the document is produced, committed to the matter, and recorded with its coverage report.
Bundle and annotate. Compile an ordered set of PDFs into one paginated bundle for filing or disclosure, and annotate a rendered PDF with boxes, arrows, or comments where review notes need to sit on the page.
The kernel verbs behind it
Each goes through the one front door: permission-checked and audited before it runs. These are the key verbs.
Authoring a pack:
doc.template.register- register a draft pack with its body and classified merge variables (the coverage source).doc.template.version- cut a version snapshot of the pack’s body, variables, and mapping.doc.template.publish- make a version current (draft to active); only a published pack can generate.doc.template.list- list packs by status, the render source for the template-pack panel.doc.template.get- read one pack: its id, key, title, status, version, merge variables, body, and mapping.doc.template.archive- withdraw a pack from active listing.mapping.set- set the extraction mapping (merge-var to source-field) on a pack; determines regulated render output.
Generating and reading documents:
doc.generate- produce a document from a pack under the coverage gate and the fidelity guard.doc.gen.list- list the generations recorded against a matter or pack.generated.get- read a single generated-document record.
Versions:
version.get- read one version record.version.list- list a pack’s versions.version.mint- mint a new version.version.rollback- roll back to an earlier version.
Filling, bundling, annotating:
acroform.fill- fill the named fields of a fillable PDF form.bundle.compile- ordered multi-PDF merge with dividers and a paginated table of contents, producing a file.doc.annotate- add a typed page-geometry annotation (box, arrow, comment) to a PDF.doc.annotation.get- read a document’s annotations.doc.annotation.remove- remove an annotation.doc.archive- withdraw a generated document from active listing and authoring.
See the full set in the doc verb reference.