# Provenance and template versions

Every published document can be traced, clause by clause, to the provision it answers and to the exact library commit it was built from.

## Register rows and statutory citations

The legal-sources obligation register lists what the DPDP Act, the DPDP Rules and the other named laws require a notice to say. Each clause in the library links to the register rows it satisfies and carries the citation shown inline in the document. GET /v1/documents/{id}/versions/{n} returns that provenance as JSON next to the rendered text.

## Pinned corpus commits and clause versions

- PolicyGrain runs on byte copies of legal-sources pinned to one commit; the commit hash appears in each document's provenance and in GET /v1/status as corpus_commit.
- Clause ids (such as C-RG-04) are stable and never renumbered. A changed clause gets a new version, and only approved clauses are printed in a published document.
- Document versions are content-addressed: regenerating with unchanged inputs keeps the same version, and changed inputs create a new numbered version. Earlier published versions stay readable at /{slug}/versions/{n}.

## Deterministic assembly without per-customer drafting

The renderer is a pure function of the pinned library and your answers. It makes no network calls and uses no language model, so there is no per-customer wording that could differ between two runs. Slots the library has not yet worded for a given answer fail closed: the document stays a draft instead of publishing invented text.
