Skip to content

Move declaratively expressible built-in lint rules to a first-party package embedded at build time #845

Closed as not planned

Description

@e54-bot

Part of #616. Decisions: see the owner comments there.

Desired behavior

Wright's built-in lint rules that the current declarative vocabulary can express live in a first-party package repository and are embedded in the Wright binary at build time, so official rules can change without a Wright release.

Scope

  • Inventory the built-in rules in registry.rs and classify each as expressible in the SPEC-309 vocabulary or native-only; record the result in the PR. Native-only rules stay in the binary. The vocabulary is not widened.
  • Move each expressible rule into the first-party package, keeping its bare ID, default severity, and behavior.
  • The first-party package may declare evidence class and default severity in its metadata; community packages still cannot.
  • Record a full commit SHA for the package in this repository and embed that revision at build time; a clean install works offline.
  • Amend ADR-0015 and SPEC-309 for bare IDs in the first-party package, the official-only evidence declaration, and replace-on-override.

Non-goals

Widening the declarative vocabulary, moving native-only rules, renaming rule IDs.

Acceptance criteria

  • For each moved rule, findings on the existing lint fixtures are identical before and after the move.
  • A build with network access disabled still loads the embedded rules.
  • --disable-rule <existing bare id> and config entries keep working unchanged.
  • A project entry for the first-party repository with a SHA replaces the embedded default.
  • A community package declaring evidence class or default severity is refused.
  • ADR-0015 and SPEC-309 are amended in the same change.

Dependencies

The store and fetch, and project pinning sub-issues. The first-party package repository must exist; creating it and choosing its name is an owner action, which blocks this issue until done.

Activity

  1. added
    enhancementNew feature or request
    blockedSettled contract, but an external dependency prevents the work
    on Oct 20, 2026
  2. e54-bot commented on Oct 20, 2026

    @e54-bot
    CollaboratorAuthor

    Blocked on: the first-party package repository does not exist yet; creating it and choosing its name is an owner action. Also sequenced after #842 and #843. Unblocks when that repository exists.

  3. removed
    blockedSettled contract, but an external dependency prevents the work
    on Oct 20, 2026
  4. e54-bot commented on Oct 20, 2026

    @e54-bot
    CollaboratorAuthor

    Inventory result (step 0 of this issue): none of the 7 built-in rules in crates/wright-analyzer/src/registry.rs can move to a first-party package with identical findings and the SPEC-309 vocabulary unchanged. Per the owner addendum on #616, the vocabulary is not widened, so nothing moves and this issue closes as not planned.

    Rule What it needs that the declarative matcher lacks
    min-wait-loop One scope covering while, for-global-variable and for-player-variable (RuleMatcher.scope is a single value); fixed message text; StaticIndicator evidence
    duplicate-condition Equality between conditions of an If/Else If chain; a dead-branch fix
    expensive-loop-check A call at any depth in any argument; one finding per value
    ongoing-condition-hot-path Condition order, short-circuit gates, and a finding payload
    repeated-value Grouping of structurally identical sub-expressions, an occurrence count, an Evaluate Once fix
    while-without-wait Severity derived from boundedness evidence (the missing wait itself is expressible)
    nested-binder-lambda Ancestor/descendant value pattern

    min-wait-loop is the only borderline rule. Its number match is expressible (wait first argument <= 0.016). It fails on the single scope (three scopes need three rules, so three IDs, which renames the rule), on the fixed message text, and on the hard-coded Exact evidence. The first two need vocabulary or output changes, which this issue forbids.

    State after #857, #858 and #861: the first-party identity, replacement of a native rule with the same ID, and project override by SHA already exist. A rule moves to wrightkit/wright-lint-rules when it is expressible. Widening the vocabulary needs its own decision backed by real rules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions