Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
address review (codex): drop the unworkable JIRA epic split, harden the marker's claims
[._.]/ Adam Eivyb77c6ffa3925
diff --git a/server/services/cosTaskPrompts.js b/server/services/cosTaskPrompts.jsindex a0b319e62a..cba8288cee 100644--- a/server/services/cosTaskPrompts.js+++ b/server/services/cosTaskPrompts.js@@ -34,7 +34,7 @@ PLAN.md item \`[${ref}]\` is reserved for this run. You MUST work on that exact'claim-issue-gitlab': forgeIssueConstraint('GitLab'),'claim-issue-jira': (ref) => `## Target Ticket Constraint-The user explicitly selected JIRA ticket \`${ref}\` from the board. Override Phase 1 ("Pick the target ticket"): do NOT pick a different ticket and do NOT scan for the next-ready one — claim exactly \`${ref}\`. Still honor the safety checks: if \`${ref}\` is already In Progress / In Review / Done / closed, is already on a \`claim/${ref}\` (or \`cos/.../${ref}/...\`) branch, or its requirements are too vague to slice against the code at all, exit cleanly (file a Review Hub todo for that last case) rather than forcing it. **Being an Epic — or simply too large for one PR — is NOT an exit**: run Phase 1b against \`${ref}\` instead, claiming the next eligible ticket already linked to it, or decomposing it into per-slice child tickets first and then claiming the first slice. That is the one case where this run legitimately ships a ticket other than \`${ref}\`. Otherwise run Phases 2–7 against \`${ref}\`.`+The user explicitly selected JIRA ticket \`${ref}\` from the board. Override Phase 1 ("Pick the target ticket"): do NOT pick a different ticket and do NOT scan for the next-ready one — claim exactly \`${ref}\`. Still honor the safety checks: if \`${ref}\` is already In Progress / In Review / Done / closed, is already on a \`claim/${ref}\` (or \`cos/.../${ref}/...\`) branch, or its requirements are too ambiguous or too large to implement in a single PR, exit cleanly (file a Review Hub todo for ambiguous requirements) rather than forcing it. An Epic also exits here: the JIRA flow has no decomposition path (the reads PortOS exposes carry neither labels nor epic links), unlike the GitHub/GitLab constraints above. Otherwise run Phases 2–7 against \`${ref}\`.`};export function buildTargetWorkItemBlock(promptTaskType, ref, excludeLabelsBlock = '') {diff --git a/server/services/taskPromptDefaults.test.js b/server/services/taskPromptDefaults.test.jsindex c17008eb80..04569628da 100644--- a/server/services/taskPromptDefaults.test.js+++ b/server/services/taskPromptDefaults.test.js@@ -644,8 +644,12 @@ describe('taskPromptDefaults integrity snapshot', () => {// signal perpetualWork.js#isActionableIssue reads, so the live agent and the// drain agree on when an epic stops being claimable.it('claim flows decompose an undecomposed epic instead of skipping it, preserving the outgoing defaults', () => {- const keys = ['claim-issue', 'claim-issue-gitlab', 'claim-issue-jira'];- const floors = { 'claim-issue': 21, 'claim-issue-gitlab': 19, 'claim-issue-jira': 14 };+ // JIRA is deliberately NOT in this list: its reads expose neither labels nor+ // epic links (jira.js#getIssue / #fetchMyCurrentSprintTickets), so a decomposition+ // marker is invisible there and an epic's children unfindable — that flow still+ // leaves an epic for a human, and says so. Tracked in #5042.+ const keys = ['claim-issue', 'claim-issue-gitlab'];+ const floors = { 'claim-issue': 21, 'claim-issue-gitlab': 19 };for (const key of keys) {const current = DEFAULT_TASK_PROMPTS[key];@@ -669,7 +673,9 @@ describe('taskPromptDefaults integrity snapshot', () => {// checklist a later claim follows to the next available child.expect(DEFAULT_TASK_PROMPTS['claim-issue']).toContain('Part of #${EPIC}');expect(DEFAULT_TASK_PROMPTS['claim-issue']).toContain('## Decomposed into');- expect(DEFAULT_TASK_PROMPTS['claim-issue-jira']).toContain('"epicKey": "<EPIC>"');+ // The JIRA flow keeps its human-split behavior, and names the API gap that forces it.+ expect(DEFAULT_TASK_PROMPTS['claim-issue-jira']).not.toContain('Phase 1b');+ expect(DEFAULT_TASK_PROMPTS['claim-issue-jira']).toContain('Leave epics for a human to split');});// #4685: `glab issue list -F json` is accepted, IGNORED, and answers with thediff --git a/server/services/taskPromptDefaults/integrity.snapshot.json b/server/services/taskPromptDefaults/integrity.snapshot.jsonindex 34a5b66c7a..081a6bb3ed 100644--- a/server/services/taskPromptDefaults/integrity.snapshot.json+++ b/server/services/taskPromptDefaults/integrity.snapshot.json@@ -16,9 +16,9 @@"feature-ideas": "d3282f16da29efe2d53595b3b34778bc","plan-feature": "b20980c8eda2256060d09d4bca397244","plan-task": "b85fe92999aa4ee4a8910320457c4242",- "claim-issue": "e54b568d0db816457ad00c9aba330d49",- "claim-issue-gitlab": "37a6aea663c4b52b6d33368467bec60d",- "claim-issue-jira": "c7548b7ae22fec055d64ec6a2ebbd32d",+ "claim-issue": "041598f468843d08c0cd0f8b9449f652",+ "claim-issue-gitlab": "e521b88f0c1e92b7c7b2750cecc3501a",+ "claim-issue-jira": "d5e2b6cf39c2acfebef9ee8e826a7e42","code-reviewer-review": "27ded42013f28e7d327d8f1cc624aac1","code-reviewer-implement": "2e10cac7c1e1cd021d06bfddb5c1eaf2","error-handling": "9afba2e99b90a8d5771c75e7f0615d96",diff --git a/server/services/taskPromptDefaults/prompts.js b/server/services/taskPromptDefaults/prompts.jsindex 660b8583c0..f3a3232fd3 100644--- a/server/services/taskPromptDefaults/prompts.js+++ b/server/services/taskPromptDefaults/prompts.js@@ -911,9 +911,9 @@ Capture the epic's number as \`EPIC\`. This phase writes ONLY to the issue track3. **If children already exist, do NOT file more.**- **Some child still OPEN** → the epic is already decomposed. Make sure it carries the \`${EPIC_DECOMPOSED_LABEL}\` label and that its body checklist lists every child (step 6), then set \`NUM\` to the FIRST open child that passes Phase 1 step 4's eligibility rules (oldest-first) and continue at **Phase 2** with that child. If every open child is in flight, assigned elsewhere, or blocked, exit cleanly — that queue is busy, not empty.- **Every child CLOSED** → the epic's work is done. Post a comment naming the children that delivered it, close it (\`gh issue close "\${EPIC}" --reason completed\`), and return to Phase 1 to look for other work.- - **Labeled \`${EPIC_DECOMPOSED_LABEL}\` but NO children exist** → an earlier split claimed the epic and died before filing anything. Treat it as undecomposed and continue at step 4; the marker is already in place, so nothing needs re-claiming.+ - **Labeled \`${EPIC_DECOMPOSED_LABEL}\` but NO children exist** → an earlier split claimed the epic and died before filing anything. Treat it as undecomposed and continue at step 4; the marker is already in place, so nothing needs re-claiming. (Auto-pick can't reach this state — the marker is exactly what makes Phase 1 skip the epic — so it is recovered only when a human or the work-item picker aims a claim straight at that epic. That is the deliberate trade: a stalled split waits for a human, rather than every marker-write failure re-splitting the same epic on every drain tick.)4. **Otherwise, plan the split.** Read the code the epic actually names before slicing — a split that never met the repo is worthless. Produce 2–8 slices, each of them independently shippable in ONE PR, valuable on its own, and written with concrete scope + acceptance criteria + the files/areas involved. Slice by user-visible behavior or subsystem; never one-issue-per-file, and never invent scope the epic doesn't ask for. Decide the boundaries yourself — an ambiguous epic is decided, not deferred (same rule as Phase 3). Only an epic so vague that no split survives contact with the code is a \`needs-input\` case: comment what is missing, \`gh issue edit "\${EPIC}" --add-label needs-input\`, and exit.-5. **Claim the epic, THEN file the slices.** Stamp the marker before the first \`gh issue create\` — the label IS this phase's claim (Phase 1 skips a \`${EPIC_DECOMPOSED_LABEL}\` epic), so two concurrent runs can't both file a full slice set, and a run that dies mid-split can't be re-split from scratch on the next tick. Marking last would instead leave the epic actionable forever whenever that final edit failed:+5. **Claim the epic, THEN file the slices.** Stamp the marker before the first \`gh issue create\` — the label IS this phase's claim (Phase 1 skips a \`${EPIC_DECOMPOSED_LABEL}\` epic). Like every other marker in this flow it **narrows** the window for two concurrent runs to collide — it does NOT eliminate it, since a label edit is an idempotent write, not a compare-and-set — so re-run step 2's child query immediately before the first create and abandon the split if children now exist. Marking last instead of first would leave the epic actionable forever whenever that final edit failed, and let a crashed run be re-split from scratch on the next tick:\`\`\`bash${EPIC_LABEL_CREATE_GH}gh issue edit "\${EPIC}" --add-label ${EPIC_DECOMPOSED_LABEL}@@ -929,7 +929,7 @@ Capture the epic's number as \`EPIC\`. This phase writes ONLY to the issue trackPart of #\${EPIC}"\`\`\`- Use \`Part of #\${EPIC}\` — NEVER \`Closes #\${EPIC}\`, which would close the whole epic on the first slice that merges. Carry over the epic's \`area:*\` labels, and add dispatch hints (\`model:light|medium|heavy\`, \`effort:low|medium|high|xhigh|max\`) or contributor labels (\`good first issue\`, \`help wanted\`) only where that slice genuinely justifies them; create a missing label immediately before applying it.+ Use \`Part of #\${EPIC}\` — NEVER \`Closes #\${EPIC}\`, which would close the whole epic on the first slice that merges. **Give every slice body the epic-closure instruction too** — a line telling the agent that ships it to check its box in #\${EPIC} and, when it was the LAST open child, close #\${EPIC} with a summarizing comment. That is what closes the epic: once it carries the marker, Phase 1 and the work detector both skip it, so no later claim run will revisit the parent on its own. Carry over the epic's \`area:*\` labels, and add dispatch hints (\`model:light|medium|heavy\`, \`effort:low|medium|high|xhigh|max\`) or contributor labels (\`good first issue\`, \`help wanted\`) only where that slice genuinely justifies them; create a missing label immediately before applying it.6. **Write the checklist back to the epic** so the next run can follow it — keep the original body and append a \`## Decomposed into\` list naming every child:\`\`\`bashEPIC_BODY=$(mktemp)@@ -1097,9 +1097,9 @@ Same contract as the GitHub flow: an undecomposed epic is work, not a dead end.2. **Find the children it already has** — never re-split an epic somebody already split. Union the \`#<num>\` refs in its own description checklist with \`glab issue list --all --search "Part of #\${EPIC}" --output json --per-page 100\`.3. **If children already exist, do NOT file more.** Some child still OPEN → make sure the epic carries the \`decomposed\` label and a complete checklist (step 6), set \`NUM\` to the FIRST open child passing Phase 1 step 4's rules (oldest-first), and continue at **Phase 2** with that child; if every open child is in flight/assigned/blocked, exit cleanly. Every child CLOSED → comment naming what delivered it, \`glab issue close "\${EPIC}"\`, and return to Phase 1.4. **Otherwise, plan the split** against the actual code the epic names: 2–8 slices, each independently shippable in ONE MR, valuable on its own, each with concrete scope + acceptance criteria + the files/areas involved. Slice by user-visible behavior, never one-issue-per-file, never invent scope. Decide the boundaries yourself; only an epic too vague to slice against the code is a \`needs-input\` case (comment why, \`glab issue update "\${EPIC}" --label needs-input\`, exit).-5. **Claim the epic, THEN file the slices.** Stamp the marker before the first create — the label IS this phase's claim, so two concurrent runs can't both file a full slice set and a run that dies mid-split can't be re-split from scratch: \`${EPIC_LABEL_CREATE_GLAB}\`, then \`glab issue update "\${EPIC}" --label ${EPIC_DECOMPOSED_LABEL}\`, then post a comment saying a split is under way. Create the \`plan\` queue label the same way if the project lacks it, or every create below fails. Then file each slice in the order you want them worked: \`glab issue create --title "<specific>" --label plan --description "<what + why + acceptance criteria + files/areas>+5. **Claim the epic, THEN file the slices.** Stamp the marker before the first create — the label IS this phase's claim. Like every other marker in this flow it **narrows** the concurrent-collision window rather than closing it (a label write is idempotent, not a compare-and-set), so re-run step 2's child query immediately before the first create and abandon the split if children now exist. Marking last would instead leave the epic actionable forever whenever that final write failed: \`${EPIC_LABEL_CREATE_GLAB}\`, then \`glab issue update "\${EPIC}" --label ${EPIC_DECOMPOSED_LABEL}\`, then post a comment saying a split is under way. Create the \`plan\` queue label the same way if the project lacks it, or every create below fails. Then file each slice in the order you want them worked: \`glab issue create --title "<specific>" --label plan --description "<what + why + acceptance criteria + files/areas>-Part of #\${EPIC}"\`. Use \`Part of #\${EPIC}\`, NEVER \`Closes #\${EPIC}\`. Carry over the epic's \`area:*\` labels; add \`model:*\`/\`effort:*\` or contributor labels only where justified.+Part of #\${EPIC}"\`. Use \`Part of #\${EPIC}\`, NEVER \`Closes #\${EPIC}\`. Give every slice the epic-closure instruction too — check its box in #\${EPIC}, and close #\${EPIC} when it was the LAST open child; once the parent carries the marker, nothing else will revisit it. Carry over the epic's \`area:*\` labels; add \`model:*\`/\`effort:*\` or contributor labels only where justified.6. **Write the checklist back to the epic**: keep its description and append a \`## Decomposed into\` checklist (\`- [ ] #<num> — <title>\`) via \`glab issue update "\${EPIC}" --description "<full text>"\`. Leave the epic OPEN, unassigned, and without \`in-progress\` — it closes when its last child closes. The step-5 marker is what stops the next run from re-splitting it; the checklist is what lets a claim aimed at the epic resolve the next available child. An epic already labeled \`${EPIC_DECOMPOSED_LABEL}\` with NO children is a split that died before filing — treat it as undecomposed and resume at step 4.7. **Then claim the first slice you filed** — set \`NUM\` to it and continue at **Phase 2**. If another run won the race, exit cleanly: the decomposition itself is a successful round.@@ -1241,23 +1241,11 @@ Run steps 1–5 in order.- Its status is a not-started status (e.g. "To Do", "Open", "Backlog", "Selected for Development", "Ready"). Skip tickets already "In Progress", "In Review", "Done", or any closed/resolved status — those are claimed or finished.- Its KEY is NOT in the in-flight set from step 3.- It has enough of a summary/description to act on. A ticket that merely leaves a design choice unstated is still eligible — you'll decide the reading in Phase 3, not skip it here. Skip only a ticket with essentially no actionable content (bare title, no description or acceptance criteria).- - It is NOT an ALREADY-DECOMPOSED Epic (issue type "Epic", or a title ending in "(epic)"; decomposed once it carries the \`decomposed\` label). Skip a decomposed epic — its child tickets are ordinary claimable work. An epic that is NOT yet decomposed IS eligible, but only as a **last resort**: prefer every non-epic ticket first, and an epic you pick goes to **Phase 1b**, not Phase 2.-5. **If no eligible ticket exists**, exit cleanly — an empty actionable queue is a healthy state, not a failure. **But an open, undecomposed Epic is NOT an empty queue** — go to Phase 1b rather than reporting "no work available". If a ticket is in the sprint but too vague or blocked to start, create a Review Hub todo (POST ${PORTOS_API_URL}/api/review/todo with title "[<KEY>] Needs clarification" or "[<KEY>] Blocked" and a description of what's missing) instead of claiming it.+ - It is NOT an Epic (issue type "Epic", or a title ending in "(epic)"). Leave epics for a human to split. Unlike the GitHub/GitLab claim flows, this one cannot decompose one: the JIRA reads PortOS exposes return neither a ticket's labels nor its epic links, so an agent here can see no decomposition marker and cannot find an epic's existing children.+5. **If no eligible ticket exists**, exit cleanly — an empty actionable queue is a healthy state, not a failure. If a ticket is in the sprint but too vague or blocked to start, create a Review Hub todo (POST ${PORTOS_API_URL}/api/review/todo with title "[<KEY>] Needs clarification" or "[<KEY>] Blocked" and a description of what's missing) instead of claiming it.Capture the ticket KEY as \`KEY\`, its summary, and its full description — you'll reuse them in the branch, the MR/PR, and the commit trailer.-## Phase 1b — Decompose an Epic (only when Phase 1 landed on one)--Same contract as the GitHub/GitLab flows: an undecomposed epic is work, not a dead end. Capture its key as \`EPIC\`. This phase writes ONLY to JIRA — no worktree, no branch, no MR/PR.--1. Read it: GET ${PORTOS_API_URL}/api/jira/instances/<instanceId>/issues/<EPIC>.-2. **Find the children it already has** — never re-split an epic somebody already split. Re-read the sprint list from Phase 1 step 2 for tickets whose epic link is \`EPIC\`, and union that with every \`<PROJ-nnn>\` key its description checklist names.-3. **If children already exist, do NOT file more.** Any child still in a not-started status → set \`KEY\` to the first that passes Phase 1 step 4's rules and continue at **Phase 2** with it (first ensure the epic carries the \`decomposed\` label and a complete checklist, per step 6). Every child Done/closed → comment naming what delivered it, transition the epic to **Done**, and return to Phase 1.-4. **Otherwise, plan the split** against the actual code the epic names: 2–8 slices, each independently shippable in ONE MR/PR, valuable on its own, each with concrete scope + acceptance criteria + the files/areas involved. Slice by user-visible behavior, never one-ticket-per-file, never invent scope. Decide the boundaries yourself; only an epic too vague to slice against the code becomes a Review Hub todo (POST ${PORTOS_API_URL}/api/review/todo with title "[<EPIC>] Needs clarification") — then exit.-5. **Claim the Epic, THEN file the slices.** First PUT the parent's \`labels\` with \`${EPIC_DECOMPOSED_LABEL}\` added (step 6's shape) and POST a comment saying a split is under way — that marker IS this phase's claim, so two concurrent runs can't both file a full slice set and a run that dies mid-split can't be re-split from scratch. Then file each slice in the order you want it worked: POST ${PORTOS_API_URL}/api/jira/instances/<instanceId>/tickets with body {"projectKey": "<projectKey>", "summary": "<specific>", "description": "<what + why + acceptance criteria + files/areas>\\n\\nPart of <EPIC>", "issueType": "Task", "epicKey": "<EPIC>", "labels": ["plan"]}. The \`epicKey\` link is what keeps the slice attached to its parent on the board. Add independently justified labels (\`model-light\`/\`model-medium\`/\`model-heavy\`, \`effort-low\`…\`effort-max\`, \`good-first-issue\`, \`help-wanted\`) only where the slice warrants them.-6. **Write the checklist back to the Epic so the next run can follow it.** PUT ${PORTOS_API_URL}/api/jira/instances/<instanceId>/tickets/<EPIC> with a \`description\` that keeps the original text and appends a "Decomposed into" checklist naming every child key, and a \`labels\` array containing the ticket's EXISTING labels plus \`${EPIC_DECOMPOSED_LABEL}\` (send the full list — the update replaces it). Leave the Epic OPEN in its current status — it moves to Done when its last child is done. The step-5 marker is what stops the next run from re-splitting it; the checklist is what lets a claim aimed at the Epic resolve the next available child. A ticket already labeled \`${EPIC_DECOMPOSED_LABEL}\` with NO children is a split that died before filing — treat it as undecomposed and resume at step 4.-7. **Then claim the first slice you filed** — set \`KEY\` to it and continue at **Phase 2**. If another run won the race, exit cleanly: the decomposition itself is a successful round.-## Phase 2 — Claim (In Progress + worktree)First move the ticket to **In Progress** (this is the claim, and it must happen BEFORE you start coding), then create the worktree. Transition names vary per project workflow, so resolve the id dynamically:@@ -1290,7 +1278,7 @@ Re-read the ticket (GET ${PORTOS_API_URL}/api/jira/instances/<instanceId>/ticket(A too-large scope is NOT in this list — it has its own park path below.)-**A genuinely too-large ticket gets SPLIT, not parked.** If the work is bigger than one coherent claim — it would touch files far outside the ticket's scope (>5 unrelated files) — and you can't carve a valuable standalone slice to ship first, decompose it exactly as **Phase 1b** steps 4–6 describe (each slice linked with \`"epicKey": "<KEY>"\` and carrying \`Part of <KEY>\`), then continue at Phase 2 with the first slice you filed. Phase 1 skips a parent only when it is BOTH epic-shaped AND marked, so promote this ticket on both axes: add \`${EPIC_DECOMPOSED_LABEL}\` to its labels, and make it epic-shaped — change its issue type to Epic where the project allows it, otherwise append " (epic)" to its summary, which is the title convention Phase 1 recognizes. A ticket marked but still typed Task stays eligible and gets re-split every pass. Splitting an omnibus ticket is work you do, not a hand-off. Only when the ticket is too vague to slice against the code at all is it a human call: create a Review Hub todo (POST ${PORTOS_API_URL}/api/review/todo with title "[<KEY>] Needs clarification" and the split you'd suggest), transition the ticket to a **Blocked/On Hold status if the workflow has one — NOT back to a not-started status**, which would re-queue it under Phase 1 (ticket selection never consults Review Hub todos, so a not-started ticket is immediately re-eligible and the run would re-park it every pass); if the workflow has no held status, leave it **In Progress**. Phase 1's not-started-only filter keeps a non-not-started ticket out of the ready queue, and the Review Hub todo is the durable human signal — together they let the claim run converge. Then remove the worktree and exit.+**A genuinely too-large ticket needs parking so the queue converges.** If the work is bigger than one coherent claim — it would touch files far outside the ticket's scope (>5 unrelated files) — and you can't carve a valuable standalone slice to ship first, splitting the omnibus is a human call: create a Review Hub todo (POST ${PORTOS_API_URL}/api/review/todo with title "[<KEY>] Needs clarification" and the split you'd suggest), transition the ticket to a **Blocked/On Hold status if the workflow has one — NOT back to a not-started status**, which would re-queue it under Phase 1 (ticket selection never consults Review Hub todos, so a not-started ticket is immediately re-eligible and the run would re-park it every pass); if the workflow has no held status, leave it **In Progress**. Phase 1's not-started-only filter keeps a non-not-started ticket out of the ready queue, and the Review Hub todo is the durable human signal — together they let the claim run converge. Then remove the worktree and exit.**Ambiguity is NOT a release trigger — decide, don't defer.** If the ticket is merely open to more than one reasonable reading, or leaves a design choice unstated, do NOT bail to a "Needs clarification" todo. Pick the most reasonable interpretation, record the approach you chose in a ticket comment (POST ${PORTOS_API_URL}/api/jira/instances/<instanceId>/tickets/<KEY>/comments) so the decision is on the record, and implement it. The user would rather iterate on top of a shipped best-guess than have the ticket parked waiting on a decision they didn't ask to make. Reserve the "Needs clarification" todo for cases where proceeding would be **destructive or irreversible**, or genuinely requires the human: specific hardware/credentials you don't have, or a judgment only they can make. In those cases only, create the todo (POST ${PORTOS_API_URL}/api/review/todo with title "[<KEY>] Needs clarification" and what a human must resolve), transition the ticket to a **Blocked/On Hold status if the workflow has one — NOT back to a not-started status** (which would re-queue it under Phase 1, since ticket selection never consults Review Hub todos); if the workflow has no held status, leave it **In Progress** so Phase 1's not-started-only filter excludes it. Then remove the worktree and **exit — do NOT proceed to Phase 4**.diff --git a/server/services/taskPromptDefaults/versions.js b/server/services/taskPromptDefaults/versions.jsindex ec9fde413d..1569904dd4 100644--- a/server/services/taskPromptDefaults/versions.js+++ b/server/services/taskPromptDefaults/versions.js@@ -14,7 +14,7 @@ export const PROMPT_VERSIONS = {'plan-task': 18, // v18: scheduled plan-task no longer instructs a code-review loop; v17: the implement + changelog steps name `AGENTS.md` (or `CLAUDE.md`) as the repo-conventions file (#4852 made AGENTS.md canonical; the dual naming keeps a managed app that still carries only the old name discoverable). v16: every reviewer that can read the working tree runs BEFORE the PR is opened — Phase 6 splits the configured list into LOCAL reviewers (every non-`@<login>` token, reviewed against `git diff origin/main...HEAD`) and PR-SIDE reviewers (`@<login>` plus any auto-requested review bot), opens the PR only once the branch is review-clean, and then waits on those PR-side reviewers plus required CI. Previously the PR was opened first and every reviewer ran against its diff, so each round of findings landed as follow-up commits on an already-public PR. v14: claim worktree creation passes `--no-track`, so a branch based on `origin/main` cannot inherit `main` as its upstream and make a config-derived push write directly to the default branch; the later `git push -u` sets the intended branch upstream. v13: Phase 5's changelog step reads the repo's documented convention FIRST (per-branch fragment directory + helper script, as PortOS now uses) and only falls back to detect-and-append when none is documented; the Phase 6 review-stuck note no longer names `.changelog/NEXT.md` as the file it wrote. v12: the reviewer bullets name the antigravity reviewer's actual PATH binary (`agy`) — the bare `antigravity` slug is a command that exists nowhere, and a review-loop agent that probed for it concluded no reviewer was available and merged on its own self-review. The same bump adds the missing-binary guard: a reviewer whose CLI is not on PATH is UNSATISFIED, never a clean review the agent substitutes its own self-review for. v11: worktree is created under PortOS's shared worktrees dir (`{worktreesRoot}` → data/cos/worktrees) instead of a repo-relative `data/cos/worktrees/` path, so the agent's checkout no longer lands inside the managed app's working tree. v10: Phase 3 "decide, don't defer" — an *ambiguous* PLAN.md item no longer jumps to the Phase 3b clarification PR; the agent picks the most reasonable reading, notes it, and implements. Phase 3b is reserved for destructive/irreversible or genuinely-human-gated items. Mirrors claim-issue v7 + CLAUDE.md. v9: per-kind reviewer bullets name `grok` alongside `claude`/`codex`/`antigravity` as a local-CLI reviewer (grok is now a selectable Review Loop reviewer). v8: Phase-6 merge fallback prefers --merge over --squash (after --auto), matching the /do:pr + review-loop default and PortOS's merge-only policy'claim-issue': 21, // v21: an epic is no longer a dead end — Phase 1 treats an UNdecomposed epic as eligible (last-resort, after every atomic issue) and routes it to the new Phase 1b, which reuses an existing child split or files one (2–8 independently shippable slices, each `Part of #<epic>`), rewrites the epic body with a `## Decomposed into` checklist, stamps the `decomposed` label, and then claims the first slice. Phase 3's too-large branch decomposes instead of parking to `needs-input`. Before this, a queue holding only epics ended every run with nothing done. `decomposed` is the convergence marker the perpetualWork detector reads (isActionableIssue). v20: canonicalize GitHub's ssh.github.com SSH-over-443 alias before host-aware identity probes. v19: host-aware GitHub identity probes use the repository origin, and probe failures stay transient instead of parking an assigned-only queue. v18: explicit issue-page claims ignore existing assignees; auto-pick resolves the authenticated login so self-assigned issues remain retryable; open continuation handoffs clear in-progress and all assignees. v17: mirrors plan-task v17 — Phase 4 and Phase 5 name `AGENTS.md` (or `CLAUDE.md`) as the repo-conventions file (#4852). v16: Phase 1 step 4's blocking-label check is now the `{issueExcludeLabels}` placeholder (resolveIssueExcludeLabelsBlock, cosTaskGenerator.js) — the fixed NON_ACTIONABLE_ISSUE_LABELS set plus any app-configured `taskMetadata.issueExcludeLabels` extras (e.g. `good first issue`), so the live claim agent honors the same per-app exclusions the perpetual-drain detector applies, not just the hardcoded set. The pinned-target constraint (`/do:next <num>` / the work-item picker) also re-checks that resolved list, not just the fixed 3, so a target that gained an excluded label after the picker snapshot still isn't force-claimed. Phase 1's candidate fetch widened to `--limit 500` (was 100), matching perpetualWork.js's detector — the label filter runs on the fetched page, so a small cap risked missing eligible work further down a busy queue. v15: Phase 5 is now the pre-PR local review (LOCAL reviewers = every non-`@<login>` token, run against the branch diff; an unsatisfied one blocks PR creation entirely) and Phase 6 opens the PR, satisfies the PR-SIDE reviewers (`@<login>` plus any auto-requested review bot) and required CI, then merges. v13: follow-up issue recipes choose independent slashdo dispatch hints (`model:`/`effort:`) and contributor labels (`good first issue`/`help wanted`) instead of only `plan`. v12: claim worktree creation passes `--no-track`, so a branch based on `origin/main` cannot inherit `main` as its upstream and make a config-derived push write directly to the default branch; the later `git push -u` sets the intended branch upstream. v11: EVERY Phase-3 release now converges — the "already fixed / superseded" case CLOSES the issue (with a comment naming what delivered it) and the "stale reference" case tags `needs-input`, instead of both releasing the issue open and unlabeled. `isActionableIssue` (perpetualWork.js) can only see labels/assignees/epic/in-flight, so a body-or-comment-driven release left the issue looking actionable and the perpetual drain re-spawned a no-op agent on it every tick. v10: Phase 5's changelog step defers to the convention the repo documents (per-branch fragment directory + helper script when present) instead of prescribing an append to `.changelog/NEXT.md`. v9: reviewer bullets name the antigravity reviewer's actual PATH binary (`agy`) — mirrors plan-task v12. The same bump adds the missing-binary guard: a reviewer whose CLI is not on PATH is UNSATISFIED, never a clean review the agent substitutes its own self-review for. v8: worktree is created under PortOS's shared worktrees dir (`{worktreesRoot}` → data/cos/worktrees) instead of a repo-relative `data/cos/worktrees/` path, so the agent's checkout no longer lands inside the managed app's working tree. v7: Phase 3 no longer releases/parks an *ambiguous* issue to `needs-input` — the agent decides (picks the most reasonable reading, records it in an issue comment, ships) rather than punting the choice back to a human; `needs-input` is reserved for destructive/irreversible or genuinely-human-gated (hardware/credentials) cases. Mirrors the "Decide, don't defer" policy in CLAUDE.md. v6: Phase 1 epic skip also recognizes a leading `[epic]` bracket or `Epic:` colon title tag (e.g. "[Epic] …" / "Epic: …"), not just an `epic` label or a "(epic)" suffix — mirrors the perpetualWork detector so a `[Epic]`-titled issue with no `epic` label stops re-spawning a claim agent that always skips it (perpetual drain now converges/parks). v5: per-kind reviewer bullets name `grok` alongside `claude`/`codex`/`antigravity` as a local-CLI reviewer (grok is now a selectable Review Loop reviewer). v4: Phase 5 chooses the issue trailer deliberately (Closes for a full ship, Refs + a `## Remaining` section for a partial one) and Phase 7 reconciles the issue with the partial-ship hybrid — close + file a scoped follow-up when the remainder is separable, else comment "done/remaining" + release the `in-progress` claim — so a partial ship is never left OPEN + `in-progress` (a zombie the claim queue skips forever). v3: Phase 3 tags an ambiguous/too-large issue `needs-input` (not just a comment) so it's excluded from future autonomous claims — required for `perpetual` (drain-until-done) mode to converge instead of re-picking the same un-actionable issue. v2: stop treating the bare `plan` label as a skip — `plan` is the claimable-queue label (do-replan --issues labels every migrated backlog item `plan`), so v1's exclusion emptied the whole actionable queue; now skip only true epics (`epic` label or "(epic)" title)'claim-issue-gitlab': 19, // v19: mirrors claim-issue v21 — Phase 1b decomposes an undecomposed epic into per-slice issues (`Part of #<epic>`, `decomposed` marker label on the parent) and claims the first slice, and the too-large branch splits rather than parking. v18: explicit issue-page claims ignore existing assignees; auto-pick resolves the authenticated login so self-assigned issues remain retryable; open continuation handoffs clear in-progress and all assignees. v17: mirrors claim-issue v17 — the repo-conventions file is named `AGENTS.md` (or `CLAUDE.md`) (#4852). v16: the Phase 1 and Phase 6 glab recipes use `--output json` instead of `-F json`. On `glab issue list`, `-F` is `--output-format` (details|ids|urls) — a DIFFERENT flag from `--output` (text|json) — so that spelling was accepted, ignored, and answered with the human table at exit 0; an agent piping that to `jq` got nothing and could not distinguish it from "no issues". `--output json` is correct on every glab subcommand, so the mr recipes are normalized to the same spelling in this bump. v15: mirrors claim-issue v16 — Phase 1 step 4's blocking-label check is now the `{issueExcludeLabels}` placeholder. v14: mirrors claim-issue v15 — Phase 5 runs the LOCAL reviewers against the branch diff before any MR exists, Phase 6 opens the MR and satisfies the MR-SIDE reviewers + pipeline before merging. v12: follow-up issue recipes choose independent slashdo dispatch hints (`model:`/`effort:`) and contributor labels (`good first issue`/`help wanted`) instead of only `plan`. v11: claim worktree creation passes `--no-track`, so a branch based on the default-branch remote ref does not inherit it as an upstream; the later `git push -u` sets the intended branch upstream. v10: mirrors claim-issue v11 — every Phase-3 release converges (close the already-fixed/superseded issue, tag the stale-reference one `needs-input`) so the perpetual drain stops re-picking it. v9: mirrors claim-issue v10 — Phase 5's changelog step defers to the repo's documented convention (per-branch fragments) rather than prescribing a `.changelog/NEXT.md` append. v8: reviewer bullets name the antigravity reviewer's actual PATH binary (`agy`) — mirrors plan-task v12. The same bump adds the missing-binary guard: a reviewer whose CLI is not on PATH is UNSATISFIED, never a clean review the agent substitutes its own self-review for. v7: worktree is created under PortOS's shared worktrees dir (`{worktreesRoot}` → data/cos/worktrees) instead of a repo-relative `data/cos/worktrees/` path, so the agent's checkout no longer lands inside the managed app's working tree (mirrors claim-issue v8). v6: mirrors claim-issue v7 — Phase 3 decides an *ambiguous* issue (record the chosen reading in an issue note, ship) instead of parking it to `needs-input`, which is reserved for destructive/irreversible or genuinely-human-gated (hardware/credentials) cases. v5: mirrors claim-issue v6 — Phase 1 epic skip also recognizes a leading `[epic]` bracket or `Epic:` colon title tag (e.g. "[Epic] …" / "Epic: …"), not just an `epic` label or a "(epic)" suffix, so the GitLab detector/agent converge on epic-titled issues too. v4: per-kind reviewer bullets name `grok` alongside `claude`/`codex`/`antigravity` as a local-CLI reviewer (grok is now a selectable Review Loop reviewer). v3: mirrors claim-issue v4 — Phase 5 chooses Closes-vs-Refs deliberately and Phase 7 reconciles the issue with the partial-ship hybrid (close + scoped follow-up when separable, else "done/remaining" note + release the `in-progress` claim) so a partial ship is never stranded. v2: Phase 3 tags an ambiguous/too-large issue `needs-input` (mirrors claim-issue v3) so it's excluded from future autonomous claims — required for `perpetual` (drain-until-done) mode to converge. v1: GitLab sibling of claim-issue — same 7-phase /claim --issues flow over `glab` issues + merge requests. Reached via the claim-work router when an app's resolved workTracker is 'gitlab'.- 'claim-issue-jira': 14, // v14: mirrors claim-issue v21 in JIRA's vocabulary — Phase 1b splits an undecomposed Epic into child tickets linked with `epicKey`, stamps the `decomposed` label on the parent, and claims the first slice; the too-large branch decomposes instead of parking behind a Review Hub todo. v13: mirrors claim-issue v17 — the repo-conventions file is named `AGENTS.md` (or `CLAUDE.md`) (#4852). v12: mirrors claim-issue v15 in the JIRA flow — Phase 5 runs the LOCAL reviewers against the branch diff before the MR/PR is opened (and before the In Review transition), Phase 6 keeps only the PR-side reviewers plus the worktree cleanup. v10: follow-up tickets receive equivalent hyphenated dispatch (`model-*`/`effort-*`) and contributor (`good-first-issue`/`help-wanted`) labels when independently justified. v9: claim worktree creation passes `--no-track`, so a branch based on the default-branch remote ref does not inherit it as an upstream; the later `git push -u` sets the intended branch upstream. v8: mirrors claim-issue v11 in JIRA's status vocabulary — an already-fixed/superseded ticket transitions to Done/Closed and a stale-reference ticket parks on a Blocked/On Hold status behind a Review Hub todo, instead of transitioning back to a not-started status that Phase 1 immediately re-picks. v7: mirrors claim-issue v10 — Phase 5's changelog step defers to the repo's documented convention (per-branch fragments) rather than prescribing a `.changelog/NEXT.md` append. v6: reviewer bullets name the antigravity reviewer's actual PATH binary (`agy`) — mirrors plan-task v12. The same bump adds the missing-binary guard: a reviewer whose CLI is not on PATH is UNSATISFIED, never a clean review the agent substitutes its own self-review for. v5: worktree is created under PortOS's shared worktrees dir (`{worktreesRoot}` → data/cos/worktrees) instead of `{repoPath}/data/cos/worktrees/`, so the agent's checkout no longer lands inside the managed app's working tree (mirrors claim-issue v8). v4: mirrors claim-issue v7 — Phase 3 decides an *ambiguous* ticket (record the chosen reading in a ticket comment, ship) instead of parking it to a "Needs clarification" Review Hub todo, and Phase 1 no longer skips a merely-underspecified ticket; the todo is reserved for destructive/irreversible or genuinely-human-gated cases. v3: per-kind reviewer bullets name `grok` alongside `claude`/`codex`/`antigravity` as a local-CLI reviewer (grok is now a selectable Review Loop reviewer). v2: Phase 5 records remaining scope in the ticket (Done/Remaining comment) and files a follow-up ticket when a partial ship's remainder is separable, so remaining work isn't lost when a human lands the MR/PR. v1: JIRA sibling of claim-issue — claim ONE ready sprint ticket, move it To Do→In Progress→In Review around a self-managed worktree + MR/PR. Reached via the claim-work router when an app's resolved workTracker is 'jira' (replaces the prior jira→jira-sprint-manager route).+ 'claim-issue-jira': 14, // v14: Phase 1 states WHY this flow leaves an epic for a human while claim-issue v21 / claim-issue-gitlab v19 now decompose one — the JIRA reads PortOS exposes (jira.js#getIssue, #fetchMyCurrentSprintTickets) return neither a ticket's labels nor its epic links, so an agent here can see no decomposition marker and cannot find an epic's existing children. Doc-only; the flow is unchanged, and porting Phase 1b here is tracked in #5042. v13: mirrors claim-issue v17 — the repo-conventions file is named `AGENTS.md` (or `CLAUDE.md`) (#4852). v12: mirrors claim-issue v15 in the JIRA flow — Phase 5 runs the LOCAL reviewers against the branch diff before the MR/PR is opened (and before the In Review transition), Phase 6 keeps only the PR-side reviewers plus the worktree cleanup. v10: follow-up tickets receive equivalent hyphenated dispatch (`model-*`/`effort-*`) and contributor (`good-first-issue`/`help-wanted`) labels when independently justified. v9: claim worktree creation passes `--no-track`, so a branch based on the default-branch remote ref does not inherit it as an upstream; the later `git push -u` sets the intended branch upstream. v8: mirrors claim-issue v11 in JIRA's status vocabulary — an already-fixed/superseded ticket transitions to Done/Closed and a stale-reference ticket parks on a Blocked/On Hold status behind a Review Hub todo, instead of transitioning back to a not-started status that Phase 1 immediately re-picks. v7: mirrors claim-issue v10 — Phase 5's changelog step defers to the repo's documented convention (per-branch fragments) rather than prescribing a `.changelog/NEXT.md` append. v6: reviewer bullets name the antigravity reviewer's actual PATH binary (`agy`) — mirrors plan-task v12. The same bump adds the missing-binary guard: a reviewer whose CLI is not on PATH is UNSATISFIED, never a clean review the agent substitutes its own self-review for. v5: worktree is created under PortOS's shared worktrees dir (`{worktreesRoot}` → data/cos/worktrees) instead of `{repoPath}/data/cos/worktrees/`, so the agent's checkout no longer lands inside the managed app's working tree (mirrors claim-issue v8). v4: mirrors claim-issue v7 — Phase 3 decides an *ambiguous* ticket (record the chosen reading in a ticket comment, ship) instead of parking it to a "Needs clarification" Review Hub todo, and Phase 1 no longer skips a merely-underspecified ticket; the todo is reserved for destructive/irreversible or genuinely-human-gated cases. v3: per-kind reviewer bullets name `grok` alongside `claude`/`codex`/`antigravity` as a local-CLI reviewer (grok is now a selectable Review Loop reviewer). v2: Phase 5 records remaining scope in the ticket (Done/Remaining comment) and files a follow-up ticket when a partial ship's remainder is separable, so remaining work isn't lost when a human lands the MR/PR. v1: JIRA sibling of claim-issue — claim ONE ready sprint ticket, move it To Do→In Progress→In Review around a self-managed worktree + MR/PR. Reached via the claim-work router when an app's resolved workTracker is 'jira' (replaces the prior jira→jira-sprint-manager route).'pr-reviewer': 3, // v3: multi-stage pipeline (security scan → code review + merge)'code-reviewer-a': 1, // v1: 2-stage pipeline (codebase review → triage & implement)'code-reviewer-b': 1, // v1: 2-stage pipeline (codebase review → triage & implement)