Replace SQLite with JSON file storage
- Remove database.py (SQLite) from tools/storage/ and dss-mvp1/ - Add json_store.py with full JSON-based storage layer - Update 16 files to use new json_store imports - Storage now mirrors DSS canonical structure: .dss/data/ ├── _system/ (config, cache, activity) ├── projects/ (per-project: tokens, components, styles) └── teams/ (team definitions) - Remove Docker files (not needed) - Update DSS_CORE.json to v1.1.0 Philosophy: "Eat our own food" - storage structure matches DSS design 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -39,7 +39,7 @@ sys.path.insert(0, str(Path(__file__).parent.parent))
|
||||
|
||||
from mcp.server.fastmcp import FastMCP
|
||||
from config import config
|
||||
from storage.database import Projects, Components, SyncHistory, ActivityLog, get_stats
|
||||
from storage.json_store import Projects, Components, SyncHistory, ActivityLog, get_stats
|
||||
from figma.figma_tools import FigmaToolSuite
|
||||
|
||||
# Import new ingestion modules
|
||||
|
||||
@@ -64,10 +64,9 @@ from browser_logger import router as browser_log_router
|
||||
|
||||
# Legacy imports (will gradually migrate these)
|
||||
from config import config
|
||||
from storage.database import (
|
||||
from storage.json_store import (
|
||||
Projects, Components, SyncHistory, ActivityLog, Teams, Cache, get_stats,
|
||||
FigmaFiles, ESREDefinitions, TokenDriftDetector, CodeMetrics, TestResults,
|
||||
get_connection
|
||||
FigmaFiles, CodeMetrics, TestResults, TokenDrift, Tokens, Styles
|
||||
)
|
||||
from figma.figma_tools import FigmaToolSuite
|
||||
|
||||
@@ -405,16 +404,15 @@ async def health():
|
||||
import psutil
|
||||
from pathlib import Path
|
||||
|
||||
# ❤️ Check Heart (database) connectivity
|
||||
# ❤️ Check Heart (storage) connectivity
|
||||
db_ok = False
|
||||
try:
|
||||
with get_connection() as conn:
|
||||
conn.execute("SELECT 1").fetchone()
|
||||
db_ok = True
|
||||
from storage.json_store import DATA_DIR
|
||||
db_ok = DATA_DIR.exists()
|
||||
except Exception as e:
|
||||
import traceback
|
||||
error_trace = traceback.format_exc()
|
||||
print(f"🏥 VITAL SIGN: Heart (database) error: {type(e).__name__}: {e}", flush=True)
|
||||
print(f"🏥 VITAL SIGN: Heart (storage) error: {type(e).__name__}: {e}", flush=True)
|
||||
print(f" Traceback:\n{error_trace}", flush=True)
|
||||
pass
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ from datetime import datetime, timedelta
|
||||
from typing import Optional, Dict, Any
|
||||
from atlassian import Jira, Confluence
|
||||
|
||||
from storage.database import get_connection
|
||||
from storage.json_store import read_json, write_json, SYSTEM_DIR
|
||||
|
||||
|
||||
class AtlassianAuth:
|
||||
|
||||
@@ -11,7 +11,7 @@ from typing import Optional, Dict, Any
|
||||
from datetime import datetime
|
||||
from enum import Enum
|
||||
|
||||
from storage.database import get_connection # Use absolute import (tools/ is in sys.path)
|
||||
from storage.json_store import ActivityLog, append_jsonl, read_jsonl, SYSTEM_DIR # JSON storage
|
||||
|
||||
|
||||
class AuditEventType(Enum):
|
||||
|
||||
@@ -17,7 +17,7 @@ from pathlib import Path
|
||||
import sys
|
||||
sys.path.insert(0, str(Path(__file__).parent.parent.parent))
|
||||
|
||||
from storage.database import get_connection, Projects
|
||||
from storage.json_store import Projects, Components, Tokens
|
||||
from analyze.scanner import ProjectScanner
|
||||
from ..config import mcp_config
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ from pathlib import Path
|
||||
# Note: sys.path is set up by the importing module (server.py)
|
||||
# Do NOT modify sys.path here as it causes relative import issues
|
||||
|
||||
from storage.database import get_connection
|
||||
from storage.json_store import Projects, ActivityLog
|
||||
from .config import mcp_config, integration_config
|
||||
from .context.project_context import get_context_manager, ProjectContext
|
||||
from .tools.project_tools import PROJECT_TOOLS, ProjectTools
|
||||
|
||||
@@ -12,7 +12,7 @@ from datetime import datetime, timedelta
|
||||
from enum import Enum
|
||||
|
||||
from ..config import mcp_config
|
||||
from storage.database import get_connection
|
||||
from storage.json_store import Cache, read_json, write_json, SYSTEM_DIR
|
||||
|
||||
|
||||
class CircuitState(Enum):
|
||||
|
||||
@@ -13,7 +13,7 @@ from datetime import datetime
|
||||
from enum import Enum
|
||||
|
||||
from .config import mcp_config
|
||||
from storage.database import get_connection # Use absolute import (tools/ is in sys.path)
|
||||
from storage.json_store import ActivityLog, read_json, write_json, DATA_DIR # JSON storage
|
||||
|
||||
|
||||
class OperationStatus(Enum):
|
||||
|
||||
@@ -16,7 +16,7 @@ from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC
|
||||
from cryptography.hazmat.backends import default_backend
|
||||
|
||||
from .config import mcp_config
|
||||
from storage.database import get_connection # Use absolute import (tools/ is in sys.path)
|
||||
from storage.json_store import read_json, write_json, SYSTEM_DIR # JSON storage
|
||||
|
||||
|
||||
class CredentialVault:
|
||||
|
||||
@@ -20,7 +20,7 @@ from mcp import types
|
||||
from ..context.project_context import get_context_manager
|
||||
from ..security import CredentialVault
|
||||
from ..audit import AuditLog, AuditEventType
|
||||
from storage.database import get_connection # Use absolute import (tools/ is in sys.path)
|
||||
from storage.json_store import Projects, Components, Tokens, ActivityLog # JSON storage
|
||||
|
||||
|
||||
# Tool definitions (metadata for Claude)
|
||||
|
||||
@@ -38,7 +38,7 @@ import httpx
|
||||
sys.path.insert(0, str(Path(__file__).parent.parent))
|
||||
|
||||
from config import config
|
||||
from storage.database import Cache, ActivityLog
|
||||
from storage.json_store import Cache, ActivityLog
|
||||
|
||||
@dataclass
|
||||
class DesignToken:
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
1026
tools/storage/json_store.py
Normal file
1026
tools/storage/json_store.py
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user