feat(import): add TM7 file import from Microsoft TMT#30
Merged
Conversation
Import .tm7 XML files and convert to native .thf format, preserving elements, data flows, trust boundaries, threats, positions, and STRIDE categories. - Rust: TM7 XML parser (quick-xml) with 14 unit tests covering happy path, edge cases (empty files, duplicates, out-of-scope, orphaned refs, self-loops, line boundaries, malformed XML), and all helper functions - Rust: import_threat_model Tauri command with format dispatch - Frontend: FileAdapter.importThreatModel + Tauri/Browser implementations - Frontend: importModel hook with dirty-state guard, error handling, layout setup - Native menu "Import…" item + command palette file:import command - Docs: README, CONTRIBUTING, architecture, overview, product-design, runbook Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.tm7files to ThreatForge's native.thfYAML formatWhat's Included
Rust Backend
src-tauri/src/importers/tm7.rs) — ~1000 lines of parser + 14 unit testsStencilRectangle(external entity),StencilEllipse(process),StencilParallelLines(data store),BorderBoundary,LineBoundary,ConnectorUserThreatCategorywith TypeId prefix fallbackimport_commands.rs) — extensible format dispatch ("tm7"→ parser)Frontend
FileAdapter.importThreatModel()— interface + Tauri/Browser implementationsuseFileOperations.importModel— dirty-state guard, error handling, layout setup, store clearingfile:importcommandnullafter import (forces Save As to create.thf)Tests (14 Rust, 1 Frontend)
Docs Updated
Test plan
cargo clippy— cleancargo fmt— cleancargo test— 73 tests pass (14 new)npx biome check— cleannpx vitest --run— 417 tests pass (1 new)npm run ci:local— all checks pass.tm7file from Microsoft TMT🤖 Generated with Claude Code