ReportAIMESSOFT-TR-2026-01Nov 19, 2026
Mechanism in the Host, Judgment in the Agent
Building and Operating an Agent-Operated Media Library

As language-model agents emerge as a new human-computer interaction paradigm, software is shifting from direct-manipulation interfaces toward intent-driven systems. Opening an application to an agent immediately raises an architectural question: which logic belongs in deterministic host code, and which judgments should be left to the agent?
Most evidence on this so far comes from coding agents or synthetic environments. To study it in a real application, we have been building NipaPlay Next since October 2026—a second mode of our open-source anime player NipaPlay in which an agent named Rika operates the media library for the user, handling file identification, episode binding, metadata completion, downloading, playback, and library maintenance. The UI and Rika share a single capability layer of 339 actions. A desktop or headless machine runs Rika, while phones, tablets, and TVs run the app without a local agent; Rika reads their state and triggers playback remotely.
A personal media library exhibits two characteristics that stress this boundary. First, it requires judgment: public anime catalogues (TMDB, Bangumi) and release groups routinely disagree on seasons, specials, and episode numbering. Second, it is slow: downloads take hours and new episodes air weekly, so state changes arrive long after an action is initiated. Based on 57 rounds of end-to-end sessions and controlled experiments, we documented the system, formal model, and measurements in technical report AIMESSOFT-TR-2026-01. This post summarizes the core results.
Drawing the line between host and agent
We model the interaction between the application and the agent as a closed loop over a library state space $W$. The application (the host) defines an interface $H = (O, A, o, e)$: an observation channel $o : W \to O$ that exposes part of the state, and an effect channel $e$ that applies actions and updates state. The host is ordinary deterministic code and owns $W$, $o$, and $e$.
Between observation and effect sits Rika’s policy $\pi_\theta : O \to A$. The policy is stochastic and outside the host’s control; it shifts whenever the model, runtime, harness seed (initial instructions and tools), or user preferences change.
On this loop, our placement criterion is straightforward: a component belongs in the host if and only if the reason for having it holds for every policy $\pi$, and it provides a guarantee that downstream tasks rely on.
This restates Saltzer, Reed, and Clark’s end-to-end argument for an agent at the endpoint. Two things change when the endpoint is a stochastic, improving model. First, “implement it completely and correctly” becomes “justify it independently of which agent is running.” Second, an incomplete heuristic in the host that helps a weaker model can flip into a net cost as $\pi_\theta$ improves. Recording who started a download is useful regardless of the agent, so it belongs in the host; guessing which episode a file represents only helps agents weaker than the rule, so it is a judgment that belongs with the agent or the user.
Missing fields create an error floor no model can beat
In an early session, Rika cancelled a download that the user had added manually. Checking the logs showed why: download tasks did not record who created them. Once the host attached provenance to each task, she distinguished them immediately and told the user, “you added this one.”
This is not a prompting problem; it is an information-theoretic floor. Take two states $w, w' \in W$ that call for different actions, with host observations $o_w$ and $o_{w'}$. By Le Cam’s two-point bound, for every policy $\pi$:
where $\mathrm{TV}$ is total variation distance. When the host presents identical observations in both states ($\mathrm{TV} = 0$), any agent’s combined error rate across the pair is at least $1$. And if the read interface as a whole merges the two states, re-prompting or rephrasing cannot get around it.
We tested this across three such state pairs with two models. With the deciding field missing, error rates summed to at least $1$ for every model and pair. Restoring the field brought accuracy to $58/60$ and $53/60$. When an agent makes a seemingly obvious mistake, the culprit is often a deciding fact the host never exposed.
When helpful host rules get in the way
Early builds of NipaPlay included a hash-based episode matcher meant to identify files automatically. Once Rika was running, the matcher ran after her and silently overwrote episodes she had already bound. Rika noticed the state drift and redid the bindings—spending an extra 205 seconds in one session and 90 seconds in another just fighting the host.
Having a heuristic rule $g$ in the host does not mean locking in its verdict. There are three ways to place a rule:
- Omission: leave $g$ out and expose only the raw observation $o$.
- Annotation: show the rule’s guess alongside the facts with a label ($o \oplus g$).
- Substitution: overwrite the facts or commit the verdict directly ($g \circ o$).
Information-theoretically, annotation is lossless, while substitution is a Blackwell garbling—and the only placement whose value can drop below omission once the agent is more accurate than the rule.
To measure this directly, we took a single numbering rule accurate on $6/12$ tasks and tested 3 GPT models across 7 placements and 12 tasks (10 runs per condition). Without the rule, all three models scored $12/12$. Told to apply it, scores fell to $0.50\text{–}0.65$. Shown the rule’s guess as a labelled candidate, or asked to review host-written bindings, all three stayed at the $12/12$ ceiling.
When catalogues disagree, compute where agreement ends
Anime metadata comes from sources that do not agree with each other: TMDB, Bangumi, and release-group file names. Across 490 files from one season, 70 files (14%) mapped to two or more valid TMDB identities depending on how the sources were read. One short series got bound to a show’s TMDB specials in two sessions and to a standalone Bangumi entry in a third—each defensible on its own.
Whether several sources can be merged into one numbering is computable. Modeling the sources and their episode correspondences as an atlas $\mathcal{A}$, a global numbering exists if and only if every closed walk $\gamma$ around the sources returns to its starting episode—say, from a TMDB episode to a release file, to Bangumi, and back to TMDB (cycle consistency, or trivial holonomy).
That gives a clean split of labor. When every loop closes, identity is fixed by the sources and the host computes it directly. When a loop fails to close, no single convention satisfies every source, and no policy can be right for all conventions at once. The host computes the candidate set and the conflicting loop, hands them to the agent or user, and stores the chosen binding once so every device reads the same record.
Long waits: delivery latency and what a host can truthfully say
Hours-long downloads and weekly episodes bring time into the observation channel, surfacing two practical issues.
The first is delivery latency. When updates went out in 600-second batches, nine episodes took $261.6\,\text{s}$ on average from download completion to episode binding ($324.7\,\text{s}$ for the seven episodes that waited on a batch boundary). Assigning a watcher sub-agent cut the mean to $22.7\,\text{s}$. Delivering completion events directly into Rika’s active turn via a blocking download.wait_files call brought it down to $7.0\,\text{s}$—over 37× faster than coarse batching.
The second is what a host can assert in finite time. A background script Rika wrote to monitor new episodes hit a torrent whose peers all disappeared and waited forever. On the space of timed event traces, “this download is dead” is a closed set with empty interior: it can be refuted if peers return, but never confirmed in finite time. By contrast, “no progress for $300\,\text{s}$” is clopen—decidable by a host with a clock. So the host emits a stall event carrying the elapsed silence duration and leaves the verdict to the agent.
Measuring stall events also turned up a real bug in the headless backend: it never recorded the timestamp of the last progress, so a source stalled for 900 seconds never emitted an event. After fixing it and setting a 60-second test threshold, the stall event fired at $60.1\,\text{s}$.
What else is in the report
The full 90-page report AIMESSOFT-TR-2026-01 documents nine empirical findings across 57 end-to-end rounds. Beyond rule conflicts, observation floors, multi-source consistency, and delivery latency, it covers several recurring operational issues:
- Silent failures in agent-written scripts: letting an agent write background scripts automates tedious monitoring, but without host-level liveness and timeout signals they hang quietly.
- Bidirectional isolation leaks: local files, caches, and cross-session state crossed intended isolation boundaries from both the host and agent sides.
- No universal rule for delegation or prompt length: whether sub-agent parallelism helps depends on the runtime and user preference, and trimming the harness instruction file shorter is not uniformly better.
Section 3 develops the full formal model and proofs (host-agent loop, rule placement orderings, atlas gluing, and observable topology), and Sections 4–6 detail the NipaPlay Next architecture and measurements. The source code and initial harness seed are public on GitHub; the run registry and measurement scripts will follow on this site.
Citation
Sakiko Shinokawa, aozaoz112233 and MCDFsteve. Mechanism in the Host, Judgment in the Agent: Building and Operating an Agent-Operated Media Library. Technical report AIMESSOFT-TR-2026-01, AimesSoft, November 2026. doi:10.5281/zenodo.24364872
@techreport{shinokawa2026mechanism,
title = {Mechanism in the Host, Judgment in the Agent:
Building and Operating an Agent-Operated Media Library},
author = {Shinokawa, Sakiko and {aozaoz112233}
and {MCDFsteve}},
institution = {AimesSoft},
number = {AIMESSOFT-TR-2026-01},
year = {2026},
month = nov,
doi = {10.5281/zenodo.24364872}
}Files
- Report, PDF, 90 pages
- Source code, code and releases of NipaPlay
- Run registry and measurement scripts: will be published here.