Skip to content

Dev#6

Merged
infinyte merged 6 commits intomainfrom
dev
Jan 5, 2026
Merged

Dev#6
infinyte merged 6 commits intomainfrom
dev

Conversation

@infinyte
Copy link
Copy Markdown
Owner

@infinyte infinyte commented Jan 5, 2026

No description provided.

infinyte and others added 6 commits January 4, 2026 17:10
🎉 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
Copilot AI review requested due to automatic review settings January 5, 2026 16:24
@infinyte infinyte merged commit 1094d69 into main Jan 5, 2026
2 checks passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

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

Corrected spelling of 'duriebse' to 'duration'.

Suggested change
+duriebse
+duration

Copilot uses AI. Check for mistakes.
Comment on lines +15 to +16
+diagnoseL
+preserbbe
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

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

Multiple spelling errors in property names. 'diagnoseL' should be 'diagnosis' and 'preserbbe' should be 'prescribe'.

Suggested change
+diagnoseL
+preserbbe
+diagnosis
+prescribe

Copilot uses AI. Check for mistakes.
Comment on lines +25 to +28
class Ditopper {
+neabor
+specialty
+preserrber
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

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

Class name 'Ditopper' appears to be misspelled (likely 'Doctor'). Property 'neabor' should be 'name' and 'preserrber' should be 'prescriber'.

Copilot uses AI. Check for mistakes.
Comment on lines +31 to +33
class Nourise {
+durpooe
+pepartbent
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

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

Class name 'Nourise' appears to be misspelled (likely 'Nurse'). Property 'durpooe' and 'pepartbent' contain spelling errors.

Copilot uses AI. Check for mistakes.
+pressicratuss
}

class Departmecord {
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

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

Class name 'Departmecord' appears to be misspelled (likely 'DepartmentRecord'). Property 'prepertabess' contains spelling errors.

Copilot uses AI. Check for mistakes.
Comment thread HospitalDomain.cs
Comment on lines +33 to +37
public class Ditopper
{
public object neabor { get; set; }
public object specialty { get; set; }
public object preserrber { get; set; }
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

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

Class name 'Ditopper' is misspelled (should be 'Doctor'). Properties 'neabor' and 'preserrber' contain spelling errors.

Suggested change
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; }

Copilot uses AI. Check for mistakes.
Comment thread HospitalDomain.cs
Comment on lines +61 to +64
public class Nourise
{
public object durpooe { get; set; }
public object pepartbent { get; set; }
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

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

Class name 'Nourise' is misspelled (should be 'Nurse'). Properties 'durpooe' and 'pepartbent' contain spelling errors.

Suggested change
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; }

Copilot uses AI. Check for mistakes.
Comment thread HospitalDomain.cs

public class Insurance
{
public object hospitalNabel { get; set; }
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

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

Property 'hospitalNabel' should be 'hospitalName'.

Suggested change
public object hospitalNabel { get; set; }
public object hospitalName { get; set; }

Copilot uses AI. Check for mistakes.
Comment thread HospitalDomain.cs
{
public object poclayeemiee { get; set; }
public object hiredate { get; set; }
public object salay { get; set; }
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

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

Property 'poclayeemiee' contains spelling errors. Property 'salay' should be 'salary'.

Suggested change
public object salay { get; set; }
public object salary { get; set; }

Copilot uses AI. Check for mistakes.
Comment on lines +440 to +463
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;
}

Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
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;
}

Copilot uses AI. Check for mistakes.
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.

2 participants