Ctrl K
ComunidadGuías…

Taskfile.yml

Rama main · réplica de lectura del repositorio original.

Archivo original ↗Preguntar a KiBot
# Dev commands. Requires go-task (https://taskfile.dev) — optional; each task is
# a thin wrapper over uv, so you can always run the underlying command directly.
version: "3"

tasks:
  setup:
    desc: Install all dependencies into the uv-managed virtualenv
    cmds:
      - uv sync --all-packages

  new-module:
    desc: Scaffold + wire in a new module (e.g. `task new-module -- "Weather"`); see docs/reference/ports.md
    cmds:
      - uv run python scripts/new_module.py {{.CLI_ARGS}}

  lint:
    desc: Lint with ruff
    cmds:
      - uv run ruff check .

  fmt:
    desc: Auto-format with ruff
    cmds:
      - uv run ruff format .

  fmt-check:
    desc: Check formatting without writing changes
    cmds:
      - uv run ruff format --check .

  type:
    desc: Type-check with mypy (strict; packages come from pyproject.toml)
    cmds:
      - uv run mypy

  test:
    desc: Run the test suite
    cmds:
      - uv run pytest

  check:
    desc: Run every quality gate (lint, format check, types, tests) — mirrors CI
    cmds:
      - task: lint
      - task: fmt-check
      - task: type
      - task: test

  migrate:list:
    desc: List the services whose schema is migration-managed, with each one's head revision
    cmds:
      - uv run python scripts/migrate.py services

  migrate:new:
    desc: 'Create the next schema revision for a service, empty and ready to hand-write (e.g. `task migrate:new -- storage "add etag"`). Not autogenerate — that needs a live Postgres; see docs/developer/migrations.md'
    cmds:
      - uv run python scripts/migrate.py new {{.CLI_ARGS}}

  migrate:check:
    desc: 'Prove a service''s revisions still match its models — upgrade an empty SQLite to head, then `alembic check` (e.g. `task migrate:check -- storage`; no args checks every migrated service). The local half of CI''s `migrations` gate'
    cmds:
      - uv run python scripts/migrate.py check {{.CLI_ARGS}}

  up:
    desc: Start the full stack (data plane + enabled modules; Docker control is on by default through docker-proxy-core, observability is opt-in — see `obs-up` / `docker-socket-up`, and `hosted-only-up` to run without the local AI runtime)
    cmds:
      - docker compose up -d

  hosted-only-up:
    desc: 'Start the stack with NO local LLM runtime (#962) — no Ollama container, and OLLAMA_URL blank so the core says so rather than probing a host that is not there. Set LLM_DEFAULT_MODEL + MEMORY_EMBED_MODEL to hosted ids in .env first, or chat and every embedding fail at call time'
    cmds:
      - docker compose -f compose.yaml -f infra/ollama/compose.hosted-only.yaml up -d

  hosted-only-down:
    desc: Stop the stack including the hosted-only override (append `-- -v` to drop volumes)
    cmds:
      - docker compose -f compose.yaml -f infra/ollama/compose.hosted-only.yaml down {{.CLI_ARGS}}

  down:
    desc: Stop the full stack (append `-- -v` to also drop volumes)
    cmds:
      - docker compose down {{.CLI_ARGS}}

  obs-up:
    desc: Start the stack with the opt-in observability profile (Grafana/Prometheus/Loki/Tempo)
    cmds:
      - docker compose --profile observability up -d

  obs-down:
    desc: Stop the stack including the observability profile (append `-- -v` to drop volumes)
    cmds:
      - docker compose --profile observability down {{.CLI_ARGS}}

  docker-socket-up:
    desc: 'Start the stack with core-app on the RAW Docker socket instead of the default docker-proxy-core (#622, #708) — root-equivalent, no allowlist in front of it; requires DOCKER_GID (see services/core-app/compose.docker-socket.yaml)'
    cmds:
      - docker compose -f compose.yaml -f services/core-app/compose.docker-socket.yaml up -d

  docker-socket-down:
    desc: Stop the stack including the Docker-socket override (append `-- -v` to drop volumes)
    cmds:
      - docker compose -f compose.yaml -f services/core-app/compose.docker-socket.yaml down {{.CLI_ARGS}}

  external-mounts-up:
    desc: 'Start the stack with operator-declared external file mounts (#731) — additional Files roots bound from the host; requires EXTERNAL_MOUNT_*_HOST_PATH + FILES_EXTERNAL_MOUNTS (see services/core-app/compose.external-mounts.yaml)'
    cmds:
      - docker compose -f compose.yaml -f services/core-app/compose.external-mounts.yaml up -d

  external-mounts-down:
    desc: Stop the stack including the external-mounts override (append `-- -v` to drop volumes)
    cmds:
      - docker compose -f compose.yaml -f services/core-app/compose.external-mounts.yaml down {{.CLI_ARGS}}

  smoke:
    desc: Boot an isolated copy of the stack and assert the integration last mile (mirrors the CI gate)
    cmds:
      - sh infra/ci/smoke.sh

  reconcile:
    desc: 'Deploy on the box: pull GHCR images for the tracked tag and restart changed containers (data volumes preserved; EPICURUS_VERSION in .env selects release/pinned/testing; DOCKER_GID in .env persists the docker-socket opt-in, #655)'
    cmds:
      - sh infra/cd/reconcile.sh

  infra-up:
    desc: Start only the data-plane stack (Postgres, Valkey, NATS, Qdrant, OpenBao)
    cmds:
      - docker compose -f infra/compose/docker-compose.yml up -d

  infra-down:
    desc: Stop the data-plane stack (append `-- -v` to also drop volumes)
    cmds:
      - docker compose -f infra/compose/docker-compose.yml down {{.CLI_ARGS}}

  infra-ps:
    desc: Show data-plane service status
    cmds:
      - docker compose -f infra/compose/docker-compose.yml ps

  infra-logs:
    desc: Tail data-plane logs
    cmds:
      - docker compose -f infra/compose/docker-compose.yml logs -f