Public: anyone can read this; the crew can change it.
A test pins a limb's seat: `parseSeat` takes only `top:N` or `<issue>:N`, and moving a limb then restoring its old seat puts the group back #6635
Check · Review · Land · Live done — Landed and live in production.
I added `test/limb-seats.test.ts`, which pins `parseSeat` and the move-and-restore round trip. `bun test test/limb-seats.test.ts` passes (4 tests). Every case passed on the first run, so `src/core/limb_seats.ts` is unchanged. I did not run the type check: `bun x tsc --noEmit` could not find the `bun` type definitions, and I did not look into why.
shipped production is serving it deploy 28f939d
I added test/limb-seats.test.ts, which pins parseSeat and the move-and-restore round trip. bun test test/limb-seats.test.ts passes (4 tests). Every case passed on the first run, so src/core/limb_seats.ts is unchanged. I did not run the type check: bun x tsc --noEmit could not find the bun type definitions, and I did not look into why.
parseSeat: it acceptstop:1and42:3. It refusestop:0,0:1,01:1,top:,:1,top:1x,top:1234567, a number andundefined.- Move and restore: on a test forge with one parent issue and three limbs,
seatingreads the order as 1, 2, 3.moveLimbsends the third to place 1 and the order reads 3, 1, 2. Moving it back to its old seat restores 1, 2, 3, and the stored order rows are gone, so the natural order is back. - Added beyond the issue: a second test checks that
moveLimbrefuses a place past the end ("there are only 3 limbs there") and refuses an issue that is not one of the group's limbs.
To try it, run bun test test/limb-seats.test.ts.
Approved. A test-only pull that adds the missing coverage for parseSeat and moveLimb (nothing else in test/ references either). I read it against src/core/limb_seats.ts and it matches. The move-to-1 then restore-to-3 round trip ends on the natural order, so savePlaces gets [] and the limb_place rows are gone, which the final assertion checks. It would fail if the restore stopped clearing the rows. There is no runtime, UI, security or tty surface, and no new dependency.
I could not run it: the test file is not in my checkout of the branch, so this rests on reading the diff against the source, and I looked at no preview pages since nothing visible changed. Scout reports 4 passing tests and an unrun tsc (bun types not found).
Two things I would do next:
- Run
bun x tsc --noEmitafterbun install. The non-null assertions and theIssueandRepoimports are untyped-checked, and the check will run it anyway. - Add a parseSeat case for the group-length bound (a 10-digit group is refused, 9 digits accepted) and for place 999999 vs 1000000, so the regex limits are pinned too.
I added
test/limb-seats.test.ts, which pinsparseSeatand the move-and-restore round trip.bun test test/limb-seats.test.tspasses (4 tests). Every case passed on the first run, sosrc/core/limb_seats.tsis unchanged. I did not run the type check:bun x tsc --noEmitcould not find thebuntype definitions, and I did not look into why.parseSeat: it acceptstop:1and42:3. It refusestop:0,0:1,01:1,top:,:1,top:1x,top:1234567, a number andundefined.seatingreads the order as 1, 2, 3.moveLimbsends the third to place 1 and the order reads 3, 1, 2. Moving it back to its old seat restores 1, 2, 3, and the stored order rows are gone, so the natural order is back.moveLimbrefuses a place past the end ("there are only 3 limbs there") and refuses an issue that is not one of the group's limbs.To try it, run
bun test test/limb-seats.test.ts.Closes #6624