Concept · files
Use when
The person wants a collection to follow a folder, a vault or a notes account, or you must check, pause or stop one.
Looking for something else?
One-off uploads of documents (recipe bring-in-a-corpus). A newer copy of one document (recipe new-edition). Grouping Files without a folder behind them (card collection).
For
A synced folder ties one collection to a place that keeps its own documents. The place is a folder or Obsidian vault on a computer, a folder in Google Drive, or the notes of a Granola account. Penumbra brings each document in as a File. A change in the folder becomes a new version of the same File. A renamed document keeps its File. A deleted document goes to Trash. The folder is the authority. Its Files read as ordinary Files, with versions, passages and search, but Penumbra refuses to change them. To change one, change the document in its folder, or stop syncing.Use when
- The person has a folder, a vault or a notes account that changes, and wants Penumbra to follow it.
- You must see whether a synced folder is up to date, and what its last run changed.
- A File refuses a change and says it is kept in sync with its folder.
- The person wants to pause, resume or stop syncing.
Not this
- Documents that you add once: use recipe bring-in-a-corpus.
- A newer copy of one document: use recipe new-edition. A synced File takes its new editions from the folder (rule source.1).
- Files that you group by hand: use a collection (card collection).
Rules
source.1The folder wins. Enforced: a change to a synced File is refused withfile_write_constrainedand exit code 3. The refusal coverspenumbra files replace,penumbra files trash, edits and a move to another folder. The folder owns the File’s name and path. A rename in the same folder (penumbra files move) is not refused. It sets the File’s title (card file, rule file.12). The name and path stay the folder’s, so a note’s[[link]]to the File still resolves. Your job: change the document in its folder and sync again, or stop syncing (rule source.9). Do not work around the refusal by uploading a copy: the project then holds two editions (problem two-editions-two-files).source.2Syncing has three kinds, and each has its own start. Your job: for a folder or vault on this computer, runpenumbra sync <folder>. For Granola, runpenumbra sources connect granola, thenpenumbra sources link granola --allor--folder <folder-id>. A Google Drive folder can only be started in the App.source.3Plan before you apply. Your job: runpenumbra sync <folder> --dry-run. It prints what is new, changed, renamed and removed, what it skips, and a plan id. Show the person the removals. Enforced when you ask:penumbra sync <folder> --plan <plan-id>applies that plan, and refuses if the folder changed since.source.4Some files are never sent. Enforced: a sync skips the Obsidian settings folder,.git, the.penumbrafolder and other hidden files. It also skips symlinks that lead outside the folder, and unsafe names. The plan counts them under “skipped”.source.5The first sync ties the folder to a collection, and later syncs send only what changed. Your job: name the collection with--collection "<name>". Without it, Penumbra uses or makes one named after the folder.source.6A large removal needs a decision. Enforced: a sync that removes every file, or over half of the files when that is more than 25, is refused. The code isremoval_review_required, the exit code is 3, and nothing is sent. Your job: read the list with--dry-run, ask the person, and only then run again with--allow-removals.source.7A removal goes to Trash and can be restored. Enforced: a deleted document leaves the collection as a File in Trash, not as a purge. Penumbra removes nothing from a list it could not read completely. A Google Drive folder that Penumbra can no longer read keeps its Files, marked as possibly out of date.source.8A run is done when its status says so. Your job: runpenumbra sources status <source>. Tell the person the folder is current only when the latest run succeeded and the status says “Up to date” and “All searchable”. Penumbra cannot see a folder on a computer between syncs, so its status says “Last synced” with the time instead. Tell the person that time, never that the folder is current.penumbra sync <folder>brings in changes made since.penumbra sources changes <source>lists what the run added, changed, renamed, removed and skipped.source.9Stopping and pausing differ. Enforced:penumbra sources pausestops new content and keeps the Files read-only, andpenumbra syncof a paused folder is refused withsource_paused.penumbra sources disconnectends syncing for good, asks to confirm, and releases the Files as ordinary editable Files. Without a terminal it needs--yes, or it exits withconfirmation_requiredand changes nothing. Your job: tell the person that changes in the folder stop arriving.source.10Syncing the same folder again picks up where it ended. Enforced:penumbra sync <folder>after a stop uses the folder’s earlier collection and matches a File at the same path with the one already there. Files added in Penumbra while syncing was off stay as they are.source.11Synced folders belong to a person. Enforced: a key or a connected agent that runspenumbra sources list,penumbra syncor any other synced-folder command is refused withhuman_session_required. Members read synced folders. Owners and admins change them.source.12Access can be lost. Your job: whenpenumbra sources statusshows a Drive folder or a Granola key that no longer works, tell the person. Nothing was deleted. For Drive, the person reconnects in the App under Synced folders: open the folder and choose Reconnect Google Drive. For Granola, runpenumbra sources connect granola, thenpenumbra sources reconnect <source>.source.13A Granola key is a secret. Enforced: the commandpenumbra sources connect granolahas no argument for the key. It asks with nothing shown on screen, or reads it from stdin with--key-stdin. Your job: never ask the person to paste a key into the chat.
Failure signs
- A File refuses a change and says it is kept in sync with its folder: rule source.1.
- A sync exits with
removal_review_required: rule source.6. - A sync exits with
source_paused: rule source.9. - Search shows the old text after the folder changed: the last run is not done (rule source.8). Or a new File is not ready yet (problem new-file-not-searchable-yet).
- Two copies of one document: problem two-editions-two-files.
Doors
penumbra sources sync <source> starts a run of a Google Drive or Granola
folder now. A folder on a computer syncs only with penumbra sync <folder>.
The person connects Google Drive in the App under Synced folders, and
chooses Connect Google Drive.
The CLI word
The CLI calls a synced folder a source. This is not the source of a citation or the source date (card passage, card file).HTTP reference
- Create upload session
- Get upload session
- Add file
- List files
- Resolve files
- Replace file
- List file versions
- Get file version
- Get file processing status
- Download file
- Get file text
- Get file pages
- List file citations
- Set file title
- Set file description
- Set file tags
- Set file source date
- Trash files
- Restore files
- Get file operation
- Recover file request