feat(builder): documented launch options only, and no game-specific code
Launch options must be documented. A draft passed an option its server doesn't have; servers ignore unknown options, so it booted and passed every boot test while its setting did nothing. build now reads the pages research based the variant on, in full, and the drafter rejects any launch option in the startup command that none of them, nor the image's own scripts, mention. Shell tools' options (mkdir -p, [ -n ...]) are skipped; the check is off without sources. The builder is game-agnostic: - AUTHORING.md (the model's rules), the research prompt and the schema describe the rules without naming a game. - The draft prompt no longer includes real templates from the repo. Its format example is one invented server (no real command, options, ports or app id), checked by TestExampleTemplateFollowsTheRules. - Comments, help texts, BUILDER.md and test fixtures use invented names and values. - TestBuilderIsGameAgnostic reads every game's name and id from games/ and fails if any appears in the builder's code, tests, rules, schemas or docs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
dd92b6be4c
commit
8623ba2d7b
16 files changed
+395
-120
No files matched your search
+26
-1
@@ -138,7 +138,8 @@ func build(o buildOptions) (*buildResult, error) {
|
||||
steamApp = o.variant.SteamAppID
|
||||
}
|
||||
d, err := newDrafter(draftJob{GamesDir: o.gamesDir, SchemaDir: o.schemaDir, Name: o.name, ID: o.id, Image: res.Image,
|
||||
SteamApp: steamApp, Notes: variantNotes(o.variant, o.notes), Report: report, Provider: o.provider, Model: o.model, NoPull: true})
|
||||
SteamApp: steamApp, Notes: variantNotes(o.variant, o.notes), Report: report, Provider: o.provider, Model: o.model, NoPull: true,
|
||||
Docs: sourceText(o.variant.Sources)})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -370,3 +371,27 @@ func buildSummary(o buildOptions, res *buildResult) string {
|
||||
}
|
||||
return b.String()
|
||||
}
|
||||
|
||||
// sourceText reads the pages research based the variant on, in full, so the drafter can check that every
|
||||
// launch option the model uses is documented there. Empty (check skipped) without a reader.
|
||||
func sourceText(sources []string) string {
|
||||
reader := os.Getenv("READER_URL")
|
||||
if reader == "" || len(sources) == 0 {
|
||||
fmt.Println("[build] no research sources to check launch options against (READER_URL or sources missing)")
|
||||
return ""
|
||||
}
|
||||
var b strings.Builder
|
||||
read := 0
|
||||
for _, s := range sources {
|
||||
text, err := readPageLimit(reader, s, 200_000)
|
||||
if err != nil {
|
||||
fmt.Printf("[build] could not read %s: %v\n", s, err)
|
||||
continue
|
||||
}
|
||||
read++
|
||||
b.WriteString(text)
|
||||
b.WriteString("\n")
|
||||
}
|
||||
fmt.Printf("[build] read %d of %d research sources to check launch options against\n", read, len(sources))
|
||||
return b.String()
|
||||
}
|
||||
Reference in new issue
Block a user