truss check enforces architecture boundaries from truss.yml and returns CI-friendly exit codes.
- Load and validate
truss.yml - Discover source files (
.ts/.tsx/.js/.jsx, ignore junk folders) - Parse imports and build dependency edges
- Assign files to layers
- Evaluate rules
- Apply suppressions
- Render human or JSON output
- Exit with status code
0No unsuppressed violations1One or more unsuppressed architectural violations2Configuration or CLI usage error3Internal error
- Rule name
- Source and target layer
- File path + line number
- Import statement
- Reason
- Summary counts for unsuppressed/suppressed/total
Truss: Architectural violations found (1)
no-import
Layers: api -> db
src/api/user.ts:15
import { db } from "../db/client"
Reason: API layer must not depend directly on DB layer.
Suppressed violations: 1 (intentional, still reported)
Summary:
Unsuppressed: 1
Suppressed: 1
Total: 2
Truss: No Architectural violations found
Checked 9000 files
npm install
npm run truss:check
npm run truss:check:jsonname: Truss
on:
pull_request:
push:
branches: [main]
jobs:
truss:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
- run: npm run truss:checkname: Truss (JSON Report)
on: [pull_request]
jobs:
truss:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
- run: npm run truss:check:json > truss-report.json
- uses: actions/upload-artifact@v4
with:
name: truss-report
path: truss-report.json