Skip to content

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

apply the forge label separator at one boundary instead of at every axis

[._.]/ Adam Eivy42e7d8a11bd2
diff --git a/client/src/components/cos/ReviewerPicker.jsx b/client/src/components/cos/ReviewerPicker.jsx
index d30eb429e6..9499dbedfb 100644
--- a/client/src/components/cos/ReviewerPicker.jsx
+++ b/client/src/components/cos/ReviewerPicker.jsx
@@ -17,7 +17,7 @@ import {
} from './constants';
import ProviderModelSelector from '../ProviderModelSelector';
import { selectableModelsForProvider, effortLevelsForProvider, effectiveModelFor } from '../../utils/providers';
-import { APPLY_CAPABLE_REVIEWER, isProviderReviewer, normalizeReviewerSlug } from '../../lib/reviewerPins';
+import { isApplyCapableReviewer, isProviderReviewer, normalizeReviewerSlug } from '../../lib/reviewerPins';
import { getNavPageForPath } from '../../../../server/lib/navManifest.js';
// The SAME map the readiness cards link by (`LOCAL_RUNTIMES[*].manageUrl` reads
// from it), taken from the server leaf rather than mirrored — the mirror is what
@@ -196,7 +196,7 @@ export default function ReviewerPicker({
// Only codex is offered the editing pass: slashdo forces every other local
// reviewer back to review-only and reverts what it wrote, so showing the toggle
// for agy/grok/cursor would ask the user to grant write access for nothing.
- const hasApplyCapableReviewer = selected.includes(APPLY_CAPABLE_REVIEWER);
+ const hasApplyCapableReviewer = selected.some(isApplyCapableReviewer);
const selectedUsernames = normalizeReviewUsernames(usernames);
const atMaxUsernames = selectedUsernames.length >= MAX_REVIEW_USERNAMES;
// Optional (non-blocking) reviewers — emitted with slashdo's `~opt` suffix.
diff --git a/client/src/lib/reviewerPins.js b/client/src/lib/reviewerPins.js
index 5df5165994..678931457c 100644
--- a/client/src/lib/reviewerPins.js
+++ b/client/src/lib/reviewerPins.js
@@ -156,13 +156,14 @@ export const REVIEWER_VALUES = ['copilot', 'claude', 'antigravity', 'codex', 'gr
export const DEFAULT_REVIEWER = 'copilot';
export const DEFAULT_REVIEWERS = [];
-// The one reviewer `--reviewer-applies` reaches. slashdo's loop forces every
-// other local CLI back to review-only and reverts what it wrote, and the flag is
+// Reviewers `--reviewer-applies` reaches. slashdo's loop forces every other
+// local CLI back to review-only and reverts what it wrote, and the flag is
// meaningless for the cloud (`copilot`, `@login`) and non-agentic (`ollama`)
-// paths — so the picker offers the toggle only when codex is selected, rather
-// than inviting a user to grant agy/grok/cursor write access that gets reverted.
-// Mirror of `APPLY_CAPABLE_REVIEWER` in server/lib/reviewerConfig.js.
-export const APPLY_CAPABLE_REVIEWER = 'codex';
+// paths — so the picker offers the toggle only for these, rather than inviting a
+// user to grant agy/grok/cursor write access that gets reverted.
+// Mirror of `APPLY_CAPABLE_REVIEWERS` in server/lib/reviewerConfig.js.
+export const APPLY_CAPABLE_REVIEWERS = Object.freeze(['codex']);
+export const isApplyCapableReviewer = (slug) => APPLY_CAPABLE_REVIEWERS.includes(normalizeReviewerSlug(slug));
// Arbitrary GitHub reviewer usernames (e.g. `@CodeReviewbot`) requested as PR
// reviewers to gate merging, appended to slashdo's `--review-with` after the
diff --git a/server/lib/README.md b/server/lib/README.md
index 45bc2bb87f..6a4e250911 100644
--- a/server/lib/README.md
+++ b/server/lib/README.md
@@ -186,7 +186,7 @@ The barrel `server/lib/index.js` is a machine-checkable enumeration of every pub
| `antigravity.js` | Antigravity (`agy`) CLI provider helpers — id/sentinel constants (`ANTIGRAVITY_CLI_ID`, `ANTIGRAVITY_CONFIGURED_DEFAULT`, `LEGACY_GEMINI_*`), `isAntigravityCommand`/`isAntigravityCliProvider` predicates, and `ensureAntigravityPrintArgs(args, {model, effort})`/`ensureAntigravityTuiArgs(args, {model, effort})`/`stripAntigravityUnsupportedArgs` argv normalizers. `parseAntigravityModelList(stdout)` parses `agy models` rows — accepts both the modern `<id>\t<Label>` shape and the older bare-id-per-line one, deduped, sentinel dropped (mirrored in the vendored toolkit's `internal/antigravity.js`; used by both the provider-catalog refresh and Image Gen's agy model picker). `isAntigravityModelId(id)` is the same id shape as a bare predicate, for spawn sites building an `agy --model` argv from a value no route schema bounded. The strip drops legacy Gemini `--yolo`/`-m`/`--output-format` but PRESERVES the long `--model` (agy accepts it as a per-session flag, so a user-baked pin is a real selection and suppresses the injected one); the two builders inject `--model`/`--effort` from the per-run overrides, always ahead of the trailing `--print` marker whose value is the prompt. |
| `llmText.js` | Pure LLM-output text helpers — `stripCodeFences` (unfence a model reply) and `parseLLMJSON` (unfence then JSON.parse with a descriptive throw). Below the provider layer, so lib can clean model output without importing provider orchestration. |
| `providerCooldown.js` | Provider bench policy — `resolveProviderBench(analysis)` → `null` (don't bench) / a `usage-limit` marker / an `unavailable` marker with the per-category cooldown from `COOLDOWN_MS_BY_CATEGORY`. Declines to bench request/response-specific categories (`isRequestSpecificCategory` / `isSchemaTypeCategory`) so one bad model id or off-shape response can't take a healthy provider offline. Shared by `services/promptRunner.js` (prompt cascade) and `services/agentFinalization.js` (finished CoS agent run) so both bench a category for the same window. Pure. |
-| `reviewerConfig.js` | Review-Loop reviewer vocabulary (split out of `cosValidation.js`, #5702; Zod-free): the reviewer roster + aliases (`REVIEWER_VALUES` / `REVIEWER_ALIASES` / `DEFAULT_REVIEWER`), the local-LLM / PortOS-only / model-capable / effort-selectable subsets, the slug→CLI-binary map (`REVIEWER_CLI_BINARIES`, `isCliReviewer`, `reviewerCliBinary`), the keyed model/effort/max-rounds pin normalizers + resolvers (`normalizeReviewers`, `normalizeReviewerModels`, `normalizeReviewerEfforts`, `resolveReviewerConfig`, `resolveClaimReviewerConfig`, `KEYED_REVIEWER_PINS`), the override-key rosters that say when a task has pinned its own reviewers (`REVIEWER_OVERRIDE_KEYS` — everything the picker writes and its reset clears; `REVIEWER_LIST_OVERRIDE_KEYS` / `hasReviewerOverride` — only the keys that can change the resolved LIST), and the emitters that render a reviewer set into slashdo argv (`buildReviewWithArgs` — which emits `--reviewer-applies` only alongside `APPLY_CAPABLE_REVIEWER`, the one reviewer slashdo lets edit the tree, `buildReviewersCsv`) and into agent-prompt notes (`buildReviewerPinNote`, `buildReviewerEffortNote`). Re-exported flat by `cosValidation.js`, so existing `validation.js` imports keep resolving. Provider-backed identities use `provider:<id>` (`isProviderReviewer`, `isReviewer`, `isToolFreeReviewer`) and additive `providerModels` defaults; legacy scalar pins stay compatible. |
+| `reviewerConfig.js` | Review-Loop reviewer vocabulary (split out of `cosValidation.js`, #5702; Zod-free): the reviewer roster + aliases (`REVIEWER_VALUES` / `REVIEWER_ALIASES` / `DEFAULT_REVIEWER`), the local-LLM / PortOS-only / model-capable / effort-selectable subsets, the slug→CLI-binary map (`REVIEWER_CLI_BINARIES`, `isCliReviewer`, `reviewerCliBinary`), the keyed model/effort/max-rounds pin normalizers + resolvers (`normalizeReviewers`, `normalizeReviewerModels`, `normalizeReviewerEfforts`, `resolveReviewerConfig`, `resolveClaimReviewerConfig`, `KEYED_REVIEWER_PINS`), the override-key rosters that say when a task has pinned its own reviewers (`REVIEWER_OVERRIDE_KEYS` — everything the picker writes and its reset clears; `REVIEWER_LIST_OVERRIDE_KEYS` / `hasReviewerOverride` — only the keys that can change the resolved LIST), and the emitters that render a reviewer set into slashdo argv (`buildReviewWithArgs` — which emits `--reviewer-applies` only alongside an `APPLY_CAPABLE_REVIEWERS` slug, the reviewers slashdo lets edit the tree, `buildReviewersCsv`) and into agent-prompt notes (`buildReviewerPinNote`, `buildReviewerEffortNote`). Re-exported flat by `cosValidation.js`, so existing `validation.js` imports keep resolving. Provider-backed identities use `provider:<id>` (`isProviderReviewer`, `isReviewer`, `isToolFreeReviewer`) and additive `providerModels` defaults; legacy scalar pins stay compatible. |
| `providerPrerequisites.js` | Can a provider run on this host AT ALL — `providerPrerequisites(provider, { runtime, gatewayKeySet })` → `{ met, missing: [{ code, label }] }` (CLI binary on PATH, API key stored for a public endpoint, the sibling key a gateway-backed wrapper inherits from the API record of its own gateway id unless it carries its own), plus `providerRuntimeKey` (`null` for an API provider, for a command carrying an explicit path, and for a provider with its own `PATH` in `envVars` — the runtime table only answers "does the BARE binary resolve on PortOS's PATH?", which is not those providers' question), `isPrivateNetworkEndpoint` (mirror of the client copy: loopback/RFC1918/tailnet CGNAT + ULA/`.ts.net`/single-label hosts need no key) and `describeMissingPrerequisites`. `runtime: null` = NOT PROBED and never counts as missing. Feeds BOTH `GET /api/providers` and the fallback chain in `aiToolkit/providerStatus.js` (via `services/providerPrerequisites.js`), so a `NEEDS SETUP` card and the router read one computation (#4611). `ROUTING_BLOCKING_CODES`/`blocksRouting(missing)` narrow what ROUTING may act on to the missing binary. Stored, inherited, and environment-backed credential findings stay presentation-only here because the server cannot assume the eventual process environment; the client card classifies sanitized env metadata through tri-state lookups (#4612). Pure. |
| `tuiShellLaunch.js` | `buildTuiShellLaunch(provider)` → `{ commandLine, env }` for launching a TUI provider by hand in a Shell session (the AI Providers card's "Launch in Shell" button). Resolves the command via `tuiHandshake.js#buildTuiInvocation` (so the vendor posture flags and `--model`/`--effort` injection match a real TUI spawn) and the env via `cliChildEnv.js#composeProviderEnv`. **The env is why this is server-side and the deep link carries only a provider ID**: a TUI provider's backend lives in `envVars` (`ANTHROPIC_BASE_URL` for an Ollama-backed or Bedrock `claude`, `OPENCODE_CONFIG_CONTENT` for an OpenCode wrapper), so a shell handed only the command line would run the right binary against the vendor cloud instead of the local daemon the user configured — and those values are secret, so they can't ride a URL. Returns null for a non-TUI provider. Must be given a RAW provider, never a client-sanitized one (redacted `'***'` env reads truthy). |
| `tuiHandshake.js` | Shared TUI invocation + paste-handshake constants. Also owns `SUBMIT_KEY` — the single Enter byte every PTY writer sends, whether it's submitting a pasted TUI prompt or a command PortOS injected into a shell session. It is CR, never LF: a POSIX pty's ICRNL hides the difference, but cmd.exe under Windows ConPTY accepts only CR and leaves an LF-terminated line typed-but-unexecuted at the prompt. |
@@ -585,7 +585,7 @@ pm` default, `NPM_CONFIG_PREFIX`, nvm/Volta) installed `codex` successfully and
| `assetRoutePrefixes.js` | Import-free leaf holding the URL prefixes the server owns: `ASSET_ROUTE_PREFIXES` (every `/data/**` static mount) and `SERVER_OWNED_PREFIXES` (what must never reach the SPA fallback, each with the exact `spaPaths` that ARE client routes). `scripts/dev-proxy-drift.test.js` checks the dev proxy's `^/data/` wildcard against the mounts, pins the route-registration order in `server/index.js` (a router added below the terminators is shadowed), and fails if a client route — from `NAV_COMMANDS` or `App.jsx`'s nested `<Route>` tree — is ever added under a server-owned prefix without being declared. |
| `asyncMutex.js` | Promise-based async mutex. |
| `concurrencyGate.js` | `createConcurrencyGate(limit)` → `run(fn)` — cap on simultaneous async work for ONE module-scoped budget, released FIFO. Sibling to `mapWithConcurrency.js`, which caps in-flight work *within one array map*; a gate is shared state, so several call sites fanning out at the same remote respect one budget instead of each respecting its own while the host sees the sum. `createMutex` (`asyncMutex.js`) is this with `limit` fixed at 1 — prefer it for mutual exclusion. Note the budget is per-MODULE, not per-host: two modules calling one host each get their own gate. Used by `huggingFaceMetadata.js` (4) and `ollamaRegistryCatalog.js` (16), whose cold catalog-enrichment bursts otherwise arrive at a free public API as a thundering herd — which the Hub answers with an HTTP/2 GOAWAY that surfaces as a bare `fetch failed`. |
-| `dispatchLabels.js` | slashdo dispatch-hint contract: the `model:` capability and `effort:` reasoning-budget label vocabulary (the tiers themselves live in this module and are deliberately not re-enumerated here — a catalog copy of them is what drifted a tier behind), prescribed forge colors, validation (`normalizeDispatchModel` / `normalizeDispatchEffort`), the read-side inverse (`dispatchHintFromLabels` — recovers `{model, effort}` from a raw label-name list, used by branch-reconcile's per-branch routing hint), the per-forge label separator (`labelSeparator` / `forgeLabelName` — GitLab spells every prefixed label with its native scoped `::`, GitHub keeps `:`, and the read side accepts both; Jira keeps the hyphen form), optional contributor labels (`good first issue` / `help wanted`, never implied by `model:light`, and released at claim time by `formatContributorLabelReleaseCommands` — one best-effort command per label, since a forge fails the whole edit when a named label is absent), the one shared volunteer-claim policy (`volunteerClaimLabels` / `formatVolunteerClaimCommands` — a human comment claiming an unassigned issue is resolved by BOTH issueWatcher.js's deterministic pass and the claim prompt's Phase 1 handoff, so both stamp `in-progress` and retire the invitations rather than writing opposite state), the open-ended planner-attribution axis (`planner:<model>`, `normalizePlannerId` / `resolvePlannerId` / `formatPlannerLabelGuidance` — records WHICH model wrote the plan, prefix-matched by `dispatchLabelSpec` so it lazily creates like the fixed labels; a filing agent takes the value from its prompt, never from self-identification), the workflow-state markers (`EPIC_LABEL`/`EPIC_DECOMPOSED_LABEL` and `IN_PROGRESS_LABEL` — state, not hints: shared with perpetualWork.js#isActionableIssue, issueReconcile.js's zombie scan, issueWatcher.js's volunteer assignment, and the claim prompts), lazy-create command text, the optional `--label` slots a rendered `issue create` example offers (`OPTIONAL_ISSUE_LABEL_FLAG_SLOTS` / `formatOptionalIssueLabelFlags` — one list so a new axis reaches every prompt template's copy-pasteable command, not just its prose), and shared dispatch plus issue-quality guidance (`ISSUE_QUALITY_GUIDANCE`, `DISPATCH_HINT_GUIDANCE`, `MANDATORY_DISPATCH_HINT_GUIDANCE`, `JIRA_DISPATCH_HINT_GUIDANCE`, `MANDATORY_JIRA_DISPATCH_HINT_GUIDANCE`, `REFERENCE_WATCH_LABEL_CONTRACT`, plus the consumer-side pair `DISPATCH_HINT_READING_GUIDANCE` / `DISPATCH_HINT_FANOUT_GUIDANCE` — what the labels mean to an agent that RECEIVES them (the preloaded `open-issues` task data input) and, for an orchestrator only, how to route each sub-agent by its own issue (the swarm block); the fan-out form is the reading form plus one line, never a second copy of the vocabulary). All forge filing callers require both dispatch axes and verify labels after creation; help wanted requires specific hardware validation or valuable input from real users; never invent `medium`; reject future-only/speculative work while keeping useful current refactors claimable. Consumed by work-tracker instructions, quota-burn audits, Layered Intelligence filing, and claim follow-up prompts. |
+| `dispatchLabels.js` | slashdo dispatch-hint contract: the `model:` capability and `effort:` reasoning-budget label vocabulary (the tiers themselves live in this module and are deliberately not re-enumerated here — a catalog copy of them is what drifted a tier behind), prescribed forge colors, validation (`normalizeDispatchModel` / `normalizeDispatchEffort`), the read-side inverse (`dispatchHintFromLabels` — recovers `{model, effort}` from a raw label-name list, used by branch-reconcile's per-branch routing hint), the per-forge label separator (`labelSeparator` / `forgeLabelName` — GitLab spells every prefixed label with its native scoped `::`, GitHub keeps `:`, and the read side accepts both; applied once at the `forgeIssueLabels` / `dispatchLabelSpec` boundary so the axis builders stay canonical; Jira keeps the hyphen form), optional contributor labels (`good first issue` / `help wanted`, never implied by `model:light`, and released at claim time by `formatContributorLabelReleaseCommands` — one best-effort command per label, since a forge fails the whole edit when a named label is absent), the one shared volunteer-claim policy (`volunteerClaimLabels` / `formatVolunteerClaimCommands` — a human comment claiming an unassigned issue is resolved by BOTH issueWatcher.js's deterministic pass and the claim prompt's Phase 1 handoff, so both stamp `in-progress` and retire the invitations rather than writing opposite state), the open-ended planner-attribution axis (`planner:<model>`, `normalizePlannerId` / `resolvePlannerId` / `formatPlannerLabelGuidance` — records WHICH model wrote the plan, prefix-matched by `dispatchLabelSpec` so it lazily creates like the fixed labels; a filing agent takes the value from its prompt, never from self-identification), the workflow-state markers (`EPIC_LABEL`/`EPIC_DECOMPOSED_LABEL` and `IN_PROGRESS_LABEL` — state, not hints: shared with perpetualWork.js#isActionableIssue, issueReconcile.js's zombie scan, issueWatcher.js's volunteer assignment, and the claim prompts), lazy-create command text, the optional `--label` slots a rendered `issue create` example offers (`OPTIONAL_ISSUE_LABEL_FLAG_SLOTS` / `formatOptionalIssueLabelFlags` — one list so a new axis reaches every prompt template's copy-pasteable command, not just its prose), and shared dispatch plus issue-quality guidance (`ISSUE_QUALITY_GUIDANCE`, `DISPATCH_HINT_GUIDANCE`, `MANDATORY_DISPATCH_HINT_GUIDANCE`, `JIRA_DISPATCH_HINT_GUIDANCE`, `MANDATORY_JIRA_DISPATCH_HINT_GUIDANCE`, `REFERENCE_WATCH_LABEL_CONTRACT`, plus the consumer-side pair `DISPATCH_HINT_READING_GUIDANCE` / `DISPATCH_HINT_FANOUT_GUIDANCE` — what the labels mean to an agent that RECEIVES them (the preloaded `open-issues` task data input) and, for an orchestrator only, how to route each sub-agent by its own issue (the swarm block); the fan-out form is the reading form plus one line, never a second copy of the vocabulary). All forge filing callers require both dispatch axes and verify labels after creation; help wanted requires specific hardware validation or valuable input from real users; never invent `medium`; reject future-only/speculative work while keeping useful current refactors claimable. Consumed by work-tracker instructions, quota-burn audits, Layered Intelligence filing, and claim follow-up prompts. |
| `domainAutonomy.js` | Per-domain autonomy guardrails (pure). `AUTONOMY_DOMAINS`/`DOMAIN_IDS`/`DOMAIN_MODES` (`off`/`dry-run`/`execute`), `getDomainMode(config, id)`, and `normalizeDomainAutonomy(raw)` to coerce a hand-edited/partial map. Default per domain is `execute` (reproduces pre-#711 behavior, so no migration needed). Also `CREATIVE_DOMAIN`/`getCreativeAutonomyMode(config)` (#2183) — the Creative Director orchestrator domain, kept out of `DOMAIN_IDS` and defaulting to mirror the `cos` mode. |
| `domainBudgets.js` | Per-domain daily autonomy budgets (pure). `BUDGET_LIMIT_FIELDS` (`maxActionsPerDay`/`maxMinutesPerDay`), `getDomainBudget(config, id)`, `normalizeDomainBudgets(raw)`, `hasBudget(budget)`, and `evaluateBudget(budget, usage)` → `{ withinBudget, exceeded }`. A `null`/non-positive cap means unlimited (default per domain, so no migration needed). Token/$ caps are intentionally absent — CLI subscription providers expose no per-run metering. Usage ledger + gate wiring live in `services/domainUsage.js`. |
| `federationSafety.js` | "Does this JSON-shaped payload carry anything that must not leave the install?" — the structured, REFUSAL-side counterpart to the scrubbers (`secretText.js`, `homePath.js`) that rewrite text for a log. `federationSafetyFindings(value, { limit })` walks every string AND every object key, returning `{ code, path, detail }` for a home/Windows path, IPv4 or IPv6 literal, `.ts.net`/`.local` host, MAC, email, phone number, labelled GPS coordinate (the shared table is `piiRedactionPatterns.js`), credential-shaped value (`scrubSecretTokens`) or credential-NAMED key (`secretKeys.js#isSecretKey` — the half no value-shape scan can see). Deliberately over-refuses rather than under-detects: a payload leaving the machine should fail on "looks like an address", and the finding names the exact JSON path to fix. `walkJsonText` / `describeJsonPath` are the reusable path-reporting walk. Pure; reads no environment. |
diff --git a/server/lib/dispatchLabels.js b/server/lib/dispatchLabels.js
index c5f329de02..2ea77389e7 100644
--- a/server/lib/dispatchLabels.js
+++ b/server/lib/dispatchLabels.js
@@ -42,13 +42,24 @@ export function labelSeparator(cli = 'gh') {
return cli === 'glab' ? '::' : ':';
}
+/** The key half of a prefixed label — one grammar, shared by both regexes below. */
+const LABEL_KEY = '[A-Za-z][A-Za-z0-9-]*';
+
/** A prefixed label, split into its key and value across either separator. */
-const PREFIXED_LABEL_RE = /^([A-Za-z][A-Za-z0-9-]*)::?(.+)$/;
+const PREFIXED_LABEL_RE = new RegExp(`^(${LABEL_KEY})::?(.+)$`);
/**
* Rewrite one label into `cli`'s separator. A label with no `key:value` shape
* (`good first issue`, `in-progress`) is returned untouched, so a caller can
- * pipe every label it is about to apply through this without special-casing.
+ * pipe every label it is about to apply through this without special-casing,
+ * and re-running it is a no-op rather than growing a third colon.
+ *
+ * Every function below that has to name a label in a forge's own spelling goes
+ * through here, so `labelSeparator` has exactly one caller and "key + separator
+ * + value" has exactly one definition. Called with no `cli` it yields the
+ * CANONICAL (GitHub) form, which is what every lookup table here is keyed by —
+ * that is how `dispatchLabelSpec('model::heavy')` finds its color instead of
+ * falling through to "not a dispatch label".
* @param {string} name
* @param {{cli?: string}} [options]
* @returns {string}
@@ -59,13 +70,6 @@ export function forgeLabelName(name, { cli = 'gh' } = {}) {
return parts ? `${parts[1]}${labelSeparator(cli)}${parts[2]}` : name;
}
-/**
- * The GitHub-form spelling of a label, whichever forge wrote it — the key every
- * lookup table here is keyed by. Lets `dispatchLabelSpec('model::heavy')` find
- * its color instead of falling through to "not a dispatch label".
- */
-const canonicalLabelName = (name) => forgeLabelName(name, { cli: 'gh' });
-
export const DISPATCH_LABEL_COLORS = Object.freeze({
'model:light': 'D4C5F9',
'model:medium': 'A371F7',
@@ -216,10 +220,13 @@ export function resolvePlannerId({ providerId, model } = {}) {
return normalizePlannerId(model) || normalizePlannerId(providerId);
}
-/** Forge label for a planner identity (`planner:opus-5`, `planner::opus-5`), or null. */
-export function forgePlannerLabel(value, { cli = 'gh' } = {}) {
+/**
+ * Forge label for a planner identity (`planner:opus-5`), or null. Canonical
+ * form — `forgeIssueLabels` / `dispatchLabelSpec` re-spell it for the forge.
+ */
+export function forgePlannerLabel(value) {
const id = normalizePlannerId(value);
- return id ? `planner${labelSeparator(cli)}${id}` : null;
+ return id ? `${PLANNER_LABEL_PREFIX}${id}` : null;
}
/** Jira-safe planner label (`planner-opus-5`), or null. */
@@ -231,7 +238,7 @@ export function jiraPlannerLabel(value) {
/** True when `name` is a forge planner label with a non-empty value, in either separator. */
export function isPlannerLabel(name) {
if (typeof name !== 'string') return false;
- const canonical = canonicalLabelName(name);
+ const canonical = forgeLabelName(name);
return canonical.startsWith(PLANNER_LABEL_PREFIX) && canonical.length > PLANNER_LABEL_PREFIX.length;
}
@@ -241,12 +248,12 @@ export function isPlannerLabel(name) {
* name is re-derived from the normalized slug so a caller can't smuggle an
* unnormalized label past `formatLabelCreateCommand`.
*/
-export function plannerLabelSpec(name, { cli = 'gh' } = {}) {
+export function plannerLabelSpec(name) {
if (!isPlannerLabel(name)) return null;
- const id = normalizePlannerId(canonicalLabelName(name).slice(PLANNER_LABEL_PREFIX.length));
+ const id = normalizePlannerId(forgeLabelName(name).slice(PLANNER_LABEL_PREFIX.length));
if (!id) return null;
return {
- name: `planner${labelSeparator(cli)}${id}`,
+ name: `${PLANNER_LABEL_PREFIX}${id}`,
color: PLANNER_LABEL_COLOR,
description: `Plan authored by the ${id} model`,
};
@@ -263,7 +270,7 @@ export function plannerLabelSpec(name, { cli = 'gh' } = {}) {
* has to act on. `cli` only picks the `label create` dialect (`gh` / `glab`).
*/
export function formatPlannerLabelGuidance(plannerId, { cli = 'gh' } = {}) {
- const label = forgePlannerLabel(plannerId, { cli });
+ const label = forgeLabelName(forgePlannerLabel(plannerId), { cli });
if (!label) return '';
const sep = labelSeparator(cli);
return [
@@ -293,11 +300,11 @@ export const OPTIONAL_ISSUE_LABEL_FLAG_SLOTS = Object.freeze([
]);
/**
- * `--label <key>:<value>` occurrences in a rendered flag string. Quoted and
- * bare values both, and `(?!:)` so re-running this on an already-GitLab string
- * is a no-op rather than growing a third colon.
+ * The prefixed label inside a rendered `--label <key>:<value>` flag, quoted or
+ * bare. Only the label token is captured; `forgeLabelName` does the re-spelling,
+ * so the separator is not restated here.
*/
-const LABEL_FLAG_SEPARATOR_RE = /(--label\s+"?[A-Za-z][A-Za-z0-9-]*):(?!:)/g;
+const LABEL_FLAG_RE = new RegExp(`(--label\\s+"?)(${LABEL_KEY}::?[^\\s"]+)`, 'g');
/**
* The optional slots as one line, appended after any flags a contract already
@@ -316,7 +323,7 @@ export function formatOptionalIssueLabelFlags(requiredFlags = '', { cli = 'gh' }
(slot) => !required.includes(slot.slice('[--label '.length, -1))
);
const line = [required.trim(), ...slots].filter(Boolean).join(' ');
- return cli === 'glab' ? line.replace(LABEL_FLAG_SEPARATOR_RE, '$1::') : line;
+ return line.replace(LABEL_FLAG_RE, (_match, prefix, label) => prefix + forgeLabelName(label, { cli }));
}
const MODEL_SET = new Set(DISPATCH_MODEL_TIERS);
@@ -360,7 +367,7 @@ export function dispatchHintFromLabels(labels) {
if (typeof label !== 'string') continue;
// Canonicalized first: a GitLab tracker hands back the scoped `model::heavy`
// spelling, and reading only the GitHub form would report it as unlabeled.
- const canonical = canonicalLabelName(label);
+ const canonical = forgeLabelName(label);
if (canonical.startsWith('model:')) model = normalizeDispatchModel(canonical.slice('model:'.length)) || model;
else if (canonical.startsWith('effort:')) effort = normalizeDispatchEffort(canonical.slice('effort:'.length)) || effort;
}
@@ -369,18 +376,18 @@ export function dispatchHintFromLabels(labels) {
/**
* Forge (GitHub/GitLab) label name for one axis, or null when the value is
- * unrecognized. `axis` is `'model'` or `'effort'`; `cli` picks the separator
- * (`model:heavy` on GitHub, the scoped `model::heavy` on GitLab).
+ * unrecognized. `axis` is `'model'` or `'effort'`. Canonical (GitHub) form —
+ * `forgeIssueLabels` re-spells the finished list for the forge it is filing to,
+ * so nothing between here and there has to carry a `cli`.
*/
-export function forgeDispatchLabel(axis, value, { cli = 'gh' } = {}) {
- const sep = labelSeparator(cli);
+export function forgeDispatchLabel(axis, value) {
if (axis === 'model') {
const tier = normalizeDispatchModel(value);
- return tier ? `model${sep}${tier}` : null;
+ return tier ? `model:${tier}` : null;
}
if (axis === 'effort') {
const level = normalizeDispatchEffort(value);
- return level ? `effort${sep}${level}` : null;
+ return level ? `effort:${level}` : null;
}
return null;
}
@@ -398,8 +405,8 @@ export function jiraDispatchLabel(axis, value) {
* Valid forge labels for the supplied hints, omitting any unjustified axis.
* Never invents a default; never derives one axis from the other.
*/
-export function forgeDispatchLabels({ model, effort, cli = 'gh' } = {}) {
- return [forgeDispatchLabel('model', model, { cli }), forgeDispatchLabel('effort', effort, { cli })].filter(Boolean);
+export function forgeDispatchLabels({ model, effort } = {}) {
+ return [forgeDispatchLabel('model', model), forgeDispatchLabel('effort', effort)].filter(Boolean);
}
/** Jira-safe equivalents of `forgeDispatchLabels`. */
@@ -502,13 +509,18 @@ export function formatVolunteerClaimCommands(issueRef, { cli = 'gh' } = {}) {
return [...creates, ...adds, ...formatContributorLabelReleaseCommands(issueRef, { cli })];
}
-/** Dispatch hints + contributor labels for one GitHub/GitLab issue. */
+/**
+ * Dispatch hints + contributor labels for one GitHub/GitLab issue, spelled for
+ * `cli` — this is the one place the forge's separator is applied to a filed
+ * label, so every axis above it stays in the canonical form its lookup tables
+ * are keyed by.
+ */
export function forgeIssueLabels({ model, effort, goodFirstIssue, helpWanted, planner, cli = 'gh' } = {}) {
return [
- ...forgeDispatchLabels({ model, effort, cli }),
+ ...forgeDispatchLabels({ model, effort }),
...forgeContributorLabels({ goodFirstIssue, helpWanted }),
- forgePlannerLabel(planner, { cli }),
- ].filter(Boolean);
+ forgePlannerLabel(planner),
+ ].filter(Boolean).map((name) => forgeLabelName(name, { cli }));
}
/** Dispatch hints + contributor labels for one Jira ticket. */
@@ -529,39 +541,33 @@ export function jiraIssueLabels({ model, effort, goodFirstIssue, helpWanted, pla
* for `cli` — which is what makes `formatLabelCreateCommand` create the label
* the issue will actually be filed with.
*/
+const LABEL_TABLES = Object.freeze([
+ [DISPATCH_LABEL_COLORS, DISPATCH_LABEL_DESCRIPTIONS],
+ [CONTRIBUTOR_LABEL_COLORS, CONTRIBUTOR_LABEL_DESCRIPTIONS],
+ [WORKFLOW_LABEL_COLORS, WORKFLOW_LABEL_DESCRIPTIONS],
+]);
+
export function dispatchLabelSpec(name, { cli = 'gh' } = {}) {
if (typeof name !== 'string') return null;
- const canonical = canonicalLabelName(name);
- const forgeName = forgeLabelName(name, { cli });
- if (DISPATCH_LABEL_COLORS[canonical]) {
- return {
- name: forgeName,
- color: DISPATCH_LABEL_COLORS[canonical],
- description: DISPATCH_LABEL_DESCRIPTIONS[canonical],
- };
- }
- if (CONTRIBUTOR_LABEL_COLORS[canonical]) {
- return {
- name: forgeName,
- color: CONTRIBUTOR_LABEL_COLORS[canonical],
- description: CONTRIBUTOR_LABEL_DESCRIPTIONS[canonical],
- };
- }
- if (WORKFLOW_LABEL_COLORS[canonical]) {
- return {
- name: forgeName,
- color: WORKFLOW_LABEL_COLORS[canonical],
- description: WORKFLOW_LABEL_DESCRIPTIONS[canonical],
- };
+ const canonical = forgeLabelName(name);
+ for (const [colors, descriptions] of LABEL_TABLES) {
+ if (colors[canonical]) {
+ return {
+ name: forgeLabelName(name, { cli }),
+ color: colors[canonical],
+ description: descriptions[canonical],
+ };
+ }
}
// Prefix-matched last: the planner axis has no enumerable table, so it must
// not shadow a fixed label that happens to start with the same characters.
- return plannerLabelSpec(name, { cli });
+ const planner = plannerLabelSpec(name);
+ return planner ? { ...planner, name: forgeLabelName(planner.name, { cli }) } : null;
}
-/** All slashdo dispatch-label specs, in axis-then-ramp order, spelled for `cli`. */
-export function allDispatchLabelSpecs({ cli = 'gh' } = {}) {
- return Object.keys(DISPATCH_LABEL_COLORS).map((name) => dispatchLabelSpec(name, { cli }));
+/** All slashdo dispatch-label specs, in axis-then-ramp order. */
+export function allDispatchLabelSpecs() {
+ return Object.keys(DISPATCH_LABEL_COLORS).map((name) => dispatchLabelSpec(name));
}
/**
@@ -731,7 +737,7 @@ export const REPO_STUDY_LABEL_CONTRACT = Object.freeze({
dispatchGuidance: MANDATORY_DISPATCH_HINT_GUIDANCE,
jiraDispatchGuidance: MANDATORY_JIRA_DISPATCH_HINT_GUIDANCE,
instructions: [
- '**Repo-study complete-label contract (mandatory):** every NEW proposal must carry `repo-study`, `plan`, at least one relevant `area:*`, exactly one justified model label (`model:*` on GitHub/GitLab, `model-*` on JIRA), and exactly one justified effort label (`effort:*` on GitHub/GitLab, `effort-*` on JIRA). The dispatch axes are independent: choose them from the inspected PortOS files and proposed implementation, never by stamping `medium` on both.',
+ '**Repo-study complete-label contract (mandatory):** every NEW proposal must carry `repo-study`, `plan`, at least one relevant `area:*`, exactly one justified model label (`model:*` on GitHub, `model::*` on GitLab, `model-*` on JIRA), and exactly one justified effort label (`effort:*` on GitHub, `effort::*` on GitLab, `effort-*` on JIRA). The dispatch axes are independent: choose them from the inspected PortOS files and proposed implementation, never by stamping `medium` on both.',
PORTOS_AREA_LABEL_GUIDANCE,
'If a proposal cannot be classified defensibly on all three axes, do not file that proposal; filing an incomplete issue is not a valid fallback. After each NEW issue, read its labels back and repair any missing required label before continuing; never relabel a duplicate you skipped. Contributor labels remain optional and must follow the shared guidance.',
].join('\n'),
@@ -750,7 +756,7 @@ export const REFERENCE_WATCH_LABEL_CONTRACT = Object.freeze({
dispatchGuidance: MANDATORY_DISPATCH_HINT_GUIDANCE,
jiraDispatchGuidance: MANDATORY_JIRA_DISPATCH_HINT_GUIDANCE,
instructions: [
- '**Reference-watch complete-label contract (mandatory):** every NEW proposal must carry `reference-watch`, `plan`, exactly one justified model label (`model:*` on GitHub/GitLab, `model-*` on JIRA), and exactly one justified effort label (`effort:*` on GitHub/GitLab, `effort-*` on JIRA). The dispatch axes are independent: choose them from the inspected reference diff and proposed implementation, never by stamping `medium` on both.',
+ '**Reference-watch complete-label contract (mandatory):** every NEW proposal must carry `reference-watch`, `plan`, exactly one justified model label (`model:*` on GitHub, `model::*` on GitLab, `model-*` on JIRA), and exactly one justified effort label (`effort:*` on GitHub, `effort::*` on GitLab, `effort-*` on JIRA). The dispatch axes are independent: choose them from the inspected reference diff and proposed implementation, never by stamping `medium` on both.',
'If a proposal cannot be classified defensibly on both axes, do not file it; filing an incomplete issue is not a valid fallback. After each NEW issue, read its labels back and repair any missing required label before continuing; never relabel a duplicate you skipped.',
].join('\n'),
});
@@ -760,7 +766,7 @@ export const GENERIC_REPO_STUDY_LABEL_CONTRACT = Object.freeze({
forgeFlags: '--label area:<area> --label model:<tier> --label effort:<level>',
jiraFlags: '`area:<area>` + `model-<tier>` + `effort-<level>`',
instructions: [
- '**Repo-study complete-label contract (mandatory):** every NEW proposal must carry `repo-study`, `plan`, at least one relevant `area:*`, exactly one justified model label (`model:*` on GitHub/GitLab, `model-*` on JIRA), and exactly one justified effort label (`effort:*` on GitHub/GitLab, `effort-*` on JIRA). The dispatch axes are independent: choose them from the inspected target-app files and proposed implementation, never by stamping `medium` on both.',
+ '**Repo-study complete-label contract (mandatory):** every NEW proposal must carry `repo-study`, `plan`, at least one relevant `area:*`, exactly one justified model label (`model:*` on GitHub, `model::*` on GitLab, `model-*` on JIRA), and exactly one justified effort label (`effort:*` on GitHub, `effort::*` on GitLab, `effort-*` on JIRA). The dispatch axes are independent: choose them from the inspected target-app files and proposed implementation, never by stamping `medium` on both.',
'Scope labels (`area:*`) are required for repo-study issues. Inspect the target app\'s existing tracker labels and apply the narrowest relevant labels; create a genuinely missing, clearly scoped area label only when the tracker supports it.',
'If a proposal cannot be classified defensibly on all three axes, do not file that proposal; filing an incomplete issue is not a valid fallback. After each NEW issue, read its labels back and repair any missing required label before continuing; never relabel a duplicate you skipped. Contributor labels remain optional and must follow the shared guidance.',
].join('\n'),
diff --git a/server/lib/dispatchLabels.test.js b/server/lib/dispatchLabels.test.js
index 62e0327ec7..a3a2197af8 100644
--- a/server/lib/dispatchLabels.test.js
+++ b/server/lib/dispatchLabels.test.js
@@ -123,15 +123,22 @@ describe('forge vs Jira label formatting', () => {
// value per key at a time, which is exactly what these axes want. Filing
// `model:heavy` there produces an ordinary label instead, so an issue can end up
// carrying two conflicting tiers and `/do:next --model` stops matching it.
+ // `forgeIssueLabels` is the one place the forge's separator is applied, so the
+ // axis builders above it keep the canonical form their lookup tables are keyed
+ // by and nothing between them has to carry a `cli`.
it('spells every axis with GitLab\'s scoped separator on glab, and Jira stays colon-free', () => {
- expect(forgeDispatchLabel('model', 'light', { cli: 'glab' })).toBe('model::light');
- expect(forgeDispatchLabel('effort', 'max', { cli: 'glab' })).toBe('effort::max');
- expect(forgeDispatchLabels({ model: 'heavy', effort: 'low', cli: 'glab' }))
- .toEqual(['model::heavy', 'effort::low']);
expect(forgeIssueLabels({ model: 'light', planner: 'claude-opus-5', helpWanted: true, cli: 'glab' }))
.toEqual(['model::light', HELP_WANTED_LABEL, 'planner::opus-5']);
+ expect(forgeIssueLabels({ model: 'heavy', effort: 'low', cli: 'glab' }))
+ .toEqual(['model::heavy', 'effort::low']);
+ // A contributor label has no `key:value` shape, so it is passed through
+ // untouched rather than being mangled into a scoped label.
+ expect(forgeIssueLabels({ goodFirstIssue: true, cli: 'glab' })).toEqual([GOOD_FIRST_ISSUE_LABEL]);
// An explicit gh, and the default, both keep the single colon.
- expect(forgeDispatchLabel('model', 'light', { cli: 'gh' })).toBe('model:light');
+ expect(forgeIssueLabels({ model: 'heavy', effort: 'low', cli: 'gh' }))
+ .toEqual(['model:heavy', 'effort:low']);
+ expect(forgeIssueLabels({ model: 'heavy', effort: 'low' })).toEqual(['model:heavy', 'effort:low']);
+ expect(forgeDispatchLabel('model', 'light')).toBe('model:light');
expect(jiraDispatchLabel('model', 'heavy')).toBe('model-heavy');
});
diff --git a/server/lib/reviewerConfig.js b/server/lib/reviewerConfig.js
index 0911022a8e..593cbd5c67 100644
--- a/server/lib/reviewerConfig.js
+++ b/server/lib/reviewerConfig.js
@@ -61,12 +61,17 @@ export const NON_REVIEWER_VENDORS = Object.freeze({
export const REVIEWER_ALIASES = { gemini: 'antigravity', 'cursor-agent': 'cursor' };
export const DEFAULT_REVIEWER = 'copilot';
export const DEFAULT_REVIEWERS = [];
-// The one reviewer slashdo's `--reviewer-applies` actually reaches. Its loop
-// forces every other local CLI back to review-only (none of them ships an
-// enforceable write-isolated profile), and the flag is meaningless for the
-// cloud (`copilot`, `@login`) and non-agentic (`ollama`) paths — so a list
-// without codex emits no flag at all rather than a promise slashdo drops.
-export const APPLY_CAPABLE_REVIEWER = 'codex';
+// Reviewers slashdo's `--reviewer-applies` actually reaches. Its loop forces
+// every OTHER local CLI back to review-only and reverts what it wrote — codex is
+// the one with a verified write-isolated profile — and the flag is meaningless
+// for the cloud (`copilot`, `@login`) and non-agentic (`ollama`) paths, so a list
+// without one of these emits no flag rather than a promise slashdo drops.
+//
+// A roster plus a predicate, like every other capability axis in this file
+// (LOCAL_LLM_REVIEWERS, MODEL_CAPABLE_CLI_REVIEWERS, …): slashdo granting a
+// second reviewer the editing pass is then one row, not an edit at every gate.
+export const APPLY_CAPABLE_REVIEWERS = Object.freeze(['codex']);
+export const isApplyCapableReviewer = (slug) => APPLY_CAPABLE_REVIEWERS.includes(slug);
// Reviewers that resolve to a local-LLM backend (rather than a CLI or GitHub
// bot). Used by the code-review endpoint, settings panel, and prompt builder
// to gate model-id resolution.
@@ -1258,7 +1263,8 @@ export function buildReviewersCsv(reviewers, usernames = [], optionalReviewers =
* Usernames are appended as `@user` tokens after the keyed reviewers.
* - `--review-stop-on-*` only when the effective list is 2+ (stop-mode is
* meaningless for one).
- * - `--reviewer-applies` only when `codex` is in the emitted list. slashdo's loop
+ * - `--reviewer-applies` only when an `APPLY_CAPABLE_REVIEWERS` slug (`codex`) is in
+ * the emitted list. slashdo's loop
* forces every OTHER local reviewer (`claude`/`agy`/`grok`/`pi`/`cursor`/
* `opencode`) back to review-only — codex is the one reviewer with a verified
* write-isolated profile — and the flag is a no-op on `copilot`, `@login`
@@ -1327,8 +1333,9 @@ export function buildReviewWithArgs(reviewers, {
const isDefaultOnly = configured.length === 1 && configured[0] === DEFAULT_REVIEWER
&& !optSet.has(DEFAULT_REVIEWER) && maxLookup.get(DEFAULT_REVIEWER) === undefined
&& effortLookup.get(DEFAULT_REVIEWER) === undefined;
- // The only reviewer `--reviewer-applies` reaches — see the doc comment above.
- const hasApplyCapableReviewer = combined.includes(APPLY_CAPABLE_REVIEWER);
+ // Keyed by resolved SLUG, like every other per-reviewer lookup in this function,
+ // so a bracketed or suffixed token cannot slip past the comparison.
+ const hasApplyCapableReviewer = combined.some(t => isApplyCapableReviewer(reviewerTokenSlug(t)));
const parts = [];
// Nothing slashdo can parse (a list of PortOS-only reviewers): emit no flag at
// all rather than a bare `--review-with`.
diff --git a/server/lib/reviewerConfig.test.js b/server/lib/reviewerConfig.test.js
index 7ca259a034..058dca8cf2 100644
--- a/server/lib/reviewerConfig.test.js
+++ b/server/lib/reviewerConfig.test.js
@@ -11,7 +11,8 @@ import {
REVIEWER_VALUES,
EFFORT_SELECTABLE_REVIEWERS,
MODEL_CAPABLE_CLI_REVIEWERS,
- APPLY_CAPABLE_REVIEWER,
+ APPLY_CAPABLE_REVIEWERS,
+ isApplyCapableReviewer,
MODEL_SELECTABLE_REVIEWERS,
NON_REVIEWER_VENDORS,
pairReviewerModelsAndEfforts,
@@ -450,10 +451,14 @@ describe('client mirror of the reviewer vocabulary', () => {
// gates the emitted flag on it. Drift shows the toggle for a reviewer whose
// editing pass slashdo would force back to review-only, or hides it from the one
// reviewer the flag reaches.
- it('matches the server apply-capable reviewer', async () => {
+ it('matches the server apply-capable roster', async () => {
const client = await import('../../client/src/lib/reviewerPins.js');
- expect(client.APPLY_CAPABLE_REVIEWER).toBe(APPLY_CAPABLE_REVIEWER);
- expect(REVIEWER_VALUES).toContain(APPLY_CAPABLE_REVIEWER);
+ expect([...client.APPLY_CAPABLE_REVIEWERS].sort()).toEqual([...APPLY_CAPABLE_REVIEWERS].sort());
+ for (const slug of REVIEWER_VALUES) {
+ expect(client.isApplyCapableReviewer(slug), slug).toBe(isApplyCapableReviewer(slug));
+ }
+ // Every apply-capable slug is a reviewer the picker can actually offer.
+ for (const slug of APPLY_CAPABLE_REVIEWERS) expect(REVIEWER_VALUES).toContain(slug);
});
// The roster itself. A reviewer added on one side only is the `antigravity`
diff --git a/server/services/branchReconcile.js b/server/services/branchReconcile.js
index a567252ac8..2ac59a6b4e 100644
--- a/server/services/branchReconcile.js
+++ b/server/services/branchReconcile.js
@@ -32,6 +32,7 @@ import { execGh, ensureForgeReachable, getIssueDispatchHint } from './github.js'
import { resolveForgeExecOptions } from './forgeExecOptions.js';
import { isForgeNoAccessError, logForgeNoAccessOnce } from '../lib/forgeAccessErrors.js';
import { issueNumberFromRef } from './issueReconcile.js';
+import { forgeDispatchLabels } from '../lib/dispatchLabels.js';
import { getOriginInfo } from '../lib/gitRemote.js';
import { githubRepoSpec, githubApiHost } from '../lib/workTracker.js';
import { safeJSONParse, PATHS } from '../lib/fileUtils.js';
@@ -1504,7 +1505,10 @@ async function dispatchHintLineForBranch(branchName, repoPath) {
if (!issueNumber) return '';
const hint = await getIssueDispatchHint(issueNumber, { cwd: repoPath }).catch(() => ({ status: 'unavailable', model: null, effort: null }));
if (hint.status !== 'known' || (!hint.model && !hint.effort)) return '';
- const parts = [hint.model ? `model:${hint.model}` : null, hint.effort ? `effort:${hint.effort}` : null].filter(Boolean);
+ // Rendered from the shared vocabulary rather than hand-spelled, so this line
+ // cannot drift from the labels a filer writes (and picks up the forge separator
+ // for free the day getIssueDispatchHint grows a glab arm).
+ const parts = forgeDispatchLabels({ model: hint.model, effort: hint.effort });
return `- Recommended dispatch (issue #${issueNumber}'s labels): ${parts.join(', ')} — run this branch's work at that capability/effort.`;
}
diff --git a/server/services/persistentMindIssueCapability.js b/server/services/persistentMindIssueCapability.js
index ad39356d2d..c746027598 100644
--- a/server/services/persistentMindIssueCapability.js
+++ b/server/services/persistentMindIssueCapability.js
@@ -27,6 +27,7 @@ import {
dispatchLabelSpec, forgeIssueLabels, resolvePlannerId,
} from '../lib/dispatchLabels.js';
import { forgeIssueCreateArgs, forgeLabelCreateArgs, parseCreatedForgeIssue } from '../lib/forgeIssueCli.js';
+import { forgeCliForTracker } from '../lib/workTracker.js';
import { boundedByJsonChars } from '../lib/objects.js';
import { boundedErrorMessage } from '../lib/errorHandler.js';
import { scrubHomePath } from '../lib/homePath.js';
@@ -63,13 +64,6 @@ const MAX_CATALOG_PROMPT_CHARS = 2_000;
*/
const scrubForgeText = (value) => scrubSecretTokens(scrubHomePath(value));
-/**
- * Which CLI dialect an app's tracker speaks — and, through `dispatchLabelSpec` /
- * `forgeIssueLabels`, which separator its prefixed labels are spelled with
- * (`model:heavy` on GitHub, GitLab's scoped `model::heavy`).
- */
-const forgeCli = (app) => (app.forge === 'gitlab' ? 'glab' : 'gh');
-
const labelSpec = (name, cli) => dispatchLabelSpec(name, { cli })
|| (PERSISTENT_MIND_ISSUE_EXTRA_LABEL_SPECS[name]
? { name, ...PERSISTENT_MIND_ISSUE_EXTRA_LABEL_SPECS[name] }
@@ -182,20 +176,22 @@ export async function listPersistentMindIssues(args) {
* rather than adding a serial spawn per label to every file.
*/
const ensureLabels = async ({ app, names }) => {
+ const cli = forgeCliForTracker(app.forge);
await Promise.all(names.map((name) => {
- const spec = labelSpec(name, forgeCli(app));
+ const spec = labelSpec(name, cli);
if (!spec) return null;
- return (app.forge === 'gitlab'
- ? execGlab(forgeLabelCreateArgs('glab', spec), app.repoPath)
- : execGh(forgeLabelCreateArgs('gh', spec, { repo: app.repoSpec }))).catch(() => null);
+ return (cli === 'glab'
+ ? execGlab(forgeLabelCreateArgs(cli, spec), app.repoPath)
+ : execGh(forgeLabelCreateArgs(cli, spec, { repo: app.repoSpec }))).catch(() => null);
}));
};
const createIssue = ({ app, title, body, labels }) => {
- const args = forgeIssueCreateArgs(app.forge === 'gitlab' ? 'glab' : 'gh', {
- title, body, labels, repo: app.forge === 'gitlab' ? null : app.repoSpec,
+ const cli = forgeCliForTracker(app.forge);
+ const args = forgeIssueCreateArgs(cli, {
+ title, body, labels, repo: cli === 'glab' ? null : app.repoSpec,
});
- const run = app.forge === 'gitlab'
+ const run = cli === 'glab'
? execGlab(args, app.repoPath, undefined, { rejectOnError: true })
: execGh(args);
return run.then(
@@ -246,7 +242,7 @@ export async function filePersistentMindIssue(args) {
const labels = [
PERSISTENT_MIND_ISSUE_LABEL,
...forgeIssueLabels({
- cli: forgeCli(app),
+ cli: forgeCliForTracker(app.forge),
model: args.model,
effort: args.effort,
// The planner axis records who WROTE the plan — this mind's own model —
diff --git a/server/services/persistentMindIssueCapability.test.js b/server/services/persistentMindIssueCapability.test.js
index bb0bd6d58f..3d26b5c44a 100644
--- a/server/services/persistentMindIssueCapability.test.js
+++ b/server/services/persistentMindIssueCapability.test.js
@@ -14,7 +14,11 @@ const mocks = vi.hoisted(() => ({
vi.mock('./cosState.js', () => ({ loadState: vi.fn(async () => mocks.root) }));
vi.mock('./apps.js', () => ({ getActiveApps: vi.fn(async () => mocks.apps) }));
vi.mock('./appIssues.js', () => ({ listAppIssues: (...args) => mocks.listAppIssues(...args) }));
-vi.mock('../lib/workTracker.js', () => ({
+// `resolveAppForgeTarget` is doubled; `forgeCliForTracker` is a pure mapper the
+// code under test relies on for real (it decides the forge's label separator),
+// so it passes through rather than being stubbed into a second definition.
+vi.mock('../lib/workTracker.js', async (importOriginal) => ({
+ ...(await importOriginal()),
resolveAppForgeTarget: (...args) => mocks.resolveAppForgeTarget(...args),
}));
vi.mock('./github.js', () => ({
diff --git a/server/services/promptSections/reviewLifecycle.js b/server/services/promptSections/reviewLifecycle.js
index 58d82a6bb2..134181ffa3 100644
--- a/server/services/promptSections/reviewLifecycle.js
+++ b/server/services/promptSections/reviewLifecycle.js
@@ -171,12 +171,6 @@ function resolveReviewRoster(metadata, { reviewerPositions = [] } = {}) {
// leaves slashdo's built-in per-loop default; `0` means "loop until clean".
const reviewerMaxRounds = normalizeReviewerMaxRounds(metadata.reviewLoopReviewerMaxRounds) || {};
const stopMode = metadata.reviewLoopStopMode || DEFAULT_REVIEW_STOP_MODE;
- // A reviewer consuming public PR/MR content never receives write authority.
- // The orchestrator applies independently validated findings in a later step.
- // This is deliberately stricter than slashdo, whose loop grants an editing
- // pass to `codex` alone — so the rendered note only ever states the off case,
- // and `metadata.reviewLoopReviewerApplies` cannot turn it on.
- const reviewerApplies = false;
const hasCopilot = reviewers.includes(DEFAULT_REVIEWER);
const hasLocalLlm = reviewers.some(r => isToolFreeReviewer(r));
// Spawnable-CLI reviewers, in configured order.
@@ -276,9 +270,14 @@ function resolveReviewRoster(metadata, { reviewerPositions = [] } = {}) {
...reviewers.filter(isOptionalReviewer).map(reviewer => `\`${reviewer}\``),
...usernames.filter(username => isOptionalReviewer(`@${username}`)).map(username => `\`@${username}\``),
];
- const equivArgs = buildReviewWithArgs(reviewers, { stopMode, reviewerApplies, usernames, optionalReviewers, reviewerMaxRounds, reviewerModels: reviewerModelMap });
+ // `reviewerApplies: false`, always: a reviewer consuming public PR/MR content
+ // never receives write authority, and the orchestrator applies independently
+ // validated findings in a later step. Deliberately stricter than slashdo, whose
+ // loop grants an editing pass to `codex` alone — so the rendered note only ever
+ // states the off case, and `metadata.reviewLoopReviewerApplies` cannot turn it on.
+ const equivArgs = buildReviewWithArgs(reviewers, { stopMode, reviewerApplies: false, usernames, optionalReviewers, reviewerMaxRounds, reviewerModels: reviewerModelMap });
return {
- usernames, reviewers, reviewerMaxRounds, stopMode, reviewerApplies,
+ usernames, reviewers, reviewerMaxRounds, stopMode,
reviewerModelMap, reviewerEffortMap, hasCopilot, hasLocalLlm, hasCli, hasGithubUser,
cliReviewers, cliBinaries, cliReviewerHeading, cliBinaryNote, reviewerPinNote, multi,
configuredReviewerPositions, reviewerPositionLabel, optionalConfiguredReviewers,
@@ -729,7 +728,7 @@ export function buildReviewLoopFollowUpSection(metadata = {}, { verbose = false,
sourceTaskId, localPhaseReviewers: localPhaseReviewerList, localPhaseCanShortCircuit, localPhaseReviewRequired,
});
const {
- usernames, reviewers, reviewerMaxRounds, stopMode, reviewerApplies,
+ usernames, reviewers, reviewerMaxRounds, stopMode,
reviewerModelMap, reviewerEffortMap, hasCopilot, hasLocalLlm, hasCli, hasGithubUser,
cliReviewers, cliBinaries, cliReviewerHeading, cliBinaryNote, reviewerPinNote, multi,
requiredCliBinaries, optionalCliBinaries, reviewerLabel, optionalConfiguredReviewers,
diff --git a/server/services/taskPromptDefaults/integrity.snapshot.json b/server/services/taskPromptDefaults/integrity.snapshot.json
index 1bead928fe..690430ecaf 100644
--- a/server/services/taskPromptDefaults/integrity.snapshot.json
+++ b/server/services/taskPromptDefaults/integrity.snapshot.json
@@ -11,7 +11,7 @@
"branch-cleanup": "8fdeb4acc2749816a47ca318b6602721",
"branch-reconcile": "45feea1d5ccd456bb0bec5d12c373a64",
"claim-issue": "729e4c7e0d25f8c9e668727658bcb5b0",
- "claim-issue-gitlab": "ba2389fe761653408e14eca697b5bfd7",
+ "claim-issue-gitlab": "749049f3c7e214379d516ed002a71e04",
"claim-issue-jira": "84843e8068d75fa023b4ed85b8df9239",
"code-quality": "6762542233cdffb86d4e2244945bf52b",
"code-reviewer-implement": "2e10cac7c1e1cd021d06bfddb5c1eaf2",
diff --git a/server/services/taskPromptDefaults/prompts.js b/server/services/taskPromptDefaults/prompts.js
index 9574a0bc92..4601db9894 100644
--- a/server/services/taskPromptDefaults/prompts.js
+++ b/server/services/taskPromptDefaults/prompts.js
@@ -2365,7 +2365,7 @@ Same contract as the GitHub flow: an undecomposed epic is work, not a dead end.
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. 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}\`. 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.
+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 (GitLab scoped labels — double colon).
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.