version: '3'

vars:
  DEFT_ROOT: '{{joinPath .TASKFILE_DIR ".."}}'

# reconcile issues task.
#
# IMPORTANT: runs from the consumer project root (``dir:
# '{{.USER_WORKING_DIR}}'``) so ``gh`` and ``git`` commands executed by
# ``scripts/reconcile_issues.py`` resolve against the CONSUMER's remote,
# not deftai/directive (#538). Script path dispatched via {{.DEFT_ROOT}}
# (defined locally in this file's `vars:` block via
# ``{{joinPath .TASKFILE_DIR ".."}}`` -- see ../Taskfile.yml for why
# root-level definition is avoided) to keep the path traversal-free and
# avoid the {{.TASKFILE_DIR}}/.. form that breaks on Windows under
# `uv --project "{{.DEFT_ROOT}}" run python` (#566).

tasks:

  issues:
    desc: "Reconcile GitHub issues against vBRIEF references -- report linked, unlinked, and resolved"
    dir: '{{.USER_WORKING_DIR}}'
    deps:
      - task: :engine:_ts-build
    cmds:
      - task: :engine:invoke
        vars:
          ENGINE_CMD: 'reconcile-issues --project-root "{{.USER_WORKING_DIR}}" {{.CLI_ARGS}}'
