a06f331eb8
CI / benchmark (push) Has been skipped
install-script / posix-syntax (push) Successful in 6m1s
CI / build-onnx (push) Failing after 6m43s
init-smoke / dry-run (push) Failing after 15m57s
security / govulncheck (push) Has been cancelled
security / trivy-fs (push) Has been cancelled
CI / test (1.26, ubuntu-latest) (push) Has been cancelled
Scorecard supply-chain security / Scorecard analysis (push) Has been cancelled
CI / test (1.26, macos-latest) (push) Has been cancelled
CI / build-windows (push) Has been cancelled
CI / lint (push) Has been cancelled
install-script / powershell-syntax (push) Has been cancelled
install-script / install (macos-14) (push) Has been cancelled
install-script / install (ubuntu-latest) (push) Has been cancelled
55 lines
1.7 KiB
Go
55 lines
1.7 KiB
Go
package llm
|
|
|
|
import "context"
|
|
|
|
// MockBackend serves canned responses keyed on input. Used by the
|
|
// bench so the only variable across runs is the model, not real graph
|
|
// data. Add cases here as new questions are added.
|
|
type MockBackend struct{}
|
|
|
|
func (MockBackend) SearchSymbols(_ context.Context, query string, _ Scope, _ int) ([]Match, error) {
|
|
switch query {
|
|
case "LoadConfig":
|
|
return []Match{
|
|
{ID: "internal/config.LoadConfig", Kind: "function", Path: "internal/config/config.go"},
|
|
{ID: "internal/config.LoadConfigFromEnv", Kind: "function", Path: "internal/config/env.go"},
|
|
}, nil
|
|
case "RunServer":
|
|
return []Match{
|
|
{ID: "cmd/gortex/server.RunServer", Kind: "function", Path: "cmd/gortex/server/run.go"},
|
|
}, nil
|
|
}
|
|
return nil, nil
|
|
}
|
|
|
|
func (MockBackend) GetCallers(_ context.Context, id string, _ Scope, _ int) ([]Caller, error) {
|
|
switch id {
|
|
case "internal/config.LoadConfig":
|
|
return []Caller{
|
|
{ID: "cmd/gortex.main", File: "cmd/gortex/main.go"},
|
|
{ID: "internal/daemon.Bootstrap", File: "internal/daemon/bootstrap.go"},
|
|
}, nil
|
|
case "cmd/gortex/server.RunServer":
|
|
return []Caller{
|
|
{ID: "cmd/gortex.main", File: "cmd/gortex/main.go"},
|
|
}, nil
|
|
}
|
|
return nil, nil
|
|
}
|
|
|
|
func (MockBackend) ListRepos(_ context.Context) ([]Repo, error) {
|
|
return []Repo{
|
|
{Name: "gortex", Root: "/Users/x/code/gortex", Nodes: 21609},
|
|
}, nil
|
|
}
|
|
|
|
func (MockBackend) GetDependencies(_ context.Context, id string, _ Scope, _, _ int) ([]Dep, error) {
|
|
// MockBackend doesn't synthesise dependencies; cross-system chain
|
|
// tests are daemon-backend-only.
|
|
return nil, nil
|
|
}
|
|
|
|
func (MockBackend) ListContracts(_ context.Context, _ ContractFilter, _ Scope) ([]Contract, error) {
|
|
return nil, nil
|
|
}
|