# [TSM.ID].[11031972] PXE : Platform X Ecosystem I [3 Module - Bare Metal -REAL LIVE-]
# 3Z Pipeline : Zero Error | Zero Warning | Zero Downtime

name: "[TSM.ID].[11031972] PXE : Platform X Ecosystem I [3 Module - Bare Metal -REAL LIVE-]"
run-name: "[TSM.ID].[11031972] PXE : Platform X Ecosystem I [3 Module - Bare Metal -REAL LIVE-]"

on:
  push:
    branches: [master, main]
  pull_request:
    branches: [master, main]

jobs:
  bare-metal-check:
    name: "3Z: Bare Metal (3 Module)"
    runs-on: ubuntu-latest
    steps:
      - name: "[TSM.ID] Checkout Multiverse"
        run: |
          set -e
          rm -rf workspace && mkdir -p workspace && cd workspace
          git clone http://supreme_commander:XCU_Forge_2026!@127.0.0.1:3050/supreme_commander/multiverse.git .

      - name: "[3Z] xcu-ebpf — Zero Error"
        run: |
          set -e
          cd workspace/xcom-ultra
          export PATH="$HOME/.cargo/bin:/usr/local/bin:$PATH"
          cargo check -p xcu-ebpf 2>&1
          echo "=== xcu-ebpf: PASSED ==="

      - name: "[3Z] xcu-ebpf-loader — Zero Error"
        run: |
          set -e
          cd workspace/xcom-ultra
          export PATH="$HOME/.cargo/bin:/usr/local/bin:$PATH"
          cargo check -p xcu-ebpf-loader 2>&1
          echo "=== xcu-ebpf-loader: PASSED ==="

      - name: "[3Z] xcu-omega — Zero Error"
        run: |
          set -e
          cd workspace/xcom-ultra
          export PATH="$HOME/.cargo/bin:/usr/local/bin:$PATH"
          cargo check -p xcu-omega 2>&1
          echo "=== xcu-omega: PASSED ==="

      - name: "[3Z] Watermark Verification"
        run: |
          set -e
          cd workspace/xcom-ultra
          for m in xcu-ebpf xcu-ebpf-loader xcu-omega; do
            if grep -q 'TSM\.ID' "$m/src/lib.rs"; then
              echo "$m: WATERMARK [TSM.ID].[11031972] OK"
            else
              echo "$m: WATERMARK MISSING!"
              exit 1
            fi
          done
          echo "=== BARE METAL WATERMARK: VERIFIED ==="

      - name: "[3Z] Zero Warning — deny warnings"
        run: |
          set -e
          cd workspace/xcom-ultra
          export PATH="$HOME/.cargo/bin:/usr/local/bin:$PATH"
          export RUSTFLAGS="-D warnings"
          cargo check -p xcu-ebpf -p xcu-ebpf-loader -p xcu-omega 2>&1
          echo "=== BARE METAL ZERO WARNING: PASSED ==="
