@trestle-labs/core
v1.0.3
Published
Compliance automation, logic, and rule engine
Readme
Trestle Core
Shared TypeScript library for the Trestle Labs workspace. This package holds the canonical compliance data model and the rule engine used by both the product app and the educational app.
Responsibilities
- Wizard schema and shared types for organization, scope, governance, operations, and framework selections.
- Document-generation rules and template manifests that decide which policies are required for a given scenario.
- Template payload construction via
buildTemplatePayload()so every renderer gets the same derived variables. - Handlebars rendering helpers and markdown cleanup utilities such as
renderTemplate()andstripMappingMetadata(). - Evidence canonicalization, scanner normalization, glossary helpers, and audit-report synthesis primitives.
Public Surface
The package re-exports modules from:
src/wizard- schema, rule matrix, template manifest, control map, scoring, audit reporting, and merge utilities.src/documents- template engine, artifact hashing, section diffing, frontmatter, statuses, and mapping catalog.src/evidence- canonicalization, scanner normalizers, and auditor display helpers.src/synthesis- LLM synthesis support.- shared roots such as
types,tsc-criteria,glossary, andacronyms.
Development
cd trestle-core
npm install
npm run buildUseful commands:
npm run build- compilesrc/intodist/.npm run build:watch- watch mode for package development.npm run typecheck- run TypeScript without emitting output.npm run clean- remove compiled artifacts.
Consumers
TrustScaffolduses this package for wizard logic, document compilation, and server-side utilities.trustscaffold-eduuses it for scenario evaluation, canonical payload building, and markdown preview rendering.
Keep business rules here when they need to be consistent across apps; keep app-specific presentation logic in the consuming applications.
