Skip to content

Use Arr.getSomes for optional array entries - #207

Merged
cursor[bot] merged 1 commit into
masterfrom
cursor/effect-option-array-idiom-e7eb
Nov 29, 2026
Merged

cursor[bot] merged 1 commit into
masterfrom
cursor/effect-option-array-idiom-e7eb

Conversation

@jonbeckman

Copy link
Copy Markdown
Contributor

Summary

Service code already keeps present Option values with Arr.getSomes. Ten call sites still did that by hand: flatMap plus Option.match returning [] or [value]. Those sites now use Arr.getSomes. The kept values, their order, and the records built from them are unchanged.

effect/prefer-array-fromoption-over-option-match-empty is an error on the Effect service files, so that manual pattern cannot come back. Four other Effect rules already had no violations on those files, and they are errors now:

  • effect/no-effect-ignore-then-as
  • effect/avoid-yield-ref
  • effect/avoid-mutable-state
  • effect/context-tag-extends

This change has no user-visible effect. It uses the release:none label and does not add a Tegami entry.

Validation

  • nub run config:check
  • nub run typecheck
  • nub run lint (clean with the new rules)
  • nub run format
  • The pre-push hook ran typecheck, lint, and format again.
  • nub run test was not run. Each call still drops empty options and keeps the same values in the same order. No route or screen changed.

Checklist

  • I added or updated tests for behavior changes, or explained why tests are not needed.
  • I updated documentation and config examples when behavior or configuration changed.
  • I added a .tegami/ release entry, or explained why this pull request uses release:none.
  • I ran nub run config:check, nub run typecheck, nub run lint, nub run format, and nub run test.
  • I did not include credentials, private data, internal URLs, or organization-specific defaults.
  • I updated THIRD_PARTY_NOTICES.md for new third-party code or separately licensed assets.
Open in Web Open in Cursor 

Option.match that returns [] or [value] is Arr.getSomes. The remaining
service call sites now use that helper, and the Effect lint rule blocks
the manual pattern. Four other Effect rules that the service code
already follows are errors too.

Co-authored-by: Jonathan Beckman <jonathantbeckman@gmail.com>
@jonbeckman jonbeckman added the release:none label Nov 29, 2026 — with Cursor
@jonbeckman
jonbeckman marked this pull request as ready for review November 29, 2026 09:20
@github-actions

Copy link
Copy Markdown
Contributor

Tegami

This repository uses Tegami to manage releases. When your changes affect published packages, add a changelog file under .tegami/ before merging.

Create a changelog → · Changelog format

No changelogs yet

This PR has no pending changelog files. If your changes require a release, add a changelog before merging.

Run nub run tegami locally to create a changelog interactively.

Managed by Tegami.

@github-actions

Copy link
Copy Markdown
Contributor

🟢 e2e solzero-core: 5 passed, 26 left out by filters

Change 8 files changed since c05d661
Filter decision kept 4 of 30 tests, left out 26 (1 call, 18.8k tokens)

26 tests left out by filters
Test Filter Reason
tests/accounts.e2e.ts › create, use and revoke an isolated user API key decision 16% likely affected
tests/accounts.e2e.ts › Better Auth 1.7 account APIs select the local account row id decision 16% likely affected
tests/accounts.e2e.ts › Accounts settings shows GitHub as unlinked without OAuth providers decision 16% likely affected
tests/admin.e2e.ts › administrator pages show live control-plane configuration decision 17% likely affected
tests/advanced-sessions.e2e.ts › incognito sessions stay outside normal lists but open directly decision 16% likely affected
tests/advanced-sessions.e2e.ts › session MCP definitions and subagent preferences persist decision 16% likely affected
tests/auth.e2e.ts › sign-in gate protects every application route decision 4% likely affected
tests/auth.e2e.ts › credential sign-in opens the requested settings page decision 11% likely affected
tests/auth.e2e.ts › anonymous callers cannot access any protected API group decision 6% likely affected
tests/auth.e2e.ts › sign-out removes authenticated UI access decision 5% likely affected
tests/bots.e2e.ts › create a bot and manage a temporary routine through the UI decision 16% likely affected
tests/branding.e2e.ts › the selected deployment brand reaches the browser decision 11% likely affected
tests/branding.e2e.ts › health identifies the configured application without exposing configuration decision 15% likely affected
tests/branding.e2e.ts › OpenAPI uses the selected deployment brand decision 19% likely affected
tests/session-transfer.e2e.ts › admin authentication transfer redeems once and retains its deep link decision 16% likely affected
tests/sessions.e2e.ts › session tools, archive and restoration persist through the real Worker decision 16% likely affected
tests/sessions.e2e.ts › a second account cannot read or mutate another account's session decision 16% likely affected
tests/sessions.e2e.ts › codex executes a real prompt and persists its output decision 16% likely affected
tests/settings.e2e.ts › runtime default persists after reload decision 16% likely affected
tests/settings.e2e.ts › MCP deep link and legacy settings URL open the MCP tab decision 16% likely affected
tests/settings.e2e.ts › secret editor creates, finds and deletes a disposable secret decision 19% likely affected
tests/settings.e2e.ts › theme preference survives reload decision 16% likely affected
tests/skills.e2e.ts › global skill defaults and per-user preferences persist independently decision 16% likely affected
tests/workflows.e2e.ts › workflow authoring, rename, export, disable and archive persist decision 16% likely affected
tests/workflows.e2e.ts › manual workflow executes JavaScript and stores a real R2 artifact decision 19% likely affected
tests/workflows.e2e.ts › invalid workflow definitions are rejected before storage decision 16% likely affected
All 5 tests in 4 files
Test Time
🟢 tests/api-contract.e2e.ts · 1 passed 523ms
🟢 exported API key and session schemas decode actual Worker responses 523ms
🟢 tests/auth.setup.e2e.ts · 1 passed 6.9s
🟢 authenticate isolated admin 6.9s
🟢 tests/sessions.e2e.ts · 2 passed 24.3s
🟢 isolate executes a real prompt and persists its output 9.2s
🟢 opencode executes a real prompt and persists its output 15.0s
🟢 tests/settings.e2e.ts · 1 passed 9.9s
🟢 all settings categories load real data 9.9s

Tested by e2e 0.23.0 · 1m 46s · local-cloudflare · run artifacts

@cursor
cursor Bot merged commit ae4312b into master Nov 29, 2026
19 of 20 checks passed
@cursor
cursor Bot deleted the cursor/effect-option-array-idiom-e7eb branch November 29, 2026 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants