beads/examples/library-usage/go.mod
Julian Knutsen d594092ebb
security: v1.3.0 dependency + toolchain bumps (7 reachable stdlib advisories, criticals triaged) (#6047)
* security: pin build toolchain to go1.26.7

go1.26.5 carries 8 stdlib advisories, 7 of them reachable from the shipped
bd binary. Verified with govulncheck in call-graph mode against ./cmd/bd,
toolchain pinned so the analysis cannot drift:

  GO-2026-6218  net/url        quadratic resolvePath
  GO-2026-6091  html/template  JS-regexp context tracking
  GO-2026-6090  crypto/tls     post-handshake message flood
  GO-2026-6089  net/http       ReadHeaderTimeout on the h2c check
  GO-2026-6088  encoding/xml   recursion depth
  GO-2026-5972  encoding/asn1  recursion depth
  GO-2026-5026  net/http       vendored x/net/idna punycode
  GO-2026-5942  net            dnsmessage SVCB/HTTPS RR (linked, uncalled)

`bd serve` is a real HTTP server and bd makes TLS client connections, so
these are live paths rather than dead weight: httpapi.Serve reaches four of
them directly. go1.26.6 fixes all eight; 1.26.7 adds one more net/http fix.
After the bump the same scan reports zero.

The `go` directive stays at 1.26.5 so importers of the module keep their
current floor; `toolchain` is what we actually build with. release.yml
builds the shipped binaries with a bare `go build` under the default
GOTOOLCHAIN=auto, which honors the toolchain line.

The Makefile needed the second half of this. It pinned GOTOOLCHAIN from the
`go` directive, which is the importer floor, not the build version - left
alone it would have held every make target (the test suite, the npm and MCP
package gates, local `make build`) at 1.26.5 while the release binaries
moved to 1.26.7, which is both a silent downgrade and a split between what
CI tests and what we ship. It now reads `toolchain` first and falls back to
`go` when there is no toolchain directive, preserving the original reason
for pinning: one exact version so the compile tools and coverage
instrumentation cannot disagree.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* security: bump x/crypto, x/mod, klauspost/compress, moby/go-archive

Four advisories, none reachable from the shipped bd binary; these are
hygiene bumps that also clear the Dependabot board.

  golang.org/x/crypto           v0.54.0 -> v0.55.0   GO-2026-6303
  golang.org/x/mod              v0.37.0 -> v0.40.0   GO-2026-6179/6180
  github.com/klauspost/compress v1.18.5 -> v1.18.7   GO-2026-5841
  github.com/moby/go-archive     v0.2.0 -> v0.3.3    CVE-2026-17106 (#140)

Reachability, from `go list -deps ./cmd/bd` plus govulncheck call-graph mode:
x/crypto/ssh proper enters only through testcontainers (test-only); the
compress advisory is in the s2 codec, which is not linked into bd at all
(bd links zstd/gzip/flate/huff0 via dolt); the x/mod sumdb/tlog code is
required but never called; go-archive is testcontainers-only and absent
from the binary's package graph entirely.

go-archive goes to v0.3.3, not the advisory's minimum v0.3.0: v0.3.0's
hardened extraction rejected absolute symlinks and hardlinks and broke
device nodes and implied directories, all fixed across v0.3.1-v0.3.3.

MVS carries x/net, x/text, x/tools and x/telemetry along. No replace
directives, and the dolt pin is untouched - dolt requires older versions of
all three x/ modules, so beads' go.mod already wins the version selection.

The examples/ modules reach the parent through a `replace` directive, so
their recorded graph goes stale on any root go.mod change and both failed
scripts/build-examples.sh with the documented "updates to go.mod needed".
Re-tidied here rather than left for the advisory job to warn about; the
diff is purely the mirror of the bumps above.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* security: bump oapi-codegen to v2.7.1 and kin-openapi to v0.144.0

Clears the board's one critical (#133, GHSA-r277-6w6q-xmqw, CVSS 9.1) plus
#142, #141, #134 and the low #132. All five are codegen-tool-only:
kin-openapi reaches the module graph solely through the go.mod `tool`
directive for oapi-codegen, no beads source file imports kin-openapi,
oapi-codegen or openapi3filter, and `go list -deps ./cmd/bd` contains none
of them. The critical is a fail-open bug in openapi3filter's
ValidationHandler.Load(), middleware this repo never runs - request
validation in internal/httpapi is hand-rolled. Dependabot scopes the alert
"runtime" because it cannot model Go tool-directive semantics.

Both must move together: oapi-codegen v2.6.0 does not compile against
kin-openapi v0.144.0 (pkg/codegen/schema.go:909, openapi3.MappingRef vs
string). v2.7.1 is the minimum-fix pair, chosen over the latest 2.8.0/0.149.0
to keep codegen churn off a release branch.

The `make api-gen` regen diff is two lines of real change: the generated
BearerTokenScopes constant picks up a generated named context-key type
instead of being an untyped string. The identifier has no references outside
types.gen.go. `make api-check` is green - regeneration is idempotent,
pinning.go's compile-time welds hold, and TestWireTagBijection passes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* security: refresh beads-mcp uv.lock (clears all 19 pip alerts)

`uv lock --upgrade` with fastmcp still pinned ==3.4.5. Every one of the 19
Dependabot alerts on integrations/beads-mcp/uv.lock is a fastmcp transitive,
and each lands at or above its first-patched version:

  mcp              1.25.0 -> 1.29.1   #129 #128 #127 (high)
  cryptography     48.0.0 -> 50.0.1   #137 #138 #82 #139
  pyjwt             2.12.1 -> 2.13.0  #79 #136 #81 #78 #135
  joserfc            1.6.5 -> 1.7.4   #113 #109
  python-multipart 0.0.27 -> 0.0.32   #88 #87 #86 #85
  idna                3.11 -> 3.19    #68

Real exposure was already low: beads-mcp runs stdio transport only
(server.py's mcp.run_async(transport="stdio")), so the three high mcp-SDK
alerts - WebSocket Host/Origin validation, HTTP session principal handling,
task-handler cross-access - are all HTTP/WS-transport bugs this server never
reaches, and the auth libraries ride along with fastmcp's extras rather than
being used by beads-mcp's own code. The lock governs dev and CI installs;
PyPI users resolve fresh and already get patched versions.

mcp 1.25 -> 1.29 is the only behaviorally interesting jump. The full package
gate is green: uv sync --locked, ruff, mypy, 228 passed / 5 skipped, uv build.
The resolved lock is byte-identical under uv 0.9.5 and CI's uv 0.11.16.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* chore(nix): update vendorHash for go.sum changes

The go.mod/go.sum bumps in this branch invalidate the proxyVendor
fixed-output hash in default.nix, which fails the nix-build gate. The
workflow that repairs this automatically only fires for dependabot PRs
targeting main, so it does not cover this branch.

Recomputed with scripts/update-nix-vendorhash.sh's flow and verified:
`nix build .#default` completes green, which also confirms the new
`toolchain go1.26.7` directive is compatible with default.nix's
GOTOOLCHAIN = "local".

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-28 23:26:04 -07:00

182 lines
9.8 KiB
Modula-2

module example.com/beads-library-demo
go 1.26.5
require github.com/steveyegge/beads v0.0.0
require (
cel.dev/expr v0.25.2 // indirect
cloud.google.com/go v0.121.6 // indirect
cloud.google.com/go/auth v0.18.2 // indirect
cloud.google.com/go/auth/oauth2adapt v0.2.8 // indirect
cloud.google.com/go/compute/metadata v0.9.0 // indirect
cloud.google.com/go/iam v1.5.3 // indirect
cloud.google.com/go/monitoring v1.24.3 // indirect
cloud.google.com/go/storage v1.56.0 // indirect
filippo.io/edwards25519 v1.2.0 // indirect
github.com/AlekSi/pointer v1.0.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.21.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.2 // indirect
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.6.4 // indirect
github.com/AzureAD/microsoft-authentication-library-for-go v1.6.0 // indirect
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.33.0 // indirect
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.53.0 // indirect
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.53.0 // indirect
github.com/HdrHistogram/hdrhistogram-go v1.1.2 // indirect
github.com/abiosoft/readline v0.0.0-20180607040430-155bce2042db // indirect
github.com/aliyun/aliyun-oss-go-sdk v3.0.2+incompatible // indirect
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 // indirect
github.com/apache/arrow/go/arrow v0.0.0-20211112161151-bc219186db40 // indirect
github.com/apache/thrift v0.23.0 // indirect
github.com/aws/aws-sdk-go-v2 v1.41.5 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.8 // indirect
github.com/aws/aws-sdk-go-v2/config v1.29.8 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.17.61 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.30 // indirect
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.64 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.21 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.21 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.22 // indirect
github.com/aws/aws-sdk-go-v2/service/dynamodb v1.41.0 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.7 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.9.13 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.10.15 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.21 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.21 // indirect
github.com/aws/aws-sdk-go-v2/service/s3 v1.97.3 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.25.0 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.29.0 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.33.16 // indirect
github.com/aws/smithy-go v1.24.2 // indirect
github.com/bcicen/jstream v1.0.1 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/clipperhouse/uax29/v2 v2.7.0 // indirect
github.com/cncf/xds/go v0.0.0-20260202195803-dba9d589def2 // indirect
github.com/cockroachdb/apd/v3 v3.2.3 // indirect
github.com/denisbrodbeck/machineid v1.0.1 // indirect
github.com/dolthub/aws-sdk-go-ini-parser v0.0.0-20250305001723-2821c37f6c12 // indirect
github.com/dolthub/dolt/go v0.40.5-0.20260715172757-a6690826d767 // indirect
github.com/dolthub/driver/v2 v2.2.0 // indirect
github.com/dolthub/eventsapi_schema v0.0.0-20260310172945-37a9265ade69 // indirect
github.com/dolthub/flatbuffers/v23 v23.3.3-dh.2 // indirect
github.com/dolthub/fslock v0.0.5 // indirect
github.com/dolthub/go-icu-regex v0.0.0-20260610153742-72563bc7ca83 // indirect
github.com/dolthub/go-mysql-server v0.20.1-0.20260713210757-6d01d00bbbf3 // indirect
github.com/dolthub/gozstd v0.0.0-20240423170813-23a2903bca63 // indirect
github.com/dolthub/ishell v0.0.0-20260414231531-5f031e3e9037 // indirect
github.com/dolthub/jsonpath v0.0.2-0.20240227200619-19675ab05c71 // indirect
github.com/dolthub/vitess v0.0.0-20260624214226-81d034e0fde8 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/edsrzf/mmap-go v1.2.0 // indirect
github.com/envoyproxy/go-control-plane/envoy v1.37.0 // indirect
github.com/envoyproxy/protoc-gen-validate v1.3.3 // indirect
github.com/esote/minmaxheap v1.0.0 // indirect
github.com/fatih/color v1.16.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/flynn-archive/go-shlex v0.0.0-20150515145356-3f9db97f8568 // indirect
github.com/fsnotify/fsnotify v1.9.0 // indirect
github.com/go-jose/go-jose/v4 v4.1.4 // indirect
github.com/go-logr/logr v1.4.4 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-sql-driver/mysql v1.10.0 // indirect
github.com/go-viper/mapstructure/v2 v2.4.0 // indirect
github.com/goccy/go-json v0.10.5 // indirect
github.com/gocraft/dbr/v2 v2.7.6 // indirect
github.com/gofrs/flock v0.8.1 // indirect
github.com/golang-jwt/jwt/v5 v5.3.0 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/btree v1.1.2 // indirect
github.com/google/go-github/v57 v57.0.0 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/s2a-go v0.1.9 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.11 // indirect
github.com/googleapis/gax-go/v2 v2.17.0 // indirect
github.com/hashicorp/golang-lru v1.0.2 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
github.com/juju/gnuflag v1.0.0 // indirect
github.com/kch42/buzhash v0.0.0-20160816060738-9bdec3dec7c6 // indirect
github.com/klauspost/compress v1.18.7 // indirect
github.com/klauspost/cpuid/v2 v2.2.6 // indirect
github.com/kylelemons/godebug v1.1.0 // indirect
github.com/lestrrat-go/strftime v1.2.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.22 // indirect
github.com/mattn/go-runewidth v0.0.23 // indirect
github.com/mohae/uvarint v0.0.0-20160208145430-c3f9e62bf2b0 // indirect
github.com/olebedev/when v1.1.0 // indirect
github.com/oracle/oci-go-sdk/v65 v65.55.0 // indirect
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
github.com/pierrec/lz4/v4 v4.1.21 // indirect
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pkg/profile v1.5.0 // indirect
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/procfs v0.16.1 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/sagikazarmark/locafero v0.11.0 // indirect
github.com/sergi/go-diff v1.4.0 // indirect
github.com/sirupsen/logrus v1.9.4 // indirect
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 // indirect
github.com/sony/gobreaker v0.5.0 // indirect
github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 // indirect
github.com/spf13/afero v1.15.0 // indirect
github.com/spf13/cast v1.10.0 // indirect
github.com/spf13/pflag v1.0.10 // indirect
github.com/spf13/viper v1.21.0 // indirect
github.com/spiffe/go-spiffe/v2 v2.7.0 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/tealeg/xlsx v1.0.5 // indirect
github.com/tidwall/gjson v1.18.0 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.1 // indirect
github.com/tidwall/sjson v1.2.5 // indirect
github.com/vbauerster/mpb/v8 v8.7.2 // indirect
github.com/xitongsys/parquet-go v1.6.2 // indirect
github.com/xitongsys/parquet-go-source v0.0.0-20240122235623-d6294584ab18 // indirect
github.com/xtaci/smux v1.5.56 // indirect
github.com/zeebo/xxh3 v1.0.2 // indirect
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
go.opentelemetry.io/contrib/detectors/gcp v1.44.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0 // indirect
go.opentelemetry.io/otel v1.45.0 // indirect
go.opentelemetry.io/otel/metric v1.45.0 // indirect
go.opentelemetry.io/otel/sdk v1.45.0 // indirect
go.opentelemetry.io/otel/sdk/metric v1.45.0 // indirect
go.opentelemetry.io/otel/trace v1.45.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/crypto v0.55.0 // indirect
golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b // indirect
golang.org/x/mod v0.40.0 // indirect
golang.org/x/net v0.58.0 // indirect
golang.org/x/oauth2 v0.36.0 // indirect
golang.org/x/sync v0.22.0 // indirect
golang.org/x/sys v0.47.0 // indirect
golang.org/x/telemetry v0.0.0-20260811182544-a038080d80e5 // indirect
golang.org/x/term v0.45.0 // indirect
golang.org/x/text v0.41.0 // indirect
golang.org/x/time v0.14.0 // indirect
golang.org/x/tools v0.49.0 // indirect
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
google.golang.org/api v0.264.0 // indirect
google.golang.org/genproto v0.0.0-20260128011058-8636f8732409 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20260803160001-6ac0973c030d // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260803160001-6ac0973c030d // indirect
google.golang.org/grpc v1.83.0 // indirect
google.golang.org/protobuf v1.36.11 // indirect
gopkg.in/go-jose/go-jose.v2 v2.6.3 // indirect
gopkg.in/src-d/go-errors.v1 v1.0.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
// For local development, replace with local path
replace github.com/steveyegge/beads => ../..