Repository navigation
feat(task): a registered task records the plugin packages it requires, and task run checks them first - #383
earakely-scale wants to merge 5 commits into
Conversation
…, and task run checks them first bundle register records on each task the plugin packages behind its own step types and the types of the bundle entities it references, in the range bundle.toml gives a package it requires, else at least the installed version (Task.requires, saved only when there are some). The ledger hashes them, so a new range writes the task anew. Before a stored task's first step, task run and run-batch refuse one whose requirements aren't met, or whose steps read an env or artifact of a type nothing here registers, offering in a terminal to install what it requires with agent-env plugin add. In local stores they then set up the infra envs the task's gateway deploys run on, as agent-env run does. A step type nothing registers names the task's unmet requirements and the command that installs them wherever a stored task is loaded. A task stored without requires loads and runs as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s them A resumed run (--start-step) no longer reads what the steps it skips reference, and a step the run gives step_params, which it reads in place of what it names, isn't checked against its stored references. The infra envs follow the run's env state overrides, so an external state needs no service-db and an attached instance's own type decides. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A step's step_params that name one of its fields referencing a kind replace what it reads of that kind, so only those references are left to it; overrides that leave its references as stored, such as a load_artifact destination_path, still have them checked before the run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@greptileai review |
E2E + chaos verification (badb9a5)These ran on a fresh agent-environments-admin VM for each of 53d92ee, d19e6f9, 29bc743 and badb9a5, each torn down after: Ubuntu 24.04, m5.2xlarge, Docker 28, uv 0.10. The wheel came from this branch. Every environment shared one local store. The environments were:
On badb9a5 there were 55 cases, all as designed, and all 52 shared with the 29bc743 round gave the same result. Registered with what it requires
Fresh local store:
Without the plugin: refused before anything starts
Stored records it can't trust (badb9a5)
Chaos
Leftovers: only the local registry container; the secret scan of the results is clean. Found and fixed along the way:
The first round's "core task" was an empty task, which 🤖 Generated with Claude Code |
… when missing, and imports keep recorded ranges A stored requires entry that isn't a pip requirement, or holds a character a terminal wouldn't show as it is, is named as unmet and never offered for install, where it used to crash the load. task run sets up only the infra envs a local store doesn't hold, leaving one it holds for agent-env up or run to rebuild. Each entity the steps reference is read once however many name it. bundle init --from-task writes the ranges the stored task records. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ined DeployEnvTaskStep.run_state is the one place a deploy's env state comes from, for its run, preflight and task run's checks; the gateway and service-db override keys are constants beside run_env_ids. Setting up only missing infra is ensure_default_envs(missing_only=True), decided with its other rules under the same lock. run-batch checks the task with the metadata it runs with. The checks use EntityRef.field, and the bundle and stored-task prompt tests share one terminal helper. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Summary
The store side of
bundle.toml(the folder side was #377). A task shared through a store now says which plugin packages it needs, andagent-env task runchecks them before anything starts.Task.requires: an optional field, saved with the task's document only when it has entries, so every task stored before this, and every task using only core types, is unchanged.bundle register, per task: the packages behind the task's own step types and behind the types of the bundle entities it references (envs, artifacts, skills), not the whole bundle's list. A packagebundle.tomlrequires keeps the range written there; otherwise the detected floor (>=the installed version). The ledger hashesrequires, so changing a range inbundle.tomlwrites only the affected tasks anew (requires agentenv-acme>=1.1,<2as the reason).task run/run-batch, before the first step:agent-env plugin addcommand that installs them; at a terminal it offers to run it and then runs the command again (asagent-env rundoes since feat(bundle): a bundle.toml names the plugin packages a bundle requires #377);--start-stepon, and without the references a step'sstep_paramsreplace. An entity the store doesn't hold, or whose id the run fills in from a seed, is left to its step, as today;--env-state-type/--env-state-instance-id, except for one the run is given (--gateway-env-id,--service-db-env-id). An infra env the store holds is left foragent-env up/runto rebuild. Shared stores are unchanged.Unknown task step type: acme_check; task reg-check v1: requires 'agentenv-acme>=1.2.0', which isn't installed; install it with: agent-env plugin add 'agentenv-acme>=1.2.0'.plugin add, as for bundles. A stored entry that isn't a pip requirement, or holds a character a terminal wouldn't show as it is, is named as unmet and never offered.bundle init --from-taskwrites the ranges the stored task records.The hub rebuilds a task from its id and steps when saving a new version, so a hub edit drops
requiresuntil the hub passes it through; hub workers have every Scale plugin installed, so hub runs aren't affected.Review guide
task/task.py: the field, andUnknownStepTypeErrorcarrying the unmet requirements.plugins/_requirements.py:unmet_problems/install_commandmoved here frombundle/requires.py, with an owner (bundle.toml, ortask <id> v<n>), so a task can say the same thing without the bundle package.bundle/register.py:with_task_requires;bundle/requires.py:entry_uses, anddetectedtaking the declared lines.bundle/plan.py/ledger.py/materialize.py:Write.requirescarried, hashed and stored.cli/task/_checks.py: whattask runchecks;bundle/preflight.py:stored_infra, factored out of the walk's gateway logic.Test plan
make linttask runrefusal before the run,run-batch, the prompt, the agent-env-itself case, entities left to their step, and infra set up in local stores only, but for those the run is given;stored_infra🤖 Generated with Claude Code


Confidence Score: 5/5
The changes since the previous review appear safe to merge.Summary
Stored tasks now record their required plugin packages, and task commands check those packages before starting.
All three supplied previous threads were unnumbered, so they receive no numbered finding entries.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Register bundle] --> B[Record each task's plugin requirements] B --> C[Save task and hash requirements] C --> D[Run stored task] D --> E{Requirements and referenced types available?} E -- No --> F[Refuse run and explain missing packages] E -- Yes --> G[Set up missing local infrastructure] G --> H[Submit run]Reviews (5) · Last reviewed commit: "fix(task): stored requires are read defe..." · Reviewed by Greptile