Repository navigation
Issue #1772: plug-in host — large files, folder/host/secret settings, secrets - #1858
Merged
Merged
Conversation
…me, chunked writes, fs.copy)
Plug-ins that list "fsFiles" in `requires` get fs.stat, fs.read {path,
offset, length} (8 MiB a call), fs.freeSpace, fs.mkdir, fs.rename and
chunked atomic writes (fs.writeBegin / fs.writeChunk / fs.writeEnd: temp
file beside the target, synced and renamed at the end; open writes are
dropped with their temp files when the call ends). fs.copy {from, to,
expectHash?, overwrite} is a host-side verified copy with no size cap:
import_move::copy_verified (now with a watched variant counting bytes and
honouring a cancel flag) run as an io_sched job, never overwriting unless
asked. Time inside fs.copy is paused against the 120 s wall budget; in a
job it reports bytes to the activity row and stops on cancel.
Lent files are split into read/write and read-only lists; the
beforeImport hook now lends its file read-only (as the docs said).
SDK wrappers: host::list, stat, read, free_space, mkdir, rename,
write_begin/write_chunk/write_end, write_large, copy. Hostile-input
tests in tests/abi.rs and a fuzz case in tests/robust.rs.
Manual: none (docs/plugins.md updated; manual page, example, notes in the
step's docs pass)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Host features folderSettings and secrets. Manifest settings gain three
types, for settings only, never prepared, with no default and set only by
the user on the plug-in's Settings tab:
- folder {write?}: the chosen folder is granted as an fs root while chosen
(stored as {path, write}; write no more than the field asks for now),
checked like a manifest root (absolute, no "..", never a folder holding
the app's settings or plug-ins); settings.get gives its path.
- host: the chosen host (a plain DNS name) is granted as a network host.
- secret: kept in the session's secret store under
Key("plugin:<id>", key), never in settings/<id>.json, never shown, left
out of settings.get; plugin.settings says only whether one is stored.
Chosen folders and hosts are listed with the plug-in's requests
(setting: <key>) and on the Permissions tab ("chosen in Settings",
Revoke clears the choice; plugin.revoke does too). settings.set and
plugin.setSettings may only clear them and refuse secrets; the control
channel's clicks on the new buttons change nothing.
New permission group secrets and host calls secrets.get / secrets.set /
secrets.delete (the plug-in's own secrets only; 16 KiB cap; set/delete
are writes), served by SessionHost, relayed from workers (Relayed::Secret,
not tied to the open library), jobs and program.end hooks. A locked or
missing store fails with what to do. Every secret value a plug-in read,
kept or had typed for it is redacted as [secret] in its log and call
errors for the session. Removing a plug-in with its data deletes its
secret settings' secrets.
UI: Settings tab rows for the three types (Choose.../Clear, Allow/Clear,
a password field with Save/Remove), localized in every language. SDK:
host::secret, secret_set, secret_delete, chosen_folder, chosen_host.
Docs: docs/plugins.md (Folder, host and secret settings; Secrets;
permission and SDK tables; feature names). Tests: abi (secrets, redaction,
grant, hostile requests, chosen folder grants, hostile choices, manifest
checks), compat (features, secrets group), robust (fuzzed secrets and
settings calls), engine (session store, relay, uninstall), ui (drawing).
Manual: none (docs/plugins.md updated; manual page, example, notes in the
step's docs pass)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tings and secrets - docs/plugins.md: the copy hash is photo.inspect's `content_hash`; Engine commands say how plugin.settings / setSettings / revoke / uninstall treat the new setting kinds and secrets; the Permissions tab lists chosen folders and hosts; the settings file never holds a secret; "Not done yet" no longer claims hosts are fixed in the manifest, notes that a secret kept under the plug-in's own name outlives removal and that a job's fs.copy stops at once; ten examples. - New SDK example sdk/examples/archive-tools (fsFiles, folderSettings, secrets): Copy to Archive (free space, mkdir, stat, verified fs.copy against the photo's hash, rename, chunked writes), Verify Archive (ranged reads), Server Status / Forget Session (chosen host, secrets get/set/delete, log redaction); driven end to end in crates/plugins/tests/example.rs. - permissions.rs: every fsFiles call and secrets.* fail ungranted and work once allowed; a chunked write not ended is dropped. - What's New and changelog entries; parity row LRC-SHELL-PLUGINS, gap 19, ROADMAP log and target-app-parity line updated (status unchanged). Manual: automate/plugins, platforms/settings-and-privacy Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- fs.copy opens its source with open_checked and copies and verifies from
that open file; the file it creates (or the temp file renamed over the
target) must be in the target's own folder before any write and again
before the rename, so a link swapped in after the check never reads,
creates or replaces anything outside the roots (no after-the-fact
remove_file any more).
- fs.copy's time is outside the wall budget only in a job; outside a job
the copy stops when the call's deadline passes (CallContext::deadline).
- Secrets: the names a plug-in sets are listed in the store under a name no
plug-in can use; uninstall (by id or file) deletes all of them; a locked
store keeps a pending list, wiped before the id's next store use.
- Host settings are stored as {host}, so a value kept for a setting of
another kind is never taken for the user's choice.
- plugins.chooseFolder takes a path only with the random token given to the
picker it opened; the folder row and picker title say what is granted.
- group_label names secrets and libraryRemove, unknown groups by name.
- Parity change table back in date order.
Manual: automate/plugins
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The row added by #1732 (merged from staging) was painted in English in every language; the i18n sweep failed after merging staging. Manual: none, no user-visible change beyond the translation Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Dec 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1772
Part of #1771
Problem
Plug-ins can't handle real photo files: reads and writes are capped at 8 MiB per call with no copy, stat, mkdir or rename; roots and hosts are fixed in the manifest, so a plug-in can't work in a folder the user picks; there is nowhere safe to keep a password or token.
Change
fsFiles:fs.stat,fs.mkdir,fs.rename,fs.freeSpace, rangedfs.read, chunked atomicfs.writeBegin/Chunk/End, andfs.copy— a host-side verified copy with no size cap (copy + hash check throughio_sched, never overwrites unless asked, link swaps refused). SDK wrappers, including the existingfs.list.beforeImportnow lends the file read-only, as the docs always said.folderSettings: setting kindsfolder {write}andhost; the user's choice becomes a granted root/host, shown on the Permissions tab with Revoke. The folder picker answers only with a one-time token, so a control-channel caller can't grant a path.secrets:secrets.get/set/deletein the OS credential store underplugin:<id>; never insettings/<id>.json, never shown, left out ofsettings.get, redacted from the plug-in log; deleted on uninstall (also when the store was locked then).fs.copydoesn't count against the 120 s limit; it honours cancel and reports bytes.sdk/examples/archive-tools.Not in this PR: With
keepData: trueon uninstall, secrets stay but the pinned author key is dropped (same as kept data today). On Windowsopen_checkedcompares canonical paths, not file ids.How it was checked
cargo xtask ci --quickon this branch, up to date withstaging(merged in, not rebased): fmt, brand, docs,notes, i18n, windows, clippy, heif, stamp, parity, layers, assets and the wasm check pass. The test step
fails on three
lcc-ui-eguitests that are not touched by this stack and fail the same way on step 1 aftermerging
staging:tests_pixel_shift::a_cancelled_pixel_shift_merge_leaves_no_file_and_no_photo(asourceColour"Reading source colours" activity row from staging's own colour work is still open when the test looks),
tests_pixel_shift::a_series_of_another_mode_is_refused_by_name_and_never_merged_as_16_shots, andtests_chart_profile::the_dialog_reads_the_chart_photo_and_suggests_a_name(passes when run alone).Every
lcc-pluginstest passes, and the fulllcc-enginelib suite passes (3097 tests on step 2).crates/plugins/tests/{abi,robust}.rsfor every new call (bad paths, huge lengths, bad handles, NaN/negative numbers).
consumers installed: chromaforge-archive-copy and
chromaforge-convert-on-import. Archive copy,
hash mismatch, unwritable archive, retry, DNG conversion (built-in and an external stand-in), sidecars kept,
fallback to the original and scratch clean-up all checked. Folder choices and grants were written into the
scratch config (they can only be made by the user, by design), so the Choose…/Allow clicks were not driven.
#[cfg(unix)]link-swap and odd-name tests (Windows machine); the first unix CI run covers them.Each step went through three independent reviews (crash safety, security/permissions, completeness against the
plan); every finding was fixed or answered.
Merging
requiresbehave asbefore; the ABI number stays 1.
unsafe, build scripts, network access, spawned processes, deleted files, CI orxtaskgatechanges: none;
lcc-pluginsdepends onlcc-sysmem(workspace crate) for free spaceChecklist
tr()and has its key in every localeLRC-SHELL-PLUGINSrow and gap 19 updated in the same commits🤖 Generated with Claude Code