{
  "name": "Tracker Dashboard Test Runner",
  "description": "Add an admin-only Testing tab that dynamically discovers repository pytest tests, runs a selected safe test target in a background process, and shows live output/status in the tracker dashboard.",
  "branchName": "ralph/dashboard-test-runner",
  "userStories": [
    {
      "id": "US-001",
      "title": "Implement secure tracker test-runner API",
      "description": "As a tracker administrator, I want the tracker to discover and run repository tests through a controlled API so that dashboard actions cannot execute arbitrary shell commands.",
      "acceptanceCriteria": [
        "Add an explicit disabled-by-default TrackerServer/CLI test-runner flag; no test endpoint runs commands unless enabled.",
        "Admin-only endpoints dynamically collect pytest node IDs and start one selected collected test or approved suite at a time without accepting arbitrary command arguments.",
        "Run pytest in a background process without shell=True, retain bounded stdout/stderr logs, status, timestamps, exit code, and reject concurrent runs.",
        "Add focused API tests for authorization, disabled state, collection, start, progress/completion, and concurrent-run rejection.",
        "uv run pytest tests/test_dashboard.py tests/test_tracker_routing.py tests/test_dynamic_routing.py -q passes."
      ],
      "priority": 1,
      "passes": true,
      "notes": "Use repository root discovery independent of tracker current working directory. Real-inference tests must require an explicit enable flag or environment gate and must never be included in a default suite.",
      "dependsOn": [],
      "completionNotes": "Completed by agent"
    },
    {
      "id": "US-002",
      "title": "Add Testing dashboard tab with live test logs",
      "description": "As a tracker administrator, I want a Testing tab that lists discovered tests and exposes run/status/log controls so that I can operate and inspect tests from the dashboard.",
      "acceptanceCriteria": [
        "Add an admin-only Testing navigation tab and panel; it is hidden for non-admin users.",
        "Dynamically render tests/suites returned by the tracker API with a Run button for each allowed target.",
        "Show current state, start/end time, elapsed time, exit code, success/failure, and an auto-refreshing bounded console/log view.",
        "Disable run controls while a test run is active and display API errors clearly.",
        "Add dashboard regression tests asserting the Testing tab, dynamic API calls, run controls, and log/status renderer exist.",
        "uv run pytest tests/test_dashboard.py -q passes."
      ],
      "priority": 2,
      "passes": true,
      "notes": "Depends on US-001. Preserve existing dashboard tabs and admin authentication conventions.",
      "dependsOn": [
        "US-001"
      ],
      "completionNotes": "Completed by agent"
    },
    {
      "id": "US-003",
      "title": "Wire launch and document operator workflow",
      "description": "As a local mesh operator, I want a launch configuration and documentation for the opt-in test runner so that I can enable it intentionally and understand real-inference safeguards.",
      "acceptanceCriteria": [
        "Add a distinct VS Code tracker launch configuration that enables the test runner and uses the project tracker runtime.",
        "Document default safe suites versus the explicitly gated real-inference suite, including required environment variables and API-credit/hardware implications.",
        "Validate launch.json and tracker CLI --help.",
        "uv run pytest tests/test_dashboard.py tests/test_dynamic_routing.py -q passes."
      ],
      "priority": 3,
      "passes": true,
      "notes": "Do not reintroduce --enable-test-runner without implementing its CLI argument in US-001.",
      "dependsOn": [
        "US-001",
        "US-002"
      ],
      "completionNotes": "Completed by agent"
    }
  ],
  "metadata": {
    "updatedAt": "2026-07-12T01:58:06.286Z"
  }
}