@zq-silk/yui 0.6.15 → 0.6.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -984,6 +984,11 @@ const STORED_TASK_V16_FIELDS = [
984
984
  "integrationQueue",
985
985
  "durableJobs",
986
986
  "jobCallerKeyHashes",
987
+ // The SQLite reverse reader reconstructs every physical family map even
988
+ // when the older manifest has not introduced that family yet. A v16
989
+ // aggregate may therefore contain an empty wakes map; preserve that exact
990
+ // repair shape, but reject records because taskWake has no v16 version.
991
+ "wakes",
987
992
  // May already be present after the publicationReference introduction runs
988
993
  // first; the 16->17 normalizer preserves the empty introduced map.
989
994
  "publicationReferences",
@@ -1022,6 +1027,12 @@ function requireStoredTaskV16Shape(snapshot) {
1022
1027
  if (unknown !== undefined) {
1023
1028
  throw new Error(`Task aggregate ${taskId} has an unknown v16 field: ${unknown}.`);
1024
1029
  }
1030
+ if (task.wakes !== undefined) {
1031
+ const wakes = asObject(task.wakes, `Task aggregate ${taskId} wakes`);
1032
+ if (Object.keys(wakes).length > 0) {
1033
+ throw new Error(`Task aggregate ${taskId} already has Task wakes before v17.`);
1034
+ }
1035
+ }
1025
1036
  if (task.publicationReferences !== undefined) {
1026
1037
  const references = asObject(task.publicationReferences, `Task aggregate ${taskId} publicationReferences`);
1027
1038
  if (Object.keys(references).length > 0) {
@@ -1049,6 +1060,9 @@ function normalizeStoredTaskV16ToV17(snapshot) {
1049
1060
  const existingReferences = task.publicationReferences === undefined
1050
1061
  ? {}
1051
1062
  : asObject(task.publicationReferences, `Task aggregate ${taskId} publicationReferences`);
1063
+ const existingWakes = task.wakes === undefined
1064
+ ? {}
1065
+ : asObject(task.wakes, `Task aggregate ${taskId} wakes`);
1052
1066
  const marks = asObject(task.idHighWaterMarks, `Task id high-water marks ${taskId}`);
1053
1067
  const existingMark = marks.publicationReference;
1054
1068
  const existingWakeMark = marks.taskWake;
@@ -1061,7 +1075,7 @@ function normalizeStoredTaskV16ToV17(snapshot) {
1061
1075
  taskWake: typeof existingWakeMark === "number" ? existingWakeMark : TASK_WAKE_FROM_VERSION
1062
1076
  },
1063
1077
  publicationReferences: existingReferences,
1064
- wakes: {}
1078
+ wakes: existingWakes
1065
1079
  };
1066
1080
  }
1067
1081
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zq-silk/yui",
3
- "version": "0.6.15",
3
+ "version": "0.6.16",
4
4
  "description": "Local control plane for long-running native agent CLI sessions backed by tmux.",
5
5
  "license": "MIT",
6
6
  "private": false,