Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
fix: preserve release workflow from dispatch through completion
[._.]/ Adam Eivyd73461552532
diff --git a/server/lib/README.md b/server/lib/README.mdindex 3cc2877119..a5625d0772 100644--- a/server/lib/README.md+++ b/server/lib/README.md@@ -243,7 +243,7 @@ The barrel `server/lib/index.js` is a machine-checkable enumeration of every pub| `callerModePolicy.js` | The one caller EXECUTION-MODE policy: `CALLER_MODE_POLICIES` (`agent-harness`, `cli-harness`, `direct-api`, `any-text`) plus `resolveCallerModePolicy` / `allowedModesFor` / `callerModeRejection` / `isCallerModeEligible` / `filterCallerModeEligible`. Answers "may THIS caller run on THAT route mode?" for an explicit pin, `activeProvider` inheritance and every fallback candidate alike — `allowedModesFor()` is what rides on `requestCapabilities.allowedModes` into the toolkit's `getFallbackProvider`. Pure and dependency-light so the out-of-process autofixer can import it; `enabled`/benched state, prerequisites and text-transport consent stay with their existing owners. Unknown never becomes true: a record with no executable mode, and a required model capability with no positive evidence, are both refused. || `cliChildEnv.js` | The one place the AI-CLI child environment is composed, replacing the hand-rolled copy every spawn site carried — which made each env-level fix an N-file sweep (#3194). `buildCliChildEnv({ baseEnv, before, provider, model, cwd, extra, guard })` returns a COMPLETE env for `spawn`: filters the inherited base to runtime essentials/provider auth, then layers `baseEnv → before → Ollama-Claude defaults → provider.envVars → buildOpencodeEnvVars → extra`, pins `PWD` to `cwd`, strips `CLAUDECODE`, and (with `guard: true`) prepends the pm2 guard shim onto the final `PATH`. The Ollama-Claude layer raises Claude Code's default output ceiling to 65,536 tokens so a thinking-capable local model cannot finish its reasoning past the stock 32K ceiling and die before its final tool call; an explicit provider env value wins. `composeProviderEnv({ before, provider, model, extra })` returns just the ordered provider layers, for sites that build a DELTA someone else bases and spawns (the CoS runner payload, a shell-session overlay). The two slots are not interchangeable: `before` sits UNDER `provider.envVars` (forgeTokenEnv/claudeSettingsEnv, so a provider override still wins), `extra` sits OVER it (TERM/COLORTERM for a PTY). `cliChildEnv.test.js` asserts the composed order per call site and **discovers** any new site that hand-rolls the tuple instead of calling these — so the call-site list stays in the test, not in prose here. || `agentExecutionProfiles.js` | Named agent execution postures shared by lifecycle dispatch, CLI/TUI spawners, and child-environment filtering. A stage declares a PROFILE (`PUBLIC_REVIEW_EXECUTION_PROFILE`, `PUBLIC_REVIEW_GATE_EXECUTION_PROFILE`, `PUBLIC_REVIEW_ACTIONS_EXECUTION_PROFILE`); `publicReviewPostureForProfile` maps it to the enforceable POSTURE a provider must carry a maintained recipe for (`no-tool` or `sandboxed-actions`), which is how a pipeline stage stays vendor-agnostic. |-| `agentCompletionMode.js` | The ONE completion-contract decision behind every agent prompt: `resolveCompletionMode(flags)` returns a single `COMPLETION_MODES` key (`tool-free`, `sentinel-payload`, `action-output`, `discard-worktree`, `claim-flow`, `read-only`, `review-loop-follow-up`, `tui-slashdo-free`, `tui`, `portos-merges`, `worktree-no-push`, `commit-and-push`) from an ordered rule list, plus `portosMergesBranchOnExit`. Replaces the five independent flag ladders in `agentPromptBuilder.js` that each re-derived it in a different order — two had drifted far enough to render a prompt telling a tool-free or read-only task both to commit and that it had no git at all (#6616). Call sites branch on the key and render per mode; they never re-test the flags. |+| `agentCompletionMode.js` | The ONE completion-contract decision behind every agent prompt: `resolveCompletionMode(flags)` returns a single `COMPLETION_MODES` key (`tool-free`, `sentinel-payload`, `action-output`, `discard-worktree`, `claim-flow`, `read-only`, `review-loop-follow-up`, `release-flow`, `tui-slashdo-free`, `tui`, `portos-merges`, `worktree-no-push`, `commit-and-push`) from an ordered rule list, plus `portosMergesBranchOnExit`. Replaces the five independent flag ladders in `agentPromptBuilder.js` that each re-derived it in a different order — two had drifted far enough to render a prompt telling a tool-free or read-only task both to commit and that it had no git at all (#6616). Call sites branch on the key and render per mode; they never re-test the flags. || `localEndpoint.js` | Dependency-light local-instance URL predicates (`isLocalInstanceHost`, `isLocalInstanceEndpoint`, `localEndpointPort`) shared by provider safety policy and local-runtime classification without importing backend configuration or daemon managers. || `cliProviderArgs.js` | Per-CLI argv conventions (`buildCliArgs`) for stdin prompt delivery — dependency-light extraction from runner.js so out-of-process callers (autofixer) can import it. || `cliProviderRun.js` | One-shot CLI provider invocation (`pickCliProvider` + `runCliProviderPrompt`) — lightweight path for the autofixer + calendar MCP sync to honor the configured provider/model. Optional `safetyProfile` runs only maintained no-tool vendor recipes and composes the same restricted environment, refusing extra argv and unsupported providers. |diff --git a/server/lib/agentCompletionMode.js b/server/lib/agentCompletionMode.jsindex 2cb72a00d8..f1e742752f 100644--- a/server/lib/agentCompletionMode.js+++ b/server/lib/agentCompletionMode.js@@ -65,6 +65,8 @@ export const COMPLETION_MODES = Object.freeze({READ_ONLY: 'read-only',/** Pushes fixes straight to an existing PR branch; opens no new PR. */REVIEW_LOOP_FOLLOW_UP: 'review-loop-follow-up',+ /** The bundled release workflow owns delivery and final verification. */+ RELEASE_FLOW: 'release-flow',/** TUI host that cannot type a `/do:*` command — commit, then hand off. */TUI_SLASHDO_FREE: 'tui-slashdo-free',/** TUI host that drives its own `/do:pr` | `/do:push` completion workflow. */@@ -108,6 +110,7 @@ const COMPLETION_MODE_RULES = Object.freeze([[COMPLETION_MODES.CLAIM_FLOW, (f) => f.claimFlow],[COMPLETION_MODES.READ_ONLY, (f) => f.isReadOnly],[COMPLETION_MODES.REVIEW_LOOP_FOLLOW_UP, (f) => f.isReviewLoopFollowUp],+ [COMPLETION_MODES.RELEASE_FLOW, (f) => f.slashdoCommand === 'release'],[COMPLETION_MODES.TUI_SLASHDO_FREE, (f) => f.isTui && !f.canRunSlashCommands],[COMPLETION_MODES.TUI, (f) => f.isTui],[COMPLETION_MODES.PORTOS_MERGES, (f) => f.portosMergesBranch],@@ -125,6 +128,7 @@ const COMPLETION_MODE_RULES = Object.freeze([* @param {boolean} [flags.claimFlow]* @param {boolean} [flags.isReadOnly]* @param {boolean} [flags.isReviewLoopFollowUp]+ * @param {string} [flags.slashdoCommand]* @param {boolean} [flags.isTui]* @param {boolean} [flags.canRunSlashCommands] - Defaults to `true`; only a TUI* host that demonstrably cannot type `/do:*` takes the slashdo-free contract.diff --git a/server/lib/agentCompletionMode.test.js b/server/lib/agentCompletionMode.test.jsindex e2172119ce..c5e5c26827 100644--- a/server/lib/agentCompletionMode.test.js+++ b/server/lib/agentCompletionMode.test.js@@ -80,6 +80,7 @@ describe('resolveCompletionMode', () => {resolveCompletionMode({ claimFlow: true }),resolveCompletionMode({ isReadOnly: true }),resolveCompletionMode({ isReviewLoopFollowUp: true }),+ resolveCompletionMode({ slashdoCommand: 'release' }),resolveCompletionMode({ isTui: true, canRunSlashCommands: false }),resolveCompletionMode({ isTui: true }),resolveCompletionMode({ worktreeInfo: wt, willOpenPR: false }),diff --git a/server/lib/cosValidation.js b/server/lib/cosValidation.jsindex ee2c8da494..5a0410b7ba 100644--- a/server/lib/cosValidation.js+++ b/server/lib/cosValidation.js@@ -1030,6 +1030,15 @@ export function sanitizeTaskMetadata(raw) {clean.prCompletion = raw.prCompletion;hasKeys = true;}+ // Schedule dispatch must preserve the workflow and its reviewer pin. Reuse+ // the task-input schemas so command paths and argument bounds stay identical.+ for (const key of ['slashdoCommand', 'slashdoArgs']) {+ const parsed = createCosTaskSchema.shape[key].safeParse(raw[key]);+ if (parsed.success && parsed.data !== undefined) {+ clean[key] = parsed.data;+ hasKeys = true;+ }+ }// `reviewer` is a legacy single constrained string.const normalizedReviewer = REVIEWER_ALIASES[raw.reviewer] || raw.reviewer;if (Object.prototype.hasOwnProperty.call(raw, 'reviewer') && isReviewer(normalizedReviewer)) {diff --git a/server/lib/cosValidation.test.js b/server/lib/cosValidation.test.jsindex 60eb7faa10..fcc5f5449b 100644--- a/server/lib/cosValidation.test.js+++ b/server/lib/cosValidation.test.js@@ -336,3 +336,12 @@ describe('cosValidation job shell-only fields cleared on an agent job', () => {expect(updateCosJobSchema.safeParse({ triggerAction: 42 }).success).toBe(false);});});++describe('scheduled slashdo metadata', () => {+ it('preserves the validated command and exact reviewer arguments through sanitization', () => {+ const metadata = { slashdoCommand: 'release', slashdoArgs: '--review-with codex[gpt-6-astra]~opt~max=1~effort=low' };+ expect(sanitizeTaskMetadata(metadata)).toEqual(metadata);+ expect(sanitizeTaskMetadata({ slashdoCommand: '../../release', slashdoArgs: 42 })).toBeNull();+ expect(sanitizeTaskMetadata({ slashdoArgs: 'x'.repeat(4001) })).toBeNull();+ });+});diff --git a/server/services/agentPromptBuilder.js b/server/services/agentPromptBuilder.jsindex 02ed989795..b2c0e45d10 100644--- a/server/services/agentPromptBuilder.js+++ b/server/services/agentPromptBuilder.js@@ -38,6 +38,7 @@ import {buildActionOutputCompletionSection,buildAuditOutputCompletionSection,buildClaimFlowCompletionSection,+ buildReleaseFlowCompletionSection,buildCliCompletionSection,buildCompletionGuidelineBullet,buildFallbackCompletionInstructions,@@ -455,27 +456,6 @@ export async function buildAgentPrompt(task, config, workspaceDir, worktreeInfo// below; the flag is read up here because it is an input to the mode decision.const isReviewLoopFollowUp = isTruthyMetaFn(task.metadata?.reviewLoopFollowUp);const isWorktreeOnExistingBranch = isPrBranchWorktree(task, worktreeInfo);- const worktreeCommitNote = worktreeInfo- ? worktreeCommitGuidance({- isTui,- canTypeSlashCommands: false,- rendersInlinePrLifecycle: false,- isWorktreeOnExistingBranch,- willOpenPR,- discardWorktree,- claimFlow,- noChangeSuccess,- })- : '';- const worktreeSection = worktreeInfo ? `-## Git Worktree Context-You are working in an **isolated git worktree** to avoid conflicts with other agents working concurrently.-- **Branch**: \`${worktreeInfo.branchName}\`${isWorktreeOnExistingBranch ? ' *(pre-existing PR branch)*' : ''}-- **Worktree Path**: \`${worktreeInfo.worktreePath}\`-${worktreeInfo.baseBranch ? `- **Based on**: \`${worktreeInfo.baseBranch}\` (latest from origin)` : ''}--**Important**: ${worktreeCommitNote} Do NOT manually switch branches or modify the worktree configuration.-${buildResumeSection(task, worktreeInfo)}` : '';// Build pipeline context section if this is a pipeline stageconst pipelineCtx = task.metadata?.pipeline;@@ -501,10 +481,6 @@ ${buildResumeSection(task, worktreeInfo)}` : '';const canRunSlashCommands = canTypeSlashCommands({providerId, providerCommand, leanMode, assumeClaudeWhenUnknown: false,});- const simplifySection = buildSimplifySection({- canRunSlashCommands, simplifyEnabled, isTui, discardWorktree, claimFlow,- worktreeInfo, willOpenPR, portosMergesBranch,- });// Resolve the user's ordered reviewer list + flags (task metadata wins; else the// install's configured Code Review Defaults; else `[]`). Declared up here@@ -550,7 +526,34 @@ ${buildResumeSection(task, worktreeInfo)}` : '';const completionMode = resolveCompletionMode({toolFreeReasoning, sentinelPayloadOutput, noCodeOutput, discardWorktree, claimFlow,isReadOnly, isReviewLoopFollowUp, isTui, canRunSlashCommands, portosMergesBranch,- worktreeInfo, willOpenPR,+ worktreeInfo, willOpenPR, slashdoCommand: task.metadata?.slashdoCommand,+ });+ const worktreeCommitNote = worktreeInfo+ ? worktreeCommitGuidance({+ isTui,+ mode: completionMode,+ canTypeSlashCommands: false,+ rendersInlinePrLifecycle: false,+ isWorktreeOnExistingBranch,+ willOpenPR,+ discardWorktree,+ claimFlow,+ noChangeSuccess,+ })+ : '';+ const worktreeSection = worktreeInfo ? `+## Git Worktree Context+You are working in an **isolated git worktree** to avoid conflicts with other agents working concurrently.+- **Branch**: \`${worktreeInfo.branchName}\`${isWorktreeOnExistingBranch ? ' *(pre-existing PR branch)*' : ''}+- **Worktree Path**: \`${worktreeInfo.worktreePath}\`+${worktreeInfo.baseBranch ? `- **Based on**: \`${worktreeInfo.baseBranch}\` (latest from origin)` : ''}++**Important**: ${worktreeCommitNote} ${completionMode === COMPLETION_MODES.RELEASE_FLOW ? 'Follow the release workflow branch instructions while preserving unrelated work.' : 'Do NOT manually switch branches or modify the worktree configuration.'}+${buildResumeSection(task, worktreeInfo)}` : '';++ const simplifySection = buildSimplifySection({+ mode: completionMode, canRunSlashCommands, simplifyEnabled, isTui, discardWorktree, claimFlow,+ worktreeInfo, willOpenPR, portosMergesBranch,});// Step 4, the Git Hygiene bullet and the commit-target bullet as ONE record,// so the three cannot contradict each other the way they did (#6616).@@ -602,6 +605,7 @@ ${buildResumeSection(task, worktreeInfo)}` : '';[COMPLETION_MODES.CLAIM_FLOW]: () => buildClaimFlowCompletionSection({isTui, sentinelPath, reviewersCsv: claimReviewersCsv(task, codeReviewDefaults, defaultReviewers),}),+ [COMPLETION_MODES.RELEASE_FLOW]: () => buildReleaseFlowCompletionSection({ isTui, sentinelPath }),[COMPLETION_MODES.TUI_SLASHDO_FREE]: buildFullPathTuiCompletion,[COMPLETION_MODES.TUI]: buildFullPathTuiCompletion,}[completionMode] || (() => ''))();@@ -704,14 +708,14 @@ async function loadDeveloperContext(task, config, workspaceDir, skipDevContext)* describing the same pass. Empty for the contracts that never commit.*/function buildSimplifySection({- canRunSlashCommands, simplifyEnabled, isTui, discardWorktree, claimFlow,+ mode, canRunSlashCommands, simplifyEnabled, isTui, discardWorktree, claimFlow,worktreeInfo, willOpenPR, portosMergesBranch,}) {const simplifyInstruction = canRunSlashCommands? 'run `/simplify` to review the changed code for reuse, quality, and efficiency': SIMPLIFY_INLINE_REVIEW;// Discard tasks don't commit, so the simplify-before-commit step is moot.- const simplifySection = simplifyEnabled && !isTui && !discardWorktree && !claimFlow ? `+ const simplifySection = mode !== COMPLETION_MODES.RELEASE_FLOW && simplifyEnabled && !isTui && !discardWorktree && !claimFlow ? `## Simplify StepAfter completing your work and before committing, ${simplifyInstruction}. Fix any issues found, then ${worktreeInfo && willOpenPR ? 'commit your changes (do NOT push — on a successful run the system will push and open the PR after you exit; if the run fails, no push or PR happens)' : portosMergesBranch ? 'commit your changes (do NOT push — PortOS merges this branch back into the source checkout after you exit; a pushed copy would only be left behind on origin)' : 'commit and push using `/do:push`'}.` : '';@@ -1007,7 +1011,7 @@ function buildLightContextSections(task, workspaceDir, worktreeInfo, isTruthyMetconst completionMode = resolveCompletionMode({toolFreeReasoning, sentinelPayloadOutput, noCodeOutput, discardWorktree, claimFlow,isReadOnly, isReviewLoopFollowUp, isTui, canRunSlashCommands: canTypeSlash,- portosMergesBranch, worktreeInfo, willOpenPR,+ portosMergesBranch, worktreeInfo, willOpenPR, slashdoCommand: task.metadata?.slashdoCommand,});// Does this session drive commit → push → PR → review → merge itself?//@@ -1017,7 +1021,7 @@ function buildLightContextSections(task, workspaceDir, worktreeInfo, isTruthyMet// a JIRA run be told to open a PR whose merge section was suppressed — and// PortOS opened that PR too. `inlineSection` also names WHICH section follows,// so the completion step's cross-reference can't name the wrong one.- const inlineSection = claimFlow ? null : inlinePrLifecycleSection(task, {+ const inlineSection = claimFlow || completionMode === COMPLETION_MODES.RELEASE_FLOW ? null : inlinePrLifecycleSection(task, {providerType: isTui ? PROVIDER_TYPES.TUI : PROVIDER_TYPES.CLI,providerId, providerCommand, leanMode, worktreeInfo, isTruthyMetaFn,});@@ -1148,6 +1152,7 @@ function buildLightContextSections(task, workspaceDir, worktreeInfo, isTruthyMet...buildSentinelWriteSteps(1, lightSentinelPath(), sentinelTail)].join('\n'));},+ [COMPLETION_MODES.RELEASE_FLOW]: () => contractSections.push(buildReleaseFlowCompletionSection({ isTui, sentinelPath: lightSentinelPath() })),[COMPLETION_MODES.TUI_SLASHDO_FREE]: pushTuiCompletion,[COMPLETION_MODES.TUI]: pushTuiCompletion,}[completionMode] || pushCliCompletion)();@@ -1210,7 +1215,9 @@ function buildLightTaskContextSections({worktreeInfo.baseBranch ? `- **Based on**: \`${worktreeInfo.baseBranch}\`` : null,'',worktreeCommitGuidance({ isTui, mode, canTypeSlashCommands, rendersInlinePrLifecycle, isWorktreeOnExistingBranch, willOpenPR, discardWorktree, claimFlow, noChangeSuccess }),- 'Do NOT manually switch branches or modify the worktree configuration.',+ mode === COMPLETION_MODES.RELEASE_FLOW+ ? 'Follow the release workflow branch instructions while preserving unrelated work.'+ : 'Do NOT manually switch branches or modify the worktree configuration.',// Resuming a previous failed agent's branch: establish what's already done// before writing code (see buildResumeSection). '' when not a resume.buildResumeSection(task, worktreeInfo) || nulldiff --git a/server/services/agentPromptBuilder.test.js b/server/services/agentPromptBuilder.test.jsindex 8f8e2e6857..43a449aa1d 100644--- a/server/services/agentPromptBuilder.test.js+++ b/server/services/agentPromptBuilder.test.js@@ -123,6 +123,7 @@ import { getDigitalTwinForPrompt } from './digital-twin.js';import { getToolsSummaryForPrompt } from './tools.js';import { loadSlashdoFile, loadSlashdoLib, loadSlashdoBundle, writeResolvedSlashdoBody } from '../lib/slashdoLoader.js'; // mocked above — control the inlined bodyimport { SLASHDO_INLINE_BUDGET_CHARS } from '../lib/slashdoInvocation.js';+import { sanitizeTaskMetadata } from '../lib/cosValidation.js';import { DEFAULT_TASK_PROMPTS } from './taskPromptDefaults.js';// The heading a task-type hook's prompt points at to locate the sentinel path.import { PROGRAMMATIC_OUTPUT_COMPLETION_HEADING } from '../lib/agentSentinel.js';@@ -3428,6 +3429,39 @@ describe('buildAgentPrompt — slashdo-backed tasks', () => {});});+ it.each([+ ['tui', 'codex-tui', 'codex'],+ ['cli', 'codex', 'codex'],+ ['tui', 'claude-code-tui', 'claude'],+ ['api', 'test-api', null],+ ])('keeps scheduled release attachment and completion aligned on %s/%s', async (providerType, providerId, providerCommand) => {+ vi.mocked(loadSlashdoFile).mockResolvedValue('# Release\n\nCanonical release procedure.');+ const scheduledMetadata = sanitizeTaskMetadata({+ useWorktree: false, openPR: false, worktreeChangesExpected: false,+ slashdoCommand: 'release', slashdoArgs: '--review-with codex[gpt-6-astra]~opt~max=1~effort=low'+ });+ const prompt = await buildAgentPrompt(+ makeTask({ metadata: scheduledMetadata }), {}, '/r', null, isTruthyMeta,+ { providerType, providerId, providerCommand, agentId: 'release-test' });+ expect(prompt).toContain('Canonical release procedure.');+ expect(prompt).toContain('--review-with codex[gpt-6-astra]~opt~max=1~effort=low');+ expect(prompt).toContain('Release Workflow Handoff');+ expect(prompt).toContain('first unverified checkpoint');+ expect(prompt).not.toMatch(/Do NOT push|do NOT push|Commit only|commit only|PortOS will (?:push|merge)/);+ expect(prompt).not.toContain('## Completion Workflow');+ if (providerType === 'tui') expect(prompt).toContain('.agent-done-release-test');+ });++ it('recovers the bundled release for an older queued task whose command was stripped', async () => {+ vi.mocked(loadSlashdoFile).mockResolvedValue('# Release\n\nCanonical release procedure.');+ const prompt = await buildAgentPrompt(+ makeTask({ metadata: { analysisType: 'release-check', openPR: false } }),+ {}, '/r', null, isTruthyMeta, { providerType: 'tui', providerId: 'codex-tui', providerCommand: 'codex' });+ expect(prompt).toContain('Canonical release procedure.');+ expect(prompt).toContain('Release Workflow Handoff');+ expect(prompt).not.toContain('Do NOT push');+ });+it('uses explicit slashdoArgs when present', async () => {const prompt = await buildAgentPrompt(slashdoTask({ slashdoArgs: '--issues 42' }), {}, '/r', null, isTruthyMeta,diff --git a/server/services/promptSections/completion.js b/server/services/promptSections/completion.jsindex f188bb06a5..6561fbbbd8 100644--- a/server/services/promptSections/completion.js+++ b/server/services/promptSections/completion.js@@ -21,6 +21,8 @@ function withNoChangeAuditGuidance(guidance, noChangeSuccess) {: guidance;}+const RELEASE_FLOW_GUIDANCE = 'Follow the bundled release workflow through its final verification and report. It owns release delivery; do not stop at a prepared commit or hand publication back to PortOS. If it cannot complete, report INCOMPLETE and the first unverified checkpoint instead of claiming a successful release.';+const REASONING_ONLY_BULLET = '**This is a reasoning-only task.** The worktree is discarded on exit — do NOT commit, push, merge, or open a PR. Write your result to the completion sentinel (see the Completion section) and stop.';const DISCARD_WORKTREE_HYGIENE = '- **Do NOT commit, push, or open a PR.** This worktree is discarded on exit — your only output is the completion sentinel (see the Completion section above).';@@ -76,6 +78,7 @@ export function buildCompletionGuidelineBullet({[COMPLETION_MODES.ACTION_OUTPUT]: () => '**This task produces no code output.** Its result is the API request or command your instructions describe (a PortOS endpoint call, a filed tracker issue, …) — do NOT run `/do:push`, `/do:pr`, `/simplify`, `git commit`, `git push`, or open a PR. Write the completion sentinel (see the Completion section) and stop.',[COMPLETION_MODES.DISCARD_WORKTREE]: () => REASONING_ONLY_BULLET,[COMPLETION_MODES.CLAIM_FLOW]: () => '**This is a self-managed claim flow.** Follow the claim prompt above through its phase-specific worktree, PR/MR, review, merge or human-handoff, and cleanup steps. Do NOT stop after committing or hand the lifecycle back to PortOS.',+ [COMPLETION_MODES.RELEASE_FLOW]: () => RELEASE_FLOW_GUIDANCE,[COMPLETION_MODES.READ_ONLY]: () => '**This is a read-only task.** Do NOT commit, push, or modify any files in the repository. Only read data and generate reports.',// A PR follow-up already carries its own PRIMARY OBJECTIVE section with the// full procedure, and its cleanup runs with `skipMerge`. The generic "your@@ -118,6 +121,7 @@ const NO_COMMIT_TARGET_MODES = new Set([COMPLETION_MODES.ACTION_OUTPUT,COMPLETION_MODES.DISCARD_WORKTREE,COMPLETION_MODES.CLAIM_FLOW,+ COMPLETION_MODES.RELEASE_FLOW,COMPLETION_MODES.READ_ONLY,]);@@ -179,6 +183,10 @@ export function buildFallbackCompletionInstructions({step4: 'Do NOT commit, push, or modify any files — this is a read-only task; read what you need and report your findings',gitHygiene: '- **Do NOT commit, push, or modify any files.** This is a read-only task — read what you need and report your findings.',}),+ [COMPLETION_MODES.RELEASE_FLOW]: () => ({+ step4: RELEASE_FLOW_GUIDANCE,+ gitHygiene: `- ${RELEASE_FLOW_GUIDANCE}`,+ }),[COMPLETION_MODES.REVIEW_LOOP_FOLLOW_UP]: () => ({step4: 'Follow the follow-up section above — push any fixes you make to the PR branch; a run that needed no fix makes no commit and that is a success, not a miss',gitHygiene: '- **Push fixes straight to the PR branch you are on** (the follow-up section above is the procedure). Stage specific files, use a `fix:` prefix, no Co-Authored-By annotations. Do NOT open a new PR.',@@ -375,6 +383,16 @@ export function buildActionOutputCompletionSection({ isTui = false, sentinelPath].join('\n');}+/** The release procedure is the deliverable; the sentinel only records its verified outcome. */+export function buildReleaseFlowCompletionSection({ isTui = false, sentinelPath = null } = {}) {+ const lines = ['## Release Workflow Handoff', RELEASE_FLOW_GUIDANCE];+ if (isTui && sentinelPath) {+ lines.push('', 'After the workflow reaches its documented final outcome, write that outcome to the completion sentinel and stop:', '',+ ...buildSentinelWriteSteps(1, sentinelPath, ' ## Release outcome\n <verified release URL, no-release-needed result, or INCOMPLETE with its first unverified checkpoint>'));+ }+ return lines.join('\n');+}+/** Audit reports are a deliverable even when the run only files issues. */export function buildAuditOutputCompletionSection(task, sentinelPath) {const category = resolveTaskHookType(task);@@ -471,6 +489,7 @@ export function buildAutoMergeCommitStep(baseBranch = null) {* apart from their non-slashdo equivalents.*/export function worktreeCommitGuidance({ isTui, mode = null, canTypeSlashCommands = false, rendersInlinePrLifecycle = false, isWorktreeOnExistingBranch, willOpenPR, discardWorktree, claimFlow = false, noChangeSuccess = false }) {+ if (mode === COMPLETION_MODES.RELEASE_FLOW) return RELEASE_FLOW_GUIDANCE;if (discardWorktree) return DISCARD_WORKTREE_NOTE;if (claimFlow) return 'The claim workflow in the Completion section owns the push, PR/MR, review, merge or human-handoff, and cleanup steps.';if (isTui) return withNoChangeAuditGuidance('Commit your changes to this branch — see **Completion Workflow** below.', noChangeSuccess);diff --git a/server/services/promptSections/slashdo.js b/server/services/promptSections/slashdo.jsindex 90a48cdc21..5c15078176 100644--- a/server/services/promptSections/slashdo.js+++ b/server/services/promptSections/slashdo.js@@ -153,7 +153,9 @@ export async function applySlashdoInvocation(task, {providerId = null, providerCommand = null, leanMode = false, hasFileTools = false,defaultReviewers = null, codeReviewDefaults = null,} = {}) {- const command = task.metadata?.slashdoCommand;+ // Older queued release checks lost this key in metadata sanitization.+ const taskType = task.metadata?.analysisType || task.metadata?.taskAnalysisType;+ const command = task.metadata?.slashdoCommand || (taskType === 'release-check' ? 'release' : null);const resolved = resolveSlashdoInvocation({command,args: task.metadata?.slashdoArgs || '',@@ -198,5 +200,5 @@ export async function applySlashdoInvocation(task, {includeTaskContext,explicitReviewWith,});- return { ...task, description: `${task.description}\n\n${section}` };+ return { ...task, metadata: { ...task.metadata, slashdoCommand: command }, description: `${task.description}\n\n${section}` };}