Skip to content

Commit 9c9544b

Browse files
committed
Tweak CLAUDE.md
1 parent 88cc577 commit 9c9544b

1 file changed

Lines changed: 15 additions & 3 deletions

File tree

CLAUDE.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ The usual Gradle commands, plus:
3232

3333
- **State Tree**: Immutable user-supplied in-memory tree structure composed mostly of records
3434
- **ReadSession**: Coarse-grained snapshot-at-start semantics (e.g. one per HTTP request)
35-
- **Drivers**: Pluggable layers for processing state updates
35+
- **Drivers**: Pluggable layers for processing state updates; drivers form a _stack_, or chain, with updates passed along from one to the next until they reach the in-memory state tree
3636
- **Hooks**: Callbacks for state change notifications
3737
- **References**: Type-safe "pointers" into the state tree
3838

@@ -79,6 +79,17 @@ and try to answer that question in the javadocs.
7979

8080
We use Lombok sparingly. Most of its features are disabled in lombok.config.
8181

82+
### What to avoid
83+
84+
- Do not use Mockito or other mocking libraries for tests.
85+
Mockito is a phenomenal solution to the wrong problem.
86+
Our components are designed to be stateless and to use immutable structures
87+
so that mocks are almost never necessary. If you think you need a mock, reconsider the design first.
88+
- Don't merge wildcard imports. You can use them temporarily but they must be expanded before merging.
89+
Spotless will enforce this.
90+
- Tests should not emit logs unless something unexpected occurs.
91+
- Use `bosk-logback/src/main/java/works/bosk/logback/BoskLogFilter.java` to suppress expected production logs in tests.
92+
8293
## Testing Patterns
8394

8495
- Tests use JUnit 5
@@ -104,8 +115,9 @@ We use Lombok sparingly. Most of its features are disabled in lombok.config.
104115
- We use spotbugs for shipped code
105116
- Published to Maven Central via GitHub actions, by creating a new release in GitHub
106117
- We use GitHub Dependabot to keep dependencies very up-to-date
107-
- We use bytecode generation for high performance in several places.
108-
- Abstractions are designed to support this by specifying things once and then using them many times (e.g. "compiling" a `Path` into a `Reference`) even where we don't yet take advantage
118+
- We separate setup from execution. Prefer designs where work is described once (at construction/configuration time) and executed many times efficiently.
119+
- `Reference` is an example: path parsing and validation happen once when the `Reference` is built, and then reads are fast.
120+
Apply this pattern when designing new abstractions — avoid doing expensive setup work inside hot paths.
109121
- Each published subproject may have its own developer documentation (e.g. [bosk-mongo/DEVELOPERS.md](bosk-mongo/DEVELOPERS.md))
110122
- Changes to those subprojects should first consult that documentation for further guidance, and even update it if necessary
111123
- Bosk treats reads and writes very differently

0 commit comments

Comments
 (0)