@ariestools/toolchain 10.1.2 → 10.1.3

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.
@@ -52,6 +52,15 @@ export declare const githubIssueIsOpen: (issue: Pick<GithubIssueSnapshot, 'state
52
52
  export declare const readGithubStoreNumber: (stores: Record<string, unknown>) => number | undefined;
53
53
  export declare const readGithubStoreUrl: (stores: Record<string, unknown>) => string | undefined;
54
54
  export declare const formatGithubWorkIssueBody: (item: WorkItem) => string;
55
+ /**
56
+ Compare issue bodies, ignoring the CRLF line endings and surrounding whitespace GitHub can add.
57
+ */
58
+ export declare const githubIssueBodiesMatch: (a: string, b: string) => boolean;
59
+ /**
60
+ Drop the sections `formatGithubWorkIssueBody` generates (metadata, marker, footer) so an imported
61
+ xy-work issue body can be rendered again without repeating them.
62
+ */
63
+ export declare const stripXyWorkGeneratedBody: (body: string) => string;
55
64
  export declare const inferWorkTypeFromGithubLabels: (labels: readonly string[]) => WorkType;
56
65
  export declare const githubWorkItemId: (issueNumber: number) => string;
57
66
  export declare const normalizeGithubIssueToWorkItem: (issue: GithubIssueSnapshot) => WorkItem;
@@ -1 +1 @@
1
- {"version":3,"file":"github.d.ts","sourceRoot":"","sources":["../../../src/actions/work/github.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAI1E,OAAO,KAAK,EACV,QAAQ,EAAc,QAAQ,EAC/B,MAAM,aAAa,CAAA;AAEpB;;EAEE;AACF,eAAO,MAAM,oBAAoB,YAAY,CAAA;AAE7C;;EAEE;AACF,eAAO,MAAM,iCAAiC,kBAAkB,CAAA;AAEhE,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAA;IACd,GAAG,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;IACj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AEnD,CAAA;AAED,eAAO,MAAM,mBAAmB,UAAW,IAAI,CAAC,mBAAmB,EAAE,MAAM,GAAG,QAAQ,CAAC,KAAG,OAEzF,CAAA;AAED;;EAEE;AACF,eAAO,MAAM,2BAA2B,SAAU,MAAM,KAAG,MAAM,GAAG,SAKnE,CAAA;AAED,eAAO,MAAM,iBAAiB,UAAW,IAAI,CAAC,mBAAmB,EAAE,OAAO,CAAC,KAAG,OAE7E,CAAA;AAED,eAAO,MAAM,qBAAqB,WAAY,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAG,MAAM,GAAG,SAIhF,CAAA;AAED,eAAO,MAAM,kBAAkB,WAAY,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAG,MAAM,GAAG,SAG7E,CAAA;AAED,eAAO,MAAM,yBAAyB,SAAU,QAAQ,KAAG,MA4C1D,CAAA;AAID;;EAEE;AACF,eAAO,MAAM,sBAAsB,MAAO,MAAM,KAAK,MAAM,KAAG,OAE7D,CAAA;AAID;;;EAGE;AACF,eAAO,MAAM,wBAAwB,SAAU,MAAM,KAAG,MAGvD,CAAA;AAuBD,eAAO,MAAM,6BAA6B,WAAY,SAAS,MAAM,EAAE,KAAG,QAMzE,CAAA;AAED,eAAO,MAAM,gBAAgB,gBAAiB,MAAM,KAAG,MAEtD,CAAA;AAED,eAAO,MAAM,8BAA8B,UAAW,mBAAmB,KAAG,QA+B3E,CAAA;AAED,eAAO,MAAM,oBAAoB,WAAY,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAG,mBAAmB,GAAG,SAW5F,CAAA;AAyDD,eAAO,MAAM,sBAAsB,YAAY,gBAAgB,KAA6B,gBA8D3F,CAAA;AAED,eAAO,MAAM,uBAAuB,kBAA2B,CAAA"}
@@ -20,6 +20,9 @@ export declare const workDone: (options: WorkDoneOptions) => import("./result.ts
20
20
  export interface WorkUpdateOptions extends WorkScopeOptions {
21
21
  acceptanceCriteria?: readonly string[];
22
22
  area?: string;
23
+ /**
24
+ Replaces the blocked reason; an empty or whitespace-only value removes it.
25
+ */
23
26
  blockedReason?: string;
24
27
  confidence?: number;
25
28
  description?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../../../src/actions/work/lifecycle.ts"],"names":[],"mappings":"AAUA,OAAO,EAEL,KAAK,QAAQ,EACb,KAAK,UAAU,EAChB,MAAM,aAAa,CAAA;AAEpB,OAAO,EAGL,KAAK,gBAAgB,EACtB,MAAM,gBAAgB,CAAA;AAEvB,MAAM,WAAW,gBAAiB,SAAQ,gBAAgB;IACxD,EAAE,EAAE,MAAM,CAAA;IACV,GAAG,CAAC,EAAE,IAAI,CAAA;CACX;AAED,eAAO,MAAM,SAAS,YAAa,gBAAgB;;;EAMlD,CAAA;AAED,MAAM,WAAW,eAAgB,SAAQ,gBAAgB;IACvD,QAAQ,EAAE,MAAM,CAAA;IAChB,EAAE,EAAE,MAAM,CAAA;IACV,GAAG,CAAC,EAAE,IAAI,CAAA;CACX;AAED,eAAO,MAAM,QAAQ,YAAa,eAAe;;;EAiBhD,CAAA;AAED,MAAM,WAAW,iBAAkB,SAAQ,gBAAgB;IACzD,kBAAkB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACtC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,GAAG,CAAC,EAAE,IAAI,CAAA;IACV,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,UAAU,CAAA;IACnB,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,C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AAO,CAAC,EAAE,MAAM,CAAA;IAChB,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CACjC;AAOD,eAAO,MAAM,UAAU,YAAa,iBAAiB;;;EAgCpD,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"lint.d.ts","sourceRoot":"","sources":["../../../src/actions/work/lint.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,mBAAmB,EAGpB,MAAM,kBAAkB,CAAA;AAEzB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAUnD,OAAO,EAGL,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACtB,MAAM,gBAAgB,CAAA;AAEvB,MAAM,WAAW,eAAgB,SAAQ,gBAAgB;IACvD,MAAM,CAAC,EAAE,gBAAgB,CAAA;IACzB,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;AAED,MAAM,WAAW,mBAAmB;IAClC,aAAa,EAAE,MAAM,EAAE,CAAA;IACvB,aAAa,EAAE,OAAO,CAAA;IACtB,iBAAiB,EAAE,OAAO,CAAA;IAC1B,eAAe,EAAE,MAAM,EAAE,CAAA;IACzB,UAAU,EAAE,OAAO,CAAA;IACnB,IAAI,EAAE,QAAQ,CAAA;CACf;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,mBAAmB,EAAE,CAAA;CAC7B;AAyGD,eAAO,MAAM,eAAe,EAAE,mBAAmB,CAAC,eAAe,CAAC,EA6DjE,CAAA;AAkBD,eAAO,MAAM,QAAQ,aAAmB,eAAe,sDAkCtD,CAAA"}
1
+ {"version":3,"file":"lint.d.ts","sourceRoot":"","sources":["../../../src/actions/work/lint.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,mBAAmB,EAGpB,MAAM,kBAAkB,CAAA;AAEzB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAUnD,OAAO,EAGL,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACtB,MAAM,gBAAgB,CAAA;AAEvB,MAAM,WAAW,eAAgB,SAAQ,gBAAgB;IACvD,MAAM,CAAC,EAAE,gBAAgB,CAAA;IACzB,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;AAED,MAAM,WAAW,mBAAmB;IAClC,aAAa,EAAE,MAAM,EAAE,CAAA;IACvB,aAAa,EAAE,OAAO,CAAA;IACtB,iBAAiB,EAAE,OAAO,CAAA;IAC1B,eAAe,EAAE,MAAM,EAAE,CAAA;IACzB,UAAU,EAAE,OAAO,CAAA;IACnB,IAAI,EAAE,QAAQ,CAAA;CACf;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,mBAAmB,EAAE,CAAA;CAC7B;AA4GD,eAAO,MAAM,eAAe,EAAE,mBAAmB,CAAC,eAAe,CAAC,EA6DjE,CAAA;AAkBD,eAAO,MAAM,QAAQ,aAAmB,eAAe,sDAkCtD,CAAA"}
@@ -1,5 +1,9 @@
1
1
  import type { WorkItem, WorkPriority } from './schema.ts';
2
2
  export declare const calculatePriorityScore: (priority: WorkPriority | undefined, formula?: string) => number | undefined;
3
3
  export declare const compareWorkItemsByPriority: (a: WorkItem, b: WorkItem, formula?: string) => number;
4
- export declare const priorityFromPartial: (partial: Partial<WorkPriority>) => WorkPriority | undefined;
4
+ /**
5
+ Build a priority from the fields given. Fields left out keep their value from `base` (the stored
6
+ priority on update), or default to 3 when there is no base.
7
+ */
8
+ export declare const priorityFromPartial: (partial: Partial<WorkPriority>, base?: WorkPriority) => WorkPriority | undefined;
5
9
  //# sourceMappingURL=priority.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"priority.d.ts","sourceRoot":"","sources":["../../../src/actions/work/priority.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,QAAQ,EAAE,YAAY,EACvB,MAAM,aAAa,CAAA;AAMpB,eAAO,MAAM,sBAAsB,aACvB,YAAY,GAAG,SAAS,uBAEjC,MAAM,GAAG,SAkBX,CAAA;AAED,eAAO,MAAM,0BAA0B,MAClC,QAAQ,KACR,QAAQ,uBAEV,MAMF,CAAA;AAED,eAAO,MAAM,mBAAmB,YAAa,OAAO,CAAC,YAAY,CAAC,KAAG,YAAY,GAAG,SASnF,CAAA"}
1
+ {"version":3,"file":"priority.d.ts","sourceRoot":"","sources":["../../../src/actions/work/priority.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,QAAQ,EAAE,YAAY,EACvB,MAAM,aAAa,CAAA;AAMpB,eAAO,MAAM,sBAAsB,aACvB,YAAY,GAAG,SAAS,uBAEjC,MAAM,GAAG,SAkBX,CAAA;AAED,eAAO,MAAM,0BAA0B,MAClC,QAAQ,KACR,QAAQ,uBAEV,MAMF,CAAA;AAED;;;EAGE;AACF,eAAO,MAAM,mBAAmB,YAAa,OAAO,CAAC,YAAY,CAAC,SAAS,YAAY,KAAG,YAAY,GAAG,SASxG,CAAA"}
@@ -24,6 +24,10 @@ export interface WorkSyncOptions {
24
24
  now?: Date;
25
25
  }
26
26
  export interface WorkSyncDrift {
27
+ /**
28
+ Open linked pairs owned by xy work whose GitHub body differs from the local item's rendering.
29
+ */
30
+ bodyMismatch: string[];
27
31
  /**
28
32
  xy-work (or otherwise marked) GitHub issues not present as local items.
29
33
  */
@@ -56,7 +60,7 @@ export declare const computeWorkSyncDrift: (cwd: string, options?: {
56
60
  *
57
61
  * - Local active items without a GitHub link → create a marked GitHub issue
58
62
  * - Open/closed GitHub issues not present locally → import as local items
59
- * - Linked pairs: reconcile title (newer wins) and status (done/wontfix ↔ closed)
63
+ * - Linked pairs: reconcile title (newer wins), body of xy-work issues (local wins), and status (done/wontfix ↔ closed)
60
64
  */
61
65
  export declare const workSync: (options?: WorkSyncOptions) => import("./result.ts").WorkActionResult<{
62
66
  summary: WorkSyncSummary;
@@ -1 +1 @@
1
- {"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../../src/actions/work/sync.ts"],"names":[],"mappings":"AACA,OAAO,EAKL,KAAK,gBAAgB,EAMtB,MAAM,aAAa,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AEE;IACF,aAAa,EAAE,MAAM,EAAE,CAAA;CACxB;AAED,eAAO,MAAM,kBAAkB,QAAO,aAMpC,CAAA;AAEF,eAAO,MAAM,oBAAoB,UAAW,aAAa,KAAG,OAM3D,CAAA;AAuDD;;;GAGG;AACH,eAAO,MAAM,oBAAoB,QAC1B,MAAM,YACF;IACP,MAAM,CAAC,EAAE,UAAU,CAAA;IACnB,MAAM,CAAC,EAAE,gBAAgB,CAAA;CAC1B,KACA,aA4BF,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,aAAa,eAAe;;EAsBhD,CAAA"}
package/dist/bin/xy.mjs CHANGED
@@ -7149,7 +7149,7 @@ var require_semver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
7149
7149
  //#region src/lib/toolchainVersion.ts
7150
7150
  createRequire(import.meta.url);
7151
7151
  function bundledToolchainVersion() {
7152
- return "10.1.2";
7152
+ return "10.1.3";
7153
7153
  }
7154
7154
  function bundledToolchainRange() {
7155
7155
  return `^${bundledToolchainVersion()}`;
@@ -57827,6 +57827,22 @@ const formatGithubWorkIssueBody = (item) => {
57827
57827
  ].join("\n"));
57828
57828
  return sections.join("\n\n");
57829
57829
  };
57830
+ const normalizeGithubIssueBody = (body) => body.replaceAll("\r\n", "\n").trim();
57831
+ /**
57832
+ Compare issue bodies, ignoring the CRLF line endings and surrounding whitespace GitHub can add.
57833
+ */
57834
+ const githubIssueBodiesMatch = (a, b) => {
57835
+ return normalizeGithubIssueBody(a) === normalizeGithubIssueBody(b);
57836
+ };
57837
+ const XY_WORK_GENERATED_SECTION_PATTERN = /(?:^|\n)(?:## xy work metadata\b|(?:---[ \t]*\r?\n)?[ \t]*<!--\s*xy-work:)/i;
57838
+ /**
57839
+ Drop the sections `formatGithubWorkIssueBody` generates (metadata, marker, footer) so an imported
57840
+ xy-work issue body can be rendered again without repeating them.
57841
+ */
57842
+ const stripXyWorkGeneratedBody = (body) => {
57843
+ const match = XY_WORK_GENERATED_SECTION_PATTERN.exec(body);
57844
+ return (match === null ? body : body.slice(0, match.index)).trim();
57845
+ };
57830
57846
  const TYPE_LABEL_MAP = [
57831
57847
  ["bug", "bug"],
57832
57848
  ["type:bug", "bug"],
@@ -58017,6 +58033,20 @@ const isTerminalWorkStatus = (status) => {
58017
58033
  return status === "done" || status === "wontfix";
58018
58034
  };
58019
58035
  /**
58036
+ Sync may edit a linked issue only when its body marker names this item and the stored URL matches.
58037
+ */
58038
+ const githubIssueBelongsToItem = (item, issue) => {
58039
+ const storedUrl = readGithubStoreUrl(item.stores);
58040
+ return parseXyWorkIdFromGithubBody(issue.body) === item.id && (storedUrl === void 0 || storedUrl === issue.url);
58041
+ };
58042
+ /**
58043
+ The body of an issue xy work owns is rendered from the local item and cannot be imported back,
58044
+ so any difference counts as drift and sync pushes the local rendering.
58045
+ */
58046
+ const githubBodyDrifted = (item, issue) => {
58047
+ return githubIssueBelongsToItem(item, issue) && !githubIssueBodiesMatch(formatGithubWorkIssueBody(item), issue.body);
58048
+ };
58049
+ /**
58020
58050
  * Normalize open GitHub issues that were not created by `xy work` into WorkItem shape.
58021
58051
  * Issues already linked from local items (or marked with the xy-work label/marker) are skipped.
58022
58052
  */
@@ -58054,6 +58084,7 @@ const importGithubIssueLocally = (cwd, issue, now, preferredId) => {
58054
58084
  const item = {
58055
58085
  ...base,
58056
58086
  completedAt: open ? void 0 : base.updatedAt || nowIso(now),
58087
+ description: createdByXyWork ? stripXyWorkGeneratedBody(base.description) : base.description,
58057
58088
  id,
58058
58089
  status: open ? "open" : "done",
58059
58090
  stores: { github: {
@@ -58130,26 +58161,33 @@ const attachOrImportGithubIssues = (cwd, issuesByNumber, summary, now) => {
58130
58161
  }
58131
58162
  }
58132
58163
  };
58133
- const reconcileTitleDrift = (cwd, github, item, issue, number, summary, canMutateGithub = true, now) => {
58134
- if (item.title === issue.title) return {
58164
+ /**
58165
+ Title: newer side wins. Body: the local rendering always wins on issues the item owns.
58166
+ */
58167
+ const reconcileContentDrift = (cwd, github, item, issue, number, summary, canMutateGithub = true, now) => {
58168
+ const titleDrifted = item.title !== issue.title;
58169
+ const bodyDrifted = githubBodyDrifted(item, issue);
58170
+ if (!titleDrifted && !bodyDrifted) return {
58171
+ localChanged: false,
58172
+ next: item
58173
+ };
58174
+ const localIsNewer = item.updatedAt.localeCompare(issue.updatedAt) >= 0;
58175
+ const pushTitle = titleDrifted && localIsNewer && canMutateGithub;
58176
+ if (pushTitle || bodyDrifted) {
58177
+ const body = formatGithubWorkIssueBody(item);
58178
+ github.updateIssue(cwd, number, pushTitle ? {
58179
+ body,
58180
+ title: item.title
58181
+ } : { body });
58182
+ summary.updatedGithub.push(`${item.id}→#${String(number)}`);
58183
+ issue.body = body;
58184
+ if (pushTitle) issue.title = item.title;
58185
+ issue.updatedAt = nowIso(now);
58186
+ }
58187
+ if (!titleDrifted || localIsNewer) return {
58135
58188
  localChanged: false,
58136
58189
  next: item
58137
58190
  };
58138
- if (item.updatedAt.localeCompare(issue.updatedAt) >= 0) {
58139
- if (canMutateGithub) {
58140
- github.updateIssue(cwd, number, {
58141
- body: formatGithubWorkIssueBody(item),
58142
- title: item.title
58143
- });
58144
- summary.updatedGithub.push(`${item.id}→#${String(number)}`);
58145
- issue.title = item.title;
58146
- issue.updatedAt = nowIso(now);
58147
- }
58148
- return {
58149
- localChanged: false,
58150
- next: item
58151
- };
58152
- }
58153
58191
  return {
58154
58192
  localChanged: true,
58155
58193
  next: {
@@ -58177,15 +58215,16 @@ const reconcileLinkedItem = (cwd, github, item, issue, number, summary, now) =>
58177
58215
  let localChanged = false;
58178
58216
  const issueOpen = githubIssueIsOpen(issue);
58179
58217
  const localTerminal = isTerminalWorkStatus(item.status);
58180
- const markerId = parseXyWorkIdFromGithubBody(issue.body);
58181
- const storedUrl = readGithubStoreUrl(item.stores);
58182
- const canMutateGithub = markerId === item.id && (storedUrl === void 0 || storedUrl === issue.url);
58218
+ const canMutateGithub = githubIssueBelongsToItem(item, issue);
58183
58219
  if (localTerminal && issueOpen) {
58184
58220
  if (canMutateGithub) {
58185
58221
  github.updateIssue(cwd, number, { state: "closed" });
58186
58222
  summary.closedGithub.push(`${item.id}→#${String(number)}`);
58187
58223
  issue.state = "CLOSED";
58188
- } else xyLog(`Sync reconcile skipped closing GitHub #${String(number)}: body marker (${markerId ?? "none"}) does not match ${item.id} or URL mismatch`);
58224
+ } else {
58225
+ const markerId = parseXyWorkIdFromGithubBody(issue.body);
58226
+ xyLog(`Sync reconcile skipped closing GitHub #${String(number)}: body marker (${markerId ?? "none"}) does not match ${item.id} or URL mismatch`);
58227
+ }
58189
58228
  } else if (!localTerminal && !issueOpen) {
58190
58229
  next = {
58191
58230
  ...next,
@@ -58196,9 +58235,9 @@ const reconcileLinkedItem = (cwd, github, item, issue, number, summary, now) =>
58196
58235
  };
58197
58236
  localChanged = true;
58198
58237
  } else if (!localTerminal && issueOpen) {
58199
- const titleResult = reconcileTitleDrift(cwd, github, next, issue, number, summary, canMutateGithub, now);
58200
- next = titleResult.next;
58201
- localChanged ||= titleResult.localChanged;
58238
+ const contentResult = reconcileContentDrift(cwd, github, next, issue, number, summary, canMutateGithub, now);
58239
+ next = contentResult.next;
58240
+ localChanged ||= contentResult.localChanged;
58202
58241
  }
58203
58242
  const urlResult = ensureGithubStoreUrl(next, issue, number);
58204
58243
  next = urlResult.next;
@@ -58236,13 +58275,14 @@ const logSyncSummary = (summary) => {
58236
58275
  ].join("\n"));
58237
58276
  };
58238
58277
  const emptyWorkSyncDrift = () => ({
58278
+ bodyMismatch: [],
58239
58279
  githubMissingLocal: [],
58240
58280
  localMissingGithub: [],
58241
58281
  statusMismatch: [],
58242
58282
  titleMismatch: []
58243
58283
  });
58244
58284
  const workSyncDriftIsClean = (drift) => {
58245
- return drift.githubMissingLocal.length === 0 && drift.localMissingGithub.length === 0 && drift.statusMismatch.length === 0 && drift.titleMismatch.length === 0;
58285
+ return drift.bodyMismatch.length === 0 && drift.githubMissingLocal.length === 0 && drift.localMissingGithub.length === 0 && drift.statusMismatch.length === 0 && drift.titleMismatch.length === 0;
58246
58286
  };
58247
58287
  const recordLocalMissingGithub = (localItems, drift) => {
58248
58288
  for (const item of localItems) {
@@ -58258,7 +58298,11 @@ const recordLinkedPairDrift = (issue, linked, drift) => {
58258
58298
  drift.statusMismatch.push(`${linked.id} done/wontfix but GitHub #${String(issue.number)} open`);
58259
58299
  return;
58260
58300
  }
58261
- if (!localTerminal && !issueOpen) drift.statusMismatch.push(`${linked.id} open locally but GitHub #${String(issue.number)} closed`);
58301
+ if (!localTerminal && !issueOpen) {
58302
+ drift.statusMismatch.push(`${linked.id} open locally but GitHub #${String(issue.number)} closed`);
58303
+ return;
58304
+ }
58305
+ if (!localTerminal && githubBodyDrifted(linked, issue)) drift.bodyMismatch.push(`${linked.id}/#${String(issue.number)}`);
58262
58306
  };
58263
58307
  const recordUnlinkedXyWorkDrift = (issue, localById, drift) => {
58264
58308
  if (!isXyWorkGithubIssue(issue)) return;
@@ -58303,7 +58347,7 @@ const computeWorkSyncDrift = (cwd, options = {}) => {
58303
58347
  *
58304
58348
  * - Local active items without a GitHub link → create a marked GitHub issue
58305
58349
  * - Open/closed GitHub issues not present locally → import as local items
58306
- * - Linked pairs: reconcile title (newer wins) and status (done/wontfix ↔ closed)
58350
+ * - Linked pairs: reconcile title (newer wins), body of xy-work issues (local wins), and status (done/wontfix ↔ closed)
58307
58351
  */
58308
58352
  const workSync = (options = {}) => {
58309
58353
  const cwd = options.cwd ?? process.cwd();
@@ -58350,14 +58394,18 @@ const compareWorkItemsByPriority = (a, b, formula = DEFAULT_PRIORITY_FORMULA) =>
58350
58394
  if (aScore !== void 0 && bScore === void 0) return -1;
58351
58395
  return aScore === void 0 && bScore !== void 0 ? 1 : a.createdAt.localeCompare(b.createdAt) || a.id.localeCompare(b.id);
58352
58396
  };
58353
- const priorityFromPartial = (partial) => {
58397
+ /**
58398
+ Build a priority from the fields given. Fields left out keep their value from `base` (the stored
58399
+ priority on update), or default to 3 when there is no base.
58400
+ */
58401
+ const priorityFromPartial = (partial, base) => {
58354
58402
  if (Object.values(partial).every((value) => value === void 0)) return void 0;
58355
58403
  return {
58356
- confidence: partial.confidence ?? 3,
58357
- effort: partial.effort ?? 3,
58358
- impact: partial.impact ?? 3,
58359
- risk: partial.risk ?? 3,
58360
- urgency: partial.urgency ?? 3
58404
+ confidence: partial.confidence ?? base?.confidence ?? 3,
58405
+ effort: partial.effort ?? base?.effort ?? 3,
58406
+ impact: partial.impact ?? base?.impact ?? 3,
58407
+ risk: partial.risk ?? base?.risk ?? 3,
58408
+ urgency: partial.urgency ?? base?.urgency ?? 3
58361
58409
  };
58362
58410
  };
58363
58411
  //#endregion
@@ -58574,6 +58622,7 @@ const buildRepoContext = (repo, github) => {
58574
58622
  for (const id of drift.localMissingGithub) driftMessages.push(`${id} — active local item missing GitHub link`);
58575
58623
  for (const entry of drift.githubMissingLocal) driftMessages.push(`${entry} — GitHub issue missing local item`);
58576
58624
  for (const entry of drift.titleMismatch) driftMessages.push(`${entry} — title mismatch`);
58625
+ for (const entry of drift.bodyMismatch) driftMessages.push(`${entry} — body mismatch`);
58577
58626
  for (const entry of drift.statusMismatch) driftMessages.push(entry);
58578
58627
  }
58579
58628
  } catch (error) {
@@ -59580,6 +59629,10 @@ const workDone = (options) => {
59580
59629
  repo: scoped.repo
59581
59630
  });
59582
59631
  };
59632
+ const updatedBlockedReason = (next, current) => {
59633
+ if (next === void 0) return current;
59634
+ return next.trim().length === 0 ? void 0 : next;
59635
+ };
59583
59636
  const workUpdate = (options) => {
59584
59637
  const scoped = resolveScopedWorkItem(options.id, scopeFrom(options));
59585
59638
  const item = stripScope(scoped);
@@ -59589,13 +59642,13 @@ const workUpdate = (options) => {
59589
59642
  impact: options.impact,
59590
59643
  risk: options.risk,
59591
59644
  urgency: options.urgency
59592
- });
59645
+ }, item.priority);
59593
59646
  const updatedAt = nowIso(options.now);
59594
59647
  const updated = {
59595
59648
  ...item,
59596
59649
  acceptanceCriteria: options.acceptanceCriteria === void 0 ? item.acceptanceCriteria : normalizeTextList(options.acceptanceCriteria),
59597
59650
  area: options.area ?? item.area,
59598
- blockedReason: options.blockedReason ?? item.blockedReason,
59651
+ blockedReason: updatedBlockedReason(options.blockedReason, item.blockedReason),
59599
59652
  description: options.description ?? item.description,
59600
59653
  priority: priority === void 0 ? item.priority : validateWorkPriority(priority),
59601
59654
  status: options.status ?? item.status,
@@ -61787,7 +61840,7 @@ const updateCommand = {
61787
61840
  describe: "Replace status",
61788
61841
  type: "string"
61789
61842
  }).option("blocked-reason", {
61790
- describe: "Blocked status explanation",
61843
+ describe: "Blocked status explanation; pass an empty value (--blocked-reason \"\") to remove it",
61791
61844
  type: "string"
61792
61845
  }).option("tag", {
61793
61846
  array: true,
@@ -61801,17 +61854,32 @@ const updateCommand = {
61801
61854
  array: true,
61802
61855
  describe: "Replace verification entries; repeatable",
61803
61856
  type: "string"
61804
- }).option("impact", { type: "number" }).option("urgency", { type: "number" }).option("effort", { type: "number" }).option("risk", { type: "number" }).option("confidence", { type: "number" }));
61857
+ }).option("impact", {
61858
+ describe: "Set priority impact (1-5)",
61859
+ type: "number"
61860
+ }).option("urgency", {
61861
+ describe: "Set priority urgency (1-5)",
61862
+ type: "number"
61863
+ }).option("effort", {
61864
+ describe: "Set priority effort (1-5)",
61865
+ type: "number"
61866
+ }).option("risk", {
61867
+ describe: "Set priority risk (1-5)",
61868
+ type: "number"
61869
+ }).option("confidence", {
61870
+ describe: "Set priority confidence (1-5)",
61871
+ type: "number"
61872
+ }).epilogue(["Only the fields you pass change. Priority fields you leave out keep their stored values (or default to 3 when the item has no priority yet).", "Updates are written to the local store only. Run `xy work sync` afterwards to push the title and issue body to a linked GitHub issue; `xy work lint` reports linked issues whose body has drifted (work.github-synced)."].join("\n\n")));
61805
61873
  },
61806
61874
  command: "update <id>",
61807
- describe: "Update triage fields on a work item",
61875
+ describe: "Update fields on a work item (local only; run `xy work sync` to push to GitHub)",
61808
61876
  handler: async (argv) => {
61809
61877
  const scope = scopeFromArgv(argv);
61810
61878
  await withEnvelope("work update", () => workUpdate({
61811
61879
  ...scope,
61812
61880
  acceptanceCriteria: optionalStringArray(argv.acceptance),
61813
61881
  area: optionalString(argv.area),
61814
- blockedReason: optionalString(argv["blocked-reason"]),
61882
+ blockedReason: typeof argv["blocked-reason"] === "string" ? argv["blocked-reason"] : void 0,
61815
61883
  confidence: optionalNumber(argv.confidence),
61816
61884
  description: optionalString(argv.description),
61817
61885
  effort: optionalNumber(argv.effort),