Skip to content

fix(publish): name every stale requirement in a conflict - #223

Merged
TornquistK merged 3 commits into
mainfrom
workset/name-every-stale-requirement-in-a-conflict
Dec 1, 2026
Merged

TornquistK merged 3 commits into
mainfrom
workset/name-every-stale-requirement-in-a-conflict

Conversation

@TornquistK

@TornquistK TornquistK commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

A publication conflict named only the first stale requirement and picked its remedy from it. When that first one was a removal and a later one a modification, the message said "submit it again unchanged", which submit then refused.

 applyChain
-  type.stale(...)            -> first stale part
+  staleParts(...)            -> every stale part (up to 50)
 ChainFailure (stale)
-  failure: DeltaFailure
+  parts: [DeltaFailure, ...DeltaFailure[]]
 failureRemedy(failure)
-  first part is a removal   -> "submit it again unchanged"
+  a part was removed on the default branch -> fix the delta
+  resubmitAccepts(parts)    -> "submit it again unchanged"   (same rule as acceptsBlock)
+  overwritten parts resolvable -> one `mate artifact resolve` with a triple each,
+                                  "also accepts" the removals/renames
+  otherwise                 -> fix the delta
 chainConflict
   conflict                  (unchanged: first entry)
+  conflicts                 one PublicationConflict per stale requirement

A part whose requirement was removed on the default branch always gets "fix the delta": OpenSpec cannot apply a delta to a missing requirement, so neither an unchanged resubmit nor resolve gets past it.

mate-publish-artifact now follows the remedy the message gives and offers "submit unchanged" only when the message does. mate-submit-change relays a failed check's remedy as given. reference/commands.mdx is updated to match.

Evidence

  • Before: a change that removes Widget sizes and modifies Widget renders, both changed on main since its delta base → message names only Widget sizes and offers "submit it again unchanged"; that resubmit fails with the same conflict. Reproduced in the real CLI at 3bb80c70 (verify-mate baseline run).
    After: publishSubmitted > a stale removal beside a stale modification is reported whole, with resolve as the remedy passes: message names both, conflicts has two entries, conflict === conflicts[0], remedy is mate artifact resolve … --requirement 'Widget renders', no "submit it again unchanged". Driven in the real CLI too: same message and JSON; following the remedy (resolve, then publish) lands the group on main.
  • failureRemedy > resolves a stale modification beside a stale removal instead of resubmitting (unit) passes; fails under the old first-part logic.
  • failureRemedy > asks for a delta fix for a modification of a requirement removed on the default branch passes; fails with the upstream-removed check taken out.
  • bun run test in packages/mate-core (7002 pass, 0 fail) and typecheck pass on a48ce397 (merged with main); lint, format check and docs check passed on the chain's final diff.
  • Not exercised: the upstream-removed remedy in the real CLI (unit test only); the submit pre-flight warning was seen during the drive but not asserted.
  • Second opinion: not run (not risky: message text, two-way door)
  • Finish: 819a62b

Merge Danger

Door: two-way

Blast Radius: messages

Message text and the recorded blocked.reason change, so an already-blocked change gets one extra pending-branch commit with the new reason. --json only adds conflicts; conflict keeps its shape.

A publication conflict named only the first stale requirement and chose its remedy from it, so a removal before a modification offered a resubmit that submit then refused. The chain now collects every stale part, the remedy uses submit's own acceptance rule, and --json adds conflicts.
@TornquistK
TornquistK force-pushed the workset/name-every-stale-requirement-in-a-conflict branch from 83f2d1e to 3723714 Compare December 1, 2026 22:46
A modification of a requirement removed on the default branch got
"submit it again unchanged" or was "also accepted" by resolve, yet
OpenSpec cannot apply it, so the next publish failed. Also drop the
stale failure's redundant first part and tighten comments.
…ale-requirement-in-a-conflict

# Conflicts:
#	packages/mate-core/src/tools/setup/__snapshots__/runtime-surface-golden.test.ts.snap
@TornquistK
TornquistK merged commit c2b7652 into main Dec 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant