diff --git a/scripts/remote.sh b/scripts/remote.sh index 96855cff..b3a1f377 100644 --- a/scripts/remote.sh +++ b/scripts/remote.sh @@ -787,6 +787,7 @@ _remote_write_pulled_team() { SELECT json_object('name','$(_agmsg_sqlesc "$team")', 'team_id','$(_agmsg_sqlesc "$team_id")', 'agents', json_object(), + 'drivers', json_object('layout', 'per-team'), 'created_at','$(date -u +%Y-%m-%dT%H:%M:%SZ)');") agmsg_write_atomic "$cfg" "$initial" fi diff --git a/tests/test_remote.bats b/tests/test_remote.bats index cbe02f35..2c810fb9 100644 --- a/tests/test_remote.bats +++ b/tests/test_remote.bats @@ -620,6 +620,17 @@ PULL_TEAM_ID=018f3f7e-2222-7000-8000-000000000002 [ -f "$cfg" ] # Not minted here: the id is the one the server answered with. [ "$(sqlite_mem "SELECT json_extract(readfile('$(rf "$cfg")'), '\$.team_id');")" = "$PULL_TEAM_ID" ] + [ "$(sqlite_mem "SELECT json_extract(readfile('$(rf "$cfg")'), '\$.drivers.layout');")" = "per-team" ] + [ -f "$TEST_SKILL_DIR/db/teams/cloned/messages.db" ] + # Pull arrives into an empty local team, so it can select the isolated layout + # before bootstrap. Imported remote rows must never leak into the shared + # store that local-only teams and external readers still use. + if sqlite3 "$TEST_SKILL_DIR/db/messages.db" \ + "SELECT name FROM sqlite_master WHERE type='table' AND name='events';" | + grep -qx events; then + [ "$(sqlite3 "$TEST_SKILL_DIR/db/messages.db" \ + "SELECT COUNT(*) FROM events WHERE team='cloned';")" -eq 0 ] + fi } @test "remote pull: starts a background sync engine that disconnect stops" {