Skip to content

Give back only what a run took down, and plan a restart of a stopped service as its start - #36

Merged
donislawdev merged 1 commit into
mainfrom
fix/stability-package-d
Sep 30, 2026
Merged

donislawdev merged 1 commit into
mainfrom
fix/stability-package-d

Conversation

@donislawdev

Copy link
Copy Markdown
Owner

What changes for a person

  • Stop pressed before the first step of a restart no longer starts a service that was not running. A run now starts again only what it stopped itself. After an interruption, a refused stop, an interrupted restart of a selection, or a dependent somebody else stopped between the preview and the run, the step reads "not started, this run never stopped it".
  • Restarting a service that is not running only starts it, from the window and with bws restart, and the preview says so with one step and the warning "is not running, so restarting it only starts it". This is what Restart-Service does. A disabled service that is not running gets the warning a start of it gets instead of a refusal worded about stopping it.

Machine readable output (additive)

  • skippedBecause has a fifth value, nothingToPutBack. Unlike processStays it counts against completed, because the entry is not where the plan wanted it at the end.
  • A new warning kind, restartOnlyStarts, with an empty related.
  • Behaviour without a change of shape: a restore after a refused stop now reports nothingToPutBack where it reported alreadyThere, and a restart whose service was stopped by somebody else after the preview leaves it stopped and exits with 3.

How it is built

  • PlanRunner.Unneeded skips a restore unless NetEffect.TookDown says the run took the entry down - the same tally the way back uses, plus an ending Windows answered by starting the entry again at once.
  • PlanBuilder.AsPlanned plans a restart of an entry read as stopped as a start. The plan keeps the restart as its action, so the equivalent command is still bws restart NAME.
  • The warnings about the start in a plan moved to their own switch in both interfaces (PlanText.Starting.cs, PlanWords.Starting.cs), so the warning switches grew thinner rather than reaching their complexity ceiling.

Checked

  • New tests: RestartOfStoppedTests (4), PutBackTests (7, each asserting what the manager was asked), PutBackOutputTests (2). Two existing assertions in PlanRunnerTests changed with the rule.
  • Narrow runs green: core 245, command line 41, architecture 182, integration 24. Window 122 of 125 in the narrow set - the three red are PlanConfirmationGuards, which fail the same way on main when run without the rest of the window project (an existing test-order dependence, not this change).
  • Mutation runs of the new, re-anchored and neighbouring guards: 59 of 59 caught.
  • On a real machine, preview only (--dry-run): a stopped service shows one start step and the warning, a stopped disabled one is no longer refused, a running one is unchanged.

Not checked: a real run on a throwaway machine, and the window on screen.

🤖 Generated with Claude Code

…service as its start

A step putting a service back was carried out whatever had happened before
it. Stop pressed before the first step of a restart started a service that
was not running, an interrupted restart of a selection started services it
never stopped, and a dependent stopped by somebody else after the preview was
started again. Such a step is now skipped with the new reason
nothingToPutBack unless the run itself stopped the entry or ended the process
it lived in, counted the same way the way back counts it.

A restart of a service that is not running is planned as a start, the way
Restart-Service treats it, with the new warning restartOnlyStarts. A disabled
service that is not running now gets the warning a start of it gets, where
the restart used to be refused with a sentence about stopping it.

The warnings about the start in a plan moved to a switch of their own in both
interfaces, so the warning switches grew thinner rather than reaching their
complexity ceiling.

Stability report W-5, package D.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 30, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 99dd2e61-cce1-4754-b9a2-4022ce1ad7d0


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@donislawdev
donislawdev merged commit b2d3913 into main Sep 30, 2026
8 checks passed
@donislawdev
donislawdev deleted the fix/stability-package-d branch September 30, 2026 09:52
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