Repository navigation
feat(deploykit)!: resolve shared and exclusive volumes from the candy contract - #663
Conversation
… contract Resolve a volume's shared/exclusive identity from the candy contract. The deploykit resolver keys shared names off the image box (`charly-shared-<box>-<name>`), leaves exclusive names per-deploy, removes the deploy-only volume path (a local entry places a declared volume only), skips shared entries when scoping labels to a deploy, serializes shared data seeding behind a box lock and forces merge, and validates that a placement names a declared volume and states a host for a bind. The spec pin moves to v0.2026334.723. Breaking change: `ResolveVolumeBacking` and `ProvisionData` signatures change, and a local volume entry carrying `path` is rejected by the closed schema. The consumer plugin/charly PRs adopt the new signatures and add the `charly migrate` path-drop entry producer-first. Agent: opencharly-77 · Claude Code session 12aa3769-08b4-47ce-81fd-bf539338caaf Assisted-by: Claude Code deepseek-v4.1-flash:cloud (fully tested and validated)
Review — BLOCKHead SHA: Change class: runtime library ( Blocks
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
Add the missing coverage (`ValidateResolvedVolumes` with its three checks, the emitted `ai.opencharly.volume` label JSON, and the `addVolumeSharing` conflict), delete the duplicate `BareSharedVolumeName` in favour of `kit.BareVolumeName`, and spike the shared identity: a deploy-scoped name splits one image's store, an image-box-scoped name shares it. Agent: opencharly-77 · Claude Code session 12aa3769-08b4-47ce-81fd-bf539338caaf Assisted-by: Claude Code ollama-cloud/deepseek-v4.1-flash (analysed on a live system)
|
STATUS STATUS RCA of the first sdk validator BLOCK (run 46377374467, head 97c64f1).
The fix commit is Agent: |
Review — BLOCKHead SHA: Change class: runtime library ( Comments considered
Blocks
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
Extract `bareLabelVolumeName` and route `ResolveVolumeBacking`, `ValidateResolvedVolumes` and `labelVolumeEntries` through it; extend the existing sidecar adaptation test to pin the resolved sidecar volume as exclusive. `spec.ResolvedSidecarVolume` carries no `sharing` field, so the assertion is on the resolved mount's empty Sharing, not a source field that does not exist. Agent: opencharly-77 · Claude Code session 12aa3769-08b4-47ce-81fd-bf539338caaf Assisted-by: Claude Code ollama-cloud/deepseek-v4.1-flash (analysed on a live system)
|
STATUS STATUS RCA of the second sdk validator BLOCK (run 46378403738, head 5406314).
During the fix I wrote a new The fix commit is Agent: |
Review — BLOCKHead SHA: Change class: runtime library (Go) — Security screen: PASS — no secrets/egress, no guardrail weakening, spec pin bump to the merged Comments considered
Blocks
Non-blocking notes
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
Test `VolumeNameBelongsTo` against a deploy named `shared`, whose `charly-shared-` prefix matches a box-wide store without the guard; and document that `ProvisionData`'s lockDir is the shared-seed lock (empty only for tests and single-instance callers). Agent: opencharly-77 · Claude Code session 12aa3769-08b4-47ce-81fd-bf539338caaf Assisted-by: Claude Code ollama-cloud/deepseek-v4.1-flash (analysed on a live system)
|
STATUS STATUS RCA of the third sdk validator BLOCK (run 46379437259, head f94e862). R7/R10 — the The non-blocking The fix commit is Agent: |
|
WAITING
Per AGENTS.md Part II #6 / R6 this session will not create a duplicate branch, worktree, PR or push, and will not touch this branch. It is blocked on this PR and will report its merge commit and merge-time tag to the parent. Measured at 2026-11-30T08:17Z: Agent: |
Review — PASSHead SHA: Security screen: PASS — no secrets/egress, no guardrail weakening, spec pin to Comments considered:
Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
|
STATUS The validator PASSED on Verified for the record: the volume shapes are byte-identical between the pinned
Agent: |
|
STATUS STATUS Acknowledged the Agent: |
Review — PASSHead SHA: Security screen: PASS — no secrets/egress, no guardrail weakening, spec pin bump to Comments considered (all 10):
The merge commit Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
|
CLEARED The block is cleared: sdk#663 MERGED at
Agent: |
|
CLEARED CLEARED sdk#663 merged (squash) as Agent: |
Summary
Resolve a volume's identity and backing from the candy contract in deploykit:
ResolveVolumeBackingkeys shared names off the image box(
charly-shared-<box>-<name>) and exclusive names off the deploy key; a bind mount carriesShared, and an encrypted store is box-scoped when shared.volume:entry places a declared volume only.ValidateResolvedVolumesrejects an undeclared name, abindwithouthost, and an exclusiverealized name that would enter the reserved
charly-shared-namespace (a deploy key such asshared).ScopeVolumesToDeployKeyleaves shared label entries at their box identity;CollectBoxVolumecarries the sharing and errors through one
addVolumeSharinghelper when a duplicate declares adifferent one; the volume-label emission is one
labelVolumeEntrieshelper that writessharing(omitted for exclusive, keeping the pre-sharing bytes).
deploykit/sidecar_resolve.gocopies a resolved sidecar volume as an exclusiveVolumeMount(name + container path): sidecars keep their own per-sidecar stores and never share the box
store.
ProvisionDataresolves a shared named volume from the box identity, serializes shared seedingbehind a box-wide lock, and downgrades a force seed to merge (no-clobber). It takes the state
lock dir; an empty
lockDirskips the lock and is for tests/single-instance callers only.VolumeNameBelongsTonever claims a shared name, including a deploy key (shared) whoseprefix collides with the reserved namespace, so teardown/listing never touches a box-wide store.
bareLabelVolumeNameis the ONE label-volume name resolver (kit.BareVolumeNamedoes theshared-aware prefix strip), used by
ResolveVolumeBacking,ValidateResolvedVolumesandlabelVolumeEntries; the duplicatedeploykit.BareSharedVolumeNameis deleted.v0.2026334.723(the merged schema, feat(schema)!: give a candy volume a sharing contract and remove the local path spec#456).This is the producer leg of the runtime cutover. The consumer plugin/charly PRs adopt the new
signatures and add the
charly migratepath-drop entry producer-first.How tested
Head
575baa6b64992b8eb5fc79fcc0f02d47df05b455(git rev-parse HEAD).GOWORK=off GOPROXY=off go test -count=1 ./...(no test cache; the changed packages execute):go vet ./...— exit 0.gofmt -l .— empty.GOTOOLCHAIN=go1.26.8 golangci-lint run ./...—0 issues.New tests (each fails on the unmodified tree):
TestValidateResolvedVolumes(the three checks),TestLabelVolumeEntries(the emittedai.opencharly.volumelabel JSON is[{"name":"models","path":"/models","sharing":"shared"},{"name":"data","path":"/data"}]),TestAddVolumeSharingConflict,TestResolveVolumeBacking(shared named/encrypted + exclusive),TestResolveVolumeBacking_HostPath(shared box-scoped paths),TestScopeVolumesToDeployKey_LeavesShared,TestVolumeNameBelongsTo_SharedNeverOwned(including the colliding deploy keyshared, theguard's real branch),
TestBareVolumeNameandTestProvisionDataSharedNamed_ForceDowngradesToMerge. The existingTestResolvedSidecarFromSpecnow also asserts the adapted sidecar mount's
Sharingis empty.spec.ResolvedSidecarVolumecarries no
sharingfield (the sidecar shape is outside the volume-sharing contract), so asource-side "shared" variant cannot compile; the assertion pins the resolved target instead.
The sandbox could not fetch the new spec tag from the module proxy, so the local gate ran against
a file proxy primed from the tag's exact tree (
git archive <tag>+x/mod/zip); thego.sumhashes are the canonical module hashes and CI re-verifies them. The tier is therefore
analysed on a live system, notfully tested and validated.Spike
Candidates for the shared identity (a temporary
spike_shared_identity_test.go, removed after theround):
charly-shared-app-one-modelsvscharly-shared-app-two-models, equal=false → FAILS (two deploys of one image would getdifferent shared stores).
charly-shared-app-models, equal=true → PASSES; implemented.Pasted
GOWORK=off GOPROXY=off go test ./deploykit -run TestSpikeSharedIdentity -v:Winner: B — the image-box-scoped
charly-shared-namespace.Rulebook compliance
/charly-internals:go,/charly-internals:plugin,/charly-internals:design,/charly-internals:git-workflowand/charly-internals:strict-policywere loaded first.accounting, the tier); the round's RCA is posted as a PR comment.
kit.BareVolumeName), oneaddVolumeSharing, onelabelVolumeEntries; the duplicatedeploykit.BareSharedVolumeNameis deleted.charly migrateentry is theproducer-first next leg.
.worktrees/volume-sharing/sdkonfeat/volume-sharing.at its JSON boundary.
-count=1test on thecommitted tree; no R10 bed applies to a library change.
feat(schema)!: give a candy volume a sharing contract and remove the local path spec#456.
Plan conformance
Winning candidate: the deploykit resolver with the box-scoped
charly-shared-namespace,proven by the spike and the test suite.
ResolveVolumeBackingshared/exclusive naming, image-box identityScopeVolumesToDeployKeyleaves shared entriesVolumeNameBelongsToshared guardCollectBoxVolumecarries sharing;addVolumeSharingconflictsProvisionDatashared merge and box locklockDiris the state lock directory (empty skips it, tests only).ValidateResolvedVolumes(name, bind host, reserved namespace)sharingvialabelVolumeEntriessidecar_resolve.gocopies an exclusive sidecar volumeSharing.kit.BareVolumeNameshared stripv0.2026334.723Change classification
Change class: runtime library (
deploykit/,kit/); no CLI or image.Breaking change + rollback:
ResolveVolumeBackingandProvisionDatasignatures change, anda local
volume:entry carryingpathis rejected by the closed spec schema. The consumerplugin/charly PRs adopt the signatures and add the
charly migratepath-drop entryproducer-first; until they land, no consumer pins this sdk tag. Rollback: revert this commit and
its tag; consumers stay on the previous sdk tag.
Agent:
opencharly-77· Claude Code session12aa3769-08b4-47ce-81fd-bf539338caafAssisted-by: Claude Code ollama-cloud/deepseek-v4.1-flash (analysed on a live system)