factory.yaml, board-driven
runs) is a different product with its own CLI, architech factory.
mutagent factory does four jobs: register entries, update their specs, record stage runs, and read
them back. Reports are pushed with mutagent reports push.
- An entry’s id is its agentspec’s
metadata.id. Every command addresses the entry by that id:mutagent factory show invoice-pricing. - The spec decides the rest: the entry’s kind (
Agent,Skill,MultiAgentorWorkflow), its deployment targets (the spec’stargets[]), and, for a multi-agent system, its components (spec.multiAgent.members[]). To change any of them, edit the spec and push it. - A spec version is one recorded version of the agentspec:
1,2, and so on. - A build is one deployed package of an entry with a Mutagent Cloud target, linked to the spec version it implements. Other targets ship by pull request.
- A stage run is one run of one lifecycle stage against an entry, with an id that starts with
sr_. The stages arespec,build,evaluate,diagnose,optimizeandship; the states arestarted,succeeded,failedandcancelled.
MUTAGENT_API_KEY=<key> mutagent login --json for a coding agent), and select the workspace with
mutagent workspaces use <workspace-name>. Writes (add, spec push, stage start, stage finish,
stage record) need the editor or admin role. Every command takes --json and then prints one result
object on stdout.
Reads run freely. add, spec push, stage start, stage finish and stage record change shared
workspace data: a coding agent confirms with the person before it runs one. delete also needs
--force.
A worked example
Register an agent from its spec, record an evaluation against it, and attach the report.addvalidates the agentspec on your machine, then registers the entry. Its id is the spec’smetadata.id; the git remote, path and commit are read from the file’s checkout.stage startopens a stage run and prints its id (sr_…). Keep it:stage finishtakes it.reports push --stage-runattaches the evaluation report to that run. The report inherits the run’s entry, spec version and build.stage finishcloses the run with its outcome. Only the run’s owner can finish it.
spec status prints the state and, in next, the exact command that brings the file and the
platform in sync.
On your machine and in a cloud sandbox
The same commands run in both places.- On your machine you sign in with your key and pass the ids. Where a command takes an entry
id, it defaults to the entry this checkout’s
.mutagent/factory.jsonlinks; with no id and no link, it fails withMISSING_ARGUMENTS. A run id has no default on your machine. - In a cloud sandbox the CLI signs in with the sandbox’s own token (
MUTAGENT_SANDBOX_TOKEN); no API key goes into the sandbox. When the session was launched for a Factory entry (for example withmutagent helix agent … --subject <id> --stage <stage>), the platform opens the stage run before the session starts and sets these variables:
So inside such a sandbox,
mutagent factory stage finish --state succeeded needs no id. Without the
variables, the platform resolves the bound entry and the open run from the session itself.
What a sandbox may do is decided by the platform from the entry, the stage it was launched for, and
the entry’s settings in the web app. There is no flag that widens it. A sandbox may write the entry it
is bound to. add in a sandbox registers the entry without binding the session; an unbound session
links to an entry when it starts or records a stage run on it. Anything else is refused with
SANDBOX_SCOPE, which names the scope and the bound entry. Archiving (delete) is never allowed in a
sandbox.
mutagent factory list
List the workspace’s Factory entries, newest first.mutagent factory ls is the same command.
With
--json: { entries, count, nextCursor, next? }. Run next for the following page. An
unknown cursor is INVALID_CURSOR: list again from the start. A server too old for --remote
answers FILTER_UNSUPPORTED: list without it and match git.remote yourself.
mutagent factory show
One entry: its targets, the git location of its spec, the current spec version and build, its components, and the last run of each stage.
An unknown id is
ENTRY_NOT_FOUND: find ids with mutagent factory list --json.
mutagent factory add
Register a Factory entry from its agentspec. The id, kind, components and targets come from the spec.
The spec is validated on your machine (AgentSpec 0.3.0) before anything is sent. For a multi-agent
system, each
spec.multiAgent.members[].specRef file is read for its metadata.id, relative to the
spec file’s folder (for stdin and --spec: the working directory). Every member must already be an
entry; otherwise COMPONENT_NOT_FOUND, and you add the member first. When the spec sets
spec.traceSource, it is then set on the entry; if that step is refused, traceSourceUpdate names
the code and the entry stays registered.
mutagent factory delete
Archive an entry. Its spec versions, builds, stage runs and reports stay readable.mutagent factory rm is the same command.
-f, --force is required in every mode, --json included. Without it the command exits 1 with
CONFIRMATION_REQUIRED and sends nothing; a coding agent confirms with the person before adding
--force. Archiving an entry that is already archived, or that does not exist, succeeds.
ENTRY_IN_USE means a multi-agent system still lists the entry as a component: push the system’s
spec without it first.
mutagent factory activity
An entry’s history, newest first: spec pushes, builds, stage runs and reports.In these commands
m is not minutes. A bare <n>m, such as 10m, is refused with
VALIDATION_ERROR and the fix Use 10min for minutes or 10d for days; nothing is sent. Write
minutes as min (10min, 30min) and days as d.mutagent factory builds
An entry’s builds, each with the spec version it implements and where it is deployed.--limit and --cursor. Only entries with a Mutagent Cloud target (a targets[] item of type
platform named mutagent) have builds; mutagent agent deploy
creates them. Other targets ship by pull request, and NO_BUILDS_FOR_TARGET points you to
mutagent factory spec versions <id>.
mutagent factory spec
Spec versions:versions, get, status and push. There is no pull: spec get --out writes the
file.
mutagent factory spec versions
An entry’s spec versions, with the digest, author, git commit and the newest build that implements each.--limit and --cursor. Pass a version number to spec get --version <n>.
mutagent factory spec get
Print one spec version, or write it to a file.
Without
--force, an existing file is FILE_EXISTS and nothing is written. Never overwrite a file
that has local edits: write to a temporary path and merge. An unknown version is
VERSION_NOT_FOUND: list them with spec versions.
mutagent factory spec status
Compare a local agentspec with the platform and print the command that fixes any difference.
The base is the version this checkout last wrote with
spec get --out or pushed; it is kept in
.mutagent/factory.json.
mutagent factory spec push
Validate an agentspec and record it as the entry’s next spec version.
The components (
spec.multiAgent.members[]), their pins and the targets[] update from the spec; the
git location comes from the checkout. A push never overwrites a newer platform version: if the
platform moved past your base, the push is refused with SPEC_PUSH_STALE and nothing is written.
A changed spec.traceSource is then set on the entry; a refusal of that step is reported in
traceSourceUpdate, and the push stands.
mutagent factory stage
Stage runs:start, finish, record, list and show. Only a run’s owner can finish it. In a
cloud sandbox launched for a stage, the run is already open: finish it, do not start another.
The build a run was made against is described by three flags, shared by stage start,
stage record and reports push:
mutagent factory stage start
Open a stage run on an entry. It prints the run id thatstage finish takes.
Plus the build flags above. In a sandbox launched for a stage,
stage start is refused with
STAGE_RUN_ALREADY_OPEN: finish the open run instead (its id is in the error and in
MUTAGENT_STAGE_RUN_ID).
mutagent factory stage finish
Close a stage run with its outcome.
In a cloud sandbox, the session counts as done only once its stage run is finished.
mutagent factory stage record
Record a stage that already finished, in one call.
Plus the build flags above. On your machine nothing defaults: pass
--build-target and --build-rev
only when a build ran; otherwise leave both out. Shipping to a code repository is recorded this way once the pull request is merged.
mutagent factory stage list
An entry’s stage runs, newest first.mutagent factory stage ls is the same command.
mutagent factory stage show
One stage run, with its reports, findings, owner and session.<run-id> defaults to the open run.
If it fails
On any other error, run the command in
suggestedAction once; do not retry blind. Every command’s
--help lists its errors with the fix for each. See CLI errors.