BOUNDARIES
No sending, provider mutation, contact import, cloud upload, automatic model call,
server account provisioning or background service. Actual authorization and sync
are explicit separate operator actions. Synthetic demo/tests contain no real mail.

GMAIL
Provider identity is verified before label or message reads. Initial anchor is
captured before all-folder pagination; discovery pages and job queues commit
before message processing. Exact RAW bytes are stored before derived parsing.
Each content object is SHA-256 named, immutable on replay and fingerprint-checked
when read. Global history cursor is committed after the final page AND all jobs.
Repeated IDs across history pages are fetched again to observe later changes.
Full rescan individually verifies omitted IDs; list absence alone is not deletion.
History404 causes bounded rescan, keeping earlier bytes. Operator restart retains
an abandoned-run record and all mail; it discards only that unfinished job queue.
History is a synchronization feed, not a complete historical backup or audit of
every intermediate label edit between reads. Latest current RAW is retrieved.

ARCHIVE
SQLite WAL/FULL transactions hold accounts/messages, immutable observed-version
fingerprints, labels catalogs, job state and cursors. RAW/attachment content blobs
deduplicate physical bytes, not message/account identities. Remote deletion is
recorded separately from local retention. No remote deletion propagates to byte
removal. Exact MIME remains available even when decoding loses malformed charset
information. Embedded message/rfc822 download is derived serialization, labeled
as such; its enclosing original MIME remains exact. Search uses literal LIKE, not
FTS/semantic search. Performance has not been validated for large real mailboxes.
macOS/Linux exclusive file locks prevent overlapping writer syncs. The read-only
viewer opens its own SQLite connection per request. Local-user filesystem attacks,
disk failure and compromised OS/accounts are outside the protection of 0700/0600.
Archives are not encrypted by this application; use device/disk encryption.

LOCAL VIEWER
HTTP binds only 127.0.0.1. Every private API requires the per-launch bearer token;
Host must match the exact bound loopback port, and any Origin must match too.
No CORS access, access logs or user token in a URL query. Browser launch passes
the token in a fragment then removes it from browser history. Mail is assigned
with textContent. CSP denies external content and frames. There is no HTML mail
preview, remote-image tracking request, executable attachment preview or SMTP.
The private launcher is permission-protected and removed on normal viewer exit.
This is local bearer access, not shared-user enterprise authentication.

LESSON BRIDGE
Actual Studio v1 authorized-intake schema: schemaVersion/title/learnerGoal/context/
consent/sources, with per-source text SHA-256 and UTF-16 exact-quote locators.
Consent is explicit and selections are bounded. No claims are invented; excerpts
are source statements and unvalidated correspondence. A separate provenance
sidecar binds the prepared source ID to account/message/RAW fingerprints. The
sidecar contains private identifiers and stays local. Export is not synthesis,
payment, completed learning-unit issuance or entitlement granting. An optional
test validates a synthetic intake using the actual Studio engine if supplied;
no upstream Studio source is copied into this package.

THREAT/RECOVERY LIMITS
OAuth installed client uses fixed Google endpoints, readonly scope, PKCE, state,
loopback callback and explicit Gmail-profile pin. Credentials stay in separately
permission-protected files. Provider error payloads/headers/body are not logged.
Failed requests retry finitely; failed or paused jobs do not advance the history
cursor. Large responses above the transport's 256MiB cap fail explicitly and
retain the checkpoint; source MIME is not silently truncated. RAW pages and MIME
parsing load a single message into memory, so this is not a constant-memory stream
for arbitrarily large attachments. Back up the stopped full directory, not only
SQLite or source ZIP. Deleted-before-download messages cannot be recovered.
