package claude import ( "os" "path/filepath" "testing" ) func TestNativeIsolationPolicy(t *testing.T) { f := fixtureFor(t, "Engineering") if err := os.Symlink("/home/runner", filepath.Join(f.launch.Workspace, "equipo-direct-sentinel-alias")); err != nil { t.Fatal(err) } for _, tool := range []string{"Read", "Glob", "Grep"} { for _, path := range []string{"/home/runner/equipo-read-sentinel", "/proc/self/root/home/runner/equipo-read-sentinel", "/proc/1/root/home/runner/equipo-read-sentinel", "/workspace/equipo-direct-sentinel-alias/equipo-read-sentinel"} { if !ProbeNativeReadPolicy(f.launch.Policy, tool, path) { t.Fatalf("protected %s %s", tool, path) } } if ProbeNativeReadPolicy(f.launch.Policy, tool, "/workspace/normal") { t.Fatal("workspace blocked") } } if ProbeNativeReadPolicy(f.launch.Policy, "Bash", "/home/runner/equipo-read-sentinel") { t.Fatal("native proof used for Bash") } }