test(explore): #1500 regression fixtures for budget allocation (CG-6)

Two permanent fixtures pinning the failure mode from issue #1500 — explore
spending its byte envelope on files that merely name-collide with the query.
BOTH FAIL TODAY, by design: they document the bug and become the pass gate
for CG-10 (scoring) + CG-12 (proportional allocation).

__tests__/fixtures/payroll-go/ — a synthetic Go service mirroring the
reporter's shape: generated FKIT CRUD beside a hand-written payroll use-case,
entered from an HTTP route. Half the generated tree carries ORDINARY names
detectable only by their `// Code generated ... DO NOT EDIT.` header (the
#1500 case, and end-to-end cover for CG-5); `payrollpb/*.pb.go` covers the
path-detectable channel. BuildPayslip, Upsert and Store each exist twice,
generated and hand-written. cycle.go sits above the whole-file window so it
clips; the generated files sit below it so they ship whole.

Asking "how does payroll cycle create and calculate payslips?" — naming none
of the answering symbols — the generated CRUD delivers 57.4% of the envelope
against the hand-written layer's 25.6%, all of the latter domain types.
cycle.go is allocated the single largest slice (30.6%) and delivers ZERO: the
hard ceiling drops its whole section. runPayrollCycleAll, the hand-written
BuildPayslip and the real Upsert never reach the agent.

The second fixture is this repo, "how does explore allocate its output budget
across files", where scripts/agent-eval/*.mjs take 71.8% against tools.ts's
18.5% despite scoring 4.6x lower. It reads the live index, so its assertions
are relative rather than fixed percentages.

- scripts/agent-eval/probe-allocation.mjs — per-file budget-share probe,
  driving the CG-4 diagnostic through a JSONL sidecar so it measures the
  shipping allocator. Fixture entries are hermetic (copy + re-index per run,
  verified byte-identical across runs); exits 1 while any assertion fails.
- scripts/agent-eval/allocation-fixtures.json — both fixtures declared, with
  the 2026-08-03 baselines.
- __tests__/explore-allocation-1500.test.ts — fixture-shape assertions green
  today; the allocation assertions held as `it.fails` so the suite stays green
  while the bug is open and goes RED the moment it is fixed.

Also documented and deliberately left unfixed: runPayrollCycleAll's
`s.store.Upsert` edge resolves to the GENERATED Store.Upsert, not the
hand-written one — same-name method resolution across two packages picks the
wrong receiver. It is upstream of the allocation bug, so it belongs with
CG-10's scoring work.

Refs #1500

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Colby McHenry
2026-08-03 23:30:17 -05:00
co-authored by Claude Opus 5
parent 16e17495f4
commit bd86ad2061
25 changed files with 2687 additions and 0 deletions
@@ -0,0 +1,139 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.34.2
// protoc v5.27.1
// source: payroll/v1/payroll.proto
package payrollpb
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
)
// RunPayrollCycleRequest is the generated request message.
type RunPayrollCycleRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
CycleId string `protobuf:"bytes,1,opt,name=cycle_id,json=cycleId,proto3" json:"cycle_id,omitempty"`
DryRun bool `protobuf:"varint,2,opt,name=dry_run,json=dryRun,proto3" json:"dry_run,omitempty"`
Reason string `protobuf:"bytes,3,opt,name=reason,proto3" json:"reason,omitempty"`
}
func (x *RunPayrollCycleRequest) GetCycleId() string {
if x != nil {
return x.CycleId
}
return ""
}
func (x *RunPayrollCycleRequest) GetDryRun() bool {
if x != nil {
return x.DryRun
}
return false
}
func (x *RunPayrollCycleRequest) GetReason() string {
if x != nil {
return x.Reason
}
return ""
}
func (x *RunPayrollCycleRequest) Reset() { *x = RunPayrollCycleRequest{} }
func (x *RunPayrollCycleRequest) String() string { return protoimpl.X.MessageStringOf(x) }
// RunPayrollCycleResponse is the generated response message.
type RunPayrollCycleResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
CycleId string `protobuf:"bytes,1,opt,name=cycle_id,json=cycleId,proto3" json:"cycle_id,omitempty"`
Payslips []*Payslip `protobuf:"bytes,2,rep,name=payslips,proto3" json:"payslips,omitempty"`
GrossCents int64 `protobuf:"varint,3,opt,name=gross_cents,json=grossCents,proto3" json:"gross_cents,omitempty"`
NetCents int64 `protobuf:"varint,4,opt,name=net_cents,json=netCents,proto3" json:"net_cents,omitempty"`
}
func (x *RunPayrollCycleResponse) GetPayslips() []*Payslip {
if x != nil {
return x.Payslips
}
return nil
}
func (x *RunPayrollCycleResponse) Reset() { *x = RunPayrollCycleResponse{} }
func (x *RunPayrollCycleResponse) String() string { return protoimpl.X.MessageStringOf(x) }
// Payslip is the generated payslip message.
type Payslip struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
CycleId string `protobuf:"bytes,2,opt,name=cycle_id,json=cycleId,proto3" json:"cycle_id,omitempty"`
EmployeeId string `protobuf:"bytes,3,opt,name=employee_id,json=employeeId,proto3" json:"employee_id,omitempty"`
GrossCents int64 `protobuf:"varint,4,opt,name=gross_cents,json=grossCents,proto3" json:"gross_cents,omitempty"`
DeductionCents int64 `protobuf:"varint,5,opt,name=deduction_cents,json=deductionCents,proto3" json:"deduction_cents,omitempty"`
NetCents int64 `protobuf:"varint,6,opt,name=net_cents,json=netCents,proto3" json:"net_cents,omitempty"`
PeriodFrom *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=period_from,json=periodFrom,proto3" json:"period_from,omitempty"`
PeriodTo *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=period_to,json=periodTo,proto3" json:"period_to,omitempty"`
}
func (x *Payslip) GetId() string {
if x != nil {
return x.Id
}
return ""
}
func (x *Payslip) GetNetCents() int64 {
if x != nil {
return x.NetCents
}
return 0
}
func (x *Payslip) Reset() { *x = Payslip{} }
func (x *Payslip) String() string { return protoimpl.X.MessageStringOf(x) }
// PayrollCycle is the generated cycle message.
type PayrollCycle struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Start *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=start,proto3" json:"start,omitempty"`
End *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=end,proto3" json:"end,omitempty"`
Status string `protobuf:"bytes,4,opt,name=status,proto3" json:"status,omitempty"`
}
func (x *PayrollCycle) GetId() string {
if x != nil {
return x.Id
}
return ""
}
func (x *PayrollCycle) Reset() { *x = PayrollCycle{} }
func (x *PayrollCycle) String() string { return protoimpl.X.MessageStringOf(x) }
var file_payroll_v1_payroll_proto_rawDesc = []byte{
0x0a, 0x18, 0x70, 0x61, 0x79, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79,
0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x70, 0x61, 0x79, 0x72,
}
var file_payroll_v1_payroll_proto_goTypes = []any{
(*RunPayrollCycleRequest)(nil),
(*RunPayrollCycleResponse)(nil),
(*Payslip)(nil),
(*PayrollCycle)(nil),
}
var File_payroll_v1_payroll_proto protoreflect.FileDescriptor
@@ -0,0 +1,104 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.4.0
// - protoc v5.27.1
// source: payroll/v1/payroll.proto
package payrollpb
import (
context "context"
grpc "google.golang.org/grpc"
)
const (
PayrollService_RunPayrollCycle_FullMethodName = "/payroll.v1.PayrollService/RunPayrollCycle"
PayrollService_GetPayrollCycle_FullMethodName = "/payroll.v1.PayrollService/GetPayrollCycle"
PayrollService_ListPayslips_FullMethodName = "/payroll.v1.PayrollService/ListPayslips"
)
// PayrollServiceClient is the generated client API for PayrollService.
type PayrollServiceClient interface {
RunPayrollCycle(ctx context.Context, in *RunPayrollCycleRequest, opts ...grpc.CallOption) (*RunPayrollCycleResponse, error)
GetPayrollCycle(ctx context.Context, in *RunPayrollCycleRequest, opts ...grpc.CallOption) (*PayrollCycle, error)
ListPayslips(ctx context.Context, in *RunPayrollCycleRequest, opts ...grpc.CallOption) (*RunPayrollCycleResponse, error)
}
type payrollServiceClient struct {
cc grpc.ClientConnInterface
}
// NewPayrollServiceClient returns a generated client.
func NewPayrollServiceClient(cc grpc.ClientConnInterface) PayrollServiceClient {
return &payrollServiceClient{cc}
}
func (c *payrollServiceClient) RunPayrollCycle(ctx context.Context, in *RunPayrollCycleRequest, opts ...grpc.CallOption) (*RunPayrollCycleResponse, error) {
out := new(RunPayrollCycleResponse)
err := c.cc.Invoke(ctx, PayrollService_RunPayrollCycle_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *payrollServiceClient) GetPayrollCycle(ctx context.Context, in *RunPayrollCycleRequest, opts ...grpc.CallOption) (*PayrollCycle, error) {
out := new(PayrollCycle)
err := c.cc.Invoke(ctx, PayrollService_GetPayrollCycle_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *payrollServiceClient) ListPayslips(ctx context.Context, in *RunPayrollCycleRequest, opts ...grpc.CallOption) (*RunPayrollCycleResponse, error) {
out := new(RunPayrollCycleResponse)
err := c.cc.Invoke(ctx, PayrollService_ListPayslips_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// PayrollServiceServer is the generated server API for PayrollService.
type PayrollServiceServer interface {
RunPayrollCycle(context.Context, *RunPayrollCycleRequest) (*RunPayrollCycleResponse, error)
GetPayrollCycle(context.Context, *RunPayrollCycleRequest) (*PayrollCycle, error)
ListPayslips(context.Context, *RunPayrollCycleRequest) (*RunPayrollCycleResponse, error)
mustEmbedUnimplementedPayrollServiceServer()
}
// UnimplementedPayrollServiceServer must be embedded for forward compatibility.
type UnimplementedPayrollServiceServer struct{}
func (UnimplementedPayrollServiceServer) RunPayrollCycle(context.Context, *RunPayrollCycleRequest) (*RunPayrollCycleResponse, error) {
return nil, nil
}
func (UnimplementedPayrollServiceServer) GetPayrollCycle(context.Context, *RunPayrollCycleRequest) (*PayrollCycle, error) {
return nil, nil
}
func (UnimplementedPayrollServiceServer) ListPayslips(context.Context, *RunPayrollCycleRequest) (*RunPayrollCycleResponse, error) {
return nil, nil
}
func (UnimplementedPayrollServiceServer) mustEmbedUnimplementedPayrollServiceServer() {}
// RegisterPayrollServiceServer registers the generated service.
func RegisterPayrollServiceServer(s grpc.ServiceRegistrar, srv PayrollServiceServer) {
s.RegisterService(&PayrollService_ServiceDesc, srv)
}
// PayrollService_ServiceDesc is the generated service descriptor.
var PayrollService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "payroll.v1.PayrollService",
HandlerType: (*PayrollServiceServer)(nil),
Methods: []grpc.MethodDesc{
{MethodName: "RunPayrollCycle"},
{MethodName: "GetPayrollCycle"},
{MethodName: "ListPayslips"},
},
Metadata: "payroll/v1/payroll.proto",
}