session-runner has no host affinity: a ready-for-session ticket whose standing is host-specific is claimed by every host that cannot do it (#743 burned both attempts) #746
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Matou/idss#746
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
The session queue has no host affinity, and #743 is what that costs.
.sandcastle/session-runner.shpicks from?labels=ready-for-sessionand filters onno-triage/deferred/agent-blocked/agent-working/ open dependencies — andnothing else. Whichever host ticks first claims the ticket. But
ready-for-sessionexists (ADR 0174 §5) precisely for work that needs a particular session's standing:
host credentials, live droplet doors, a host's own evidence directories. The label
records that a host is needed; it cannot record which.
What it cost
#743 asks for eyes on two rented drives whose evidence lives on elitebook-03. Per
docs/agents/worker-classes.json, session-runner'shostsis[matou-workstation]—elitebook-03 runs Forgejo Actions but no session-runner at all. So #743 was unclaimable
by the only host that could do it, and claimable by every host that could not:
matou-workstation: notest-results/drive-rented, no route to elitebook-03;matou-dev-server-01: a DigitalOcean droplet whose netbird mesh holds only its sibling dev servers.Two attempts is the runner's escalation cap, so a correctly-labelled ticket walks itself
to
ready-for-humanwithout a human ever being the actual blocker.Shape of a fix (not ruled — this ticket is the ask)
The cheapest thing that would have worked: an opt-in host tag the picker honours.
A
host:<name>label (or a<!-- session-host: elitebook-03 -->body marker, the shape<!-- rehearsal-target/confirm -->already uses on the drive issues) that the jq filterskips unless it matches this host, with no tag meaning "any host" so every existing
ticket is unaffected. Guard it the way
scripts/tests/rehearsal-queue-test.shguards thedrive queue.
Worth considering alongside: the runner's
fail-<n>counter cannot tell "this host can'tdo it" from "this work is hard". A skip-for-wrong-host must not burn an attempt.
Why this is not urgent
#743's own need is now covered a different way —
.forgejo/workflows/rented-cert-evidence.yml(
18bda3e9) is a dispatch-only read-only door that runs on elitebook-03 and posts the drive'scert evidence to the tracker, so that evidence no longer needs a session on that host. This
ticket is the general gap that door works around, and the next host-specific
ready-for-sessionticket will pay the same two attempts unless it is closed.Filed by an agent session under ADR 0174 while working #743 (rule 1: file follow-ups, do not
widen the ticket).
Routing:
ready-for-session, notready-for-agent. The fix lands in.sandcastle/session-runner.sh, a protected.sandcastle/path (#445) — perdocs/agents/triage-labels.md'sready-for-sessionrole, that routes to an interactive session, never the swarm queue, regardless of how well-specified the work is.Verified against the current script: the picker filters only on
no-triage/deferred/agent-blocked/ open dependencies and the two-attempt escalation counter — no host tag or host-matching logic exists anywhere in the claim path. The gap is real.Agent Brief
Category: bug
Summary: The
ready-for-sessionticket picker has no host affinity, so a ticket needing a specific host's standing (credentials, mesh routes, local evidence) is claimable — and burned — by every host that cannot do the work.Current behavior:
The picker selects from open
ready-for-sessionissues (priority first, then oldest), skippingno-triage/deferred/agent-blockedand issues with open dependencies. It has no concept of which host a ticket needs. A ticket whose work is only possible on one host (e.g. it depends on that host's local evidence directory, netbird mesh membership, or credentials) is claimed by whichever host's session-runner ticks first. Two unadvanced attempts by wrong hosts exhausts the escalation cap and walks the ticket toready-for-human, even though the correct host was never tried.Desired behavior:
A ticket can optionally declare the host(s) it needs. The picker skips a ticket for a host that isn't in its declared set; a ticket with no declaration is claimable by any host (existing behavior, unaffected). A skip-for-wrong-host must not consume one of the ticket's two escalation attempts — only a genuine failed attempt by an eligible host should count against the cap.
Key interfaces:
host:<name>) is the cheapest shape (mirrors the<!-- rehearsal-target/confirm -->body-marker precedent already used elsewhere for machine-readable ticket metadata), but a body marker is also acceptable. No declaration = any host (unaffected default).Acceptance criteria:
ready-for-sessionticket declaring a specific host is not claimed, and does not have an attempt burned, by a session-runner on a different host.ready-for-sessionticket with no host declaration is claimed exactly as today (regression guard).scripts/tests/rehearsal-queue-test.shcovers: wrong-host skip (no attempt burned), right-host claim, and undeclared-ticket claim by any host.Out of scope:
ready-for-agentswarm queue (.sandcastle/list-ready-tasks.sh) — this isready-for-sessiononly..forgejo/workflows/rented-cert-evidence.yml).Close report — the session queue now has host affinity
Landed as
44dc585b(idss) on top ofMatou/dev-factory@29c2c94.The ruling this needed first
The ticket asked for a change to
.sandcastle/session-runner.sh. That file is aFACTORY_MANIFESTentry, vendored byte-identical fromMatou/dev-factoryatFACTORY_REF(ADR 0180) — editing it here is the ownership inversion that ADR retired, itreds
check-harness-drift.shimmediately, and it would be overwritten at the next pin bump.The #664/#666 precedent is explicit about this. So the fix landed upstream and idss
re-vendored:
Matou/dev-factory#89filed, worked, closed with its own close-report (29c2c94);FACTORY_REF343d26f→29c2c94.Ruled by agent under ADR 0174 — veto anytime. Two-way door on both sides: a commit in each
repo, revertible by reverting it; proved by an offline suite that was red before it and green
after.
What landed
New pure lib
.sandcastle/session-host-lib.sh:session_host_marker— the opt-in body marker, in the same HTML-comment shape the driveissues already use for
<!-- rehearsal-target: … -->, exactly as this ticket proposed;session_host_match— comma/space list, case-insensitive, tolerant of an FQDN on our side(
elitebook-03matcheselitebook-03.lan, neverelitebook-030);session_host_self—SESSION_RUNNER_HOST→SWARM_HOST→hostname, the order the restof the factory already resolves a host name in.
session-runner.shhonours it first in the pick loop:safe to land on a live queue.
.body(verified against the realtracker before writing a line), so the filter is served from the JSON in hand. Only the
SESSION_RUNNER_PICKrollout path, which skips the queue read, pays a fetch. A body thatcannot be read is empty — "any host", today's behaviour — never a hard fail.
implemented, not deferred: the check sits above the cooldown, fail-cap and dependency
checks and long before the claim, the attempt marker and
fail-<n>. A ticket pinned toanother host is not this host's failed attempt; it is not this host's ticket at all.
Known cost, recorded rather than engineered around: a marker naming a host that never ticks
(a typo, a decommissioned box) sits in the queue indefinitely, visible only as a skip line in
every other host's runner log. Escape hatch:
SESSION_RUNNER_HOST=<name>on the host thatshould take it.
Proof
.sandcastle/tests/session-host-lib-test.sh— 7 checks over the pure core (extraction, theno-marker default, lists, case/FQDN matching, resolution order).
.sandcastle/tests/session-runner-test.shgroup 19 — the wiring. 19a asserts the wronghost neither claims, nor starts a session, nor stamps an attempt marker, nor writes
fail-<n>, nor records a swarm.db run row; 19b the named host works it to completion;19c an unmarked ticket is picked straight past a foreign pinned one (no queue blocking);
19d a host list matches any member, the rule holds on the
PICKpath, andSESSION_RUNNER_HOSToverrides.the pinned ticket — this ticket's bug, reproduced in the suite.
.sandcastle/,check-harness-drift.shOK at the new pin.Two things this turned up
session-runner-test.shcould not run here at all. It died silently after group 1 on adoubled prompt path (
.sandcastle/.sandcastle/session-runner-prompt.md) — aconsumer-layout bug already fixed upstream as
dev-factory#87, which idss's stale pin hadnot picked up. The bump carries that fix, which is why this ticket's own regression is
runnable here.
docs/agents/worker-classes.jsonwas wrong about this very question. session-runner'srow has claimed a single host (
matou-workstation) since 2026-08-20, butmatou-dev-server-01has been draining the same queue — proven by #743's attempt 2 and bythis session, which ran on it. Corrected in the same commit, along with a stale lock
description (pre repo-scoping, pre owner-lock) and the top-level host list.
docs/agents/triage-labels.mddocuments the marker under theready-for-sessionrole(dev-factory's
docs/**is factory-only by ruling, so a consumer keeps its own copy).Filed, not widened (rule 1)
Matou/dev-factory#90—heal-test.shandclaude-call-guards-test.shred on a busy host:their run helpers inherit the host's live rehearsal-drive reservation instead of pinning
HOST_CAPACITY_DRIVE_WANTED. Red on a clean tree at both pins, so unrelated to this change;diagnosed to the exact line and filed rather than fixed here.
Not touched: #743's own fail counters on the two hosts that burned them, and #743 itself
(already covered by
.forgejo/workflows/rented-cert-evidence.yml, as this ticket notes).