apiVersion: unidesk.pikapython.com/v1alpha1
kind: RuntimeReuseConfig
metadata:
  name: hwlab-v03-reuse
  ownerRepository: pikasTech/HWLAB
spec:
  envArtifactGroups:
    hwlab-go-runtime-env:
      enabled: true
      mode: env-reuse-gitea-checkout
      buildService: hwlab-user-billing
      imageRepository: hwlab-go-runtime-env
      cacheRepository: cache/hwlab-go-runtime-env
      services:
        - hwlab-user-billing
        - hwlab-workbench-runtime
    hwlab-ts-runtime-env:
      enabled: true
      mode: env-reuse-gitea-checkout
      buildService: hwlab-cloud-api
      imageRepository: hwlab-ts-runtime-env
      cacheRepository: cache/hwlab-ts-runtime-env
      services:
        - hwlab-cloud-api
        - hwlab-project-management
        - hwlab-tasktree-api
        - hwlab-tasktree-worker
        - hwlab-cloud-web
        - hwlab-gateway
        - hwlab-edge-proxy
        - hwlab-agent-skills
  services:
    hwlab-cloud-api:
      runtimeReuse:
        enabled: true
        codeIdentity:
          paths:
            - cmd/hwlab-cloud-api
            - cmd/hwlab-codex-api-responses-forwarder
            - cmd/hwlab-deepseek-responses-bridge
            - deploy/runtime/boot/hwlab-cloud-api.sh
            - deploy/runtime/boot/hwlab-codex-api-responses-forwarder.sh
            - deploy/runtime/boot/hwlab-deepseek-responses-bridge.sh
            - internal/cloud
            - internal/db
            - internal/audit
            - internal/agent/agentrun-dispatch.mjs
            - internal/agent/prompts
            - skills/hwlab-agent-runtime
        envIdentity:
          paths:
            - package.json
            - package-lock.json
            - deploy/runtime/launcher/hwlab-env-reuse-launcher.ts
            - internal/dev-entrypoint/artifact-runtime.mjs
      envReuse:
        enabled: true
        mode: env-reuse-gitea-checkout
        nodeDepsPath: /opt/hwlab-env/node_modules
        envIdentityFiles:
          - package.json
          - package-lock.json
          - deploy/runtime/launcher/hwlab-env-reuse-launcher.ts
          - internal/dev-entrypoint/artifact-runtime.mjs
    hwlab-workbench-runtime:
      runtimeReuse:
        enabled: true
        codeIdentity:
          paths:
            - go.mod
            - go.sum
            - cmd/hwlab-workbench-runtime
            - internal/workbenchruntime
            - deploy/runtime/boot/hwlab-workbench-runtime.sh
        envIdentity:
          paths:
            - go.mod
            - go.sum
            - deploy/runtime/launcher/hwlab-go-env-reuse-launcher.mjs
            - deploy/runtime/launcher/hwlab-env-reuse-launcher.ts
            - internal/dev-entrypoint/artifact-runtime.mjs
      envReuse:
        enabled: true
        mode: env-reuse-gitea-checkout
        nodeDepsPath: /opt/hwlab-env/node_modules
        envIdentityFiles:
          - go.mod
          - go.sum
          - deploy/runtime/launcher/hwlab-go-env-reuse-launcher.mjs
          - deploy/runtime/launcher/hwlab-env-reuse-launcher.ts
          - internal/dev-entrypoint/artifact-runtime.mjs
    hwlab-user-billing:
      runtimeReuse:
        enabled: true
        codeIdentity:
          paths:
            - go.mod
            - go.sum
            - cmd/hwlab-user-billing
            - internal/userbilling
            - deploy/runtime/boot/hwlab-user-billing.sh
        envIdentity:
          paths:
            - go.mod
            - go.sum
            - deploy/runtime/launcher/hwlab-go-env-reuse-launcher.mjs
            - deploy/runtime/launcher/hwlab-env-reuse-launcher.ts
            - internal/dev-entrypoint/artifact-runtime.mjs
      envReuse:
        enabled: true
        mode: env-reuse-gitea-checkout
        nodeDepsPath: /opt/hwlab-env/node_modules
        envIdentityFiles:
          - go.mod
          - go.sum
          - deploy/runtime/launcher/hwlab-go-env-reuse-launcher.mjs
          - deploy/runtime/launcher/hwlab-env-reuse-launcher.ts
          - internal/dev-entrypoint/artifact-runtime.mjs
    hwlab-project-management:
      runtimeReuse:
        enabled: true
        codeIdentity:
          paths:
            - cmd/hwlab-project-management
            - internal/project-management
            - internal/db/runtime-store.ts
            - deploy/runtime/boot/hwlab-project-management.sh
        envIdentity:
          paths:
            - package.json
            - package-lock.json
            - deploy/runtime/launcher/hwlab-env-reuse-launcher.ts
            - internal/dev-entrypoint/artifact-runtime.mjs
      envReuse:
        enabled: true
        mode: env-reuse-gitea-checkout
        nodeDepsPath: /opt/hwlab-env/node_modules
        envIdentityFiles:
          - package.json
          - package-lock.json
          - deploy/runtime/launcher/hwlab-env-reuse-launcher.ts
          - internal/dev-entrypoint/artifact-runtime.mjs
    hwlab-tasktree-api:
      runtimeReuse:
        enabled: true
        codeIdentity:
          paths:
            - cmd/hwlab-tasktree-api
            - internal/tasktree
            - tools/src/tasktree-cli.ts
            - deploy/runtime/boot/hwlab-tasktree-api.sh
        envIdentity:
          paths:
            - package.json
            - package-lock.json
            - deploy/runtime/launcher/hwlab-env-reuse-launcher.ts
            - internal/dev-entrypoint/artifact-runtime.mjs
      envReuse:
        enabled: true
        mode: env-reuse-gitea-checkout
        nodeDepsPath: /opt/hwlab-env/node_modules
        envIdentityFiles:
          - package.json
          - package-lock.json
          - deploy/runtime/launcher/hwlab-env-reuse-launcher.ts
          - internal/dev-entrypoint/artifact-runtime.mjs
    hwlab-tasktree-worker:
      runtimeReuse:
        enabled: true
        codeIdentity:
          paths:
            - cmd/hwlab-tasktree-worker
            - internal/tasktree
            - deploy/runtime/boot/hwlab-tasktree-worker.sh
        envIdentity:
          paths:
            - package.json
            - package-lock.json
            - deploy/runtime/launcher/hwlab-env-reuse-launcher.ts
            - internal/dev-entrypoint/artifact-runtime.mjs
      envReuse:
        enabled: true
        mode: env-reuse-gitea-checkout
        nodeDepsPath: /opt/hwlab-env/node_modules
        envIdentityFiles:
          - package.json
          - package-lock.json
          - deploy/runtime/launcher/hwlab-env-reuse-launcher.ts
          - internal/dev-entrypoint/artifact-runtime.mjs
    hwlab-cloud-web:
      runtimeReuse:
        enabled: true
        codeIdentity:
          paths:
            - web/hwlab-cloud-web
            - internal/dev-entrypoint/cloud-web-runtime.mjs
            - internal/dev-entrypoint/cloud-web-proxy.mjs
            - internal/dev-entrypoint/cloud-web-routes.mjs
            - internal/dev-entrypoint/opencode-provider-proxy.mjs
            - deploy/runtime/boot/opencode-provider-proxy.sh
            - tools/src/hwlab-cli/trace-renderer.ts
        envIdentity:
          paths:
            - package.json
            - package-lock.json
            - deploy/runtime/launcher/hwlab-env-reuse-launcher.ts
            - internal/dev-entrypoint/artifact-runtime.mjs
      envReuse:
        enabled: true
        mode: env-reuse-gitea-checkout
        nodeDepsPath: /opt/hwlab-env/node_modules
        envIdentityFiles:
          - package.json
          - package-lock.json
          - deploy/runtime/launcher/hwlab-env-reuse-launcher.ts
          - internal/dev-entrypoint/artifact-runtime.mjs
    hwlab-gateway:
      runtimeReuse:
        enabled: true
        codeIdentity:
          paths:
            - cmd/hwlab-gateway
            - internal/sim
            - deploy/runtime/boot/hwlab-gateway.sh
        envIdentity:
          paths:
            - package.json
            - package-lock.json
            - deploy/runtime/launcher/hwlab-env-reuse-launcher.ts
            - internal/dev-entrypoint/artifact-runtime.mjs
      envReuse:
        enabled: true
        mode: env-reuse-gitea-checkout
        nodeDepsPath: /opt/hwlab-env/node_modules
        envIdentityFiles:
          - package.json
          - package-lock.json
          - deploy/runtime/launcher/hwlab-env-reuse-launcher.ts
          - internal/dev-entrypoint/artifact-runtime.mjs
    hwlab-edge-proxy:
      runtimeReuse:
        enabled: true
        codeIdentity:
          paths:
            - cmd/hwlab-edge-proxy
            - internal/dev-entrypoint/http.mjs
            - deploy/runtime/boot/hwlab-edge-proxy.sh
        envIdentity:
          paths:
            - package.json
            - package-lock.json
            - deploy/runtime/launcher/hwlab-env-reuse-launcher.ts
            - internal/dev-entrypoint/artifact-runtime.mjs
      envReuse:
        enabled: true
        mode: env-reuse-gitea-checkout
        nodeDepsPath: /opt/hwlab-env/node_modules
        envIdentityFiles:
          - package.json
          - package-lock.json
          - deploy/runtime/launcher/hwlab-env-reuse-launcher.ts
          - internal/dev-entrypoint/artifact-runtime.mjs
    hwlab-agent-skills:
      runtimeReuse:
        enabled: true
        codeIdentity:
          paths:
            - skills
            - deploy/runtime/boot/hwlab-agent-skills.sh
        envIdentity:
          paths:
            - package.json
            - package-lock.json
            - deploy/runtime/launcher/hwlab-env-reuse-launcher.ts
            - internal/dev-entrypoint/artifact-runtime.mjs
      envReuse:
        enabled: true
        mode: env-reuse-gitea-checkout
        nodeDepsPath: /opt/hwlab-env/node_modules
        envIdentityFiles:
          - package.json
          - package-lock.json
          - deploy/runtime/launcher/hwlab-env-reuse-launcher.ts
          - internal/dev-entrypoint/artifact-runtime.mjs
