Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix([issue-1289]): gate series.arc.tickingClock behind pipelineSeries schema v3

[._.]/ Adam Eivyeb85fe4823ca
diff --git a/server/lib/schemaVersions.js b/server/lib/schemaVersions.js
index 8fe94676bd..9ad08bbc09 100644
--- a/server/lib/schemaVersions.js
+++ b/server/lib/schemaVersions.js
@@ -61,7 +61,13 @@ export const PORTOS_SCHEMA_VERSIONS = Object.freeze({
// round-trip a series through its readerMap-unaware sanitizer and LWW-strip
// the field back onto a newer peer. Per-category gate → only series sync
// pauses with old peers; issues/universes keep flowing.
- pipelineSeries: 2,
+ // v3 = `series.arc.tickingClock` added (#1289). Same situation as readerMap:
+ // an additive field INSIDE the series.arc payload, so a ≤v2 peer that receives
+ // and re-sanitizes a series through its tickingClock-unaware `sanitizeArc`
+ // would silently strip the countdown and last-writer-wins the loss back onto
+ // the newer peer. Bump makes the older peer reject the ahead-version series
+ // transfer instead. Per-category gate → only series sync pauses with old peers.
+ pipelineSeries: 3,
// NOT bumped for the manuscript-review sibling doc now bundled on series
// pushes/exports (`data/pipeline-series/{id}/manuscript-review.json`).
// Unlike `readerMap` (v2), the review is NOT a field inside the series
diff --git a/server/lib/schemaVersions.test.js b/server/lib/schemaVersions.test.js
index d777d09c26..0675be0109 100644
--- a/server/lib/schemaVersions.test.js
+++ b/server/lib/schemaVersions.test.js
@@ -26,8 +26,8 @@ describe('PORTOS_SCHEMA_VERSIONS', () => {
it('declares pipeline collection layout versions', () => {
// pipelineIssues bumped to 2 when stages.audio.audioMode + cues[] were added.
expect(PORTOS_SCHEMA_VERSIONS.pipelineIssues).toBe(2);
- // pipelineSeries bumped to 2 when series.arc.readerMap was added.
- expect(PORTOS_SCHEMA_VERSIONS.pipelineSeries).toBe(2);
+ // pipelineSeries bumped to 3 when series.arc.tickingClock was added (v2 = readerMap).
+ expect(PORTOS_SCHEMA_VERSIONS.pipelineSeries).toBe(3);
});
it('declares mediaCollections layout version', () => {
@@ -41,7 +41,7 @@ describe('buildPortosMeta', () => {
expect(meta.portosVersion).toMatch(/^\d+\.\d+\.\d+/);
expect(meta.schemaVersions.universes).toBe(6);
expect(meta.schemaVersions.pipelineIssues).toBe(2);
- expect(meta.schemaVersions.pipelineSeries).toBe(2);
+ expect(meta.schemaVersions.pipelineSeries).toBe(3);
});
it('overrides merge into schemaVersions', async () => {
diff --git a/server/services/dataSync.pipelineUniverse.test.js b/server/services/dataSync.pipelineUniverse.test.js
index c1b3f6be3f..2cdfd4f6cf 100644
--- a/server/services/dataSync.pipelineUniverse.test.js
+++ b/server/services/dataSync.pipelineUniverse.test.js
@@ -1053,12 +1053,12 @@ describe('dataSync — per-category schema gate (cross-key isolation)', () => {
const result = await dataSync.applyRemote('pipeline', {
series: [{ id: 'ser-1', name: 'Foundry', updatedAt: '2026-05-17T11:00:00Z' }],
issues: [],
- }, { portosMeta: { portosVersion: '99.0.0', schemaVersions: { universes: 5, pipelineSeries: 3, pipelineIssues: 1, mediaCollections: 1 } } });
+ }, { portosMeta: { portosVersion: '99.0.0', schemaVersions: { universes: 5, pipelineSeries: 4, pipelineIssues: 1, mediaCollections: 1 } } });
expect(result.applied).toBe(false);
expect(result.blockedBySchema).toBeDefined();
// The reported gap is scoped to the relevant category — NOT mis-attributed.
expect(result.blockedBySchema.ahead).toEqual([
- { category: 'pipelineSeries', senderV: 3, receiverV: 2 },
+ { category: 'pipelineSeries', senderV: 4, receiverV: 3 },
]);
expect(readSeriesState()).toEqual([]); // nothing written
});
diff --git a/server/services/sharing/integration.test.js b/server/services/sharing/integration.test.js
index bd2592be1c..abf3bcf180 100644
--- a/server/services/sharing/integration.test.js
+++ b/server/services/sharing/integration.test.js
@@ -2223,7 +2223,7 @@ describe('sharing round-trip', () => {
const result = await importer.processManifest(bucket.id, exp.filename);
expect(result.skipped).toBe(true);
expect(result.reason).toBe('portos-schema-ahead');
- expect(result.ahead).toEqual([{ category: 'pipelineSeries', senderV: 99, receiverV: 2 }]);
+ expect(result.ahead).toEqual([{ category: 'pipelineSeries', senderV: 99, receiverV: 3 }]);
expect(result.producedByVersion).toBe('99.0.0');
// Series stayed tombstoned (or absent) — apply was refused.
await expect(series.getSeries(s.id)).rejects.toThrow();