Skip to content

slot-filler: a gone parent's children keep their slots; clear its left-over starts - #1526

Merged
scuttletoby merged 1 commit into
mainfrom
slot-filler-gone-parents
Nov 30, 2026
Merged

scuttletoby merged 1 commit into
mainfrom
slot-filler-gone-parents

Conversation

@scuttletoby

Copy link
Copy Markdown
Owner

Follow-up to #1515 (merged): the four minors its lens left.

What changes

  1. A gone parent's children keep their slots. GET /api/fork/delegate on an archived or deleted parent still answers 404 parent_missing, but now its body carries the children T3 keeps for that thread (the records outlive the archive; the 404 body already had a children: [] field). The filler takes them from the parent_missing answer, so they count toward slots, memory and a repeat's last run until each ends. A thread with no shell at all still answers children: []. This is "T3's own task list", not the started/ records: the records alone could never show a child finished.
  2. A left-over start under a gone parent clears. When the parent is gone and the lookup finds no task (not_found, or parent_missing from a server that answers that), the marker is dropped with a log line ("dropped the intent for <id> on <machine>: its parent thread X is gone or archived ...; the item stays queued"). The item then waits in its file, so giving it another parentThreadId works. Note: the real server answers a lookupOnly with not_found, never parent_missing (it checks the request id before it checks the parent), so the filler goes by its own gone flag from the GET. This also covers a handover whose old parent was archived: the item then starts under the current parent. The note for a marker that is still kept (settled parent) now names the file to delete.
  3. A blank parent id is refused at the item check. A parentThreadId or parentEnvironmentId that is empty or has spaces around it is refused and kept. parent_of never hands one to T3 (the config's parent stands in), so known_parents cannot stop the run on T3's 400. The config's parents list gets the same check.
  4. Recovery checks the parents list again. A marker whose parent has left the list since is only looked up (held, as for a settled parent), never started.

Mutant table: new entry known_parents reads started/ and the markers (drops started/ from known_parents). It is killed by the extended table test, where a parent that is archived and off the list is known only from started/. Dropping only the markers read has no test that fails: recovery runs before the slot count and turns each found marker into a started/ record, so only a stopped, offline or unclear marker under a parent that nothing else names would be missed. The settled before recovery entry now targets the new hold line.

State question

  • Runs again: a gone parent is asked once per run, and its children come from T3 each time, so the same state gives the same count. A dropped marker is gone for good, and the next run sees only the queue file, which waits on the gone parent with the same line.
  • Stops half-way: a stop after the marker is removed but before the log line loses only the line; the item is still in its file. A stop before the removal leaves the marker: the next run looks it up again and drops it then.
  • Old data: markers, started records and items without parentThreadId still fall back to the config's parent. A T3 from before this change answers a gone parent with children: []: its children count as ended, as before this PR (no worse).
  • Empty state: no queue, no markers: known_parents gives the config's parent and the list, as before.
  • Left risk: a remote start whose record arrives after its parent was archived, and after the lookup found nothing, could start a second time once the item names another parent. This needs an unclear remote answer and an archive in the same window.

Tests

  • fork-kit/slot-filler/tests/filler.test.py: all 228 pass. Extended in place, no new test or file: the parents table test (a blank-id row, plus a third phase: an archived parent known only from started/ holds its writer slots until its children end), test_a_settled_parent_keeps_its_left_over_start_unasked (then archived: the marker is dropped and the item stays), and test_an_unstarted_start_of_an_old_parent_is_never_started (now a two-row table: handover, or the parent left the list). Each new assertion fails on slot-filler: one queue, several parent threads #1515's head (checked against its binary). RedCheck runs the mutant table and passes.
  • catch-up.test.py passes.
  • apps/server/src/fork/fillerDelegate.test.ts: the list test now also checks that an archived parent's 404 lists its children, and that a missing one lists none. All 29 pass.
  • vp run check:changed (format, lint, knip, typecheck, tests) and the fork-checks scripts (schema, upstream-files, seam) pass.

Part of the #1515 lens follow-up; nothing is left from its four minors.

🤖 Generated with Claude Code

…t-over starts

- GET /api/fork/delegate on an archived or deleted parent still answers 404
  parent_missing, now with the children T3 keeps for it. The filler counts them
  (slots, memory, a repeat's last run) until each ends.
- A left-over start under a gone parent whose lookup finds no task is dropped;
  the item stays queued and the log says why.
- A parentThreadId that is empty or has spaces around it is refused at the item
  check and never asked of T3 (its 400 stopped the whole run).
- Recovery checks a marker's parent against the parents list again: one that
  left the list is only looked up.
- Mutant for known_parents reading started/ (a gone parent known only from
  its started records).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@scuttletoby scuttletoby added the fork:merge-ready Merge conveyor: lenses done, merge when green (PRs) label Nov 30, 2026
@scuttletoby
scuttletoby merged commit 4f9690c into main Nov 30, 2026
31 checks passed
@scuttletoby
scuttletoby deleted the slot-filler-gone-parents branch November 30, 2026 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork:merge-ready Merge conveyor: lenses done, merge when green (PRs)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant