feat(builder): research, build and a worker for the AI builder
- research: searches SearXNG, reads the best pages through the reader, has the model list the server's variants, then checks every Docker image and Steam app it named for real before an admin sees it. - build: first boot of the variant's images (skipping ones that need root), a draft by the model, then the draft deployed with the node-agent's BootTest like CI does; crashes, error lines and saves outside /server go back to the model, three boots at most. - worker: polls the panel's builder queue (outbound only), runs research or build in a fresh clone, streams the output as the job log, and opens the result as a pull request from the bot account. - Dockerfile.builder, a workflow publishing gbr-builder:latest, and BUILDER.md. Everything about where it runs comes from environment variables; deployment files live outside this public repo. draft now keeps its conversation in a drafter, so build can send boot failures back to the same model session. The boot-test runner comment no longer names its VM. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
05bfc9b061
commit
c75190d8c4
12 files changed
+1495
-95
No files matched your search
@@ -0,0 +1,41 @@
|
||||
package main
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestPickPagesPrefersDocsAndOnePerSite(t *testing.T) {
|
||||
hits := []searchHit{
|
||||
{URL: "https://blog.example.com/valheim-server"},
|
||||
{URL: "https://github.com/a/valheim-docker"},
|
||||
{URL: "https://github.com/b/other"},
|
||||
{URL: "https://hub.docker.com/r/x/valheim"},
|
||||
{URL: "https://blog.example.com/valheim-server"},
|
||||
}
|
||||
got := pickPages(hits, 3)
|
||||
if len(got) != 3 {
|
||||
t.Fatalf("got %d pages", len(got))
|
||||
}
|
||||
if got[0].URL != "https://github.com/a/valheim-docker" || got[1].URL != "https://hub.docker.com/r/x/valheim" || got[2].URL != "https://blog.example.com/valheim-server" {
|
||||
t.Errorf("order: %v", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestTrimToJSON(t *testing.T) {
|
||||
if got := trimToJSON("Here you go:\n```json\n{\"a\": 1}\n```"); got != `{"a": 1}` {
|
||||
t.Errorf("got %q", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestAppNameFromAppInfo(t *testing.T) {
|
||||
out := `"896660"
|
||||
{
|
||||
"common"
|
||||
{
|
||||
"name" "Valheim Dedicated Server"
|
||||
"type" "Tool"
|
||||
}
|
||||
}`
|
||||
m := appName.FindStringSubmatch(out)
|
||||
if m == nil || m[1] != "Valheim Dedicated Server" {
|
||||
t.Errorf("got %v", m)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user