Summary

Second comprehensive E2E test pass after fixes for #101, #102, #103 were merged. Testing performed on devcontainer (Linux 5.15.167.4-microsoft-standard-WSL2) using the built CLI binary. Focus: edge cases, data integrity, bidirectional sync, view system.

Category Tests Bugs Found

Special Characters & Unicode

10

0

Empty/Large/Deep Models

5

2

CLI Add Commands

14

5

Views & Wildcards

12

4

Reverse Sync

6

5

Forward Sync

4

1

Watch Mode

3

0

JSON Output

7

0

Sync State Edge Cases

3

1

Model File Edge Cases

5

1

Template Edge Cases

3

0

Drawio File Integrity

1

0

Total

73

18 (filed as issues)

Issues Filed

Critical (Data Loss)

Issue Description Test Area

#108

Adding new views causes child elements to be deleted from model

Views

#109

Draw.io changes silently lost when model also changed

Reverse Sync

#118

Exclude/include round-trip permanently deletes elements from model

Views

High Severity

Issue Description Test Area

#107

Element kind changes not detected during sync

Forward Sync

#115

New element with bausteinsicht_id added in draw.io is deleted

Reverse Sync

Medium Severity

Issue Description Test Area

#110

Emptying model does not remove elements from draw.io pages

Forward Sync

#112

HTML formatting tags leak into model during reverse sync

Reverse Sync

#113

Tooltip attribute not synced back to model

Reverse Sync

#117

Validate does not detect duplicate relationships

Validation

#119

Deleting sync state file causes duplicate relationships

Sync State

#120

Wildcard pattern and * don’t work in view include

Views

#122

add element and add relationship strip JSONC comments

CLI

#123

Element IDs with dots, spaces, or special characters accepted

CLI

Low Severity

Issue Description Test Area

#111

Self-referencing relationships not rendered in draw.io

Forward Sync

#114

View include arrays not cleaned when elements deleted

Reverse Sync

#116

Double "WARNING: WARNING:" prefix in conflict messages

CLI Output

#121

JSONC block comments (/* …​ */) not supported

Model Parser

#124

add element accepts empty title

CLI

Detailed Test Results

1. Basic Workflow

Test Result Notes

bausteinsicht init

PASS

Creates all 4 files correctly

bausteinsicht sync (after init)

PASS

"Already in sync. No changes."

bausteinsicht validate

PASS

"Model is valid."

bausteinsicht validate --format json

PASS

Valid JSON: {"valid": true, "errors": []}

2. Special Characters & Unicode

Test Result Notes

Umlauts (ä, ö, ü, ß) in title/description

PASS

Correctly encoded in draw.io XML

Angle brackets (<, >) in description

PASS

Double-encoded for HTML-in-XML

Ampersand (&) in description

PASS

Properly escaped

Quotes in title

PASS

XML-escaped as "

Emoji (🏗️, 🔧) in titles

PASS

UTF-8 preserved

CJK characters (建築) in titles

PASS

Rendered correctly

Arabic (هندسة) in titles

PASS

RTL text preserved

Cyrillic (Архитектура) in titles

PASS

Correct encoding

Special chars in relationship labels

PASS

Properly escaped

Mixed scripts in single title

PASS

All scripts coexist

3. Forward Sync Edge Cases

Test Result Notes

Add element to model, sync

PASS

New element with red dashed border

Modify title/description/technology

PASS

Changes reflected in diagram

Remove element from model

PASS

Element removed from diagram

Change element kind

FAIL

Kind change silently ignored (#107)

Add relationship, sync

PASS

Connector appears

Remove relationship, sync

PASS

Connector removed

Self-referencing relationship

FAIL

Silently dropped (#111)

Child-to-parent relationship

FAIL

Silently dropped (#111)

Empty model sync

FAIL

Orphan pages not cleaned up (#110)

4. Reverse Sync Edge Cases

Test Result Notes

Edit label in draw.io, sync

PASS

Model updated correctly

Conflict detection (both sides changed)

PASS

Model wins, conflict reported

HTML tags in edited label

FAIL

<i>, <u> tags leak into model (#112)

Tooltip-only change

FAIL

Not detected (#113)

Delete element in draw.io

PASS

Element removed from model

Add element in draw.io

FAIL

Deleted instead of preserved (#115)

Concurrent model+drawio changes

FAIL

Draw.io changes lost (#109)

Stale view references after delete

FAIL

Not cleaned up (#114)

Double WARNING prefix

FAIL

Cosmetic (#116)

5. Views System

Test Result Notes

Multiple views as separate pages

PASS

Each view gets its own page

include with prefix.* wildcard

PASS

Direct children resolved

include with bare *

FAIL

Matches nothing (#120)

include with prefix.**

FAIL

Matches nothing (#120)

exclude removes elements

PASS

Element removed from page

Remove exclude, re-sync

FAIL

Element permanently deleted (#118)

Add new view revealing children

FAIL

Children deleted from model (#108)

Scope with non-existent element

PASS

Warning, graceful handling

Scope with non-container

PASS

Warning about missing template

Overlapping views — modify element

PASS

All views updated

Overlapping views — delete element

PASS

Removed from all pages

Relationship lifting

PASS

Connectors lifted to parent

6. CLI Add Commands

Test Result Notes

No --title flag

PASS

Error: required flag not set

Empty title --title ""

FAIL

Accepted, caught only by validate (#124)

Non-existent kind

PASS

Error with valid kinds listed

Dotted ID at top level (foo.bar)

FAIL

Creates unreachable element (#123)

ID with spaces

FAIL

No validation (#123)

ID with special chars

FAIL

No validation (#123)

Parent not a container

PASS

Correct error message

Deeply nested parent

PASS

Works correctly

Self-referencing relationship

FAIL

Accepted but dropped in sync (#111)

Non-existent relationship kind

PASS

Correct error message

Very long label (600 chars)

PASS

Accepted

Duplicate relationship (same from/to)

PASS

Rejected with error

Different kind, same from/to pair

QUESTIONABLE

Rejected — may be too strict (#117)

Comments stripped after add

FAIL

JSONC comments lost (#122)

7. Watch Mode

Test Result Notes

Detects model changes

PASS

Trigger within debounce window

Detects draw.io changes

PASS

Reverse sync triggered

Rapid changes (debounce)

PASS

Single sync for rapid saves

Invalid model recovery

PASS

Reports error, doesn’t crash, recovers

8. Large/Deep Models

Test Result Notes

50+ elements performance

PASS

Sync in ~5ms, well under 5s threshold

6 levels deep nesting

PASS

All levels sync correctly

Very long title (500+ chars)

PASS

No truncation

Very long description (2000+ chars)

PASS

Full content preserved

9. Sync State & Template

Test Result Notes

Delete sync state, re-sync

FAIL

Duplicate relationships created (#119)

Corrupt sync state

PASS

Clear error message

Read-only sync state

PASS

Write succeeds via rename

Delete template file

PASS

Falls back to embedded default

Empty template file

PASS

Falls back to default

Invalid XML template

PASS

Falls back to default

10. Model File Parsing

Test Result Notes

Trailing commas in JSONC

PASS

Accepted

Block comments /* …​ */

FAIL

Parse error (#121)

Non-existent $schema URL

PASS

URL not fetched

Missing specification section

PASS

Validate catches errors

Missing model section

PASS

Treated as empty model

11. Draw.io File Integrity

Test Result Notes

XML well-formedness after 5 cycles

PASS

Valid XML

No duplicate element IDs

PASS

All IDs unique per page

No orphaned connectors

PASS

All connectors have valid endpoints

Page structure (mxCell 0/1)

PASS

Correct base cells on all pages

Root Cause Patterns

The bugs cluster around two systemic issues:

1. Reverse Sync Over-Eagerness

The three-way diff interprets any element absent from draw.io as "user deleted it in draw.io." This is incorrect when elements are absent because:

  • They are excluded by a view’s exclude array (#118)

  • They were never on any view page (#108)

  • The sync state was reset (#119)

The root fix: the reverse sync should only consider an element "deleted in draw.io" when it was previously present on a view page AND the view still includes it.

2. Incomplete Change Detection

The change detection in diff.go misses several fields:

  • kind not compared (#107)

  • Tooltip-only changes not detected (#113)

  • HTML tags not stripped before comparison (#112)

Recommendations

  1. Priority 1: Fix the critical data-loss bugs (#108, #109, #118) — these make the view system unsafe to use.

  2. Priority 2: Fix kind change detection (#107) — straightforward one-line fix.

  3. Priority 3: Add input validation to CLI commands (#123, #124).

  4. Priority 4: Address comment preservation in add commands (#122).

  5. Priority 5: Address remaining medium/low issues.