chore: start transition layout — python into version-python/, scaffold version-rust/
- git mv of all existing files into version-python/ (history preserved) - version-rust/: minimal cargo scaffold (edition 2024), no deps yet - root AGENTS.md documents the transition rules and artifact/schema contract - main is untouched; the python layout there stays as-is
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
# version-rust
|
||||
|
||||
Rust rewrite of `version-python` (same repo, `main` branch still carries the
|
||||
flat python layout). Goal: one concise binary + webapp, eventually replacing
|
||||
the python tooling.
|
||||
|
||||
## Why this structure
|
||||
|
||||
- `main` stays untouched (flat python layout) until the rewrite reaches parity.
|
||||
- This branch re-homes the python code into `version-python/` (via `git mv`,
|
||||
history preserved) and starts `version-rust/` beside it.
|
||||
- `version-python/AGENTS.md` still documents the python stage — its rules
|
||||
(secrets, failure policy, idempotency, rate limiting) apply to the rewrite
|
||||
too and are the contract the Rust version must keep.
|
||||
|
||||
## Planned crate choices (initial, adjust as modules get ported)
|
||||
|
||||
| Concern | Python today | Rust plan |
|
||||
|---|---|---|
|
||||
| 7z extraction (extract_all) | 7z CLI, cp437 name repair, /var/tmp fallback | `sevenz-rust2` (pure Rust, LZMA2/PPMD/AES-256); zip via `zip` crate; rar likely still needs an external tool |
|
||||
| HTTP client | `requests` | `reqwest` (blocking first, async where the webapp needs it) |
|
||||
| sha256 (gofile website token, --hash manifest) | hashlib | `sha2` |
|
||||
| Fuzzy matching (sorter) | difflib-style ratios | `strsim` — port thresholds exactly, add unit tests |
|
||||
| CLI | argparse | `clap` |
|
||||
| Webapp | — | `axum` (CLI parity first, webapp second) |
|
||||
| Discord export | DCE docker container (external) | unchanged: shell out to docker |
|
||||
|
||||
## Port order (suggested)
|
||||
|
||||
1. `state` / `globalstore` — state.json + urls.json schemas must stay
|
||||
backward compatible with the python versions.
|
||||
2. hosters: `gofile` (one guest account per run!), `zero807` (UA + Referer).
|
||||
3. extraction + manifest appender.
|
||||
4. catalogue / sorter (hardest logic; port the matching rules documented in
|
||||
`version-python/AGENTS.md` §7 with tests).
|
||||
5. webapp on top.
|
||||
Reference in New Issue
Block a user