IDENTITY

title: "Git Sync, Hygiene & Sledgehammer Cleanup"
type: ticket
subtype: debt_cleanup
purpose: "Sync all repos, purge build artifacts from Git, fix 3 MVP bypasses so Next.js compiles strictly."

GOVERNANCE

status: PLANNED
version: "1.0.0"
priority_index: 1
budget_cap: "$0.50"
assigned_agent: "Coder Swarm (Claude Sonnet 4.6 via Roo Code)"
approved_by: "Principal Architect (Claude Opus 4.6)"
sprint: "S0 — Day 1"
depends_on: []
blocks: ["TICKET_032"]
last_updated: "2026-03-14 18:00"

TICKET_031: Git Sync, Hygiene & Sledgehammer Cleanup

1. OBJECTIVE

Synchronize all 5 repositories on the Hetzner server, purge tracked build artifacts, and eliminate all 3 TypeScript/runtime bypasses so the DEVXIO portal compiles with strict checking enabled.

2. CONSTRAINTS

3. ACCEPTANCE CRITERIA

4. EXECUTION PLAN

Sub-Task A: Git Sync (All 5 Repos)

cd ~/STRUXIO_Workspace
for repo in STRUXIO_Business STRUXIO_Design STRUXIO_Logic STRUXIO_OS STRUXIO_App; do
  echo "--- Syncing $repo ---"
  cd $repo && git fetch origin && git pull origin main && cd ..
done

Verify each repo is at HEAD. Report any merge conflicts immediately — do NOT force-resolve.

Sub-Task B: Purge Build Artifacts from Git

  1. Add to STRUXIO_OS/.gitignore:
    07_engineering/01_frontend/devxio_portal/.next/
    
  2. Remove from Git tracking (but keep on disk):
    cd STRUXIO_OS
    git rm -r --cached 07_engineering/01_frontend/devxio_portal/.next/
    git commit -m "chore(frontend): remove .next build cache from git tracking"
    
  3. Verify infrastructure_secrets.enc.yaml and struxio-vertex-service-account.json are in .gitignore. If NOT:
    echo "01_state/infrastructure_secrets.yaml" >> .gitignore
    echo "01_state/struxio-vertex-service-account.json" >> .gitignore
    # DO NOT git rm these if they contain real secrets — flag to Founder immediately
    

Sub-Task C: Fix Zustand ThemeState (Root Cause)

  1. Locate the Zustand store file:
    grep -r "ThemeState" STRUXIO_OS/07_engineering/01_frontend/devxio_portal/src/ --include="*.ts" --include="*.tsx" -l
    
  2. Inspect runtime usage — find what tokens shape is expected:
    grep -rn "tokens\." STRUXIO_OS/07_engineering/01_frontend/devxio_portal/src/ --include="*.ts" --include="*.tsx"
    grep -rn "Object.entries" STRUXIO_OS/07_engineering/01_frontend/devxio_portal/src/ --include="*.ts" --include="*.tsx"
    
  3. Add tokens to the ThemeState interface with correct type.
  4. Ensure create() initializes tokens to a valid default (not undefined).
  5. Test: npx tsc --noEmit — note error count.

Sub-Task D: Remove as any Casts

  1. Open ThemeInit.tsx — remove as any on store reference.
  2. Open WorkspaceDashboard.tsx — same.
  3. If new type errors appear, extend the interface in Sub-Task C. Do NOT re-add as any.
  4. Test: npx tsc --noEmit — confirm these files have zero errors.

Sub-Task E: Fix WebSocket Localhost Bug

  1. Find the hardcoded WebSocket:
    grep -rn "ws://localhost" STRUXIO_OS/07_engineering/01_frontend/devxio_portal/src/ --include="*.ts" --include="*.tsx"
    grep -rn "new WebSocket" STRUXIO_OS/07_engineering/01_frontend/devxio_portal/src/ --include="*.ts" --include="*.tsx"
    
  2. Replace hardcoded localhost with dynamic resolution:
    const wsHost = process.env.NEXT_PUBLIC_API_URL
      || (typeof window !== 'undefined' ? window.location.hostname : 'localhost');
    
  3. Verify NEXT_PUBLIC_API_URL exists in the Docker .env or docker-compose.yml. If missing, add NEXT_PUBLIC_API_URL=89.167.96.154.
  4. Test: Rebuild, reload UI, check DevTools Console for zero WS errors.

Sub-Task F: Remove Build Bypasses (LAST)

  1. Open next.config.ts.
  2. Set typescript.ignoreBuildErrors to false (or delete the line).
  3. Set eslint.ignoreDuringBuilds to false (or delete the line).
  4. Run npm run build. Must exit 0.
  5. If new errors appear, fix them individually. Do NOT re-enable bypasses.

5. AFFECTED FILES

STRUXIO_OS/.gitignore
STRUXIO_OS/07_engineering/01_frontend/devxio_portal/.gitignore
STRUXIO_OS/07_engineering/01_frontend/devxio_portal/next.config.ts
STRUXIO_OS/07_engineering/01_frontend/devxio_portal/src/[store directory]/[theme store file]
STRUXIO_OS/07_engineering/01_frontend/devxio_portal/src/[components]/ThemeInit.tsx
STRUXIO_OS/07_engineering/01_frontend/devxio_portal/src/[components]/WorkspaceDashboard.tsx
STRUXIO_OS/07_engineering/01_frontend/devxio_portal/src/[hooks or utils]/[websocket file]

(Exact paths TBD by Sonnet upon grep discovery in Sub-Tasks C and E)

6. DELIVERABLES

  1. Single commit (or minimal commit set) on a fix/TICKET_031_debt_cleanup branch.
  2. PR description includes: before/after tsc --noEmit error count.
  3. Screenshot or terminal paste of browser console showing zero WS errors.

7. ROLLBACK

If any sub-task breaks the live render:

  1. git stash current changes
  2. Rebuild with previous commit
  3. Report which sub-task caused regression
  4. Do NOT re-enable sledgehammers

STRUXIO.ai // Confidential & Proprietary // Generated by Claude Opus 4.6 (Principal Architect) // © 2026