The Dual Identity Problem for Agent Tasks

Scheduled agent tasks, like those managed by systems such as APC (Agent Portable Context) and APX (Agent Portable Runtime), require two distinct forms of identification. One is for human interaction – a descriptive name like daily-review or report-generation. This is the label users see, use in commands, and generally associate with the task's purpose. The other is a persistent, machine-readable identifier that underpins the task's runtime state, including its history and operational context. Treating these two as one and the same leads to a subtle but critical failure mode: when a routine's display name is edited, its historical runtime state is silently and irrevocably detached, effectively becoming the problem of whoever is now responsible for that routine, even if the underlying task is identical.

This distinction is central to the design of systems like APX, which separates project facts (versioned rules, agent definitions, skills) residing in a portable context layer (APC) from the daily-use runtime and tooling layer (APX). APX is responsible for executing routines and managing their local operational state, critically keeping this state separate from the version-controlled repository. This division makes routine identity a specific concern of the APX runtime layer.

Display Names vs. Stable Runtime Identifiers

In APX, a routine record is engineered to possess both a human-readable name and a generated, stable id. The name serves as the primary means for a human user or the command-line interface (CLI) to locate and reference a routine. It's the friendly alias. However, this display name is mutable. Users might rename a routine for clarity, to align with project changes, or simply due to evolving organizational conventions. If the system were to use this mutable display name as the key for storing and retrieving runtime state, any edit to the name would break the link to the routine's past executions, logs, and configuration snapshots.

The generated id, conversely, is designed to be immutable. It acts as the true memory key for the routine's operational history. When a routine is created, APX generates a unique, persistent identifier. All runtime state – execution logs, scheduled runtimes, error reports, and any other stateful information – is associated with this id. This ensures that even if the human-readable name changes multiple times, the system can always reliably access the correct historical data by referencing the unchanging id.

Diagram illustrating the separation of human-readable routine names and stable runtime IDs.

The Silent Data Loss Scenario

Consider a scenario where a routine named data-ingest-v1 has been running for months, accumulating a rich history of successful and failed executions, performance metrics, and detailed logs. This history is crucial for auditing, debugging, and performance analysis. Now, the team decides to rename the routine to ingest-customer-data to better reflect its function. If the system uses the display name as the primary key for state management, renaming data-ingest-v1 to ingest-customer-data would cause the system to lose the association with all the historical data previously linked to data-ingest-v1. A new, empty history would begin for ingest-customer-data. The old data wouldn't be deleted, but it would become orphaned – inaccessible through the new name and no longer associated with the routine that generated it. This is not a crash; it's a silent corruption of the task's operational memory.

This problem is particularly insidious because it doesn't manifest as an immediate error. The routine with the new name will likely start executing correctly. The failure lies in the loss of continuity and historical context. For teams relying on this history, it's as if the routine started fresh, making it impossible to trace performance regressions, understand past failure patterns, or perform historical analysis. The problem becomes someone else's if the responsibility for the routine shifts, as they inherit a seemingly new task with no prior context.

Architectural Implications and Best Practices

The architectural decision to decouple display names from memory keys is fundamental for building robust, stateful agent systems. It mirrors best practices seen in other domains, such as database primary keys or object storage identifiers, where the identifier is distinct from any human-assigned metadata. For developers working with such systems, understanding this distinction is paramount.

When interacting with routines, it is crucial to use the stable id for any operation that requires referencing historical state. This means that CLI commands for querying history, logs, or performance metrics should ideally accept or default to using the id. Developers building integrations or custom tooling around these agent systems must also respect this separation. Any persistence layer or state tracking mechanism should be keyed by the generated id, not the user-editable name.

The challenge for users lies in managing this dual identity. Tools and CLIs need to provide clear ways to discover both the human-readable name and the stable ID, and to use the ID when continuity matters. The APX approach, by explicitly separating these concerns into the portable context (APC) for definitions and the runtime (APX) for state, provides a clean separation of concerns. This allows for flexible naming conventions without compromising the integrity of the task's operational memory.

What nobody has adequately addressed yet is how to gracefully migrate existing systems or datasets that may have inadvertently conflated routine names with their memory keys. For teams adopting or building on these agent frameworks, the principle is simple: treat the name as a label and the ID as the actual identity. Anything less risks silent data loss and a broken historical record.