smelt-cli 0.1.6__tar.gz → 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- smelt_cli-0.2.0/CHANGELOG.md +333 -0
- smelt_cli-0.2.0/CONTRIBUTING.md +291 -0
- smelt_cli-0.2.0/Cargo.lock +1538 -0
- smelt_cli-0.2.0/Cargo.toml +31 -0
- smelt_cli-0.2.0/PKG-INFO +103 -0
- smelt_cli-0.2.0/README.md +87 -0
- smelt_cli-0.2.0/docs/README.md +21 -0
- smelt_cli-0.2.0/docs/adoption.md +40 -0
- smelt_cli-0.2.0/docs/agent-workflow.md +506 -0
- smelt_cli-0.2.0/docs/architecture.md +171 -0
- smelt_cli-0.2.0/docs/benchmarks/incremental-followup-2026-10-31.json +633 -0
- smelt_cli-0.2.0/docs/benchmarks/native-checks-2026-10-31.json +1147 -0
- smelt_cli-0.2.0/docs/benchmarks/native-git-retained-state-2026-10-31.json +1478 -0
- smelt_cli-0.2.0/docs/benchmarks/precommit-performance-2026-10-30.json +203 -0
- smelt_cli-0.2.0/docs/benchmarks/review-feedback-2026-10-31.json +176 -0
- smelt_cli-0.2.0/docs/benchmarks/staged-checks-2026-10-30.json +56 -0
- smelt_cli-0.2.0/docs/benchmarks/staged-policy-cache-2026-10-31.json +364 -0
- smelt_cli-0.2.0/docs/cli.md +69 -0
- smelt_cli-0.2.0/docs/configuration.md +181 -0
- smelt_cli-0.2.0/docs/integrations.md +86 -0
- smelt_cli-0.2.0/docs/proposals/config-structure.md +138 -0
- smelt_cli-0.2.0/docs/review.md +206 -0
- smelt_cli-0.2.0/docs/rule-selection.md +62 -0
- smelt_cli-0.2.0/docs/rules/README.md +46 -0
- smelt_cli-0.2.0/docs/rules/SMT101.md +40 -0
- smelt_cli-0.2.0/docs/rules/SMT102.md +38 -0
- smelt_cli-0.2.0/docs/rules/SMT103.md +39 -0
- smelt_cli-0.2.0/docs/rules/SMT104.md +38 -0
- smelt_cli-0.2.0/docs/rules/SMT105.md +38 -0
- smelt_cli-0.2.0/docs/rules/SMT106.md +39 -0
- smelt_cli-0.2.0/docs/rules/SMT107.md +36 -0
- smelt_cli-0.2.0/docs/rules/SMT108.md +38 -0
- smelt_cli-0.2.0/docs/rules/SMT301.md +40 -0
- smelt_cli-0.2.0/docs/rules/SMT302.md +33 -0
- smelt_cli-0.2.0/docs/rules/SMT305.md +39 -0
- smelt_cli-0.2.0/docs/rules/SMT306.md +47 -0
- smelt_cli-0.2.0/docs/rules/SMT307.md +41 -0
- smelt_cli-0.2.0/docs/rules/SMT308.md +38 -0
- smelt_cli-0.2.0/docs/rules/SMT309.md +37 -0
- smelt_cli-0.2.0/docs/rules/SMT310.md +35 -0
- smelt_cli-0.2.0/docs/rules/SMT311.md +37 -0
- smelt_cli-0.2.0/docs/rules/SMT312.md +39 -0
- smelt_cli-0.2.0/docs/rules/SMT313.md +43 -0
- smelt_cli-0.2.0/docs/rules/SMT314.md +39 -0
- smelt_cli-0.2.0/docs/rules/SMT315.md +45 -0
- smelt_cli-0.2.0/docs/rules/SMT316.md +43 -0
- smelt_cli-0.2.0/docs/rules/SMT317.md +45 -0
- smelt_cli-0.2.0/docs/rules/SMT318.md +43 -0
- smelt_cli-0.2.0/docs/rules/SMT319.md +38 -0
- smelt_cli-0.2.0/docs/rules/SMT401.md +37 -0
- smelt_cli-0.2.0/docs/rules/SMT420.md +38 -0
- smelt_cli-0.2.0/docs/rules/SMT421.md +38 -0
- smelt_cli-0.2.0/docs/rules/SMT422.md +39 -0
- smelt_cli-0.2.0/docs/rules/SMT423.md +38 -0
- smelt_cli-0.2.0/docs/rules/SMT424.md +38 -0
- smelt_cli-0.2.0/docs/rules/SMT425.md +38 -0
- smelt_cli-0.2.0/docs/rules/SMT426.md +38 -0
- smelt_cli-0.2.0/docs/rules/SMT427.md +39 -0
- smelt_cli-0.2.0/docs/rules/SMT428.md +40 -0
- smelt_cli-0.2.0/docs/rules/SMT429.md +44 -0
- smelt_cli-0.2.0/docs/rules/SMT430.md +54 -0
- smelt_cli-0.2.0/docs/rules/SMT901.md +33 -0
- smelt_cli-0.2.0/docs/rules/SMT902.md +33 -0
- smelt_cli-0.2.0/docs/rules/SMT903.md +33 -0
- smelt_cli-0.2.0/docs/structure.md +446 -0
- smelt_cli-0.2.0/docs/test-quality-evaluation.json +203 -0
- smelt_cli-0.2.0/docs/testing.md +234 -0
- smelt_cli-0.2.0/docs/vision.md +50 -0
- smelt_cli-0.2.0/native/git.rs +120 -0
- smelt_cli-0.2.0/native/main.rs +357 -0
- smelt_cli-0.2.0/native/worker.rs +159 -0
- smelt_cli-0.1.6/pyproject.toml.orig → smelt_cli-0.2.0/pyproject.toml +17 -9
- smelt_cli-0.2.0/scripts/benchmark_checks.py +296 -0
- smelt_cli-0.2.0/scripts/benchmark_hooks.py +180 -0
- smelt_cli-0.2.0/scripts/benchmark_session.py +305 -0
- smelt_cli-0.2.0/scripts/evaluate.py +74 -0
- smelt_cli-0.2.0/scripts/generate.py +21 -0
- smelt_cli-0.2.0/scripts/smoke_distribution.py +95 -0
- smelt_cli-0.2.0/smelt/analysis/__init__.py +45 -0
- smelt_cli-0.2.0/smelt/analysis/cache.py +168 -0
- smelt_cli-0.2.0/smelt/analysis/context.py +147 -0
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/analysis/contracts.py +1 -12
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/analysis/coverage.py +44 -25
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/analysis/definition_blocks.py +154 -145
- smelt_cli-0.2.0/smelt/analysis/enum_values.py +217 -0
- smelt_cli-0.2.0/smelt/analysis/errors.py +11 -0
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/analysis/files.py +59 -25
- smelt_cli-0.2.0/smelt/analysis/function_usage.py +123 -0
- smelt_cli-0.2.0/smelt/analysis/identity.py +64 -0
- smelt_cli-0.2.0/smelt/analysis/import_cache.py +98 -0
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/analysis/imports.py +153 -29
- smelt_cli-0.2.0/smelt/analysis/literals.py +17 -0
- smelt_cli-0.2.0/smelt/analysis/member_state.py +108 -0
- smelt_cli-0.2.0/smelt/analysis/members.py +975 -0
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/analysis/ordering.py +91 -69
- smelt_cli-0.2.0/smelt/analysis/package_exports.py +58 -0
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/analysis/parsing.py +39 -29
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/analysis/python_version.py +52 -50
- smelt_cli-0.2.0/smelt/analysis/retained.py +84 -0
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/analysis/syntax.py +33 -7
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/analysis/test_cases.py +4 -3
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/analysis/test_deadlines.py +10 -9
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/analysis/test_outcomes.py +12 -12
- smelt_cli-0.2.0/smelt/analysis/test_subprocesses.py +107 -0
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/analysis/test_syntax.py +288 -78
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/analysis/workspace.py +26 -17
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/cli/app.py +67 -18
- smelt_cli-0.2.0/smelt/cli/commands/__init__.py +62 -0
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/cli/commands/adopt.py +114 -73
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/cli/commands/check.py +68 -12
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/cli/commands/info.py +19 -19
- smelt_cli-0.2.0/smelt/cli/session.py +163 -0
- smelt_cli-0.2.0/smelt/cli/session_slots.py +43 -0
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/cli/support.py +12 -3
- smelt_cli-0.2.0/smelt/config/__init__.py +36 -0
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/config/discovery.py +27 -13
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/config/loader.py +61 -13
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/config/models.py +14 -37
- smelt_cli-0.2.0/smelt/config/source.py +56 -0
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/diagnostics/debt.py +15 -5
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/diagnostics/dedupe.py +9 -12
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/diagnostics/groups.py +11 -10
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/diagnostics/render/machine.py +6 -2
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/diagnostics/render/text.py +22 -18
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/diagnostics/report.py +2 -0
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/diagnostics/violation.py +2 -4
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/docs.py +23 -19
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/engine/briefing.py +74 -75
- smelt_cli-0.2.0/smelt/engine/cache.py +65 -0
- smelt_cli-0.2.0/smelt/engine/changes.py +260 -0
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/engine/check.py +271 -114
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/engine/coverage.py +6 -6
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/engine/evaluation.py +125 -122
- smelt_cli-0.2.0/smelt/engine/file_checks.py +94 -0
- smelt_cli-0.2.0/smelt/engine/git_source.py +140 -0
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/engine/inference.py +83 -58
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/engine/mirror_inference.py +27 -27
- smelt_cli-0.2.0/smelt/engine/native_git.py +190 -0
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/engine/paths.py +10 -5
- smelt_cli-0.2.0/smelt/engine/result_cache.py +208 -0
- smelt_cli-0.2.0/smelt/engine/rule_settings.py +164 -0
- smelt_cli-0.2.0/smelt/engine/schema.py +58 -0
- smelt_cli-0.2.0/smelt/engine/staged.py +75 -0
- smelt_cli-0.2.0/smelt/rules/activation.py +129 -0
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/rules/base.py +4 -0
- smelt_cli-0.2.0/smelt/rules/catalog.json +600 -0
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/rules/common.py +47 -74
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/rules/dependencies/composition_root.py +7 -8
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/rules/dependencies/fanout.py +2 -8
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/rules/dependencies/features.py +17 -12
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/rules/dependencies/interfaces.py +2 -8
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/rules/dependencies/layers.py +9 -92
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/rules/dependencies/third_party.py +33 -16
- smelt_cli-0.2.0/smelt/rules/member_names.py +13 -0
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/rules/meta.py +1 -0
- smelt_cli-0.2.0/smelt/rules/registry.py +132 -0
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/rules/structure/assignments.py +2 -14
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/rules/structure/contracts.py +2 -8
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/rules/structure/coverage.py +3 -5
- smelt_cli-0.2.0/smelt/rules/structure/enum_values.py +50 -0
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/rules/structure/headers.py +7 -22
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/rules/structure/import_style.py +2 -8
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/rules/structure/layout.py +7 -7
- smelt_cli-0.2.0/smelt/rules/structure/members.py +116 -0
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/rules/structure/naming.py +3 -12
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/rules/structure/ordering.py +25 -12
- smelt_cli-0.2.0/smelt/rules/structure/package_imports.py +117 -0
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/rules/structure/type_dispatch.py +3 -9
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/rules/testing/awaits.py +5 -10
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/rules/testing/cases.py +5 -10
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/rules/testing/location.py +20 -21
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/rules/testing/mocking.py +10 -17
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/rules/testing/outcomes.py +38 -25
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/rules/testing/private_access.py +19 -13
- smelt_cli-0.2.0/smelt/rules/testing/public_attributes.py +62 -0
- smelt_cli-0.2.0/smelt/rules/testing/public_functions.py +52 -0
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/rules/testing/timing.py +5 -10
- smelt_cli-0.2.0/smelt.schema.json +2823 -0
- smelt_cli-0.2.0/smelt.yml +86 -0
- smelt_cli-0.2.0/tests/__init__.py +0 -0
- smelt_cli-0.2.0/tests/analysis/__init__.py +0 -0
- smelt_cli-0.2.0/tests/analysis/test_annotations.py +57 -0
- smelt_cli-0.2.0/tests/analysis/test_context.py +100 -0
- smelt_cli-0.2.0/tests/analysis/test_contracts.py +83 -0
- smelt_cli-0.2.0/tests/analysis/test_enum_values.py +146 -0
- smelt_cli-0.2.0/tests/analysis/test_exports.py +134 -0
- smelt_cli-0.2.0/tests/analysis/test_identity.py +91 -0
- smelt_cli-0.2.0/tests/analysis/test_ordering.py +303 -0
- smelt_cli-0.2.0/tests/analysis/test_ordering_rewrite.py +190 -0
- smelt_cli-0.2.0/tests/analysis/test_parsing.py +115 -0
- smelt_cli-0.2.0/tests/analysis/test_python_version.py +152 -0
- smelt_cli-0.2.0/tests/analysis/test_retained.py +129 -0
- smelt_cli-0.2.0/tests/analysis/test_test_awaits.py +152 -0
- smelt_cli-0.2.0/tests/analysis/test_test_cases.py +72 -0
- smelt_cli-0.2.0/tests/analysis/test_test_deadlines.py +80 -0
- smelt_cli-0.2.0/tests/analysis/test_test_outcomes.py +106 -0
- smelt_cli-0.2.0/tests/analysis/test_test_syntax.py +328 -0
- smelt_cli-0.2.0/tests/analysis/test_test_timing.py +125 -0
- smelt_cli-0.2.0/tests/analysis/test_type_dispatch.py +141 -0
- smelt_cli-0.2.0/tests/analysis/test_workspace.py +113 -0
- smelt_cli-0.2.0/tests/cli/__init__.py +0 -0
- smelt_cli-0.2.0/tests/cli/test_app.py +1531 -0
- smelt_cli-0.2.0/tests/cli/test_session.py +412 -0
- smelt_cli-0.2.0/tests/cli/test_session_slots.py +56 -0
- smelt_cli-0.2.0/tests/config/__init__.py +0 -0
- smelt_cli-0.2.0/tests/config/test_loader.py +312 -0
- smelt_cli-0.2.0/tests/config/test_validation.py +252 -0
- smelt_cli-0.2.0/tests/diagnostics/__init__.py +0 -0
- smelt_cli-0.2.0/tests/diagnostics/render/__init__.py +0 -0
- smelt_cli-0.2.0/tests/diagnostics/render/conftest.py +111 -0
- smelt_cli-0.2.0/tests/diagnostics/render/test_machine.py +139 -0
- smelt_cli-0.2.0/tests/diagnostics/render/test_text.py +176 -0
- smelt_cli-0.2.0/tests/diagnostics/test_groups.py +137 -0
- smelt_cli-0.2.0/tests/diagnostics/test_suppressions.py +35 -0
- smelt_cli-0.2.0/tests/engine/__init__.py +0 -0
- smelt_cli-0.2.0/tests/engine/test_briefing.py +540 -0
- smelt_cli-0.2.0/tests/engine/test_cache.py +294 -0
- smelt_cli-0.2.0/tests/engine/test_changes.py +709 -0
- smelt_cli-0.2.0/tests/engine/test_check.py +301 -0
- smelt_cli-0.2.0/tests/engine/test_coverage.py +180 -0
- smelt_cli-0.2.0/tests/engine/test_evaluation.py +144 -0
- smelt_cli-0.2.0/tests/engine/test_file_checks.py +195 -0
- smelt_cli-0.2.0/tests/engine/test_inference.py +570 -0
- smelt_cli-0.2.0/tests/engine/test_mirror_inference.py +90 -0
- smelt_cli-0.2.0/tests/engine/test_native_git.py +195 -0
- smelt_cli-0.2.0/tests/engine/test_ordering_fixes.py +214 -0
- smelt_cli-0.2.0/tests/engine/test_paths.py +148 -0
- smelt_cli-0.2.0/tests/engine/test_rule_settings.py +206 -0
- smelt_cli-0.2.0/tests/engine/test_schema.py +50 -0
- smelt_cli-0.2.0/tests/engine/test_staged.py +589 -0
- smelt_cli-0.2.0/tests/fixtures/gateway/smelt.yaml +36 -0
- smelt_cli-0.2.0/tests/fixtures/gateway/src/gateway/__init__.py +0 -0
- smelt_cli-0.2.0/tests/fixtures/gateway/src/gateway/bootstrap.py +5 -0
- smelt_cli-0.2.0/tests/fixtures/gateway/src/gateway/features/__init__.py +0 -0
- smelt_cli-0.2.0/tests/fixtures/gateway/src/gateway/features/billing/__init__.py +0 -0
- smelt_cli-0.2.0/tests/fixtures/gateway/src/gateway/features/billing/application/__init__.py +0 -0
- smelt_cli-0.2.0/tests/fixtures/gateway/src/gateway/features/billing/application/invoices.py +5 -0
- smelt_cli-0.2.0/tests/fixtures/gateway/src/gateway/features/billing/domain/__init__.py +0 -0
- smelt_cli-0.2.0/tests/fixtures/gateway/src/gateway/features/billing/domain/money.py +6 -0
- smelt_cli-0.2.0/tests/fixtures/gateway/src/gateway/features/voice/__init__.py +0 -0
- smelt_cli-0.2.0/tests/fixtures/gateway/src/gateway/features/voice/api/__init__.py +0 -0
- smelt_cli-0.2.0/tests/fixtures/gateway/src/gateway/features/voice/api/routes.py +12 -0
- smelt_cli-0.2.0/tests/fixtures/gateway/src/gateway/features/voice/application/__init__.py +0 -0
- smelt_cli-0.2.0/tests/fixtures/gateway/src/gateway/features/voice/application/ports.py +7 -0
- smelt_cli-0.2.0/tests/fixtures/gateway/src/gateway/features/voice/application/session.py +12 -0
- smelt_cli-0.2.0/tests/fixtures/gateway/src/gateway/features/voice/domain/__init__.py +0 -0
- smelt_cli-0.2.0/tests/fixtures/gateway/src/gateway/features/voice/domain/session.py +11 -0
- smelt_cli-0.2.0/tests/fixtures/gateway/src/gateway/features/voice/infra/__init__.py +0 -0
- smelt_cli-0.2.0/tests/fixtures/gateway/src/gateway/features/voice/infra/sql.py +9 -0
- smelt_cli-0.2.0/tests/fixtures/gateway/src/gateway/main.py +3 -0
- smelt_cli-0.2.0/tests/fixtures/gateway/src/gateway/shared/__init__.py +0 -0
- smelt_cli-0.2.0/tests/fixtures/gateway/src/gateway/shared/clock.py +5 -0
- smelt_cli-0.2.0/tests/helpers.py +51 -0
- smelt_cli-0.2.0/tests/model/__init__.py +0 -0
- smelt_cli-0.2.0/tests/model/test_architecture.py +143 -0
- smelt_cli-0.2.0/tests/rules/__init__.py +0 -0
- smelt_cli-0.2.0/tests/rules/dependencies/__init__.py +0 -0
- smelt_cli-0.2.0/tests/rules/dependencies/test_composition_root.py +199 -0
- smelt_cli-0.2.0/tests/rules/dependencies/test_cycles.py +208 -0
- smelt_cli-0.2.0/tests/rules/dependencies/test_fanout.py +159 -0
- smelt_cli-0.2.0/tests/rules/dependencies/test_features.py +421 -0
- smelt_cli-0.2.0/tests/rules/dependencies/test_interfaces.py +259 -0
- smelt_cli-0.2.0/tests/rules/dependencies/test_layers.py +242 -0
- smelt_cli-0.2.0/tests/rules/dependencies/test_third_party.py +301 -0
- smelt_cli-0.2.0/tests/rules/structure/__init__.py +0 -0
- smelt_cli-0.2.0/tests/rules/structure/test_assignments.py +171 -0
- smelt_cli-0.2.0/tests/rules/structure/test_contracts.py +162 -0
- smelt_cli-0.2.0/tests/rules/structure/test_coverage.py +446 -0
- smelt_cli-0.2.0/tests/rules/structure/test_enum_values.py +96 -0
- smelt_cli-0.2.0/tests/rules/structure/test_headers.py +179 -0
- smelt_cli-0.2.0/tests/rules/structure/test_import_style.py +181 -0
- smelt_cli-0.2.0/tests/rules/structure/test_layout.py +203 -0
- smelt_cli-0.2.0/tests/rules/structure/test_members.py +392 -0
- smelt_cli-0.2.0/tests/rules/structure/test_naming.py +258 -0
- smelt_cli-0.2.0/tests/rules/structure/test_ordering.py +133 -0
- smelt_cli-0.2.0/tests/rules/structure/test_package_imports.py +245 -0
- smelt_cli-0.2.0/tests/rules/structure/test_type_dispatch.py +118 -0
- smelt_cli-0.2.0/tests/rules/test_activation.py +185 -0
- smelt_cli-0.2.0/tests/rules/test_registry.py +134 -0
- smelt_cli-0.2.0/tests/rules/testing/__init__.py +0 -0
- smelt_cli-0.2.0/tests/rules/testing/test_awaits.py +154 -0
- smelt_cli-0.2.0/tests/rules/testing/test_cases.py +25 -0
- smelt_cli-0.2.0/tests/rules/testing/test_location.py +620 -0
- smelt_cli-0.2.0/tests/rules/testing/test_mocking.py +237 -0
- smelt_cli-0.2.0/tests/rules/testing/test_outcomes.py +288 -0
- smelt_cli-0.2.0/tests/rules/testing/test_private_access.py +215 -0
- smelt_cli-0.2.0/tests/rules/testing/test_public_attributes.py +358 -0
- smelt_cli-0.2.0/tests/rules/testing/test_public_functions.py +393 -0
- smelt_cli-0.2.0/tests/rules/testing/test_timing.py +61 -0
- smelt_cli-0.2.0/tests/test_docs.py +79 -0
- smelt_cli-0.2.0/uv.lock +785 -0
- smelt_cli-0.1.6/PKG-INFO +0 -955
- smelt_cli-0.1.6/README.md +0 -939
- smelt_cli-0.1.6/pyproject.toml +0 -123
- smelt_cli-0.1.6/smelt/analysis/__init__.py +0 -19
- smelt_cli-0.1.6/smelt/analysis/context.py +0 -86
- smelt_cli-0.1.6/smelt/analysis/errors.py +0 -2
- smelt_cli-0.1.6/smelt/cli/commands/__init__.py +0 -15
- smelt_cli-0.1.6/smelt/config/__init__.py +0 -24
- smelt_cli-0.1.6/smelt/engine/changes.py +0 -83
- smelt_cli-0.1.6/smelt/rules/activation.py +0 -17
- smelt_cli-0.1.6/smelt/rules/registry.py +0 -76
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/__init__.py +0 -0
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/__main__.py +0 -0
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/analysis/annotations.py +0 -0
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/analysis/exports.py +0 -0
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/analysis/graphs.py +0 -0
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/analysis/ordering_rewrite.py +37 -37
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/analysis/test_awaits.py +24 -24
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/analysis/test_timing.py +0 -0
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/analysis/type_dispatch.py +30 -30
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/cli/__init__.py +0 -0
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/cli/commands/discover.py +0 -0
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/config/errors.py +0 -0
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/config/patterns.py +0 -0
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/config/schema.py +0 -0
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/config/validation.py +0 -0
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/diagnostics/__init__.py +0 -0
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/diagnostics/render/__init__.py +0 -0
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/diagnostics/suppressions.py +0 -0
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/engine/__init__.py +0 -0
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/engine/ordering_fixes.py +33 -33
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/engine/workspace.py +0 -0
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/model/__init__.py +0 -0
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/model/architecture.py +7 -7
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/py.typed +0 -0
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/rules/__init__.py +0 -0
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/rules/dependencies/__init__.py +0 -0
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/rules/dependencies/cycles.py +0 -0
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/rules/structure/__init__.py +0 -0
- {smelt_cli-0.1.6 → smelt_cli-0.2.0}/smelt/rules/testing/__init__.py +0 -0
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
User-visible changes, newest first. Agents should read the latest release's
|
|
4
|
+
migration notes before interpreting fewer findings as an improvement. For the
|
|
5
|
+
current configuration and complete rule contracts, see the [README](README.md),
|
|
6
|
+
[rule catalog](docs/rules/README.md) and [activation guide](docs/rule-selection.md).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [0.2.0] - 2026-10-31
|
|
11
|
+
|
|
12
|
+
- Visibility reviews (SMT316/SMT317/SMT429/SMT430) explicitly limit their claims to
|
|
13
|
+
analyzed callers and expose `usage_scope`, including exclusions and unassessed
|
|
14
|
+
maintainer scripts, unselected packages and external consumers. They do not
|
|
15
|
+
scan excluded code or infer that unobserved callers cannot exist.
|
|
16
|
+
- SMT313 fix refusals identify the triggering expression and source location in
|
|
17
|
+
`fix_blocker` and the human-readable reason, including inherited/decorated
|
|
18
|
+
classes, namespace inspection and nonliteral type variables. Existing safety
|
|
19
|
+
refusals are retained; skipped-fix output carries the same location.
|
|
20
|
+
- SMT425 recognizes locally assigned nonempty list/set/dict literals, including
|
|
21
|
+
annotations and aliases, and discards that evidence after possible mutations,
|
|
22
|
+
calls or branch merges. SMT424/SMT425 also recognize direct assertions in
|
|
23
|
+
statically known, checked `sys.executable -c` subprocesses. Unchecked exits,
|
|
24
|
+
optimized Python, dynamic scripts, files and potentially swallowed failures
|
|
25
|
+
remain outside recognition; subprocess review hints explain that boundary.
|
|
26
|
+
- Smelt now checks its own sources with public-first ordering, internal-member
|
|
27
|
+
visibility, test-only public API reviews, when-needed future annotations and
|
|
28
|
+
test-quality reviews. CI and release validation fail on warnings too. Internal
|
|
29
|
+
helpers are private, obsolete snapshot helpers are removed, and deliberate
|
|
30
|
+
primitive/cache tests carry local, reasoned exceptions. Consumer defaults stay
|
|
31
|
+
unchanged.
|
|
32
|
+
- SMT420 locates private imports on the imported name, including aliases in
|
|
33
|
+
multiline imports. A reasoned exception on that name now survives Ruff
|
|
34
|
+
formatting and does not suppress neighboring import lines; put multiline
|
|
35
|
+
import exceptions next to the affected name.
|
|
36
|
+
- Optional [SMT319](docs/rules/SMT319.md), enabled with
|
|
37
|
+
`rules: {prefer-package-import: hint}` or `--select SMT319`, suggests existing
|
|
38
|
+
package re-exports so callers can combine imports through a common `__init__.py`.
|
|
39
|
+
All names must have direct, unconditional public re-exports in analyzed code;
|
|
40
|
+
internal package imports and unscanned third-party packages are excluded.
|
|
41
|
+
Findings preserve aliases in their suggestions; checks never rewrite imports.
|
|
42
|
+
- Worker transport now acknowledges requests within 250 ms and bounds accepted
|
|
43
|
+
responses to five seconds, including partial output. Failures fall back to
|
|
44
|
+
foreground checking without repeating accepted requests. A watchdog and four
|
|
45
|
+
OS-owned worker slots bound background sessions; terminated workers release
|
|
46
|
+
capacity. Whole-process memory observations include helpers and Windows
|
|
47
|
+
launchers; the retained-state budget is not a total-process memory quota.
|
|
48
|
+
- Default cached staged checks read HEAD, the index and Git objects through a
|
|
49
|
+
persistent native reader, avoiding Git child-process starts. The reader supports
|
|
50
|
+
SHA-1/SHA-256, packed objects, linked worktrees, split indexes and alternate
|
|
51
|
+
commit indexes. Unsupported repositories, other Git overrides and reader
|
|
52
|
+
failures fall back to Git; `--no-cache` keeps independent reads. Workers also
|
|
53
|
+
retain bounded member dependency state, validating current inputs before reuse
|
|
54
|
+
and discarding borrowed state on failed updates. Worker requests are sent as
|
|
55
|
+
complete TCP frames. See the [paired CLI and complete-hook measurements](docs/agent-workflow.md).
|
|
56
|
+
- Staged checks reuse verified policy blobs before parsing configuration, avoiding
|
|
57
|
+
a redundant Git blob subprocess after source edits. Policy changes still use
|
|
58
|
+
their captured object ID; `--no-cache` keeps independent reads. Paired Windows
|
|
59
|
+
CLI edit medians improve about 11%; complete-hook gains remain inconclusive.
|
|
60
|
+
- The installed CLI now uses a native Rust client and bounded local workers for
|
|
61
|
+
read-only checks. Fresh clients reuse imports, while every check captures current
|
|
62
|
+
Git/config inputs. CI, fixes and other commands stay in the foreground; worker
|
|
63
|
+
startup/transport failures fall back to checking. Workers restart when analyzer
|
|
64
|
+
identity changes and expire after 120 idle seconds. Source installs, including
|
|
65
|
+
pre-commit environments from Git, now require Rust; release wheels include the
|
|
66
|
+
compiled client. `python -m smelt` retains the direct Python entry point.
|
|
67
|
+
- Member-local checks maintain a persistent reverse dependency index and replace
|
|
68
|
+
only changed usage contributions. Unchanged decisions can be reused without
|
|
69
|
+
loading all definition objects. Removed callers, re-exports, missing namespaces,
|
|
70
|
+
inheritance and inventory changes remain part of invalidation.
|
|
71
|
+
|
|
72
|
+
- Checks select built-in rules using a generated lightweight catalog, loading only
|
|
73
|
+
the needed implementations. Staged results can survive edits to unobserved
|
|
74
|
+
content while preserving the current index hash in JSON/SARIF; additions,
|
|
75
|
+
deletions, observed source, config, metadata and debt still invalidate them.
|
|
76
|
+
Normal cached staged retries capture repository/HEAD and index in two Git
|
|
77
|
+
invocations. A separate benchmark measures a retained Python worker including
|
|
78
|
+
fresh client startup and IPC; it preceded the native client above.
|
|
79
|
+
See [the performance measurements](docs/agent-workflow.md).
|
|
80
|
+
- Staged checks read captured Git blobs directly instead of writing temporary
|
|
81
|
+
source trees. An unchanged retry can reuse its exact result before loading the
|
|
82
|
+
analysis engine. Per-file import, member and test facts and selected findings
|
|
83
|
+
are reused across edits, with dependency-aware invalidation for callers,
|
|
84
|
+
re-exports and fixtures. `--no-cache` remains an independent check. See the
|
|
85
|
+
[paired CLI benchmarks and cache limits](docs/agent-workflow.md).
|
|
86
|
+
- `architecture.imports.transitive: true` now checks arbitrary import chains for
|
|
87
|
+
layer, cross-feature, shared, composition-root and third-party policies, e.g.
|
|
88
|
+
`domain → shared.utils → sqlalchemy`. Findings include a deterministic shortest
|
|
89
|
+
chain with each hop's source line; `TYPE_CHECKING` policy applies at every hop.
|
|
90
|
+
The opt-in now follows all reachable module imports, including allowed layers
|
|
91
|
+
and unused facade exports, rather than just selected re-exports. External
|
|
92
|
+
packages remain leaves and the default is still direct imports only. Smelt's
|
|
93
|
+
own repository policy enables these checks. See
|
|
94
|
+
[SMT101](docs/rules/SMT101.md) and [SMT103](docs/rules/SMT103.md).
|
|
95
|
+
- **Breaking configuration API:** fixed source/test checks are enabled directly by
|
|
96
|
+
problem name in `rules`, with one value for activation and severity. Removed
|
|
97
|
+
`review_*`, assertion/private-import boolean flags, binary helper conventions,
|
|
98
|
+
`ordering.enabled` and the experimental preset. Public-first ordering needs an
|
|
99
|
+
explicit rule entry; options alone do not enable it. Package `rules` use the
|
|
100
|
+
same names and closest-package precedence. Stable SMT codes, debt identities
|
|
101
|
+
and architecture-policy activation are retained. See the complete
|
|
102
|
+
[migration table and developer-facing YAML API](docs/configuration.md).
|
|
103
|
+
- `--select` and `--ignore` accept the same canonical names as YAML and `explain`.
|
|
104
|
+
`context` reports effective rule severities for existing and planned modules.
|
|
105
|
+
Scoped-off debt is retained as unassessed when recording/pruning.
|
|
106
|
+
- `smelt init --maintainability` writes explicit individual checks, plus a local
|
|
107
|
+
`.smelt.schema.json` and YAML modeline. Editor completions, validation and hover
|
|
108
|
+
examples come from the real catalog and work offline. Plain `init` keeps its
|
|
109
|
+
conservative check selection. Existing configs can export `smelt config schema`
|
|
110
|
+
and add the modeline; see [editor setup](docs/configuration.md#editor-completion-hover-and-validation).
|
|
111
|
+
- Optional [SMT430](docs/rules/SMT430.md), enabled by
|
|
112
|
+
`rules: {test-only-public-attribute: warning}` or `--select SMT430`,
|
|
113
|
+
reviews public instance/class data attributes read only by tests outside their
|
|
114
|
+
class. Findings include test locations and a collision-free private name.
|
|
115
|
+
Possible production accesses and uncertain class contracts preserve visibility;
|
|
116
|
+
checks never rename code. Public-use rules now share the same member index,
|
|
117
|
+
export/import evidence and private-name suggestions. The new rule is off by
|
|
118
|
+
default and never renames code automatically.
|
|
119
|
+
- Optional [SMT318](docs/rules/SMT318.md), enabled with `rules: {SMT318: hint}`
|
|
120
|
+
or `--select SMT318`, reviews direct `StrEnum.MEMBER.value` reads for using the
|
|
121
|
+
string enum member directly. Known import aliases and analyzed re-exports are
|
|
122
|
+
supported; ordinary enums, uncertain bindings and instance inference are
|
|
123
|
+
excluded. Exact-string boundaries can still need a conversion, so findings
|
|
124
|
+
remain advisory and checks stay read-only. The default rule set is unchanged.
|
|
125
|
+
- `smelt check --staged` reviews the actual Git index against HEAD, using staged
|
|
126
|
+
source, configuration, Python metadata and debt. The new `smelt-staged` hook
|
|
127
|
+
blocks new warnings as well as errors, including findings in unchanged methods
|
|
128
|
+
whose last caller was removed. Partial staging and untracked files cannot hide
|
|
129
|
+
commit findings. JSON/SARIF distinguish staged scope from working-tree changes.
|
|
130
|
+
- Content-addressed JSON caches reuse complete analyses, per-file member facts
|
|
131
|
+
and the historical baseline. `--no-cache` recomputes independently. Member-use
|
|
132
|
+
analysis avoids repeated per-function tree walks; cache invalidation includes
|
|
133
|
+
contents, inventory, policy, Python targets and analyzer implementation. See
|
|
134
|
+
[the commit workflow and benchmark](docs/agent-workflow.md). Changed/staged
|
|
135
|
+
snapshots reject symbolic links; staged fixes require editing and re-staging
|
|
136
|
+
working files explicitly.
|
|
137
|
+
- SMT316 feedback explains how to retain a deliberate public API with a reasoned
|
|
138
|
+
`# smelt: ignore[SMT316] -- ...` comment on its definition. Existing suppression
|
|
139
|
+
reason and unused-suppression checks continue to apply with caching.
|
|
140
|
+
|
|
141
|
+
- Optional [SMT316](docs/rules/SMT316.md), enabled with
|
|
142
|
+
`rules: {internal-public-member: warning}`, reviews public module functions and
|
|
143
|
+
ordinary instance methods with no observed external use, including unused
|
|
144
|
+
definitions. Findings suggest a private name and list internal uses/callbacks
|
|
145
|
+
so agents can review renames. Existing private names are avoided. Explicit
|
|
146
|
+
exports, decorators, inheritance and possible external method accesses preserve
|
|
147
|
+
public APIs; test-only public module functions remain covered by SMT429.
|
|
148
|
+
- Optional [SMT317](docs/rules/SMT317.md), enabled with
|
|
149
|
+
`rules: {internal-static-helper: hint}`, suggests extracting internal static helpers
|
|
150
|
+
to private module functions. Class dependencies, inheritance, extra decorators
|
|
151
|
+
and possible external callers preserve deliberate static APIs. Both new
|
|
152
|
+
rules support closest package `off` overrides and appear in `smelt context`.
|
|
153
|
+
Checks remain read-only and the default rule set is unchanged.
|
|
154
|
+
- Optional [SMT429](docs/rules/SMT429.md), enabled by
|
|
155
|
+
`rules: {test-only-public-function: warning}`, reviews public module functions
|
|
156
|
+
accessed from tests but not from other analyzed production modules. Findings
|
|
157
|
+
suggest a leading underscore and include test locations so agents can review
|
|
158
|
+
the rename and test the public caller. Explicit exports and decorated functions
|
|
159
|
+
stay public; external/dynamic consumers remain a review limitation. The default
|
|
160
|
+
rule set is unchanged.
|
|
161
|
+
|
|
162
|
+
## [0.1.6] - 2026-10-29
|
|
163
|
+
|
|
164
|
+
### Compatibility and activation
|
|
165
|
+
|
|
166
|
+
- SMT428 remains opt-in through `tests.review_async_mock_assertions`; the default
|
|
167
|
+
rule set is unchanged. Its findings ask for review of an individual test, not a
|
|
168
|
+
claim that the suite misses the regression.
|
|
169
|
+
- Existing `tests.review_test_deadlines` policies can now report additional known
|
|
170
|
+
asyncio subprocess waits. Review each operation's local deadline, including
|
|
171
|
+
cleanup paths, rather than adding a blanket timeout or await restriction.
|
|
172
|
+
|
|
173
|
+
### Added and fixed
|
|
174
|
+
|
|
175
|
+
- SMT426 now reviews `wait()` and `communicate()` on known asyncio subprocesses
|
|
176
|
+
created through awaited standard factories or explicit Process annotations.
|
|
177
|
+
Each operation needs its own local guard, including exit waits after bounded
|
|
178
|
+
reads or `kill()`. Unknown process-like objects remain outside scope.
|
|
179
|
+
- Optional SMT428 (`tests.review_async_mock_assertions`) reviews call-only checks
|
|
180
|
+
on known async mocks and async class-spec methods. Await assertions, deliberate
|
|
181
|
+
scheduling checks and synchronous methods remain valid. Known fixture specs and
|
|
182
|
+
simple local history values are traced without executing analyzed code; unknown
|
|
183
|
+
methods and general data flow remain outside scope. Executed missing-await
|
|
184
|
+
counterexamples demonstrate the distinction between call and await assertions.
|
|
185
|
+
- `context` text now shows all adopted test-quality review flags, including when
|
|
186
|
+
only the newer policies are enabled.
|
|
187
|
+
- SMT424 recognizes awaited, typed Event observations inside local timeout
|
|
188
|
+
contexts that raise on expiry, consistently with SMT426 deadline recognition.
|
|
189
|
+
Unused contexts, unawaited waits and `move_on_after` scopes are not outcome
|
|
190
|
+
evidence; configured timeout helpers alone still do not count as assertions.
|
|
191
|
+
|
|
192
|
+
## [0.1.5] - 2026-10-29
|
|
193
|
+
|
|
194
|
+
### Compatibility and activation
|
|
195
|
+
|
|
196
|
+
- Existing opted-in test policies can report additional MonkeyPatch operations
|
|
197
|
+
and known instance accesses. New SMT425-SMT427 review policies remain opt-in;
|
|
198
|
+
the small default rule set is unchanged. Review legitimate boundary tests
|
|
199
|
+
rather than exposing internals or imposing a global mock ban.
|
|
200
|
+
- `--fail-on warning` now includes configuration warnings, and unused
|
|
201
|
+
`pytest.raises`/`warns` context objects no longer count as outcome evidence.
|
|
202
|
+
A passing static report is not proof of test effectiveness.
|
|
203
|
+
|
|
204
|
+
### Added and fixed
|
|
205
|
+
|
|
206
|
+
- `scripts/evaluate.py` supports repeatable agent review loops: compare two import
|
|
207
|
+
roots on identical config bytes, retain
|
|
208
|
+
structured recognition changes and independently bounded logs, then optionally
|
|
209
|
+
execute explicitly selected pytest targets. Invalid analysis, timeouts and
|
|
210
|
+
incomplete collection remain distinct from test failures; normal checks never
|
|
211
|
+
execute analyzed tests. See the [evaluation workflow](docs/testing.md#evaluate-a-test-quality-change).
|
|
212
|
+
- Test outcome review now recognizes known mock interaction assertions, annotated
|
|
213
|
+
fixture receivers and awaited, bounded asyncio Event observations. Unused
|
|
214
|
+
`pytest.raises`/`warns` context objects no longer count as checks. Unknown
|
|
215
|
+
`assert_*` methods and fixture execution alone remain insufficient evidence.
|
|
216
|
+
- [SMT420](docs/rules/SMT420.md) tracks direct known production constructors and
|
|
217
|
+
explicitly typed instance reads, including analyzed facade re-exports and
|
|
218
|
+
consistent known fixture return/yield tuple components. Unknown/conflicting
|
|
219
|
+
outputs, private writes and local fakes are excluded; fixture inference has
|
|
220
|
+
separate provenance and respects class/conftest scope. A private class import
|
|
221
|
+
is not reported again for each public instance operation.
|
|
222
|
+
[SMT421–SMT423](docs/rules/SMT422.md) now include MonkeyPatch attribute
|
|
223
|
+
replacement, aliases and context scopes, with operation/provenance metadata.
|
|
224
|
+
MonkeyPatch environment/mapping setup is excluded from the mock count.
|
|
225
|
+
- Optional [SMT425](docs/rules/SMT425.md), [SMT426](docs/rules/SMT426.md) and
|
|
226
|
+
[SMT427](docs/rules/SMT427.md) review potentially vacuous outcomes, known waits
|
|
227
|
+
without deadlines/scheduler-clock replacements, and small independent-case loop
|
|
228
|
+
candidates. They remain advisory and require explicit test policies; no fixer,
|
|
229
|
+
blanket mock/sleep ban or assertion quota is introduced.
|
|
230
|
+
- Configuration warnings now appear in JSON `configuration_diagnostics`, SARIF
|
|
231
|
+
configuration notifications, GitHub annotations and text summaries. They count
|
|
232
|
+
toward `summary.warnings` and `--fail-on warning`, including scoped/changed
|
|
233
|
+
checks; rule selection, suppressions and debt cannot hide configuration warnings.
|
|
234
|
+
|
|
235
|
+
## [0.1.4] - 2026-10-29
|
|
236
|
+
|
|
237
|
+
### Migration: rule activation changed
|
|
238
|
+
|
|
239
|
+
- Only **SMT301, SMT901, SMT902 and SMT903** run by default. Declaring an
|
|
240
|
+
architecture, package or test policy activates the corresponding checks without
|
|
241
|
+
a second enable switch. The catalog now distinguishes 4 default, 24 policy-driven
|
|
242
|
+
and 2 explicitly selected rules; activation and severity are separate.
|
|
243
|
+
- **SMT104 import cycles and SMT305 unclassified-module hints require explicit
|
|
244
|
+
selection.** To retain these checks from earlier versions, add:
|
|
245
|
+
|
|
246
|
+
```yaml
|
|
247
|
+
rules:
|
|
248
|
+
SMT104: error
|
|
249
|
+
SMT305: warning
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
- `--select SMT3` and `--select ALL` activate matching opt-in checks and replace
|
|
253
|
+
normal selection. Explicit `off` settings and ignores still win; selection does
|
|
254
|
+
not invent missing policies. Strict coverage remains mandatory when configured
|
|
255
|
+
or requested, even outside the selected rule prefix.
|
|
256
|
+
- `smelt init` still proposes architecture but leaves naming conventions and test
|
|
257
|
+
mirroring disabled for review. A detected mirror pattern remains available as a
|
|
258
|
+
setting, with an activation comment.
|
|
259
|
+
- Debt for inactive or hint-only rules is retained when recording/pruning, rather
|
|
260
|
+
than silently considered resolved. Older cycle and indirect-import debt can
|
|
261
|
+
resurface because corrected fingerprints track the actual dependency. Review
|
|
262
|
+
these findings before recording new debt.
|
|
263
|
+
|
|
264
|
+
### Added
|
|
265
|
+
|
|
266
|
+
| Capability | Rules / interface | What agents can now check |
|
|
267
|
+
| --- | --- | --- |
|
|
268
|
+
| Strict architecture coverage | [SMT306](docs/rules/SMT306.md), `project.coverage: strict`, `--strict-coverage` | Production files outside package selection, missing architecture roles and exclusions without reasons. These gaps cannot be hidden by changed/path filters, suppressions or debt. |
|
|
269
|
+
| Package structure and public APIs | [SMT107](docs/rules/SMT107.md), [SMT307](docs/rules/SMT307.md) | Required modules and explicit public entry points through `structure.contracts`; outside callers cannot import private implementation modules. |
|
|
270
|
+
| Import fanout | [SMT108](docs/rules/SMT108.md) | Optional hints when one outside caller imports too many distinct modules from the same contracted package. |
|
|
271
|
+
| Source conventions | [SMT308](docs/rules/SMT308.md)–[SMT312](docs/rules/SMT312.md) | Scoped absolute/relative import styles, module-docstring policy, future-annotation policy and private module/package names. Python targets come from declared metadata or configuration. |
|
|
272
|
+
| Definition order | [SMT313](docs/rules/SMT313.md) | Dependency-aware module/class ordering, including execution barriers and bounded, explicitly requested fixes. |
|
|
273
|
+
| Instance field assignments | [SMT314](docs/rules/SMT314.md) | Bundled or chained writes to multiple direct instance attributes when `instance_assignments: separate` is declared. |
|
|
274
|
+
| Type dispatch | [SMT315](docs/rules/SMT315.md) | Review hints for same-subject `isinstance`/`elif` chains under a declared `type_dispatch` policy. |
|
|
275
|
+
| Test quality | [SMT420](docs/rules/SMT420.md)–[SMT424](docs/rules/SMT424.md) | Configured private production access, forbidden mocks, string patch targets, per-test patch limits and missing recognized outcome assertions. |
|
|
276
|
+
|
|
277
|
+
- `smelt context <path> --format json` explains ownership, coverage status,
|
|
278
|
+
applicable contracts, effective conventions and Python targets for existing or
|
|
279
|
+
planned files. Planned placement is distinguished from analyzed source.
|
|
280
|
+
- `check --show-coverage` exposes the per-file policy inventory. JSON reports add
|
|
281
|
+
discovery roots, classification counts, policy references, exclusions and a
|
|
282
|
+
policy hash. Rule metadata exposes activation, analysis requirements and
|
|
283
|
+
configuration paths through `rules`, `explain` and reports.
|
|
284
|
+
- Contributor documentation and catalog checks verify explicit registration,
|
|
285
|
+
unique rule codes/names, complete metadata and generated documentation.
|
|
286
|
+
- Tag-triggered PyPI Trusted Publishing validates the tag/version and main
|
|
287
|
+
ancestry, runs checks, builds and smoke-tests both distributions, then publishes
|
|
288
|
+
the validated artifacts without a stored PyPI API token.
|
|
289
|
+
|
|
290
|
+
### Fixed
|
|
291
|
+
|
|
292
|
+
- Resolve named re-exports across layer, feature, shared and composition-root
|
|
293
|
+
boundaries. Indirect findings retain the final forbidden target; declared
|
|
294
|
+
feature wiring no longer produces false unknown-layer findings.
|
|
295
|
+
- Track every cyclic architecture edge and semantic identities/multiplicity in
|
|
296
|
+
changed/debt comparisons. New edges, patches or ordering inversions cannot hide
|
|
297
|
+
behind an accepted aggregate finding. Existing violations do not become new
|
|
298
|
+
merely because an import's formatting, comment or alias changed.
|
|
299
|
+
- Merge namespace package portions, reject duplicate module definitions and infer
|
|
300
|
+
usable workspace source roots. Grouped imports check every alias, and source
|
|
301
|
+
discovery avoids symlink cycles.
|
|
302
|
+
- Reject duplicate YAML keys and invalid source encoding. With `--format json`,
|
|
303
|
+
usage/configuration/analysis errors return structured error documents; reports
|
|
304
|
+
identify their origin and comparison scope. SARIF and GitHub paths are rebased
|
|
305
|
+
correctly for nested configurations.
|
|
306
|
+
|
|
307
|
+
### Agent workflow and limits
|
|
308
|
+
|
|
309
|
+
```bash
|
|
310
|
+
smelt rules --format json
|
|
311
|
+
smelt context path/to/module.py --format json
|
|
312
|
+
smelt check --changed --base origin/main --format json
|
|
313
|
+
smelt check --strict-coverage --show-coverage --format json
|
|
314
|
+
smelt explain SMT313 --format json
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
- Normal checks are read-only. After configuring ordering with `fix: safe-only`,
|
|
318
|
+
`smelt check --select SMT313 --fix` can apply bounded definition moves. It
|
|
319
|
+
preserves source trivia, validates the permitted AST moves and refuses unsafe
|
|
320
|
+
or concurrently changed files. Run the project formatter afterwards.
|
|
321
|
+
- SMT314 and SMT315 have no automatic rewrite. Splitting assignments or converting
|
|
322
|
+
type dispatch can change evaluation, guards and fallthrough.
|
|
323
|
+
- Coverage means policy assignment within declared discovery roots, not a proof
|
|
324
|
+
of behavior. Package APIs and test-quality checks are static and do not infer
|
|
325
|
+
dynamic imports, arbitrary runtime access or fixture dependency effects.
|
|
326
|
+
- Import fanout, match suggestions and missing-assertion checks are review aids;
|
|
327
|
+
their default severities differ. Configure policy and severity deliberately.
|
|
328
|
+
|
|
329
|
+
[Unreleased]: https://github.com/mathisarends/smelt/compare/v0.2.0...HEAD
|
|
330
|
+
[0.2.0]: https://github.com/mathisarends/smelt/compare/v0.1.6...v0.2.0
|
|
331
|
+
[0.1.6]: https://github.com/mathisarends/smelt/compare/v0.1.5...v0.1.6
|
|
332
|
+
[0.1.5]: https://github.com/mathisarends/smelt/compare/v0.1.4...v0.1.5
|
|
333
|
+
[0.1.4]: https://github.com/mathisarends/smelt/compare/v0.1.3...v0.1.4
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
# Extending Smelt
|
|
2
|
+
|
|
3
|
+
Use [the vision](docs/vision.md) as the scope and acceptance filter for proposed changes.
|
|
4
|
+
|
|
5
|
+
Development requires Python 3.12+ and Rust 1.88+ with rustfmt/clippy and a platform
|
|
6
|
+
linker. `uv sync --locked` builds the native `smelt` client with maturin; uv's cache
|
|
7
|
+
keys include the Cargo manifests and native Rust sources. `python -m smelt` keeps
|
|
8
|
+
the direct Python entry point for debugging and uncached comparisons. Installed
|
|
9
|
+
wheels include both the native client and the Python engine. Keep Cargo.toml's
|
|
10
|
+
version equal to pyproject.toml's version when releasing.
|
|
11
|
+
|
|
12
|
+
The native client reuses a worker for read-only local checks. Workers are scoped
|
|
13
|
+
to the interpreter, environment and invocation directory, serialize requests and
|
|
14
|
+
expire after 120 idle seconds. Every request captures Git/configuration again.
|
|
15
|
+
Changes to analyzer sources/dependency identity restart the worker. `--fix`, other
|
|
16
|
+
commands and CI run directly; `SMELT_DAEMON=0` disables workers and
|
|
17
|
+
`SMELT_DAEMON=1` enables them explicitly in CI. Transport/startup failures fall
|
|
18
|
+
back to the foreground checker. Tests must cover fresh-client output/exit codes,
|
|
19
|
+
partial staging, restart, concurrent startup and independent `--no-cache` results.
|
|
20
|
+
|
|
21
|
+
Native interpreter launches use Python's safe-path mode so a project package named
|
|
22
|
+
`smelt` cannot replace the installed analyzer. Explicit PYTHONPATH overrides are
|
|
23
|
+
retained; relative PYTHONPATH/PYTHONHOME/PYTHONUSERBASE entries use the foreground
|
|
24
|
+
path to preserve their interpretation relative to the caller's directory.
|
|
25
|
+
|
|
26
|
+
An agent mistake is evidence for a regression, not automatically a new rule. Start
|
|
27
|
+
with the smallest reproducible example, the intended result and a nearby valid
|
|
28
|
+
counterexample. Fix an existing rule when its documented contract already covers
|
|
29
|
+
the case. Add a rule when the decision has a distinct meaning and can generalize
|
|
30
|
+
beyond the repository that exposed it. Use a configurable package policy for team
|
|
31
|
+
preferences. Consider whether an existing Ruff/type-checker check already covers
|
|
32
|
+
the same decision before adding another finding.
|
|
33
|
+
|
|
34
|
+
## Where a change belongs
|
|
35
|
+
|
|
36
|
+
| Concern | Location | Responsibility |
|
|
37
|
+
| --- | --- | --- |
|
|
38
|
+
| Source facts | `smelt/analysis/` | Discovery, parsing and reusable indexes; never execute analyzed code |
|
|
39
|
+
| Policy data | `smelt/config/models.py` | Typed configuration, defaults and validation |
|
|
40
|
+
| Rule decision | `smelt/rules/<category>/<concept>.py` | Compare facts with policy and emit violations |
|
|
41
|
+
| Catalog | `smelt/rules/registry.py` | Explicitly register each rule once |
|
|
42
|
+
| Diagnostic content | The rule's `RuleDoc` | Summary, rationale, bad/good examples, repair advice and config paths |
|
|
43
|
+
| Execution and scope | `smelt/engine/` | Selection, severity, suppressions, debt and changed comparisons |
|
|
44
|
+
| Output and CLI | `smelt/diagnostics/`, `smelt/cli/` | Render findings and expose commands |
|
|
45
|
+
| Regression | Mirrored paths under `tests/` | Demonstrate the failure and protect valid neighbors |
|
|
46
|
+
| Generated reference | `docs/rules/`, `smelt.schema.json` | Generated from code; edit their sources instead |
|
|
47
|
+
|
|
48
|
+
Rules depend on analysis/config/model/diagnostics, never engine or CLI. The engine
|
|
49
|
+
composes rules. Share a source fact through an analysis index when several rules
|
|
50
|
+
need it; don't make one rule call another or hide policy decisions in parsing.
|
|
51
|
+
Smelt checks these architecture boundaries with its own `smelt.yml`.
|
|
52
|
+
|
|
53
|
+
The repository also enables public-first ordering, internal-member/static-helper
|
|
54
|
+
visibility, test-only public functions/attributes and test-quality reviews. Future
|
|
55
|
+
annotations follow `when-needed` using the supported Python minimum in package
|
|
56
|
+
metadata (currently 3.12), not the developer's interpreter. Keep imports needed for
|
|
57
|
+
forward references, TYPE_CHECKING or runtime annotation consumers.
|
|
58
|
+
|
|
59
|
+
Run `uv run smelt check --strict-coverage --fail-on warning` before committing.
|
|
60
|
+
CI and release validation use the same warning threshold; the staged hook checks
|
|
61
|
+
new findings against HEAD. Do not record debt or disable rules to adopt a change.
|
|
62
|
+
Prefer private helpers and test public behavior. A direct unit test of a parser,
|
|
63
|
+
rewriter or cache invalidation boundary can use a local `SMT420` exception with a
|
|
64
|
+
specific reason; in multiline imports put it on the imported name. Entry points
|
|
65
|
+
used by excluded maintainer scripts have deliberate `__all__` exports.
|
|
66
|
+
|
|
67
|
+
The checker selects rules through generated `smelt/rules/catalog.json` metadata
|
|
68
|
+
and imports implementations only when needed. Register implementation paths in
|
|
69
|
+
`rules/registry.py`; rule classes remain the metadata source. Shared pure policy
|
|
70
|
+
predicates live in `rules/activation.py`. Refresh the catalog together with the
|
|
71
|
+
reference using `python scripts/generate.py`.
|
|
72
|
+
|
|
73
|
+
Checks read project inputs through `config.source.SourceStore`. Use the store on
|
|
74
|
+
the analysis context or file index for reads, existence tests, discovery and path
|
|
75
|
+
resolution; direct `Path` reads can accidentally inspect unstaged files during a
|
|
76
|
+
Git-index check. Keep configured paths inside the captured repository. Cached
|
|
77
|
+
facts must include content identity and any module, inventory, metadata or policy
|
|
78
|
+
inputs that affect their meaning. Verify results against `--no-cache` after edits,
|
|
79
|
+
deletions, re-exports and fixture changes. Mark a rule `file_local` only when its
|
|
80
|
+
source contents, resolved policy and Python target fully determine its decision.
|
|
81
|
+
`test_local` rules additionally receive resolved constructor, fixture and module
|
|
82
|
+
inventory inputs. `member_local` rules consume resolved member facts, including
|
|
83
|
+
current external-use and inheritance evidence. Global rules must retain their
|
|
84
|
+
cross-file dependencies.
|
|
85
|
+
|
|
86
|
+
Member-local decisions use a persisted dependency index. File summaries contribute
|
|
87
|
+
reference/attribute/inheritance counts and record both positive and missing
|
|
88
|
+
namespace dependencies. Changed contributions invalidate reverse readers; equal
|
|
89
|
+
contributions do not propagate to unrelated definitions. Keep the uncached member
|
|
90
|
+
analysis independent so differential tests can detect invalidation errors.
|
|
91
|
+
|
|
92
|
+
Keep related rules together when they share a concept, as in `structure/headers.py`.
|
|
93
|
+
Give a growing concept its own module rather than expanding a catch-all file.
|
|
94
|
+
Normal checks stay read-only. A new rule does not need a fixer or a new index.
|
|
95
|
+
|
|
96
|
+
## One rule, one catalog entry
|
|
97
|
+
|
|
98
|
+
New BaseRule subclasses are off by default. Choose activation alongside the rule:
|
|
99
|
+
|
|
100
|
+
Fixed-pattern source/test reviews are selected directly by a problem name in
|
|
101
|
+
`rules`; do not add `review_*`, `require_*` or other duplicate boolean switches.
|
|
102
|
+
Keep real options separate from activation. Package `rules` use the same names
|
|
103
|
+
and severities, with closest-package precedence. Update the canonical class/name,
|
|
104
|
+
CLI explanation, findings, editor schema and documentation together. Stable SMT
|
|
105
|
+
codes preserve diagnostic and debt identities across a documented name migration.
|
|
106
|
+
|
|
107
|
+
- Reserve `enabled_by_default = True` for reliable baseline diagnostics that need
|
|
108
|
+
no opinionated policy. The baseline set is locked by catalog tests.
|
|
109
|
+
- Use `PolicyActivation(description, matches)` from `smelt.rules.activation` for
|
|
110
|
+
an explicit architecture/package/test policy. Its predicate receives a typed
|
|
111
|
+
SmeltConfig; keep the predicate pure and let mypy check field access. It must not
|
|
112
|
+
inspect source files or infer architecture. Per-file checks still resolve closest
|
|
113
|
+
package overrides normally.
|
|
114
|
+
- Leave activation unset for a heuristic requiring a deliberate `rules` entry or
|
|
115
|
+
CLI selection. Check applicability inside the rule even when selected with ALL.
|
|
116
|
+
|
|
117
|
+
Activation and severity are separate. Do not require users to configure both a
|
|
118
|
+
policy and an enable flag. Test missing policy, active policy, allow/disabled
|
|
119
|
+
overrides and important falsy values such as public: [] or a patch limit of zero.
|
|
120
|
+
Add a policy-activation regression when introducing a new policy. CLI prefixes must
|
|
121
|
+
also activate opt-in rules, while explicit off/ignore and strict coverage retain
|
|
122
|
+
their precedence. The generated catalog and CLI metadata derive activation from
|
|
123
|
+
the rule class; there is no second registration list of activation decisions.
|
|
124
|
+
|
|
125
|
+
Use `BaseRule`, a stable code, a unique kebab-case name, a category, explicit
|
|
126
|
+
`requires` and a complete `RuleDoc`. Allocate an unused code from the live catalog:
|
|
127
|
+
|
|
128
|
+
| Range | Category |
|
|
129
|
+
| --- | --- |
|
|
130
|
+
| SMT1xx | dependencies |
|
|
131
|
+
| SMT3xx | structure |
|
|
132
|
+
| SMT4xx | tests (directory `testing/`) |
|
|
133
|
+
| SMT9xx | meta, evaluated by engine post-processing where appropriate |
|
|
134
|
+
|
|
135
|
+
Run `uv run smelt rules --format json` before allocating. Gaps are not promises
|
|
136
|
+
that a historical code is reusable; check history, and never repurpose a published
|
|
137
|
+
code or name. Reconcile allocations when concurrent PRs introduce rules.
|
|
138
|
+
|
|
139
|
+
1. Implement the decision next to the closest concept. `structure/naming.py` is a
|
|
140
|
+
small file-policy example; `dependencies/interfaces.py` shows richer import
|
|
141
|
+
analysis; `structure/ordering.py` consumes a dedicated analysis index.
|
|
142
|
+
2. Use `self.violation(...)` so metadata and documentation links stay consistent.
|
|
143
|
+
Include a concrete location, useful `expected` policy data and an actionable
|
|
144
|
+
hint. Keep output deterministic. Avoid a report for every alias when one
|
|
145
|
+
architectural decision explains them all.
|
|
146
|
+
3. Register the implementation path in `_IMPLEMENTATIONS` in `rules/registry.py`.
|
|
147
|
+
Keep abstract helper classes private; `build_rule_set()` is the public factory.
|
|
148
|
+
Production registration stays explicit; test discovery detects forgotten rules.
|
|
149
|
+
4. Add policy to the existing typed configuration only if needed. Preserve package
|
|
150
|
+
ownership, closest-policy overrides and conservative behavior for unknown
|
|
151
|
+
Python versions. Expose new placement policy in `context` when an agent needs it
|
|
152
|
+
before creating a file. Do not hardcode example-project package names.
|
|
153
|
+
5. Add the regression and a valid counterexample. Cover aliasing, relative imports,
|
|
154
|
+
Python targets or package layouts when they affect the decision. Assert code,
|
|
155
|
+
location and relevant policy payload rather than entire incidental messages.
|
|
156
|
+
6. Regenerate documentation/schema and run the checks below.
|
|
157
|
+
|
|
158
|
+
`RuleDoc` is the documentation source. `engine.check.rule_meta()` supplies the CLI
|
|
159
|
+
and report metadata; there is no separate hand-maintained catalog manifest.
|
|
160
|
+
`rules --format json` exposes analysis requirements and config paths;
|
|
161
|
+
`explain <code> --format json` adds rationale, examples and repair advice. A rule
|
|
162
|
+
being active by default does not imply that its optional package policy is enabled.
|
|
163
|
+
|
|
164
|
+
`engine.schema.config_json_schema()` enriches the model schema from the live rule
|
|
165
|
+
catalog, including completion names, severities and bad/good hover examples. Keep
|
|
166
|
+
config models independent of the rule registry. `init` exports the schema locally;
|
|
167
|
+
the checker never reads that editor artifact. Verify schema errors and the CLI
|
|
168
|
+
against the same API, including aliases, package overrides and removed keys.
|
|
169
|
+
|
|
170
|
+
CI verifies registration completeness, unique codes/names, code/category agreement,
|
|
171
|
+
metadata, and generated-file freshness. Duplicate codes or names also fail when a
|
|
172
|
+
`RuleSet` is constructed, before selection can resolve an ambiguous catalog.
|
|
173
|
+
|
|
174
|
+
## Regressions from real projects
|
|
175
|
+
|
|
176
|
+
Reduce the example to synthetic files using `tests.helpers.write_project`, or a
|
|
177
|
+
small layout under `tests/fixtures/`. Keep the behavior that exposed the defect,
|
|
178
|
+
including workspace roots or namespace portions when relevant. Tests must run
|
|
179
|
+
without private repositories, network access, credentials or absolute user paths.
|
|
180
|
+
Use real repositories for a read-only evaluation and report the config used,
|
|
181
|
+
findings reviewed, known uncertainty and whether source files changed.
|
|
182
|
+
|
|
183
|
+
Exercise the actual `check()` pipeline for policy behavior. Add CLI/output tests
|
|
184
|
+
only when the public interface changes. Check rule selection, suppression, debt
|
|
185
|
+
and changed comparisons if the change affects their semantics. Aggregate findings
|
|
186
|
+
need stable semantic identities: an old accepted finding must not hide a new edge.
|
|
187
|
+
Fixers additionally need explicit opt-in, source-preservation tests, idempotence
|
|
188
|
+
and refusal tests for uncertain execution or concurrent edits.
|
|
189
|
+
|
|
190
|
+
## Verification and PR scope
|
|
191
|
+
|
|
192
|
+
Install the [uv](https://docs.astral.sh/uv/) and Rust toolchains, then run
|
|
193
|
+
`uv sync --locked` and `uv run prek install`. After editing, run
|
|
194
|
+
`uv run prek run --all-files`, inspect any hook fixes, and repeat until it passes.
|
|
195
|
+
The install also enables the Conventional Commits hook.
|
|
196
|
+
|
|
197
|
+
Update [CHANGELOG.md](CHANGELOG.md) under `Unreleased` for user-visible features,
|
|
198
|
+
fixes and behavior changes. State what an agent can do differently, required
|
|
199
|
+
policy or opt-in settings, compatibility changes and relevant limits. Keep entries
|
|
200
|
+
concise and link to detailed rule documentation rather than duplicating it. Before
|
|
201
|
+
publishing a release, move its entries into a dated version section and update the
|
|
202
|
+
comparison links.
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
uv sync --locked
|
|
206
|
+
uv run pytest tests/rules/<category>/test_<concept>.py
|
|
207
|
+
uv run python scripts/generate.py
|
|
208
|
+
uv run pytest tests/rules/test_registry.py tests/test_docs.py
|
|
209
|
+
uv run smelt explain <code> --format json
|
|
210
|
+
uv run smelt check --strict-coverage --fail-on warning --format json
|
|
211
|
+
uv run prek run --all-files
|
|
212
|
+
uv run pytest
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
Replace placeholders with real paths/codes. If source discovery, analysis shared
|
|
216
|
+
by multiple rules, metadata or machine output changes, include its consumers in
|
|
217
|
+
focused validation; CI runs the full supported Python/OS matrix.
|
|
218
|
+
|
|
219
|
+
Keep one reproducible behavior change per PR where practical. Explain the trigger,
|
|
220
|
+
old/new result, valid counterexample, default/configuration behavior, false-positive
|
|
221
|
+
boundaries and validation. Link related issues or prerequisite PRs. A new report
|
|
222
|
+
format or configuration default deserves explicit compatibility notes. The PR
|
|
223
|
+
template captures these decisions without duplicating the generated rule catalog.
|
|
224
|
+
|
|
225
|
+
## Publishing a release
|
|
226
|
+
|
|
227
|
+
The `.github/workflows/release.yml` workflow publishes `smelt-cli` to PyPI when a
|
|
228
|
+
`v`-prefixed version tag is pushed. It uses
|
|
229
|
+
[PyPI Trusted Publishing](https://docs.pypi.org/trusted-publishers/using-a-publisher/)
|
|
230
|
+
through GitHub Actions OIDC; no PyPI API token or repository secret is needed.
|
|
231
|
+
|
|
232
|
+
### One-time account configuration
|
|
233
|
+
|
|
234
|
+
In the PyPI project's
|
|
235
|
+
[Publishing settings](https://pypi.org/manage/project/smelt-cli/settings/publishing/),
|
|
236
|
+
add a GitHub Trusted Publisher with these exact values:
|
|
237
|
+
|
|
238
|
+
| Field | Value |
|
|
239
|
+
| --- | --- |
|
|
240
|
+
| PyPI project | `smelt-cli` |
|
|
241
|
+
| Repository owner | `mathisarends` |
|
|
242
|
+
| Repository name | `smelt` |
|
|
243
|
+
| Workflow filename | `release.yml` |
|
|
244
|
+
| Environment name | `pypi` |
|
|
245
|
+
|
|
246
|
+
The workflow filename is the basename, without `.github/workflows/`. If the PyPI
|
|
247
|
+
project does not exist yet, register the same values as a
|
|
248
|
+
[pending publisher](https://pypi.org/manage/account/publishing/) instead.
|
|
249
|
+
|
|
250
|
+
In the repository's
|
|
251
|
+
[Environments settings](https://github.com/mathisarends/smelt/settings/environments),
|
|
252
|
+
create an environment named `pypi` and allow deployments from tags matching `v*`.
|
|
253
|
+
Required reviewers are optional; leave them unset if maintainers and coding agents
|
|
254
|
+
should be able to publish without a separate approval for each release. The PyPI
|
|
255
|
+
environment name must match the workflow exactly.
|
|
256
|
+
|
|
257
|
+
### Release procedure
|
|
258
|
+
|
|
259
|
+
1. Bump matching versions in `pyproject.toml` and `Cargo.toml`, run `uv lock` and
|
|
260
|
+
`cargo check` to refresh both lockfiles, and merge the version change and
|
|
261
|
+
release workflow into `main` after CI passes. Each release needs a new PyPI
|
|
262
|
+
version; this setup does not bump or publish the existing `0.1.3` automatically.
|
|
263
|
+
2. From an up-to-date, clean `main` checkout, create and push the corresponding tag.
|
|
264
|
+
For example, after merging version `0.1.4`:
|
|
265
|
+
|
|
266
|
+
```bash
|
|
267
|
+
git switch main
|
|
268
|
+
git pull --ff-only
|
|
269
|
+
git tag v0.1.4
|
|
270
|
+
git push origin v0.1.4
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
3. Follow the `Publish to PyPI` run in
|
|
274
|
+
[GitHub Actions](https://github.com/mathisarends/smelt/actions/workflows/release.yml).
|
|
275
|
+
The workflow requires the tagged commit to be reachable from `main` and the tag
|
|
276
|
+
to equal `v` followed by the package version. It runs prek, pytest and
|
|
277
|
+
Smelt, validates a source distribution outside the checkout, then builds native
|
|
278
|
+
Linux x86_64/aarch64, Windows x86_64 and macOS x86_64/aarch64 wheels. CI also
|
|
279
|
+
installs and exercises native wheels on Linux, Windows and macOS. A separate
|
|
280
|
+
job downloads the validated release artifacts and publishes them
|
|
281
|
+
with OIDC and the publishing action's default attestations enabled.
|
|
282
|
+
|
|
283
|
+
Maintainers and coding agents with permission to push release tags can use this
|
|
284
|
+
procedure without local PyPI credentials. Ordinary branch pushes and pull requests
|
|
285
|
+
do not publish. Manual workflow runs must select an existing `v`-prefixed tag
|
|
286
|
+
(`gh workflow run release.yml --ref v0.1.4`); branch runs skip publishing.
|
|
287
|
+
|
|
288
|
+
If the upload fails because account configuration is missing, finish that setup
|
|
289
|
+
and rerun the failed publishing job so it reuses the validated build artifacts.
|
|
290
|
+
PyPI does not permit overwriting published files; use a new version for changed
|
|
291
|
+
package contents.
|