Files
claudetools/scripts
Mike Swanson 3faf09c111 feat: Complete DOS update system with test data routing fix
Implemented comprehensive DOS 6.22 update system for ~30 test stations with
critical fix for test data database import routing.

## Major Changes

### DOS Batch Files (7 files)
- NWTOC.BAT: Download updates from network to DOS machines
- CTONW.BAT v1.2: Upload with separate ProdSW/LOGS routing (CRITICAL FIX)
- UPDATE.BAT: Full system backup to network
- STAGE.BAT: System file staging for safe updates
- REBOOT.BAT: Apply staged updates on reboot
- CHECKUPD.BAT: Check for available updates
- DEPLOY.BAT: One-time deployment installer for DOS machines

### CTONW v1.2 Critical Fix
Fixed test data routing to match AD2 sync script expectations:
- Software distribution: C:\ATE\*.EXE -> T:\TS-4R\ProdSW\ (bidirectional)
- Test data logging: C:\ATE\8BDATA\*.DAT -> T:\TS-4R\LOGS\8BLOG\ (upload only)
- Subdirectory mapping: 8BDATA->8BLOG, DSCDATA->DSCLOG, HVDATA->HVLOG, etc.
- Test data now correctly imported to AD2 database via Sync-FromNAS.ps1

### Deployment Infrastructure
- copy-to-ad2.ps1: Automated deployment to AD2 server
- DOS_DEPLOYMENT_GUIDE.md: Complete deployment documentation
- DEPLOYMENT_GUIDE.md: Technical workflow documentation
- credentials.md: Centralized credentials (AD2, NAS, Gitea)

### Analysis & Documentation (15 files)
- CTONW_ANALYSIS.md: Comprehensive compliance analysis
- CTONW_V1.2_CHANGELOG.md: Detailed v1.2 changes
- NWTOC_ANALYSIS.md: Download workflow analysis
- DOS_BATCH_ANALYSIS.md: DOS 6.22 compatibility guide
- UPDATE_WORKFLOW.md: Backup system workflow
- BEHAVIORAL_RULES_INTEGRATION_SUMMARY.md: C: drive integration

### Session Logs
- session-logs/2026-01-19-session.md: Complete session documentation

### Conversation Reorganization
- Cleaned up 156 imported conversation files
- Organized into sessions-by-date structure
- Created metadata index and large files guide

## Technical Details

### AD2 → NAS → DOS Sync Flow
1. Admin copies files to AD2: \192.168.0.6\C$\Shares\test\
2. Sync-FromNAS.ps1 runs every 15 minutes (AD2 → NAS)
3. DOS machines access via T: drive (\D2TESTNAS\test)
4. NWTOC downloads updates, CTONW uploads test data
5. Sync imports test data to AD2 database

### DOS 6.22 Compatibility
- No %COMPUTERNAME%, uses %MACHINE% variable
- No IF /I, uses multiple case-specific checks
- Proper ERRORLEVEL checking (highest values first)
- XCOPY /S for subdirectory support
- ASCII markers ([OK], [ERROR], [WARNING]) instead of emojis

### File Locations
- AD2: C:\Shares\test\COMMON\ProdSW\ (deployed)
- NAS: T:\COMMON\ProdSW\ (synced)
- DOS: C:\BAT\ (installed)
- Logs: T:\TS-4R\LOGS\8BLOG\ (test data for database import)

## Deployment Status

 All 7 batch files deployed to AD2 (both COMMON and _COMMON)
 Pending sync to NAS (within 15 minutes)
 Pending pilot deployment on TS-4R
📋 Ready for rollout to ~30 DOS machines

## Breaking Changes

CTONW v1.1 → v1.2: Test data now uploads to LOGS folder instead of ProdSW.
Existing machines must download v1.2 via NWTOC for proper database import.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-19 12:49:54 -07:00
..

ClaudeTools Scripts

Utility scripts for managing the ClaudeTools system.


Core Scripts

Context Recall System

setup-context-recall.sh

  • One-time setup for context recall system
  • Configures JWT authentication
  • Tests API connectivity

test-context-recall.sh

  • Verify context recall system functionality
  • Test API endpoints
  • Check compression

Conversation Import & Archive

import-conversations.py

  • Import conversation JSONL files to database
  • Extract and compress conversation context
  • Tag extraction and categorization
  • Optional tombstone creation with --create-tombstones

archive-imported-conversations.py

  • Archive imported conversation files
  • Create tombstone markers
  • Move files to archived/ subdirectories
  • Database verification (optional)

check-tombstones.py

  • Verify tombstone integrity
  • Validate JSON structure
  • Check archived files exist
  • Database context verification

TOMBSTONE_QUICK_START.md

  • Quick reference for tombstone system
  • Common commands
  • Troubleshooting tips

Database & Testing

test_db_connection.py

  • Test database connectivity
  • Verify credentials
  • Check table access

test-server.sh

  • Start development server
  • Run basic API tests

MCP Servers

setup-mcp-servers.sh

  • Configure Model Context Protocol servers
  • Setup GitHub, Filesystem, Sequential Thinking

Tombstone System (NEW)

Archive imported conversation files with small marker files.

Quick Start

# Archive all imported files
python scripts/archive-imported-conversations.py --skip-verification

# Verify tombstones
python scripts/check-tombstones.py

# Check space savings
du -sh imported-conversations/

Documentation

  • TOMBSTONE_QUICK_START.md - Quick reference
  • ../TOMBSTONE_SYSTEM.md - Complete documentation
  • ../TOMBSTONE_IMPLEMENTATION_SUMMARY.md - Implementation details

Expected Results

  • 549 tombstone files (~1 MB)
  • 549 archived files in subdirectories
  • 99%+ space reduction in active directory

Usage Patterns

Initial Setup

# 1. Setup context recall
bash scripts/setup-context-recall.sh

# 2. Setup MCP servers (optional)
bash scripts/setup-mcp-servers.sh

# 3. Test database connection
python scripts/test_db_connection.py

Import Conversations

# Import with automatic tombstones
python scripts/import-conversations.py --create-tombstones

# Or import first, archive later
python scripts/import-conversations.py
python scripts/archive-imported-conversations.py --skip-verification

Verify System

# Test context recall
bash scripts/test-context-recall.sh

# Check tombstones
python scripts/check-tombstones.py

# Test API
bash scripts/test-server.sh

Script Categories

Setup & Configuration

  • setup-context-recall.sh
  • setup-mcp-servers.sh

Import & Archive

  • import-conversations.py
  • archive-imported-conversations.py
  • check-tombstones.py

Testing & Verification

  • test_db_connection.py
  • test-context-recall.sh
  • test-server.sh
  • test-tombstone-system.sh

Utilities

  • Various helper scripts

Common Commands

# Start API server
uvicorn api.main:app --reload

# Import conversations
python scripts/import-conversations.py

# Archive files
python scripts/archive-imported-conversations.py --skip-verification

# Check system health
python scripts/check-tombstones.py
bash scripts/test-context-recall.sh

# Database connection test
python scripts/test_db_connection.py

Requirements

Most scripts require:

  • Python 3.8+
  • Virtual environment activated (api\venv\Scripts\activate)
  • .env file configured (see .env.example)
  • Database access (172.16.3.30:3306)

Environment Variables

Scripts use these from .env:

DATABASE_URL=mysql+pymysql://user:pass@172.16.3.30:3306/claudetools
JWT_TOKEN=your-jwt-token-here
API_USER_EMAIL=user@example.com
API_USER_PASSWORD=your-password

Documentation

  • TOMBSTONE_QUICK_START.md - Tombstone system quick start
  • ../TOMBSTONE_SYSTEM.md - Complete tombstone documentation
  • ../.claude/CONTEXT_RECALL_QUICK_START.md - Context recall guide
  • ../CONTEXT_RECALL_SETUP.md - Full setup instructions

Last Updated: 2026-01-18 Version: 1.0