{
  "error": {
    "message": "{\"error\":{\"message\":\"{\\n  \\\"error\\\": {\\n    \\\"code\\\": 403,\\n    \\\"message\\\": \\\"Your API key was reported as leaked. Please use another API key.\\\",\\n    \\\"status\\\": \\\"PERMISSION_DENIED\\\"\\n  }\\n}\\n\",\"code\":403,\"status\":\"Forbidden\"}}",
    "stack": "ApiError: {\"error\":{\"message\":\"{\\n  \\\"error\\\": {\\n    \\\"code\\\": 403,\\n    \\\"message\\\": \\\"Your API key was reported as leaked. Please use another API key.\\\",\\n    \\\"status\\\": \\\"PERMISSION_DENIED\\\"\\n  }\\n}\\n\",\"code\":403,\"status\":\"Forbidden\"}}\n    at throwErrorIfNotOK (file:///home/claude/.npm-global/lib/node_modules/@google/gemini-cli/bundle/chunk-67TFD6HC.js:36178:24)\n    at process.processTicksAndRejections (node:internal/process/task_queues:103:5)\n    at async file:///home/claude/.npm-global/lib/node_modules/@google/gemini-cli/bundle/chunk-67TFD6HC.js:35941:7\n    at async Models.generateContentStream (file:///home/claude/.npm-global/lib/node_modules/@google/gemini-cli/bundle/chunk-67TFD6HC.js:37037:16)\n    at async file:///home/claude/.npm-global/lib/node_modules/@google/gemini-cli/bundle/chunk-UQGLVPZQ.js:278827:19\n    at async file:///home/claude/.npm-global/lib/node_modules/@google/gemini-cli/bundle/chunk-UQGLVPZQ.js:255732:23\n    at async retryWithBackoff (file:///home/claude/.npm-global/lib/node_modules/@google/gemini-cli/bundle/chunk-UQGLVPZQ.js:275704:23)\n    at async GeminiChat.makeApiCallAndProcessStream (file:///home/claude/.npm-global/lib/node_modules/@google/gemini-cli/bundle/chunk-UQGLVPZQ.js:311287:28)\n    at async GeminiChat.streamWithRetries (file:///home/claude/.npm-global/lib/node_modules/@google/gemini-cli/bundle/chunk-UQGLVPZQ.js:311125:29)\n    at async Turn.run (file:///home/claude/.npm-global/lib/node_modules/@google/gemini-cli/bundle/chunk-UQGLVPZQ.js:311618:24)"
  },
  "context": [
    {
      "role": "user",
      "parts": [
        {
          "text": "<session_context>\nThis is the Gemini CLI. We are setting up the context for our chat.\nToday's date is Wednesday, June 24, 2026 (formatted according to the user's locale).\nMy operating system is: linux\nThe project's temporary directory is: /home/claude/.gemini/tmp/pr-review-wylsju\n- **Workspace Directories:**\n  - /tmp/pr-review-wYlSJU\n- **Directory Structure:**\n\nShowing up to 200 items (files + folders).\n\n/tmp/pr-review-wYlSJU/\n\n\n\n</session_context>"
        }
      ]
    },
    {
      "role": "user",
      "parts": [
        {
          "text": "You are re-reviewing PR #30: \"docs(orchestration): remove Linear workflow requirement\" after the author pushed changes to address your prior review.\n\n## Your Prior Review Comments\n(no inline comments — only a summary was posted)\n\n## Prior Summary\n🤖 **Gemini Code Review**\n\nAll outstanding review threads have been successfully addressed. The no-emoji rule is now explicitly documented, Phase 3 validation accurately reflects the optional nature of `AGENT_TASK_ID` (handling cases without a tracker or GitHub issue), and the `curl` tool description has been updated to reflect its current use cases. The non-blocking suggestions and nitpicks have been integrated nicely. The PR is ready to merge.\n\n## Unresolved Threads\nWould approve code changes, but 8 unresolved review thread(s) remain:\n- **gautam-claude** on `docs/AGENTS.md:58`: [suggestion] This line (`When no tracker is configured, Pi operates from the cur...\n- **gautam-claude** on `docs/AGENTS.md:82`: [suggestion] The `AGENT_TASK_ID` is documented as optional here, but Phase 3 (li...\n- **gautam-claude** on `docs/AGENTS.md:222`: [nitpick] `curl` description is now \"HTTP checks and optional tracker adapter ca...\n- **gautam-claude** on `docs/AGENTS.md:179`: [suggestion] The agent comment templates dropped emojis (was `🔄`, `✅`, `❌`). Th...\n- **gautam-claude** on `docs/AGENTS.md:57`: [suggestion] This paragraph is doing a lot of work. Consider breaking \"Durable t...\n\n\n## Workflow Suggestions\n- 💡 Consider adding a lint rule or a simple bash script in CI (`grep -i 'linear' docs/AGENTS.md`) to ensure future documentation updates don't accidentally reintroduce hard-coded Linear concepts outside of the historical context sections.\n- 💡 Consider enabling auto-resolve for review threads in GitHub when the referenced lines are updated to avoid manual resolution steps for non-blocking nitpicks.\n\n\n## Current Diff (after changes)\n```diff\nFile: docs/AGENTS.md (modified, +78/-100)\n@@ -2,7 +2,7 @@\n \n ## Overview\n \n-This repo implements a multi-agent orchestration system built on pi-mono. Pi (the orchestrator) acts as CTO, communicating with Gautam via iMessage and delegating work to specialized sub-agents. Linear serves as the orchestration bus and single source of truth for task state. All work flows through Linear issues, with sub-agents executing tasks in isolated branches and submitting PRs for review. The system enforces strict lifecycle protocols, conventional commit standards, and comprehensive audit trails via git notes.\n+This repo implements a multi-agent orchestration system built on pi-mono. Pi (the orchestrator) acts as CTO, communicating with Gautam via iMessage and delegating work to specialized sub-agents. Work can originate from a direct user request, a GitHub issue, or an optional external tracker. Sub-agents execute tasks in isolated branches and submit PRs for review. The system enforces strict lifecycle protocols, conventional commit standards, and comprehensive audit trails via git notes.\n \n ## Architecture\n \n@@ -17,11 +17,11 @@ This repo implements a multi-agent orchestration system built on pi-mono. Pi (th\n │             │ Tools: read, subagent delegation\n └──────┬──────┘\n        │\n-       ├─────► Linear API (async orchestration bus)\n-       │       - Issue state management\n-       │       - AgentSession lifecycle\n+       ├─────► Optional task tracker integration\n+       │       - Task state management\n+       │       - Agent session lifecycle\n        │       - Activity streaming\n-       │       - Board state webhooks\n+       │       - Conditional state webhooks\n        │\n        └─────► Sub-Agents (spawned via scripts/agent-wrapper.sh)\n                │\n@@ -34,7 +34,7 @@ This repo implements a multi-agent orchestration system built on pi-mono. Pi (th\n                    │\n                    ▼\n                Git Operations\n-               - Branch per issue\n+               - Branch per task\n                - Conventional commits\n                - Co-Authored-By trailers\n                - Git notes for session logs\n@@ -47,9 +47,13 @@ This repo implements a multi-agent orchestration system built on pi-mono. Pi (th\n                - Branch protection on main\n ```\n \n-**Flow**: Gautam → iMessage → Pi → Linear Issue → Sub-Agent → Git Branch → PR → Review → Merge → Done\n+**Flow**: Gautam → iMessage → Pi → Task/User Request → Sub-Agent → Git Branch → PR → Review → Merge → Done\n \n-**Key Principle**: Linear is the single source of truth. Pi reads board state via webhooks, spawns agents assigned to Linear issues, agents report progress via AgentActivity API, and Pi never directly edits code.\n+**Key Principles**:\n+- Durable task state is required; Linear is not.\n+- Pi may source state from a configured tracker, GitHub issues and PRs, or direct user context.\n+- When no tracker is configured, Pi operates from the current user request plus GitHub issue and PR state.\n+- Agents report progress to the surface that originated the work, and Pi never directly edits code.\n \n ## Agent Roles\n \n@@ -58,7 +62,7 @@ This repo implements a multi-agent orchestration system built on pi-mono. Pi (th\n | `worker` | General-purpose implementation | `claude-sonnet-4-5` | read, write, edit, bash | Disposable (killed after In Review) |\n | `worker-full` | Full-capability implementation | `claude-sonnet-4-20250514` | read, write, edit, bash | Disposable |\n | `worker-readonly` | Read-only analysis/audit | `claude-sonnet-4-20250514` | read, grep, find, ls, bash | Disposable |\n-| `researcher` | Topic investigation | `claude-opus-4-6` | read, grep, find, ls, bash | Persistent (Linear app user) |\n+| `researcher` | Topic investigation | `claude-opus-4-6` | read, grep, find, ls, bash | Persistent |\n | `reviewer` | Code review specialist | `claude-sonnet-4-5` | read, bash | Persistent (learns patterns) |\n | `planner` | Spec/plan creation | `claude-sonnet-4-5` | read | Disposable |\n | `scout` | Fast recon/exploration | `claude-haiku-4-5` | read, bash (compressed context) | Disposable |\n@@ -72,11 +76,11 @@ This repo implements a multi-agent orchestration system built on pi-mono. Pi (th\n Sub-agents follow a strict 5-phase lifecycle enforced by `scripts/agent-wrapper.sh`:\n \n ### Phase 1: Setup\n-- Create Linear AgentSession on issue\n-- Generate branch name from issue title (conventional format)\n+- Create an agent session record when the active tracker supports it\n+- Generate branch name from the task title (conventional format)\n - **Sequential mode**: Create branch off `main`\n - **Parallel mode**: Create branch off task branch, add worktree\n-- Export environment variables (`AGENT_SESSION_ID`, `AGENT_ISSUE_ID`, `LINEAR_API_KEY`, `LINEAR_APP_TOKEN`)\n+- Export environment variables (`AGENT_SESSION_ID`, optional `AGENT_TASK_ID`, optional tracker credentials)\n \n ### Phase 2: Execution\n - Parse agent definition (`~/.pi/agent/agents/<name>.md`)\n@@ -90,30 +94,32 @@ Sub-agents follow a strict 5-phase lifecycle enforced by `scripts/agent-wrapper.\n - Verify new commits exist (`git rev-list --count`)\n - Validate conventional commit format (`type(scope): description`)\n - Verify Co-Authored-By trailer on all commits\n-- Post errors to Linear AgentActivity and issue comments on failure\n+- Post errors to the originating task surface on failure when one exists\n+- When there is no tracker task or GitHub issue, leave the failure in the session log and return it to Pi/user context\n \n ### Phase 4: Finalization\n - Attach session log as git note on last commit (truncated to 500KB or 10k lines)\n - Push branch to origin\n - Push git notes (`refs/notes/commits`)\n - Create PR (to `main` or task branch depending on mode)\n-- Post handoff activity to Linear session\n-- Move issue to `In Review` state\n-- Post completion comment to issue\n+- Post handoff activity to the originating task surface\n+- Move the task to review when the active tracker supports states\n+- Post completion comment to the originating issue or PR when available\n \n ### Phase 5: Teardown\n - Clean up temp files (`/tmp/agent-system-prompt-*`, `/tmp/agent-session-*.log`)\n - **Sequential mode**: No teardown needed\n - **Parallel mode**: Remove worktree, leave branches for orchestrator\n \n-**Critical**: Agents are killed after Phase 4. Session state persists in git notes and Linear. New agent spawns reconstruct context from external state.\n+**Critical**: Agents are killed after Phase 4. Session state persists in git notes and the originating task surface. New agent spawns reconstruct context from external state.\n \n ## Git Model\n \n ### Branch Naming (conventional-branch.github.io)\n-- **Sequential**: `feat/PI-XXX-description` (branch off `main`)\n-- **Parallel**: `feat/PI-XXX/agent-<role>` (branch off task branch `feat/PI-XXX-description`)\n-- Examples: `feat/pi-56-completion-protocol`, `feat/pi-65/agent-worker`, `fix/pi-72-linear-cleanup`\n+- **Sequential**: `feat/descriptive-slug` or `fix/descriptive-slug` (branch off `main`)\n+- **Parallel**: `feat/descriptive-slug/agent-<role>` (branch off task branch `feat/descriptive-slug`)\n+- **Issue-backed optional**: include the issue key when one exists, e.g. `feat/gh-123-completion-protocol`\n+- Examples: `feat/completion-protocol`, `feat/review-gate/agent-worker`, `fix/task-context-cleanup`\n \n ### Commit Conventions\n Format: `type(scope): description`\n@@ -126,122 +132,103 @@ Example:\n ```\n feat(orchestration): add completion protocol\n \n-Implements Linear AgentSession lifecycle with 5-phase wrapper.\n+Implements agent session lifecycle with 5-phase wrapper.\n \n Co-Authored-By: agent/worker-full 550e8400-e29b-41d4-a716-446655440000@noreply\n ```\n \n ### PR Workflow\n \n **Sequential (single agent)**:\n-1. Agent works on `feat/PI-XXX-description` off `main`\n-2. Wrapper creates PR: `feat/PI-XXX-description` → `main`\n+1. Agent works on `feat/descriptive-slug` off `main`\n+2. Wrapper creates PR: `feat/descriptive-slug` → `main`\n 3. Review gates: reviewer agent → 4-agent PR review\n 4. Merge to `main` on approval\n \n **Parallel (multiple agents)**:\n-1. Pi creates task branch `feat/PI-XXX-description` off `main`\n-2. Each agent works on `feat/PI-XXX/agent-<role>` in isolated worktree\n-3. Wrapper creates PR: `feat/PI-XXX/agent-<role>` → `feat/PI-XXX-description`\n+1. Pi creates task branch `feat/descriptive-slug` off `main`\n+2. Each agent works on `feat/descriptive-slug/agent-<role>` in isolated worktree\n+3. Wrapper creates PR: `feat/descriptive-slug/agent-<role>` → `feat/descriptive-slug`\n 4. Pi merges agent branches into task branch after review\n-5. Pi creates final PR: `feat/PI-XXX-description` → `main`\n+5. Pi creates final PR: `feat/descriptive-slug` → `main`\n 6. Review gates apply to final PR\n \n-**Always**: Every commit links to Linear issue via `fixes #PI-XXX` in commit message.\n+**Issue-backed work**: Use `fixes #<issue-number>` or `closes #<issue-number>` in commit messages only when the issue is meant to auto-close on merge. Direct user-requested work does not require an issue link.\n \n-## Linear Integration\n+## Optional Task Tracker Integration\n \n-### State Machine\n+Tracker integration is optional. Linear was the original adapter, but it is no longer required for normal branch, commit, PR, or agent workflows.\n+When a tracker adapter is enabled, use that tracker's states. Historical Linear-specific states are adapter reference material in `docs/adapters/linear.md`, not default workflow requirements.\n \n-**Project States**:\n-```\n-Backlog → Shaping → Planned → In Progress → Review → Done\n-```\n-\n-**Issue States**:\n-```\n-Backlog → Todo → Plan → In Progress → In Review → Done\n-         ↑                                ↓\n-         └────────── (blocked/dependency) ─┘\n-```\n-\n-**Rules**:\n-- Nothing moves to `In Progress` without a spec in `Plan` state\n-- Sub-agents own state up to `In Review`\n-- Pi owns transition to `Done` and parent issue state\n+### Agent Session Lifecycle\n \n-### AgentSession Lifecycle\n-\n-1. **Creation**: Wrapper calls `agentSessionCreateOnIssue` mutation on issue\n-2. **Streaming**: Agent posts progress via `agentActivityCreate` with types:\n+1. **Creation**: Wrapper creates an agent session on the active task when supported\n+2. **Streaming**: Agent posts progress to the originating surface with types:\n    - `response`: Status updates, handoff messages\n    - `error`: Failures, validation errors\n 3. **Completion**: Final activity posted with PR link, commit stats\n-4. **Persistence**: Session ID stored in git notes, Linear retains full history\n+4. **Persistence**: Session ID stored in git notes; the originating tracker or PR retains the user-facing history\n \n-### Linear as Orchestration Bus\n+### Tracker as Orchestration Bus\n \n-- **Pi**: Receives webhooks for board state changes (issue created, status updated, assigned)\n-- **Pi cache**: In-memory board state (issue ID, status, assignee, delegate, due date)\n-- **Sub-agents**: Never read board state, only interact via their assigned issue session\n-- **API tokens**: `LINEAR_API_KEY` for Pi queries, `LINEAR_APP_TOKEN` for agent sessions\n+- **No tracker configured**: Pi uses current user context plus GitHub issue and PR state; no board-state webhooks or tracker cache are required\n+- **Pi**: Receives webhooks for board state changes only when a tracker is configured\n+- **Pi cache**: Optional in-memory board state (task ID, status, assignee, delegate, due date)\n+- **Sub-agents**: Never read board state, only interact via their assigned task/session\n+- **API tokens**: Required only by the configured tracker adapter\n \n ### Comments\n \n-- **Agent start**: \"🔄 Agent `<name>` started on issue PI-XXX (session: `<id>`)\"\n-- **Agent complete**: \"✅ Agent `<name>` completed successfully. Pull request: `<url>`\"\n-- **Agent error**: \"❌ Agent `<name>` failed with exit code `<code>`. See session `<id>` for details.\"\n+Comment templates are plain text to comply with the repo's no-emoji communication rule.\n+\n+- **Agent start**: \"Agent `<name>` started on task `<id>` (session: `<id>`)\"\n+- **Agent complete**: \"Agent `<name>` completed successfully. Pull request: `<url>`\"\n+- **Agent error**: \"Agent `<name>` failed with exit code `<code>`. See session `<id>` for details.\"\n \n ## Naming Conventions\n \n | Entity | Format | Example |\n |--------|--------|---------|\n-| Sequential branch | `type/PI-XXX-slug` | `feat/pi-56-completion-protocol` |\n-| Parallel task branch | `type/PI-XXX-slug` | `feat/pi-65-review-gate` |\n-| Parallel agent branch | `type/PI-XXX/agent-role` | `feat/pi-65/agent-reviewer` |\n+| Sequential branch | `type/slug` | `feat/completion-protocol` |\n+| Parallel task branch | `type/slug` | `feat/review-gate` |\n+| Parallel agent branch | `type/slug/agent-role` | `feat/review-gate/agent-reviewer` |\n | Commit message | `type(scope): description` | `feat(orchestration): add wrapper` |\n | Co-Authored-By | `agent/<role> <uuid@noreply>` | `agent/worker-full 550e8400@noreply` |\n-| Issue identifier | `PI-XXX` | `PI-56` |\n+| Task identifier | Optional tracker or GitHub issue ID | `123` |\n | Agent session ID | UUID v4 | `550e8400-e29b-41d4-a716-446655440000` |\n | Session log file | `/tmp/agent-session-<uuid>.log` | `/tmp/agent-session-550e8400.log` |\n | System prompt file | `/tmp/agent-system-prompt-<uuid>.txt` | `/tmp/agent-system-prompt-550e8400.txt` |\n \n ## Dependencies\n \n ### Required Tools\n-- `gh` (GitHub CLI) - PR creation, issue management\n-- `jq` - JSON parsing for Linear API responses\n-- `curl` - Linear API calls\n+- `gh` (GitHub CLI) - PR creation and GitHub issue management\n - `tsx` - TypeScript execution for Pi CLI\n - `git` - Version control (with `git notes` support)\n - `node` (v18+) - Node.js runtime\n - `npm` - Package manager\n-\n-### Required Environment Variables\n-| Variable | Description | Used By |\n-|----------|-------------|---------|\n-| `LINEAR_API_KEY` | User API key for Pi board queries | Pi, wrapper setup |\n-| `LINEAR_APP_TOKEN` | App token for AgentSession API | Wrapper, sub-agents |\n-| `LINEAR_TEAM_ID` | Linear team UUID | Wrapper (defaults to pi-mono team) |\n-| `LINEAR_STATE_IN_REVIEW` | State ID for In Review | Wrapper (defaults to pi-mono state) |\n+- `jq` - JSON parsing in wrapper and GitHub/tracker flows\n+- `curl` - HTTP requests in wrapper scripts, local probes, and optional tracker adapter calls\n \n ### Optional Environment Variables\n | Variable | Description | Default |\n |----------|-------------|---------|\n | `REPO_ROOT` | Repository root path | Detected from script location |\n | `MAX_LOG_SIZE` | Max session log size (bytes) | 512000 (500KB) |\n+| `TRACKER_API_KEY` | API key for an optional tracker adapter | unset |\n+| `TRACKER_APP_TOKEN` | App token for an optional tracker adapter | unset |\n \n ## Rules\n \n ### Hard Rules (All Agents)\n \n-1. **Single source of truth**: Linear is authoritative for task state. Never use custom IDs.\n-2. **Everything is an issue**: All work that results in action must have a Linear issue.\n+1. **Single source of truth**: Use the originating user request, GitHub issue, or configured tracker as authoritative task state.\n+2. **Task context required**: Work must have an explicit user request, GitHub issue, or configured tracker task.\n 3. **Branch for everything**: No direct commits to `main`. No exceptions. Even one-line fixes.\n 4. **Conventional commits**: All commits use `type(scope): description` format.\n 5. **Co-Authored-By required**: All agent commits must include Co-Authored-By trailer.\n-6. **Link commits to issues**: Include `fixes #PI-XXX` or `closes #PI-XXX` in commit messages.\n-7. **No orphan commits**: Every commit must trace to a Linear issue.\n+6. **Link commits when appropriate**: Include `fixes #<issue-number>` or `closes #<issue-number>` only for issue-backed work intended to auto-close.\n+7. **No orphan commits**: Every commit must trace to explicit task context.\n 8. **Kill after In Review**: Sub-agents are terminated after finalization. Never kept alive.\n 9. **No solo scoping**: Always check scope with Gautam before executing.\n 10. **Spec gates execution**: Nothing moves to In Progress without a plan/spec.\n@@ -266,8 +253,8 @@ Multiple agents may work simultaneously. **NEVER**:\n - **Tools**: read, subagent delegation only. NO write, edit, or bash.\n - **Never auto-execute**: Plans must be reviewed by Gautam before execution.\n - **iMessage = synchronous**: Always acknowledge immediately before starting work.\n-- **Linear = async**: Process Linear queue when capacity allows.\n-- **One topic at a time**: Focus on single issue before moving to next.\n+- **Trackers are async**: Process configured task queues when capacity allows.\n+- **One topic at a time**: Focus on a single task before moving to the next.\n \n ### Sub-Agent Constraints\n \n@@ -283,41 +270,32 @@ Multiple agents may work simultaneously. **NEVER**:\n 1. **First gate**: `reviewer` agent (fast, cheap, learns patterns)\n 2. **Second gate**: 4-agent PR review (Gemini, Codex, Claude, Copilot) on PRs to `main`\n 3. **Branch protection**: `main` requires all 4 approvals\n-4. **Parallel review**: Independent sub-issues reviewed in parallel, connected ones batched\n+4. **Parallel review**: Independent sub-tasks reviewed in parallel, connected ones batched\n \n ### Communication\n \n - **iMessage**: Synchronous, always respond immediately. Gautam's live line to Pi.\n-- **Linear comments**: Automated, technical, concise. No emojis.\n-- **Linear activities**: Real-time progress streaming via AgentActivity API.\n+- **Tracker comments**: Automated, technical, concise. No emojis.\n+- **Tracker activities**: Real-time progress streaming when supported by the configured adapter.\n - **Git notes**: Full session logs attached to commits for audit trail.\n \n ## Environment Variables\n \n-All environment variables used by the orchestration system:\n+Environment variables used by the orchestration system:\n \n ```bash\n-# Required - Linear API Access\n-export LINEAR_API_KEY=\"lin_api_...\"          # User API key (Pi board queries)\n-export LINEAR_APP_TOKEN=\"lin_app_...\"        # App token (AgentSession API)\n-\n-# Required - Linear Team Configuration\n-export LINEAR_TEAM_ID=\"e368d033-...\"         # Team UUID (defaults to pi-mono)\n-export LINEAR_STATE_IN_REVIEW=\"e85f987d-...\" # In Review state ID\n+# Optional - tracker API access\n+export TRACKER_API_KEY=\"...\"                 # User API key for configured tracker\n+export TRACKER_APP_TOKEN=\"...\"               # App token for configured tracker\n \n-# Optional - Wrapper Configuration\n+# Wrapper Configuration\n export MAX_LOG_SIZE=512000                   # Session log size limit (bytes)\n export REPO_ROOT=\"/path/to/repo\"             # Override repo root detection\n \n # Agent Runtime (set by wrapper, read by agents)\n-export AGENT_SESSION_ID=\"550e8400-...\"       # Linear AgentSession UUID\n-export AGENT_ISSUE_ID=\"PI-56\"                # Linear issue identifier\n-export AGENT_BRANCH=\"feat/pi-56-...\"         # Git branch name\n+export AGENT_SESSION_ID=\"550e8400-...\"       # Agent session UUID\n+export AGENT_TASK_ID=\"123\"                   # Optional; set only when task or issue ID exists\n+export AGENT_BRANCH=\"feat/descriptive-slug\"  # Git branch name\n ```\n \n-**How to obtain tokens**:\n-- `LINEAR_API_KEY`: Linear Settings → API → Personal API Keys\n-- `LINEAR_APP_TOKEN`: Linear Settings → Integrations → Create OAuth App → App Token\n-- Team/State IDs: Query Linear GraphQL API or inspect browser network requests\n-\n **Security**: Never commit tokens. Store in environment or secure secret management.\n\nFile: docs/adapters/linear.md (added, +32/-0)\n@@ -0,0 +1,32 @@\n+# Linear Adapter Reference\n+\n+Linear was the original tracker adapter for the orchestration system. It is not required for normal branch, commit, PR, or agent workflows. Use this file only when operating a configured Linear adapter.\n+\n+## Credentials\n+\n+Only configured Linear adapter runs need Linear credentials.\n+\n+- `LINEAR_API_KEY`: Personal API key for direct Linear API access.\n+- `LINEAR_APP_TOKEN`: OAuth app token for app-backed Linear integration.\n+\n+## State Machine\n+\n+When the Linear adapter is enabled, the original project states were:\n+\n+```\n+Backlog → Shaping → Planned → In Progress → Review → Done\n+```\n+\n+The original task states were:\n+\n+```\n+Backlog → Todo → Plan → In Progress → In Review → Done\n+         ↑                                ↓\n+         └────────── (blocked/dependency) ─┘\n+```\n+\n+## Rules\n+\n+- Nothing moves to `In Progress` without a spec in `Plan` state.\n+- Sub-agents own state up to `In Review`.\n+- Pi owns transition to `Done` and parent task state.\n```\n\n## Instructions\nFor each prior comment, determine if it was addressed. Provide your response as JSON:\n- \"summary\": markdown summary of what was fixed and what remains\n- \"comments\": array of { \"path\", \"line\", \"body\" } for any NEW issues found\n- \"verdict\": \"approve\" if all prior issues are resolved and no new blocking issues, otherwise \"request_changes\"\n- \"workflow_suggestions\": array of strings (optional process improvement suggestions)\n- \"prior_resolution\": array of { \"index\": number, \"resolved\": boolean, \"note\": string } for each prior comment\n\nReturn ONLY valid JSON, no markdown fences.\n\n-"
        }
      ]
    },
    {
      "role": "user",
      "parts": [
        {
          "text": "You are re-reviewing PR #30: \"docs(orchestration): remove Linear workflow requirement\" after the author pushed changes to address your prior review.\n\n## Your Prior Review Comments\n(no inline comments — only a summary was posted)\n\n## Prior Summary\n🤖 **Gemini Code Review**\n\nAll outstanding review threads have been successfully addressed. The no-emoji rule is now explicitly documented, Phase 3 validation accurately reflects the optional nature of `AGENT_TASK_ID` (handling cases without a tracker or GitHub issue), and the `curl` tool description has been updated to reflect its current use cases. The non-blocking suggestions and nitpicks have been integrated nicely. The PR is ready to merge.\n\n## Unresolved Threads\nWould approve code changes, but 8 unresolved review thread(s) remain:\n- **gautam-claude** on `docs/AGENTS.md:58`: [suggestion] This line (`When no tracker is configured, Pi operates from the cur...\n- **gautam-claude** on `docs/AGENTS.md:82`: [suggestion] The `AGENT_TASK_ID` is documented as optional here, but Phase 3 (li...\n- **gautam-claude** on `docs/AGENTS.md:222`: [nitpick] `curl` description is now \"HTTP checks and optional tracker adapter ca...\n- **gautam-claude** on `docs/AGENTS.md:179`: [suggestion] The agent comment templates dropped emojis (was `🔄`, `✅`, `❌`). Th...\n- **gautam-claude** on `docs/AGENTS.md:57`: [suggestion] This paragraph is doing a lot of work. Consider breaking \"Durable t...\n\n\n## Workflow Suggestions\n- 💡 Consider adding a lint rule or a simple bash script in CI (`grep -i 'linear' docs/AGENTS.md`) to ensure future documentation updates don't accidentally reintroduce hard-coded Linear concepts outside of the historical context sections.\n- 💡 Consider enabling auto-resolve for review threads in GitHub when the referenced lines are updated to avoid manual resolution steps for non-blocking nitpicks.\n\n\n## Current Diff (after changes)\n```diff\nFile: docs/AGENTS.md (modified, +78/-100)\n@@ -2,7 +2,7 @@\n \n ## Overview\n \n-This repo implements a multi-agent orchestration system built on pi-mono. Pi (the orchestrator) acts as CTO, communicating with Gautam via iMessage and delegating work to specialized sub-agents. Linear serves as the orchestration bus and single source of truth for task state. All work flows through Linear issues, with sub-agents executing tasks in isolated branches and submitting PRs for review. The system enforces strict lifecycle protocols, conventional commit standards, and comprehensive audit trails via git notes.\n+This repo implements a multi-agent orchestration system built on pi-mono. Pi (the orchestrator) acts as CTO, communicating with Gautam via iMessage and delegating work to specialized sub-agents. Work can originate from a direct user request, a GitHub issue, or an optional external tracker. Sub-agents execute tasks in isolated branches and submit PRs for review. The system enforces strict lifecycle protocols, conventional commit standards, and comprehensive audit trails via git notes.\n \n ## Architecture\n \n@@ -17,11 +17,11 @@ This repo implements a multi-agent orchestration system built on pi-mono. Pi (th\n │             │ Tools: read, subagent delegation\n └──────┬──────┘\n        │\n-       ├─────► Linear API (async orchestration bus)\n-       │       - Issue state management\n-       │       - AgentSession lifecycle\n+       ├─────► Optional task tracker integration\n+       │       - Task state management\n+       │       - Agent session lifecycle\n        │       - Activity streaming\n-       │       - Board state webhooks\n+       │       - Conditional state webhooks\n        │\n        └─────► Sub-Agents (spawned via scripts/agent-wrapper.sh)\n                │\n@@ -34,7 +34,7 @@ This repo implements a multi-agent orchestration system built on pi-mono. Pi (th\n                    │\n                    ▼\n                Git Operations\n-               - Branch per issue\n+               - Branch per task\n                - Conventional commits\n                - Co-Authored-By trailers\n                - Git notes for session logs\n@@ -47,9 +47,13 @@ This repo implements a multi-agent orchestration system built on pi-mono. Pi (th\n                - Branch protection on main\n ```\n \n-**Flow**: Gautam → iMessage → Pi → Linear Issue → Sub-Agent → Git Branch → PR → Review → Merge → Done\n+**Flow**: Gautam → iMessage → Pi → Task/User Request → Sub-Agent → Git Branch → PR → Review → Merge → Done\n \n-**Key Principle**: Linear is the single source of truth. Pi reads board state via webhooks, spawns agents assigned to Linear issues, agents report progress via AgentActivity API, and Pi never directly edits code.\n+**Key Principles**:\n+- Durable task state is required; Linear is not.\n+- Pi may source state from a configured tracker, GitHub issues and PRs, or direct user context.\n+- When no tracker is configured, Pi operates from the current user request plus GitHub issue and PR state.\n+- Agents report progress to the surface that originated the work, and Pi never directly edits code.\n \n ## Agent Roles\n \n@@ -58,7 +62,7 @@ This repo implements a multi-agent orchestration system built on pi-mono. Pi (th\n | `worker` | General-purpose implementation | `claude-sonnet-4-5` | read, write, edit, bash | Disposable (killed after In Review) |\n | `worker-full` | Full-capability implementation | `claude-sonnet-4-20250514` | read, write, edit, bash | Disposable |\n | `worker-readonly` | Read-only analysis/audit | `claude-sonnet-4-20250514` | read, grep, find, ls, bash | Disposable |\n-| `researcher` | Topic investigation | `claude-opus-4-6` | read, grep, find, ls, bash | Persistent (Linear app user) |\n+| `researcher` | Topic investigation | `claude-opus-4-6` | read, grep, find, ls, bash | Persistent |\n | `reviewer` | Code review specialist | `claude-sonnet-4-5` | read, bash | Persistent (learns patterns) |\n | `planner` | Spec/plan creation | `claude-sonnet-4-5` | read | Disposable |\n | `scout` | Fast recon/exploration | `claude-haiku-4-5` | read, bash (compressed context) | Disposable |\n@@ -72,11 +76,11 @@ This repo implements a multi-agent orchestration system built on pi-mono. Pi (th\n Sub-agents follow a strict 5-phase lifecycle enforced by `scripts/agent-wrapper.sh`:\n \n ### Phase 1: Setup\n-- Create Linear AgentSession on issue\n-- Generate branch name from issue title (conventional format)\n+- Create an agent session record when the active tracker supports it\n+- Generate branch name from the task title (conventional format)\n - **Sequential mode**: Create branch off `main`\n - **Parallel mode**: Create branch off task branch, add worktree\n-- Export environment variables (`AGENT_SESSION_ID`, `AGENT_ISSUE_ID`, `LINEAR_API_KEY`, `LINEAR_APP_TOKEN`)\n+- Export environment variables (`AGENT_SESSION_ID`, optional `AGENT_TASK_ID`, optional tracker credentials)\n \n ### Phase 2: Execution\n - Parse agent definition (`~/.pi/agent/agents/<name>.md`)\n@@ -90,30 +94,32 @@ Sub-agents follow a strict 5-phase lifecycle enforced by `scripts/agent-wrapper.\n - Verify new commits exist (`git rev-list --count`)\n - Validate conventional commit format (`type(scope): description`)\n - Verify Co-Authored-By trailer on all commits\n-- Post errors to Linear AgentActivity and issue comments on failure\n+- Post errors to the originating task surface on failure when one exists\n+- When there is no tracker task or GitHub issue, leave the failure in the session log and return it to Pi/user context\n \n ### Phase 4: Finalization\n - Attach session log as git note on last commit (truncated to 500KB or 10k lines)\n - Push branch to origin\n - Push git notes (`refs/notes/commits`)\n - Create PR (to `main` or task branch depending on mode)\n-- Post handoff activity to Linear session\n-- Move issue to `In Review` state\n-- Post completion comment to issue\n+- Post handoff activity to the originating task surface\n+- Move the task to review when the active tracker supports states\n+- Post completion comment to the originating issue or PR when available\n \n ### Phase 5: Teardown\n - Clean up temp files (`/tmp/agent-system-prompt-*`, `/tmp/agent-session-*.log`)\n - **Sequential mode**: No teardown needed\n - **Parallel mode**: Remove worktree, leave branches for orchestrator\n \n-**Critical**: Agents are killed after Phase 4. Session state persists in git notes and Linear. New agent spawns reconstruct context from external state.\n+**Critical**: Agents are killed after Phase 4. Session state persists in git notes and the originating task surface. New agent spawns reconstruct context from external state.\n \n ## Git Model\n \n ### Branch Naming (conventional-branch.github.io)\n-- **Sequential**: `feat/PI-XXX-description` (branch off `main`)\n-- **Parallel**: `feat/PI-XXX/agent-<role>` (branch off task branch `feat/PI-XXX-description`)\n-- Examples: `feat/pi-56-completion-protocol`, `feat/pi-65/agent-worker`, `fix/pi-72-linear-cleanup`\n+- **Sequential**: `feat/descriptive-slug` or `fix/descriptive-slug` (branch off `main`)\n+- **Parallel**: `feat/descriptive-slug/agent-<role>` (branch off task branch `feat/descriptive-slug`)\n+- **Issue-backed optional**: include the issue key when one exists, e.g. `feat/gh-123-completion-protocol`\n+- Examples: `feat/completion-protocol`, `feat/review-gate/agent-worker`, `fix/task-context-cleanup`\n \n ### Commit Conventions\n Format: `type(scope): description`\n@@ -126,122 +132,103 @@ Example:\n ```\n feat(orchestration): add completion protocol\n \n-Implements Linear AgentSession lifecycle with 5-phase wrapper.\n+Implements agent session lifecycle with 5-phase wrapper.\n \n Co-Authored-By: agent/worker-full 550e8400-e29b-41d4-a716-446655440000@noreply\n ```\n \n ### PR Workflow\n \n **Sequential (single agent)**:\n-1. Agent works on `feat/PI-XXX-description` off `main`\n-2. Wrapper creates PR: `feat/PI-XXX-description` → `main`\n+1. Agent works on `feat/descriptive-slug` off `main`\n+2. Wrapper creates PR: `feat/descriptive-slug` → `main`\n 3. Review gates: reviewer agent → 4-agent PR review\n 4. Merge to `main` on approval\n \n **Parallel (multiple agents)**:\n-1. Pi creates task branch `feat/PI-XXX-description` off `main`\n-2. Each agent works on `feat/PI-XXX/agent-<role>` in isolated worktree\n-3. Wrapper creates PR: `feat/PI-XXX/agent-<role>` → `feat/PI-XXX-description`\n+1. Pi creates task branch `feat/descriptive-slug` off `main`\n+2. Each agent works on `feat/descriptive-slug/agent-<role>` in isolated worktree\n+3. Wrapper creates PR: `feat/descriptive-slug/agent-<role>` → `feat/descriptive-slug`\n 4. Pi merges agent branches into task branch after review\n-5. Pi creates final PR: `feat/PI-XXX-description` → `main`\n+5. Pi creates final PR: `feat/descriptive-slug` → `main`\n 6. Review gates apply to final PR\n \n-**Always**: Every commit links to Linear issue via `fixes #PI-XXX` in commit message.\n+**Issue-backed work**: Use `fixes #<issue-number>` or `closes #<issue-number>` in commit messages only when the issue is meant to auto-close on merge. Direct user-requested work does not require an issue link.\n \n-## Linear Integration\n+## Optional Task Tracker Integration\n \n-### State Machine\n+Tracker integration is optional. Linear was the original adapter, but it is no longer required for normal branch, commit, PR, or agent workflows.\n+When a tracker adapter is enabled, use that tracker's states. Historical Linear-specific states are adapter reference material in `docs/adapters/linear.md`, not default workflow requirements.\n \n-**Project States**:\n-```\n-Backlog → Shaping → Planned → In Progress → Review → Done\n-```\n-\n-**Issue States**:\n-```\n-Backlog → Todo → Plan → In Progress → In Review → Done\n-         ↑                                ↓\n-         └────────── (blocked/dependency) ─┘\n-```\n-\n-**Rules**:\n-- Nothing moves to `In Progress` without a spec in `Plan` state\n-- Sub-agents own state up to `In Review`\n-- Pi owns transition to `Done` and parent issue state\n+### Agent Session Lifecycle\n \n-### AgentSession Lifecycle\n-\n-1. **Creation**: Wrapper calls `agentSessionCreateOnIssue` mutation on issue\n-2. **Streaming**: Agent posts progress via `agentActivityCreate` with types:\n+1. **Creation**: Wrapper creates an agent session on the active task when supported\n+2. **Streaming**: Agent posts progress to the originating surface with types:\n    - `response`: Status updates, handoff messages\n    - `error`: Failures, validation errors\n 3. **Completion**: Final activity posted with PR link, commit stats\n-4. **Persistence**: Session ID stored in git notes, Linear retains full history\n+4. **Persistence**: Session ID stored in git notes; the originating tracker or PR retains the user-facing history\n \n-### Linear as Orchestration Bus\n+### Tracker as Orchestration Bus\n \n-- **Pi**: Receives webhooks for board state changes (issue created, status updated, assigned)\n-- **Pi cache**: In-memory board state (issue ID, status, assignee, delegate, due date)\n-- **Sub-agents**: Never read board state, only interact via their assigned issue session\n-- **API tokens**: `LINEAR_API_KEY` for Pi queries, `LINEAR_APP_TOKEN` for agent sessions\n+- **No tracker configured**: Pi uses current user context plus GitHub issue and PR state; no board-state webhooks or tracker cache are required\n+- **Pi**: Receives webhooks for board state changes only when a tracker is configured\n+- **Pi cache**: Optional in-memory board state (task ID, status, assignee, delegate, due date)\n+- **Sub-agents**: Never read board state, only interact via their assigned task/session\n+- **API tokens**: Required only by the configured tracker adapter\n \n ### Comments\n \n-- **Agent start**: \"🔄 Agent `<name>` started on issue PI-XXX (session: `<id>`)\"\n-- **Agent complete**: \"✅ Agent `<name>` completed successfully. Pull request: `<url>`\"\n-- **Agent error**: \"❌ Agent `<name>` failed with exit code `<code>`. See session `<id>` for details.\"\n+Comment templates are plain text to comply with the repo's no-emoji communication rule.\n+\n+- **Agent start**: \"Agent `<name>` started on task `<id>` (session: `<id>`)\"\n+- **Agent complete**: \"Agent `<name>` completed successfully. Pull request: `<url>`\"\n+- **Agent error**: \"Agent `<name>` failed with exit code `<code>`. See session `<id>` for details.\"\n \n ## Naming Conventions\n \n | Entity | Format | Example |\n |--------|--------|---------|\n-| Sequential branch | `type/PI-XXX-slug` | `feat/pi-56-completion-protocol` |\n-| Parallel task branch | `type/PI-XXX-slug` | `feat/pi-65-review-gate` |\n-| Parallel agent branch | `type/PI-XXX/agent-role` | `feat/pi-65/agent-reviewer` |\n+| Sequential branch | `type/slug` | `feat/completion-protocol` |\n+| Parallel task branch | `type/slug` | `feat/review-gate` |\n+| Parallel agent branch | `type/slug/agent-role` | `feat/review-gate/agent-reviewer` |\n | Commit message | `type(scope): description` | `feat(orchestration): add wrapper` |\n | Co-Authored-By | `agent/<role> <uuid@noreply>` | `agent/worker-full 550e8400@noreply` |\n-| Issue identifier | `PI-XXX` | `PI-56` |\n+| Task identifier | Optional tracker or GitHub issue ID | `123` |\n | Agent session ID | UUID v4 | `550e8400-e29b-41d4-a716-446655440000` |\n | Session log file | `/tmp/agent-session-<uuid>.log` | `/tmp/agent-session-550e8400.log` |\n | System prompt file | `/tmp/agent-system-prompt-<uuid>.txt` | `/tmp/agent-system-prompt-550e8400.txt` |\n \n ## Dependencies\n \n ### Required Tools\n-- `gh` (GitHub CLI) - PR creation, issue management\n-- `jq` - JSON parsing for Linear API responses\n-- `curl` - Linear API calls\n+- `gh` (GitHub CLI) - PR creation and GitHub issue management\n - `tsx` - TypeScript execution for Pi CLI\n - `git` - Version control (with `git notes` support)\n - `node` (v18+) - Node.js runtime\n - `npm` - Package manager\n-\n-### Required Environment Variables\n-| Variable | Description | Used By |\n-|----------|-------------|---------|\n-| `LINEAR_API_KEY` | User API key for Pi board queries | Pi, wrapper setup |\n-| `LINEAR_APP_TOKEN` | App token for AgentSession API | Wrapper, sub-agents |\n-| `LINEAR_TEAM_ID` | Linear team UUID | Wrapper (defaults to pi-mono team) |\n-| `LINEAR_STATE_IN_REVIEW` | State ID for In Review | Wrapper (defaults to pi-mono state) |\n+- `jq` - JSON parsing in wrapper and GitHub/tracker flows\n+- `curl` - HTTP requests in wrapper scripts, local probes, and optional tracker adapter calls\n \n ### Optional Environment Variables\n | Variable | Description | Default |\n |----------|-------------|---------|\n | `REPO_ROOT` | Repository root path | Detected from script location |\n | `MAX_LOG_SIZE` | Max session log size (bytes) | 512000 (500KB) |\n+| `TRACKER_API_KEY` | API key for an optional tracker adapter | unset |\n+| `TRACKER_APP_TOKEN` | App token for an optional tracker adapter | unset |\n \n ## Rules\n \n ### Hard Rules (All Agents)\n \n-1. **Single source of truth**: Linear is authoritative for task state. Never use custom IDs.\n-2. **Everything is an issue**: All work that results in action must have a Linear issue.\n+1. **Single source of truth**: Use the originating user request, GitHub issue, or configured tracker as authoritative task state.\n+2. **Task context required**: Work must have an explicit user request, GitHub issue, or configured tracker task.\n 3. **Branch for everything**: No direct commits to `main`. No exceptions. Even one-line fixes.\n 4. **Conventional commits**: All commits use `type(scope): description` format.\n 5. **Co-Authored-By required**: All agent commits must include Co-Authored-By trailer.\n-6. **Link commits to issues**: Include `fixes #PI-XXX` or `closes #PI-XXX` in commit messages.\n-7. **No orphan commits**: Every commit must trace to a Linear issue.\n+6. **Link commits when appropriate**: Include `fixes #<issue-number>` or `closes #<issue-number>` only for issue-backed work intended to auto-close.\n+7. **No orphan commits**: Every commit must trace to explicit task context.\n 8. **Kill after In Review**: Sub-agents are terminated after finalization. Never kept alive.\n 9. **No solo scoping**: Always check scope with Gautam before executing.\n 10. **Spec gates execution**: Nothing moves to In Progress without a plan/spec.\n@@ -266,8 +253,8 @@ Multiple agents may work simultaneously. **NEVER**:\n - **Tools**: read, subagent delegation only. NO write, edit, or bash.\n - **Never auto-execute**: Plans must be reviewed by Gautam before execution.\n - **iMessage = synchronous**: Always acknowledge immediately before starting work.\n-- **Linear = async**: Process Linear queue when capacity allows.\n-- **One topic at a time**: Focus on single issue before moving to next.\n+- **Trackers are async**: Process configured task queues when capacity allows.\n+- **One topic at a time**: Focus on a single task before moving to the next.\n \n ### Sub-Agent Constraints\n \n@@ -283,41 +270,32 @@ Multiple agents may work simultaneously. **NEVER**:\n 1. **First gate**: `reviewer` agent (fast, cheap, learns patterns)\n 2. **Second gate**: 4-agent PR review (Gemini, Codex, Claude, Copilot) on PRs to `main`\n 3. **Branch protection**: `main` requires all 4 approvals\n-4. **Parallel review**: Independent sub-issues reviewed in parallel, connected ones batched\n+4. **Parallel review**: Independent sub-tasks reviewed in parallel, connected ones batched\n \n ### Communication\n \n - **iMessage**: Synchronous, always respond immediately. Gautam's live line to Pi.\n-- **Linear comments**: Automated, technical, concise. No emojis.\n-- **Linear activities**: Real-time progress streaming via AgentActivity API.\n+- **Tracker comments**: Automated, technical, concise. No emojis.\n+- **Tracker activities**: Real-time progress streaming when supported by the configured adapter.\n - **Git notes**: Full session logs attached to commits for audit trail.\n \n ## Environment Variables\n \n-All environment variables used by the orchestration system:\n+Environment variables used by the orchestration system:\n \n ```bash\n-# Required - Linear API Access\n-export LINEAR_API_KEY=\"lin_api_...\"          # User API key (Pi board queries)\n-export LINEAR_APP_TOKEN=\"lin_app_...\"        # App token (AgentSession API)\n-\n-# Required - Linear Team Configuration\n-export LINEAR_TEAM_ID=\"e368d033-...\"         # Team UUID (defaults to pi-mono)\n-export LINEAR_STATE_IN_REVIEW=\"e85f987d-...\" # In Review state ID\n+# Optional - tracker API access\n+export TRACKER_API_KEY=\"...\"                 # User API key for configured tracker\n+export TRACKER_APP_TOKEN=\"...\"               # App token for configured tracker\n \n-# Optional - Wrapper Configuration\n+# Wrapper Configuration\n export MAX_LOG_SIZE=512000                   # Session log size limit (bytes)\n export REPO_ROOT=\"/path/to/repo\"             # Override repo root detection\n \n # Agent Runtime (set by wrapper, read by agents)\n-export AGENT_SESSION_ID=\"550e8400-...\"       # Linear AgentSession UUID\n-export AGENT_ISSUE_ID=\"PI-56\"                # Linear issue identifier\n-export AGENT_BRANCH=\"feat/pi-56-...\"         # Git branch name\n+export AGENT_SESSION_ID=\"550e8400-...\"       # Agent session UUID\n+export AGENT_TASK_ID=\"123\"                   # Optional; set only when task or issue ID exists\n+export AGENT_BRANCH=\"feat/descriptive-slug\"  # Git branch name\n ```\n \n-**How to obtain tokens**:\n-- `LINEAR_API_KEY`: Linear Settings → API → Personal API Keys\n-- `LINEAR_APP_TOKEN`: Linear Settings → Integrations → Create OAuth App → App Token\n-- Team/State IDs: Query Linear GraphQL API or inspect browser network requests\n-\n **Security**: Never commit tokens. Store in environment or secure secret management.\n\nFile: docs/adapters/linear.md (added, +32/-0)\n@@ -0,0 +1,32 @@\n+# Linear Adapter Reference\n+\n+Linear was the original tracker adapter for the orchestration system. It is not required for normal branch, commit, PR, or agent workflows. Use this file only when operating a configured Linear adapter.\n+\n+## Credentials\n+\n+Only configured Linear adapter runs need Linear credentials.\n+\n+- `LINEAR_API_KEY`: Personal API key for direct Linear API access.\n+- `LINEAR_APP_TOKEN`: OAuth app token for app-backed Linear integration.\n+\n+## State Machine\n+\n+When the Linear adapter is enabled, the original project states were:\n+\n+```\n+Backlog → Shaping → Planned → In Progress → Review → Done\n+```\n+\n+The original task states were:\n+\n+```\n+Backlog → Todo → Plan → In Progress → In Review → Done\n+         ↑                                ↓\n+         └────────── (blocked/dependency) ─┘\n+```\n+\n+## Rules\n+\n+- Nothing moves to `In Progress` without a spec in `Plan` state.\n+- Sub-agents own state up to `In Review`.\n+- Pi owns transition to `Done` and parent task state.\n```\n\n## Instructions\nFor each prior comment, determine if it was addressed. Provide your response as JSON:\n- \"summary\": markdown summary of what was fixed and what remains\n- \"comments\": array of { \"path\", \"line\", \"body\" } for any NEW issues found\n- \"verdict\": \"approve\" if all prior issues are resolved and no new blocking issues, otherwise \"request_changes\"\n- \"workflow_suggestions\": array of strings (optional process improvement suggestions)\n- \"prior_resolution\": array of { \"index\": number, \"resolved\": boolean, \"note\": string } for each prior comment\n\nReturn ONLY valid JSON, no markdown fences.\n\n-"
        }
      ]
    }
  ]
}