fix(builder): keep every game's name and code out of the builder
The builder must be game-agnostic, but its prompts named games: AUTHORING.md (the model's rules) used three games as examples, the research prompt listed two games' editions, the schema described containerUser by one game's image, and every draft prompt included two real templates from the repo, so the model saw, and could copy, other games' commands and options. - AUTHORING.md, the research prompt and the schema describe the rules without naming a game. - The draft prompt's format example is now one invented server (no real command, options, ports or app id), checked by TestExampleTemplateFollowsTheRules against validation and the draft checks. - 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
8b49895d5e
commit
929cbc31cf
15 files changed
+243
-123
No files matched your search
@@ -6,12 +6,12 @@ import (
|
||||
)
|
||||
|
||||
func TestBootFailureKeepsVerdictAndServerOutput(t *testing.T) {
|
||||
out := "[boot-test] deploying boottest-valheim (cm2network/steamcmd)\n" +
|
||||
"[boot-test] container started; waiting for ready pattern /Game server connected/\n" +
|
||||
out := "[boot-test] deploying boottest-example (cm2network/steamcmd)\n" +
|
||||
"[boot-test] container started; waiting for ready pattern /Server ready/\n" +
|
||||
"[boot-test] FAILED: container exited before it was ready\n" +
|
||||
"---- last 2 log lines ----\n" +
|
||||
"Unknown argument --save-dir\n" +
|
||||
"Usage: valheim_server.x86_64 ...\n"
|
||||
"Usage: example_server ...\n"
|
||||
got := bootFailure(out)
|
||||
if !strings.Contains(got, "failed: FAILED: container exited before it was ready") {
|
||||
t.Errorf("verdict missing: %s", got)
|
||||
@@ -19,19 +19,19 @@ func TestBootFailureKeepsVerdictAndServerOutput(t *testing.T) {
|
||||
if !strings.Contains(got, "Unknown argument --save-dir") || strings.Contains(got, "deploying boottest") {
|
||||
t.Errorf("want only the server's last lines, got: %s", got)
|
||||
}
|
||||
if v := bootVerdict("[boot-test] PASSED: READY: Game server connected"); v != "PASSED: READY: Game server connected" {
|
||||
if v := bootVerdict("[boot-test] PASSED: READY: Server ready"); v != "PASSED: READY: Server ready" {
|
||||
t.Errorf("verdict = %q", v)
|
||||
}
|
||||
}
|
||||
|
||||
func TestOutsideDirsSkipsSteamNoise(t *testing.T) {
|
||||
r := &bootReport{ContainerChanges: []string{
|
||||
"A /home/steam/.config/unity3d/IronGate/Valheim/worlds_local/w.db",
|
||||
"A /home/steam/.config/example-game/worlds/w.db",
|
||||
"A /home/steam/Steam/logs/connection_log.txt",
|
||||
"C /home/steam/.steam/registry.vdf",
|
||||
}}
|
||||
got := outsideDirs(r)
|
||||
if len(got) != 1 || got[0] != "/home/steam/.config/unity3d/IronGate/Valheim/worlds_local" {
|
||||
if len(got) != 1 || got[0] != "/home/steam/.config/example-game/worlds" {
|
||||
t.Errorf("got %v", got)
|
||||
}
|
||||
if outsideDirs(nil) != nil {
|
||||
@@ -40,9 +40,9 @@ func TestOutsideDirsSkipsSteamNoise(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestVariantNotes(t *testing.T) {
|
||||
v := variant{Title: "Crossplay", Description: "PC + Xbox", StartupHint: "./valheim_server.x86_64 -crossplay", Ports: []string{"2456/udp"}}
|
||||
v := variant{Title: "Crossplay", Description: "PC + Xbox", StartupHint: "./example_server -crossplay", Ports: []string{"30000/udp"}}
|
||||
got := variantNotes(v, "needs Xbox")
|
||||
for _, want := range []string{"variant: Crossplay (PC + Xbox)", "documented startup: ./valheim_server.x86_64 -crossplay", "2456/udp", "the admin asked for: needs Xbox"} {
|
||||
for _, want := range []string{"variant: Crossplay (PC + Xbox)", "documented startup: ./example_server -crossplay", "30000/udp", "the admin asked for: needs Xbox"} {
|
||||
if !strings.Contains(got, want) {
|
||||
t.Errorf("missing %q in %q", want, got)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user