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: make release-check review advisory
[._.]/ Adam Eivyd538e94b3434
diff --git a/scripts/migrations/308-release-check-advisory-review-prompt.js b/scripts/migrations/308-release-check-advisory-review-prompt.jsnew file mode 100644index 0000000000..ed3558e9cd--- /dev/null+++ b/scripts/migrations/308-release-check-advisory-review-prompt.js@@ -0,0 +1,52 @@+/**+ * Upgrade the scheduled release-check prompt to v12, where code review is+ * advisory and CI is the only release merge gate.+ *+ * Existing installs persist task prompts under data/cos/task-schedule.json (and+ * older installs may still use data/task-schedule.json). Customized prompts+ * remain untouched.+ */++import { readFile, writeFile } from 'fs/promises';+import { join } from 'path';+import { DEFAULT_TASK_PROMPTS, PROMPT_VERSIONS } from '../../server/services/taskPromptDefaults.js';++const SCHEDULE_PATHS = [+ join('data', 'cos', 'task-schedule.json'),+ join('data', 'task-schedule.json'),+];++async function readJson(path) {+ const raw = await readFile(path, 'utf-8').catch((err) => {+ if (err.code === 'ENOENT') return null;+ throw err;+ });+ if (raw == null) return null;+ try {+ return JSON.parse(raw);+ } catch {+ return null;+ }+}++export default {+ async up({ rootDir }) {+ let updatedCount = 0;+ for (const relPath of SCHEDULE_PATHS) {+ const fullPath = join(rootDir, relPath);+ const schedule = await readJson(fullPath);+ const task = schedule?.tasks?.['release-check'];+ if (!task) continue;++ const currentVersion = task.promptVersion || 1;+ if (task.promptCustomized || currentVersion >= PROMPT_VERSIONS['release-check']) continue;++ task.prompt = DEFAULT_TASK_PROMPTS['release-check'];+ task.promptVersion = PROMPT_VERSIONS['release-check'];+ await writeFile(fullPath, `${JSON.stringify(schedule, null, 2)}\n`);+ updatedCount += 1;+ console.log(`📝 ${relPath}: upgraded release-check prompt v${currentVersion} → v${PROMPT_VERSIONS['release-check']}`);+ }+ return { updated: updatedCount };+ },+};diff --git a/scripts/migrations/308-release-check-advisory-review-prompt.test.js b/scripts/migrations/308-release-check-advisory-review-prompt.test.jsnew file mode 100644index 0000000000..3576827df9--- /dev/null+++ b/scripts/migrations/308-release-check-advisory-review-prompt.test.js@@ -0,0 +1,70 @@+import { describe, it, expect, beforeEach, afterEach } from 'vitest';+import { mkdtempSync, rmSync, writeFileSync, readFileSync, mkdirSync } from 'fs';+import { tmpdir } from 'os';+import { join } from 'path';++import migration from './308-release-check-advisory-review-prompt.js';+import { DEFAULT_TASK_PROMPTS, PROMPT_VERSIONS, PREVIOUS_DEFAULT_PROMPTS } from '../../server/services/taskPromptDefaults.js';++const writeJson = (path, value) => writeFileSync(path, `${JSON.stringify(value, null, 2)}\n`);+const readJson = (path) => JSON.parse(readFileSync(path, 'utf-8'));+const oldPrompt = PREVIOUS_DEFAULT_PROMPTS['release-check'].at(-1);++describe('migration 308 — make release-check review advisory', () => {+ let rootDir;++ beforeEach(() => {+ rootDir = mkdtempSync(join(tmpdir(), 'migration-308-'));+ mkdirSync(join(rootDir, 'data', 'cos'), { recursive: true });+ });++ afterEach(() => {+ rmSync(rootDir, { recursive: true, force: true });+ });++ it('updates both supported schedule locations and leaves custom prompts alone', async () => {+ const cosPath = join(rootDir, 'data', 'cos', 'task-schedule.json');+ const legacyPath = join(rootDir, 'data', 'task-schedule.json');+ writeJson(cosPath, {+ tasks: {+ 'release-check': { promptVersion: 11, promptCustomized: false, prompt: oldPrompt },+ custom: { promptVersion: 11, promptCustomized: true, prompt: 'keep this' },+ },+ });+ writeJson(legacyPath, {+ tasks: {+ 'release-check': { promptVersion: 11, promptCustomized: false, prompt: oldPrompt },+ },+ });++ const result = await migration.up({ rootDir });++ expect(result.updated).toBe(2);+ expect(readJson(cosPath).tasks['release-check']).toEqual({+ promptVersion: PROMPT_VERSIONS['release-check'],+ promptCustomized: false,+ prompt: DEFAULT_TASK_PROMPTS['release-check'],+ });+ expect(readJson(cosPath).tasks.custom).toEqual({+ promptVersion: 11,+ promptCustomized: true,+ prompt: 'keep this',+ });+ expect(readJson(legacyPath).tasks['release-check'].prompt).toBe(DEFAULT_TASK_PROMPTS['release-check']);+ });++ it('does not rewrite a current or customized prompt', async () => {+ const path = join(rootDir, 'data', 'cos', 'task-schedule.json');+ writeJson(path, {+ tasks: {+ current: { promptVersion: PROMPT_VERSIONS['release-check'], promptCustomized: false, prompt: DEFAULT_TASK_PROMPTS['release-check'] },+ custom: { promptVersion: 11, promptCustomized: true, prompt: 'custom release policy' },+ },+ });++ const result = await migration.up({ rootDir });++ expect(result.updated).toBe(0);+ expect(readJson(path).tasks.custom.prompt).toBe('custom release policy');+ });+});diff --git a/server/services/taskPromptDefaults.test.js b/server/services/taskPromptDefaults.test.jsindex 8579ba41cf..64d35fb172 100644--- a/server/services/taskPromptDefaults.test.js+++ b/server/services/taskPromptDefaults.test.js@@ -537,9 +537,9 @@ describe('taskPromptDefaults integrity snapshot', () => {// release-check READS the changelog rather than writing it, so its fix is the// mirror image: an unreleased set that lives in uncollected fragments must not// read as "not enough work accumulated for a release".- it('release-check v11 delegates release mechanics and configured reviews, preserving v10', () => {+ it('release-check v12 keeps code review advisory and CI as the release gate, preserving v11', () => {const current = DEFAULT_TASK_PROMPTS['release-check'];- expect(PROMPT_VERSIONS['release-check']).toBeGreaterThanOrEqual(11);+ expect(PROMPT_VERSIONS['release-check']).toBeGreaterThanOrEqual(12);expect(current).toContain('Reconcile Missing Releases');expect(current).toContain('Unpublished release detected');expect(current).toContain('--latest=false');@@ -555,6 +555,11 @@ describe('taskPromptDefaults integrity snapshot', () => {expect(current).toContain('never substitute a production database');expect(current).toContain('{reviewers}');expect(current).toContain('/do:release');+ expect(current).toContain('Code review is optional');+ expect(current).toContain('Only CI is the review/merge gate');+ expect(current).toContain('inconclusive review must never stop the release');+ expect(current).not.toContain('If the reviewer list is empty or unavailable, stop');+ expect(current).not.toContain('If it cannot run or a configured reviewer is unavailable or inconclusive, stop');expect(current).not.toMatch(/copilot/i);expect(current).not.toContain('reviewThreads');expect(current).not.toContain('copilot-pull-request-reviewer');@@ -570,6 +575,9 @@ describe('taskPromptDefaults integrity snapshot', () => {const v10 = previous.find((prompt) => prompt.includes('copilot-pull-request-reviewer') && prompt.includes('AGENTS.md'));expect(v10).toBeDefined();expect(v10).not.toBe(current);+ const v11 = previous.find((prompt) => prompt.includes('configured reviewer is unavailable or inconclusive, stop'));+ expect(v11).toBeDefined();+ expect(v11).not.toBe(current);});// The PortOS custom catalog-refresh job still sources this versioned prompt:diff --git a/server/services/taskPromptDefaults/integrity.snapshot.json b/server/services/taskPromptDefaults/integrity.snapshot.jsonindex 0938239258..94a8744fb0 100644--- a/server/services/taskPromptDefaults/integrity.snapshot.json+++ b/server/services/taskPromptDefaults/integrity.snapshot.json@@ -27,7 +27,7 @@"code-reviewer-implement": "2e10cac7c1e1cd021d06bfddb5c1eaf2","error-handling": "9afba2e99b90a8d5771c75e7f0615d96","typing": "1f2758ce0bb62d789a21aec241549531",- "release-check": "64be10f6ac7bcf74d4fc257089fc179b",+ "release-check": "644e5f2f6df1daf06f3792a81ba7a51a","stash-cleanup": "1c12bac5aac6bb27008c40981e7db08c","repo-sync": "0a648d35d43b023b758226b9c709c8ea","jira-sprint-manager": "3e63c8a3bdf0d5a05a30faaa2dc07980",@@ -77,7 +77,7 @@"copy": 1,"stash-cleanup": 2,"repo-sync": 1,- "release-check": 11+ "release-check": 12},"REFERENCE_WATCH_AUDITED_VERSION": 3,"PREVIOUS_DEFAULT_PROMPTS": {@@ -223,7 +223,8 @@"746f11daaf721eae9e16845858ef55ee","08c928e6f79f83535e40b6988ff6eae3","afa9039cfbff21d77d601dc74eb5b81f",- "2d2a6700c23b73bf738c2aa915e37277"+ "2d2a6700c23b73bf738c2aa915e37277",+ "64be10f6ac7bcf74d4fc257089fc179b"],"branch-reconcile": ["7ef2b5f7d8f05937d4912b26ad45f42e",diff --git a/server/services/taskPromptDefaults/previousDefaults.js b/server/services/taskPromptDefaults/previousDefaults.jsindex 9c4aa0df59..ed4a9470f5 100644--- a/server/services/taskPromptDefaults/previousDefaults.js+++ b/server/services/taskPromptDefaults/previousDefaults.js@@ -10583,7 +10583,47 @@ Summarize:'Then search for release documentation. Check your AGENTS.md (or CLAUDE.md) context (already provided above) for "Git Workflow", "Release", or "Changelog" sections. If the release process is not clear from those instructions, check these files in order (use whichever exist):');if (v10 === history.at(-1)) throw new Error('release-check v10 historical prompt derivation did not match v9');- return [...history, v10];+ // v11 delegated release mechanics to slashdo and pinned the configured+ // reviewers. Keep that outgoing body byte-for-byte recognizable so v12 can+ // upgrade existing uncustomized schedules without touching user prompts.+ const v11 = `[Improvement: {appName}] Release Check++Repository: {repoPath}++This scheduled task is a thin coordinator for {appName}'s release. 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.++## Step 0: Reconcile Missing Releases++Before evaluating unreleased work, determine \`<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+cd {repoPath} && gh repo view --json owner,name --jq '"OWNER=" + .owner.login + " REPO=" + .name'+\`\`\`++Check for existing release tags that lack a corresponding GitHub Release:+1. \`git -C {repoPath} fetch --tags origin\`+2. List version tags on \`<TARGET_BRANCH>\` / \`origin\` and published releases:+ \`\`\`bash+ gh release list --repo <OWNER>/<REPO> --limit 100+ \`\`\`+3. Compare every \`vX.Y.Z\` tag with published releases. For each missing release:+ - Report it explicitly as "Unpublished release detected: vX.Y.Z".+ - Find its changelog body (for example, \`.changelog/vX.Y.Z.md\` or \`.changelog/vX.Y.x.md\`).+ - Check whether a newer version exists.+ - 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.++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.++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, report the environmental blocker and stop.++## Step 1: Run the canonical release workflow++The PortOS Code Review Defaults rendered into \`{reviewers}\` are authoritative for this run. Use exactly that reviewer list and no other. 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. PortOS-only configured reviewers still run through the Local Reviewer Procedure appended to this prompt. If the reviewer list is empty or unavailable, stop before creating or updating a release PR.++Run the bundled \`/do:release\` workflow (or its equivalent \`release\` skill) exactly once, in autonomous mode with no \`--interactive\` flag. It owns release readiness, version/changelog finalization, tests/build, local review, PR creation, the configured reviewer loop, CI, merge, tagging, and the final report. If it cannot run or a configured reviewer is unavailable or inconclusive, stop and report instead of substituting another reviewer.++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.`;+ return [...history, v10, v11];})(),'branch-reconcile': [// v1 default — superseded by v2, whose Rules make "merged" (not "PR opened")diff --git a/server/services/taskPromptDefaults/prompts.js b/server/services/taskPromptDefaults/prompts.jsindex ad4e9a49b4..24b718aa9d 100644--- a/server/services/taskPromptDefaults/prompts.js+++ b/server/services/taskPromptDefaults/prompts.js@@ -1720,9 +1720,9 @@ If the release docs identify a separate database-backed test suite, the canonica## Step 1: Run the canonical release workflow-The PortOS Code Review Defaults rendered into \`{reviewers}\` are authoritative for this run. Use exactly that reviewer list and no other. 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. PortOS-only configured reviewers still run through the Local Reviewer Procedure appended to this prompt. If the reviewer list is empty or unavailable, stop before creating or updating a release PR.+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 must never stop the release.-Run the bundled \`/do:release\` workflow (or its equivalent \`release\` skill) exactly once, in autonomous mode with no \`--interactive\` flag. It owns release readiness, version/changelog finalization, tests/build, local review, PR creation, the configured reviewer loop, CI, merge, tagging, and the final report. If it cannot run or a configured reviewer is unavailable or inconclusive, stop and report instead of substituting another reviewer.+Run the bundled \`/do:release\` workflow (or its equivalent \`release\` skill) exactly once, 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. Only CI is the review/merge gate; required release tests/build checks still must pass. If the workflow itself cannot run, its required tests/build checks fail, or CI fails, stop and report; do not stop or leave the release open because code review is unavailable or inconclusive.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 8d62f524dd..83bf63df59 100644--- a/server/services/taskPromptDefaults/versions.js+++ b/server/services/taskPromptDefaults/versions.js@@ -48,7 +48,7 @@ export const PROMPT_VERSIONS = {'copy': 1, // v1: copy/text-clarity audit (jargon, ambiguous action verbs, dead-end errors, pluralization). Net-new type. Mode injected at dispatch.'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 PREVIOUS_DEFAULT_PROMPTS entry 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 PREVIOUS_DEFAULT_PROMPTS entry needed).- 'release-check': 11, // 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")+ 'release-check': 12, // 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")};// Audit anchor for reference-watch's read/write coupling.