Skip to content

ios: unify failure ambiguity classifiers and extract AidenDurablePendingMutation - #901

Open
sambitcreate wants to merge 3 commits into
mainfrom
fix/sm-ios-classifiers-and-engine
Open

sambitcreate wants to merge 3 commits into
mainfrom
fix/sm-ios-classifiers-and-engine

Conversation

@sambitcreate

Copy link
Copy Markdown
Owner

Summary

  • Consolidate all 12 iOS failure-ambiguity classifiers into ios/AidenOnTheGo/Networking/AidenRemoteFailureClassification.swift with two endpoint-contract tiers (beforeEffectRefusal vs cachedRejectionLedger), fixing the live 409 idempotency_in_flight key-drop bug (OpenWork, Watch, RoutineModels, Bot Session/Settings/Avatar) and CancellationError/non-AidenRemoteClientError key drops (Coordinator, ScheduledTasks, WorkspaceGit)
  • Extract shared @MainActor AidenDurablePendingMutation across the 5 storageBlocked files / 6 classes (AidenBotResumeModel, AidenBotWatchModel, AidenBotRoutineModelsModel, AidenBotPeersModel + AidenBotPeerExchangeModel, AidenBotOpenWorkModel) while keeping the 4 persistence stores and purge hooks unchanged
  • Add AidenRemoteFailureClassificationTests, AidenDurablePendingMutationTests, and AidenBotResumeModelTests, extend AidenScheduledTaskTests, and wire into project.pbxproj and scripts/check-ios-shipping-target.test.mjs

Verification

  • node --test scripts/check-ios-shipping-target.test.mjs scripts/check-ios-testflight-policy.test.mjs scripts/check-ios-app-store-metadata.test.mjs (22/22 passed on Linux; macOS CI xcodebuild test running on this PR)

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

Durable Bot retries can keep a key after the host has proven its rejection is settled.

Reviewed changes I reviewed the complete initial diff and traced both classifier tiers and the shared pending-mutation engine through their iOS callers and host-side durability contracts.

  • Failure classification: Consolidates mutation ambiguity decisions into before-effect-refusal and cached-rejection-ledger policies across Bot, workspace, schedule, Git, fork, and worktree flows.
  • Durable mutation engine: Adds the shared AidenDurablePendingMutation lifecycle for persist-before-send admission, storage fencing, replay limits, unknown-outcome retention, and settlement.
  • Bot model integrations: Moves Open Work, Peers, Peer Exchange, Resume, Routine Models, and Watch onto the shared engine while preserving their stores and reconciliation paths.
  • Coverage and shipping wiring: Adds classifier, engine, and Resume behavioral tests and registers the new Swift sources in Xcode and the shipping inventory.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using GPT Sol | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No new issues in this incremental delta; the earlier unresolved classifier concern remains open.

Reviewed changes I reviewed the changes since the prior Pullfrog review at 1354e0d08, including their interaction with every retry call site in the full PR.

  • Made retry persistence nonescaping: Split beginRetry into a no-persistence convenience overload and a required persistence-callback overload so fail-closed retry sites can pass actor-isolated state safely.
  • Isolated Tier 2 test closures: Typed the classifier table as @MainActor and wrapped actor-isolated method references in explicit closures.
  • Extended state-machine coverage: Added behavioral checks for rejected, saved, and storage-failed retry persistence outcomes while preserving the pending attempt and phase invariants.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | Fix it ➔ | View workflow run | Using GPT Sol | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes I reviewed the durable Bot-ledger classifier changes since the prior Pullfrog review and traced them through the affected iOS retained-key flows and host-side operation contracts.

  • Added an explicit Bot-ledger policy: Introduced durableBotLedgerBeforeEffectRefusal so decoded replayed 409 internal_error responses release settled keys without weakening live failures, malformed responses, or idempotency_in_flight.
  • Updated durable Bot callers: Routed Bot creation, avatar upload, conversation creation, messages, and indirect session actions through the named policy while leaving strict before-effect routes unchanged.
  • Added end-to-end retry coverage: Exercised lost responses, malformed and in-flight 409 responses, settled rejection replay, fresh-key retry, and eventual success across representative create, avatar, conversation, and question flows.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | View workflow run | Using GPT Sol | 𝕏

This branch has not been deployed

No deployments
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