npm notice run @mosaic/seat@0.1.0 test
npm notice run node --test tests/
✔ a first launch clones the root at its branch, with the root's path as origin (45.999753ms)
✔ the clone is not at its place until git clone has finished (31.714978ms)
✔ a later launch fast-forwards a clean clone after a commit to the root, then finds it current (87.004405ms)
✔ a clone ahead of the root keeps its commits and counts as current (56.500856ms)
▶ a dirty clone and one on another branch are fetched, and nothing but refs/remotes moves
  ✔ a modified file (57.900696ms)
  ✔ an untracked file (56.101465ms)
  ✔ a staged file (56.77676ms)
  ✔ another branch (55.299511ms)
  ✔ a detached HEAD (57.924036ms)
✔ a dirty clone and one on another branch are fetched, and nothing but refs/remotes moves (285.551225ms)
✔ a diverged clone gets the fetch into refs/remotes and is kept, not-fast-forward (54.291587ms)
▶ a clone kept before the branch check, or for a failed status, gets no fetch
  ✔ not-a-clone (29.002345ms)
  ✔ hooks-present (33.893076ms)
  ✔ submodule (39.685595ms)
  ✔ config-changed (37.719482ms)
  ✔ root-unreadable (42.395527ms)
  ✔ root-detached (51.703328ms)
  ✔ status-failed, on the root's branch and clean (54.799976ms)
  ✔ status-failed, dirty (41.974392ms)
✔ a clone kept before the branch check, or for a failed status, gets no fetch (332.858986ms)
✔ a dirty clone whose fetch fails is kept, fetch-failed, exactly as it was (48.239754ms)
✔ every git call the host makes, for a new clone and an existing one, carries maintenance.auto=false and gc.auto=0 (53.839644ms)
✔ a clone with loose objects enough for gc --auto gets no maintenance or gc from the fetch and the merge (81.707783ms)
▶ a clone with user.name or user.email in its config is kept, and git runs nothing in it
  ✔ user.name (29.217ms)
  ✔ user.email (29.862183ms)
✔ a clone with user.name or user.email in its config is kept, and git runs nothing in it (59.584726ms)
✔ a commit git can't read after the fast-forward is null (53.920212ms)
✔ a new clone whose commit can't be read refuses the launch and leaves nothing behind (23.015292ms)
▶ a clone the session rigged is kept, and git runs nothing and writes nothing outside it
  ✔ core.fsmonitor (44.696077ms)
  ✔ core.hooksPath (37.961627ms)
  ✔ a hook file (36.959014ms)
  ✔ include.path (41.653571ms)
  ✔ includeIf (45.637758ms)
  ✔ a filter driver (39.714056ms)
  ✔ origin moved (40.989286ms)
  ✔ a second origin url (41.637563ms)
  ✔ the origin url twice, both the root (42.354861ms)
  ✔ an ext:: origin (43.568652ms)
  ✔ a branch tracking another remote (44.78212ms)
  ✔ a branch merging a tag (44.782488ms)
  ✔ a fetch line onto local branches (45.879828ms)
  ✔ no origin (39.984797ms)
  ✔ a config file over the size cap (39.622113ms)
  ✔ config a symlink to /dev/zero (41.345001ms)
  ✔ the clone a symlink to the bait (37.700599ms)
  ✔ the clone a file (39.968919ms)
  ✔ the clone a plain directory (37.578583ms)
  ✔ .git a gitdir: file (35.844982ms)
  ✔ .git a symlink (36.490085ms)
  ✔ .git/logs a symlink (36.349819ms)
  ✔ .git/refs/heads a symlink (36.6323ms)
  ✔ .git/objects a symlink (35.514628ms)
  ✔ a reflog hard-linked to a file outside (36.326006ms)
  ✔ HEAD a fifo (36.556709ms)
  ✔ a commondir file (36.215251ms)
  ✔ an alternates file (37.107609ms)
  ✔ a gitlink staged, no .gitmodules (54.396866ms)
  ✔ a gitlink and .gitmodules staged (52.429087ms)
  ✔ a gitlink to a repository with its own gitlink (61.632281ms)
  ✔ a gitlink and .gitmodules committed (56.897162ms)
  ✔ a gitlink and submodule.active in config (54.217456ms)
  ✔ a .git/modules with no gitlink (40.441965ms)
✔ a clone the session rigged is kept, and git runs nothing and writes nothing outside it (1439.41533ms)
▶ a root that can't be cloned refuses with the project id and leaves nothing behind
  ✔ missing (12.193262ms)
  ✔ not a repository (11.856937ms)
  ✔ a plain directory inside another repository (18.026333ms)
  ✔ unreadable (13.525194ms)
  ✔ on no branch (17.461663ms)
  ✔ missing an object (19.803621ms)
✔ a root that can't be cloned refuses with the project id and leaves nothing behind (93.925947ms)
✔ a clone whose root is on no branch, or gone, is kept and named (34.318847ms)
✔ no credential or forge remote of the root reaches a clone (58.675838ms)
✔ every project in the business file gets its own clone at its own branch (40.20198ms)
✔ a clone past its time gets SIGTERM and refuses the launch, with nothing left in the workspace (517.577975ms)
✔ a clone that ignores SIGTERM gets SIGKILL once the grace period is over (1027.954483ms)
✔ a timeout signals git's process group, so a process git started dies with it (527.457894ms)
✔ once a signalled git has closed, its group gets SIGKILL, so a process that ignored SIGTERM dies too (517.415821ms)
✔ RUNNER_FILES is exactly what the runner and the harness sources it starts import (2.544285ms)
✔ sandboxProblem names a missing bwrap and a bwrap that fails (12.847999ms)
✔ every bind says why; the bundle and session file stay read-only over the run directory (1.850877ms)
✔ the host's git socket is bound only when given, read-only and before the writable binds (0.876573ms)
✔ the git identity is the instance's, at <instance>@<business>.mosaic.invalid, and sandboxArgv refuses without it (1.554905ms)
✔ a confined session's shell reaches its own workspace and run directory and nothing of the founder's or another session's (1819.734654ms)
✔ a bind that exposes a stand-in, or a missing workspace bind, fails the matching check (2940.080077ms)
✔ a confined session that runs tester-cli.mjs is refused as tester, and the same shim outside the sandbox binds (215.500723ms)
✔ resolveSeat: by name under --repo resolves the repo layout (1.935664ms)
✔ resolveSeat: by path resolves the fleet layout (0.443247ms)
✔ resolveSeat: refusals for missing dir, missing launch.sh, non-executable launch.sh, invalid name, and unknown layout (0.785649ms)
✔ tmuxContext: outside tmux, default socket, custom socket, and exec failure (0.719711ms)
✔ makeRegistration produces a record that validates; each shape violation throws SeatError (0.834354ms)
✔ writeRegistration/readRegistration: round trip, permissions, absence, and malformed records (1.414486ms)
✔ updateTask: changes task, taskSetBy and updatedAt only, and refuses appropriately (1.282279ms)
✔ CLI launch: registers, execs the fake launch script, and passes args through (41.043296ms)
✔ CLI launch: --harness lands in the record (43.555887ms)
✔ CLI launch: the launch script's own exit code passes through (39.359793ms)
✔ CLI launch: relaunching a seat rewrites the one registration record (71.867822ms)
✔ CLI launch: omitting --task records an empty string, not null (34.966774ms)
✔ CLI seat task: updates only the task after a launch, and refuses on an unlaunched seat (99.583695ms)
✔ CLI refusals: no args, unknown flag, missing config, already-registered env, and exec failure (153.719066ms)
✔ samePath: equal paths, symlinked dirs, distinct dirs, and non-strings (0.412077ms)
✔ resolveSetBy: explicit --by wins over the environment; absent or empty environment gives unknown; invalid explicit or environment values refuse with exit 4 (0.570619ms)
✔ validateRegistration/readRegistration: taskSetBy is optional; a record without it (written before #1511) still loads unchanged; an invalid one is refused; the version does not change (0.699211ms)
✔ updateTask: records setBy, preserves startedAt and every unrelated field, upgrades an old record in place only when the task is set, and replaces a previous attribution (0.990645ms)
✔ CLI seat task: --by beats MOSAIC_AGENT_NAME, the environment beats nothing, empty environment is unknown, invalid --by or environment refuses with exit 4 and leaves the record byte for byte (330.365858ms)
✔ family: exactly one launch.max key in the model name, else null (1.102811ms)
✔ sessionEnv passes only the allowlist, the repo's bin on PATH, and the run id (0.853894ms)
✔ sessionExit gives a runner's signal death back as the signal; a session credential is one whole set of nonempty variables (0.311512ms)
✔ newRun: short ids, 0700 directories, and a refusal when the socket path won't fit (2.01489ms)
✔ session file and launch log: 0600, the session file written once (1.53161ms)
✔ endReason maps the runner's exit codes; a signal is killed (0.129297ms)
✔ Registry mirrors to sessions.json; readSessions marks live entries; bad files refuse (1.917057ms)
✔ stopSession refuses an unknown run, reports a stale one, and won't signal a pid that isn't a runner (1.161878ms)
✔ a session runs in its sandbox as pid 1 of its namespace, claims, answers, and stops on mosaic stop (247.613441ms)
✔ workRef and validBranch take only what a ref name can hold (1.371627ms)
✔ a push lands as the task's work ref, a fast-forward lands after it, and main is the root's (142.621974ms)
✔ a rewritten branch refuses non-fast-forward and the work ref stays (120.57256ms)
✔ a branch with no history in common with main refuses unrelated-history (57.0417ms)
✔ a bundle that needs commits the working repository lacks refuses missing-prerequisite (48.771052ms)
✔ main is fetched from the root again before each push, so a clone of a newer root pushes (124.248559ms)
✔ a root moved back after the clone leaves the push's base unknown: missing-prerequisite (76.552763ms)
✔ a commit with a broken object refuses invalid-bundle, and only because fsck is on (78.092051ms)
✔ only a v2 bundle with the named branch is read (60.725071ms)
✔ a branch named main, or named for another task, moves only this task's work ref (114.313772ms)
✔ a record that throws moves the work ref back, or removes a new one (127.230969ms)
✔ a work ref that can't go back refuses rollback-failed, naming the ref and the commit (340.689478ms)
✔ a root that can't be read refuses root-unreadable (33.47297ms)
✔ a git past its time gets SIGTERM, leaves no ref lock, and the next push lands (2146.094283ms)
✔ a git that ignores SIGTERM gets SIGKILL once the grace period is over (1032.661208ms)
✔ a working repository path that isn't a directory refuses (26.699538ms)
✔ review bundles a pushed commit as refs/mosaic/review, leaving out what the reviewer has (113.480768ms)
✔ review of a project with no working repository refuses unknown-commit (14.618972ms)
✔ the runner's git tools hold the host's limits and branch rule (1.314448ms)
ℹ tests 132
ℹ suites 0
ℹ pass 132
ℹ fail 0
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 5533.314428
