Files
rclone/docs/ARCHITECTURE.md
T
Lucas WintherandClaude Fable 5.2 a28ee25855 build: add agent docs, permissions and spec/plan layout for the fork
Fork-only. Appends a Fork Workflow section to AGENTS.md and adds
GEMINI.md, per-tool permission files and docs/ pages for agent driven
development. Not for upstream.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-11 10:01:49 +01:00

45 lines
2.0 KiB
Markdown

# Architecture
Fork-only orientation for agents. The summary in `AGENTS.md` ("Architecture")
is upstream's and is not repeated here; this page adds what that summary
leaves out. Update in the same commit as any structural change.
## Map
| Path | Responsibility |
|---|---|
| `rclone.go` | Entry point; blank-imports `backend/all` and `cmd/all` |
| `backend/<name>/` | One storage backend per package, registered in `init()` |
| `cmd/<name>/` | One cobra command per package |
| `fs/` | Core interfaces, config, operations, sync, accounting |
| `vfs/` | Virtual filesystem used by mount and serve |
| `lib/` | Shared helpers: `rest`, `pacer`, `dircache`, `oauthutil`, `encoder` |
| `fstest/` | Test framework: `fstests` (backend contract), `test_all` (runner) |
| `docs/content/` | Hugo website source; partly autogenerated |
| `docs/specs/`, `docs/plans/` | Fork-only agent workflow artefacts |
| `bin/` | Build and docs scripts |
## Test layers
- Unit tests: `RCLONE_CONFIG=/notfound go test ./...` - no credentials.
- Backend contract: each `backend/<name>/<name>_test.go` calls
`fstests.Run()` against a remote named `Test<Name>:` in the user's rclone
config. Without that remote the test skips, so a green `go test` on a
backend package says nothing about the backend against the real service.
- Integration: `fstest/test_all` runs the backend contract plus the
`fs/operations`, `fs/sync`, `vfs` etc. suites against the backends listed in
`fstest/test_all/config.yaml`.
## Invariants
- Backwards compatibility of commands, flags, config keys and the rc API.
- `fs` and `vfs` contain no backend-specific code.
- cgo use differs per release target (the `cgo` and `build_flags` columns of
the matrix in `.github/workflows/build.yml`), so a backend cannot assume cgo.
## Known rough edges
- `backend/protondrive` depends on the forks `github.com/rclone/Proton-API-Bridge`
and `github.com/rclone/go-proton-api` (`go.mod`). See `docs/specs/`.
- See `docs/TODO.md` for host tooling gaps.