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
@@ -278,8 +278,8 @@ func parseProbe(f *imageFacts, out string) {
|
||||
}
|
||||
|
||||
// suggestContainerUser works out whether the image only works as a specific user. Images either declare
|
||||
// it (USER) or are built around an account whose home folder nobody else may enter (ARK's gameserver,
|
||||
// uid 25000, with /home/gameserver at 700).
|
||||
// it (USER) or are built around an account whose home folder nobody else may enter (e.g. a home folder
|
||||
// at mode 700 owned by a uid other than 1000).
|
||||
func suggestContainerUser(f *imageFacts) {
|
||||
if u := strings.TrimSpace(f.User); u != "" && u != "root" && u != "0" {
|
||||
resolved := resolveUser(f, u)
|
||||
@@ -364,7 +364,7 @@ func checkTemplate(game map[string]any, f *imageFacts) (problems, notes []string
|
||||
}
|
||||
if cmd, _ := game["defaultStartupCommand"].(string); cmd != "" {
|
||||
for _, m := range assignedVars.FindAllStringSubmatch(cmd, -1) {
|
||||
provided[m[1]] = true // set by the command itself, e.g. export ASA_START_PARAMS=...
|
||||
provided[m[1]] = true // set by the command itself, e.g. export START_PARAMS=...
|
||||
}
|
||||
withDefault := map[string]bool{}
|
||||
for _, m := range defaultedRef.FindAllStringSubmatch(cmd, -1) {
|
||||
@@ -410,7 +410,7 @@ func containerPort(p string) string {
|
||||
return p
|
||||
}
|
||||
|
||||
// startupScriptPaths picks absolute paths out of a template's startup command (e.g. ARK's
|
||||
// startupScriptPaths picks absolute paths out of a template's startup command (e.g. an image's
|
||||
// /usr/bin/start_server) so the probe reads those scripts too.
|
||||
func startupScriptPaths(game map[string]any) []string {
|
||||
cmd, _ := game["defaultStartupCommand"].(string)
|
||||
|
||||
Reference in new issue
Block a user