Skip to content

fix(profile-session): make stop idempotent - #343

Merged
gmemmy merged 1 commit into
mainfrom
codex/fix-profile-stop-idempotency
Sep 8, 2026
Merged

gmemmy merged 1 commit into
mainfrom
codex/fix-profile-stop-idempotency

Conversation

@gmemmy

@gmemmy gmemmy commented Sep 7, 2026

Copy link
Copy Markdown
Owner

Problem

A repeated or delayed profile-session stop could append another terminal event and rewrite authoritative storage after a run had already stopped. A stale stop could also race with a newer active run unless the caller and storage transition were bound to the same scenario and run identity.

What changed

  • Serialize authoritative stop transitions and return explicit stopped, already-stopped, or rejected outcomes.
  • Make repeated and delayed same-run stops byte-identical no-ops.
  • Reject missing, mismatched, ambiguous, or stale stop authority without mutating storage.
  • Require scenario and runId on stop deep links while preserving argument-free in-process stopProfileSession() calls.
  • Advance the app-helper payload identity to 1.2.0 and update package fixtures, declarations, and public contract text.

Why this approach

The durable authority manifest remains the source of truth. Stop decisions are serialized with the existing storage operation chain, so concurrent calls cannot each publish a terminal transition. The public helper keeps its existing no-argument path while allowing identity-bound callers to fail closed.

Proof

  • pnpm typecheck - passed.
  • Focused profile/storage/runner suites - 159/159 passed.
  • Full repository suite in the exact final release check - 1,851/1,851 passed.
  • pnpm package:smoke - passed, including packed installation and public declaration checks.
  • pnpm release:check - passed, including package smoke and installed-consumer rehearsal.
  • Independent final-diff review and documentation remediation re-review - clean, no P0-P3 findings.
  • git diff --check - passed.

Risks and limits

  • This proves package and synthetic lifecycle behavior, not downstream runtime acceptance.
  • A default parallel full-suite attempt encountered shared Android lease contention. The affected live-Android file passed 4/4 in isolation, and the exact final release check passed with an isolated lease namespace.
  • This PR does not change package version, publish artifacts, or broaden platform evidence claims.

Stack/review order

Follow-ups

  • Add explicit single-platform evidence-pack scope without weakening dual-platform claims.
  • Re-run installed-candidate lifecycle confirmation in downstream runtime lanes under separate authority.

@gmemmy
gmemmy force-pushed the codex/fix-profile-stop-idempotency branch from f2b434b to 43a1350 Compare September 8, 2026 06:37
@gmemmy
gmemmy changed the base branch from codex/fix-portable-promoted-evidence to main September 8, 2026 06:38
@gmemmy
gmemmy marked this pull request as ready for review September 8, 2026 06:38
@gmemmy
gmemmy merged commit 381e1ac into main Sep 8, 2026
2 checks 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