the first line was missing:

local osmose = require 'osmose.lib.osmose'