Skip to content

feat: Programs edit results carry rw2's historyWarning - #27

Merged
DanielKow merged 3 commits into
masterfrom
feature/epic-97-history-warning
Oct 5, 2026
Merged

DanielKow merged 3 commits into
masterfrom
feature/epic-97-history-warning

Conversation

@DanielKow

@DanielKow DanielKow commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

When an rw2 program edit lands but its history commit fails, rw2 answers 200 with the X-History-Not-Recorded: true header and a historyWarning body field (rw2 ProgramEditingEndpoints.cs:416-427 for add/edit/remove/move, :296-302 for capture). RocketWelder.SDK.Http dropped both, so every consumer (the MCP server first) reported a plain success.

The client now reads historyWarning from the body. rw2 sets that field on every landed-edit body whenever it sets the header, so the body is the single source and the header is not read separately.

  • BlockEditResult (add/edit) and CapturePointResult (capture) gain string? HistoryWarning (an init property; this change is additive).
  • Breaking: RemoveBlockAsync / MoveBlockAsync now return EtagEditResult(ProgramEtag Etag, string? HistoryWarning) instead of a bare ProgramEtag. Release this as a major version.
    • Callers must read .Etag.
    • The only other implementer found in the org is rw2's test fake StationManagement.Tests/ProgramAuthoringTests.cs:91 (RecordingPrograms : IProgramsApi, the Remove/Move members at :135/:137, on the epic-97 branch). It needs a two-line change when rw2 bumps past this version. rw2 pins 2.27.0 / 2.28.1 today, so nothing breaks until then.

Tests

  • ProgramsHistoryWarningTests (new, written first).
    • For add, edit, remove, move and capture: a stubbed 200 reply with X-History-Not-Recorded and a historyWarning yields that text verbatim, and a reply without them yields null.
    • RED before the fix: 14 compile errors, because the result types had no HistoryWarning and remove/move returned ProgramEtag.
  • GREEN: RocketWelder.SDK.Http.Tests passes 74/74, and the full RocketWelder.SDK.sln build succeeds.
  • Mutation check: dropping the field in ReadEtagAsync (passing null) fails exactly the remove and move warning tests.

Release

Not released yet. release.sh runs only on the user's go-ahead. The companion mcp PR pins the released version.

Daniel Kowalski added 2 commits September 29, 2026 18:21
A landed edit whose history commit failed answers 200 with X-History-Not-Recorded
and a historyWarning body field. The client dropped both. BlockEditResult and
CapturePointResult gain HistoryWarning; RemoveBlockAsync/MoveBlockAsync return
EtagEditResult(Etag, HistoryWarning) instead of a bare ProgramEtag (breaking).
@DanielKow

Copy link
Copy Markdown
Contributor Author

Epic 097 / F11-11b review of 2424220.

Sound:

  • HistoryWarning is taken from the response BODY only. It is deserialised into BlockEditResult / CapturePointResult, and EtagEditResult is built from EtagResponse.
  • Remove and Move now return EtagEditResult. That is a breaking change to the public API, and it matches the 3.0.0 packed version.
  • No AI trailers.

Breaks (detached worktree; control 36/36; each reverted by its inverse, diff 0):

  • new EtagEditResult(etag, null) ⇒ RED MoveBlockAsync_/RemoveBlockAsync_Should_Carry_The_HistoryWarning_Of_A_Not_Recorded_Edit.
  • BlockEditResult.HistoryWarning => null ⇒ RED AddBlockAsync_/EditBlockAsync_Should_Carry_The_HistoryWarning_Of_A_Not_Recorded_Edit.

COULD: every "not recorded" fixture sends the header AND the body. No test pins that the body alone drives the field; for example, a body warning with no header should still carry it, and a header with no body should give null.

— Reviewer

@DanielKow
DanielKow merged commit 758f0e7 into master Oct 5, 2026
5 checks passed
@DanielKow
DanielKow deleted the feature/epic-97-history-warning branch October 5, 2026 09:20
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