Phase 1: Foundational Changes - The New Agent Identifier (Unchanged)
Examples: /protocol/database/postgres_query/v1.0 /protocol/networking/smb_put/v1.1 /ai/text_completion/ollama_generate/v2.0 /data/string/regex_extractor/v1.0
Example config.json snippet: { "agents": { "/protocol/database/postgres_query/v1.0": { ... }, "/protocol/database/postgres_query/v1.1": { ... }, "/protocol/database/postgres_query/v2.0": { ... } } }
CLI: The command-line argument for the agent name must now accept the full path-like identifier.exec_agent: No changes needed. It already accepts the full agent name.Workflow Steps: Steps in a workflow will now store the full, specific versioned identifier (e.g., /protocol/database/postgres_query/v1.1). This "pins" the workflow to a specific, stable version, which is crucial for reliability.
Phase 2: IDE User Interface Overhaul (Revised)
Modify _on_agent_drag_start: When a user drags any version of an agent (e.g., /protocol/database/postgres_query/v1.1), the drag payload will be the agent'sbase name (e.g., /protocol/database/postgres_query).Modify _on_drop: When the drop occurs:The IDE will find all available MAJOR versions for that base name (e.g., v1, v2). It will display a small, modal dialog under the mouse pointer with buttons for each Major version: [v1], [v2]. When the user clicks a version (e.g., v1), the IDE finds the latest MINOR version within that major branch (e.g., v1.1 is chosen over v1.0).A new step is inserted into the workflow, pinned to that specific latest minor version (.../postgres_query/v1.1).
2.2.5. The "Interface-Aware" Editor and "Never Overwrite" Save Logic:
On Editor Load: The editor still creates the initial_interface snapshot.On Save (save_agent in ui_app_shell.py): Get current form data and compare its interface to the initial_interface snapshot. If a breaking change is detected: a. Force a Major Version Bump: Calculate the new identifier by incrementing MAJOR and resetting MINOR to 0 (e.g., .../v1.1 -> .../v2.0).b. Notify and Save: Inform the user that a new MAJOR version is being created. Save the changes as anew agent under the new identifier. The original agent is untouched.If no breaking change is detected: a. Force a Minor Version Bump: Calculate the new identifier by incrementing MINOR (e.g., .../v1.1 -> .../v1.2).b. Notify and Save: Inform the user that a new MINOR version is being created. Save the changes as anew agent under the new identifier. The original agent is untouched.
Result: Every single save action that modifies an agent's logic or interface results in anew, immutable agent definition being added to the config.json. The history is automatically preserved.
"Version" Dropdown: In the Step Editor, for any step using a versioned agent, add a new dropdown field labeled "Version".Populate Dropdown: This dropdown will be populated with all available versions of the same agent (e.g., v1.0, v1.1, v2.0).Behavior: When a user changes the version, the Step Editor should immediately refresh, showing the correct inputs for the newly selected version and using the existing "orphaned parameter" UI to flag any incompatibilities.
2.3.5. Step Editor (ui_step_editor.py) Enhancement (Revised):
"Version" Dropdown: This dropdown is now even more critical.Populate Dropdown: It will be populated with all available versions of the agent, PLUS the special @latest option for each major version (e.g., v1.0, v1.1, v1.2, v1@latest, v2.0, v2@latest).Behavior: The user can explicitly pin a workflow step to a specific version (v1.1) for absolute stability, or they can choose a "floating" reference (v1@latest) to automatically get the newest non-breaking updates for that major version branch.
Action: Remove the manual "Create New Version" buttons. The save_agent function in ui_app_shell.py will now handle versioning automatically and intelligently.On Editor Load: The editor creates an in-memory snapshot of the agent's interface (inputs, optional_inputs, outputs).On Save: The IDE compares the current state of the interface fields to the initial snapshot. If a breaking change is detected (any difference in the input or output interface, or deleting an optional input, but you are free to add optional inputs):a. Force a Major Version Bump: A new agent identifier is calculated by incrementing the MAJOR version (e.g., .../v1.1 -> .../v2.0).b. Notify A floating dialog informs the user that the save increased the major version number.c. The changes are saved as a new agent under the new identifier.If no breaking change is detected: a. create a new MINOR version (e.g., .../v1.1 -> .../v1.2). b. The changes are saved according to the user's choice.
c. A floating dialog announces a save with a minor version update.
To keep from having hundreds of versions of every agent with every little change we can create a policy that only keeps a specific number of minor agent versions of each major version. This would not delete any agents that are specifically named in a step with that exact minor version.
Phase 3: Deployment Tooling
Purpose: To take a development config.json and "prune" it to create a lean, production-ready config.release.json.Command-Line Interface: python deployment_tool.py --source config.dev.json --output config.prod.json --service public_api
Input: Takes a source config file path and an optional --service <tag> argument.Agent Discovery: It first finds all agents that match the --service tag. It then recursively scans the steps of these entry-point workflows to discover every single agent version that is actually used by that service.
Pruning Process: It creates a new, empty config dictionary. It copies over only the agents that were found in the dependency graph. For each agent it copies, it strips out development-only keys : run_config and gui.
Output: Writes the new, pruned config.release.json file.
No comments:
Post a Comment