Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecuteProject ¶
func ExecuteProject(ctx context.Context, cfg *Config, name, instructions string, bag rubrics.RunBag, items ...rubrics.Evaluator) error
ExecuteProject executes a grading workflow using the provided evaluators. The name parameter identifies the project/assignment being graded. The instructions parameter is used for AI quality evaluation when QualityClient is configured. If bag is nil, a new empty bag is created. Otherwise, the provided bag is used (for pre-configured context). If ProgramBuilder is nil, defaults to creating a Program with the provided Env. This function is generic and can be used by any course-specific implementation.
func PromptForSubmission ¶
PromptForSubmission asks the user if they want to submit results to the server. Returns true if user confirms, false otherwise. The caller must pass a non-nil writer and reader; this function will not default them. If either the writer or reader is nil, the function will log a warning and return false. Accepts "y", "Y", "yes", "YES" (case-insensitive, whitespace-trimmed).
Types ¶
type AuthTransport ¶
type AuthTransport struct {
// contains filtered or unexported fields
}
AuthTransport injects an Authorization header for every outgoing request. It wraps an existing http.RoundTripper and adds a "Authorization: Bearer {token}" header to each outgoing request.
func NewAuthTransport ¶
func NewAuthTransport(token string, base http.RoundTripper) *AuthTransport
NewAuthTransport creates a new AuthTransport with the given token. If base is nil, defaultTLSTransport() is used.
type Config ¶
type Config struct {
ServerURL string
// ClientVersion is the version of the running CLI.
ClientVersion string
// Execution specific fields
WorkDir WorkDir
RunCmd string
Env map[string]string
// Connect client for the QualityService
QualityClient protoconnect.QualityServiceClient
// Connect client for the RubricService
RubricClient protoconnect.RubricServiceClient
// Writer is where the resulting rubric table will be written. If nil, defaults to os.Stdout
Writer io.Writer
// Reader is where to read user input from. If nil, defaults to os.Stdin
Reader io.Reader
// ProgramBuilder creates a ProgramRunner for a given working directory and run command.
// If nil, defaults to creating a Program with ExecCommandBuilder using Env.
// This is the primary extension point for testing and customization.
ProgramBuilder func(workDir, runCmd string) (rubrics.ProgramRunner, error)
}
Config represents configuration for the grading client
func (*Config) UploadResult ¶
UploadResult prompts the user for confirmation and uploads the rubric result to the server. If RubricClient is nil, logs and returns without error. If Reader is nil, defaults to os.Stdin for user input.
type DirectoryError ¶
type DirectoryError struct {
Err error
// contains filtered or unexported fields
}
DirectoryError represents an error related to directory access
func (*DirectoryError) Error ¶
func (e *DirectoryError) Error() string
func (*DirectoryError) Unwrap ¶
func (e *DirectoryError) Unwrap() error