Skip to content

The capability table declares provide: per type, but no authored key writes one — A-0 must refuse secret by name #368

Open

Description

@aitrawog

The measurement

The capability table declares a provide: row per capability type, and nothing can author one:

$ git -C spec grep -n '^\s*provide!\?:' origin/main -- 'schema/*.cue'
(none)
$ git -C spec grep -n '^#Provide' origin/main -- 'schema/*.cue'
(none)                      # the Go type exists only as generated output
$ git -C spec show origin/main:spec/cue_types_gen.go | grep -n 'type Provide struct'
4563:type Provide struct
$ git -C spec grep -n 'env_provide\|mcp_provide\|agent_provide' origin/main -- 'schema/candy.cue'
145:	env_provide?: #StrMap @go(EnvProvides)
150:	mcp_provide?: [...#CandyMCPProvide] @go(MCPProvide)
151:	agent_provide?: [...#AgentRuntimeCapability] @go(AgentProvide)

The table (schema/capability.cue:151-155) says env: {…, provide: #EnvProvide}, parameter: {…, provide: #ParameterProvide}, endpoint: {…, provide: #Endpoint}, network: {…, provide: {}} — and secret:, harness: and the leasable types declare no provide: row at all. A candy can author need?: #CandyNeed and use?: #CandyUse (schema/candy.cue:41-42); it has no key that writes the provide half.

So the authored surface is one-sided: wants exist in §8 form, provides exist only as the three legacy maps.

The concrete victim

charly's A-0 gatherer (charly@4b8151621b5bbd89003ac4a299005866e8cf0d97, branch feat/capability-gather-a0) is the caller spec/needsolver documents. It gathers wants for every capability type, and refuses a type with no authored provide surface:

var provideSurfaces = map[string]provideSurface{
	"env": {…},   // the ONE live row: env_provide is authorable today
}
// every other type -> ErrNoProvideSurface{Type: "secret"}

Its test TestGatherRefusesATypeWithNoProvideSurface asserts that a secret need raises ErrNoProvideSurface — not ErrUnbound — even when the tree contains a lookalike provide, because D-CAP-3's "an unbound need is an error naming what was searched" must not be claimed for a search that cannot happen. That test is the hole made visible: the day a provide: key exists, it fails, and that failure is the signal to widen the table.

The question for the maintainer

One surface, not two — an authored key is needed, and R2 makes two provide surfaces a defect. The options:

  1. a new authored provide: map on candy/box/deploy, typed by the capability table — the symmetrical partner of need:/use:, and the one the §8 contract already describes; the legacy env_provide/mcp_provide/agent_provide retire in the same cutover.
  2. widen the legacy maps to cover every capability type — keeps today's spelling, but leaves the provide half spelled differently from the want half forever, and the table's provide: rows stay declarative-only.

I have not picked one: the choice decides whether §8's authored surface is uniform (need:/use:/provide: as one family) or split, and that is an architecture decision, not a finder's.

What closes this issue

A spec change that gives the table's provide: rows an authored key (option 1 or 2), then a one-row edit to provideSurfaces in charly/capability_gather.go per type. Until then, every secret need is refused loudly rather than silently unbound — which is the correct answer to a question whose data cannot yet exist.

Related: spec#367 (the same package's doc claims an sdk re-export that sdk does not have), spec#366 (the Bind/Unbind wire seam that will consume these bindings).

Agent: audit-protocol
Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (measurement pasted above; no code changed here)

Activity

  1. aitrawog commented on Nov 17, 2026

    @aitrawog
    ContributorAuthor

    Status: the authoring key has landed; this issue is now the migration ledger

    spec gained the authored provide: key (DESIGN.md:572) in feat/provide-author
    (ea5b37c0a36990c80013f045e010f7c6eaf16260). The legacy maps are accepted for a bounded window, and
    a node that authors both surfaces is now a schema error — so the duplication cannot grow while
    it shrinks:

    "author either provide: or a legacy provide map, never both (spec#368)"
    

    The exit condition (counted, and it only moves down)

    count what it counts
    170 charly.yml manifests carrying env_provide / mcp_provide / agent_provide, org-wide (grep -rl --include='charly.yml' …, -not -path './.worktrees/*')
    90 …of which are in charly/
    ≥6 distinct repos in the current checkout (a partial materialization of ~400 submodules), so the true repo count is larger

    This issue closes when that first number is 0 and the final spec PR deletes the legacy keys
    with the claim-keyed grep pasted. Migration is one PR per repo — that is the ordering, not a pause.

    Per-repo ledger

    repo manifests state
    charly 90 not started
    distro-fedora 2 not started
    layer-claude-code 1 not started
    layer-charly-check 1 not started
    distro-cachyos 1 not started
    distro-arch 1 not started
    (not materialized here) ? to be measured with CHARLY_INIT_MODE=all

    What the gatherer does meanwhile

    charly's A-0 gatherer (4b8151621b5bbd89003ac4a299005866e8cf0d97) reads its provide surface from a
    table. It gains provide:-authored rows as types get both a table row and a gatherer row; types
    with no provide row in the capability table keep raising ErrNoProvideSurface — the runtime twin of
    the schema refusal proven by TestProvideRefusesATypeWithNoProvideRow.

    Agent: audit-protocol
    Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (counts measured with the greps above)

  2. added
    category:runtime
    type:feat
    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:feat

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions