Skip to content

refactor: split AbstractGraphBuilder into clean class hierarchy#38

Merged
oke11o merged 2 commits intomainfrom
feat/optional-registries
Jan 30, 2026
Merged

refactor: split AbstractGraphBuilder into clean class hierarchy#38
oke11o merged 2 commits intomainfrom
feat/optional-registries

Conversation

@oke11o
Copy link
Contributor

@oke11o oke11o commented Jan 30, 2026

Summary

  • Extract registry logic into new ExternalGraphBuilder subclass, keeping AbstractGraphBuilder as a pure base class
  • AbstractGraphBuilder — no registries, no registration logic (manifest, config, version validation only)
  • ExternalGraphBuilder extends AbstractGraphBuilder — adds required CallbackRegistry + EndpointRegistry with auto-registration
  • VersionRouter stays on plain AbstractGraphBuilder (pure router, no registries needed)
  • All 8 example builders updated to extends ExternalGraphBuilder

Context

Part of flutchai/flutch#566 — migrating backend graph builders from implements IGraphBuilder<T> to extends AbstractGraphBuilder.

Replaces the initial @Optional() approach with proper class hierarchy for clean separation of concerns.

Changes

File Change
src/graph/external-graph.builder.ts NewExternalGraphBuilder with required registries and registration logic
src/graph/abstract-graph.builder.ts Removed registry properties, @Optional(), setImmediate block, and 3 registration methods
src/graph/index.ts Added ExternalGraphBuilder export
src/core/universal-graph.module.ts Removed registry params from createMetaBuilder() and VersionRouter
examples/*/src/graph.builder.ts extends ExternalGraphBuilder (8 files)

Test plan

  • SDK builds successfully (npm run build)
  • All 438 tests pass (npm test)
  • Existing graph microservices still work (registries injected via ExternalGraphBuilder)
  • Backend builders can extend AbstractGraphBuilder without registries

🤖 Generated with Claude Code

@oke11o oke11o force-pushed the feat/optional-registries branch from a868531 to bebb435 Compare January 30, 2026 16:32
@oke11o oke11o changed the title feat: make CallbackRegistry and EndpointRegistry optional refactor: split AbstractGraphBuilder into clean class hierarchy Jan 30, 2026
@oke11o oke11o force-pushed the feat/optional-registries branch from 7518ed6 to 450216b Compare January 30, 2026 16:47
@github-actions
Copy link

github-actions bot commented Jan 30, 2026

📊 Test Coverage

Metric Coverage
Statements 39.8%
Branches 42.2%
Functions 39.9%
Lines 39.7%

@oke11o oke11o force-pushed the feat/optional-registries branch 2 times, most recently from d05bbad to 13848e2 Compare January 30, 2026 17:30
Extract registry logic (CallbackRegistry, EndpointRegistry) into new
ExternalGraphBuilder subclass, keeping AbstractGraphBuilder as a pure
base class without registry dependencies.

- AbstractGraphBuilder: manifest, config, version validation only
- ExternalGraphBuilder: adds required registries + auto-registration
- VersionRouter: stays on plain AbstractGraphBuilder (pure router)
- All example builders updated to extend ExternalGraphBuilder

Closes flutchai/flutch#566 (SDK part)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@oke11o oke11o force-pushed the feat/optional-registries branch from 13848e2 to 0f6f3b3 Compare January 30, 2026 17:32
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@oke11o oke11o merged commit 0383d3a into main Jan 30, 2026
1 check passed
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