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: declare each slashdo workflow's deliverable so report-shaped runs stop failing as idle-no-changes (#3636)

[._.]/ Adam Eivy6af53fc6d954
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index 400ccef4c9..ca930abb17 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -23,3 +23,5 @@
- A CoS task whose agent spawn is **rejected by the runner** is now requeued immediately instead of being penalized for it. The runner-rejection path finalized the agent but never transitioned the task, so it sat `in_progress` holding its federation claim until the 15-minute orphan sweep — a path meant for genuine orphans, which charged one of the task's finite `orphanRetryCount` retries and armed a 30-minute cooldown for a failure the task did not cause (the agent never started; a momentarily unreachable runner was enough). It now runs the same `finalizeAgent` → `releaseRetryHold` chain the TUI path does, under its own `spawn-rejected` reason, so the task returns to `pending` with its claim released the moment the rejection lands and the runner's actual error is on the agent record.
- A failed X profile read no longer reads as "you are shadowbanned." The reach diagnostic settles the X SPA for a moment and only throws on an origin mismatch, so a page that rate-limited, rendered late, or returned an app shell resolved *successfully* with an empty profile — and all three visibility checks persisted as hard `false` while `last_error` was cleared, presenting a confident "your profile is not public, you do not appear in search, you have no recent posts" verdict produced by a read that simply failed. That is the one conclusion the feature exists to avoid drawing. Each of the three reads is now scored on its own evidence: a page that did not render yields `null` for its checks (shown as the warning-toned "Unknown", with a per-check hint to re-run) and names itself in a plain-language last error instead of clearing it. A page that read fine and did not match still reports `false`, and a positive search hit stays `true` on its own evidence even when a sibling read came back blank.
+
+- CoS agents whose deliverable is a **report** are no longer scored as failures either. `/do:plan-task`, `/do:replan`, `/do:review` and `/do:scan` file an issue or print a report and are explicitly told to write no code, so they reach the idle reaper with a clean tree and no commit — the exact shape the reaper calls `idle-no-changes`. Widening the evidence probe to count in-run commits fixed only the commit-shaped half. Each launchable slashdo workflow now declares its deliverable on its catalog entry: the six that land a commit keep the clean-tree gate armed, and the four report-shaped ones carry `worktreeChangesExpected: false` and opt out of it, the same escape hatch a `reference-watch` run against a forge tracker already uses. `/do:next` still defers to the work tracker its claim flow actually resolved.
diff --git a/server/lib/README.md b/server/lib/README.md
index a6581c1348..d70df126bf 100644
--- a/server/lib/README.md
+++ b/server/lib/README.md
@@ -318,7 +318,7 @@ The barrel `server/lib/index.js` is a machine-checkable enumeration of every pub
| `prDisposition.js` | `resolvePrCompletion(metadata)` resolves the explicit `review-then-merge` / `merge-on-green` / `leave-open` policy, with legacy `reviewLoop` fallback; `leavesPrForHuman(task)` + `PR_STAYS_OPEN_TASK_TYPES` keep JIRA hand-offs open. Shared by the agent prompt builder and `agentWorktreeCleanup` so both halves agree. |
| `shellQuote.js` | `shellQuote(value)` — POSIX single-quote escaping for values interpolated into shell command strings (display command lines, copy-paste blocks in agent prompts). Bare-safe tokens pass through; everything else is single-quoted. Canonical escaper — don't hand-roll. |
| `sidecarProcess.js` | `runSidecarProcess({bin,args,env,signal,onStage,onProcess})` + `parseSidecarResult(stdout)` — the shared Python-sidecar STAGE:/RESULT: wire-protocol runner (spawn, tail-capped stdout/stderr, per-STAGE-line callback, abort/SIGTERM → `canceled`, non-zero exit → stderr-tail reason). Used by `pipeline/musicGen.js` (all music backends) and `audioMidiTranscription.js` (MuScriptor). |
-| `slashdoCatalog.js` | The single catalog of which bundled slashdo workflows PortOS offers as a one-click agent run — `SLASHDO_WORKFLOWS` (`{command, label, description, icon, templateName, templatePrompt?, settings, appTypes, configurable?}`), `getSlashdoWorkflow()` (the allowlist gate for `POST /api/cos/tasks/slashdo`), `SLASHDO_COMMAND_NAMES`, `slashdoWorkflowsForApp(isSwiftApp)`, `SLASHDO_APP_TYPES`, and `WORKFLOW_OWNS_ITS_OWN_GIT` (the shared run-shape defaults). Backs the Agent Operations buttons, the CoS quick templates (`taskTemplates.js`), and the route allowlist, replacing two catalogs that had drifted. Mirrored in `client/src/lib/slashdoCatalog.js` (button styling only), pinned by `slashdoCatalog.test.js`. |
+| `slashdoCatalog.js` | The single catalog of which bundled slashdo workflows PortOS offers as a one-click agent run — `SLASHDO_WORKFLOWS` (`{command, label, description, icon, templateName, templatePrompt?, settings, appTypes, configurable?}`), `getSlashdoWorkflow()` (the allowlist gate for `POST /api/cos/tasks/slashdo`), `SLASHDO_COMMAND_NAMES`, `slashdoWorkflowsForApp(isSwiftApp)`, `SLASHDO_APP_TYPES`, and the two run-shape postures `WORKFLOW_OWNS_ITS_OWN_GIT` (commit-shaped) / `WORKFLOW_REPORTS_NO_CODE` (report-shaped — carries `worktreeChangesExpected: false` so the TUI idle reaper does not score a filed-issue/printed-report run as `idle-no-changes`). Backs the Agent Operations buttons, the CoS quick templates (`taskTemplates.js`), and the route allowlist, replacing two catalogs that had drifted. Mirrored in `client/src/lib/slashdoCatalog.js` (button styling only), pinned by `slashdoCatalog.test.js`. |
| `slashdoInvocation.js` | Resolves how a bundled slashdo workflow is invoked on a given host CLI. `resolveSlashdoInvocation({command, args, providerId, providerCommand, leanMode})` → `{command, args, style, invocation, skillName}` for the three shapes slashdo's installer produces (`slash-namespaced` `/do:x` for Claude Code, `slash-flat` `/do-x` for OpenCode, `skill` — an Agent Skill selected by name — for codex/grok/antigravity and any unidentified provider). Plus `buildSlashdoSection(resolved, body, {bodyPath, reviewWith})` (pure renderer; the caller loads the body via `loadSlashdoFile`. Over `SLASHDO_INLINE_BUDGET_CHARS` (24,000) with a `bodyPath` it emits a filesystem pointer instead of the text — #3110), `unreachableReviewerIncludes({reviewers, usernames})` → the reviewer-variant lib includes a run can never reach (the `skipIncludes` set for `loadSlashdoFile`; defaults to pruning NOTHING for an unresolved/unrecognized reviewer set, since an over-pruned prompt is worse than a fat one), `SLASHDO_REVIEWER_INCLUDES`/`SLASHDO_REVIEWER_INCLUDE_NAMES`, `slashdoSkillName`, `isValidSlashdoCommand` (the one definition of the safe bare-command shape, also gating the Zod schemas), and `canTypeSlashCommands()` — the single predicate behind `agentPromptBuilder.js`'s completion-workflow gates (can this session TYPE `/do:pr` / `/simplify`?), which reads `resolveSlashdoStyle`'s `assumeClaudeWhenUnknown` posture because the spawners resolve a blank command to `claude`. Provider is only known at spawn time, so a task persists the BARE command name — never a rendered `/do:x` string. |
| `slashdoLoader.js` | Loads bundled slashdo command/lib markdown (`lib/slashdo/` submodule) and resolves it the way slashdo's own per-environment installer would, since PortOS inlines these bodies into CoS-agent prompts WITHOUT running that installer. `loadSlashdoFile(cmd, {stripFrontmatter, skipIncludes})` / `loadSlashdoLib(name, {teams})` resolve the `` !`cat ~/.claude/lib/…` `` includes + `if:teams` conditionals, with `skipIncludes` pruning lib includes the run can never reach (each leaves a one-line "not applicable" marker — #3110); `writeResolvedSlashdoBody(cmd, body, {skipIncludes})` → absolute path, writing the already-loaded body under `PATHS.slashdoResolved` (`data/cos/slashdo-resolved/`, gitignored derived cache) at most once per (command, body) per process, so a file-tool host can be handed a path instead of a 250KB paste. Split out of `fileUtils.js` (a generic file-utilities module) as its own feature module — pairs with `slashdoInvocation.js`, which resolves how a workflow is TYPED per host CLI rather than how its body is loaded. |
| `singleFlight.js` | `createSingleFlight()` → `run(key, fn)` — keyed in-flight coalescer: concurrent calls for the same key share one `fn()` execution and result; the slot auto-clears on settle. Minimal by design (no TTL/result cache layered on top, doesn't reject concurrent callers). Used by `promptRunner.js`'s fallback mark-and-pick. |
diff --git a/server/lib/slashdoCatalog.js b/server/lib/slashdoCatalog.js
index 391dbcf81b..623c868215 100644
--- a/server/lib/slashdoCatalog.js
+++ b/server/lib/slashdoCatalog.js
@@ -21,8 +21,8 @@
* workflow for this host", this one answers "which workflows can be launched".
*/
-/**
- * The run-shape defaults every catalog entry implies. All ten workflows set
+/*
+ * The run-shape defaults a catalog entry implies. All ten workflows set
* `useWorktree`/`openPR`/`simplify` to false, for two distinct reasons:
* - plan-task / replan / review / scan write no code at all, so there is
* nothing to isolate, PR, or simplify.
@@ -31,8 +31,32 @@
* and `release` must run from `main` in the primary checkout.
* A key absent from `settings` means "leave the current toggle alone" (the
* absent-vs-empty rule) — it does NOT mean false.
+ *
+ * The two postures below differ ONLY in `worktreeChangesExpected`, which declares
+ * the workflow's DELIVERABLE (#3636). The TUI idle reaper fails a run as
+ * `idle-no-changes` when the worktree is clean and no commit landed during the
+ * run (`worktreeHasWorkEvidence`), so a workflow whose output never touches the
+ * repo has to opt out — the reaper cannot see a filed issue or a printed report.
+ */
+
+/**
+ * Commit-shaped workflows: `next` / `better` / `better-swift` / `depfree` /
+ * `release` / `push` land a commit (usually behind their own PR), so the
+ * reaper's evidence probe covers them and the clean-tree gate stays armed.
+ */
+export const WORKFLOW_OWNS_ITS_OWN_GIT = Object.freeze({
+ useWorktree: false, openPR: false, simplify: false, worktreeChangesExpected: true,
+});
+
+/**
+ * Report-shaped workflows: `plan-task` / `replan` / `review` / `scan` deliver a
+ * filed issue or a printed report and write no code at all. A clean tree IS
+ * their success shape, so they opt out of the clean-tree gate the way
+ * `reference-watch` against a non-file work tracker already does (#3102).
*/
-export const WORKFLOW_OWNS_ITS_OWN_GIT = Object.freeze({ useWorktree: false, openPR: false, simplify: false });
+export const WORKFLOW_REPORTS_NO_CODE = Object.freeze({
+ useWorktree: false, openPR: false, simplify: false, worktreeChangesExpected: false,
+});
/** App-type gates for the Agent Operations buttons. */
export const SLASHDO_APP_TYPES = Object.freeze({
@@ -53,7 +77,9 @@ export const SLASHDO_APP_TYPES = Object.freeze({
* @property {string} [templatePrompt] - trailing fragment appended to the
* template's description when the workflow needs a user-typed target
* (`Safety scan of: `). Absent ⇒ the description stands alone.
- * @property {Object} settings - implied run-shape toggles (see WORKFLOW_OWNS_ITS_OWN_GIT)
+ * @property {Object} settings - implied run-shape toggles; exactly one of
+ * WORKFLOW_OWNS_ITS_OWN_GIT (commit-shaped) or WORKFLOW_REPORTS_NO_CODE
+ * (report-shaped), per the workflow's deliverable
* @property {string} appTypes - one of SLASHDO_APP_TYPES; gates the button only
* @property {boolean} [configurable] - the button opens the run-settings drawer
* instead of queuing immediately
@@ -69,7 +95,7 @@ export const SLASHDO_WORKFLOWS = Object.freeze([
icon: '📋',
templateName: 'Plan a Task',
templatePrompt: 'Investigate and file a decision-complete issue for: ',
- settings: WORKFLOW_OWNS_ITS_OWN_GIT,
+ settings: WORKFLOW_REPORTS_NO_CODE,
appTypes: SLASHDO_APP_TYPES.ANY,
},
{
@@ -92,7 +118,7 @@ export const SLASHDO_WORKFLOWS = Object.freeze([
description: 'Audit the backlog, archive completed items, prune stale work',
icon: '🗺️',
templateName: 'Replan Backlog',
- settings: WORKFLOW_OWNS_ITS_OWN_GIT,
+ settings: WORKFLOW_REPORTS_NO_CODE,
appTypes: SLASHDO_APP_TYPES.ANY,
},
{
@@ -102,7 +128,7 @@ export const SLASHDO_WORKFLOWS = Object.freeze([
description: 'Deep code review of the changed files',
icon: '🔍',
templateName: 'Review Changes',
- settings: WORKFLOW_OWNS_ITS_OWN_GIT,
+ settings: WORKFLOW_REPORTS_NO_CODE,
appTypes: SLASHDO_APP_TYPES.ANY,
},
{
@@ -163,7 +189,7 @@ export const SLASHDO_WORKFLOWS = Object.freeze([
icon: '🔒',
templateName: 'Safety Scan',
templatePrompt: 'Read-only safety audit of: ',
- settings: WORKFLOW_OWNS_ITS_OWN_GIT,
+ settings: WORKFLOW_REPORTS_NO_CODE,
appTypes: SLASHDO_APP_TYPES.ANY,
},
]);
diff --git a/server/lib/slashdoCatalog.test.js b/server/lib/slashdoCatalog.test.js
index 4feaf23588..9729fbcddf 100644
--- a/server/lib/slashdoCatalog.test.js
+++ b/server/lib/slashdoCatalog.test.js
@@ -6,11 +6,13 @@ import {
SLASHDO_COMMAND_NAMES,
SLASHDO_WORKFLOWS,
WORKFLOW_OWNS_ITS_OWN_GIT,
+ WORKFLOW_REPORTS_NO_CODE,
getSlashdoWorkflow,
slashdoWorkflowAppliesTo,
slashdoWorkflowsForApp,
} from './slashdoCatalog.js';
import { isValidSlashdoCommand, SLASHDO_NAMESPACE } from './slashdoInvocation.js';
+import { sanitizeTaskMetadata } from './cosValidation.js';
import { PATHS } from './fileUtils.js';
describe('SLASHDO_WORKFLOWS', () => {
@@ -22,11 +24,46 @@ describe('SLASHDO_WORKFLOWS', () => {
expect(w.detail).toBeTruthy();
expect(w.icon).toBeTruthy();
expect(w.templateName).toBeTruthy();
- expect(w.settings).toBe(WORKFLOW_OWNS_ITS_OWN_GIT);
+ expect([WORKFLOW_OWNS_ITS_OWN_GIT, WORKFLOW_REPORTS_NO_CODE]).toContain(w.settings);
expect(Object.values(SLASHDO_APP_TYPES)).toContain(w.appTypes);
}
});
+ // #3636: the posture a workflow carries declares its DELIVERABLE. The TUI idle
+ // reaper fails a clean-tree, no-commit run as `idle-no-changes`, which is
+ // correct for the six that land a commit and wrong for the four whose output is
+ // a filed issue or a printed report — the reaper cannot see either. Pinned
+ // per-command (not derived) so adding a workflow forces the author to decide.
+ it('carries the posture matching each workflow deliverable', () => {
+ const REPORT_SHAPED = new Set(['plan-task', 'replan', 'review', 'scan']);
+ for (const w of SLASHDO_WORKFLOWS) {
+ const expected = REPORT_SHAPED.has(w.command) ? WORKFLOW_REPORTS_NO_CODE : WORKFLOW_OWNS_ITS_OWN_GIT;
+ expect(w.settings, `${w.command} posture`).toBe(expected);
+ }
+ // Every command is classified — a new entry can't slip in unconsidered.
+ expect(SLASHDO_COMMAND_NAMES.filter(c => REPORT_SHAPED.has(c)).length).toBe(REPORT_SHAPED.size);
+ });
+
+ it('keeps the two postures differing only in worktreeChangesExpected', () => {
+ expect(WORKFLOW_OWNS_ITS_OWN_GIT).toEqual({
+ useWorktree: false, openPR: false, simplify: false, worktreeChangesExpected: true,
+ });
+ expect(WORKFLOW_REPORTS_NO_CODE).toEqual({
+ useWorktree: false, openPR: false, simplify: false, worktreeChangesExpected: false,
+ });
+ expect(Object.isFrozen(WORKFLOW_OWNS_ITS_OWN_GIT)).toBe(true);
+ expect(Object.isFrozen(WORKFLOW_REPORTS_NO_CODE)).toBe(true);
+ });
+
+ // The key must survive sanitizeTaskMetadata (#3102) or the posture is inert by
+ // the time the task is stored.
+ it('carries a worktreeChangesExpected value sanitizeTaskMetadata accepts', () => {
+ for (const posture of [WORKFLOW_OWNS_ITS_OWN_GIT, WORKFLOW_REPORTS_NO_CODE]) {
+ expect(sanitizeTaskMetadata({ worktreeChangesExpected: posture.worktreeChangesExpected }))
+ .toEqual({ worktreeChangesExpected: posture.worktreeChangesExpected });
+ }
+ });
+
it('has no duplicate commands', () => {
expect(new Set(SLASHDO_COMMAND_NAMES).size).toBe(SLASHDO_COMMAND_NAMES.length);
});
diff --git a/server/routes/cos.test.js b/server/routes/cos.test.js
index 55a0b05a8b..a26f93d23b 100644
--- a/server/routes/cos.test.js
+++ b/server/routes/cos.test.js
@@ -949,6 +949,31 @@ describe('CoS Routes', () => {
expect(loadSlashdoCommand).not.toHaveBeenCalled();
});
+ // #3636: the catalog posture's `worktreeChangesExpected` must reach the task,
+ // or the TUI idle reaper scores a report-shaped run's clean tree as
+ // `idle-no-changes` — exactly the failure the commit-probe widening left
+ // behind for plan-task / replan / review / scan.
+ it.each([
+ ['plan-task', false],
+ ['replan', false],
+ ['review', false],
+ ['scan', false],
+ ['push', true],
+ ['release', true],
+ ['better', true],
+ ['depfree', true]
+ ])('threads the catalog deliverable posture — %s ⇒ worktreeChangesExpected %s', async (command, expected) => {
+ getAppById.mockResolvedValue({ id: 'my-app', name: 'MyApp', type: 'web', repoPath: '/repo' });
+ cos.addTask.mockResolvedValue({ id: `task-wce-${command}`, status: 'pending' });
+
+ const response = await request(app)
+ .post('/api/cos/tasks/slashdo')
+ .send({ command, app: 'my-app' });
+
+ expect(response.status).toBe(200);
+ expect(cos.addTask.mock.calls.at(-1)[0].worktreeChangesExpected).toBe(expected);
+ });
+
it('queues the SwiftUI audit for a Swift app', async () => {
getAppById.mockResolvedValue({ id: 'my-ios', name: 'MyPhone', type: 'ios-native', repoPath: '/repo' });
cos.addTask.mockResolvedValue({ id: 'task-sd-swift', status: 'pending' });
@@ -1020,6 +1045,50 @@ describe('CoS Routes', () => {
expect(taskData.description).not.toContain('/do:');
});
+ // `next` is commit-shaped in the catalog, but the claim flow resolves the
+ // app's actual work tracker — a forge tracker files its outcome outside the
+ // repo, so its `worktreeChangesExpected` must override the catalog default
+ // rather than be masked by it (#3636).
+ it('lets the claim flow work-tracker posture override the catalog default for next', async () => {
+ getAppById.mockResolvedValue({ id: 'my-app', name: 'MyApp', repoPath: '/repo' });
+ buildClaimWorkTask.mockResolvedValue({
+ tracker: 'github',
+ source: 'config',
+ promptTaskType: 'claim-issue',
+ prompt: 'CLAIM ISSUE PROMPT',
+ taskMetadata: { useWorktree: false, openPR: false, worktreeChangesExpected: false }
+ });
+ cos.addTask.mockResolvedValue({ id: 'task-sd-next-wce', status: 'pending' });
+
+ const response = await request(app)
+ .post('/api/cos/tasks/slashdo')
+ .send({ command: 'next', app: 'my-app' });
+
+ expect(response.status).toBe(200);
+ expect(cos.addTask.mock.calls.at(-1)[0].worktreeChangesExpected).toBe(false);
+ });
+
+ // …and when the claim flow says nothing, the catalog's commit-shaped default
+ // stands, so a `/do:next` that shipped a PR still needs its commit evidence.
+ it('falls back to the catalog commit-shaped default when the claim flow omits the key', async () => {
+ getAppById.mockResolvedValue({ id: 'my-app', name: 'MyApp', repoPath: '/repo' });
+ buildClaimWorkTask.mockResolvedValue({
+ tracker: 'plan',
+ source: 'config',
+ promptTaskType: 'claim-work',
+ prompt: 'CLAIM PLAN PROMPT',
+ taskMetadata: { useWorktree: false, openPR: false }
+ });
+ cos.addTask.mockResolvedValue({ id: 'task-sd-next-default', status: 'pending' });
+
+ const response = await request(app)
+ .post('/api/cos/tasks/slashdo')
+ .send({ command: 'next', app: 'my-app' });
+
+ expect(response.status).toBe(200);
+ expect(cos.addTask.mock.calls.at(-1)[0].worktreeChangesExpected).toBe(true);
+ });
+
it('threads the run drawer settings — target/author-filter/reviewers into the claim prompt, provider/model/effort/simplify onto the task', async () => {
getAppById.mockResolvedValue({ id: 'my-app', name: 'MyApp', repoPath: '/repo' });
buildClaimWorkTask.mockResolvedValue({
diff --git a/server/routes/cosTaskRoutes.js b/server/routes/cosTaskRoutes.js
index e5d3b4be4f..467e84cf39 100644
--- a/server/routes/cosTaskRoutes.js
+++ b/server/routes/cosTaskRoutes.js
@@ -166,10 +166,15 @@ router.post('/tasks/slashdo', asyncHandler(async (req, res) => {
// the rendered string was wrong for it (#3089's whole point).
//
// `workflow.settings` is the catalog's run-shape posture (see
- // WORKFLOW_OWNS_ITS_OWN_GIT) — read from it rather than restating false/false,
- // so a future entry that genuinely wants a PortOS-managed worktree gets one.
- // `simplify` comes from the request (the run drawer's toggle), not the catalog.
- const { useWorktree, openPR } = workflow.settings;
+ // WORKFLOW_OWNS_ITS_OWN_GIT / WORKFLOW_REPORTS_NO_CODE) — read from it rather
+ // than restating false/false, so a future entry that genuinely wants a
+ // PortOS-managed worktree gets one. `worktreeChangesExpected` declares the
+ // workflow's deliverable: false for the report-shaped four (plan-task /
+ // replan / review / scan), whose output is a filed issue or a printed report,
+ // so the TUI idle reaper doesn't score their clean tree `idle-no-changes`
+ // (#3636). `simplify` comes from the request (the run drawer's toggle), not
+ // the catalog.
+ const { useWorktree, openPR, worktreeChangesExpected } = workflow.settings;
let shape;
if (command === 'next') {
const claim = await buildClaimWorkTask(appObj, { target, issueAuthorFilter, reviewers, usernames, optionalReviewers, reviewerMaxRounds, reviewerModels, reviewerEfforts });
@@ -183,14 +188,17 @@ router.post('/tasks/slashdo', asyncHandler(async (req, res) => {
// key. All current claim flows (plan-task / claim-issue / claim-issue-gitlab
// / claim-issue-jira) self-manage their worktree + MR/PR, so false/false
// stands; the spread stays for a future delegated type that needs
- // CoS-managed isolation.
- taskMetadata: { useWorktree, openPR, ...claim.taskMetadata },
+ // CoS-managed isolation. `worktreeChangesExpected` is one such key: the
+ // claim flow derives it from the app's RESOLVED work tracker (a file
+ // tracker commits its checklist, a forge tracker doesn't), which is more
+ // specific than the catalog's commit-shaped default, so the spread wins.
+ taskMetadata: { useWorktree, openPR, worktreeChangesExpected, ...claim.taskMetadata },
};
} else {
shape = {
description: `${workflow.label} for ${appObj.name} — ${workflow.description}`,
slashdoCommand: command,
- taskMetadata: { useWorktree, openPR },
+ taskMetadata: { useWorktree, openPR, worktreeChangesExpected },
};
}
diff --git a/server/services/taskTemplates.test.js b/server/services/taskTemplates.test.js
index 9783a455c1..b02f533983 100644
--- a/server/services/taskTemplates.test.js
+++ b/server/services/taskTemplates.test.js
@@ -24,7 +24,7 @@ vi.mock('fs', () => ({
}));
// Not mocked — the shared launchable-workflow catalog is a pure constant list.
-const { SLASHDO_COMMAND_NAMES } = await import('../lib/slashdoCatalog.js');
+const { SLASHDO_COMMAND_NAMES, getSlashdoWorkflow } = await import('../lib/slashdoCatalog.js');
// Import after mocking
const { readJSONFile } = await import('../lib/fileUtils.js');
@@ -257,7 +257,14 @@ describe('taskTemplates service', () => {
// Every one of these either writes no code at all or manages its own
// worktree/PR, so none of them want PortOS to wrap another one around it.
for (const t of slashdo) {
- expect(t.settings).toEqual({ useWorktree: false, openPR: false, simplify: false });
+ expect(t.settings).toMatchObject({ useWorktree: false, openPR: false, simplify: false });
+ }
+ // …and each carries the catalog's deliverable posture verbatim (#3636), so
+ // the template surface can't quietly drop `worktreeChangesExpected` the way
+ // a hand-copied settings literal would. Which command gets which posture is
+ // pinned in `slashdoCatalog.test.js`; here we only assert the pass-through.
+ for (const t of slashdo) {
+ expect(t.settings).toBe(getSlashdoWorkflow(t.slashdoCommand).settings);
}
// The BARE command name is what is stored — a rendered `/do:x` string
// would be Claude-only, and the provider is unknown at pick time.