ADORSYS-GIS / ADORSYS-GIS/lightbridge-authz
[Story]: lightbridge-authz-rest/src/lib.rs is split into cohesive modules
- Dominant language
- Rust
- Stars
- 0
- Forks
- 1
- Avg merge
- 6h 42m
- Merged PRs (30d)
- 246
Description
### Story Statement
As an engineer changing the REST layer, I want `lib.rs` split by responsibility, so that I can find and modify one concern without reading 4,068 lines.
### Real Intent
This file is the single largest obstacle to the 200-LoC rule and the hardest file in the tree to review. It holds server startup, router composition, and hand-written RPC procedures at once.
### Background and Context
4,068 LoC, the largest `src` file in the workspace. It carries `start_api_server`, `start_idp_server`, `start_budget_server`, `build_idp_router`, and the whole `Procedures` impl.
### Source of truth (links)
- Measured 2026-08-26
- ADR-0010 (budget procedures are hand-written), ADR-0023 (unconditional IdP mounts)
### Acceptance Criteria
- [ ] Split along real seams: per-service startup, router construction, and procedure implementations
- [ ] No behavioural change - the existing suite passes untouched
- [ ] The ADR-0023 regression test still passes unmodified
- [ ] Public paths preserved, or every caller updated in the same commit
- [ ] Each resulting file is at or below 200 LoC, or carries a written reason it cannot be
### Out of Scope
Changing any procedure's behaviour, and splitting the test files.
### Dependencies and Blockers
Should land after the CI gate, so the result is protected once achieved.
### Assumptions
Team capacity is 6 engineers; estimates are ideal dev-days for one engineer.
### Implementation Notes
Move code, do not rewrite it. Watch for `E0277` unsizing where a moved impl loses a `Self: Sized` bound - this tree has hit that before. Some resulting files will legitimately exceed 200 LoC; say so in the file rather than splitting along a fake seam.
### Test Expectations
The existing suite is the oracle: it must pass before and after with no test edits. A test edit during a mechanical split is a signal that behaviour moved.
### Verification evidence
- [ ] Automated test added and proven to fail before the fix
- [ ] `just all-checks` green
- [ ] Every new or changed `src` file is <= 200 LoC
### Human accountable owner
@stephane-segning
### AI Usage Declaration
Story drafted with AI assistance from a verified repo audit.
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/
Contributor guide
Assessment
This issue has not been assessed yet.