Skip to content

feat(schema): implement Phase 14 LazySchema for recursive types#25

Merged
viniciusdacal merged 1 commit intomainfrom
feat/schema-phase14-lazy
Feb 6, 2026
Merged

feat(schema): implement Phase 14 LazySchema for recursive types#25
viniciusdacal merged 1 commit intomainfrom
feat/schema-phase14-lazy

Conversation

@viniciusdacal
Copy link
Copy Markdown
Contributor

Summary

  • Add LazySchema with deferred resolution — getter is called on first use, not at construction
  • Support recursive type definitions (e.g., tree nodes with self-referencing children)
  • JSON Schema output delegates to resolved inner schema, works with .id() for $ref/$defs
  • Validates deeply nested recursive data with proper error paths

Test plan

  • Deferred resolution — getter not called until first parse
  • Recursive tree node parsing (4 levels deep)
  • JSON Schema with $ref for named lazy schemas
  • Deep recursive validation
  • Rejects invalid data in recursive structures with correct path
  • 249 tests passing across 53 test files, no regressions

🤖 Generated with Claude Code

Add LazySchema with deferred resolution for recursive type definitions.
Getter is called lazily on first use, not at construction time. Works with
.id() for JSON Schema $ref output and validates deeply nested recursive data.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor Author

@viniciusdacal viniciusdacal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Post-PR Review

Overview: Phase 14 adds LazySchema for recursive type definitions. Clean, minimal implementation (40 lines) that leverages existing infrastructure.

Code Quality: LazySchema follows established patterns — extends Schema, implements _parse/_schemaType/_toJSONSchema/_clone. Uses memoized getter pattern for deferred resolution.

Test Coverage: 5 tests covering deferred resolution, recursive parsing, JSON Schema $ref output, deep nesting, and error path validation. All 249 tests pass.

No issues found. The implementation is elegant — LazySchema simply delegates to the resolved inner schema, and the existing infrastructure handles everything else (recursive $ref, error paths, pipeline execution).

@viniciusdacal viniciusdacal merged commit 3ff4eae into main Feb 6, 2026
@viniciusdacal viniciusdacal deleted the feat/schema-phase14-lazy branch February 6, 2026 16:43
viniciusdacal added a commit that referenced this pull request Feb 22, 2026
Add LazySchema with deferred resolution for recursive type definitions.
Getter is called lazily on first use, not at construction time. Works with
.id() for JSON Schema $ref output and validates deeply nested recursive data.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
viniciusdacal added a commit that referenced this pull request Apr 5, 2026
…2053)

Phase 1 of runtime feature parity tests:
- Test skeleton: main.rs, common.rs (shared helpers), checklist_meta.rs (report validation)
- HTTP serving tests: API delegation (#5), proxy rules (#6), logging middleware (#7)
- Compilation tests: import.meta.env (#19), CSS→JS (#20), tsconfig paths (#22),
  /@deps endpoint (#23), /@css endpoint (#24), theme CSS injection (#25)
- PARITY_REPORT.md with all 55 included + 12 deferred feature rows
- Test fixtures: env-app, css-app, tsconfig-paths-app, theme-app

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
viniciusdacal added a commit that referenced this pull request Apr 5, 2026
* test(runtime): add Phase 1 parity tests — infra, HTTP, compilation (#2053)

Phase 1 of runtime feature parity tests:
- Test skeleton: main.rs, common.rs (shared helpers), checklist_meta.rs (report validation)
- HTTP serving tests: API delegation (#5), proxy rules (#6), logging middleware (#7)
- Compilation tests: import.meta.env (#19), CSS→JS (#20), tsconfig paths (#22),
  /@deps endpoint (#23), /@css endpoint (#24), theme CSS injection (#25)
- PARITY_REPORT.md with all 55 included + 12 deferred feature rows
- Test fixtures: env-app, css-app, tsconfig-paths-app, theme-app

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* test(runtime): add Phase 2 parity tests — SSR, HMR, watcher, module graph (#2053)

Phase 2 of runtime feature parity tests:
- SSR: verify SSR-enabled server serves HTML shell for page routes (#34)
- HMR Tier 1: WebSocket update message delivery via hmr_hub.broadcast (#37)
- HMR Tier 1: CSS-only update message (not full-reload) (#38)
- HMR Tier 2: FileWatcher detects entry file changes in tempdir (#39)
- Module graph: transitive dependency invalidation A→B→C (#40)
- Shared helpers: copy_fixture() for tempdir-based watcher tests

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* test(runtime): add Phase 3 parity tests — errors, diagnostics, MCP, auto features (#2053)

Phase 3 of runtime feature parity tests:
- Error overlay: client error reporting via POST endpoint (#47)
- Console log: ring buffer endpoint returns stored entries (#50)
- MCP: Streamable HTTP responds to tools/list with 7 registered tools (#51)
- MCP: tool invocation returns diagnostics result (#52)
- MCP: events WebSocket delivers initial server status (#53)
- Auto-install: blacklist/dedup coordination logic (#54)
- Dep watcher: detects file changes in linked package dist/ (#55)

All 22 parity tests passing. Full cargo test --all clean. Clippy clean.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(runtime): address review findings in parity tests (#2053)

- Fix ~25 incorrect EXISTING test location references in PARITY_REPORT.md
  to match actual function names in static_serving.rs, client_render.rs,
  ssr_render.rs, and error_overlay.rs
- Rename misleading ssr_redirect_returns_302_with_location_header to
  ssr_enabled_server_returns_html_shell_for_page_routes (test asserts 200,
  not 302)
- Add import.meta.env.SECRET_KEY reference to env-app fixture so the
  non-public env var assertion actually validates the code path

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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.

1 participant