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

fix: reject speculative scheduled issue proposals (#4099)

[._.]/ Adam Eivy27856f127fba
diff --git a/.changelog/next/changed-issue-4099.md b/.changelog/next/changed-issue-4099.md
new file mode 100644
index 0000000000..93d4aa1d01
--- /dev/null
+++ b/.changelog/next/changed-issue-4099.md
@@ -0,0 +1 @@
+- Scheduled issue planners now reject speculative future-only refactors while retaining worthwhile current refactors.
diff --git a/server/lib/README.md b/server/lib/README.md
index 29fc4d6c96..c72388767d 100644
--- a/server/lib/README.md
+++ b/server/lib/README.md
@@ -343,7 +343,7 @@ The barrel `server/lib/index.js` is a machine-checkable enumeration of every pub
| `asyncMutex.js` | Promise-based async mutex. |
| `authGate.js` | Express + Socket.IO middleware that gates `/api/*` and `/data/*` behind the password set in `settings.secrets.auth`. No-op when auth is off; emits 401 `AUTH_REQUIRED` (or plain text for `/data/*`) when on and the request has no valid session token. Consults `apiRegistry.isRegistryPublic` so an exposed+passwordless API (voice/sdapi) bypasses the gate on its public prefix only. |
| `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 `huggingFaceCatalog.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: `model:light/medium/heavy` + `effort:low/medium/high/xhigh/max` vocabulary, prescribed forge colors, validation (`normalizeDispatchModel` / `normalizeDispatchEffort`), GitHub/GitLab vs Jira label formatting, optional contributor labels (`good first issue` / `help wanted`, never implied by `model:light`), lazy-create command text, and the shared `DISPATCH_HINT_GUIDANCE` / `JIRA_DISPATCH_HINT_GUIDANCE` prose. Omit an unjustified axis; never invent `medium`. Consumed by work-tracker instructions, quota-burn audits, Layered Intelligence filing, and claim follow-up prompts. |
+| `dispatchLabels.js` | slashdo dispatch-hint contract: `model:light/medium/heavy` + `effort:low/medium/high/xhigh/max` vocabulary, prescribed forge colors, validation (`normalizeDispatchModel` / `normalizeDispatchEffort`), GitHub/GitLab vs Jira label formatting, optional contributor labels (`good first issue` / `help wanted`, never implied by `model:light`), lazy-create command text, and shared dispatch plus issue-quality guidance (`ISSUE_QUALITY_GUIDANCE`, `DISPATCH_HINT_GUIDANCE`, `JIRA_DISPATCH_HINT_GUIDANCE`). Omit an unjustified axis; 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`. |
| `errorHandler.js` | `ServerError` + `asyncHandler` middleware, plus `sendErrorResponse`/`buildErrorEnvelope` for the standard `{ error, code, timestamp }` body outside a handler's catch. |
diff --git a/server/lib/dispatchLabels.js b/server/lib/dispatchLabels.js
index 460428174d..86d5f36168 100644
--- a/server/lib/dispatchLabels.js
+++ b/server/lib/dispatchLabels.js
@@ -205,6 +205,15 @@ export function formatRepeatedLabelFlags(labels = []) {
.join(' ');
}
+/**
+ * Shared quality gate for any scheduled planner that files tracker work.
+ * This deliberately allows worthwhile refactors while rejecting proposals whose
+ * only justification is a possible future trigger or a speculative abstraction.
+ */
+export const ISSUE_QUALITY_GUIDANCE = [
+ 'Issue-quality gate: File current, evidenced work with impact and a chosen fix. Drop future-only/speculative refactors; current refactors that pay off now are valid.',
+].join('\n');
+
/**
* Standing guidance for any planner that files GitHub/GitLab issues. Used in
* tracker-filing instructions, quota-burn audits, claim follow-ups, and the
@@ -221,6 +230,7 @@ export const DISPATCH_HINT_GUIDANCE = [
'- `help wanted` (color 008672) — extra hands welcome and the body is scoped enough to pick up cold.',
'Create those two with the same `gh` / `glab label create` form as the dispatch hints (quote the name; glab still needs `--name` and `#<hex>`).',
'Use repeated `--label` flags (one per label). Preserve existing category/scope labels (`plan`, `ux`, `bug`, `tests`, `layered-intelligence`, …). Never relabel a deduplicated existing issue.',
+ ISSUE_QUALITY_GUIDANCE,
].join('\n');
/**
@@ -235,6 +245,7 @@ export const JIRA_DISPATCH_HINT_GUIDANCE = [
'Choose each axis only when the work you just inspected justifies it. Omit an axis rather than guessing. Do NOT stamp `medium` on both by reflex, and do NOT put `[model-…]` / `[effort-…]` / `[category]` / `[SEVERITY]` in the summary — those belong in labels.',
'Also apply contributor labels when the work actually fits them — independently of the dispatch axes: `good-first-issue` (self-contained, a new contributor can ship it) and `help-wanted` (extra hands welcome, scoped enough to pick up cold). A `model-light` 40-file sweep is NOT a good-first-issue.',
'Preserve existing category/scope labels. Never relabel a ticket you skipped as a duplicate.',
+ ISSUE_QUALITY_GUIDANCE,
].join('\n');
/**
diff --git a/server/lib/dispatchLabels.test.js b/server/lib/dispatchLabels.test.js
index 3d8ab75d8f..edab71ce85 100644
--- a/server/lib/dispatchLabels.test.js
+++ b/server/lib/dispatchLabels.test.js
@@ -3,6 +3,7 @@ import {
DISPATCH_MODEL_TIERS,
DISPATCH_EFFORT_LEVELS,
DISPATCH_LABEL_COLORS,
+ ISSUE_QUALITY_GUIDANCE,
DISPATCH_HINT_GUIDANCE,
JIRA_DISPATCH_HINT_GUIDANCE,
PORTOS_AREA_LABELS,
@@ -152,6 +153,9 @@ describe('label specs and CLI formatting', () => {
describe('shared guidance', () => {
it('names both vocabularies and the omit-rather-than-guess rule', () => {
+ expect(ISSUE_QUALITY_GUIDANCE).toContain('current, evidenced work');
+ expect(ISSUE_QUALITY_GUIDANCE).toContain('future-only/speculative refactors');
+ expect(ISSUE_QUALITY_GUIDANCE).toContain('current refactors that pay off now are valid');
expect(DISPATCH_HINT_GUIDANCE).toContain('model:light|medium|heavy');
expect(DISPATCH_HINT_GUIDANCE).toContain('effort:low|medium|high|xhigh|max');
expect(DISPATCH_HINT_GUIDANCE).toContain('Omit an axis rather than guessing');
@@ -162,10 +166,12 @@ describe('shared guidance', () => {
expect(DISPATCH_HINT_GUIDANCE).toContain('help wanted');
expect(DISPATCH_HINT_GUIDANCE).toContain('NOT a good first issue');
expect(DISPATCH_HINT_GUIDANCE).toContain('glab label create');
+ expect(DISPATCH_HINT_GUIDANCE).toContain('Issue-quality gate');
expect(JIRA_DISPATCH_HINT_GUIDANCE).toContain('model-light|model-medium|model-heavy');
expect(JIRA_DISPATCH_HINT_GUIDANCE).toContain('effort-low|effort-medium|effort-high|effort-xhigh|effort-max');
expect(JIRA_DISPATCH_HINT_GUIDANCE).toContain('good-first-issue');
expect(JIRA_DISPATCH_HINT_GUIDANCE).toContain('help-wanted');
+ expect(JIRA_DISPATCH_HINT_GUIDANCE).toContain('Issue-quality gate');
expect(JIRA_DISPATCH_HINT_GUIDANCE).not.toMatch(/model:light/);
});
diff --git a/server/lib/quotaBurnPresets.test.js b/server/lib/quotaBurnPresets.test.js
index c0c1ea0077..be1e6e0fc4 100644
--- a/server/lib/quotaBurnPresets.test.js
+++ b/server/lib/quotaBurnPresets.test.js
@@ -105,6 +105,8 @@ describe('QUOTA_BURN_PROMPT_PRESETS', () => {
expect(prompt).toContain('Do not relabel an existing issue');
expect(prompt).toContain('good first issue');
expect(prompt).toContain('help wanted');
+ expect(prompt).toContain('Issue-quality gate');
+ expect(prompt).toContain('current refactors that pay off now are valid');
}
});
});
diff --git a/server/lib/workTracker.trackerInstructions.test.js b/server/lib/workTracker.trackerInstructions.test.js
index b16da67d63..85376df46d 100644
--- a/server/lib/workTracker.trackerInstructions.test.js
+++ b/server/lib/workTracker.trackerInstructions.test.js
@@ -33,6 +33,8 @@ function expectForgeDispatchContract(block, { cli, issueLabel }) {
expect(block).toContain(`--label ${issueLabel} --label plan [--label model:<tier>] [--label effort:<level>] [--label "good first issue"] [--label "help wanted"]`);
expect(block).toContain('good first issue');
expect(block).toContain('Do not relabel');
+ expect(block).toContain('Issue-quality gate');
+ expect(block).toContain('current refactors that pay off now are valid');
expect(block).toContain('[category]');
if (cli === 'gh') {
expect(block).toContain(`gh label create ${issueLabel}`);
@@ -85,6 +87,7 @@ describe('formatTrackerInstructions — forge dispatch hints (#4351)', () => {
expect(jira).toContain('model-light|model-medium|model-heavy');
expect(jira).toContain('effort-low|effort-medium|effort-high|effort-xhigh|effort-max');
expect(jira).toContain('Do not relabel a ticket you skipped as a duplicate');
+ expect(jira).toContain('Issue-quality gate');
expect(jira).toContain('fall back to recording proposals in PLAN.md');
expect(formatTrackerInstructions('jira')).toBe(jira);
});
diff --git a/server/services/layeredIntelligence.playbook.md b/server/services/layeredIntelligence.playbook.md
index 55831c3772..fb24736c5f 100644
--- a/server/services/layeredIntelligence.playbook.md
+++ b/server/services/layeredIntelligence.playbook.md
@@ -82,6 +82,11 @@ not one of these:
when it is done. Narrow it or drop it.
- **Speculative "nice to have"** with no goal tie and no measured need. Costs the
user triage time and lowers your merge rate further.
+- **Future-triggered refactor.** Two similar call sites are not enough reason to
+ file an abstraction whose payoff starts only when a third consumer appears. If
+ the refactor pays off in the current code, file that concrete work; otherwise
+ return `proposal: null` and let a later run rediscover it when the evidence
+ changes.
- **Maps to a chronically-failing execution domain** (see the next section).
## 4. Task Type Selection Rules
diff --git a/server/services/layeredIntelligence.test.js b/server/services/layeredIntelligence.test.js
index af286f3eee..8e3ad2cbf3 100644
--- a/server/services/layeredIntelligence.test.js
+++ b/server/services/layeredIntelligence.test.js
@@ -1677,6 +1677,9 @@ describe('buildPrompt', () => {
expect(bare).toContain('Goal Alignment Check');
// NOT_PLANNED = roadmap conflict is the headline rejection heuristic.
expect(bare).toContain('NOT_PLANNED');
+ expect(bare).toContain('Future-triggered refactor');
+ expect(bare).toContain('third consumer appears');
+ expect(bare).toContain('return `proposal: null`');
// Rendered under its dedicated heading, never dumped as a generic source block.
expect(bare).toContain('apply it as a hard constraint');
});
diff --git a/server/services/taskPromptDefaults.test.js b/server/services/taskPromptDefaults.test.js
index 906c9f0811..08429e5763 100644
--- a/server/services/taskPromptDefaults.test.js
+++ b/server/services/taskPromptDefaults.test.js
@@ -111,6 +111,21 @@ describe('taskPromptDefaults integrity snapshot', () => {
expect(v9).not.toBe(current);
});
+ it('do-replan v2 rejects future-only proposals while preserving v1 for migration', () => {
+ const current = DEFAULT_TASK_PROMPTS['do-replan'];
+ expect(PROMPT_VERSIONS['do-replan']).toBe(2);
+ expect(current).toContain('Issue-quality gate');
+ expect(current).toContain('useful to do now');
+ expect(current).toContain('let a later audit rediscover it');
+ expect(current).toContain('A refactor is valid when current evidence shows it pays off now');
+
+ const previous = PREVIOUS_DEFAULT_PROMPTS['do-replan'];
+ const v1 = previous.find((prompt) => prompt.includes('Replan — Audit PLAN.md'));
+ expect(v1).toBeDefined();
+ expect(v1).not.toContain('Issue-quality gate');
+ expect(v1).not.toBe(current);
+ });
+
// claim-issue v7 / claim-issue-gitlab v6: Phase 3 no longer parks an *ambiguous*
// issue to `needs-input` and re-picks — the agent decides (picks the most
// reasonable reading, records it in an issue comment/note, ships) instead of
diff --git a/server/services/taskPromptDefaults/integrity.snapshot.json b/server/services/taskPromptDefaults/integrity.snapshot.json
index 6a8134d959..c4c6b8455a 100644
--- a/server/services/taskPromptDefaults/integrity.snapshot.json
+++ b/server/services/taskPromptDefaults/integrity.snapshot.json
@@ -22,7 +22,7 @@
"typing": "1f2758ce0bb62d789a21aec241549531",
"release-check": "746f11daaf721eae9e16845858ef55ee",
"jira-sprint-manager": "3e63c8a3bdf0d5a05a30faaa2dc07980",
- "do-replan": "59a57f1bb445138c30ab4fa23630c6f8",
+ "do-replan": "35660eb7b43e4259a6a9253ed288a1db",
"jira-status-report": "9d374a9d8ccb92c5c8fd0aa9899e79a5",
"branch-cleanup": "8fdeb4acc2749816a47ca318b6602721",
"branch-reconcile": "16479f4b64395103fd222dc9608830b1",
@@ -35,6 +35,7 @@
"refresh-local-llm-catalog": "ca7324a0f2251a66b46ea534940c9da8"
},
"PROMPT_VERSIONS": {
+ "do-replan": 2,
"feature-ideas": 10,
"plan-task": 14,
"claim-issue": 13,
@@ -62,6 +63,9 @@
},
"REFERENCE_WATCH_AUDITED_VERSION": 3,
"PREVIOUS_DEFAULT_PROMPTS": {
+ "do-replan": [
+ "59a57f1bb445138c30ab4fa23630c6f8"
+ ],
"feature-ideas": [
"d67a9028aeb8bb8348453951f878501b",
"c6a399399245872401666d5c67c716cc",
diff --git a/server/services/taskPromptDefaults/previousDefaults.js b/server/services/taskPromptDefaults/previousDefaults.js
index 65f785c129..5bbd32d9c4 100644
--- a/server/services/taskPromptDefaults/previousDefaults.js
+++ b/server/services/taskPromptDefaults/previousDefaults.js
@@ -15,6 +15,22 @@ import { PORTOS_API_URL } from '../../lib/ports.js';
// When a schedule has no promptVersion, we check if the stored prompt matches
// any known previous default. If so, it's safe to auto-upgrade (not user-customized).
export const PREVIOUS_DEFAULT_PROMPTS = {
+ 'do-replan': [
+ // v1 default prompt
+ `[Improvement: {appName}] Replan — Audit PLAN.md
+
+Run the project's \`/do:replan\` slashdo command for {appName} in autonomous (non-interactive) mode.
+
+Repository: {repoPath}
+
+The full \`/do:replan\` command body follows. Apply it to {repoPath} exactly as written, then commit any changes. Default mode is autonomous — do NOT prompt the user; run \`--interactive\` only if the user has explicitly asked for it (they have not).
+
+Scope: this task operates against the managed app's repository, NOT PortOS. All edits must land in {repoPath} (PLAN.md, GOALS.md, docs/, the changelog) — never write to PortOS itself.
+
+---
+
+{slashdoReplan}`,
+ ],
'feature-ideas': [
// v1 default prompt
`[Improvement: {appName}] Feature Review and Development
diff --git a/server/services/taskPromptDefaults/prompts.js b/server/services/taskPromptDefaults/prompts.js
index ff719ab29d..98243ce215 100644
--- a/server/services/taskPromptDefaults/prompts.js
+++ b/server/services/taskPromptDefaults/prompts.js
@@ -11,6 +11,16 @@
// PORTOS_API_URL is interpolated into the jira-status-report default prompt below.
import { PORTOS_API_URL } from '../../lib/ports.js';
+import { ISSUE_QUALITY_GUIDANCE } from '../../lib/dispatchLabels.js';
+
+const SCHEDULED_ISSUE_QUALITY_GATE = `## Scheduled issue-quality gate
+
+${ISSUE_QUALITY_GUIDANCE}
+
+Apply this gate to every new issue created by the scheduled replan, including
+items migrated from PLAN.md or GOALS.md and opportunity-scan suggestions. A
+proposal is valid only when it is useful to do now. A refactor is valid when current evidence shows it pays off now; a deferred possibility is not an issue.
+Return/drop it and let a later audit rediscover it when the evidence changes.`;
// ============================================================
// Unified DEFAULT_TASK_PROMPTS — one entry per scheduled task type / pipeline stage
@@ -1389,6 +1399,8 @@ The full \`/do:replan\` command body follows. Apply it to {repoPath} exactly as
Scope: this task operates against the managed app's repository, NOT PortOS. All edits must land in {repoPath} (PLAN.md, GOALS.md, docs/, the changelog) — never write to PortOS itself.
+${SCHEDULED_ISSUE_QUALITY_GATE}
+
---
{slashdoReplan}`,
diff --git a/server/services/taskPromptDefaults/versions.js b/server/services/taskPromptDefaults/versions.js
index a45a3b39eb..30818ba437 100644
--- a/server/services/taskPromptDefaults/versions.js
+++ b/server/services/taskPromptDefaults/versions.js
@@ -7,6 +7,7 @@
// Prompt versions — bump when a default prompt changes so existing instances auto-upgrade.
// Only non-customized prompts (promptCustomized !== true) are upgraded.
export const PROMPT_VERSIONS = {
+ 'do-replan': 2, // v2: scheduled issue-quality gate rejects speculative/future-only work and keeps valid current refactors claimable
'feature-ideas': 10, // v10: Phase 4 (Brainstorm) consults the repo's REJECTED.md and recently closed-unmerged PRs before proposing, so ideas the user already declined aren't re-proposed (mirrors idle-review's REJECTED.md contract). v9: drop DONE.md reads — use `.changelog/` + `git log` (last 50) as the completed-work signal
'plan-task': 14, // 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': 13, // 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)
diff --git a/server/services/taskSchedule.test.js b/server/services/taskSchedule.test.js
index 40caf19e4a..1b158050d5 100644
--- a/server/services/taskSchedule.test.js
+++ b/server/services/taskSchedule.test.js
@@ -307,6 +307,10 @@ describe('taskSchedule', () => {
expect(prompt).toContain('{appName}')
expect(prompt).toContain('{repoPath}')
expect(prompt).toContain('{slashdoReplan}')
+ expect(prompt).toContain('Issue-quality gate')
+ expect(prompt).toContain('useful to do now')
+ expect(prompt).toContain('let a later audit rediscover it')
+ expect(prompt).toContain('A refactor is valid when current evidence shows it pays off now')
})
})
@@ -423,6 +427,7 @@ describe('taskSchedule', () => {
// claim-issue-jira are router-reached prompts with no DEFAULT_TASK_INTERVALS
// entry, so their preservation is asserted in taskPromptDefaults.test.js instead.
it.each([
+ 'do-replan',
'documentation',
'plan-task',
'claim-issue',