Skip to content

Smells v0.6.0

Latest

Choose a tag to compare

@github-actions github-actions released this 14 Oct 23:48
Immutable release. Only release title and notes can be modified.
04c02b4

Smells v0.6.0

Why this release

Database migration files are not ordinary application code. Frameworks often require
large, linear up/down or upgrade/downgrade entrypoints, while SQL-first tools
store the migration body outside the source language entirely. Treating those shapes
as generic application functions creates noisy size findings; silently skipping them
would hide risk instead.

Smells 0.6.0 adds evidence-based migration roles. Verified framework entrypoints stay
in the measured corpus and remain visible as review signals, but they are no longer
treated as ordinary application functions. Helpers, callbacks, orchestration, data
transformations, and complex logic inside migration files continue to receive normal
analysis.

What was added

  • Migration-role recognition for:
    • Python: Alembic and Django.
    • TypeScript: TypeORM, MikroORM, Kysely, Knex, Sequelize/Umzug, Prisma 7 and 8,
      and Drizzle.
    • Rust: SeaORM, SQLx, Diesel, and Refinery.
  • Inventory and digest binding for recognized Drizzle, Prisma, SQLx, Diesel, and
    Refinery SQL migration artifacts. Reports disclose SQL bodies as
    migration_body_not_analyzed rather than silently omitting them.
  • Report schema 11, including exact migration declaration provenance, unresolved
    migration candidates, SQL-body limitations, SQLx integrity metadata, and embedded
    catalog/source-manifest versions.
  • Rule version 2 for line metrics whose applicability now understands verified
    migration roles.
  • A Cockburn-style hexagonal scanner core: the CLI is a driving/inbound adapter and
    repository capture is a driven/outbound adapter. This is an internal boundary that
    makes the scanner easier to test and evolve without changing the CLI contract.
  • Property tests, exhaustive mutation testing, and pinned real-repository checks for
    Alembic, TypeORM, Drizzle, SeaORM, and SQLx behavior.

What was fixed

  • Canonical framework-required migration entrypoints no longer become misleading
    blocking findings solely because their linear DDL is long.
  • Framework names in comments, strings, unrelated imports, or nearby code no longer
    provide enough evidence to reclassify a declaration.
  • Migration discovery now has the same behavior in working-tree and staged scans;
    recognized artifacts and unresolved candidates participate in file budgets and
    snapshot identity.
  • External registry publication keeps each PyPI, npmjs.com, and crates.io Trusted
    Publisher workflow as a top-level workflow and requires every publication result.

What was removed

  • The ordinary application-code line-metric applicability was removed only for
    verified canonical migration entrypoints.
  • No CLI command, rule, supported language, package channel, or platform target was
    removed.
  • No migration directory or file is blanket-ignored. Migration helpers and business
    logic continue to be analyzed normally.

Before upgrading

The JSON report contract advances from schema 7 to schema 11, and affected line
metrics advance to rule version 2. Update report consumers and replace the old starter
policy with the matching v0.6.0 policy before making the new scan a required gate.

How to use it

Install one channel; each provides the same scanner behavior:

# Python tooling
uv tool install --force smells==0.6.0

# Node projects
npm install --save-dev --save-exact @mindful-time/smells@0.6.0

# Rust tooling
cargo install --locked --version 0.6.0 smells

Download the starter policy for the language being scanned. For example, Python:

curl -fsSLo quality-policy.json \
  https://raw.githubusercontent.com/mindful-time/smells/v0.6.0/examples/python-quality-policy.json
smells contracts validate --policy quality-policy.json

Run the scan as before:

smells check \
  --path . \
  --policy quality-policy.json \
  --format table \
  --log smells-findings.log \
  --report smells-report.json

Migration handling is automatic; no migration exclusion is required. Review
migration_body_not_analyzed limitations when a framework stores executable changes
as SQL, and keep normal review and integration tests around data transformations and
rollback behavior.

Verification

  • Complete format, build, lint, unit, integration, packaging, self-scan, coverage,
    CRAP, secret, and dependency-vulnerability gates.
  • Eight mutation shards: 1,181 mutants, 1,053 caught, 128 unviable, zero missed, and
    zero timed out.
  • Native release builds and smoke tests for macOS ARM64/Intel, Linux ARM64/AMD64,
    and Windows AMD64 before the immutable tag is created.