module.audit-trail
Audit trail module for tracking and querying system events
@lssm-tech/module.audit-trailbun add @lssm-tech/module.audit-trailManifest declarations describe the current workspace; they do not verify registry publication or runtime execution.
Package guide
Website: https://contractspec.io
Audit trail module for tracking and querying system events.
What It Provides
- Layer: module.
- Consumers: bundles (library, contractspec-studio), apps (web-landing).
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.tsdefines a capability surface.src/audit-trail.feature.tsdefines a feature entrypoint.src/contracts/contains contract specs, operations, entities, and registry exports.src/entities/contains domain entities and value objects.src/index.tsis 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.capabilityresolves through./src/audit-trail.capability.ts. - Export
./audit-trail.featureresolves through./src/audit-trail.feature.ts. - Export
./contractsresolves through./src/contracts/index.ts. - Export
./entitiesresolves through./src/entities/index.ts. - Export
./storageresolves through./src/storage/index.ts.
Local Commands
bun run dev— contractspec-bun-build devbun run build— contractspec-bun-build buildbun run lint— bun lint:fixbun run lint:check— biome check .bun run lint:fix— biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .bun run typecheck— tsgo --noEmitbun run publish:pkg— bun publish --tolerate-republish --ignore-scripts --verbosebun run publish:pkg:canary— bun publish:pkg --tag canarybun run clean— rimraf dist .turbobun run build:bundle— contractspec-bun-build transpilebun run build:types— contractspec-bun-build typesbun 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.busfor 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.
Relationships
Arrows point from a package to its direct dependency. Counts are derived from captured workspace manifests.
4 declarations
@lssm-tech/lib.schemaworkspace:^
Read the package manual ↗@lssm-tech/lib.contracts-spec-coreworkspace:^
Read the package manual ↗@lssm-tech/lib.busworkspace:^
Read the package manual ↗zodcatalog:
Declared capabilities
Audit trail module for tracking and querying system events
Scripts
publish:pkgbun publish --tolerate-republish --ignore-scripts --verbosepublish:pkg:canarybun publish:pkg --tag canarybuildcontractspec-bun-build buildbuild:bundlecontractspec-bun-build transpilebuild:typescontractspec-bun-build typesdevcontractspec-bun-build devcleanrimraf dist .turbolintbun lint:fixlint:fixnode ../../../../scripts/biome.cjs check --write --unsafe --only=nursery/useSortedClasses . && node ../../../../scripts/biome.cjs check --write .lint:checknode ../../../../scripts/biome.cjs check .prebuildcontractspec-bun-build prebuildtypechecktsgo --noEmit