Skip to content

chore(lint): enforce the no-sleep discipline in CI (RIG-3013) - #748

Merged
mattwilkinsonn merged 1 commit into
mainfrom
compass-repo/rig-3013-no-sleep-ci-gate
Aug 30, 2026
Merged

chore(lint): enforce the no-sleep discipline in CI (RIG-3013)#748
mattwilkinsonn merged 1 commit into
mainfrom
compass-repo/rig-3013-no-sleep-ci-gate

Conversation

@rigel-mintaka

Copy link
Copy Markdown
Contributor

The no-fixed-sleep discipline was agent guidance only: rule://go-no-sleep-in-test (Go) and rule://ts-no-test-timers (TS) nudge an agent mid-write, but nothing in CI failed the build on a blind sleep. A prior cleanup removed the flaky sleeps, so the tree is clean today — this gives the conventions CI teeth so a future one can't land unchallenged.

Reuses linters already on PATH; no new gate, no new tool:

  • Goforbidigo (already active under golangci's default: all) bans time.Sleep via a settings.forbidigo.forbid entry in go/.golangci.yml. The default fmt.Print*/print(ln) identifiers are restated (a forbid list replaces them). Escape is //nolint:forbidigo // <reason>, reusing the existing nolintlint reason-required + stale-flagging machinery.
  • TS/Bun — biome noRestrictedGlobals (stable style rule) bans setTimeout/setInterval in the single root biome.json. Escape is // biome-ignore lint/style/noRestrictedGlobals: <reason>. Effect.sleep is exempt — it is fiber-scheduled and TestClock-testable, the correct primitive.

Every current call site is genuinely legit and carries a justified escape naming its reason: poll-until-ready loops with a deadline, testing/synctest virtual-clock advances, timeout-as-assertion guards, library macrotask yields, and abort-aware production backoff.

Verified: golangci-lint run exit 0, biome check . exit 0, and a fresh unjustified sleep fails each gate with the intended message.

Follow-up (not here): two real timed waits in apps/ui/src/components/MarkdownText.test.tsx wait out the component's real debounce; converting them to fake timers is component-test surgery (Solid + async Shiki, no fake timers in the suite today) and is flagged inline for a dedicated PR.

Spec-impact: none. Refs RIG-3013

Co-authored-by: Matt Wilkinson matt@rigel.build

@linear-code

linear-code Bot commented Aug 30, 2026

Copy link
Copy Markdown

RIG-3013

@github-actions

github-actions Bot commented Aug 30, 2026

Copy link
Copy Markdown

Compass engineering docs preview: https://compass-repo-rig-3013-no-sle.compass-eng-docs.pages.dev

Deployed from compass-repo/rig-3013-no-sleep-ci-gate at df388fb.

The no-fixed-sleep discipline was agent guidance only: `rule://go-no-sleep-in-test` (Go) and `rule://ts-no-test-timers` (TS) nudge an agent mid-write, but nothing in CI failed the build on a blind sleep. A prior cleanup removed the flaky sleeps, so the tree is clean today — this gives the conventions CI teeth so a future one can't land unchallenged.

Reuses linters already on PATH; no new gate, no new tool:

- **Go** — `forbidigo` (already active under golangci's `default: all`) bans `time.Sleep` via a `settings.forbidigo.forbid` entry in `go/.golangci.yml`. The default `fmt.Print*`/`print(ln)` identifiers are restated (a `forbid` list replaces them). Escape is `//nolint:forbidigo // <reason>`, reusing the existing `nolintlint` reason-required + stale-flagging machinery.
- **TS/Bun** — biome `noRestrictedGlobals` (stable `style` rule) bans `setTimeout`/`setInterval` in the single root `biome.json`. Escape is `// biome-ignore lint/style/noRestrictedGlobals: <reason>`. `Effect.sleep` is exempt — it is fiber-scheduled and TestClock-testable, the correct primitive.

Every current call site is genuinely legit and carries a justified escape naming its reason: poll-until-ready loops with a deadline, `testing/synctest` virtual-clock advances, timeout-as-assertion guards, library macrotask yields, and abort-aware production backoff.

Verified: `golangci-lint run` exit 0, `biome check .` exit 0, and a fresh unjustified sleep fails each gate with the intended message.

Follow-up (not here): two real timed waits in `apps/ui/src/components/MarkdownText.test.tsx` wait out the component's real debounce; converting them to fake timers is component-test surgery (Solid + async Shiki, no fake timers in the suite today) and is flagged inline for a dedicated PR.

Spec-impact: none. Refs RIG-3013

Co-authored-by: Matt Wilkinson <matt@rigel.build>
@rigel-mintaka
rigel-mintaka force-pushed the compass-repo/rig-3013-no-sleep-ci-gate branch from 92548ae to df388fb Compare August 30, 2026 19:53
@mattwilkinsonn
mattwilkinsonn merged commit d48664a into main Aug 30, 2026
13 checks passed
@mattwilkinsonn
mattwilkinsonn deleted the compass-repo/rig-3013-no-sleep-ci-gate branch August 30, 2026 20:20
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