[pitboss/grind] deferred session-0015 (20260520T233019Z-6958)

This commit is contained in:
pitboss 2026-05-21 08:54:08 -05:00
parent ba0f83a855
commit 1e122b615e
5 changed files with 128 additions and 19 deletions

View file

@ -173,8 +173,15 @@ fn class_method_java_emits_reflective_dispatch() {
fn class_method_go_uses_reflect_receivers_registry() {
let spec = make_spec(Lang::Go);
let h = lang::emit(&spec).expect("emit ok");
assert!(h.source.contains("entry.NyxReceivers"));
assert!(h.source.contains("entry.NyxAutoReceivers"));
assert!(h.source.contains("MethodByName"));
let registry = h
.extra_files
.iter()
.find(|(name, _)| name == "entry/nyx_auto_registry.go")
.expect("auto registry emitted");
assert!(registry.1.contains("NyxAutoReceivers"));
assert!(registry.1.contains("UserService{}"));
}
#[test]

View file

@ -9,7 +9,3 @@ func (UserService) Run(input string) string {
out, _ := exec.Command("/bin/echo", input).Output()
return string(out)
}
var NyxReceivers = map[string]interface{}{
"UserService": UserService{},
}

View file

@ -1,9 +1,9 @@
// Phase 19 (Track M.1) — class-method vuln fixture for Go.
//
// UserService.Run accepts user input and passes it to `sh -c` so the
// shell interprets it. The fixture publishes its instance through the
// well-known `NyxReceivers` registry the harness uses to construct
// receivers reflectively.
// shell interprets it. The harness compiles in a generated
// `nyx_auto_registry.go` that publishes `UserService{}` so reflection
// works without a hand-rolled registry in the fixture.
package entry
import "os/exec"
@ -15,7 +15,3 @@ func (UserService) Run(input string) string {
out, _ := exec.Command("sh", "-c", "echo "+input).Output()
return string(out)
}
var NyxReceivers = map[string]interface{}{
"UserService": UserService{},
}