Repository source: docs/concepts/local_development_import.md
Local development import
Purpose: Make a fresh local instance explorable, bring public content into it through the browser, and report on the copy afterwards.
Scenario: Run ./v3 start, open its loopback homepage, browse sample threads or documentation, then import from the prefilled production source. Import returns at once: the card lists the import's steps with counts, an elapsed timer, the time since the last update and the time left, while other pages keep loading. Leaving and coming back shows the same progress. A failed download shows its reason and retains the source for retry; a pending import journal offers Resume. The existing CLI owns validation, conflict handling, public-content exclusions and publication.
After an import: the card reports on the copy. It leads with "Imported from zenmemes.com 2 hours ago · 8,813 imported"; a repeat from the same source reads "37 new" or "nothing new". Records held back for review label the details disclosure ("356 held back for review · 4 conflicts") and are not an alert. One button, Check for new content, imports again from the same source and states the cost ("Downloads everything again; last time took 17 s."), since sync does not exist yet. The source field is under Change source. A failed request shows its reason and Retry above the last good status. An import run from the terminal is reported the same way.
How it runs: the page queues the same instance_import task as Tools → Import, recorded as requested by local-development, and the task worker runs it. ./v3 start runs that worker; with --no-worker the page starts one, and says so with the command and Try again if none starts within 15 seconds. Without JavaScript the page reloads itself every 5 seconds while an import runs.
Where the status comes from: nothing extra is stored. Every import that reaches the merge saves a report under .git/instance-import/, however it was started; LastImportSummary (source unavailable) reads the newest by the time it was written. The newest page request's own output adds the elapsed time and the details when it is the same run.
Boundary: Controls require the development launcher marker, PHP's development server, a loopback peer and Host, no proxy headers, and a valid token plus origin checks for every POST, including the page script's status requests. Deployed servers and remote clients retain normal pages. Existing query-bearing root URLs retain their board behavior. Imports merge public content rather than mirror or delete local content. A running import cannot be stopped from the page. Only the last import is shown; there is no history.
Sources: request guard and token (source unavailable), controller (source unavailable), queueing and state (source unavailable), last import (source unavailable), page (source unavailable), shared step list (source unavailable), page script (source unavailable), importer (source unavailable), HTTP recovery checks (source unavailable), last import checks (source unavailable), fresh-start browser check (source unavailable).
Name: Messages pull
Purpose: Let a member read their own private messages in a local clone, with the private key staying in that browser.
Scenario: On the local development page, Your messages registers this browser's key on the source under the member's username. The member approves it there from an existing device and runs Import. Pull my messages then signs in, copies the member's envelopes and history-sync transfers under their original IDs, and copies read state once. The page lists the keys the clone must approve. Those are this key, the keys that signed the mail, and the donors of history keys, limited to keys the source approves. It waits for one click on Trust these keys here. It then verifies each pulled transfer in the browser and confirms it on the source. A repeat press adds only what is missing and picks up history keys that arrived later.
Boundary: Same loopback guard and token as the import. The relay (POST /local/remote) forwards only a fixed list of source calls and holds a source session for one local request. Every relayed sign-in uses a new signature from the browser. Pulled rows never replace local ones, and mismatches are reported. Trust writes approvals in this clone only: a local seed for this browser's key, ordinary approvals for the rest. Imports never carry approvals, so nothing returns to the source except the confirmations.
Sources: relay (source unavailable), relay actions (source unavailable), pull (source unavailable), participant mailbox export, pull checks (source unavailable), two-instance browser check (source unavailable).
— Revised by Claude · 2026-11-22 UTC · Model: claude-fable-5-2
— Revised by Claude · 2026-11-22 UTC (status card) · Model: claude-fable-5-2