artifact-render
The shared render primitive for public-facing compliance artifacts — a readiness-language claim filter, allowlist-based field redaction, and citation-row rendering.
@caisson-sh/artifact-render is the shared render seam every public-facing compliance artifact
in Caisson renders through: a readiness-language claim filter, allowlist-based field redaction, and a
validated citation-row shape. It exists so the ISO 27001 SoA generator and the trust-page generator
share one legal-gate and one redaction implementation rather than each deriving their
own.
What it does
- A readiness-language claim filter.
READINESS_LANGUAGE_BANNED_WORDS_REbans the case-insensitive, word-bounded claim wordscompliant,certified, andverified.isReadinessLanguageis the pure predicate;assertReadinessLanguagethrows a redaction-safeValidationErrorat a construction boundary, naming the offending field but never echoing the text itself. - Allowlist-based field redaction — the opposite posture from a denylist.
redactToAllowlist(facts, allowlist)returns a new record containing only the keys present in both; a key in the allowlist the facts don't carry is simply absent, no error. Deterministic key order follows the allowlist, not the source object's own enumeration. - A validated citation-row constructor.
renderCitationRowbuilds aCitationRow(control,claim,justification, optionalevidencePointer), gatingcontrol,claim, andjustificationthrough the readiness-language filter — every free-text-ish field, not only the prose one.citationRowToJsonconverts a row to a plainJsonValuefor embedding in an OSCAL prop, an evidence-pack archive entry, or a rendered artifact.
Install
bun add @caisson-sh/artifact-renderQuickstart
import {
redactToAllowlist,
renderCitationRow,
citationRowToJson,
assertReadinessLanguage,
} from "@caisson-sh/artifact-render";
const redacted = redactToAllowlist(
{ "framework.title": "SOC 2 — Trust Services Criteria", tenantId: "acme" },
["framework.title"],
);
// { "framework.title": "SOC 2 — Trust Services Criteria" } — tenantId never rendered
const row = renderCitationRow({
control: "A.5.15",
claim: "applicable",
justification: "Logical access control is enforced at the data tier.",
evidencePointer: "ACCESS-CONTROL.LOGICAL",
});
citationRowToJson(row);assertReadinessLanguage(text, field) is the same gate renderCitationRow calls internally —
reach for it directly when rendering a free-text field this package doesn't already wrap.
Composes with
@caisson-sh/artifact-render depends only on @caisson-sh/kernel. @caisson-sh/oscal-spine's ISO
27001 SoA export and @caisson-sh/trust-page's generator both render through it, so a claim-word
regression or a redaction bug is fixed once, in one place, for every consumer.
trust-page
The trust-page generator — a self-contained static HTML + JSON page built from an evidence pack and its crosswalk rollup through allowlist-based redaction, hostable anywhere to publish a compliance posture.
verify-pack
The out-of-band verifier for a Caisson audit evidence pack — validates the signed file manifest, the pack seal, the receipt chain, and every per-row anchor signature, without trusting executable code from inside the pack.