Skip to content

Runtime tool-package pins resolve to a published version, never * (CL-7389) - #643

Merged
TheGreatAxios merged 7 commits into
mainfrom
cl-7389-versioned-pins
Sep 5, 2026
Merged

TheGreatAxios merged 7 commits into
mainfrom
cl-7389-versioned-pins

Conversation

@TheGreatAxios

@TheGreatAxios TheGreatAxios commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Fixes CL-7389

Runtime tool-package pins resolve to a concrete, published version —
never * or any other range/tag — so a later tarball landing in a
tenant's registry never silently changes what an already-deployed
specialist runs.

Critique follow-ups in this update

  • Added a test proving a PUT that only edits name/system prompt never
    re-touches tool-package pins, even after a newer tarball lands in the
    registry (zero registry listing calls during that PUT).
  • Guided capability-add re-adding a package already pinned on a
    definition now keeps its existing stored version instead of silently
    bumping to the registry's newest tarball — resolution only happens for
    a genuinely new pin. An explicit re-pin/bump is a separate, explicit
    action this does not add.
  • NonWildcardToolPackagePin now requires an exact semver.valid
    version, rejecting *, latest, ^1, ~1.2, >=1.0.0, 1.x, and
    empty — not just the literal *.
  • resolvePinnedVersion now prefers the highest stable published
    version; a prerelease only wins when the registry carries no stable
    version for the package at all.
  • A multi-pin create_agent/POST /agent-definitions call now shares one
    createPinnedVersionResolver across all of its pins, so a five-pin
    create costs one registry-asset lookup and one tarball listing total,
    not one per pin.

packages/agent-directory/README.md documents the redeploy and re-add
semantics.

@linear-code

linear-code Bot commented Sep 4, 2026

Copy link
Copy Markdown

CL-7389

Covers the new resolvePinnedVersion resolver (highest published version
among a tenant's, or its ancestor's, corbits-tools registry tarballs;
fails closed when the registry or package is absent) and
withAgentToolPackagePin's rejection of a "*" version. Updates the
existing create/capability-add route tests, which previously asserted
the old hardcoded "*" pin, to resolve real versions through their fake
asset services instead.
…-7389)

The three runtime sites that pinned a tool package by name only
(create_agent's toolPackagePins, guided capability-add on both the
tenant-session and workflow-run capability routes) hardcoded version
"*" — a new tarball landing in the tenant's corbits-tools registry
would silently change what an already-deployed specialist runs, with
no record of the change.

Adds resolvePinnedVersion, which resolves a bare package name against
the tenant's (possibly inherited) corbits-tools package-registry asset
and picks the highest published version among its tarballs, throwing
the same CapabilityOutOfInventoryError the guided-capability-add
inventory check already throws when the registry or package is absent
— every caller's existing 4xx mapping covers it with no new wiring.
withAgentToolPackagePin now rejects a "*" version outright as a second
line of defense. A plain redeploy never re-resolves an existing pin's
version; only a newly added or newly created pin does.
Documents resolvePinnedVersion and why every runtime pin this package
writes resolves to a concrete version rather than "*".
Covers the confirmed critique findings on the versioned-pins work: a PUT
that only edits name/prompt must never re-touch tool-package pins even
after a newer tarball lands; re-adding an already-pinned package via
guided capability-add must keep its stored version rather than silently
bumping; NonWildcardToolPackagePin must reject any non-exact version
(latest, ^1, ~1.2, >=1.0.0, 1.x, empty), not just "*"; resolvePinnedVersion
must prefer the highest stable version over a higher-sorting prerelease;
and a multi-pin create must share one registry lookup and tarball listing
across all of its pins instead of doing one round trip per pin.
- resolvePinnedVersion now prefers the highest STABLE published version;
  a prerelease only wins when the registry carries no stable version for
  the package at all.
- NonWildcardToolPackagePin now requires an exact semver.valid version,
  rejecting any range or tag ("*", "latest", "^1", "~1.2", ">=1.0.0",
  "1.x", empty) instead of just the literal "*".
- Guided capability-add re-adding a package already pinned on the
  definition keeps its existing stored version and skips registry
  resolution entirely, so a newer tarball landing in the registry never
  silently bumps an existing pin; the commit message no longer claims an
  add in that case. Resolution still happens for a genuinely new pin.
- createAgentDefinitionCore and guided capability-add now share one
  createPinnedVersionResolver per call, so a multi-pin create pays for
  one registry-asset lookup and one tarball listing total, not one per
  pin.
Documents the exact-version narrowing, the stable-over-prerelease
preference, the shared per-call registry resolver, and that both a plain
redeploy and a re-add of an already-pinned package leave the stored pin
version untouched.
@TheGreatAxios
TheGreatAxios merged commit 42b757c into main Sep 5, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant