@traceweave/trf-builder
v0.1.0
Published
Create and build .twpack files - TRF (Traceability Report Framework)
Downloads
9
Maintainers
Readme
@traceweave/trf-builder
Create and build .twpack files - TRF (Traceability Report Framework)
Installation
npm install @traceweave/trf-builderUsage
Programmatic API
import { TwpackBuilder } from '@traceweave/trf-builder';
// Create a new builder
const builder = new TwpackBuilder({
id: 'automotive:brake-system:v1.0',
title: 'Brake System Traceability Pack',
profile: 'automotive-safety-iso26262',
metadata: {
domain: 'automotive',
standard: 'ISO-26262',
organization: 'ACME Corp'
}
});
// Add artifacts
builder.addArtifact({
id: 'req:BRAKE-001',
kind: 'requirement',
version: '1.0',
title: 'ABS shall activate within 50ms',
fields: {
description: 'Anti-lock braking system response time requirement',
safety_level: 'ASIL-D'
}
});
builder.addArtifact({
id: 'test:HIL-001',
kind: 'test',
version: '1.0',
title: 'HIL test for ABS activation',
fields: {
test_type: 'hardware-in-loop',
result: 'PASS'
}
});
// Add links
builder.addLink({
id: 'link:001',
from: 'req:BRAKE-001',
to: 'test:HIL-001',
relation: 'verified_by',
metadata: {
confidence: 1.0,
created_by: 'test-automation'
}
});
// Build the pack
await builder.build('./brake-system.twpack');CLI
# Create a pack from JSON files
trf-build create \
--id "automotive:brake-system:v1.0" \
--title "Brake System Traceability" \
--artifacts ./artifacts.json \
--links ./links.json \
--output ./brake-system.twpack \
--profile "automotive-safety-iso26262"Features
- ✅ Fluent API for building twpack files
- ✅ Automatic validation of artifact and link IDs
- ✅ Support for provenance tracking
- ✅ Metadata and profile support
- ✅ CLI and programmatic API
- ✅ TypeScript type definitions
License
MIT
