Files
rclone/docs/DECISIONS.md
T
Lucas WintherandClaude Opus 5.5 9598e22d90 protondrive: check a file's signed block list before handing out any of it
A full read verified the manifest signature only at the end, so blocks
a server swapped, dropped or took from an older revision reached the
reader - and rclone cat or a mount - before the error. A full read now
lists every block and verifies the manifest before releasing the first
byte, and a block listed again with a different hash is an integrity
error. Ranged reads are unchanged.

The fake's "rollback" corruption is renamed "block-rollback": serving a
whole earlier revision under the current revision ID can't be detected,
which the spec and TODO now say.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 18:51:15 +01:00

121 lines
6.5 KiB
Markdown

# Decisions
Fork-only. Append-only, newest first. Never edit or delete an entry - supersede
it with a new one that links back. One entry per decision a future maintainer
would otherwise have to reverse-engineer.
No index: `grep -n '^## ' docs/DECISIONS.md` lists every entry.
## 2026-11-11 - Proton Drive verifies the manifest before releasing a full read
**Status:** accepted
**Context:** A full read checked the manifest signature at EOF, as the
SDK does, so blocks swapped, truncated or from an older revision, each
matching its listed hash and recorded size, reached the reader before
the error: `rclone cat` and streaming mounts showed wrong bytes (spec
9.6 asks for "an integrity error, not data").
**Decision:** A full read lists every block page first, verifies the
manifest over the listed hashes, then fetches; each block is checked
against its listed hash, and a block listed again with another hash
is an integrity error. Pages are fetched one after another. Ranged
reads keep checking blocks against their listed hashes only.
**Alternatives:** Keeping the SDK's EOF check; verifying ranged reads
too by listing the whole file on each ranged open (costly for mounts
and multi-thread copies without a hash cache).
**Consequences:** No extra requests, but a file of more than 20 blocks
waits for its whole list before the first byte. Block metadata, not
data, is held meanwhile. A whole earlier revision served under the
current ID stays undetectable (protocol limit).
## 2026-11-11 - Proton Drive distrusts what a forged folder key vouches for
**Status:** accepted
**Context:** An anonymous node's passphrase, name and content signatures
are checked against its parent folder's key. A server can make a folder
key of its own, seal it to the real parent and sign everything beneath
it, so a refusal based only on each node's own signature check is
bypassed (Task 16 review).
**Decision:** A node key is unverified if its own passphrase signature
fails, or if it was checked against an unverified parent key; this
passes down the tree. Reading a file with an unverified key, and
creating, uploading, renaming, moving or copying into a folder with
one, fail unless `ignore_signature_errors` is set. Listing such a folder
still works, with one ERROR for the folder itself.
**Alternatives:** Leaving the folder's children to their own checks
(bypassable); refusing to list the folder (a sync would delete its
destination copy).
**Consequences:** Builds on the 2026-11-11 entry "Proton Drive refuses a
file whose node key signature fails". Files in a public-link upload
folder whose key fails to verify need `ignore_signature_errors`.
## 2026-11-11 - Proton Drive refuses a file whose node key signature fails
**Status:** accepted
**Context:** The node passphrase signature was only logged when it
failed, as the SDK does, so a server could seal a key of its own to
the parent folder's public key and serve any content under it (spec 7
puts the server in the threat model; 9.6 asks for an error).
**Decision:** Opening such a file fails with an integrity error naming
`ignore_signature_errors`, like a content key or manifest signature
failure; with the option set it is read, the failure logged once. The
node is still listed. Sign-in errors that need a reconnect name the
remote through a hint the seam gives the session, so read errors, which
don't pass through `translateError`, name it too.
**Alternatives:** Skipping the node from listings (a sync would then
delete its copy at the destination); leaving it to the SDK's behaviour.
**Consequences:** Legacy files whose keys were signed by a since-removed
address need `ignore_signature_errors`, which the error says.
## 2026-11-11 - Proton Drive backend runs on its own client
**Status:** accepted
**Context:** The backend sat on `rclone/Proton-API-Bridge` and
`rclone/go-proton-api`, which share credentials through package globals,
write files the official clients can't always read, and can't be tested
without a live account (spec 001).
**Decision:** `protondrive.go` was rewritten on the native client built in
plan Tasks 2-12, keeping every option name and meaning and reading v1.76
saved sessions without signing in again. `Config` offers browser sign-in
(default unless a username and password are already set, so existing
scripted setups keep using them) and password sign-in. An upload whose
commit outcome can't be known is a no-low-level-retry error: an immediate
retry could add a revision that already landed, while a later sync pass
reads the destination first.
**Alternatives:** Patching the bridge (globals and crypto stay outside the
tree); keeping browser sign-in the default even with a password set
(non-interactive `config create` would wait on a browser).
**Consequences:** The full contract suite runs hermetically against
`protontest`. Several `Fs` of one account in one process each cache
separately until events land (spec 6.2).
## 2026-11-11 - Fork agent tooling is appended, not merged, into upstream files
**Status:** accepted
**Context:** Upstream rclone already ships a maintainer-written `AGENTS.md`
and a `CLAUDE.md` that imports it. This fork tracks upstream and intends to
send work back, so every edit to an upstream file is a future merge conflict
and a risk of leaking fork-only material into an upstream PR.
**Decision:** Upstream's `AGENTS.md` text is kept verbatim. Fork rules are one
"Fork Workflow" section appended at the end. `CLAUDE.md` and `README.md` are
untouched. Fork-only docs live at the top of `docs/` (Hugo only builds
`docs/content/`, so they do not reach the website).
**Alternatives:** Restructuring `AGENTS.md` with the fork rules first (better
agent attention, permanent conflicts with upstream); a separate fork rules
file (two sources of truth).
**Consequences:** `AGENTS.md` sits at 148 of a 150 line budget - a new fork
rule must replace an old one. Upstream PR branches must be cut so they exclude
the paths listed in the Fork Workflow section.
## 2026-11-11 - Adopt AGENTS.md as single source of truth
**Status:** accepted
**Context:** Agents had no fork-specific workflow or permission config between
sessions.
**Decision:** `AGENTS.md` is canonical; `CLAUDE.md`/`GEMINI.md` are pointers.
Specs are permanent in `docs/specs/`. Plans live in `docs/plans/` only while
work is in progress and are removed before merge. Both override the
superpowers default paths.
**Alternatives:** Per-tool rule files (drift); no rules file (agents
re-explore the repo every session).
**Consequences:** Rule changes happen in one file; pointer files stay thin.
The spec, not the plan, is the record.