Repository navigation
feat(schema)!: publish endpoints by name — #Publication, #PortRange, publication state (D-PUB) - #478
Conversation
…publication state (D-PUB)
A deployment publishes the endpoints its box provides by name (publish: {<endpoint>: {port: N|auto,
address}}); a box's ports are its provide.endpoint entries, carried by one ai.opencharly.endpoint
label; the realized host side is a publication state record. Deletes #PortPin, Deploy port and
resolved_port, the candy/candymodel port unions and PortSpec, the port and port_proto labels,
VmNetwork.port_forwards, ssh.port/port_auto, and the VM and KubeVirt ssh_port/port_forwards state.
Claude-Session: https://claude.ai/code/session_01Tvdn3tjf8tKajCd43DwENP
Agent: claude-default-volume-design · Claude Code session session_01Tvdn3tjf8tKajCd43DwENP
Assisted-by: Claude Code Anthropic Claude Opus 5.5 (fully tested and validated)
Review — BLOCKHead SHA: Change class: contract/schema (SDD) — spec module; no runtime/bed gate applies. Security screen: PASS — no secrets, network egress, guardrail weakening, or instruction-injection; not security machinery. Blocks
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
The resolved candy model the sdk reads carried the candy's port list; it now carries the candy's provide.endpoint entries as the named #Endpoint the box view, the label and the publication resolver share (D-CAP-8, D-PUB-1). Claude-Session: https://claude.ai/code/session_01Tvdn3tjf8tKajCd43DwENP Agent: claude-default-volume-design · Claude Code session session_01Tvdn3tjf8tKajCd43DwENP Assisted-by: Claude Code Anthropic Claude Opus 5.5 (fully tested and validated)
Review — BLOCKHead SHA: Change class: contract/schema (spec module, SDD). No runtime/bed gate applies. Security screen: PASS — no secrets/egress/guardrail weakening/injection; the Comment disposition
Blocks
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
… document's; one publication record per deployment Review round 2. A derived publication is a nil *PublicationPort, omitted when written back, and an explicit null decodes as derived (the zero value used to marshal to null and fail to decode). #PortRange gains to >= from and is wired as DeployConfig.port_range. The realized publications are one record on the deployment node, for every kind, replacing the VM and KubeVirt state copies and the vm plugin's ssh_port input. CandyReader.Endpoint replaces HasPorts. Claude-Session: https://claude.ai/code/session_01Tvdn3tjf8tKajCd43DwENP Agent: claude-default-volume-design · Claude Code session session_01Tvdn3tjf8tKajCd43DwENP Assisted-by: Claude Code Anthropic Claude Opus 5.5 (fully tested and validated)
|
STATUS Round 2: both findings from the two BLOCK verdicts are fixed in commit 968a943.
Missed control: the regression suite covered only the pinned and Also in this commit: the realized publications are ONE per-deployment state record ( Agent: |
Review — PASSHead SHA: Security screen: PASS — no secrets/egress, no guardrail weakening, no instruction-injection; spec-schema only. Comments considered:
Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
Brings in CHANGELOG/0.2026336.1318.md (#478's tag-on-merge entry); no code change. Claude-Session: https://claude.ai/code/session_01Tvdn3tjf8tKajCd43DwENP Agent: claude-default-volume-design · Claude Code session session_01Tvdn3tjf8tKajCd43DwENP Assisted-by: Claude Code Anthropic Claude Opus 5.5 (fully tested and validated)
…verrides (#479) SaveDeployStateInput gains publish (D-PUB-1), the authored publication overrides a bed or CLI persists onto the per-host entry like volume and env; #478 deleted the ports/set_ports pair it replaces and left the realized side (publication) only. Claude-Session: https://claude.ai/code/session_01Tvdn3tjf8tKajCd43DwENP Agent: claude-default-volume-design · Claude Code session session_01Tvdn3tjf8tKajCd43DwENP Assisted-by: Claude Code Anthropic Claude Opus 5.5 (fully tested and validated)
Summary
The spec leg of D-PUB (DESIGN §17.1, opencharly/opencharly#1404,
v2026.336.1240). A deployment publishes the endpoints its box provides by name. The box's ports are its endpoints; where a deployment publishes them is the deployment's. This removes the mixing of the two that the old port lists carried.Shapes added:
#Publication(port: N | "auto",addressdefaulting to127.0.0.1);#PortRange;#PublicationRecord(the realized{address, port, mode}, kept in state, never in a document, per D-DOC-4);Deploy.publish;Deploy.publication: the realized publications, ONE charly-written state record per deployment whatever its kind (a vm'ssshamong them), besideresolved_image. It also rides the state patch (SaveDeployStateInput.publication) and the vm plugin's prepare input (LifecyclePrepareInput.publication, replacing itsssh_port);DeployConfig.port_range: the local document's range derived andautoports are leased from, typed#PortRange(to >= from, checked by CUE and byPortRange.Validate).The
int | "auto"union is the hand typePublicationPort(spec/union_types.go), because gengotypes degrades that disjunction toany. The field is a*PublicationPort: nil is the derived form, so a derived publication is omitted when written back and an explicitnulldecodes as derived.The box side: a box's ports are its
provide: {endpoint: …}entries (D-CAP-8), carried by oneai.opencharly.endpointlabel (BoxMetadata.Endpoint). The resolved candy model (CandyModel.Endpoint) and the resolved box views carry them as the named#Endpoint.Tunnels:
TunnelConfigFromMetadata(meta, published)resolves over the box's endpoints and the realized publications. A tunnel scope's ports name guest endpoint ports; each backend is the endpoint's published host port, and the scheme is the endpoint's protocol.Deleted, a hard cutover:
#PortPinwith its alias, andDeploy.port/resolved_port;port:unions, together withPortSpecand the candy reader'sPort()/PortSpecs()/HasPorts()(replaced byEndpoint());ai.opencharly.portandport_protolabels;SaveDeployStateInput.ports/set_ports;network.port_forwardsandssh.port/port_auto;ssh_port/port_forwardsstate, KubeVirt'sssh_port, and the vm prepare input'sssh_port.Kept: firecracker's
ssh_portis the guest's own port, reached over its TAP network, not a host publication. libvirt's#LibvirtInterface.port_forwardsis the bound driver's own domain-definition shape (D-HW-5), into which a VM plugin renders publications.Skills: the spec skills that documented the old shapes (
layer,image,vm-spec,vms-catalog) now document the new ones.Relates to opencharly/opencharly#1390 (D-PUB wave, spec leg). Consumers follow producer-first: sdk, charly core,
charly migrate, the deploy and check plugins, then the content repos.Files
.agents/skills/image/SKILL.md.agents/skills/layer/SKILL.md.agents/skills/vm-spec/SKILL.md.agents/skills/vms-catalog/SKILL.mdcontainer/box_metadata_coneb.gocontainer/box_metadata_coneb_test.goschema/00_common.cueschema/box.cueschema/boxmetadata.cueschema/candy.cueschema/candymodel.cueschema/deploy.cueschema/hand_state_lockstep_test.goschema/port_range_test.goschema/resolvedproject.cueschema/seam.cueschema/vm.cuespec/candy_reader.gospec/cue_types_gen.gospec/deploy_config.gospec/hand_state_types.gospec/label_consts.gospec/port_mapping.gospec/scalar_aliases.gospec/tunnel_resolve.gospec/tunnel_resolve_test.gospec/union_types.goHow tested
The change class is contract/schema (SDD). The gate is spec's regeneration plus the module tests on the committed tree, head
968a94300b8118fbcabcd3df1576af394f60ffec:Spike
RCA claim: the spec schema carries host ports in the box definition (candy
port:, theportlabels) and the deployment's realized ports in authored nodes (resolved_port). DESIGN D-PUB/D-DOC forbid both.Candidates spiked: for the
port: N | "auto"field:intplus a separateauto: bool. Fails: it is a second spelling of one value, and DESIGN's#Publicationhas one field.PublicationPort(spec's existingunion_types.goconvention). Works:TestPublicationPort_Formsdecodes41235,autoand an absent port, refusesany,70000and0, and round-trips JSON.The regression tests fail on the unmodified tree (run in a throwaway detached worktree of
origin/maincarrying only the new test file):Review round 2 (the derived form). The first two verdicts found the derived form unproven: on head
4dd5b7da0042a612b341cf52ac88048dcf5a6034a derived publication marshalled to"port":null, and that failed to decode. Probe on that head (throwaway worktree):Candidates for the derived form: (b1) keep the value type and special-case
nullin both decoders. That decodes, but the derived form is still emitted asport: null, because a struct field is never omitted. (b2) a*PublicationPortwith nil as derived, plus null-safe decoders. This works: the derived form is omitted, and an explicitnulldecodes as derived. The new tests on this head:Winner: (b), with (b2) for the derived form.
RCA verdict: confirmed: the new shapes compile, round-trip and reject the invalid forms; the old tree lacks them.
Rulebook compliance
Plan conformance
Winning candidate: (b), with (b2): the hand union
*PublicationPort, nil = derived.Deploy.publishof#Publicationpublishentry names a provided endpoint and carries a#Publication: an optionalport(a number orauto) and anaddress,127.0.0.1by default."autoport formsport_range, stable across realizations and recorded in state"DeployConfig.port_rangeof#PortRange#Documentautoports are leased from (§17.1)"#PublicationRecordas one per-deployment state record;resolved_portdeletedautoports, resolved images, leases — live in state (D-DEP-5) and are never written into a document."provide.endpoint; the endpoint labelAGENTS.mdbefore editing.968a94300b8118fbcabcd3df1576af394f60ffec. The missed control was the regression suite: it covered only the pinned andautoforms, so the derived form had no test. It now has a round-trip test in both encodings, andport_rangeis wired and tested at both its CUE and Go boundaries.autoflag. One state record per deployment replaces three per-substrate port fields. One endpoint label replaces two port labels.port_rangeand#Publicationconstraints.git statuswas clean first. The work is on a session worktree off freshorigin/main, with no force-push and no hook bypass.Change classification
charly task cue-gen+go test ./....fully tested and validated.port:or VMport_forwards/ssh.port.charly migraterewrites the documents in the plugin-migrate leg. Roll back by reverting this squash commit; no consumer has bumped yet.Filed issues
None: no new finding.
https://claude.ai/code/session_01Tvdn3tjf8tKajCd43DwENP
Agent:
claude-default-volume-design· Claude Code sessionsession_01Tvdn3tjf8tKajCd43DwENPAssisted-by: Claude Code Anthropic Claude Opus 5.5 (fully tested and validated)