AI Agents SDE Task Viewer
      • Context
      • Plan
      • Prd
  1. Home
  2. AgentSDE
  3. agent-core
  4. gh-242
  5. plan
  6. context.json
context.json(3.0 KB)· Apr 2, 2026
{
  "meta": {
    "agent": "planner",
    "task_id": "242",
    "title": "BLOCKED:PERSISTENT should set status=gated instead of status=blocked",
    "created_at": "2026-04-02T12:00:00Z"
  },
  "inputs": [
    {
      "name": "issue-242",
      "type": "context",
      "ref": "https://github.com/AgentSDE/agent-core/issues/242",
      "notes": "BLOCKED:PERSISTENT sets wrong status, causing dashboard misclassification"
    },
    {
      "name": "AGENTS.md",
      "type": "context",
      "ref": "AGENTS.md",
      "notes": "Codebase conventions and pipeline phase patterns"
    }
  ],
  "outputs": [
    {
      "name": "plan",
      "type": "plan",
      "format": "md",
      "content": "plan.md"
    }
  ],
  "files": [
    {
      "path": "src/internal-adapter/internal-adapter.service.ts",
      "action": "modify",
      "reason": "Change status from blocked to gated in handlePersistentBlock, update hook arg"
    },
    {
      "path": "src/hooks/phase-hooks.service.ts",
      "action": "modify",
      "reason": "Update early-return guard for gated category on refine/review"
    },
    {
      "path": "src/task-state/task-state.types.ts",
      "action": "modify",
      "reason": "Add gated to TaskStatus union type"
    },
    {
      "path": "src/internal-adapter/internal-adapter.service.spec.ts",
      "action": "modify",
      "reason": "Update test expectations for gated status"
    },
    {
      "path": "src/hooks/phase-hooks.service.spec.ts",
      "action": "modify",
      "reason": "Add test coverage for gated category"
    }
  ],
  "steps": [
    {
      "id": "S1",
      "summary": "Update handlePersistentBlock to set status=gated and pass gated to onPhaseBlocked hook",
      "acceptance": [
        "handlePersistentBlock sets status: 'gated' instead of status: 'blocked'",
        "onPhaseBlocked call in handlePersistentBlock passes 'gated' as the fourth argument"
      ],
      "depends_on": []
    },
    {
      "id": "S2",
      "summary": "Add gated to TaskStatus type and update onPhaseBlocked early-return guard",
      "acceptance": [
        "TaskStatus union type includes 'gated'",
        "onPhaseBlocked suppresses label/comment for category=gated on refine/review phases"
      ],
      "depends_on": [
        "S1"
      ]
    },
    {
      "id": "S3",
      "summary": "Update unit tests for persistent-block and hook gated-category behavior",
      "acceptance": [
        "internal-adapter.service.spec.ts tests expect gated status in persistent-block scenarios",
        "phase-hooks.service.spec.ts covers gated category early-return",
        "npm run test passes",
        "npm run lint passes"
      ],
      "depends_on": [
        "S1",
        "S2"
      ]
    }
  ],
  "risks": [
    {
      "risk": "Migration script for existing blocked rows is omitted",
      "mitigation": "Recommend follow-up issue or manual correction via control API status-override endpoint"
    }
  ],
  "assumptions": [
    "No migration infrastructure exists in this codebase — SQLite with plain string status column",
    "Metrics aggregation already groups blocked+gated as inProgressCount — no metrics change needed",
    "Other callers checking status=blocked (handleTransientBlock, retry-limit) are genuine error paths and should remain unchanged"
  ],
  "open_questions": []
}
Plan