Skip to content

SDK .26 adoption: lifecycle finalization causes three atomic compensation regressions #197

Open

Description

@unbraind

Observed compatibility failure

At PR #194 head 58af1d3e8ffb926270a573d298249a9bc5b2c1e5, the dependency update resolves @unbrained/pm-cli 2026.10.26 (previous lock .25). Three completed CI lanes fail the same three real-SDK compensation tests:

Failures:

  1. test/import-fidelity.test.ts:459–475: real SDK atomic compensation restores imported source lifecycle and removes newly created items after finalization.
  2. test/refresh.test.ts:657–673: terminal failures remove replay plans after real SDK compensation, fresh and recovery variants.

The tests inject an ordinary error at committing. Instead of completed compensation, they receive compensation was incomplete … cannot safely compensate incomplete step. The later item restoration/plan-cleanup assertions are not reached. This is not evidence that data was lost, nor that state was restored.

Static explanation to investigate, not an independent native reproduction

Commit hook invokes source-lifecycle finalization before the injected transition callback.
Finalizer appends an SDK mutateItem import event with Preserve GitHub source lifecycle…, outside the bulk mutation's step ownership marker.
SDK .26 ownership check rejects non-owned history suffixes unless verified sibling compensation restores the exact state. These paths support a finalization/compensation ownership mismatch; they do not establish that the SDK's protective refusal is wrong.

Intended contract and existing owners

Reproduction and acceptance

In an isolated synthetic tracker with the PR lockfile, run the existing two test files, selecting the three names above after the normal inspected build/test preparation. No provider account or live mutation is needed. These are existing CI reproductions; this review did not run native/concurrency/lock tests locally.

  1. Integrate lifecycle finalization with supported shared SDK transaction/compensation semantics; preserve exact source dates, close evidence, complete history and hooks.
  2. On the injected ordinary failure, restore/remove only transaction-owned effects and retain unrelated replay plans; verify actual item/history/journal outcomes, not just error text.
  3. If a foreign write makes compensation unsafe, retain the truthful incomplete state and resumable plan. Do not weaken ownership guards, discard history, broaden rollback ownership, or merely relax these assertions.
  4. Cover fresh and recovery paths, minimum supported SDK and adopted .26+ artifact, and all current npm/Bun lanes. If a reusable SDK primitive is missing, coordinate that upstream rather than duplicate PM semantics here.

Impact: dependency adoption/full release gates are blocked and the intended ordinary-failure recovery guarantee is not verified for this supported-host combination. Exact residual state and exclusive .25→.26 causality remain to be established. No whole-package certification or publication/deployment claim.

Activity

  1. unbraind commented on Nov 5, 2026

    @unbraind
    OwnerAuthor

    Status after #194 (merged 2026-11-05). One of the three regressions, repeat-import, is fixed through the GH-1614 production fix (c59e266). The other two atomic-compensation cases still need transaction-owned lifecycle finalization upstream (pm-cli#1656). They are quarantined on SDK 2026.11.4 only, keep every assertion, re-enable automatically on other SDK versions (943e540 tests the predicate against 12 versions), and are documented as a known limitation in the README. This issue stays open until pm-cli#1656 lands and the two tests run unquarantined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions