merge-steward 0.9.2 → 0.9.4

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.
@@ -38,6 +38,25 @@ export async function reconcile(ctx) {
38
38
  // Truth guard: verify entry against GitHub before processing.
39
39
  if (await sanitizeEntry(ctx, entry))
40
40
  continue;
41
+ // Stale dependency guard: if this entry's spec was built on top of
42
+ // another entry that was dequeued or evicted (without downstream
43
+ // invalidation), the spec is contaminated with the removed entry's
44
+ // changes. Reset so it rebuilds on the correct base next tick.
45
+ // Exclude "merged" — a merged dependency means main advanced to its
46
+ // spec, so our cumulative spec is still valid (speculative consistency).
47
+ if (entry.specBasedOn) {
48
+ const dep = ctx.store.getEntry(entry.specBasedOn);
49
+ if (!dep || dep.status === "dequeued" || dep.status === "evicted") {
50
+ emit(ctx, entry, "invalidated", {
51
+ detail: `dependency ${entry.specBasedOn} is ${dep?.status ?? "removed"}`,
52
+ });
53
+ await cleanupSpec(ctx, entry);
54
+ ctx.store.transition(entry.id, "preparing_head", {
55
+ ...CLEAN_CI, ...CLEAN_SPEC,
56
+ }, `stale dependency ${dep?.status ?? "removed"}`);
57
+ continue;
58
+ }
59
+ }
41
60
  const isHead = i === 0;
42
61
  const prevEntry = i > 0 ? ctx.store.getEntry(allActive[i - 1].id) ?? null : null;
43
62
  const phase = entry.status;
package/dist/service.js CHANGED
@@ -274,6 +274,7 @@ export class MergeStewardService {
274
274
  const entry = this.store.getEntryByPR(this.config.repoId, prNumber);
275
275
  if (entry) {
276
276
  this.store.transition(entry.id, "merged");
277
+ this.invalidateDownstreamOf(entry);
277
278
  this.logger.info({ prNumber, entryId: entry.id }, "External merge acknowledged");
278
279
  }
279
280
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "merge-steward",
3
- "version": "0.9.2",
3
+ "version": "0.9.4",
4
4
  "description": "Serial merge queue for GitHub — rebase, CI-gate, and merge PRs one at a time",
5
5
  "type": "module",
6
6
  "repository": {