From 50c566fc26b6818c73cd63473260af070aae83ff Mon Sep 17 00:00:00 2001 From: Toby Hede Date: Mon, 17 Aug 2026 10:39:25 +1000 Subject: [PATCH 1/2] chore: correct the positional-pop changeset to major MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `SessionService.popRunbook` was removed from the public surface of `@rundown-org/core`, which the changeset's own text already called out as "a breaking change only for a consumer calling `SessionService.popRunbook` directly". A `patch` bump does not describe that. The repo's precedent for this exact shape — removing public core API whose in-repo callers were already retired — is `major`: `.changeset/delete-completion-and-delegation-locks.md` ("the modules were dead code with a live public export ... the public API does change, and that is the breaking part of this major") and `.changeset/single-store-public-api-cutover.md`. No release impact either way: five core majors are already queued, so the next release resolves to 2.0.0 regardless. This is accuracy of the release record, not a fix to a reachable break. --- .changeset/positional-pop-to-fixtures.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/positional-pop-to-fixtures.md b/.changeset/positional-pop-to-fixtures.md index f0f47cf35..c3b1272f8 100644 --- a/.changeset/positional-pop-to-fixtures.md +++ b/.changeset/positional-pop-to-fixtures.md @@ -1,5 +1,5 @@ --- -'@rundown-org/core': patch +'@rundown-org/core': major --- # Move the positional pop out of product reach From 3336f24e365a6563dc02cc30e3f38ef312c30ff9 Mon Sep 17 00:00:00 2001 From: Toby Hede Date: Mon, 17 Aug 2026 10:39:35 +1000 Subject: [PATCH 2/2] docs(core): fix two stale claims left by the positional-pop move MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both are doc-only; no behaviour changes. `releaseFromSession` justified its in-place shape with "composite operations — releaseRunbooks, popRunbookIfActive — can release several runbooks against one session snapshot". `popRunbookIfActive` releases exactly one run, so the substituted name did not support the sentence's own argument. Attribute the multi-release case to `releaseRunbooks`, and state separately why the conditional pop wants the same primitive: its release folds into the transaction that decides whether the run is still the top. `popTopOfStackUnverified`'s `@returns` promised null "when the stack was empty or the release removed nothing". The second arm is unreachable, as the comment inside the body already argues — `topId` is read off `defaultStack`, so `projectRunbookRelease` always removes it. Dropping that arm alone would leave a second inaccuracy, because null is also the answer when the popped run was the last entry (the wf3/wf2/wf1 unwind in session-service.test.ts covers exactly that), so name both real cases. --- packages/core/src/runbook/session-service.ts | 8 +++++--- packages/core/src/testing/session-fixtures.ts | 9 +++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/packages/core/src/runbook/session-service.ts b/packages/core/src/runbook/session-service.ts index 136b51a8f..04a8849ad 100644 --- a/packages/core/src/runbook/session-service.ts +++ b/packages/core/src/runbook/session-service.ts @@ -1953,9 +1953,11 @@ export class SessionService { /** * Release a runbook from an in-memory session (no IO, no transaction). * - * Pure in-place mutation so composite operations — {@link releaseRunbooks}, - * {@link popRunbookIfActive} — can release several runbooks against one - * session snapshot and commit once, instead of round-tripping per runbook. + * Pure in-place mutation so a caller can release against a session snapshot + * it already holds and commit once, instead of round-tripping per release. + * {@link releaseRunbooks} needs that to put several runbooks under a single + * commit; {@link popRunbookIfActive} releases exactly one, folded into the + * same transaction that decides whether the run is still the top. * * @param session - Session to mutate in place. * @param runbookId - Runbook id to release from session targeting structures diff --git a/packages/core/src/testing/session-fixtures.ts b/packages/core/src/testing/session-fixtures.ts index f9e07fab9..517bed18f 100644 --- a/packages/core/src/testing/session-fixtures.ts +++ b/packages/core/src/testing/session-fixtures.ts @@ -308,10 +308,11 @@ export async function stashRunbookUnverified( * @param manager - State manager whose store holds the runs and the session; * take the caller's own instance so the fixture shares one store with the * test. - * @returns The new top-of-stack run id, or null when the stack was empty or the - * release removed nothing. Refused `execution_in_progress` or - * `recovery_required` instead when the popped run is execution-owned or - * awaiting recovery; the value is absent then. + * @returns The new top-of-stack run id, or null when no run remains on the + * stack — either because it was already empty and nothing was released, or + * because the run just popped was the last entry. Refused + * `execution_in_progress` or `recovery_required` instead when the popped run + * is execution-owned or awaiting recovery; the value is absent then. */ export async function popTopOfStackUnverified( manager: RunbookStateManager,