implement workspace hooks, add a test