You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Machines page (#143, merged) reads the MachineRepo table to show which repos a machine has loaded, but nothing writes those rows. T125 (pr#450) clones/reconciles repos into /workspace and tracks them in a container-local cloned.json, but never reports them to the server — so #143's "Loaded repos" section is permanently empty. This is the missing bridge.
Piggyback the loaded-repo list onto the existing heartbeat (PATCH /api/v1/me/machines/[id]/heartbeat, called every 30s; T125 already computes the cloned-set) → server reconciles MachineRepo (upsert reported, delete absent), owner-scoped + zod-validated.
Acceptance criteria
Daemon reports its current loaded repos (repo, optional branch, path) each cycle.
Server reconciles MachineRepo for the machine: upsert reported, delete no-longer-reported; owner-scoped via authorizeDaemonOrSession + userId.
Report body zod-validated (repo slug regex + length caps); invalid → 422, no partial write.
Problem
The Machines page (#143, merged) reads the
MachineRepotable to show which repos a machine has loaded, but nothing writes those rows. T125 (pr#450) clones/reconciles repos into/workspaceand tracks them in a container-localcloned.json, but never reports them to the server — so #143's "Loaded repos" section is permanently empty. This is the missing bridge.Task: #146 (
report-daemon-loaded-repos-to-server-populate-machinerepo)Approach
Piggyback the loaded-repo list onto the existing heartbeat (
PATCH /api/v1/me/machines/[id]/heartbeat, called every 30s; T125 already computes the cloned-set) → server reconcilesMachineRepo(upsert reported, delete absent), owner-scoped + zod-validated.Acceptance criteria
repo, optionalbranch,path) each cycle.MachineRepofor the machine: upsert reported, delete no-longer-reported; owner-scoped viaauthorizeDaemonOrSession+userId.Phases
loadedRepos+ integration tests.Dependencies
MachineRepomodel + read endpoint + UI.Security
Extends an authed endpoint (keep owner-scoping; test non-owner rejection). No secrets. Untrusted input (daemon-reported list) → zod slug regex
^[a-zA-Z0-9][\w.-]*/[a-zA-Z0-9][\w.-]*$+ length caps before any write.Rollback
Revert; heartbeat falls back to bodyless,
MachineRepostops being written (UI → empty state). No schema change to undo.Full spec:
.tasks/.data/tasks/report-daemon-loaded-repos-to-server-populate-machinerepo.md