Documentation
¶
Overview ¶
Package variant resolves a problem's parameters for one interview, deterministically. The same problem and interview id always produce the same values, so a session can be reproduced exactly for regrading, and each parameter draws from its own derived seed, so adding a parameter to a problem never changes the values existing parameters resolve to.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HashParts ¶ added in v0.8.0
HashParts digests parts with each one length-prefixed, so no two part lists share a digest.
func IsTemplated ¶
IsTemplated reports whether a candidate file is rendered as a Go template when it ships: known text extensions plus extensionless files. The content linter and the bundle renderer share this one predicate, so no file can be rendered without also being lint-checked.
Types ¶
type Resolved ¶
type Resolved struct {
Problem string `json:"problem"`
InterviewID string `json:"interview_id"`
Params map[string]any `json:"params"`
Overrides map[string]string `json:"overrides,omitempty"`
}
Resolved is one interview's fully resolved variant, with the provenance needed to reproduce it. It serializes into evidence bundles.
func Resolve ¶
func Resolve(problemID string, specs map[string]content.ParamSpec, interviewID string, overrides map[string]string) (*Resolved, error)
Resolve computes the variant for one interview. Overrides win over everything and are validated against the spec; a parameter with a default is pinned to it; anything else draws from the interview seed.
type TemplateIssue ¶
TemplateIssue is one problem found in candidate-facing template text.
func CheckTemplates ¶
CheckTemplates parses every candidate-visible text file and reports unparseable templates and references to parameters the problem does not declare. Without this, a typo like {{.scal}} only surfaces when a bundle is rendered for a real candidate.