Skip to content

48 candies hand-roll curl where the download: verb would do, losing cache + checksum + atomic rename #322

Closed

Description

@atrawog

What

git grep finds 48 candies installing artifacts with a hand-rolled curl instead of
the declarative download: verb.

Each one silently forfeits what EmitDownload (sdk/deploykit/tasks_emit.go:237) provides:

  • the content-addressed /tmp/downloads cache (__c=…$(sha256sum)), so a cache-miss build
    re-fetches the whole artifact
  • the atomic .part → mv -f rename, so an interrupted fetch cannot leave a truncated file
    that looks complete
  • stage-user-correct cache: mounts (the uid/gid-owned cache that exists because a shared
    root-owned one permanently breaks non-root downloads)

Concretely: candy/ollama was re-downloading a 1.32 GiB archive on every cache-miss
build while the sibling fedora-builder image, generated from the same source, got all
three protections.

Why it happened, and what has changed

Until now the verb could not express a capability GATE — "fetch only where the distro
package did not already provide this" — and a plan step has no build-time distro filter
(exclude_distro: is read by the check runner, never by the emitter). Abandoning the verb
was the only way to express it.

unless_exists: (opencharly/spec#37 + opencharly/sdk#142) closes that specific hole, and
candy/ollama is migrated as its first consumer.

What this issue tracks

Auditing the remaining 47 and migrating the ones the verb can now express. Not every one
will qualify — candy/llama-cpp, for instance, loops over GitHub releases to find one with
a matching asset, which is genuinely beyond a single declarative URL. The deliverable is a
reviewed list of migrate / cannot migrate, and why, so the hand-rolled ones that remain
are a documented decision rather than an accumulated default.

Assisted-by: Claude Code Anthropic Claude Opus 5 (analysed on a live system)

Activity

  1. atrawog commented on Aug 28, 2026

    @atrawog
    ContributorAuthor

    Validation (2026-08-28) — STILL VALID (enabler landed)

    Verified against current repos. The capability gate the issue said was missing has landed: unless_exists is in the spec vocabulary (spec/vocab_gen.go:160, cue_types_gen.go:85-95). The conversion is in progress — e.g. pod-ollama/charly.yml:90-97 now uses the declarative download: verb ("rather than a hand-rolled curl"). The corpus-wide conversion of the remaining hand-rolled curls is not complete.

    Value: MEDIUM — cache + checksum + atomic rename per converted candy. Static-verified (corpus-wide grep); no bed needed.

  2. atrawog commented on Aug 28, 2026

    @atrawog
    ContributorAuthor

    Final validation (2026-08-28) — VERIFIED (confirmed still valid, enabler landed)

    Static verification: the unless_exists capability gate landed in the spec vocabulary (spec/vocab_gen.go:160, cue_types_gen.go:85-95), and the conversion is in progress — pod-ollama/charly.yml:90-97 now uses the declarative download: verb. The corpus-wide conversion of the remaining hand-rolled curls is incomplete.

    Status: VERIFIED — keep open as the conversion batch. Value: MEDIUM (cache + checksum + atomic rename per converted candy).

  3. atrawog commented on Aug 29, 2026

    @atrawog
    ContributorAuthor

    Closing: the fix landed and merged on main. Verified against the current state of main — the fix is present (see the validation comment for the specific evidence).

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions