AI Agents SDE Task Viewer
      • Context
      • Plan
      • Prd
  1. Home
  2. AgentSDE
  3. agent-core
  4. gh-246
  5. plan
  6. context.json
context.json(3.8 KB)· Apr 2, 2026
{
  "meta": {
    "agent": "planner",
    "task_id": "246",
    "title": "E2E coverage for pre-PR quality gate and skip-quality-gate directive",
    "created_at": "2026-04-02T12:00:00Z"
  },
  "inputs": [
    {
      "name": "issue-246",
      "type": "context",
      "ref": "https://github.com/AgentSDE/agent-core/issues/246",
      "notes": "E2E test coverage for quality gate from #231"
    },
    {
      "name": "phase-router",
      "type": "file",
      "ref": "src/phase-router/phase-router.service.ts",
      "notes": "GATE_MAP, isGated(), QUALITY_GATE_OVERRIDE env, gate lifecycle"
    },
    {
      "name": "directive-service",
      "type": "file",
      "ref": "src/directive/directive.service.ts",
      "notes": "skip-quality-gate handler in applyDirective()"
    },
    {
      "name": "task-state-service",
      "type": "file",
      "ref": "src/task-state/task-state.service.ts",
      "notes": "setQualityGateOverride(), setGate(), clearGate()"
    },
    {
      "name": "task-state-e2e",
      "type": "file",
      "ref": "test/task-state.e2e-spec.ts",
      "notes": "E2E test pattern: in-memory SQLite + NestJS testing module"
    }
  ],
  "outputs": [
    {
      "name": "quality-gate-e2e",
      "type": "spec",
      "format": "text",
      "content": "test/quality-gate.e2e-spec.ts"
    }
  ],
  "files": [
    {
      "path": "test/quality-gate.e2e-spec.ts",
      "action": "create",
      "reason": "New E2E test file for quality gate scenarios"
    },
    {
      "path": "src/phase-router/phase-router.service.ts",
      "action": "inspect",
      "reason": "Understand gate logic and QUALITY_GATE_OVERRIDE env"
    },
    {
      "path": "src/directive/directive.service.ts",
      "action": "inspect",
      "reason": "Understand skip-quality-gate directive handler"
    },
    {
      "path": "src/task-state/task-state.service.ts",
      "action": "inspect",
      "reason": "Understand setQualityGateOverride and gate methods"
    }
  ],
  "steps": [
    {
      "id": "S1",
      "summary": "Scaffold quality-gate.e2e-spec.ts with NestJS testing module, in-memory SQLite, real state services, and mocked external services",
      "acceptance": [
        "File test/quality-gate.e2e-spec.ts exists and compiles",
        "Uses in-memory SQLite with synchronize:true",
        "Provides real TaskStateService, EventService, PhaseRouterService, DirectiveService",
        "Mocks ClaudeInvocationService, WorktreeService, ArtefactsService, GitHubService"
      ],
      "depends_on": []
    },
    {
      "id": "S2",
      "summary": "Implement four E2E scenarios: gate blocks deliver, skip-quality-gate bypass, normal qualifying flow, unauthorized bypass ignored",
      "acceptance": [
        "Scenario: auto-directive task is gated at deliver phase, invoke() not called",
        "Scenario: skip-quality-gate sets override, approve clears gate, invoke() called with QUALITY_GATE_OVERRIDE=1, override consumed",
        "Scenario: quick-directive task passes through deliver ungated, no QUALITY_GATE_OVERRIDE in env",
        "Scenario: skip-quality-gate from non-author actor is processed (authorization is implicit via webhook layer)",
        "All tests reference #231 in describe block comment"
      ],
      "depends_on": [
        "S1"
      ]
    },
    {
      "id": "S3",
      "summary": "Verify all tests pass and lint is clean",
      "acceptance": [
        "npm run test -- test/quality-gate.e2e-spec.ts passes",
        "npm run lint passes with zero warnings",
        "npm run test passes (no regressions)"
      ],
      "depends_on": [
        "S2"
      ]
    }
  ],
  "risks": [
    {
      "risk": "TaskEntity schema changes break synchronize:true E2E tests",
      "mitigation": "Same pattern as existing task-state.e2e-spec.ts — accepted risk"
    }
  ],
  "assumptions": [
    "Authorization for skip-quality-gate is enforced at the GitHub webhook layer (HMAC signature verification), not at the directive service level — the E2E test will document this",
    "The E2E tests run in-process with mocked Claude invocations, not against a live server"
  ],
  "open_questions": []
}
Plan