Skip to content

Commit 8fdb4a2

Browse files
committed
Refine rules
1 parent 24a9512 commit 8fdb4a2

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

cursor-rules/110-ox-error-handling-dual-channel.mdc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
2-
description: Ox uses two distinct channels for errors: exceptions for bugs/unexpected situations, and application errors as values (`Either`, union types).
2+
description:
33
globs:
4-
alwaysApply: false
4+
alwaysApply: true
55
---
66
# Ox Error Handling: Dual Channel
77

8-
Ox uses two distinct channels for error handling: exceptions for bugs and unexpected situations, and application errors represented as values.
8+
Ox uses two distinct channels for errors: exceptions for bugs/unexpected situations, and application errors as values (`Either`, union types).
99

1010
## Two Error Channels
1111

cursor-rules/101-ox-structured-concurrency.mdc renamed to cursor-rules/120-ox-structured-concurrency.mdc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
2-
description:
2+
description: Use structured concurrency with scopes (`supervised`, `supervisedError`, `unsupervised`) to manage thread lifetimes. All manual thread/fork creation in Ox must happen within concurrency scopes that guarantee proper cleanup and resource management. Scopes define the lifetime of forks (threads) through code structure.
33
globs:
4-
alwaysApply: true
4+
alwaysApply: false
55
---
66
# Ox Structured Concurrency
77

8-
All concurrent operations in Ox must happen within concurrency scopes that guarantee proper cleanup and resource management. Scopes define the lifetime of forks (threads) through code structure.
8+
Use structured concurrency with scopes (`supervised`, `supervisedError`, `unsupervised`) to manage thread lifetimes. All manual thread/fork creation in Ox must happen within concurrency scopes that guarantee proper cleanup and resource management. Scopes define the lifetime of forks (threads) through code structure.
99

1010
## Scope Types
1111

cursor-rules/generation/rules-list.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
### ox-direct-style (automatically applied)
66
Ox promotes direct-style programming where effectful computations return values directly without wrapper types like `Future`, `IO`, or `Task`. This leverages Java 21 virtual threads for high-performance concurrency.
77

8-
### ox-structured-concurrency (automatically applied)
9-
Use structured concurrency with scopes (`supervised`, `supervisedError`, `unsupervised`) to manage thread lifetimes. All manually managed threading and concurrent operations must be contained within scopes that guarantee cleanup and proper resource management.
10-
118
### ox-virtual-threads (automatically applied)
129
Leverage virtual threads - don't be afraid of blocking operations, create many forks when needed.
1310

@@ -24,6 +21,9 @@ Use the `supervisedError` scope with error modes (like `EitherMode`) for applica
2421

2522
## Scope Management
2623

24+
### ox-structured-concurrency
25+
Use structured concurrency with scopes (`supervised`, `supervisedError`, `unsupervised`) to manage thread lifetimes. All manual thread/fork creation in Ox must happen within concurrency scopes that guarantee proper cleanup and resource management. Scopes define the lifetime of forks (threads) through code structure.
26+
2727
### ox-scope-lifetime
2828
Keep concurrency scopes as small as possible. Create short-lived scopes for single requests, messages, or jobs rather than long-running global scopes.
2929

0 commit comments

Comments
 (0)