Skip to content

Commit ac77684

Browse files
authored
Merge pull request #33 from randlee/feature/sample-data-validation-tests
feat: Implement recursive tree diff algorithm (BUG-003 fix)
2 parents b9b23c4 + b95e125 commit ac77684

File tree

63 files changed

+28315
-346
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+28315
-346
lines changed

AGENT_B_SUMMARY.md

Lines changed: 489 additions & 0 deletions
Large diffs are not rendered by default.

BUG_PRIORITY_LIST.md

Lines changed: 394 additions & 0 deletions
Large diffs are not rendered by default.

BUG_REPORT_001_CLI_Command_Syntax_Error.md

Lines changed: 430 additions & 0 deletions
Large diffs are not rendered by default.

BUG_REPORT_002_CLI_Exit_Code_When_Writing_Files.md

Lines changed: 430 additions & 0 deletions
Large diffs are not rendered by default.

FINAL_VALIDATION_RESULTS.md

Lines changed: 457 additions & 0 deletions
Large diffs are not rendered by default.

GAP_ANALYSIS_REPORT.md

Lines changed: 637 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,54 @@ var output = formatter.FormatResult(result, new OutputOptions
365365

366366
See [docs/api.md](docs/api.md) for complete API documentation.
367367

368+
## Migration Notes
369+
370+
### Hierarchical Output (v2.0+)
371+
372+
The diff engine now uses a recursive tree algorithm that produces **hierarchical output**. Changes to nested members (methods, properties) appear in the `Children` property of their parent change.
373+
374+
**Before (flat output):**
375+
```json
376+
{
377+
"changes": [
378+
{ "kind": "Class", "name": "Calculator", "type": "Modified" },
379+
{ "kind": "Method", "name": "Add", "type": "Modified" },
380+
{ "kind": "Method", "name": "Multiply", "type": "Added" }
381+
]
382+
}
383+
```
384+
385+
**After (hierarchical output):**
386+
```json
387+
{
388+
"changes": [
389+
{
390+
"kind": "Class",
391+
"name": "Calculator",
392+
"type": "Modified",
393+
"children": [
394+
{ "kind": "Method", "name": "Add", "type": "Modified" },
395+
{ "kind": "Method", "name": "Multiply", "type": "Added" }
396+
]
397+
}
398+
]
399+
}
400+
```
401+
402+
**For backward compatibility**, use `Flatten()` to get flat output:
403+
404+
```csharp
405+
using RoslynDiff.Core.Models;
406+
407+
// Get hierarchical changes
408+
var changes = differ.Compare(oldContent, newContent, options).FileChanges[0].Changes;
409+
410+
// Flatten for backward compatibility
411+
var flatChanges = changes.Flatten().ToList();
412+
```
413+
414+
This change fixes BUG-003 where duplicate nodes could be reported when using the old flat extraction method.
415+
368416
## Documentation
369417

370418
- [Usage Guide](docs/usage.md) - Detailed CLI usage and examples

0 commit comments

Comments
 (0)