Import boot-partition models into the agent dir as pi #197
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "import-models-as-pi"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What this PR does
The boot-partition model import (
agent-provision) now writes the agent dir only aspi, the account that owns it. Root reads the staged files from the boot partition and hands their bytes to apiprocess: each model and sidecar is copied bypi(to a temporary name, then renamed, so the agent never reads a half-written model), theepisodesfolder is created bypi, and the episode archive is unpacked bypi. The archive is unpacked only into a plainepisodesfolder; anything else in its place leaves the archive on the card, and the models still import. Root still creates the agent dir itself when it is missing, under the root-owned/var/lib/kestrel, the waypi_dirdoes. This brings the script in line with "file work inside a pi-owned directory runs as pi".New
tests/test_agent_provision.pyruns the real script off-device, with arunuserstand-in that records what ran aspi: models and episodes import throughpi, a linkedepisodesfolder is refused, a model that can't be copied stays staged, and the script has no rootinstall -o pi,chown,mkdirortar -x. All four fail against the old script.Checklist
bash -nand the real-data check pass).test_root_writes.pypass; the full suite passes apart from the 5 potfile-import tests intest_web.pythat fail locally on main too (local werkzeug). The Test workflow runs it on the PR.docs/user-guide/boot-partition-provisioning.mdsays the history is unpacked bypiand stays on the card if it can't be.Release impact
agent-provision.shis already in the engine'sLIB_SCRIPTS; the rest is a test and a doc.Notes for review
Nothing else changes for the operator: the same files on the card, the same one-shot import, the same choice of active algorithm.
🤖 Generated with Claude Code