Files
tia-love/docs/rea/README.md
T

67 lines
3.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# REA — Reverse Engineering & Analysis (Playbook)
> Skill kerja untuk menganalisis **logika backend** proyek referensi, lalu mem-porting perilakunya
> ke Go di dalam `tia`. Definisi lengkap: `docs/PRD.md` §12.
## Aturan (wajib, tidak bisa dinegosiasi)
1. **Cek lisensi dulu** — langsung dari repo sumber, sebelum membaca kode serius. Hanya proyek
open source (MIT/Apache/BSD dsb). Jangan pernah menganalisis proyek closed-source.
2. **Tulis ulang, jangan salin.** Pelajari perilaku → implementasi sendiri dalam Go.
Tidak ada copy-paste verbatim.
3. Jika terpaksa dekat dengan aslinya (mis. tabel pemetaan flag): catat di laporan sebagai
"diadaptasi", sertakan atribusi di `THIRD_PARTY_NOTICES.md`.
4. Jangan ambil nama, logo, aset visual, atau branding proyek referensi.
5. Repo referensi di-clone ke `reference/` (git-ignored). **Tidak pernah** ikut ter-commit.
## Alur kerja
```
1 Scope → 2 Map → 3 Trace → 4 Spec → 5 Port → 6 Verify
↑ │
└── beda perilaku ┘
```
| Langkah | Aktivitas | Output |
|---|---|---|
| 1. **Scope** | Modul & batasnya, verifikasi lisensi | Catatan scope + lisensi di laporan |
| 2. **Map** | Petakan file/fungsi/struktur data relevan | Peta modul |
| 3. **Trace** | Telusuri alur input → output, edge case & error path | Diagram alur + daftar edge case |
| 4. **Spec** | Spesifikasi netral: input, output, aturan, tabel pemetaan, perintah Docker | `docs/rea/<modul>.md` + test vectors |
| 5. **Port** | Implementasi ulang dalam Go (di `internal/core`, tanpa UI) | Kode Go + unit test |
| 6. **Verify** | Uji paritas: input sama → output setara (golden/differential test) | Laporan paritas (lolos/gagal per kasus) |
## Definition of Done per modul
- [ ] Lisensi sumber diverifikasi & dicatat (repo, commit, lisensi)
- [ ] Laporan `docs/rea/<modul>.md` selesai (pakai `docs/rea/TEMPLATE.md`)
- [ ] Test vectors tersedia
- [ ] Implementasi Go terpisah dari UI (dipakai TUI **dan** CLI)
- [ ] Uji paritas lolos sesuai target (≥ 95% flag umum untuk converter)
- [ ] `THIRD_PARTY_NOTICES.md` diperbarui bila perlu
## Indeks modul (PRD §12.6)
| # | Modul | Repo | Fase | Status |
|---|---|---|---|---|
| 1 | Parser `docker run` → compose | `composerize/composerize` | 3 | ✅ [composerize.md](composerize.md) |
| 2 | Scan stack & rekonsiliasi status | `louislam/dockge` | 3 | ⬜ belum |
| 3 | Arsitektur primary ↔ agent (ide multi-host) | `louislam/dockge` | 6 | ⬜ belum |
| 4 | Pola pemanggilan Docker SDK | `jesseduffield/lazydocker` | 2, 4 | ⬜ belum |
| 5 | Manajemen stream/task background | `jesseduffield/lazydocker` | 2 | ⬜ belum |
| 6 | Custom commands (template placeholder) | `jesseduffield/lazydocker` | 5 | ⬜ belum |
| 7 | Format output `docker compose ls/ps/config` | `docker/compose` (CLI lokal) | 3 | ⬜ belum |
Repos referensi (commit yang dianalisis):
| Repo | Commit | Lisensi |
|---|---|---|
| composerize | `3e39eb7` | MIT |
| dockge | `f809ae1` | MIT |
| lazydocker | `7e7aadc` | MIT |
## Cara memanggil modul baru
Prompt singkat: `REA: analisis modul <nama> dari <repo>` — agent mengikuti alur 1–6 di atas,
selalu mulai dari verifikasi lisensi dan membaca `docs/rea/TEMPLATE.md`.