A recurring agent job rarely stays one file for long.
One of mine started as a useful script and eventually depended on a scheduler entry, a model choice, a target host, a systemd timer, environment files, deployment paths, and a verification command. Each piece worked, but the workload itself did not have a clear boundary. To understand what the job actually required, I had to reconstruct it from several parts of the repo and whatever happened to be deployed on the machine.
That became more noticeable as I added more scheduled and queue-backed work to my homelab. The scheduler knew when something ran. A script knew what code to execute. A worker knew how to process a queue. None of them owned the complete operational contract.
I ended up treating the workload itself as something that should be packaged.
A scheduler row is not the workload
Jarvis is the scheduler and runtime layer I use for much of this automation. It keeps schedules, managed agents, workers, and the surrounding execution machinery running.
The problem was not Jarvis. The problem was using the scheduler registry as the ownership boundary.
A row that says a job runs every five minutes on a particular host can tell me when and where the scheduler expects to invoke it. It cannot tell me which files belong to the workload, which runtime assumptions have to be true on the target, what model it expects, how it should be deployed, or how to verify the deployed state afterward.
Those details were spread across scripts, prompts, systemd units, host configuration, and documentation. They could all change independently.
So I built agent-loops/ around a smaller idea: the repository should contain a versioned package that describes the workload as an operational unit.
Each package lives under agent-loops/packages/<loop-id>/. Its loop.json manifest is the contract, and the package owns the scripts, prompts, static files, and service definitions needed to run it.
The schema requires the workload to declare five things explicitly: routing, placement, schedule, runtime, and observability. It can also declare its model choice, deployment requirements, secret dependencies, package files, and verification commands.
That gives me something the scheduler entry never did. I can review one package and understand what has to be true for that workload to exist.
What a workload package looks like
One current package classifies mail with a small local model. The real manifest contains deployment and compatibility detail as well, but the operational shape looks roughly like this:
id: mail-classify
version: 0.1.0
routing:
lane: L5
reasoning: simple
duration: short
locality: local-only
placement:
host: jarvis-synth
target: lxc
schedule:
type: cron
cron: "*/5 * * * *"
runtime:
kind: shell
executable: /usr/bin/python3
script: /opt/jarvis-mail/mail-classifier.py
model:
choice: Qwen3-1.7B-Q8_0
observability:
ledger: true
board: true
There is nothing especially novel about the individual fields. The useful part is that they move together.
If the script changes, its deployment destination and verification remain part of the same review surface. If the runtime moves to another kind of worker, the workload definition changes with it. If the scheduler configuration drifts from the package, compatibility checks can fail instead of leaving two competing descriptions of the same job.
The package is not the running process. It is the durable description of the work that the runtime has to satisfy.
This connects directly to placement
In From Model Routing to Workload Placement, I separated where a task executes from where its inference requests are served. That came from operating the same workloads across a laptop, homelab workers, local model servers, and approved cloud paths.
Placement Profiles pushed the boundary further. A workload should be able to describe what it requires without baking the current topology into the request. The placement layer can then decide which available target satisfies those requirements.
The loop package is where those requirements can become part of a versioned artifact rather than another convention hidden in a caller.
My current implementation is not all the way there yet. placement.host still names a concrete host, as the example above does. That is useful for the workloads I operate today, but it also means the package still carries part of the route.
I see that as a transitional boundary rather than something to hide. The package format gave the workload a stable home first. The next separation is between the durable requirements the package owns and the concrete target the placement layer selects at runtime.
A future package might say that execution must remain private, needs Python and systemd, can tolerate a long queue, and requires a local inference path. The current topology could satisfy that on jarvis-synth; another scheduler could satisfy the same requirements somewhere else.
That is much easier to evolve once the workload already exists as a first-class object.
Packaging does not replace admission
There is another boundary that matters here.
Before deployment, agent-loop probes a target for operating system, init system, required commands, filesystem writability, privilege availability, and required secret presence. A deployable package also has to define at least one verification command, which runs against the target after the files are installed.
Those checks answer whether the target can support the package and whether the deployed artifact is valid. They do not answer whether the target has enough runtime capacity to start the work now.
That distinction is the same one I explored in Admission Control for AI Workloads. A host can satisfy the workload's static requirements and still be the wrong place to start another model, allocate another workspace, or consume another queue slot at that moment.
Packaging gives admission a better object to reason about. It does not provide the capacity claim itself.
The sequence I am converging on is closer to this:
workload package
|
v
routing requirements
|
v
eligible placement targets
|
v
readiness + admission
|
v
runtime execution
|
v
verification + observability
The package survives each of those decisions. The selected host, model process, queue slot, or worker may not.
Jarvis becomes an adapter
The part of this design I care about most is that loop.json is not meant to describe a "Jarvis package."
Jarvis is simply the current live adapter. Compatibility metadata links packages back to jarvis/schedules.json, managed-agent definitions, and the systemd or launchd artifacts that already exist. The compatibility checker fails when those live definitions drift from the package.
Jarvis-specific detail stays at that adapter boundary. The core manifest uses generic concepts such as placement, schedule, runtime, deployment, verification, and observability so another scheduler can eventually consume the same package boundaries.
That changes the direction of ownership. The scheduler no longer has to be the canonical description of the work just because it happens to execute it.
This is similar to a pattern I have relied on in infrastructure work for years. Runtime configuration is easier to replace when the durable intent lives somewhere above the runtime-specific representation. Otherwise every migration becomes an exercise in rediscovering assumptions from the thing being replaced.
The package is also a deployable artifact
The CLI can turn a loop package into a deterministic bundle containing the manifest and its declared package closure. The bundle records each member's size, mode, and SHA-256 digest, and verifies that closure before using it as a deployment source.
That matters because a workload package should mean more than a directory convention. If the package says it owns a script, prompt, service unit, or static file, the deployable artifact should contain exactly those things and be able to prove they arrived intact.
Deployment is still deliberately simple. The system resolves the target, probes its capabilities, renders what will change, applies the package-owned files, and runs verification. I do not need an always-on control plane just to make the package useful.
The Git repository remains the source of truth, and the live scheduler remains something I can compare against it.
Packaging makes the other boundaries easier to see
I originally built agent-loops/ because recurring jobs were becoming difficult to audit. The more interesting result is that packaging forced several concerns that had been mixed together into explicit fields.
Routing describes the class of work. Placement says where it currently runs. The runtime describes how it executes. Deployment states what the target must provide. Verification says how I know the installed package is usable. Observability says where the execution should show up.
Those concerns were already present when they were scattered across files. Giving the workload a package did not invent them. It made their boundaries visible enough to change independently.
That is also why the current hard-coded host does not bother me as much as it would have before. I can see exactly where that coupling lives now. Moving from a concrete host to a placement profile becomes a schema and scheduler problem instead of a repo-wide search for every place the hostname leaked.
The immediate payoff is less glamorous: when I change a recurring agent job, I can review one versioned unit, deploy what it owns, verify the target, and detect when Jarvis has drifted from it.
That is enough of a boundary to build the next layer on.