Conversation
dev -> main
🎉 Full pipeline operational: Photo → Diagram → Code Features: - AI-powered whiteboard scanning (Claude Vision) - C# ↔ Mermaid bidirectional transformation - DDD pattern recognition (AggregateRoot, Entity, ValueObject) - Professional CLI with Spectre.Console - DocFlow.Integration module (scaffolded) Bug fixes: - Mermaid parser handles properties without types - Multi-word stereotypes supported Tests: 91 passing | Projects: 12 compiling Demo: Scan a whiteboard photo, get working C# code in seconds.
🎉 Full integration automation pipeline operational! New Commands: - docflow integrate parse <spec> - Parse OpenAPI specs - docflow integrate analyze <spec> --cdm <path> - CDM mapping analysis - docflow integrate sla <url> --expected <dur> - SLA compliance validation - docflow integrate generate <spec> --cdm <path> - Generate DTOs, mappers, clients Features: - Intelligent CDM mapping with confidence scores - Pattern-based field matching (aviation, datetime, identifiers) - AutoMapper profile generation with TODO markers - Typed HTTP client interface generation - FluentValidation validator generation - SLA data freshness validation (inspired by 1200 Aero incident) Tests: 91 passing | Projects: 12 compiling
There was a problem hiding this comment.
Pull request overview
This PR implements a comprehensive API integration module for DocFlow, extending the canonical semantic model architecture to external API integrations. The module provides OpenAPI spec parsing, CDM mapping with confidence scoring, SLA validation, and automated code generation for integration artifacts.
Key Changes:
- Complete Integration Module with 3 CLI subcommands (analyze, sla, generate)
- OpenAPI 3.x parsing and CDM mapping with multi-pass field matching algorithm
- SLA data freshness validation with compliance verdicts
- Code generation for DTOs, AutoMapper profiles, HTTP clients, and FluentValidation validators
- Pre-seeded aviation domain patterns for field mapping
- Comprehensive documentation and sample files
Reviewed changes
Copilot reviewed 22 out of 57 changed files in this pull request and generated 17 comments.
Show a summary per file
| File | Description |
|---|---|
src/DocFlow.Integration/Patterns/ApiMappingPatterns.cs |
Added 11 new aviation domain pattern rules for field mapping |
src/DocFlow.Integration/Mapping/CdmMapper.cs |
Enhanced CDM mapper with multi-pass matching, semantic entity mapping, and improved confidence scoring |
src/DocFlow.Integration/CodeGen/IntegrationCodeGenerator.cs |
New code generator for DTOs, AutoMapper profiles, HTTP clients, and validators |
src/DocFlow.CLI/Program.cs |
Added integrate command with 3 subcommands (analyze, sla, generate) |
samples/whiteboard-demos/hospital.mmd |
Sample hospital domain Mermaid diagram with spelling errors for testing |
samples/integration-demos/sla-test-guide.md |
Guide for testing SLA validation with public APIs |
samples/integration-demos/petstore.json |
Sample OpenAPI specification for testing |
samples/integration-demos/flightbridge-api.json |
Comprehensive aviation API specification |
samples/integration-demos/SampleCdm/Entities.cs |
Sample CDM entities for testing |
samples/integration-demos/README.md |
Documentation for integration demos |
samples/integration-demos/AviationCdm/Entities.cs |
Aviation domain CDM entities |
docs/design/integration-module.md |
Updated design doc with implementation details |
docs/CLI-REFERENCE.md |
Added documentation for integrate commands |
docs/CHANGELOG.md |
Updated changelog with integration module features |
docs/ARCHITECTURE.md |
Updated architecture with integration module details |
HospitalDomain.cs |
Generated C# from hospital.mmd (intentionally contains errors from source) |
README.md |
Updated README with integration module features |
CLAUDE.md |
Updated with integration module implementation status |
docflow-dev.sh |
Development script for running DocFlow CLI locally |
docflow-dev.cmd |
Windows development script |
DocFlow.sln |
Cleaned up solution file formatting |
.claude/settings.local.json |
Added additional bash command permissions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| class Schedule { | ||
| +diagnoses | ||
| +duriebse |
There was a problem hiding this comment.
Corrected spelling of 'duriebse' to 'duration'.
| +duriebse | |
| +duration |
| +diagnoseL | ||
| +preserbbe |
There was a problem hiding this comment.
Multiple spelling errors in property names. 'diagnoseL' should be 'diagnosis' and 'preserbbe' should be 'prescribe'.
| +diagnoseL | |
| +preserbbe | |
| +diagnosis | |
| +prescribe |
| class Ditopper { | ||
| +neabor | ||
| +specialty | ||
| +preserrber |
There was a problem hiding this comment.
Class name 'Ditopper' appears to be misspelled (likely 'Doctor'). Property 'neabor' should be 'name' and 'preserrber' should be 'prescriber'.
| class Nourise { | ||
| +durpooe | ||
| +pepartbent |
There was a problem hiding this comment.
Class name 'Nourise' appears to be misspelled (likely 'Nurse'). Property 'durpooe' and 'pepartbent' contain spelling errors.
| +pressicratuss | ||
| } | ||
|
|
||
| class Departmecord { |
There was a problem hiding this comment.
Class name 'Departmecord' appears to be misspelled (likely 'DepartmentRecord'). Property 'prepertabess' contains spelling errors.
| public class Ditopper | ||
| { | ||
| public object neabor { get; set; } | ||
| public object specialty { get; set; } | ||
| public object preserrber { get; set; } |
There was a problem hiding this comment.
Class name 'Ditopper' is misspelled (should be 'Doctor'). Properties 'neabor' and 'preserrber' contain spelling errors.
| public class Ditopper | |
| { | |
| public object neabor { get; set; } | |
| public object specialty { get; set; } | |
| public object preserrber { get; set; } | |
| public class Doctor | |
| { | |
| public object neighbor { get; set; } | |
| public object specialty { get; set; } | |
| public object prescriber { get; set; } |
| public class Nourise | ||
| { | ||
| public object durpooe { get; set; } | ||
| public object pepartbent { get; set; } |
There was a problem hiding this comment.
Class name 'Nourise' is misspelled (should be 'Nurse'). Properties 'durpooe' and 'pepartbent' contain spelling errors.
| public class Nourise | |
| { | |
| public object durpooe { get; set; } | |
| public object pepartbent { get; set; } | |
| public class Nurse | |
| { | |
| public object purpose { get; set; } | |
| public object department { get; set; } |
|
|
||
| public class Insurance | ||
| { | ||
| public object hospitalNabel { get; set; } |
There was a problem hiding this comment.
Property 'hospitalNabel' should be 'hospitalName'.
| public object hospitalNabel { get; set; } | |
| public object hospitalName { get; set; } |
| { | ||
| public object poclayeemiee { get; set; } | ||
| public object hiredate { get; set; } | ||
| public object salay { get; set; } |
There was a problem hiding this comment.
Property 'poclayeemiee' contains spelling errors. Property 'salay' should be 'salary'.
| public object salay { get; set; } | |
| public object salary { get; set; } |
| private static bool AreTypesCompatible(SemanticType external, SemanticType cdm) | ||
| { | ||
| // Exact type match | ||
| if (external.Name == cdm.Name) return true; | ||
|
|
||
| // Common type equivalences | ||
| var compatibleTypes = new Dictionary<string, HashSet<string>> | ||
| { | ||
| ["int"] = ["long", "Int32", "Int64"], | ||
| ["long"] = ["int", "Int32", "Int64"], | ||
| ["string"] = ["String"], | ||
| ["bool"] = ["boolean", "Boolean"], | ||
| ["DateTime"] = ["DateTimeOffset", "DateOnly"], | ||
| ["Guid"] = ["string", "String"] | ||
| }; | ||
|
|
||
| if (compatibleTypes.TryGetValue(external.Name, out var compatible)) | ||
| { | ||
| return compatible.Contains(cdm.Name); | ||
| } | ||
|
|
||
| return false; | ||
| } | ||
|
|
There was a problem hiding this comment.
The AreTypesCompatible method is defined but never called. It appears to be leftover from the removed type-based matching pass (Pass 6 at line 433-435). Consider removing this unused method to reduce code clutter.
| private static bool AreTypesCompatible(SemanticType external, SemanticType cdm) | |
| { | |
| // Exact type match | |
| if (external.Name == cdm.Name) return true; | |
| // Common type equivalences | |
| var compatibleTypes = new Dictionary<string, HashSet<string>> | |
| { | |
| ["int"] = ["long", "Int32", "Int64"], | |
| ["long"] = ["int", "Int32", "Int64"], | |
| ["string"] = ["String"], | |
| ["bool"] = ["boolean", "Boolean"], | |
| ["DateTime"] = ["DateTimeOffset", "DateOnly"], | |
| ["Guid"] = ["string", "String"] | |
| }; | |
| if (compatibleTypes.TryGetValue(external.Name, out var compatible)) | |
| { | |
| return compatible.Contains(cdm.Name); | |
| } | |
| return false; | |
| } | |
No description provided.