i2goSignals

goSignals v0.12.0-alpha.18

Released: TBD Compare: v0.12.0-alpha.17…v0.12.0-alpha.18

Why this release

This tag is the whole of planning spec #101 — Go 1.27 adoption — landed as ten slices (#270–#279) in one PR (#280), plus two randomness-hygiene fixes (#267, #268) that preceded it. The toolchain moved from Go 1.26.5 to 1.27.0 and go.mod now declares go 1.27.0; everything else in the release is the audit of what that makes possible or newly requires — stdlib uuid, crypto/mldsa, encoding/json/v2 under the v1 API, testing/synctest, the runtime’s goroutineleak profile, and the removal of the asynctimerchan GODEBUG escape hatch that used to make time.After in a loop survivable.

Two of the ten carry impact a consumer should read before upgrading.

The measured claim behind the toolchain bump is also worth stating plainly: the reported Go 1.27 slowdown does not reproduce. Under controlled conditions — identical source, a private empty build cache per toolchain, test result caching disabled — 1.27.0 runs this suite within ±1% of 1.26.5, race detector on or off, while JSON decode paths improve by −17% to −70%. The method and the full tables are in docs/perf/go127-baseline.md. And this alpha finally closes the gap the v0.12.0-alpha.16 and -alpha.17 notes both flagged: there is now a make qa gate (#270, absorbing #266), and its goroutine-leak stage found two real production leaks on its first run (#279).

Changes in this repo

Go 1.27, a measured performance baseline, and make qa (#270)

docs/perf/go127-baseline.md records the suite measured under go1.26.5 and go1.27.0 with a private empty build cache per toolchain and test caching disabled, and names the reference benchmark set — pkg/goSet, pkg/goSetValidate, pkg/goSetPoll, internal/eventRouter/buffer — that every later slice reports a delta against. Each slice’s row states its worst benchmark delta, not an average, so a regression cannot hide behind a set of improvements; the documented noise band on sub-microsecond benchmarks is 4–7%.

The headline table, 1.27.0 against 1.26.5 (GOEXPERIMENT=nojsonv2 returns each row to roughly its 1.26.5 timing, which is what attributes them):

Path 1.27.0 vs 1.26.5
Poll response decode (100 SETs) −70% (318 → 214 allocs/op)
Poll response encode (100 SETs) −66%
Poll request decode −48%
SET JSON unmarshal −33%
SET Peek (unverified parse) −17% (96 → 76 allocs/op)

One genuine regression: BenchmarkSetJsonBytes was +11% on 1.27.0 in exchange for a 16% allocation reduction; #273 gives most of it back (−6.2%).

make qa is now the gate — fmt-check vet tidy-check test leak-check bench, ordered cheapest-first so an obvious failure reports in seconds. tidy-check diffs what go mod tidy would change rather than applying it, and restores go.mod/go.sum on every exit path.

Post-quantum SET signing: ML-DSA-65 per stream (#278, ADR 0034)

Transport and token-header hardening (#271)

docs/security_model.md gains SET signature verification (algorithm allow-list) and Transport security floor sections recording both.

One identifier seam: pkg/dao/ids (#274)

pkg/dao/ids offers three shapes and states which a caller should reach for — NewObjectID for a record id a DAO converts back into a bson.ObjectID, NewV7 where mint order is useful, NewSecret where an embedded timestamp or an ordering would be a leak. A tree-walking test fails the build if the Mongo driver’s own ObjectID constructor reappears anywhere but the Mongo provider packages — including in _test.go files, which is how the ~50 test-file calls it just removed accumulated. model.NewRecordId carries the Mongo-shaped group across the type boundary and only re-types it.

Which sites moved, and why it is a semantic decision rather than a rename: GenerateJti, the inbound SSTP SID and the CLI’s SET txn become UUIDv7 (all want ordering; the inbound SID resolves through a string index, never as a document _id). OAuth state at both receiver verification sites becomes UUIDv4 — a v7 would publish the moment it was minted. Stream, client and server record _ids, the tx-side pair id and the key rotation suffix stay Mongo-shaped, because the Mongo stream DAO looks records up with ParseObjectID and a UUID there would be a not-found rather than a slow lookup.

Removing the ksuid jti removed the last use of github.com/segmentio/ksuid, and SecurityEventToken.IsBefore — a jti string comparison with no callers — went with it. ADR 0024 and the ADR index were corrected to say UUIDv7 where they said ksuid.

crypto.Signer at the nine signing sites (#277)

Key plumbing generalises from *rsa.PrivateKey to crypto.Signer at all nine SET and OAuth signing sites, so #278 could add a lattice key without touching a call site. Behaviour is unchanged in this slice — RSA-2048 / RS256 remains the default, and the narrowings that remain are at key load, rotation and JWKS build, not per SET. dao.KeyPairData.PrivateKey is a crypto.Signer; its public half stays *rsa.PublicKey because the stored JWK encoding is the RSA n/e form.

JSON wire hygiene: omitzero, golden fixtures, compact poll (#273)

Golden-JSON conformance fixtures were pinned first — 33 files across pkg/ssfModels and pkg/goSetPoll, in zero / mixed / populated triples — and then the retags landed against them:

Across #274–#279 the goldens moved by exactly one member — signing_alg, in the two populated fixtures only, with the zero and mixed fixtures byte-identical, which is the omitzero guarantee holding.

Faster JSON on the SET paths (#276)

Timer hygiene and the goroutine-leak gate (#275, #279)

Go 1.27 removes the asynctimerchan GODEBUG escape hatch, so time.After inside a loop now leaks an armed timer per iteration until it fires. Every such use is replaced with an owned *time.Timer stopped on all exit paths behind one ctx-aware sleep helper; a dead idle-drain path is deleted; Mongo coordinator heartbeats are scoped to the server lifecycle context so they stop at shutdown instead of outliving it. internal/timerlint keeps the rule from decaying.

#279 names the lease-heartbeat and T3-keepalive loops as seams and covers them with testing/synctest suites that make lease, backoff and T3 idle timing deterministic rather than sleep-based, then adds a leak-check stage to make qa running Go 1.27’s goroutineleak runtime profile over the four timer-owning packages (pkg/goSetPoll/..., pkg/goSetPush/..., internal/eventRouter/..., internal/server). It is a proof, not the old count-before-and-after heuristic, so there is no tolerance to tune. It found two real production goroutine leaks on its first run, both fixed here:

The gate is inert unless I2SIG_GOROUTINE_LEAK_CHECK is set, so the ordinary go test ./... edit loop is unchanged.

Randomness hygiene (#267, #268)

Build and dependencies

Compatibility

Go 1.27.0 is required to build this tag. go.mod declares it, and the code uses the stdlib uuid package, crypto/mldsa, testing/synctest and the goroutineleak profile. A consumer still on 1.26.x cannot compile against v0.12.0-alpha.18.

The key-handling surface is source-breaking for anything that binds an *rsa.PrivateKey. crypto.Signer replaces it on KeyService.CreateKeyPair, RotateKey, AddKey, GetPrivateKey, GetPrivateKeyWithKeyname and GetPrivateKeyByKid, on dao.KeyPairData.PrivateKey, on AuthIssuer.UpdateTokenKey, and on goSet.SecurityEventToken.JWS. Enterprise’s only call sites discard the returned key, so it recompiles unchanged; a caller that assigns the result to an *rsa.PrivateKey needs a type assertion. SecurityEventToken.IsBefore was removed (dropped with ksuid; it had no callers).

New exported surface, all additive: package pkg/goSet/mldsa (SigningMethodMLDSA, AKPKey, ParseAKPJWK, GenerateKey, Params); goSet.AllowedAlgs, SigningMethodFor, SigningMethodOrRS256, NewJwksWithAKP, AKPGivenKeys; ids.NewV7 / ids.NewSecret; model.NewRecordId; ssfModels.StreamConfiguration.SigningAlg; KeyService.GetSigner and EnsureSigningKeyForAlg; dao.JwkKeyRec.Alg; tlsSupport.Harden; authSupport.GenerateAlias; and package pkg/goroutineleak.

Behavioural changes an operator should know about:

New configuration: I2SIG_TLS_PQ_KEM (§TLS) and CERT_KEY_ALG (§genTlsKeys) in docs/configuration_properties.md, plus the signing_alg member on a stream configuration.

Verification

make qa is now the gate — fmt-check vet tidy-check test leak-check bench — which closes the “no test or quality gate” gap the v0.12.0-alpha.16 and -alpha.17 notes both called out (#266, closed as absorbed into #270). Green on 571e5fb: gofmt clean, go vet clean, go mod tidy clean, go test -race ./... 53 packages ok / 0 FAIL, goroutine-leak profile clean over the four timer-owning packages, benchmark set runs. The spec baseline (release-0.12.0 @ fe5a799) was 40 packages ok / 0 FAIL; the growth is packages these slices added, and there are no new failures.