Skip to content

feat(ci,scripts): unify Go and TypeScript quality checks into codequality - #1268

Merged
kyasbal merged 1 commit into
mainfrom
push-nwsoqxuswzxx
Nov 13, 2026
Merged

kyasbal merged 1 commit into
mainfrom
push-nwsoqxuswzxx

Conversation

@kyasbal

@kyasbal kyasbal commented Nov 13, 2026

Copy link
Copy Markdown
Member

Summary

Replaces scripts/mutation-diff with a single unified Go and TypeScript code and test quality engine (scripts/codequality, --lang=all|go|ts).

Key Changes

  • Unified CLI (scripts/codequality):
    • Consolidates Go AST structural/complexity/size/naming/clone checks (internal/astcheck), differential line coverage (internal/covcheck), Super-Mutant differential mutation testing (internal/mutcheck), TypeScript Istanbul differential coverage + Karma Super-Mutant evaluation (internal/tscheck), and shared polarity + kill-set subsumption redundant test detection (internal/redundancy) under one rule and reporting model (internal/rule, internal/report).
    • Supports --lang=all|go|ts (default all), --fast (sub-second Go Stage-1 AST check), --workers=0 (defaults to logical CPU core count), --fail-on-violations (enforced for Go), and --ts-fail-on-violations (advisory by default for TypeScript).
  • Unified CODEQUALITY_ALLOW Directive & No-Worsening Ratchet:
    • Enforces hard limits on newly added or compliant Go units and a strict after <= before ratchet on pre-existing legacy units (using lazy base-revision reconstruction in internal/overlay for dynamic coverage and mutation comparisons).
    • Unifies Go and TypeScript suppression syntax onto // CODEQUALITY_ALLOW(<rule_id>, <category>[, <operator>...]): <reason> with category validation, invariant-suppression rejection, and unused-directive detection.
  • Linter Layer Boundaries (.golangci.yaml):
    • Enables depguard architectural layer rules, errorlint, forbidigo (reflect.DeepEqual in tests and non-context slog/fmt.Print* in pkg/task/**), and nolintlint, resolving existing violations across pkg/.
  • Makefile, CI, Agent Rules & Docs:
    • Updates scripts/make/testing.mk (make codequality, make codequality-fast, make codequality-go, make codequality-web, make codequality-web-container), .github/workflows/pullrequest.yaml, .agents/rules/{go,ts}-coding-rule.md, and EN/JA development guides.

Verification

  • make codequality-fast: PASS (0 violations across 51 prod files, 51 test files, 654 units)
  • make codequality-go CODEQUALITY_MAX=0: PASS (96.3% patch coverage, 99.9% mutation score — 2,309/2,312 killed, 0 violations)
  • make codequality-web: PASS
  • make build-go, make test-go, make lint-go, make lint-web, make pre-commit: PASS

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request replaces the legacy mutation-diff tool with a comprehensive, unified codequality framework for Go and TypeScript. It introduces strict AST structural budgets (for cognitive complexity, nesting, function/file size, parameter bounds, and code clones), enforces a no-worsening ratchet on legacy code, and implements advanced differential coverage and mutation testing. The development guides, coding rules, and .golangci.yaml have been updated to reflect these new standards, and existing Go files have been refactored to comply with the new linter rules (e.g., using errors.Is/errors.As and go-cmp). The single review comment was filtered out because it incorrectly claimed a sorting call was inside a loop when it was actually outside. We have no further feedback to provide as the implementation is exceptionally thorough and well-tested.

@kyasbal
kyasbal disabled auto-merge November 13, 2026 05:52
@kyasbal
kyasbal merged commit 37ee6f6 into main Nov 13, 2026
20 of 21 checks passed
@kyasbal
kyasbal deleted the push-nwsoqxuswzxx branch November 13, 2026 05:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant