Skip to content

Sessions record their definition reference #2549

Closed as not planned
Closed as not planned

Description

@ChrisJBurns

Depends on: #2547, #2548, #2526 (after #2529)
Removes shortcut: definition known by name only: named definitions sent with no source, system/main with no revision (#2475)
Related: #1796

Problem

Sessions do not store which definition revision they use, so registration cannot name the exact definition and a source edit could silently change a running agent.

Design

What

A session persists only its root definition's name (Session.AgentDefinitionName, engine/session/session.go). identityAgentDefinition (internal/adapter/server/identity_broker.go) sends a named definition with no source and system/main with no revision, and RegisterAgentRequest.Validate (internal/identitybroker/service.go) allows both.

  • Persist each session's definition reference (source, name, revision) for its main agent and each helper, and register with the exact reference.
  • Make source and revision required in RegisterAgentRequest.Validate and add the matching contract test cases.
  • Restoration rebuilds the registered revision or fails closed (agent-definitions.md, "Identity continuity across runs and restarts").
  • Send the built-in system/main with its revision; the default anonymous child uses system/explorer (agent-definitions.md, "Loading definitions").
  • Decide, on the harness side, whether the harness can rebuild a built-in definition from an earlier Mecatl release, whose revision is no longer shipped; if it cannot, restoration fails closed. Minimal definition loader, including built-in definitions #2526 loads only the current release's built-ins. The broker side is open (D4, asked on Per-agent registration and identities, switched on #2527): whether step (4) check 3, which requires a loaded revision, also applies on re-registration. Until Durable broker state and recovery #2563 persists broker state, an upgrade's restart drops the stored record anyway, so re-registration is a first registration.

Assess stored-data compatibility: existing sessions have no reference.

How it fits

Registration names the exact definition, and a source edit cannot silently change a running agent.

Done when

New sessions persist and register with their exact reference; restoration fails closed when the revision cannot be rebuilt; existing sessions have documented upgrade behavior.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions