lintropy
v0.2.3
Published
Entropy linter for TypeScript vibe-coding issues.
Readme
lintropy
lintropy is a TypeScript-focused entropy linter for vibe-coding issues.
Quality foundation
This repo uses:
- Biome for formatting and fast linting
- ESLint for TypeScript safety rules
- TypeScript compiler for strict type checking
- Knip for dead files/exports/dependencies checks
- Husky pre-commit hooks for local quality enforcement
Scripts
bun run lint: Biome + ESLintbun run format: format with Biomebun run typecheck:tsc --noEmitbun run knip: dead code/dependencies checksbun run check: lint + typecheck + knipbun run test: run unit/snapshot testsbun run build: compile CLI todist/bun run dev -- check [paths...]: run CLI from source
Local developer guardrails
- Install deps with
bun install(this runsprepareand installs Husky hooks). - Pre-commit hook runs:
bun run checkbun run test
- If a commit fails, run
bun run formatand re-run checks before committing again.
CLI usage
- Install once globally:
npm i -g lintropy - Run without install:
npx lintropy check src(orbunx lintropy check src) bun run dev -- check [paths...]- analyzes TS files and enforces absolute-cap gate
- options:
--format text|json,--max-entropy,--drift-budget,--no-baseline - AI options:
--ai,--fix,--fix-dry-run,--ai-threshold,--ai-timeout-ms,--ai-retries
bun run dev -- baseline [paths...]- generates
.lintropy-baseline.json
- generates
bun run dev -- diff [paths...]- compares current project entropy to baseline
AI advisor (Ollama)
Setup:
# Install Ollama, then run:
ollama pull phi3 # Or any phi3 variant
lintropy check --ai # Static + AI advisorConfig (.lintropy.json):
{
"ollama": { "model": "phi3", "baseUrl": "http://localhost:11434" }
}Examples:
lintropy check --ai— analyze with AI advisorlintropy check --ai --fix-dry-run— preview AI fixes without applyinglintropy check --ai --fix— apply AI-generated refactors
AI safety and compliance
- AI mode is advisory-only and does not control policy pass/fail.
- Invalid AI output is dropped via strict JSON validation.
- Advisor uses local Ollama (no external API calls).
- See
AI_SAFETY.mdandTHIRD_PARTY.mdfor policy/compliance details.
Entropy defaults
- weights:
nesting=0.40,functionLength=0.35,typeEscape=0.25 - normalization caps:
depthCap=6,functionLengthCap=80 - project gate:
absoluteCap=1.00 - drift budget default:
0.05
CI rollout strategy
- Phase A (local only): run
lintropy checkmanually while tuning. - Phase B (advisory CI): run in CI and publish report artifacts, non-blocking.
- Phase C (blocking cap): fail CI on absolute-cap violations.
- Phase D (blocking drift): fail CI on cap and drift budget violations.
Current GitHub Actions workflow runs bun run check and bun run test as the default quality gate.
Branch and release workflow
- Feature work: create branch from
beta, open PR intobeta. - Promotion: open PR from
betaintomainafter beta validation. mainandbetaare protected branches with required PR checks.- Only merge PRs after CI (
check) passes. - Release on npm:
- Ensure
mainis green (bun run checkandbun run test). - Run
bun run release(ornpx release-it) — bumps version, commits, tags, pushes, creates GitHub release. - Tag pushes matching
v*trigger.github/workflows/publish.yml. - Publish job runs checks/tests and
npm publish --provenance --access public.
- Ensure
