Install
openclaw skills install @talonpoint/paperless-cloud-intake-hardeningHarden Paperless cloud-folder intake with staging, provider gates, read checks, and safe retries.
openclaw skills install @talonpoint/paperless-cloud-intake-hardeningUse this skill to design, review, or repair Paperless intake workflows where files arrive through a cloud-synced folder or another unreliable filesystem event path.
Keep all examples generic. Do not include real client names, private paths, hostnames, volume names, account names, URLs, secrets, tokens, filenames, or document examples in reusable skill text or public reports.
Preserve these even when provider commands, operating systems, or deployment details change:
Use a layered intake path:
A hydration nudge makes the common path smoother. It does not replace staging, validation, duplicate handling, retry, or Paperless-side verification.
This skill is self-contained for Paperless work. An agent using it should have enough guidance to harden a Paperless intake flow without loading another skill.
For non-Paperless workflows, use the standalone cloud-file-hydration-nudge skill. That skill is the generic reusable pattern for visible-but-unreadable cloud files in shared folders, document review, OCR, uploads, batch processing, and other automations.
Before handing cloud-backed files to Paperless, verify that files are not merely visible placeholders.
Treat filenames, sizes, Finder metadata, search results, provider badges, provider policy state, and provider state as weaker evidence than a successful byte read.
Use this ladder when deciding whether a file is safe to deliver:
Only high-confidence evidence should move a file into Paperless consume.
Preflight workflow:
file, pdfinfo, unzip -t, image metadata tools, checksum after hydration, or a bounded byte read.Provider-specific hydration is only safe after identifying the provider for the actual source path. Do not reuse the last successful nudge from another intake.
Use multiple weak signals where possible:
~/Library/Mobile Documents/com~apple~CloudDocs, ubiquitous-item metadata, or platform checks for an iCloud ubiquitous item.~/Library/CloudStorage/OneDrive-*, provider metadata/domain naming Microsoft OneDrive, or a tenant-branded OneDrive mount.Decision rules:
On macOS File Provider-backed folders, separate three questions:
fileproviderctl evaluate <path> can inspect states such as isDownloaded, isDownloading, isKeepDownloaded, and isMostRecentVersionDownloaded. Treat this as diagnostic information, not final proof. The strongest proof is a successful POSIX read followed by validation.
Useful diagnostics include:
Resource deadlock avoided, permission errors, zero-byte reads, invalid signatures, incomplete archives, or short reads.cat, dd, checksum, parser, or archive validation fails.dataless while reads fail.For unattended intake, keep defensive staging. A previously available-offline folder can later be evicted, partially synced, paused, or stuck in a provider cache state.
For macOS/File Provider sources, add a lightweight wrapper before or inside the intake script when hydration failures are observed:
The generic intake script remains responsible for correctness: stream/read into staging, validate nonzero and complete bytes, deduplicate, and atomically move into consume.
Avoid scheduled visible Finder windows. If provider UI automation is required, keep it in a trusted helper application or another narrow user-approved host. Do not grant broad Node, shell, scheduler, or generic automation processes Accessibility, Screen Recording, Full Disk Access, or equivalent privacy powers just to hydrate files.
Folder watchers, Automator Folder Actions, Shortcuts, or FSEvents may acknowledge that a file exists before it is hydrated. That acknowledgement is not a Paperless delivery signal.
Use two phases:
Observed Automator result: a temporary Folder Action fired for a newly added file in a OneDrive folder, but did not fire its adding folder items handler when an existing file was offloaded or hydrated. Do not rely on Folder Actions to notice hydration state changes for existing placeholders.
Dataless files should remain pending/retry candidates. A retry loop should prioritize pending files instead of repeatedly full-scanning large folders forever. Keep a rare/manual reconciliation scan for missed events.
For iCloud Drive files, prefer the native iCloud download request plus a bounded read wait.
Generic shape:
startDownloadingUbiquitousItem.dd if=<file> of=/dev/null bs=64k count=1 until it succeeds or times out.In causal testing, an evicted iCloud file appeared as a normal-size dataless file and failed reads with Resource deadlock avoided. Finder folder update alone did not hydrate it. The native iCloud download request plus bounded read polling did.
Keep provider-specific helpers outside the generic intake core. Other providers need different materialization actions.
Do not use Quick Look for iCloud hydration automation. If native iCloud download fails or times out, explain the failure and ask the user how they want to proceed.
For OneDrive File Provider folders on macOS, folder-level Finder update/open, /pin, and available-offline policy are not proof that a dataless child file is hydrated.
Observed OneDrive placeholder signals may include:
filesystem flags: compressed,dataless
isDownloaded = 0
isDownloadRequested = 0
isMostRecentVersionDownloaded = 0
bounded read: Resource deadlock avoided
Preferred pattern:
dataless, isDownloaded = 0, or isMostRecentVersionDownloaded = 0.Observed behavior: in Finder list view, OneDrive may expose the cloud glyph as an Accessibility AXButton with description Not downloaded. Pressing that button materialized file bytes in the observed macOS File Provider test environment without Quick Look. This requires a narrow approved automation host; do not grant broad Node permissions for production.
For folder-level cloud-button hydration, poll every intended child file. Do not trust folder state alone.
Do not treat these as proof of hydration unless bounded read succeeds afterward:
fileproviderctl evaluate com.microsoft.OneDrive.FileProviderActions.MarkPinned <file>./Applications/OneDrive.app/Contents/MacOS/OneDrive /pin <file>.Always Keep on This Device.Observed retest: /unpin <file> may print a failure while still offloading the file to compressed,dataless; /pin <file> may fail or may set policy without hydrating. Verification matters more than command output.
Quick Look is deprecated for automated Paperless/cloud hydration. It should not be built into intake scripts, scheduled retry loops, provider nudges, or parser workflows as an automated fallback.
Reason: Quick Look opens UI and invokes preview parsers. That makes it broader and riskier than provider-native or provider-UI hydration controls.
If all provider-native, provider-UI, and approved trusted-helper approaches fail, tell the user plainly that a manual Quick Look attempt may hydrate the file. Present it as a user-operated recovery option, not as an automated step:
The safer provider hydration methods did not materialize this file. Quick Look is deprecated for automated hydration because it opens a preview parser, but you can manually try Quick Look in Finder if you accept that risk. Afterward, I will re-check with the same bounded read before continuing.
After any manual Quick Look attempt, repeat provider-state checks and the same bounded read. Do not continue downstream based only on the user seeing a preview.
Separate user-facing enumeration from generic staging when macOS privacy or File Provider behavior requires it:
/bin/bash, generic node, or schedulers unless the user explicitly accepts that wider security surface.If a scheduler cannot enumerate the source folder, prefer explicit-path mode fed by a user-facing automation wrapper. If a scheduler can enumerate but reads fail, treat it as hydration/materialization and retry rather than moving anything into Paperless.
Do not assume that an atomic move into consume creates a Paperless document.
On Docker Desktop, macOS bind mounts, network mounts, and cloud-adjacent deployments, Paperless may miss filesystem notifications even when the file is visible in consume.
Recommended baseline:
PAPERLESS_CONSUMER_POLLING=60.When listing succeeds but content reads fail, log a retryable diagnostic, for example:
waiting: cloud placeholder or File Provider hydration issue suspected; file metadata is visible but content is not locally readable; materialize the source folder/file and retry
Distinguish these states:
provider classified: source path was classified, or classification was unknown/conflicting.waiting: source is not readable, zero-byte, incomplete, or timed out; leave it in source for retry.pending hydration: file is waiting for provider, trusted-helper, or manual hydration.hydrating: a provider-specific nudge is being attempted after a read failure.quicklook deprecated: Quick Look automation is not used; manual Quick Look may be mentioned only as a user-operated recovery option after safer methods fail.delivered: staged copy passed validation and was atomically moved into Paperless consume.skipped duplicate: checksum already processed.error: destination move or local state failure needs attention.Avoid logging secrets, private paths, private filenames, client names, URLs, database credentials, tokens, or real document examples in public examples or reusable skill text.
A file is successfully ingested only when:
Until all of those are true, treat the item as pending, retryable, duplicate-skipped, or failed with evidence.
Verify all of the following before calling an intake path healthy:
Do not claim a nudge works just because a freshly local file succeeds.
A stronger test is:
Old failed placeholders or leftovers in consume should stay untouched until accounted for. Before cleanup, match leftovers against Paperless records, successful task logs, checksums, original filenames, or user confirmation. Move/delete only after the user explicitly approves cleanup.