Skip to content

Commit 60a544d

Browse files
respencer-nclclaude
andcommitted
Update CLAUDE.md and NOTEBOOK.md for ValidationPass enhancements
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 6d6185e commit 60a544d

2 files changed

Lines changed: 77 additions & 1 deletion

File tree

CLAUDE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,3 +695,6 @@ Then add to root aggregation: `.aggregate(..., mymodule, mymoduleJS, mymoduleNat
695695
31. **Homebrew formula supports native + JVM fallback** - macOS ARM64 gets native binary (no JDK). Other platforms get JVM version with openjdk@21 dependency. Formula at `../homebrew-tap/Formula/riddlc.rb`
696696
32. **RiddlLib shared trait** - `riddlLib/shared/.../RiddlLib.scala` provides cross-platform API (parseString, flattenAST, validateString, getOutline, getTree). `object RiddlLib extends RiddlLib` has default implementations. RiddlAPI.scala is now a thin JS facade delegating to RiddlLib
697697
33. **parseString returns opaque Root in JS** - As of 1.5.0, `RiddlAPI.parseString()` returns the actual Scala `Root` object (opaque to JS). Use `getDomains(root)` or `inspectRoot(root)` to access data. TypeScript type is branded `RootAST`
698+
34. **Schema is in NonDefinitionValues** - Schema extends Leaf (Definition) but is also in the `NonDefinitionValues` union type. Its match case in `ValidationPass.process()` must appear BEFORE `case _: NonDefinitionValues`. Similarly, Relationship extends Leaf and must be matched before `case _: Definition`
699+
35. **CheckMessagesTest .check file format** - Lines starting with space are continuation lines appended to the previous entry (with `\n`). Non-space-starting lines begin new entries. Multi-line messages (like overloaded warnings) must not have new entries inserted mid-continuation
700+
36. **Streamlet shape validation guards on nonEmpty** - Empty streamlets (`{ ??? }`) should not be checked for inlet/outlet counts since they're placeholders. Use `streamlet.nonEmpty` guard before shape checks

NOTEBOOK.md

Lines changed: 74 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This is the central engineering notebook for the RIDDL project. It tracks curren
66

77
## Current Status
88

9-
**Last Updated**: February 6, 2026
9+
**Last Updated**: February 7, 2026
1010

1111
**Scala Version**: 3.7.4 (overrides sbt-ossuminc's 3.3.7 LTS default due to
1212
compiler infinite loop bug with opaque types/intersection types in 3.3.x).
@@ -271,8 +271,81 @@ The `pseudoCodeBlock` parser now allows comments before and/or after `???`:
271271

272272
---
273273

274+
## Changes Since v1.5.0
275+
276+
- **ValidationPass bug fixes**: SagaStep undo check used
277+
doStatements twice, SagaStep shape check was always-true,
278+
validateState called checkMetadata twice
279+
- **New validations**: Schema (kind vs structure, ref resolution),
280+
Relationship (processor ref), Streamlet shape vs inlet/outlet
281+
count, handler requirements for Streamlet/Adaptor/Repository,
282+
Projector repository ref, Epic/UseCase user story user ref,
283+
Function input/output type expressions
284+
274285
## Session Log
275286

287+
### February 7, 2026 (ValidationPass Gap Analysis & Enhancement)
288+
289+
**Focus**: Comprehensive audit and enhancement of ValidationPass
290+
to catch missing validations and fix bugs.
291+
292+
**Work Completed**:
293+
1. **Fixed 3 bugs**:
294+
- SagaStep checked `doStatements` twice instead of
295+
`undoStatements` for revert validation
296+
- SagaStep shape check compared `getClass` of two
297+
`Contents[Statements]` (always true) — replaced with
298+
meaningful `nonEmpty` symmetry check
299+
- `validateState` called `checkMetadata` twice — removed
300+
duplicate
301+
2. **Added validation for 2 previously unvalidated definitions**:
302+
- `Schema` — kind vs structure compatibility (flat/document/
303+
columnar/vector shouldn't have links; graphical should;
304+
vector expects single data node), data TypeRef resolution,
305+
link FieldRef resolution, index FieldRef resolution
306+
- `Relationship` — processor ref resolution, identifier
307+
length, metadata checks
308+
3. **Added 6 semantic validations**:
309+
- Streamlet shape vs inlet/outlet count (guarded by
310+
`nonEmpty` to skip placeholders)
311+
- Streamlet handler requirement
312+
- Adaptor handler requirement + empty handler warning
313+
- Repository handler requirement
314+
- Projector repository ref resolution
315+
- Epic/UseCase user story user ref resolution
316+
4. **Added Function input/output type validation** via
317+
`checkTypeExpression` on `input`/`output` Aggregations
318+
5. **Updated 3 `.check` test expectation files** to reflect
319+
new validation messages (everything, saga, streaming)
320+
321+
**Test Results**: `sbt clean test` — 1,526 tests, 0 failures
322+
across all modules (JVM, JS, Native).
323+
324+
**Commit**: `6d6185e5` — pushed to `origin/development`
325+
326+
**Files Modified**:
327+
- `passes/shared/.../validate/ValidationPass.scala` — all
328+
validation enhancements
329+
- `passes/input/check/everything/everything.check` — 12 new
330+
expected messages
331+
- `passes/input/check/saga/saga.check` — 5 new expected
332+
messages
333+
- `passes/input/check/streaming/streaming.check` — 3 new
334+
expected messages
335+
336+
**Remaining from gap analysis** (lower priority, not
337+
implemented this session):
338+
- Schema kind-specific deep checks (relational link type
339+
compatibility, etc.)
340+
- Adaptor message compatibility with referenced context
341+
- Saga compensation symmetry hints
342+
- Entity FSM morph/become statement presence check
343+
- `checkStreamingUsage()` implementation (still a no-op)
344+
- Handler message type vs container type appropriateness
345+
- Context isolation warnings
346+
347+
---
348+
276349
### February 5, 2026 (RiddlLib Shared Trait, JS Test Fix)
277350

278351
**Focus**: Extract shared RiddlLib trait from JS-only RiddlAPI,

0 commit comments

Comments
 (0)