Skip to content

host service: §4.6 promises a plugin its OWN user-config section; the only reader is the whole per-host file #383

Open

Description

@aitrawog

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 no config store key.
    The reverse channel is ExecutorService (Venue, RunSystem, RunUser, PutFile, GetFile,
    RunHostStep, InvokeProvider, HostBuild, DescribeProvider) plus CheckContextService.
  • The _store table's derived types do not exist: #StoreKey, #StoreValue, #PutInput have zero
    occurrences in spec/schema/.
  • #UserConfig is a contract name with no type: the eight UserConfig hits in spec/sdk/charly
    are all the stdlib os.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: #UserConfig has 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 says plugin-clean / plugin_clean /
    a plugin:-declared key. A plugin cannot implement get config until 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)

  1. spec — add the host-service store ops to plugin.proto and derive #StoreKey/#StoreValue/
    #PutInput from the _store table so the schema and the proto cannot disagree; state the
    section-key convention
    (either the section is a declared field and the plugin's plugin: block
    names it, or the candy word is the key — but say it once, in the contract).
  2. charly — serve it, deriving the caller from the socket / the in-proc reverse channel per
    D-PROTO-12, and answer denied outside the caller's own section.
  3. sdk — a client (GetUserConfigSectionViaExecutor) beside the existing loaders.
  4. 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-box read 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

  1. added
    category:runtime
    type:chore
    on Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    category:runtimetype:chore

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions