Skip to content

ci: cover the desktop module, and stop the lock flake failing unrelated PRs - #161

Merged
navbytes merged 1 commit into
mainfrom
claude/ci-desktop-coverage-and-lock-flake
Jul 28, 2026
Merged

navbytes merged 1 commit into
mainfrom
claude/ci-desktop-coverage-and-lock-flake

Conversation

@navbytes

Copy link
Copy Markdown
Owner

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.yml had one gomod entry at directory: "/". Dependabot v2 doesn't auto-discover nested modules, so desktop/go.mod has never received an update PR.

2. govulncheck never saw it either

govulncheck ./... runs from the root, where go list ./... returns zero desktop packages. Between the two gaps, that module had no automated dependency watcher of any kind:

Check Covered desktop/ before this PR?
go build (ci.yml) ✅ compile step exists
gofmt -l . ✅ incidental — walks the tree, not the module graph
go vet ❌
golangci-lint ❌
govulncheck ❌
CodeQL ❌
Dependabot ❌

That'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/crypto lives 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. Confirmed go list ./... in desktop/ returns a package, so the step isn't a silent no-op.

3. 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 queues behind 24 predecessors against lock.DefaultTimeout = 2s. On a loaded runner that budget runs out and the test fails with nt 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: Engine gains an optional LockTimeout. Zero means lock.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, and dependabot.yml now resolves gomod directories ["/", "/desktop"].

govulncheck itself can't run from this environment (vuln.go.dev returns 403), so CI is the check on the new desktop step.


Generated by Claude Code

…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
@navbytes
navbytes marked this pull request as ready for review July 28, 2026 14:09
@navbytes
navbytes merged commit 899539b into main Jul 28, 2026
9 checks passed
@navbytes
navbytes deleted the claude/ci-desktop-coverage-and-lock-flake branch July 28, 2026 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants