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: freeze release candidates at kickoff (#13273)
[._.]/3fb3bd64334b
diff --git a/.changelog/README.md b/.changelog/README.mdindex 413f8e8c28..a947d23c5c 100644--- a/.changelog/README.md+++ b/.changelog/README.md@@ -9,7 +9,8 @@ This directory contains detailed release notes for each version of PortOS.### No per-branch entries — release notes come from the commit logThere is nothing to write while you work. `/do:release` builds the changelog-for a release by reading `git log` since the last tag and grouping commits by+for a release by reading `git log` from the previous published tag through the+frozen candidate head (see [the release procedure](../docs/VERSIONING.md#creating-a-release)) and grouping commits byfeature/theme into a human-readable summary — it does this automatically aspart of the release, not from anything staged in this directory. Do not createa `NEXT.md`, do not write a per-branch fragment, and do not hand-edit adiff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex 504a30bbd1..ace591e731 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -4,7 +4,7 @@ on:# No push trigger. Every change reaches `main` through a pull request whose# own CI gate must be green, so re-running the suite on the merge commit only# repeats work. The nightly schedule below is the main-branch health signal,- # and the main -> release pull request runs the complete suite before a+ # and the candidate -> release pull request runs the complete suite before a# release ships.pull_request:branches: [main, release]@@ -1456,7 +1456,7 @@ jobs:# the trigger was Windows-irrelevant (see the FULL_TRIGGER_RULES# windowsEscalates flag in the impact planner) — publishing the gate for# one of those would vouch for Windows coverage that did not run. Every- # force-full path — nightly, the main -> release PR, release, an explicit+ # force-full path — nightly, the candidate -> release PR, release, an explicit# full-CI request — keeps windows_mode == 'full', so the release# optimization is unaffected.if: always() && needs.impact.outputs.full == 'true' && needs.impact.outputs.windows_mode == 'full' && (github.event_name != 'pull_request' || github.base_ref == 'release' || inputs.full == true)diff --git a/.github/workflows/release.yml b/.github/workflows/release.ymlindex f63c7b32f0..a6ac0efd77 100644--- a/.github/workflows/release.yml+++ b/.github/workflows/release.yml@@ -8,7 +8,7 @@ permissions:contents: writejobs:- # The main -> release pull request already ran the complete suite on the very+ # The candidate -> release pull request already ran the complete suite on the very# tree this push carries. Look for that green gate instead of paying for it# twice; anything unverified (a direct push to release, a merge that changed# the tree, an API failure) still falls through to the full run below.@@ -248,7 +248,7 @@ jobs:# The archive commit lands on main ONLY. `release` stays pinned to# the CI-verified commit: pushing main:release here would publish# unverified main commits, or be rejected as non-fast-forward when- # the branches diverged. The next main -> release promotion picks+ # the branches diverged. The next candidate -> release promotion picks# this commit up through the normal verified path.for attempt in 1 2 3; dogit fetch origin maindiff --git a/AGENTS.md b/AGENTS.mdindex 38da27ad75..35b2d92026 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -259,12 +259,12 @@ This policy governs code comments, not user-facing guides or product copy.## Git Workflow-- **main**: active development. **release**: push `main` to `release` to trigger the GitHub Release workflow.+- **main**: active development. **release**: merge a frozen candidate into `release` to trigger publication. **Release procedure:** [docs/VERSIONING.md](docs/VERSIONING.md#creating-a-release) is canonical and overrides the generic slashdo promotion recipe. Pin current `main` once at release kickoff in an isolated candidate branch, persist its cutoff, and resume that same candidate after interruption. Later merges and unrelated open issues/PRs belong to the next release. Only preparation and evidenced candidate-gating fixes may advance it; never rebase/merge live `main` into it. Promote the validated candidate, then synchronize the published release back to `main` through a normal PR.- **Before pushing**: inspect branch/upstream and working-tree state, preserve unrelated changes, and commit the intended work. Fetch the workflow's intended base explicitly for comparison; a feature branch's tracking branch is not necessarily the default branch. Integrate it only when needed under the merge policy below. Run `npm run pregate` on the resulting commits, then push. Re-run it after any subsequent rebase; do not blindly pull with autostash.-- **Merge ready branches without chasing `main`.** A branch that is behind the default branch may merge when it is conflict-free, required checks pass for its current head, and configured reviews are satisfied. Default-branch movement alone does not invalidate those results or require a rebase, branch update, or another CI run. Before every managed merge (including `/do:next` single-issue and swarm Phase C, `/do:pr --merge`, and CoS claims), fetch the default branch and run `node scripts/pregate.js --guards-only --merged-with origin/<default>` against the committed head and that fetched base. This runs only the planner’s always-run and diff-selected structural guards on the combined tree, with test-memo reuse disabled; it does not replace head CI or write an attestation receipt. Run it outside repository merge admission. Retain the checked head and base SHAs; inside admission, re-read the live base as well as the PR head. If either changed, release admission and repeat the guard check outside the lease before retrying. A failed guard leaves the PR open with the failing test named; do not merge. These instructions are the repository pre-merge hook for the bundled slashdo [merge gate](lib/slashdo/lib/merge-gate.md) and override any direct-merge fallback in that shared procedure. Rebase only for actual conflicts, an enforced up-to-date branch policy, or evidenced integration risk (including semantic overlap without textual conflicts); after changing the head, rerun affected validation and required reviews/checks. Keep implementation, review, and CI concurrent; hold repository merge admission only for the final live-state check, merge attempt, and readback, releasing it before recovery or further CI waits. Never bypass required checks or confuse a queued merge with `MERGED`. This policy overrides mandatory base-sync instructions in delegated slashdo workflows.+- **Merge ready branches without chasing `main`.** A branch that is behind the default branch may merge when it is conflict-free, required checks pass for its current head, and configured reviews are satisfied. Default-branch movement alone does not invalidate those results or require a rebase, branch update, or another CI run. Before every managed merge (including `/do:next` single-issue and swarm Phase C, `/do:pr --merge`, and CoS claims), fetch the actual PR base branch and run `node scripts/pregate.js --guards-only --merged-with origin/<base>` against the committed head and that fetched base (`main` for development PRs; `release` for candidate promotion). This runs only the planner’s always-run and diff-selected structural guards on the combined tree, with test-memo reuse disabled; it does not replace head CI or write an attestation receipt. Run it outside repository merge admission. Retain the checked head and base SHAs; inside admission, re-read the live base as well as the PR head. If either changed, release admission and repeat the guard check outside the lease before retrying. A failed guard leaves the PR open with the failing test named; do not merge. These instructions are the repository pre-merge hook for the bundled slashdo [merge gate](lib/slashdo/lib/merge-gate.md) and override any direct-merge fallback in that shared procedure. Rebase only for actual conflicts, an enforced up-to-date branch policy, or evidenced integration risk (including semantic overlap without textual conflicts); after changing the head, rerun affected validation and required reviews/checks. Keep implementation, review, and CI concurrent; hold repository merge admission only for the final live-state check, merge attempt, and readback, releasing it before recovery or further CI waits. Never bypass required checks or confuse a queued merge with `MERGED`. This policy overrides mandatory base-sync instructions in delegated slashdo workflows.- **Finish authorized merges and teardown before reporting success.** When merge is authorized, finish review and required checks, merge, and verify the merge completed. Managed GitHub merges never pass `--delete-branch` to `gh pr merge`, including method fallbacks: it can remove another linked checkout before preservation. Pin every attempt to the CI-verified head, verify remote `MERGED`, and release merge admission before cleanup. Archive unique content, including untracked and ignored files, and verify preservation before deleting a checkout. Delete only the authorized exact remote ref with an expected-head lease; an advanced ref or archive failure leaves the checkout/ref intact with a tracked handoff. Recheck live ownership, release only this task's locks on its completed work, remove its worktree, and delete its explicitly named local branch; never infer the branch to delete from its upstream. Preserve other owners' locks and explicit manual handoffs. If work must remain, name its owner, blocker, and next step in the handoff.- **No per-branch changelog entries.** PRs do not write a changelog file or fragment — commit messages are the record, and `/do:release` synthesizes the release notes from the commit log since the last tag into `.changelog/v{version}.md`. **Write commit subjects/bodies for a human release-note reader** (see "Git commits and PRs" in the global instructions). Rationale: `.changelog/README.md`.-- **Release quality snapshot**: before a release, run `npm run quality:snapshot` on the install holding PortOS audit evidence. It publishes numeric local assessments only (no provider calls, no private run prose) into the repo-root `.quality.json` through an immediately-merged pull request; with no local evidence it commits nothing and says so.+- **Release quality snapshot**: after publication, run `npm run quality:snapshot` on the install holding PortOS audit evidence. It publishes numeric local assessments only (no provider calls, no private run prose) into the repo-root `.quality.json` through an immediately-merged pull request; with no local evidence it commits nothing and says so. This publication goes to the next release; never move or delay the frozen candidate to include it.- **Versioning**: `package.json` reflects the last release. Do not bump during development — `/do:release` handles it.- After each feature or bug fix, review the diff for unnecessary complexity and duplication; use `/simplify` when available, otherwise perform the review directly. Follow the active task's delivery workflow for commit/push; a review-only request does not authorize shipping changes.- **Deferred work follows “Don't leave trash on the floor” above.** Make routine design decisions rather than parking an issue for input. PortOS issue labels come only from `MANDATORY_DISPATCH_HINT_GUIDANCE` in `server/lib/dispatchLabels.js`; do not duplicate the vocabulary in instructions.diff --git a/client/src/components/cos/constants.js b/client/src/components/cos/constants.jsindex 52a38532a4..2c7d2393f8 100644--- a/client/src/components/cos/constants.js+++ b/client/src/components/cos/constants.js@@ -454,8 +454,8 @@ export const LOG_TRIAGE_CAPS = [// server drops any key outside that list.export const RELEASE_OPTIONS_TASK_TYPES = new Set(['do-release']);export const RELEASE_OPTIONS = [- { field: 'finishInFlight', label: 'Finish in-flight work', description: 'Merge or close open PRs and reconcile lingering branches that no running agent owns before releasing' },- { field: 'mergeDependencyUpdates', label: 'Merge dependency updates', description: 'Merge open Dependabot/Renovate PRs, fixing any that break the build' },+ { field: 'finishInFlight', label: 'Finish in-flight work', description: 'Finish only in-flight fixes required by the frozen release candidate; leave unrelated PRs for the next release' },+ { field: 'mergeDependencyUpdates', label: 'Merge dependency updates', description: 'Include only dependency updates required to fix the frozen release candidate' },{ field: 'resolveBlockers', label: 'Resolve blockers', description: 'Fix failing tests, red CI, and blocking bugs (delegating to a sub-agent) instead of stopping to report them' },{ field: 'autoDecide', label: 'Make decisions', description: 'Make routine design and preference decisions and list them for your review, instead of stopping to ask' },];diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.mdindex a752a2054c..fd0a6201b8 100644--- a/docs/CONTRIBUTING.md+++ b/docs/CONTRIBUTING.md@@ -84,7 +84,7 @@ See [VERSIONING.md](./VERSIONING.md) for full details.1. Work on `main` branch (or feature branches merged to `main`)2. PRs to `main` trigger CI tests-3. Push `main` to `release` branch to trigger GitHub Release workflow+3. Follow the [frozen candidate procedure](./VERSIONING.md#creating-a-release): capture `main` at kickoff, validate an isolated candidate, then merge it into `release` to publish4. Before pushing, follow [Regular Development](./VERSIONING.md#regular-development): verify your branch/upstream and working-tree state, preserve unrelated work, and explicitly fetch the intended base for comparison (the tracking branch may differ); integrate it only for conflicts, enforced branch policy, or evidenced integration risk. Run `npm run pregate` after any rebase and before every push. See [AGENTS.md's Git Workflow](../AGENTS.md#git-workflow) for the full contract.Pregate first checks installed package versions against all four workspace lockfiles without modifying dependency trees. Stale, missing, or unreadable evidence stops lint/tests with a reconciliation diagnostic. Pregate requires development dependencies (`npm ci --include=dev` in an owning workspace); a production-only installation cannot run its checks. Ordinary worktree links must be repaired only in their owning source checkout; a separate clone with its own locked installs is also suitable for validation. `--plan-only` prints the plan without checking installed dependencies.@@ -194,7 +194,7 @@ so write commit subjects/bodies for a human release-note reader (see CommitMessages below). See [`.changelog/README.md`](../.changelog/README.md) fordetails.-> **Note:** Some older code or automation notes may still reference a `dev` branch workflow. The `main`→`release` workflow described here is the current source of truth.+> **Note:** Some older code or automation notes may still reference a `dev` branch workflow. The frozen-candidate→`release` workflow described here is the current source of truth.### Line Endings on Windowsdiff --git a/docs/GITHUB_ACTIONS.md b/docs/GITHUB_ACTIONS.mdindex 272dbceb42..3a3a598021 100644--- a/docs/GITHUB_ACTIONS.md+++ b/docs/GITHUB_ACTIONS.md@@ -46,7 +46,7 @@ once per event:|-------|-----------|| PR into `main` | Impact-scoped plan (only the surfaces the diff touches) || Push/merge to `main` | **Nothing** — no push trigger; the PR gate already passed |-| PR `main` → `release` | **Full suite**, forced regardless of the diff |+| PR candidate → `release` | **Full suite**, forced regardless of the diff || Push/merge to `release` | Reuses the release PR's green gate; full suite only if it cannot be verified || Scheduled 09:17 and 21:17 UTC | Full suite — the `main`-branch health signal; a red run names the merges since the last green one || `workflow_dispatch` | Full suite |@@ -58,7 +58,7 @@ A release therefore pays for one full run (on its PR), not three.| Branch | Purpose ||--------|---------|| `main` | Active development |-| `release` | Merge `main` into `release` to trigger releases |+| `release` | Merge the frozen candidate into `release` to trigger releases |## CI Workflow (`ci.yml`)@@ -623,7 +623,7 @@ The selected work is split across parallel jobs:more often than any other; split, each finishes in about the time of its ownsteps.- **Windows server tests** — the same server selection, but only on full CI- (the `main` → `release` PR, nightly, release, workflow dispatch) or when a+ (the candidate → `release` PR, nightly, release, workflow dispatch) or when aWindows-sensitive surface changed (`.ps1` / `.cmd` spawn, PowerShell BOM,`bufferedSpawn`, `cos-runner`, shell/PM2, etc.). Docs-only and ordinaryLinux-faithful PRs skip this job. `pinPlatform('win32')` tests still run on@@ -700,7 +700,7 @@ The selected work is split across parallel jobs:Pull requests run the browser suites' smoke profile, which skips the`[fidelity]` grading cases. Those cases run in hosted CI on the nightly-schedule, on the `main` -> `release` pull request and on dispatched full runs,+schedule, on the candidate → `release` pull request and on dispatched full runs,so a fidelity regression shows up there rather than blocking the PR thatcaused it. The `[local-performance]` playback case runs only locally.@@ -809,7 +809,7 @@ Windows-risk scoped PR already gets.Windows runs the baseline. Likewise only the pipeline scripts the Windows job executes(`ci-base-sha`, `run-ci-tests`, and `lib/githubOutput` which the runner imports) escalate it;`ci-test-plan`, `run-ci-lint`, `scan-diff-hidden-content` and `verify-ci-status` run on Linux jobs-only. The nightly run and the `main` → `release` PR keep the complete matrix as the net.+only. The nightly run and the candidate → `release` PR keep the complete matrix as the net.**Dependency manifests decide per package.** The planner's 32-PR sample inOctober 2026 traced every full plan to a lockfile/manifest change (4),@@ -869,13 +869,13 @@ Three properties keep that safe, each pinned by `scripts/ci-test-plan.test.js`:tests selected" and exits 0 for an empty `files` list, so a downgrade thatresolved to no tracked contract tests would be a green job that ran nothing.The planner falls back to the full suite instead.-- **Force-full keeps the discovery net.** Nightly, the `main` → `release` PR,+- **Force-full keeps the discovery net.** Nightly, the candidate → `release` PR,release, and an explicit full-CI request still run the complete Windowsmatrix. `ci.yml` has no push trigger, so those are the whole net for a Windowsregression on a surface nobody has tagged yet (`staticImportGraph` in #5909,`voice/fineTuning` in #6268), and worst-case detection latency for adowngraded PR is the next nightly — always before a release, because the- `main` → `release` PR is force-full. That is not a new exposure: it is the+ candidate → `release` PR is force-full. That is not a new exposure: it is thesame net every PR touching no `WINDOWS_RISK_RULES` file already relies on,which is most of them. This change widens that population by 24 runs in 250.@@ -1071,7 +1071,7 @@ The complete server, client, DB, lint, build, and smoke suite runs:There is **no push trigger on `main`**. A merge commit on `main` re-tests atree whose PR gate is already green, so the run was pure duplication; thenightly full run is what catches a semantic conflict between two independently-green PRs, and the `main` → `release` PR catches it before a release ships.+green PRs, and the candidate → `release` PR catches it before a release ships.A red scheduled run cannot point at a PR, so the gate's last step(`scripts/ci-nightly-report.js`, scheduled runs only) writes the suspect list to the run@@ -1296,7 +1296,10 @@ Triggers on push to `release` branch. Steps:older unnamed notes.7. If a pattern changelog file (`.changelog/v{major}.{minor}.x.md`) was used,archives it on `main` (renames `.x.md` to the exact version).-8. If the archive step ran, fast-forwards `release` to match `main`.+8. An archive advances only `main`; `release` remains pinned to the verified tree.++Capture and resume candidates using [the release procedure](VERSIONING.md#creating-a-release).+Concurrent development merges do not change the candidate or its CI inputs.### Reusing the release PR's CI run@@ -1312,9 +1315,9 @@ gate. Two independent conditions must hold, because each alone is forgeable:green too, so it cannot distinguish "the full suite passed on this tree"from "some subset of it did".-The ordinary release merge satisfies this — `release` is strictly behind-`main`, so the merge commit's tree equals the `main` tip it merged, and that-tip is exactly the SHA the release PR ran full CI on.+The ordinary release merge satisfies this when the frozen candidate contains+the captured `release` base: the merge commit's tree equals the candidate head+that full CI validated. The current `main` tip is irrelevant.Everything else fails closed and runs the complete suite again: a direct push to`release`, a hotfix committed on `release` that changes the merge tree, adiff --git a/docs/VERSIONING.md b/docs/VERSIONING.mdindex b161cd121b..c2b3fc636d 100644--- a/docs/VERSIONING.md+++ b/docs/VERSIONING.md@@ -17,7 +17,8 @@ Example progression: `0.22.0` → `0.22.1` (fix) → `0.23.0` (feature) → `1.0| Branch | Purpose ||--------|---------|| `main` | Active development |-| `release` | Push `main` to `release` to trigger GitHub Release workflow |+| `codex/release-*` | A candidate pinned to the development commit captured at kickoff |+| `release` | Merge the validated candidate here to trigger publication |## Workflow@@ -36,7 +37,7 @@ Direct pushes to `main` do not start this workflow. Run `npm run pregate`before every push and again after rebasing onto a moved base, as required by[`AGENTS.md`](../AGENTS.md).-### On Push `main` → `release`+### On candidate promotion to `release`1. Release workflow triggers2. Creates git tag with current version (e.g., `v1.31.0`)@@ -71,7 +72,156 @@ synthesized from commit history by `/do:release`, not staged during development.### Creating a Release-Use the `/do:release` slash command from `main`. It handles version bumping, changelog finalization, and pushing to the `release` branch.+Use `/do:release` with this **documented project procedure**, which takes+precedence over slashdo's generic live-source promotion recipe. Release preparation+and the release PR use a dedicated candidate branch; never use live `main` as the+PR head. There is no requirement to empty the issue or PR queue.++#### 1. Capture once at kickoff, or recover the existing candidate++Before version selection, backlog work, or validation, inspect existing release+PRs/candidate branches. Resume an interrupted candidate with its original cutoff,+release base, previous published tag, and version. Do not recut it from today's+`main`, bump its version again, or take over a live owner's release. If a legacy+open release PR uses `main` as its head, move the promotion to a dedicated branch+at its recorded validated SHA and close the superseded PR with a link. If no such+SHA was recorded, explicitly record a new cutoff and validate it from scratch;+never treat old checks as proof of the new tree.++For a **new** candidate, the first fetch of `main` is the cutoff. If the launcher+supplied a verified exact kickoff SHA, use that instead. A timestamp cannot recover+an earlier trigger-time commit. Capture before any potentially lengthy work. Use a+unique candidate name and an unused worktree path; never reset an existing branch:++```bash+set -e+# PRIMARY is the existing primary checkout; WORKTREE is a new isolated path.+# Keep these values in the run's record, not only in transient shell variables.+CANDIDATE_BRANCH="codex/release-$(node -e 'console.log(crypto.randomUUID())')"+git fetch origin "refs/heads/main:refs/heads/$CANDIDATE_BRANCH"+RELEASE_CUT_SHA=$(git rev-parse "$CANDIDATE_BRANCH^{commit}")+git fetch origin refs/heads/release+RELEASE_BASE_SHA=$(git rev-parse 'FETCH_HEAD^{commit}')+git worktree add "$WORKTREE" "$CANDIDATE_BRANCH"+git worktree lock --reason "Active release candidate $CANDIDATE_BRANCH" "$WORKTREE"+node scripts/link-worktree-deps.js "$PRIMARY" "$WORKTREE"+```++Resolve the previous **published** version tag and its peeled commit from the+captured release history (not the latest tag on moving `main`). Verify the GitHub+Release, notes and tag agree. Reconcile an interrupted publication at its original+commit before attempting a new version; never move an existing tag. A concurrent+release owner or conflicting version requires reconciliation, not another release.++Before changing files or starting validation, create a metadata-only commit in the+candidate worktree with commit trailers `Release-Cut`, `Release-Base`,+`Release-Previous-Tag`, and `Release-Previous-Commit`, each carrying the exact+resolved value. For example, use `git commit --allow-empty` with subject+`chore: pin release candidate` and those trailers in its body. The parent of that+commit must equal `RELEASE_CUT_SHA`. This persists the cutoff in the candidate's+history, including after a push, interruption, or a different agent resuming.+Copy those identities, the branch and chosen version into the release PR body.++The candidate must contain the captured release-base history. Normally the previous+release has already been synchronized into `main`. For a legacy release merge not+in `main`, merge only the captured `RELEASE_BASE_SHA` into the candidate and verify+that the tree is unchanged; an unexpected content change is a reconciliation+blocker. Do not merge the latest `main` to fix ancestry. Record any such ancestry+merge in the candidate ledger.++#### 2. Prepare and validate only this candidate++Choose the version and synthesize `.changelog/v{version}.md` from the previous+published tag through the pinned candidate. Count only substantive changes in+that range for readiness (at least two); exclude metadata-only commits. Update+all version-bearing package/lock files according to their existing conventions.+Keep the named first heading described in [the changelog guide](../.changelog/README.md).+Commit preparation on the candidate, not on `main` first.++Open issues, open PRs, dependency-bot updates, and commits merged after+`RELEASE_CUT_SHA` belong to the next release. Do not sweep them in, wait for their+CI, trigger branch reconciliation, rebase on `main`, or merge `main` into the+candidate. The scheduled task's in-flight/dependency options apply only to+candidate-gating fixes. A quality snapshot already present at the cutoff is+included; a newly published snapshot goes to the next release and does not move+or delay this cutoff.++Run the documented release checks from the candidate worktree: provision+`portos_test` with `npm run setup:db:test`, run `npm run test:db`, and run+`npm run pregate -- --full` before pushing. Never use the production database.+Report any locally unavailable stage and require its CI result. Review the full+previous-published-commit-to-candidate diff, not just the preparation commit.++#### 3. Admit only evidenced release-gating fixes++A failing candidate test/build/CI check or an accepted review finding that applies+to its tree can gate the release regardless of severity. An issue's existence,+an unrelated PR, or a defect only in later `main` does not. Preserve the evidence+and fix the root cause; do not weaken tests or declare an unexplained rerun clean.++For each exception, record the failure/finding, why it applies to this candidate,+the exact fix commit(s), and validation in the PR's **Candidate amendments**+ledger. Implement the smallest fix directly on the candidate, or cherry-pick the+specific reviewed fix commit from `main` (including only necessary, separately+justified prerequisites). Never merge all of updated `main`. Preserve active+owners and normal trusted-review/admission boundaries. A broad fix that cannot be+safely isolated remains an explicit blocker; do not silently expand the release.++An amendment changes the candidate head: update the notes if needed and rerun+affected local checks, pregate, required review and full promotion CI for that+head. Merely advancing `main` changes none of these inputs and does not invalidate+candidate validation. Record candidate-only fixes for forward-porting to `main`.++#### 4. Promote the exact validated candidate++Push the candidate after pregate and run `node scripts/pregate-attest.js`; an+attestation refusal leaves full CI in charge. Create the PR with+`--head "$CANDIDATE_BRANCH" --base release`, including the cutoff identities,+previous-tag comparison, chosen version/name and amendment ledger. A PR targeting+`release` forces full CI regardless of its head branch; require both `CI Gate`+and `Full CI Gate` on the current candidate head.++For the repository's pre-merge structural guard, compare the candidate against+**`origin/release`, its actual PR base**, not `origin/main`. Before merging, verify+the PR head still equals the validated candidate SHA and the target still equals+`RELEASE_BASE_SHA`. Hold merge admission only for the final live-state check,+merge attempt and readback. Use a merge commit and `--match-head-commit` with the+validated head; never squash/rebase away the candidate ancestry, bypass required+checks, or use a moving `main` PR. If the target changed, release admission and+reconcile the competing release/version and resulting tree outside the lease.+It is not permission to recut from `main` or reuse checks on a different tree.++#### 5. Verify publication++Read back `MERGED`, the merge commit and the remote release ref. Confirm the+promoted tree equals the validated candidate tree. Watch the Release workflow+for that merge SHA. The workflow creates the tag at its triggering SHA and+checks its tree before and after publication; never create the version tag by+hand. Verify the tag tree, version, named notes and published, non-draft,+non-prerelease GitHub Release. A merged PR alone is not completion.++#### 6. Synchronize back without changing the published release++After publication, open a normal **`release` → `main`** synchronization PR and+merge it with a merge commit after its own required checks/reviews/admission.+This carries version metadata, notes and candidate-only fixes back to development+and preserves the release merge ancestry for the next candidate. Run the+repository-required quality snapshot after publication as a development update;+it never changes this release. If conflicts require edits, use a temporary sync branch containing the published release commit+and the current `main`, resolve them there, and merge that branch into `main`.+Preserve newer development work. Never retarget the candidate, tag, or `release`+ref to `main`, and never back-merge development commits into the published tree.++Keep synchronization failures tracked with the exact PR, owner and next step;+they do not invalidate an already verified publication or require revalidating it.+Before a subsequent release, verify the prior published release is reconciled into+development, so its version/fixes are not lost or released twice. Clean up only+owned temporary branches/worktrees after preservation and ancestry verification,+releasing only this run's worktree lock.++The final report identifies cutoff SHA, candidate SHA, amendments, promotion PR,+published tag/release URL, and the synchronization outcome. Later `main` commits+remain unreleased until the next candidate is captured.## CI Skipdiff --git a/server/services/cosTaskPreStepBlocks.js b/server/services/cosTaskPreStepBlocks.jsindex 98ccf6080d..020b2978b4 100644--- a/server/services/cosTaskPreStepBlocks.js+++ b/server/services/cosTaskPreStepBlocks.js@@ -181,8 +181,8 @@ export function resolveIssueExcludeLabelsBlock(extraLabels = []) {// OFF forbids. Keyed by the same list the sanitizer allowlists, so an option// cannot be settable yet silently absent from the prompt.const RELEASE_OPTION_LINES = {- finishInFlight: ['Finish in-flight work', 'Step 1 runs: finish open PRs and lingering branches no live agent owns before releasing.', 'Step 1 is skipped: do not merge, close, or rebase other open PRs or branches (dependency-bot PRs follow the Merge dependency updates option).'],- mergeDependencyUpdates: ['Merge dependency updates', 'Step 2 runs: merge open dependency-bot PRs, fixing any that break the build.', 'Step 2 is skipped: leave dependency-bot PRs untouched.'],+ finishInFlight: ['Finish in-flight work', 'Step 1 runs only for evidenced candidate-gating fixes; unrelated open PRs and branches wait for the next release.', 'Step 1 is skipped: do not merge, close, or rebase other open PRs or branches (dependency-bot PRs follow the Merge dependency updates option).'],+ mergeDependencyUpdates: ['Merge dependency updates', 'Step 2 runs only for dependency updates required to fix the frozen candidate; other bot PRs wait for the next release.', 'Step 2 is skipped: leave dependency-bot PRs untouched.'],resolveBlockers: ['Resolve blockers', 'Step 4 runs: fix failing tests, red CI, and blocking bugs yourself or through a sub-agent.', 'Step 4 is skipped: report each blocker with its evidence and stop without fixing it.'],autoDecide: ['Make decisions', 'Make routine design and preference decisions yourself and list them for operator review.', 'Stop at the first design or preference decision and report the question.'],};@@ -192,11 +192,12 @@ const RELEASE_OPTION_LINES = {* (global → per-app) metadata. Each option is ON unless explicitly `false`.*/function resolveReleaseOptionsBlock(metadata = {}) {- return RELEASE_OPTION_KEYS.map((key) => {+ const options = RELEASE_OPTION_KEYS.map((key) => {const [label, on, off] = RELEASE_OPTION_LINES[key];const enabled = metadata?.[key] !== false;return `- **${label}: ${enabled ? 'ON' : 'OFF'}** — ${enabled ? on : off}`;}).join('\n');+ return `${options}\n\nRelease cutoff: before any release work, recover the existing candidate's recorded cutoff or pin the development commit at kickoff in an isolated candidate branch. Follow the project's documented release procedure. Only preparation and evidenced candidate-gating fixes may advance it; later development merges and unrelated open issues/PRs wait for the next release. Never pull, rebase, or merge the live development branch into the candidate. These limits apply even when an option is ON and override broader backlog-sweep instructions in a customized prompt.`;}/**diff --git a/server/services/cosTaskPreStepBlocks.test.js b/server/services/cosTaskPreStepBlocks.test.jsindex 649ea80c32..b4eaa4fb0d 100644--- a/server/services/cosTaskPreStepBlocks.test.js+++ b/server/services/cosTaskPreStepBlocks.test.js@@ -402,6 +402,8 @@ describe('applyReleaseOptions — the do-release {releaseOptions} block', () =>// Only a real boolean false disables — the sanitizer drops non-booleans.expect(out).toContain('**Make decisions: ON**');expect(out).not.toContain('{releaseOptions}');+ expect(out).toContain('only for evidenced candidate-gating fixes');+ expect(out).toContain('later development merges and unrelated open issues/PRs wait for the next release');expect(out.startsWith('Options:')).toBe(true);});@@ -417,6 +419,9 @@ describe('applyReleaseOptions — the do-release {releaseOptions} block', () =>expect(out.startsWith('## Release options for this run')).toBe(true);expect(out).toContain('**Resolve blockers: OFF**');expect(out.endsWith('my custom release prompt')).toBe(true);+ expect(out).toContain("recover the existing candidate's recorded cutoff");+ expect(out).toContain('Never pull, rebase, or merge the live development branch into the candidate');+ expect(out).toContain('override broader backlog-sweep instructions in a customized prompt');});it('targets the branch-reconcile trigger at the released app, or PortOS on the global lane', () => {diff --git a/server/services/taskPromptDefaults.test.js b/server/services/taskPromptDefaults.test.jsindex 4bf15e3b36..bab416fc80 100644--- a/server/services/taskPromptDefaults.test.js+++ b/server/services/taskPromptDefaults.test.js@@ -467,8 +467,6 @@ describe('taskPromptDefaults integrity snapshot', () => {// claim-issue-jira: the handoff contract changed after the token swap.// A later change made the PR-side wait human-length (FORGE_REVIEWER_WAIT_NOTE).['claim-issue-jira', [") and address the findings — push fixes, capped at 3 rounds per reviewer. " + FORGE_REVIEWER_WAIT_NOTE, "), poll every 5–15s, and address the findings — push fixes, capped at 3 rounds per reviewer."], ["After the reviewers finish, preserve the exact worktree, local `claim/<KEY>` branch and open MR/PR for the intentional human handoff. Do not invoke merged retirement while it remains unmerged.", "After the reviewers finish, run the worktree-only cleanup so the source checkout is left clean:\n ```bash\n cd {repoPath}\n git worktree remove \"${WORKTREE}\"\n ```\n Leave the local `claim/<KEY>` branch and the open MR/PR in place."]],- // do-release v20 split Step 2's "Red CI" bullet to recognize a maintainer-admission hold.- ['do-release', [/- A failing step that only says the run is[^\n]*\n- Red CI from the bump itself: check out the branch/, '- Red CI: check out the branch']],['issue-reconcile'],['jira-status-report'],['user-action-review'],@@ -625,7 +623,15 @@ describe('taskPromptDefaults integrity snapshot', () => {expect(PROMPT_VERSIONS['dependency-updates']).toBeGreaterThanOrEqual(9);});- // The hold bullet itself is pinned by the pre-token reconstruction case above.+ // Preserve recognition of the actual retired release bodies without retaining+ // obsolete instructions as literals or reconstructing them from today's prompt.+ it('upgrades pre-cutoff release defaults across installs', () => {+ expect(SNAPSHOT.PREVIOUS_DEFAULT_PROMPTS['do-release']).toEqual(expect.arrayContaining([+ 'dcb1b0c84712f7824afd9c44cb4208da', // pre-token default+ '3061f2041d25fd80d60189f68ac5c3e0', // v20, before frozen candidates+ ]));+ });+it('do-release v20 separates a held bot-PR CI run from a bump that broke CI', () => {expect(DEFAULT_TASK_PROMPTS['do-release']).toContain('Red CI from the bump itself');expect(PROMPT_VERSIONS['do-release']).toBeGreaterThanOrEqual(20);@@ -910,14 +916,19 @@ describe('taskPromptDefaults integrity snapshot', () => {expect(current).toContain('inconclusive review does not itself stop the release');// The operator's toggles are rendered at dispatch.expect(current).toContain('{releaseOptions}');- // v15: in-flight work and dependency PRs land first, respecting live owners.- expect(current).toContain('Finish in-flight work first');+ // The cutoff precedes every potentially long task. Open-work options can+ // add only specific fixes, never refresh the release from a moving branch.+ expect(PROMPT_VERSIONS['do-release']).toBeGreaterThanOrEqual(21);+ expect(current.indexOf('Freeze or recover the release candidate')).toBeLessThan(current.indexOf('Reconcile missing releases'));+ expect(current).toContain('RELEASE_CUT_SHA');+ expect(current).toContain("never recapture today's development tip");+ expect(current).toContain('Never use the development branch as the release PR head');+ expect(current).toContain('Development-branch movement alone does not restart validation');+ expect(current).toContain('cherry-pick only its exact reviewed fix commit');+ expect(current).toContain('Do not trigger branch reconciliation');+ expect(current).not.toContain('merge the updated `<DEV_BRANCH>` into');+ expect(current).not.toContain('Every other trusted item is yours to finish');expect(current).toContain('/api/cos/agents?active=1');- // Scoped to the app being released, never the install's other repos.- expect(current).toContain('"taskType":"branch-reconcile","appId":"{appId}"');- expect(current).toContain('Do not wait for the triggered agent');- // External contributors' PRs stay behind the review/admission flow, and the- // sweep targets the development branch, not the release branch.expect(current).toContain('Only trusted work is yours');expect(current).toContain('--base <DEV_BRANCH>');expect(current).toContain('Merge dependency updates');diff --git a/server/services/taskPromptDefaults/integrity.snapshot.json b/server/services/taskPromptDefaults/integrity.snapshot.jsonindex 8b1dd58fda..57526df9d8 100644--- a/server/services/taskPromptDefaults/integrity.snapshot.json+++ b/server/services/taskPromptDefaults/integrity.snapshot.json@@ -24,7 +24,7 @@"data-integrity": "5fcc4f5044101e89da5bbf4890c11a1c","data-safety": "25e79bc34cfadeab3cc3969a6c3421c2","dependency-updates": "8ce4e7e33c5c7554b89af7d35a471c31",- "do-release": "3061f2041d25fd80d60189f68ac5c3e0",+ "do-release": "22c7fa45352bd013b4208cbe8188b5cd","do-replan": "35660eb7b43e4259a6a9253ed288a1db","documentation": "c94797b4bd3a0d554e225888ed48b76b","error-handling": "416b4e9aa2c1fcc3bfea7a2d38814ae5",@@ -89,7 +89,7 @@"data-integrity": 1,"data-safety": 3,"dependency-updates": 9,- "do-release": 20,+ "do-release": 21,"do-replan": 2,"documentation": 9,"error-handling": 4,@@ -344,7 +344,8 @@"e2fb83ae74cc759d1fface857169badc","0ee9c504bad68f4a73be15f0b955a796","dcb1b0c84712f7824afd9c44cb4208da",- "97ce61508d7dd6616a8c02e2c365b872"+ "97ce61508d7dd6616a8c02e2c365b872",+ "3061f2041d25fd80d60189f68ac5c3e0"],"do-replan": ["59a57f1bb445138c30ab4fa23630c6f8"diff --git a/server/services/taskPromptDefaults/prompts.js b/server/services/taskPromptDefaults/prompts.jsindex 7d98cce249..3810e5747c 100644--- a/server/services/taskPromptDefaults/prompts.js+++ b/server/services/taskPromptDefaults/prompts.js@@ -3922,7 +3922,7 @@ mode, run the project's type check and tests before committing.`,Repository: {repoPath}-Your job is to SHIP a release of {appName}: a merged release PR, a version tag, and a published GitHub Release. Readiness checks are a means to that end, not the deliverable. Do whatever it takes to get there — finish in-flight work, merge pending dependency updates, fix red CI, fix blocking bugs, and make the routine decisions the release needs.+Your job is to SHIP a release of {appName}: a merged release PR, a version tag, and a published GitHub Release. Readiness checks are a means to that end, not the deliverable. Freeze the candidate at kickoff, fix its red CI and blocking bugs, and make the routine decisions it needs. Open issues, in-flight PRs, and later development-branch merges belong to the next release unless a specific fix is required to gate this candidate.A run ends without a published release for only two reasons:@@ -3937,7 +3937,17 @@ These are the operator's settings for this scheduled task. Follow them exactly;{releaseOptions}-## Step 0: Reconcile missing releases+## Step 0: Freeze or recover the release candidate++Before backlog work, reconciliation, version selection, or validation, read the repository's release procedure and resolve its development and publication branches. For PortOS, follow the frozen-candidate procedure in \`docs/VERSIONING.md\`; it overrides generic slashdo instructions to pull/rebase the source branch or promote live \`main\`.++First recover any existing candidate branch and release PR with its recorded cutoff SHA, release-base SHA, previous published tag, and chosen version. Resume those exact identities; never recapture today's development tip for an interrupted run. Leave an actively owned release alone and report its owner. An older PR headed by the live development branch must be migrated to a dedicated branch at its recorded validated head (or explicitly restarted with a recorded cutoff); it is not a frozen candidate.++For a new candidate, fetch the development branch once at kickoff, immediately resolve its commit to \`RELEASE_CUT_SHA\`, and create an isolated candidate branch from that SHA before lengthy work. Record the cutoff, release-base SHA, previous published tag/commit, candidate branch, and version in durable candidate metadata and the release PR body. The first fetch is the cutoff; do not infer an earlier trigger-time SHA from a timestamp. If dispatch already supplied an exact cutoff SHA, use it instead of fetching a replacement. Open issues and PRs do not delay this capture. Preserve the running application's checkout and follow the repository's worktree/dependency setup rules.++Readiness, version choice, notes, review, and tests use the previous published tag through the candidate head. Never merge or rebase the latest development branch into the candidate. Never use the development branch as the release PR head. Only release preparation and individually justified candidate-gating fixes may advance the candidate; record each exception's evidence and exact commit and revalidate the resulting head. Development-branch movement alone does not restart validation. A changed release target requires explicit conflict/version/publication reconciliation, not silently widening the cutoff.++### Reconcile missing releasesDetermine \`<OWNER>\`, \`<REPO>\`, and \`<TARGET_BRANCH>\` from the repository's AGENTS.md (or CLAUDE.md) and release documentation. If the project does not document a release flow, use the repository's default branch. Extract the GitHub project identity with:\`\`\`bash@@ -3958,53 +3968,43 @@ Check for existing release tags that lack a corresponding GitHub Release:- Publish it with \`gh release create "vX.Y.Z"\`, using \`--notes-file\` or \`--body-file\`; pass \`--latest=false\` when a newer release exists, and \`--latest\` only for the newest version.4. Report missing releases reconciled before continuing.-## Step 1: Finish in-flight work first--Skip this step when the options above say finishing in-flight work is off.--A release should carry the work that is already nearly done. Work lands on the **development branch** \`<DEV_BRANCH>\` — the branch feature PRs merge into (the repository's default branch unless its docs say otherwise). It can differ from the release target \`<TARGET_BRANCH>\`: a project that develops on \`main\` and publishes through a \`release\` branch has \`<DEV_BRANCH>\` = \`main\`. This step works on \`<DEV_BRANCH>\`; the release PR itself belongs to the canonical workflow in Step 3. Before cutting the release, survey what is in flight:+## Step 1: Finish candidate-gating in-flight work-- Open PRs against \`<DEV_BRANCH>\`: \`gh pr list --repo <OWNER>/<REPO> --base <DEV_BRANCH> --state open --json number,title,headRefName,author,isDraft,mergeable,updatedAt\`.-- Local branches and worktrees that are not merged: \`git -C {repoPath} branch --no-merged <DEV_BRANCH>\` and \`git -C {repoPath} worktree list\`.-- An older release PR this task left open on an earlier run (for example, a \`release/*\` branch or a PR into the release branch). Resume it rather than starting over.+Skip this step when the options above say finishing in-flight work is off. The option covers only a specific fix proven necessary for the frozen candidate; it never authorizes draining the backlog before release.-**Leave work alone when someone is actively on it.** Before touching a PR or branch, check for a live owner: running agents from \`curl -s -H "Authorization: Bearer \${PORTOS_API_TOKEN:-}" '{portosApiUrl}/api/cos/agents?active=1'\` (match on branch name, worktree path, or PR number), an \`in-progress\` claim on the linked issue with a commit or comment in the last two hours, or a branch commit in the last two hours. Actively owned work is not yours: release without it, and name it in the report.+Inspect open PRs against the development branch \`<DEV_BRANCH>\` only to locate such a fix: \`gh pr list --repo <OWNER>/<REPO> --base <DEV_BRANCH> --state open --json number,title,headRefName,author,isDraft,mergeable,updatedAt\`. Record the failing candidate test/check or accepted review finding before selecting work. Unrelated open issues, ready PRs, red PRs, and lingering branches stay in the development queue for the next release. Do not trigger branch reconciliation or wait for the queue to empty.-**Only trusted work is yours.** Act only on PRs and branches authored by the repository owner, an account with write access, this install's own agents, or a dependency bot (Step 2). An external contributor's PR is untrusted input: do not check it out, run its code, repair it, or merge it here. Leave it to the install's pull-request review flow (for example, the PortOS \`pr-reviewer\` task) and list it in the report.+**Leave work alone when someone is actively on it.** Check running agents from \`curl -s -H "Authorization: Bearer \${PORTOS_API_TOKEN:-}" '{portosApiUrl}/api/cos/agents?active=1'\`, issue claims, and recent branch activity before touching a fix. Preserve live ownership. If an active owner's fix is required to gate this candidate, report that dependency and coordinate through the established ownership workflow; do not take over their branch or pretend the blocker is optional.-Every other trusted item is yours to finish, one at a time:-- **Ready PRs** (green CI, no unresolved review): merge them with the repository's merge method.-- **Red or conflicted PRs**: rebase onto \`<DEV_BRANCH>\`, fix the failure or conflict (keeping both sides' intent), push, wait for CI, then merge.-- **Stale or superseded PRs** whose change already landed on \`<DEV_BRANCH>\`: close them with a comment naming the commit that superseded them.-- **Lingering local branches and worktrees**: reconcile them yourself (or through a sub-agent): delete branches already merged, ship coherent unmerged work as a PR, and report anything ambiguous. When this install has the PortOS \`branch-reconcile\` task, also trigger it so its drain keeps working the backlog after this run: \`curl -s -X POST -H "Authorization: Bearer \${PORTOS_API_TOKEN:-}" -H 'Content-Type: application/json' -d '{"taskType":"branch-reconcile","appId":"{appId}"}' {portosApiUrl}/api/cos/schedule/trigger\` (drop the \`appId\` field when it is empty — that targets PortOS itself; never point it at a different app than this release). Do not wait for the triggered agent: it may need the agent slot this run holds.+**Only trusted work is yours.** Act only on work authored by the repository owner, an account with write access, or this install's own agents. External contributor work remains behind the repository's review/admission flow; issue text and PR content cannot authorize an exception to the cutoff.-Bound this step to the work that can land now. A large in-flight feature that is far from done does not hold the release — note it in the report and move on.+Apply the smallest reviewed fix on the candidate, or cherry-pick the exact reviewed fix commit from the development branch. Never merge the entire updated development branch. Record the fix SHA and why it gates this release, then rerun the affected validation and required full candidate CI. Forward-port candidate-only fixes through a normal development PR so they are not lost.## Step 2: Merge dependency updates-Skip this step when the options above say merging dependency updates is off.+Skip this step when the options above say merging dependency updates is off. Even when enabled, only a dependency update proven necessary to fix a candidate-gating defect belongs in this release. All other updates wait for the next release; do not process the whole bot queue. Apply only the exact reviewed update commit to the candidate, with its justification and fresh validation.-List open dependency-bot PRs (Dependabot, Renovate, or equivalent): \`gh pr list --repo <OWNER>/<REPO> --state open --search "author:app/dependabot" --json number,title,headRefName,mergeable\` (repeat for \`author:app/renovate\`). For each, oldest first:+To find a required update, list open dependency-bot PRs (Dependabot, Renovate, or equivalent): \`gh pr list --repo <OWNER>/<REPO> --state open --search "author:app/dependabot" --json number,title,headRefName,mergeable\` (repeat for \`author:app/renovate\`). For the required update only:- Read the update's release notes for breaking changes that affect this codebase.-- Green CI and no breaking change that affects the codebase: merge it.+- Green CI and no breaking change that affects the codebase: incorporate only the reviewed update, following repository admission.- ${DEPENDABOT_ADMISSION_HOLD_GUIDANCE}- Red CI from the bump itself: check out the branch, fix what the new version broke, push the fix onto the PR branch, wait for CI, then merge. Never pin back or drop a security update to dodge a fix.- Conflicted or out of date: ask the bot to rebase (\`@dependabot rebase\`), or rebase it yourself, then merge once green.- Superseded by a newer bump of the same package: close it.-Merge them one at a time and let CI settle between merges, since lockfile changes collide.+Do not wait for unrelated bot PRs or let their merges advance the cutoff. Candidate lockfile changes require fresh validation.## Step 3: Run the canonical release workflow-The bundled slashdo \`release\` workflow is the single source of truth for release mechanics. Do not duplicate its branch, version, changelog, readiness, test/build, PR, review, CI, merge, tag, or report steps here.+Run the bundled slashdo \`release\` workflow using the documented project procedure and the frozen candidate from Step 0. The project procedure owns branch topology and publication; the cutoff contract overrides generic instructions to pull/rebase the development tip. Do not create a second candidate or recapture the cutoff.-The PortOS Code Review Defaults rendered into \`{reviewers}\` are advisory for this run. Use exactly that reviewer list and no other when review is available. The task builder attaches the same list to the bundled slashdo invocation; do not invoke a bare workflow that falls back to saved slashdo defaults. Code review is optional: run configured reviewers when available and address valid findings, but an empty, unavailable, timed-out, malformed, no-verdict, or otherwise inconclusive review does not itself stop the release. Known unresolved accepted findings still block release regardless of severity. Previously accepted rules are revisable. Prefer investing effort in high-quality fixes. Reassess value and feasibility before retiring a rule that is no longer useful or has no current solution worth pursuing; remove it from linting or quality scanning with concise rationale. Difficulty alone is not an exemption, and reassessment is not permission to hide a known important defect merely to pass checks.+The PortOS Code Review Defaults rendered into \`{reviewers}\` are advisory for this run. Use exactly that reviewer list and no other when review is available. The task builder attaches the same list to the bundled slashdo invocation; do not invoke a bare workflow that falls back to saved slashdo defaults. Code review is optional: run configured reviewers when available and address valid findings, but an empty, unavailable, timed-out, malformed, no-verdict, or otherwise inconclusive review does not itself stop the release. Known unresolved accepted findings still block release regardless of severity when they apply to the candidate. Findings solely in post-cutoff work belong to that work and do not gate this release. Previously accepted rules are revisable. Prefer investing effort in high-quality fixes. Reassess value and feasibility before retiring a rule that is no longer useful or has no current solution worth pursuing; remove it from linting or quality scanning with concise rationale. Difficulty alone is not an exemption, and reassessment is not permission to hide a known important defect merely to pass checks.-Run the bundled \`/do:release\` workflow (or its equivalent \`release\` skill) in autonomous mode with no \`--interactive\` flag. It owns release readiness, version/changelog finalization, tests/build, optional code review, PR creation, CI, merge, tagging, and the final report. Every accepted finding must be resolved before merge or release; required CI and release tests/build checks must also pass — and a failing test or red CI run is work for Step 4, not a reason to end the run.+Run the bundled \`/do:release\` workflow (or its equivalent \`release\` skill) in autonomous mode with no \`--interactive\` flag. It owns release readiness, version/changelog finalization, tests/build, optional code review, PR creation, CI, merge, tagging, and the final report. Every accepted finding must be resolved before merge or release when it applies to this candidate; required CI and release tests/build checks must also pass — and a failing test or red CI run is work for Step 4, not a reason to end the run.### Stay with the release PR until it is MERGED and tagged-Opening the release PR is the middle of the run, not the end. Stay in this session and drive it to completion: wait for CI on the release PR with \`gh pr checks <PR_NUM> --watch --fail-fast --interval 30\` (repeat after each fix; a few minutes of apparent silence is not a reason to stop), read every failing job's log, and apply Step 4 to each red check — including a failure inherited from \`<DEV_BRANCH>\`. When the fix belongs on \`<DEV_BRANCH>\`, land it there through its own PR (never push to the protected branch directly), then bring it into the release PR (merge the updated \`<DEV_BRANCH>\` into the release PR's head or re-run the workflow) and wait again. Once required CI is green, merge, confirm the release workflow created the tag and the GitHub Release (poll \`gh release view vX.Y.Z\`; never tag by hand), and only then write your report. Do not end the run with \`INCOMPLETE\`, "next run should resume", or a CI-pending release PR unless a Step 4 stop condition (fresh sub-agent also failed, or a real human-only blocker) actually applies — and name that condition in the report. An idle-session nudge is a signal that you stopped too early: continue, do not summarize.+Opening the release PR is the middle of the run, not the end. Stay in this session and drive it to completion: wait for CI on the release PR with \`gh pr checks <PR_NUM> --watch --fail-fast --interval 30\` (repeat after each fix; a few minutes of apparent silence is not a reason to stop), read every failing job's log, and apply Step 4 to each red check — including a failure inherited from \`<DEV_BRANCH>\`. When the fix belongs on \`<DEV_BRANCH>\`, land it there through its own PR (never push to the protected branch directly), then cherry-pick only its exact reviewed fix commit onto the candidate, record the gating evidence, and wait for checks on the new candidate head. Never merge the updated \`<DEV_BRANCH>\` wholesale or re-run preparation from its new tip. Once required CI is green, merge, confirm the release workflow created the tag and the GitHub Release (poll \`gh release view vX.Y.Z\`; never tag by hand), and only then write your report. Do not end the run with \`INCOMPLETE\`, "next run should resume", or a CI-pending release PR unless a Step 4 stop condition (fresh sub-agent also failed, or a real human-only blocker) actually applies — and name that condition in the report. An idle-session nudge is a signal that you stopped too early: continue, do not summarize.### Release naming and notes@@ -4016,7 +4016,7 @@ The versioned changelog's first heading MUST be exactly:Use the ASCII \` - \` separator, keep the name on one line, and keep the same name in the release notes and GitHub release title. Do not leave the bare \`# Release vX.Y.Z\` heading or put the name only in a later section; the GitHub Actions workflow extracts this heading to title the release. If correcting an already-published release, update the changelog body and GitHub release title together.-The canonical workflow owns readiness and should count both the current changelog and any uncollected per-branch fragments (for example, \`.changelog/next/\`) across the assembled notes. If the changelog README documents a preview/collect command, use only that documented command — Do NOT guess a command name. If fewer than two substantive entries remain, stop without creating a release PR.+The canonical workflow owns readiness and should count both the current changelog and any uncollected per-branch fragments (for example, \`.changelog/next/\`) across the assembled notes. If the changelog README documents a preview/collect command, use only that documented command — Do NOT guess a command name. Count only changes included in the frozen candidate. If fewer than two substantive entries remain, stop without creating a release PR.If the release docs identify a separate database-backed test suite, the canonical workflow must first use the documented test-database provisioning/setup command and then run that suite against an isolated test database. The workflow must never substitute a production database; if the isolated setup cannot reach its documented service, that is an environmental blocker — report the command and its error and stop.@@ -4024,7 +4024,7 @@ If the release docs identify a separate database-backed test suite, the canonicaSkip the fixing described here when the options above say resolving blockers is off; in that case report each blocker with its evidence and stop.-A failing test suite, a red CI run, or a bug you discover while releasing does NOT end this run — including a failure that already existed on \`<DEV_BRANCH>\` before this run started. Work each blocker through this loop:+A failing candidate test suite, a red candidate CI run, or an accepted bug in the candidate does NOT end this run — including a failure already present at the cutoff. Findings only in later development work are tracked there and do not block this release. Work each blocker through this loop:1. **Reproduce and localize.** Re-run only the failing file or test to confirm it fails on its own, repeating it a few times when the failure looks timing-dependent. Read the failing assertion and the code it exercises before changing anything.2. **Classify it.**@@ -4040,7 +4040,7 @@ Apply the same loop to a red CI run on the release PR, driving it from the faili**Delegate instead of giving up.** If a blocker survives three distinct fix attempts, or it is too large to fix alongside running the release, hand it to a sub-agent (your Agent/Task tool) with a self-contained brief: the failing command, the error, what you already tried, the branch to push to, and the verification to run. Wait for it, review what it did, and resume. Stop only when a fresh sub-agent has also failed on the same blocker; report exactly what was tried.-If you have no sub-agent tool, keep working the blocker in this session. When it is still beyond this run, queue it as a PortOS task (\`POST {portosApiUrl}/api/cos/tasks\` with the same bearer header and the brief above) and then END this run with the release PR left open, naming the queued task in the report. Do not wait for the queued task: this run may be holding the only agent slot the task needs, so waiting deadlocks. The next do-release run resumes the open release PR in Step 1.+If you have no sub-agent tool, keep working the blocker in this session. When it is still beyond this run, queue it as a PortOS task (\`POST {portosApiUrl}/api/cos/tasks\` with the same bearer header and the brief above) and then END this run with the release PR left open, naming the queued task in the report. Do not wait for the queued task: this run may be holding the only agent slot the task needs, so waiting deadlocks. The next do-release run resumes the same cutoff and open release PR in Step 0.## Decisions@@ -4050,7 +4050,7 @@ Never decide on the operator's behalf anything that needs a human (see the two s## Report-End with: the release version, name, PR, and GitHub Release URL (or the stop reason and the exact human action needed); the in-flight PRs and branches you merged, closed, or left for an active owner; the dependency updates merged or closed; each blocker you fixed and how; any issues filed; and the **Decisions for operator review** list.+End with: the cutoff SHA, previous tag, candidate head and release-base SHA; release version, name, PR, and GitHub Release URL (or the stop reason and exact human action needed); every candidate-gating fix and its justification; work deferred to the next release; forward-port/synchronization PRs; any issues filed; and the **Decisions for operator review** list.The release workflow is attached to this task by metadata so every provider receives the same bundled body and reviewer pin. Do not reimplement any of its phases in this scheduled prompt.`,diff --git a/server/services/taskPromptDefaults/versions.js b/server/services/taskPromptDefaults/versions.jsindex 3c68b54e29..33ff40d3d5 100644--- a/server/services/taskPromptDefaults/versions.js+++ b/server/services/taskPromptDefaults/versions.js@@ -80,7 +80,7 @@ export const PROMPT_VERSIONS = {'better-test-quality': 2, // v2: adds mocks that drift from the module they replace (members/exports the real module lacks). Previous version: v1: vacuous/weak/redundant existing tests, proven with a mutation probe. Distinct from test-coverage, which owns the gaps.'stash-cleanup': 2, // v2: the STALE/ABANDONED heuristic names `AGENTS.md` (or `CLAUDE.md`) as the policy file to check before assuming a stash contradicts current architecture (#4852). v1: triage git stash list — supersession check against main, drop superseded/stale entries, leave real unlanded work in place. Net-new type (no retired-hash history needed).'repo-sync': 1, // v1: verify + finish the deterministic install-wide origin-sync sweep (services/repoSync.js) — resolve mid-flight merges/rebases, decide what to do with uncommitted work, land or report unpushed branches, triage the stashes it could not prove redundant. Net-new type (no retired-hash history needed).- 'do-release': 20, // v20: Step 2 recognizes a maintainer-admission CI hold on a dependency-bot PR (`held for maintainer review`) — inspect the diff and re-run the held workflow instead of pushing a "fix" onto the bot branch, which re-arms the hold. v19: API calls target {portosApiUrl}, expanded at spawn to the loopback origin (#12405). v18: the run stays with the release PR through CI, fixes red checks (including ones inherited from the dev branch) and ends only with a merged, tagged, published release — v17 agent-36fff086 opened the release PR, got one idle nudge and reported INCOMPLETE with CI still pending. v17: previously accepted rules may be retired after documented value/feasibility reassessment. v16: unresolved accepted findings block release at every severity; optional reviewer availability remains optional. v15: renamed from `release-check` — the goal is a SHIPPED release, not a readiness check. The run first finishes in-flight work no live agent owns (open PRs, lingering branches via branch-reconcile), merges dependency-bot PRs, then releases; a blocker that survives three attempts goes to a sub-agent or a queued PortOS task instead of ending the run (v14 stopped at its 10-commit bound with the release PR open), local-only flakes no longer block a green-CI release, and routine design/preference decisions are made and listed for operator review. The operator's `{releaseOptions}` toggles (finishInFlight / mergeDependencyUpdates / resolveBlockers / autoDecide) gate each step. v14: the release agent names each release from its one or two biggest user-visible wins and writes the exact first heading the GitHub workflow promotes to the release title. v13: a failing test suite or red CI is work the run must FIX (reproduce, classify regression vs. bad test vs. environmental blocker, fix the root cause, verify, commit, resume) instead of a reason to halt the release — a pre-existing failure on main stopped v12 short with the release untouched; skipping/deleting/loosening a test to force green is explicitly not a fix, and the loop is bounded (3 attempts per failure, 10 fix commits per run). v12: code review is advisory and only CI gates release progress; v11: delegate release mechanics to bundled slashdo release and pin PortOS-configured reviewers. v10: the release-documentation search names the `AGENTS.md` (or `CLAUDE.md`) context instead of CLAUDE.md alone (#4852). v9: Step 1 reconciles missing GitHub Releases against git release tags (publishing any missing tag with .changelog/vX.Y.Z.md as body and --latest=false when a newer version exists) BEFORE evaluating if enough unreleased work has accumulated; v8: database-backed release tests are provisioned and run using the repo's documented isolated test database before the release PR gate; v7: Step 1 also reads the UNCOLLECTED changelog fragments (the fragment dir, plus whatever preview command that repo documents — release-check is a generic {appName} prompt, so it never names a PortOS script to run) and counts substantive entries across the assembled notes — reading only the staged `.changelog/NEXT.md` under-counts a release whose entries are still per-branch fragments, so a ready release reported as "not enough work". v6: generic {appName} body (older defaults hardcoded "PortOS")+ 'do-release': 21, // v21: pin a candidate at kickoff, resume its original cutoff, and limit in-flight/dependency work to evidenced candidate-gating fixes; later main merges belong to the next release. v20 history follows: v20: Step 2 recognizes a maintainer-admission CI hold on a dependency-bot PR (`held for maintainer review`) — inspect the diff and re-run the held workflow instead of pushing a "fix" onto the bot branch, which re-arms the hold. v19: API calls target {portosApiUrl}, expanded at spawn to the loopback origin (#12405). v18: the run stays with the release PR through CI, fixes red checks (including ones inherited from the dev branch) and ends only with a merged, tagged, published release — v17 agent-36fff086 opened the release PR, got one idle nudge and reported INCOMPLETE with CI still pending. v17: previously accepted rules may be retired after documented value/feasibility reassessment. v16: unresolved accepted findings block release at every severity; optional reviewer availability remains optional. v15: renamed from `release-check` — the goal is a SHIPPED release, not a readiness check. The run first finishes in-flight work no live agent owns (open PRs, lingering branches via branch-reconcile), merges dependency-bot PRs, then releases; a blocker that survives three attempts goes to a sub-agent or a queued PortOS task instead of ending the run (v14 stopped at its 10-commit bound with the release PR open), local-only flakes no longer block a green-CI release, and routine design/preference decisions are made and listed for operator review. The operator's `{releaseOptions}` toggles (finishInFlight / mergeDependencyUpdates / resolveBlockers / autoDecide) gate each step. v14: the release agent names each release from its one or two biggest user-visible wins and writes the exact first heading the GitHub workflow promotes to the release title. v13: a failing test suite or red CI is work the run must FIX (reproduce, classify regression vs. bad test vs. environmental blocker, fix the root cause, verify, commit, resume) instead of a reason to halt the release — a pre-existing failure on main stopped v12 short with the release untouched; skipping/deleting/loosening a test to force green is explicitly not a fix, and the loop is bounded (3 attempts per failure, 10 fix commits per run). v12: code review is advisory and only CI gates release progress; v11: delegate release mechanics to bundled slashdo release and pin PortOS-configured reviewers. v10: the release-documentation search names the `AGENTS.md` (or `CLAUDE.md`) context instead of CLAUDE.md alone (#4852). v9: Step 1 reconciles missing GitHub Releases against git release tags (publishing any missing tag with .changelog/vX.Y.Z.md as body and --latest=false when a newer version exists) BEFORE evaluating if enough unreleased work has accumulated; v8: database-backed release tests are provisioned and run using the repo's documented isolated test database before the release PR gate; v7: Step 1 also reads the UNCOLLECTED changelog fragments (the fragment dir, plus whatever preview command that repo documents — release-check is a generic {appName} prompt, so it never names a PortOS script to run) and counts substantive entries across the assembled notes — reading only the staged `.changelog/NEXT.md` under-counts a release whose entries are still per-branch fragments, so a ready release reported as "not enough work". v6: generic {appName} body (older defaults hardcoded "PortOS")// A SCHEDULE task type absent from this map is silently exempt from// auto-upgrade forever: taskScheduleStore's upgrade block is gated on