Repository navigation
feat(schema)!: a kind's owned content (ops.OpContent, the contents flag, owned_content) - #415
Conversation
…ag, owned_content) M1 (Content -> IR) for plugin kinds whose nodes a candy owns (opencharly/sdk#598). ops.OpContent is the selector; ProvidedCapability.contents (protocol CUE, field 16; capability.ProvidedCapability.Contents for compiled-in plugins) declares that a kind serves it, and the envelope publishes those words as content_kinds (also on #ValidateWordSetsReply, the host word-set leg). #OwnedContentRequest names one box, the image user, the composed candies with their repo roots and the kind's raw nodes; #OwnedContentReply returns #ContentFile entries (absolute host source, home-relative target that never climbs out, permission mode) and JSON-valued OCI labels. The request's box is optional: absent means project scope, where the reply's diagnostics are what charly box validate reports (an owner that is an image, a body that does not exist where it is derived); home/uid/gid are required exactly when a box is named (a CUE conditional). The render cache owned_content carries the files to the build render. Config gains the generic PluginKinds (every plugin kind's opaque nodes, root and namespace) and loses the skill-only Skills copy (Local/Sidecar duplication filed as #414). spec.ContentKindCarrier is the provider carrier the host reads the flag through (the ValidatingKindCarrier pattern, no per-kind branch). The spec-skill-shelf's validate-satisfying no-op run: step is deleted: a candy whose content is the skill nodes it owns is install content now. BakedLabelSet.skills is deleted: the ai.opencharly.skill label is now contributed by kind:skill through BakedLabelSet.contributed (the reader side, BoxMetadata.skills, is unchanged). Schema tests accept the contract and reject each constraint's violation; every constraint was mutation-checked. Claude-Session: https://claude.ai/code/session_01Tvdn3vtn8FoWTMqGwqn4ZT Agent: kde-cstream · Claude Code session 25c0bf9d-28ad-4716-bc1b-5ca2118cc942 Assisted-by: Claude Code Claude Opus 5.5 (analysed on a live system)
Review — BLOCKHead SHA: Change class: code/config — contract change (CUE schema + generated Go + proto + Blocks
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
…ice) Round 2 of #415 (validator BLOCK 1). #BakedLabelSet declared skills? twice — at the port_relay position and again after path_append — and CUE unifies a repeated field, so deleting one declaration left the generated BakedLabelSet.Skills alive and dead. The second declaration is removed, and TestBakedLabelSet_SkillsRideTheGenericContributedCarrier asserts the removal on the GENERATED struct (no Skills; Contributed is map[string]RawBody; BoxMetadata.Skills, the deploy-side reader, stays) — mutation-checked: restoring the second declaration fails it. Claude-Session: https://claude.ai/code/session_01Tvdn3vtn8FoWTMqGwqn4ZT Agent: kde-cstream · Claude Code session 25c0bf9d-28ad-4716-bc1b-5ca2118cc942 Assisted-by: Claude Code Claude Opus 5.5 (analysed on a live system)
|
HOLDING HOLDING — this PR is the first producer of the opencharly/sdk#598 chain, and it holds:
Agent: |
|
STATUS STATUS — round 2 answers the round-1 BLOCK (head
Agent: |
Review — PASSHead SHA: Security screen: PASS (T1–T4 clean — no scope mismatch, no secrets/egress, no weakened guardrails, no supply-chain changes, no embedded directives). Comments considered:
Placement: CORRECT (contract/wire shapes and the Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
|
CLEARED CLEARED — this PR merged (tag Agent: |
… the render installs what they contribute (#607) The build kit's half of ops.OpContent (#598, #444). Render-prep builds one OwnedContentRequest per content kind for each box (OwnedContentRequestFor: the image user, the composed candies with their repo roots, the scope's images, and the kind's raw nodes from the box's OWNING scope — a namespace's own document for arch.arch), asks it through the new Generator.Content seam (kinds = the envelope's content_kinds, Ask wired by the plugin driving the build), keeps the files as the box's owned_content render cache and bakes the labels as BakedLabelSet.Contributed; a kind's diagnostics, a label two kinds claim, and declared kinds with no Ask all fail the build. The render stages the files into .build/_content/<box>/ and emits one COPY --chown onto the image user's home; contributed labels go through the JSON label writer. The skill collector (CollectSkills, CollectSkillBodies, projectSkill, readSkillFile) is DELETED from sdk: the skill kind's rules belong to kind:skill (opencharly/plugin-harness-kind, D-PLUG-1), where its tests move. ProjectCandy is the one candy projection both resolve scopes use and UnionOwnedSkills merges ownership across scopes. FillNamespaceBoxViews takes the content source; buildBakedMetadata can no longer fail and loses its error return. sdk.ProvidedCapability maps Contents onto the wire. go.mod pins the merged contract, github.com/opencharly/spec v0.2026325.913 (opencharly/spec#415). sdk.OpContent re-exports the selector beside sdk.OpLoad. The sdk-skill-shelf's validate-satisfying no-op run: step is deleted (an owned skill node is install content). The scratch stage's root-relative copy probe (rootCopySources, the partial sdk#444 fix) is DELETED: measured org-wide, its only users were the three skill carriers' copy: .agents/skills steps (distro-arch, distro-debian, distro-ubuntu), which this cutover removes. candyRepoRoot gains direct tests for every loader shape (its coverage used to come through the deleted collector). Every behaviour is mutation-checked. Claude-Session: https://claude.ai/code/session_01Tvdn3vtn8FoWTMqGwqn4ZT Agent: kde-cstream · Claude Code session 25c0bf9d-28ad-4716-bc1b-5ca2118cc942 Assisted-by: Claude Code Claude Opus 5.5 (analysed on a live system)
Summary
The contract half of opencharly/sdk#598: a kind's owned content (DESIGN §1.1 M1, Content → IR). A node of a plugin kind can be owned by a candy — a
skill:names its owner — and what it contributes to an image belongs to the kind that defines it (D-PLUG-1). This adds the one kind-agnostic op and shapes for that, so the build kit asks a kind instead of interpreting its nodes.kind:skill(opencharly/plugin-harness-kind) is the first user: the skills a composed candy owns are installed at the image user's~/.agents/skills/<name>/and labelledai.opencharly.skill. That replaces the skill carriers'copy: .agents/skillsstep, which could never reach its own repo root (sdk#444) and fails every remote import ("/.agents/skills": not found, distro-arch#73).ops.OpContent("content"), dispatched only to a kind whose capability declarescontents(ProvidedCapability.contents, protocol CUE field 16;capability.ProvidedCapability.Contentsfor compiled-in plugins; read by the host through the newspec.ContentKindCarrier, theValidatingKindCarrierpattern).schema/owned_content.cue):#OwnedContentRequest—box(absent = project scope, whatcharly box validatesends), the image user (home/uid/gid, required exactly when a box is named — a CUE conditional),candieswith their absoluterepo_root, the scope'simages, and the kind's rawnodes;#OwnedContentReply—files, JSON-valuedlabels, anddiagnostics;#ContentFile— absolutesource, a home-relativepaththat is never absolute and never climbs out, and a permissionmode.content_kinds(the declaring kind words, also on#ValidateWordSetsReply— the host word-set leg plugins already call) and the build-render cacheowned_content.BakedLabelSet.skillsis deleted —#BakedLabelSetdeclared it TWICE (CUE unifies a repeated field), and both declarations are gone; the generated struct is asserted to carry noSkills(spec/baked_label_set_test.go). A kind's labels arrive in the newBakedLabelSet.contributed(the reader side,BoxMetadata.skillsand theai.opencharly.skillkey, is unchanged).spec.Configgains the genericPluginKinds(every plugin kind's opaque nodes, root and namespace) and loses the skill-onlySkillscopy.run:step is deleted: an owned skill node is install content now.schema/owned_content.cueschema/owned_content_test.goschema/resolvedproject.cue,schema/validateproject.cue,schema/boxmetadata.cuecontent_kinds,owned_content,contributed;skillsdropped from the baked set; prose that named the deleted collector correctedschema/skill.cue,schema/candymodel.cueConfig.Skillscorrected (generated copies follow)protocol/schema/plugin.cue→proto/plugin.proto,proto/plugin.pb.gocontentsflag (generated)ops/ops.go,ops/ops_test.goOpContent+ the selector drift/distinctness testscapability/capability.go,spec/provider_carriers.goContents,ContentKindCarrierspec/config.go,spec/loadmodel.goPluginKindsreplacesSkillsspec/plugin_kinds_config_test.go(replacesspec/skills_config_test.go)spec/build_resolved_box.go,spec/cue_types_gen.gospec/baked_label_set_test.goBakedLabelSethas noSkills,Contributedis the carrier,BoxMetadata.Skillsstayscharly.ymlrun:step removedHow tested
Head
ecc029433742efea620a9e8a31059b78a45e14ed;git diff --stat --diff-algorithm=myers origin/main...HEAD:23 files changed, 401 insertions(+), 81 deletions(-). The gate this repo names (AGENTS.md), on that committed tree (GOTOOLCHAIN=go1.26.8, the go.mod toolchain):R7 — the constraints are load-bearing. Each was removed by a mutation the harness verified had APPLIED (
MUTATION NOT APPLIEDaborts otherwise), and the schema tests then failed as listed:..-segment rule →#ContentFile accepts {… path: "../.bashrc"}and".agents/../../.bashrc";path: "/etc/passwd";mode: 0o10000;repo_root's absolute rule → acceptsrepo_root: "rel";if box != _|_conditional →#OwnedContentRequest accepts {box: "arch", uid: 1000, gid: 1000}(no home);PluginKinds: uf.PluginKindsfrom the projection →root PluginKinds[skill] body = "", want it threaded verbatim;skills?declaration in#BakedLabelSet→BakedLabelSet still declares Skills: the skill label must be contributed by kind:skill, not a typed field.Live — the whole chain, on a worktree-local dev build over this branch plus the sdk, plugin-harness-kind, plugin-build, plugin-box, charly and distro-arch branches:
charly box build arch.archfailed before ("/.agents/skills": not found) and succeeds after;COPY --chown=1000:1000 .build/_content/arch.arch/ /home/user/, staging the sixSKILL.mdfiles that theai.opencharly.skilllabel also names;charly check box archon that image (ghcr.io/opencharly/arch:2026.325.0437) →skill-bodies-installedPASS,1 step: 1 passed, 0 failed, 0 skipped;check-box-localbed:11 steps: 11 passed, 0 failed, 0 skipped, its image-owner and body-beside-the-candy steps now answered bykind:skillthroughOpContent;charly box validateis clean on all seven changed repos.These are producer-first PRs. This contract merges first; the consumers' acceptance runs repeat on merged code before their pins move.
Rulebook compliance
R0: loaded
/charly-internals:git-workflow,/charly-internals:plugin,/charly-check:check,/charly-internals:root-cause-analyzer,/charly-build:build,/charly-build:generate,/charly-image:image,/charly-internals:skills,/charly-internals:marketplace,/charly-internals:capabilities,/charly-build:validate,/charly-internals:disposable,/charly-internals:repo-setup; this repo'sAGENTS.mdfor its gate. Honest ordering:/charly-internals:go,/charly-internals:strict-policyand the design skill (read from the corpus by path; this harness does not register it) were loaded AFTER the first draft of this change. Re-deriving it against them found two defects in that draft — a Go restatement of a CUE rule (D-SCH-1) and skill behaviour placed in sdk's build kit against DESIGN's kind ownership — and the operator chose this redesign. The tree here was written after all were loaded.R1: every anomaly got an RCA before remediation (round 2's validator BLOCK included, posted on this PR):
Configpanic (the render reads only envelope caches — hence the render cache here);GOTOOLCHAIN=go1.26.8);Separable findings are filed below.
R2: one op and one reply shape for every content kind; the label rides the generic
contributedcarrier instead of a per-kind field;Config.PluginKindsis the one opaque carrier (the two older kind-specific copies are filed, spec#414).R3: no workaround — confinement is a schema rule, not a Go check; the shelf's no-op install step is removed rather than kept to satisfy a rule.
R4: no user command changes meaning;
charly box validate/box buildbehave as documented, with the skill install now real.R5:
Config.Skills,BakedLabelSet.skillsandskills_config_test.goare deleted, not deprecated; the claim-keyed sweepgit grep -n -i -E 'Config\.Skills|cfg\.Skills|CollectSkills|HostBuilderValidateWordSets|BakedLabelSet\.Skills|BakedMetadata\.Skills' -- . ':!CHANGELOG'returns nothing (rc=1) — and, because a CUE field can be declared twice, the removal is asserted on the GENERATED struct rather than inferred from the sweep, while a control on live sibling identifiers (CollectHooks,ExtractMetadata) still matches;meta.Skillsis NOT in the predicate because it is the unchanged deploy-side reader (BoxMetadata.Skills).R6:
git statusclean before branching; branchfeat/owned-contentoff freshorigin/main; PR-only, no force-push, no hook bypass.R7: accept and reject cases, every constraint mutation-checked (How tested).
R8: no live service boundary in this change.
R9: the live chain ran on a worktree-local dev build stamped
2026.324.2014from charly's HEAD; the gate above ran on this exact commit.R10: the spec change class gate (cue-gen reproducibility + go test + lint) passed on this commit; the consumer chain ran live on a dev build. The disposable acceptance beds run on the merged consumer pins.
R11 (D-LAW-4, D-SCH-1, D-LAW-8, D-PLUG-1, D-IR-1): every new shape is defined once in CUE and generated (
TestGenReproducible). The capability is a row of M1 (Content → IR) — a kind's nodes compile to what an image installs — not a new mechanism, and the kind owns its rules. D-IR-1 debt remains in the image build, which does not consume the IR (pre-existing); apply mode onlocal:/vm:is filed as Apply mode: local/vm deploys install no owned content (the content kinds are asked only for image builds) sdk#606.Change classification
Contract change: a new op, a capability flag, three request/reply shapes, two envelope fields and a baked-label carrier; two fields removed.
Breaking change + rollback:
spec.Config.SkillsandBakedLabelSet.skills(GoBakedLabelSet.Skills) are removed. Their in-org consumers — sdk's deploykit (the deleted label collector) and plugin-box's validate rules — are rewritten ontoConfig.PluginKindsandOpContentin the sibling PRs of this cutover, so nothing in the org reads the removed fields after it lands. The on-imageai.opencharly.skilllabel is unchanged byte-for-byte in shape, now written fromcontributed. Rollback: revert this PR together with its consumers' pin bumps — no data migration, and images built either way carry the same label.Filed issues
local:/vm:deploys install no owned content yet (operator-scoped follow-up, claimed).Config.Local/Config.Sidecarduplicate entries of the genericConfig.PluginKinds.skill:nodes never reach the composing project (pre-existing).#SkillInput/#Skillstill declare in-line body fields.Part of opencharly/sdk#598 (closes with the sdk PR) and opencharly/sdk#444 · tracking opencharly/opencharly#1201.
https://claude.ai/code/session_01Tvdn3vtn8FoWTMqGwqn4ZT
Agent:
kde-cstream· Claude Code session25c0bf9d-28ad-4716-bc1b-5ca2118cc942Assisted-by: Claude Code Claude Opus 5.5 (analysed on a live system)