Repository navigation
ci: cover the desktop module, and stop the lock flake failing unrelated PRs - #161
Merged
Merged
Conversation
…ed PRs Three fixes for gaps the multi-agent field test surfaced. **Dependabot never saw desktop/.** `.github/dependabot.yml` had a single gomod entry at directory "/", and Dependabot v2 does not auto-discover nested modules. Combined with the govulncheck gap below, that module had no automated dependency watcher of any kind — which is why x/net, x/crypto and x/text there have all needed hand-written catch-up bumps (3966536, 98d1a9d, and #160 an hour ago). **govulncheck never saw it either.** `govulncheck ./...` runs from the root, where `go list ./...` returns zero desktop packages, so a CVE in that module's graph could sit indefinitely. Scanned without Wails build tags, matching what ci.yml's compile step already does — the dependency graph is the point here, not the cgo build. **TestConcurrentAddsNoLostUpdate was a wall-clock race.** It fires 25 goroutines at one flock; each Apply serializes a full acquire-read-mutate-write cycle, so the last writer waits behind 24 predecessors against lock.DefaultTimeout's 2s. On a loaded runner that budget runs out and the test fails with "nt store is busy" — asserting the runner's speed rather than the lock-and-re-read contract it exists to check. It failed exactly this way on #160 and passed on a byte-identical re-push. Engine gains an optional LockTimeout (zero = lock.DefaultTimeout, so every production path is unchanged) and the test sets a generous one. The lost-update assertion is untouched — a broken lock contract still fails it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FgqQf7Lvou5F5as9aNmagu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Three CI gaps surfaced by the multi-agent field test in #159. All independent; happy to split if you'd rather.
1. Dependabot never saw
desktop/.github/dependabot.ymlhad one gomod entry atdirectory: "/". Dependabot v2 doesn't auto-discover nested modules, sodesktop/go.modhas never received an update PR.2.
govulnchecknever saw it eithergovulncheck ./...runs from the root, wherego list ./...returns zero desktop packages. Between the two gaps, that module had no automated dependency watcher of any kind:desktop/before this PR?go build(ci.yml)gofmt -l .go vetThat's why its deps have needed hand-written catch-up bumps three times —
3966536(x/net),98d1a9d(x/crypto), and #160 an hour ago (x/text).golang.org/x/cryptolives only there, so it had no watcher at all.Scanned without Wails build tags, matching what
ci.yml's existing compile step does — the dependency graph is the point here, not the cgo build. Confirmedgo list ./...indesktop/returns a package, so the step isn't a silent no-op.3.
TestConcurrentAddsNoLostUpdatewas a wall-clock raceIt fires 25 goroutines at one flock. Each
Applyserializes a full acquire → read → mutate → write cycle, so the last writer queues behind 24 predecessors againstlock.DefaultTimeout= 2s. On a loaded runner that budget runs out and the test fails withnt store is busy— asserting how fast CI happens to be, not the lock-and-re-read contract it exists to check.Not hypothetical: it failed exactly this way on #160, then passed on a byte-identical re-push (same tree, new SHA). That's the controlled proof.
Fix:
Enginegains an optionalLockTimeout. Zero meanslock.DefaultTimeout, so every production path is unchanged — all four call sites (mutate,undo,doctor,archive) now route through one helper that resolves the zero value. The test sets a generous timeout.The lost-update assertion is untouched: a genuinely broken lock contract still fails it. Only the artificial timeout failure goes away.
Verification
go build,go vet ./...,go test ./...clean. The previously-flaky test run 15× consecutively — green. Both YAML files parse, anddependabot.ymlnow resolves gomod directories["/", "/desktop"].govulncheckitself can't run from this environment (vuln.go.devreturns 403), so CI is the check on the new desktop step.Generated by Claude Code