Source snapshot bcc79fcc · Declared package version 5.0.4. This page combines the checked-in package guide and manifest; commands and runtime behavior were not executed in this review.
src/contracts/ contains contract specs, operations, entities, and registry exports.
Related ContractSpec packages include @lssm-tech/lib.bus, @lssm-tech/lib.contracts-spec, @lssm-tech/lib.schema, @lssm-tech/tool.bun, @lssm-tech/tool.typescript.
src/contracts/ contains contract specs, operations, entities, and registry exports.
Installation
npm install @lssm-tech/module.audit-trail
or
bun add @lssm-tech/module.audit-trail
Usage
Import the root entrypoint from @lssm-tech/module.audit-trail, or choose a documented subpath when you only need one part of the package surface.
For application-facing evidence, use ScopedAppendOnlyAuditPort from the
./storage subpath. Every append and query requires both tenantId and
workspaceId; the port deliberately exposes no update, delete, or clear method.
InMemoryScopedAppendOnlyAuditStore is the development and contract-test reference adapter. Administrative retention remains on the legacy storage adapter and must not be exposed as an application mutation path.
Architecture
src/audit-trail.capability.ts defines a capability surface.
src/audit-trail.feature.ts defines a feature entrypoint.
src/contracts/ contains contract specs, operations, entities, and registry exports.
src/entities/ contains domain entities and value objects.
src/index.ts is the root public barrel and package entrypoint.
src/storage/ contains persistence adapters and storage implementations.
Public Entry Points
Export . resolves through ./src/index.ts.
Export ./audit-trail.capability resolves through ./src/audit-trail.capability.ts.
Export ./audit-trail.feature resolves through ./src/audit-trail.feature.ts.
Export ./contracts resolves through ./src/contracts/index.ts.
Export ./entities resolves through ./src/entities/index.ts.
Export ./storage resolves through ./src/storage/index.ts.
Local Commands
bun run dev — contractspec-bun-build dev
bun run build — contractspec-bun-build build
bun run lint — bun lint:fix
bun run lint:check — biome check .
bun run lint:fix — biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .
bun run typecheck — tsgo --noEmit
bun run publish:pkg — bun publish --tolerate-republish --ignore-scripts --verbose
bun run publish:pkg:canary — bun publish:pkg --tag canary
bun run clean — rimraf dist .turbo
bun run build:bundle — contractspec-bun-build transpile
bun run build:types — contractspec-bun-build types
bun run prebuild — contractspec-bun-build prebuild
Recent Updates
Add strict tenant/workspace-scoped append and query contracts plus an append-only reference storage port.
Replace eslint+prettier by biomejs to optimize speed.
Notes
Depends on lib.bus for event dispatch -- never emit events outside the bus.
Audit records are append-only; mutations or deletions break compliance invariants.
Storage adapters must implement the store interface; do not bypass it.
Declared capabilities.
Module Audit Trail
Audit trail module for tracking and querying system events
Use it to
Adopt audit trail module for tracking and querying system events
Requires
TypeScript
Choose another boundary when
The @lssm-tech/module.audit-trail package constraints do not match the target runtime or platform.
These are package-manifest entry points. Named symbols listed above come from the capability catalogue; this is not an exhaustive TypeScript symbol reference.