From fa001a2d4858011ac7385d663fcfeca71978fa32 Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Thu, 26 Feb 2026 06:05:17 -0500 Subject: [PATCH] scaffold: add project structure, schema, and gitignore --- .gitignore | 16 +++ porting-schema.sql | 121 ++++++++++++++++++ .../NatsNet.PortTracker.csproj | 15 +++ tools/NatsNet.PortTracker/Program.cs | 2 + tools/go-analyzer/go.mod | 3 + 5 files changed, 157 insertions(+) create mode 100644 .gitignore create mode 100644 porting-schema.sql create mode 100644 tools/NatsNet.PortTracker/NatsNet.PortTracker.csproj create mode 100644 tools/NatsNet.PortTracker/Program.cs create mode 100644 tools/go-analyzer/go.mod diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..dedd23c --- /dev/null +++ b/.gitignore @@ -0,0 +1,16 @@ +# SQLite database (local state) +porting.db +porting.db-journal +porting.db-wal +porting.db-shm + +# .NET build output +tools/NatsNet.PortTracker/bin/ +tools/NatsNet.PortTracker/obj/ + +# Go build output +tools/go-analyzer/go-analyzer + +# OS files +.DS_Store +Thumbs.db diff --git a/porting-schema.sql b/porting-schema.sql new file mode 100644 index 0000000..f5ce1f1 --- /dev/null +++ b/porting-schema.sql @@ -0,0 +1,121 @@ +-- porting-schema.sql +-- Schema for NATS server Go-to-.NET porting tracker + +PRAGMA journal_mode=WAL; +PRAGMA foreign_keys=ON; + +CREATE TABLE IF NOT EXISTS modules ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + name TEXT NOT NULL, + description TEXT, + go_package TEXT, + go_file TEXT, + go_line_start INTEGER, + go_line_count INTEGER, + status TEXT NOT NULL DEFAULT 'not_started' + CHECK (status IN ('not_started', 'stub', 'complete', 'verified', 'n_a')), + dotnet_project TEXT, + dotnet_namespace TEXT, + dotnet_class TEXT, + notes TEXT, + created_at DATETIME DEFAULT CURRENT_TIMESTAMP, + updated_at DATETIME DEFAULT CURRENT_TIMESTAMP +); + +CREATE TABLE IF NOT EXISTS features ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + module_id INTEGER NOT NULL REFERENCES modules(id) ON DELETE CASCADE, + name TEXT NOT NULL, + description TEXT, + go_file TEXT, + go_class TEXT, + go_method TEXT, + go_line_number INTEGER, + go_line_count INTEGER, + status TEXT NOT NULL DEFAULT 'not_started' + CHECK (status IN ('not_started', 'stub', 'complete', 'verified', 'n_a')), + dotnet_project TEXT, + dotnet_class TEXT, + dotnet_method TEXT, + notes TEXT, + created_at DATETIME DEFAULT CURRENT_TIMESTAMP, + updated_at DATETIME DEFAULT CURRENT_TIMESTAMP +); + +CREATE TABLE IF NOT EXISTS unit_tests ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + module_id INTEGER NOT NULL REFERENCES modules(id) ON DELETE CASCADE, + feature_id INTEGER REFERENCES features(id) ON DELETE SET NULL, + name TEXT NOT NULL, + description TEXT, + go_file TEXT, + go_class TEXT, + go_method TEXT, + go_line_number INTEGER, + go_line_count INTEGER, + status TEXT NOT NULL DEFAULT 'not_started' + CHECK (status IN ('not_started', 'stub', 'complete', 'verified', 'n_a')), + dotnet_project TEXT, + dotnet_class TEXT, + dotnet_method TEXT, + notes TEXT, + created_at DATETIME DEFAULT CURRENT_TIMESTAMP, + updated_at DATETIME DEFAULT CURRENT_TIMESTAMP +); + +CREATE TABLE IF NOT EXISTS dependencies ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + source_type TEXT NOT NULL CHECK (source_type IN ('module', 'feature', 'unit_test')), + source_id INTEGER NOT NULL, + target_type TEXT NOT NULL CHECK (target_type IN ('module', 'feature', 'unit_test')), + target_id INTEGER NOT NULL, + dependency_kind TEXT DEFAULT 'calls', + created_at DATETIME DEFAULT CURRENT_TIMESTAMP, + UNIQUE (source_type, source_id, target_type, target_id) +); + +CREATE TABLE IF NOT EXISTS library_mappings ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + go_import_path TEXT NOT NULL UNIQUE, + go_library_name TEXT, + go_usage_description TEXT, + dotnet_package TEXT, + dotnet_namespace TEXT, + dotnet_usage_notes TEXT, + status TEXT NOT NULL DEFAULT 'not_mapped' + CHECK (status IN ('not_mapped', 'mapped', 'verified')), + created_at DATETIME DEFAULT CURRENT_TIMESTAMP, + updated_at DATETIME DEFAULT CURRENT_TIMESTAMP +); + +-- Indexes +CREATE INDEX IF NOT EXISTS idx_features_module ON features(module_id); +CREATE INDEX IF NOT EXISTS idx_features_status ON features(status); +CREATE INDEX IF NOT EXISTS idx_unit_tests_module ON unit_tests(module_id); +CREATE INDEX IF NOT EXISTS idx_unit_tests_feature ON unit_tests(feature_id); +CREATE INDEX IF NOT EXISTS idx_unit_tests_status ON unit_tests(status); +CREATE INDEX IF NOT EXISTS idx_deps_source ON dependencies(source_type, source_id); +CREATE INDEX IF NOT EXISTS idx_deps_target ON dependencies(target_type, target_id); +CREATE INDEX IF NOT EXISTS idx_library_status ON library_mappings(status); +CREATE INDEX IF NOT EXISTS idx_modules_status ON modules(status); + +-- Triggers to auto-update updated_at +CREATE TRIGGER IF NOT EXISTS trg_modules_updated AFTER UPDATE ON modules +BEGIN + UPDATE modules SET updated_at = CURRENT_TIMESTAMP WHERE id = NEW.id; +END; + +CREATE TRIGGER IF NOT EXISTS trg_features_updated AFTER UPDATE ON features +BEGIN + UPDATE features SET updated_at = CURRENT_TIMESTAMP WHERE id = NEW.id; +END; + +CREATE TRIGGER IF NOT EXISTS trg_unit_tests_updated AFTER UPDATE ON unit_tests +BEGIN + UPDATE unit_tests SET updated_at = CURRENT_TIMESTAMP WHERE id = NEW.id; +END; + +CREATE TRIGGER IF NOT EXISTS trg_library_mappings_updated AFTER UPDATE ON library_mappings +BEGIN + UPDATE library_mappings SET updated_at = CURRENT_TIMESTAMP WHERE id = NEW.id; +END; diff --git a/tools/NatsNet.PortTracker/NatsNet.PortTracker.csproj b/tools/NatsNet.PortTracker/NatsNet.PortTracker.csproj new file mode 100644 index 0000000..12aa770 --- /dev/null +++ b/tools/NatsNet.PortTracker/NatsNet.PortTracker.csproj @@ -0,0 +1,15 @@ + + + + Exe + net10.0 + enable + enable + + + + + + + + diff --git a/tools/NatsNet.PortTracker/Program.cs b/tools/NatsNet.PortTracker/Program.cs new file mode 100644 index 0000000..3751555 --- /dev/null +++ b/tools/NatsNet.PortTracker/Program.cs @@ -0,0 +1,2 @@ +// See https://aka.ms/new-console-template for more information +Console.WriteLine("Hello, World!"); diff --git a/tools/go-analyzer/go.mod b/tools/go-analyzer/go.mod new file mode 100644 index 0000000..898e50c --- /dev/null +++ b/tools/go-analyzer/go.mod @@ -0,0 +1,3 @@ +module github.com/natsnet/go-analyzer + +go 1.25.5