Skip to content

Reduce the lint result's inlined rule metadata to id and effective severity #431

Description

@e54-bot

Readiness: ready-for-implementation. Every decision is settled; see Decision and Contract mechanism.

Problem

wright lint --format json on tests/fixtures/workshop/real-world/overpy-pixelart.ws (195 KB, zero findings), wright 0.2.41:

Result field Bytes Share
rules 7455 78%
config 481 5%
program + input_identity 218 2%
findings 2 ([]) 0%
total 9586

{"op":"lintRules"} on the same input returns 7798 bytes of the same rule metadata. lint inlines the entire lintRules payload on every call. That's a fixed ~7.5 KB of static, project-independent metadata, including 2232 bytes of knownLimits prose, and it dominates the response whenever a project is clean or close to clean.

Decision (owner, option C)

The lint result keeps rules, with each entry reduced to the rule id and its effectiveSeverity. Summary, rationale, documentation, known limits, evidence class, and tags are dropped from lint. lintRules stays the one authoritative source for full rule metadata.

This record supersedes the earlier body and decision comment, which recorded "remove rules entirely". The owner did not approve that version. See the comments for the timeline.

Data point, not a decision: the reduced entries carry the same values as the existing config.rules. I checked the six built-in rules, the result after --rule-severity/--disable-rule overrides, and a local YAML rule loaded with --rule. Going further than option C would need a new owner decision.

Contract mechanism (owner)

This change breaks the lint result on both wright-result/v1 and the lint operation of wright-agent/v1. Owner decisions:

  • Q2: recorded pre-1.0 exception. No v2 contract is introduced.
  • Q3: add the wright-result/v1 evolution policy. It carries the same additive-only rule as wright-agent/v1, and this change is recorded in it as an exception made before the 1.0 freeze (Roadmap to v1.0: stable Workshop tooling platform #134).

Scope

  • In wright-driver, reduce each lint result rules entry to id and effectiveSeverity. The CLI envelope and the agent operation change together.
  • schemas/wright-agent-v1.schema.json: LintResult.rules items use a reduced definition, and LintRulesResult keeps the full LintRule.
  • The text-mode lint renderer keeps its verdict, counts, and effective-configuration summary.
  • Update docs/cli/lint.md, docs/cli/commands.md, and docs/agent-contract.md to the reduced shape.
  • Add the wright-result/v1 evolution policy to docs/cli/machine-contract.md, and record this reduction there as the pre-1.0 exception. docs/agent-contract.md versioning points to it.

Non-goals

Acceptance criteria

  • Through both wright lint --format json and {"op":"lint"}, every rules entry carries exactly id and effectiveSeverity. A test asserts the exact key set on both paths.
  • Every registered rule, including a local YAML rule loaded with --rule, appears in rules. Covered by a test.
  • {"op":"lintRules"} still returns full metadata (summary, documentation, known limits, evidence, tags). Covered by a test.
  • schemas/wright-agent-v1.schema.json parses and validates the live lint and lintRules results. The agent-contract schema tests pass.
  • Text-mode wright lint still prints the verdict, finding count, and effective-configuration summary.
  • No other command's result changes. The existing envelope tests for check, analyze, inspect, compile, and convert pass unchanged.
  • docs/cli/machine-contract.md contains the wright-result/v1 evolution policy and records this reduction as the one pre-1.0 exception; docs/agent-contract.md versioning links to it. Checked in review.

Dependencies / ownership

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions