ADORSYS-GIS / ADORSYS-GIS/lightbridge-authz

[Epic]: Code quality ratchet - 200 LoC per file, SOLID, DRY

未关闭
#506 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
epic
主要语言
Rust
星标
0
派生
1
平均合并
7 小时 7 分钟
30 天内合并 PR
237

描述

### Executive Summary
We want file size and cohesion to stop degrading, because 32 of 101 `src/*.rs` files already exceed 200 LoC by a combined 24,010 lines, with the worst at 4,068. This epic exists to stop the bleeding first and fund the burn-down second.

### Strategic Intent
Make the 200-LoC rule real rather than aspirational. A rule that is violated by a third of the tree on day one is not a rule, it is a wish.

### Problem Statement
Measured on `main` at 2026-08-26: 32/101 `src` files over 200 LoC, 24,010 excess lines. Big-bang compliance is roughly 40+ dev-days of pure refactor - more than both releases combined - and every line of it is churn on an authentication boundary. Doing it all at once would be reckless; doing none of it lets the trend continue.

### Desired Outcome
New and changed code cannot exceed 200 LoC (enforced in CI), the existing debt is published as a tracked baseline, and the four worst offenders are split.

### Scope (In / Out)
**In:**
- CI gate on new/changed `src` files (a ratchet, not a big-bang)
- Published LoC baseline and burn-down plan
- SOLID/DRY reviewer checklist in the PR template
- Splitting the top offenders, highest first

**Out:**
- Test files: a 200-line cap on a 6,052-line integration suite is a different conversation, tracked separately
- Any behavioural change; these splits are strictly mechanical

### Source of truth (links)
- Measured on `main` 2026-08-26 via `find crates app -name '*.rs' -path '*/src/*' | xargs wc -l`
- Repository code-style rules in `AGENTS.md`

### Stakeholders
Platform team (4 advanced + 2 senior engineers), Scrum Master, prod operators.

### Key Assumptions
- 200 LoC is measured on `src/` only
- Splits are behaviour-preserving and provable by the existing suite

### Constraints
- Refactors must not change behaviour on an authentication boundary
- The existing suite must stay green at every commit

### Risks
- A mechanical split that silently changes module visibility or trait-object coercion (`E0277` unsizing has bitten this tree before)
- A ratchet gate that fires on unrelated PRs and gets disabled out of frustration

### Success metrics
- 0 new `src` files over 200 LoC after the gate lands
- Files over 200 LoC reduced from 32 toward 28 by 2026-09-04
- Excess-line count published and trending down

### Child User Stories
Tracked as sub-issues of this epic.

### Human accountable owner
@stephane-segning

### AI Usage Declaration
Epic decomposition and estimation were AI-assisted.
Structure and estimates drafted with AI from a verified repository audit (file
line counts, config keys, and dependency state were read from the actual tree,
not assumed). A human owns intent, scope, and the release commitment.

### Human verification completed
- [ ] I can explain this work without referring to the AI-generated text
- [ ] Acceptance criteria are testable
- [ ] Source of truth is a real link, not boilerplate

Governance: https://adorsys-gis.github.io/ai-governance/

贡献指南

打开贡献指南

调研方向

Start with AGENTS.md and the repository's existing CI and PR-template configuration. Reproduce the baseline with the referenced find crates app -name '*.rs' -path '*/src/*' | xargs wc -l command, then review the four largest src offenders and the existing suite. Done means the ratchet, published baseline, checklist, and behavior-preserving splits are delivered without changing test behavior.

由索引模型根据 Issue 内容生成。

评估

技术栈
rust
领域
authentication, backend, ci-cd, developer-experience
Issue 类型
重构
难度
5/5
预计耗时
一周以上
活跃度
活跃
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。