Repository navigation
Description
DESIGN.md §4.6 promises a plugin its OWN user-configuration section; the tree gives it the WHOLE per-host file
The requirement
DESIGN.md:370 (the host service's get row):
get— one entry by its key (#StoreKey), returned keyed by its store (#StoreValue): …config,
the caller's section of the user configuration (D-STORE-2) … permitted when:config: always
DESIGN.md:388 (the _store table's config row):
config| none ({}) | the caller's own user-configuration section (S10, D-STORE-2) | no: read only
and D-PROTO-12 gives the identity that makes "the caller's own" decidable: "core derives the
caller's plugin from the socket the request arrives on and its permissions from that call, never from
anything the plugin asserts."
The intent is least privilege: a plugin reads its own section of the machine's configuration —
nothing about another subsystem's cache, ledger or deployments.
Measured: none of that exists, and what exists is broader
$ grep -n "^service " spec/proto/plugin.proto
432:service PluginMeta {
440:service Provider {
490:service ExecutorService {
528:service CheckContextService {
$ grep -rn "StoreKey\|StoreValue\|PutInput" spec/schema/ | wc -l
0
$ grep -rn "UserConfig" --include=*.go --include=*.cue spec sdk charly | wc -l
8 # all eight are os.UserConfigDir(); there is no #UserConfig type in Go or CUE
- There is no Host service in the proto, therefore no
get/put, therefore noconfigstore key.
The reverse channel isExecutorService(Venue,RunSystem,RunUser,PutFile,GetFile,
RunHostStep,InvokeProvider,HostBuild,DescribeProvider) plusCheckContextService. - The
_storetable's derived types do not exist:#StoreKey,#StoreValue,#PutInputhave zero
occurrences inspec/schema/. #UserConfigis a contract name with no type: the eightUserConfighits inspec/sdk/charly
are all the stdlibos.UserConfigDir().
What a plugin actually uses is the loader, which hands over the whole file:
$ grep -n "func LoadDeployConfigViaExecutor" sdk/loaderkit/deploy_config_executor.go
41:func LoadDeployConfigViaExecutor(ctx context.Context, ex *sdk.Executor, dir string) (*deploykit.DeployConfig, error) {
$ grep -rn "LoadDeployConfigViaExecutor\|LoadDeployConfigForRead" --include=*.go plugin-*/candy/ | grep -v _test | wc -l
10
Ten non-test call sites in plugin candies read ~/.config/charly/charly.yml through it, and
*deploykit.DeployConfig carries every section: cache:, ledger:, deploy:, system: — and every
section added later, including the clean: one now being added for store_budget
(opencharly/plugin-clean#28). So today a plugin that only needs one number can read the machine's git
cache configuration, its install ledger, and every deployment overlay entry.
Blast radius
- Least privilege is unmet for every plugin with the reverse channel. Any plugin candy can read any
section of the machine's configuration; nothing narrows it to the caller's own. - The contract's own consistency: §4.6 is described as "the only thing a plugin can reach besides
the engine its own deployment kind drives" and as closed — "adding a method amends this
document". A row that no implementation answers is the doc-vs-reality divergence R1 forbids us to
leave unrecorded. - A second, unstated gap sits inside the same row:
#UserConfighas no section-key convention.
The contract says "the caller's own section" but never says how a section is named for a caller —
the per-host file's sections are declared, closed fields (cache:,ledger:,deploy:,system:),
not a map keyed by a plugin name, and no CUE field or Go type saysplugin-clean/plugin_clean/
aplugin:-declared key. A plugin cannot implementget configuntil the mapping is stated.
Concrete consumer, and why this is filed rather than blocking
charly clean --store needs the machine's store ceiling (clean: { store_budget: { bytes } }), and it
reads it today through LoadDeployConfigViaExecutor — which is honest and correct for the value,
but grants it more than the knob needs. The knob ships either way; the narrowing is tracked here so the
grant is not widened silently by one more caller. Same for keep_images/keep_check_runs: the
retention-defaults seam already resolves those from the project, not from this file, so they are not
affected.
Proposed root fix (producer-first, three repos)
spec— add the host-service store ops toplugin.protoand derive#StoreKey/#StoreValue/
#PutInputfrom the_storetable so the schema and the proto cannot disagree; state the
section-key convention (either the section is a declared field and the plugin'splugin:block
names it, or the candy word is the key — but say it once, in the contract).charly— serve it, deriving the caller from the socket / the in-proc reverse channel per
D-PROTO-12, and answerdeniedoutside the caller's own section.sdk— a client (GetUserConfigSectionViaExecutor) beside the existing loaders.- Then retire the whole-file read for plugins that need only their own section, keeping it only
where a caller genuinely needs cross-section state (plugin-status/plugin-boxread deployments
and the ledger deliberately, and should stay on it).
Until then, the honest sentence in any consumer's body is: "the knob reads the machine's configuration
through the one loader the tree provides; that loader is broader than §4.6 specifies, and the narrowing
is tracked in this issue."
Agent: clean-retention
Assisted-by: DeepSeek Harness deepseek-v4.1-flash (analysed on a live system)
Activity
feat(clean): declare the per-host `clean:` section and its store budg…
feat(loaderkit): read the per-host `clean:` section without the deplo…
feat(clean): the store ceiling is the machine's, authored in the user…