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
address review (codex): gate plan-only task federation
[._.]/ Adam Eivyb80438b6f47e
diff --git a/server/lib/schemaVersions.js b/server/lib/schemaVersions.jsindex ade8440072..3097530aa3 100644--- a/server/lib/schemaVersions.js+++ b/server/lib/schemaVersions.js@@ -584,7 +584,14 @@ export const PORTOS_SCHEMA_VERSIONS = Object.freeze({// run's state back onto the v6 peer — which by then had correctly passed over// the task. Per-category gate → only cos-tasks sync pauses until the peer// upgrades.- cosTasks: 6,+ // v7 = plan-only issue-filing tasks (metadata.planOnly, the forced+ // plan-task --issues --yes invocation, and the task-description context+ // bridge). A <=v6 peer accepts the permissive metadata map but does not+ // understand the no-delivery execution contract, so it can claim the task+ // and run the workflow without the description context needed to file the+ // issue. Per-category gate -> only cos-tasks sync pauses until the peer+ // upgrades.+ cosTasks: 7,// NOTE: `videoHistory` is intentionally NOT listed here. The version gate// rejects the ENTIRE snapshot/push payload on ANY ahead-mismatch (the// comparator walks the union of keys), so declaring a brand-new key woulddiff --git a/server/services/sharing/cosTasksSync.test.js b/server/services/sharing/cosTasksSync.test.jsindex f2ce56824a..619b202ef1 100644--- a/server/services/sharing/cosTasksSync.test.js+++ b/server/services/sharing/cosTasksSync.test.js@@ -40,6 +40,7 @@ import {buildCosTasksPayload,syncCosTasksFromPeer,} from './peerSync.js';+import { PORTOS_SCHEMA_VERSIONS } from '../../lib/schemaVersions.js';import { getPeers } from '../instances.js';import { peerFetch } from '../../lib/peerHttpClient.js';import { getUserTasks, getCosTasks, mergePeerTasks } from '../cosTaskStore.js';@@ -69,7 +70,7 @@ describe('buildCosTasksPayload', () => {vi.mocked(getUserTasks).mockResolvedValue({ tasks: [task('task-a', 'pending')] });vi.mocked(getCosTasks).mockResolvedValue({ tasks: [task('sys-b', 'in_progress', { metadata: { claimedBy: 'i1' } })] });const p = await buildCosTasksPayload();- expect(p.schemaVersion).toBe(6); // v6: metadata.targetInstanceId — per-task instance pin (#4520)+ expect(p.schemaVersion).toBe(PORTOS_SCHEMA_VERSIONS.cosTasks); // v7: plan-only issue-filing execution semanticsexpect(p.listHash).toMatch(/^[a-f0-9]{64}$/);expect(p.tasks).toHaveLength(2);const user = p.tasks.find((t) => t.id === 'task-a');@@ -104,7 +105,7 @@ describe('buildCosTasksPayload', () => {it('returns an empty payload when there are no tasks', async () => {const p = await buildCosTasksPayload();expect(p.tasks).toEqual([]);- expect(p.schemaVersion).toBe(6); // v6: metadata.targetInstanceId — per-task instance pin (#4520)+ expect(p.schemaVersion).toBe(PORTOS_SCHEMA_VERSIONS.cosTasks); // v7: plan-only issue-filing execution semantics});});@@ -116,7 +117,11 @@ describe('syncCosTasksFromPeer', () => {});it('gently skips a sender whose payload schema is ahead', async () => {- vi.mocked(peerFetch).mockResolvedValue(payloadRes({ schemaVersion: 999, listHash: sha('x'), tasks: [] }));+ vi.mocked(peerFetch).mockResolvedValue(payloadRes({+ schemaVersion: PORTOS_SCHEMA_VERSIONS.cosTasks + 1,+ listHash: sha('x'),+ tasks: [],+ }));const r = await syncCosTasksFromPeer(PEER);expect(r).toEqual({ merged: 0, skipped: 'schema-ahead' });expect(mergePeerTasks).not.toHaveBeenCalled();