diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2025-12-04 15:42:00 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2025-12-04 15:42:00 +0000 |
| commit | 819866330c7e2f535a155d1d7efaf2e12dc15dc2 (patch) | |
| tree | d84c8361811544aad9cad089c0358b9028c8fb80 /README.md | |
| parent | fd0c87c787d0626b3546fa571541c9c809711821 (diff) | |
refactor: split Nip34WritePolicy into focused sub-policies
Split the ~900 line Nip34WritePolicy into focused sub-policies for improved
testability and maintainability:
- AnnouncementPolicy - Repository announcement validation
- StatePolicy - State event validation + ref alignment
- PrEventPolicy - PR/PR Update validation
- RelatedEventPolicy - Forward/backward reference checking
The main Nip34WritePolicy now delegates to these sub-policies via a shared
PolicyContext that provides domain, database, and git_data_path.
Also updates:
- README.md: Accurate project structure reflecting actual implementation
- docs/learnings: Marks this technical debt item as complete
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 40 |
1 files changed, 26 insertions, 14 deletions
| @@ -326,23 +326,35 @@ nix develop -c cargo tarpaulin --out Html | |||
| 326 | ngit-grasp/ | 326 | ngit-grasp/ |
| 327 | ├── src/ | 327 | ├── src/ |
| 328 | │ ├── main.rs # Entry point, server setup | 328 | │ ├── main.rs # Entry point, server setup |
| 329 | │ ├── lib.rs # Library exports | ||
| 330 | │ ├── config.rs # Configuration | ||
| 329 | │ ├── git/ | 331 | │ ├── git/ |
| 330 | │ │ ├── mod.rs # Git module | 332 | │ │ ├── mod.rs # Git module + repository operations |
| 331 | │ │ ├── handler.rs # Git HTTP handlers | 333 | │ │ ├── handlers.rs # Git HTTP handlers |
| 332 | │ │ └── authorization.rs # Push validation logic | 334 | │ │ ├── authorization.rs # Push validation logic |
| 335 | │ │ ├── protocol.rs # Git protocol encoding | ||
| 336 | │ │ └── subprocess.rs # Git subprocess management | ||
| 333 | │ ├── nostr/ | 337 | │ ├── nostr/ |
| 334 | │ │ ├── mod.rs # Nostr module | 338 | │ │ ├── mod.rs # Nostr module |
| 335 | │ │ ├── relay.rs # Relay setup and policies | 339 | │ │ ├── builder.rs # Relay builder + Nip34WritePolicy |
| 336 | │ │ └── events.rs # Event handlers | 340 | │ │ ├── events.rs # Event parsing and validation |
| 337 | │ ├── storage/ | 341 | │ │ └── policy/ # Sub-policies (split for maintainability) |
| 338 | │ │ ├── mod.rs # Storage abstraction | 342 | │ │ ├── mod.rs # Policy module exports |
| 339 | │ │ └── repository.rs # Repository management | 343 | │ │ ├── announcement.rs # Repository announcement validation |
| 340 | │ └── config.rs # Configuration | 344 | │ │ ├── state.rs # State event validation + ref alignment |
| 341 | ├── docs/ | 345 | │ │ ├── pr_event.rs # PR/PR Update validation |
| 342 | │ └── ARCHITECTURE.md # Detailed architecture | 346 | │ │ └── related.rs # Forward/backward reference checking |
| 343 | ├── tests/ | 347 | │ ├── http/ |
| 344 | │ ├── integration/ # Integration tests | 348 | │ │ ├── mod.rs # HTTP module |
| 345 | │ └── fixtures/ # Test data | 349 | │ │ ├── landing.rs # Landing page handler |
| 350 | │ │ └── nip11.rs # NIP-11 relay info document | ||
| 351 | │ └── metrics/ | ||
| 352 | │ ├── mod.rs # Prometheus metrics | ||
| 353 | │ ├── bandwidth.rs # Bandwidth tracking | ||
| 354 | │ └── connection.rs # Connection tracking | ||
| 355 | ├── docs/ # Documentation (Diátaxis framework) | ||
| 356 | ├── tests/ # Integration tests | ||
| 357 | ├── grasp-audit/ # Compliance audit subproject | ||
| 346 | └── README.md | 358 | └── README.md |
| 347 | ``` | 359 | ``` |
| 348 | 360 | ||