Skip to content

Overlay link can be repointed between bundles by a /runs leaf and a /v1/turn turn of the same session #459

Open

Description

@pdettori

Follow-up from the review of #458 (ADR-0038), comment #458 (comment).

Problem

The sandbox overlay for a promoted config bundle binds one link per session: /workspace/leaves/<sid>/.sh-config (harness/src/config-overlay.ts, buildLeafBindScript, ln -sfn). The link path does not include the digest.

A control-plane session id is also its leafSessionId, so a /runs leaf and a /v1/turn turn of the same session share that link on a shared pod. They can name different bundles:

  • /v1/turn takes configRef from the control-plane exchange (the session's recorded bundle).
  • An authenticated /runs still takes configRef from the request body (packages/knative-server/src/server.ts; only /v1/turn overrides it from the exchange).

Sequence:

  1. A /v1/turn turn with digest B is running; the link points at B's cache.
  2. The same principal dispatches a /runs leaf for that session with digest A. Its bind runs ln -sfn and repoints the shared link to A.
  3. The leaf ends. feat: promote config bundles through the control plane from mocactl (ADR-0038) #458 already keeps the link while the turn's ref is live, but A's refs are now empty, so A's cache is removed.
  4. The live turn's link dangles, and its tools run without their skills: the "plausible but unconfigured" failure spec §4.4 exists to prevent.

#458 fixed the other half of the review comment: cleanup no longer removes the link from under a live ref, in either mode.

Scope

Only the session's own principal can trigger this; another tenant cannot. It needs a /runs and a /v1/turn of one session at the same time with different bundles.

Options

  • Put the digest in the link path (e.g. /workspace/leaves/<sid>/.sh-config/<digest-dir>), so two bundles never share a link. The injected "Skill files:" note already carries the absolute path per turn.
  • Or make an authenticated /runs take configRef from the exchange as /v1/turn does, so one session can only ever name one bundle.

The second also closes the related gap that an authenticated /runs can name any digest, whatever the session recorded.

Activity

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