Skip to content

armgit / avibe

Public Imported from GitHub
0

Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.

build(model-hub): add the Go module security refresh for model-hub-engine-v8.0.30-2 (#2917)

Call White08413afe5b7d
diff --git a/patches/model-hub-cpa-v8.0.30/README.md b/patches/model-hub-cpa-v8.0.30/README.md
index 884c9f1f7..e30f5103b 100644
--- a/patches/model-hub-cpa-v8.0.30/README.md
+++ b/patches/model-hub-cpa-v8.0.30/README.md
@@ -1,9 +1,11 @@
# Avibe-owned CPA v8.0.30 compatibility patches
This directory records the source patches carried by Avibe's
-`model-hub-engine-v8.0.30-1` build. The build applies them with
-`git apply --whitespace=error`, in the order the manifest's `build.patches`
-records; each one applies on top of the ones before it.
+`model-hub-engine-v8.0.30-*` builds: `-1` carries patches 1 to 9, and `-2`
+adds patch 10, the Go module security refresh, built with Go 1.26.10. The
+build applies them with `git apply --whitespace=error`, in the order the
+manifest's `build.patches` records; each one applies on top of the ones before
+it. The packaged manifest names the build Avibe installs.
Base:
@@ -367,6 +369,57 @@ stripped, and properties named after the keywords survive. Dropping
Drop at the next bump to v8.0.33 or later, which contains a43026d7.
+## `go-module-security-refresh.patch`
+
+Patch 10, new in `model-hub-engine-v8.0.30-2`. `govulncheck -mode binary`
+reports eleven reachable advisories in the `-1` engine: GO-2026-6809 in the
+standard library's `crypto/x509` (Go 1.26.9) and ten in Go modules. The
+standard-library fix is the toolchain, Go 1.26.10, which the manifest records
+as `build.go_version`. This patch moves the modules to their first fixed
+releases:
+
+| Module | v8.0.30 | Patched | Advisories |
+| --- | --- | --- | --- |
+| `golang.org/x/net` | v0.57.0 | v0.60.0 | GO-2026-6603, -6610, -6611, -6612, -6617 (HTTP/2) |
+| `golang.org/x/crypto` | v0.54.0 | v0.57.0 | GO-2026-6354, -6355 (ssh) |
+| `golang.org/x/text` | v0.40.0 | v0.42.0 | GO-2026-6629 |
+| `github.com/go-git/go-git/v6` | v6.0.0-alpha.4.0.20260520124234-0860a7d8a164 | v6.0.0-alpha.5 | GO-2026-6213, -6214 |
+
+Only `x/net` v0.60.0 and `go-git` v6.0.0-alpha.5 are requested. Minimal
+version selection raises the rest: `x/net` v0.60.0 requires `x/crypto`
+v0.57.0, `x/text` v0.42.0 and `x/sys` v0.48.0, `x/text` v0.42.0 requires
+`x/sync` v0.23.0, and `go-git` v6.0.0-alpha.5 requires `go-billy`
+v6.0.0-alpha.2. `go mod tidy` then removes the go.sum lines of the replaced
+versions; no other requirement changes. Upstream v8.0.38, the latest release
+when this patch was made, and upstream `main` still require the vulnerable
+versions.
+
+`go-git` v6.0.0-alpha.5 rewrites pack file access (`internal/packhandle`,
+`x/fdpool`), and a repository handle can keep a pack open after it is deleted.
+Upstream's `corruptGitRepository` test helper removed the packs and then
+checked the corruption through the handle that had just repacked them, which
+still reads them. The patch makes the helper check through a new handle, as
+the store's own operations open one. With that change, every
+`internal/store` test passes unchanged on v6.0.0-alpha.5, and the helper still
+fails when the packs are not removed. The test change does not alter the
+engine binary. `internal/store`'s git token store is the engine's only
+`go-git` user. Avibe never enables it: it needs `GITSTORE_GIT_URL`, which
+the engine's allow-listed environment (`vibe/model_hub_runtime/environment.py`)
+does not pass and no `.env` in the engine's Avibe-owned working directory sets.
+
+Measured with Go 1.26.10. With all ten patches applied, `go test ./...`
+passes: 102 packages, as on the unrefreshed tree. Patches 4 and 5's HTTP/2
+health-check tests also pass on `x/net` v0.60.0. Two candidate builds from
+empty Go caches were byte-identical. `govulncheck -mode binary` reports no
+reachable advisory on any of the six binaries. It still lists two advisories
+it does not find called: GO-2026-5841 (`klauspost/compress/s2`, imported but
+not called) and GO-2026-5932 (`x/crypto/openpgp`, deprecated with no fix).
+
+Drop it once a CPA release that Avibe adopts requires these versions or later.
+At every bump, rebase it onto the new `go.mod` and keep only the lines upstream
+does not already cover, then re-run `govulncheck -mode binary` on the
+candidate.
+
## Known risk: model registration superseded mid-flight (#6718)
v8.0.29 (08e5762a) fences model registration with epochs. A registration that
diff --git a/patches/model-hub-cpa-v8.0.30/go-module-security-refresh.patch b/patches/model-hub-cpa-v8.0.30/go-module-security-refresh.patch
new file mode 100644
index 000000000..dfe435cdd
--- /dev/null
+++ b/patches/model-hub-cpa-v8.0.30/go-module-security-refresh.patch
@@ -0,0 +1,133 @@
+diff --git a/go.mod b/go.mod
+index 145d668..3a135bd 100644
+--- a/go.mod
++++ b/go.mod
+@@ -10,7 +10,7 @@ require (
+ github.com/charmbracelet/lipgloss v1.1.0
+ github.com/fsnotify/fsnotify v1.9.0
+ github.com/gin-gonic/gin v1.10.1
+- github.com/go-git/go-git/v6 v6.0.0-alpha.4.0.20260520124234-0860a7d8a164
++ github.com/go-git/go-git/v6 v6.0.0-alpha.5
+ github.com/google/uuid v1.6.0
+ github.com/gorilla/websocket v1.5.3
+ github.com/jackc/pgx/v5 v5.9.2
+@@ -31,12 +31,12 @@ require (
+ github.com/tidwall/gjson v1.18.0
+ github.com/tidwall/sjson v1.2.5
+ github.com/tiktoken-go/tokenizer v0.8.1
+- golang.org/x/crypto v0.54.0
+- golang.org/x/net v0.57.0
++ golang.org/x/crypto v0.57.0
++ golang.org/x/net v0.60.0
+ golang.org/x/oauth2 v0.30.0
+- golang.org/x/sync v0.22.0
+- golang.org/x/sys v0.47.0
+- golang.org/x/text v0.40.0
++ golang.org/x/sync v0.23.0
++ golang.org/x/sys v0.48.0
++ golang.org/x/text v0.42.0
+ gopkg.in/natefinch/lumberjack.v2 v2.2.1
+ gopkg.in/yaml.v3 v3.0.1
+ )
+@@ -84,7 +84,7 @@ require (
+ github.com/gabriel-vasile/mimetype v1.4.3 // indirect
+ github.com/gin-contrib/sse v0.1.0 // indirect
+ github.com/go-git/gcfg/v2 v2.0.2 // indirect
+- github.com/go-git/go-billy/v6 v6.0.0-alpha.1.0.20260519112248-0095b064a6c6 // indirect
++ github.com/go-git/go-billy/v6 v6.0.0-alpha.2 // indirect
+ github.com/go-playground/locales v0.14.1 // indirect
+ github.com/go-playground/universal-translator v0.18.1 // indirect
+ github.com/go-playground/validator/v10 v10.20.0 // indirect
+diff --git a/go.sum b/go.sum
+index 5b69fa6..a902e87 100644
+--- a/go.sum
++++ b/go.sum
+@@ -73,12 +73,12 @@ github.com/gliderlabs/ssh v0.3.8 h1:a4YXD1V7xMF9g5nTkdfnja3Sxy1PVDCj1Zg4Wb8vY6c=
+ github.com/gliderlabs/ssh v0.3.8/go.mod h1:xYoytBv1sV0aL3CavoDuJIQNURXkkfPA/wxQ1pL1fAU=
+ github.com/go-git/gcfg/v2 v2.0.2 h1:MY5SIIfTGGEMhdA7d7JePuVVxtKL7Hp+ApGDJAJ7dpo=
+ github.com/go-git/gcfg/v2 v2.0.2/go.mod h1:/lv2NsxvhepuMrldsFilrgct6pxzpGdSRC13ydTLSLs=
+-github.com/go-git/go-billy/v6 v6.0.0-alpha.1.0.20260519112248-0095b064a6c6 h1:AaQOU2NVLxnBGWkv5YSoxomcDCqlaqfCW0t00pNKtnk=
+-github.com/go-git/go-billy/v6 v6.0.0-alpha.1.0.20260519112248-0095b064a6c6/go.mod h1:eaCUpHbedW7//EwcYmUDfJe2N6sJC9O12AT0OTqJR1E=
++github.com/go-git/go-billy/v6 v6.0.0-alpha.2 h1:1Sv5WemXL8CxKrAx1gioJ+uHNb2bZJhiQLfwSZ4Et8c=
++github.com/go-git/go-billy/v6 v6.0.0-alpha.2/go.mod h1:r/bsv9i/iDyyEU8/Z6mjC+YraOVwie1ddfUqBCElKXQ=
+ github.com/go-git/go-git-fixtures/v6 v6.0.0-alpha.1 h1:gmqi2jvsreu0s8JMLylYDFq4sbjHwwlhktMw0DUg3mA=
+ github.com/go-git/go-git-fixtures/v6 v6.0.0-alpha.1/go.mod h1:ECf1MqJlBdYpKggBrOXjo/0EnvRZx6D++I86UYjPgAQ=
+-github.com/go-git/go-git/v6 v6.0.0-alpha.4.0.20260520124234-0860a7d8a164 h1:chk74EHqDOHvIx/WH43JfdLImedxN98qGvEFd7WYgus=
+-github.com/go-git/go-git/v6 v6.0.0-alpha.4.0.20260520124234-0860a7d8a164/go.mod h1:OTUSi3RzPFoC0j/+uxHdVG1X/xXz84QCxLzYvXRvyXk=
++github.com/go-git/go-git/v6 v6.0.0-alpha.5 h1:sE+OlkHgYWNMVmN1s9sR7uyFgsWLtxcNWse/vBYKxRE=
++github.com/go-git/go-git/v6 v6.0.0-alpha.5/go.mod h1:3IjhiZnM+uBmUrOGSeqrJpsmi4Vd0H2NZO/uK2a7d0s=
+ github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=
+ github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
+ github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=
+@@ -253,19 +253,19 @@ go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0
+ golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8=
+ golang.org/x/arch v0.8.0 h1:3wRIsP3pM4yUptoR96otTUOXI367OS0+c9eeRi9doIc=
+ golang.org/x/arch v0.8.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys=
+-golang.org/x/crypto v0.54.0 h1:YLIA59K4fiNzHzjnZt2tUJQjQtUWfWbeHBqKtk3eScw=
+-golang.org/x/crypto v0.54.0/go.mod h1:KWL8ny2AZdGR2cWmzeHrp2azQPGogOv+HeQaVEXC2dk=
++golang.org/x/crypto v0.57.0 h1:3ZVCjf8Ggz7zneR/EHRVx68Ctf+2pmIMP2UFhh9cC6M=
++golang.org/x/crypto v0.57.0/go.mod h1:Fdz0i5U6CoizGwLda9DttjSk6qlZo25zYNtR+ycvuZA=
+ golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI=
+ golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo=
+ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
+ golang.org/x/net v0.0.0-20210423184538-5f58ad60dda6/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk=
+-golang.org/x/net v0.57.0 h1:K5+3DljvIuDG9/Jv9rvyMywYNFCQ9RSUY6OOTTkT+tE=
+-golang.org/x/net v0.57.0/go.mod h1:KpXc8iv+r3XplLAG/f7Jsf9RPszJzdR0f58q9vGOuEU=
++golang.org/x/net v0.60.0 h1:79p50tfZlm0J9YfoDsSi639qSXNGVwEzOPLCxM2FsYU=
++golang.org/x/net v0.60.0/go.mod h1:2DA/G1UfVbCpQPeWTmMPGY7Cs2PkBkwu743bVX5PIVg=
+ golang.org/x/oauth2 v0.30.0 h1:dnDm7JmhM45NNpd8FDDeLhK6FwqbOf4MLCM9zb1BOHI=
+ golang.org/x/oauth2 v0.30.0/go.mod h1:B++QgG3ZKulg6sRPGD/mqlHQs5rB3Ml9erfeDY7xKlU=
+ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+-golang.org/x/sync v0.22.0 h1:SZjpbeLmrCk4xhRSZFNZW5gFUeCeFgjekvI/+gfScek=
+-golang.org/x/sync v0.22.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
++golang.org/x/sync v0.23.0 h1:KameEIfc1IkluZyXWLn39Wd4tURc6GbCiISGiZm2bQk=
++golang.org/x/sync v0.23.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0=
+ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+ golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+@@ -273,15 +273,15 @@ golang.org/x/sys v0.0.0-20210426080607-c94f62235c83/go.mod h1:h1NjWce9XRLGQEsW7w
+ golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+ golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+-golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs=
+-golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
++golang.org/x/sys v0.48.0 h1:bbX/i/6MgT9BVLM9RT1thmxL04yeTAhbEz4SyadbXoo=
++golang.org/x/sys v0.48.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og=
+ golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
+-golang.org/x/term v0.45.0 h1:NwWyBmoJCbfTHpxrWoZ9C6/VxOf7ic219I8xZZFdrf0=
+-golang.org/x/term v0.45.0/go.mod h1:9aqxs0blBcrm/n0L9QW0aRVD+ktan8ssZromtqJC43w=
++golang.org/x/term v0.46.0 h1:3+OXuTbaKDgwk8jTi3aSLHRlmWqHEUDUtxnbFigO4YE=
++golang.org/x/term v0.46.0/go.mod h1:+K02xbkittuwc0Am4abfA3Fc+XRGXkvBXNO88NCXPoc=
+ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
+ golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
+-golang.org/x/text v0.40.0 h1:Ub2Z6/xjgF1WrYQz2nuITOEegKFtiIy+rieRJ5lHZKs=
+-golang.org/x/text v0.40.0/go.mod h1:hpnzDAfGV753zIKo+wk3u1bVKCGPbrnF7+7LBF/UHVY=
++golang.org/x/text v0.42.0 h1:JbOZXgfeCPU9gacVtYliJqOhD+zhrEqK4LfdpmlUZqI=
++golang.org/x/text v0.42.0/go.mod h1:ojzP1Z+2QtioaF8DTtO8K5q7JWVVYwZKenzujK0Zd0E=
+ golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI=
+ golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4=
+ golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+diff --git a/internal/store/gitstore_test.go b/internal/store/gitstore_test.go
+index d7123c0..366e8aa 100644
+--- a/internal/store/gitstore_test.go
++++ b/internal/store/gitstore_test.go
+@@ -1830,7 +1830,18 @@ func corruptGitRepository(t *testing.T, repoDir string) {
+ t.Fatalf("remove packfile %s: %v", filepath.Base(packfile), errRemove)
+ }
+ }
+- if errVerify := verifyRepositoryHead(repo); !isRepositoryCorruptionError(errVerify) {
++ // The handle that repacked may still hold the removed packs open, so check
++ // the corruption through a new handle, as the store's operations open one.
++ reopened, errReopen := git.PlainOpen(repoDir)
++ if errReopen != nil {
++ t.Fatalf("reopen corrupted repository: %v", errReopen)
++ }
++ defer func() {
++ if errClose := reopened.Close(); errClose != nil {
++ t.Errorf("close reopened repository: %v", errClose)
++ }
++ }()
++ if errVerify := verifyRepositoryHead(reopened); !isRepositoryCorruptionError(errVerify) {
+ t.Fatalf("verifyRepositoryHead error = %v, want repository corruption", errVerify)
+ }
+ }