Skip to content

feat(demo): add Acme Bank demo app with Live Sync - #3

Open
ashsesa-afk wants to merge 2 commits into
amazon-connect:mainfrom
ashsesa-afk:feat/demo-live-sync
Open

ashsesa-afk wants to merge 2 commits into
amazon-connect:mainfrom
ashsesa-afk:feat/demo-live-sync

Conversation

@ashsesa-afk

Copy link
Copy Markdown

feat(demo): add Acme Bank demo app with Live Sync

Adds the Acme Bank demo app as demo/acme-bank/, the Android counterpart of the iOS demo in amazon-connect/touchpoint-ios#7. Both demos follow the same customer journey: the AI agent opens an account, filters and selects a transaction and starts a dispute through Live Sync, and the customer submits the dispute with their own tap.

What changed

  • New module demo/acme-bank/. settings.gradle.kts already builds it when the folder exists. It runs in a scripted mode with no backend, and in a live mode (debug builds) against the demo backend.
  • Live Sync keys come from the backend. After a real sign-in, the app calls POST /livesync/credentials on every sign-in, so a rotated key is picked up, and the two key fields are hidden. If the fetch fails, sign-in still succeeds and chat works without Live Sync.
  • No confirmation on start_dispute. With confirmation on, the action is never delivered, so the dispute screen never opens. Opening it is reversible. Submitting stays the customer's tap. A comment marks this as temporary until the SDK fix.
  • Flow name. Live chats send the livesync flow once Live Sync keys are set.
  • Forgiving transaction filter. When no transaction matches amount, merchant and date together, the list shows the transactions that match the amount alone (Kotlin port of iOS TransactionFilter.apply(to:)). The transaction list and the select_transaction fallback both use it.
  • Config. live.properties stays gitignored. Added live.properties.example with placeholder values only.
  • README. The demo README explains where the backend lives: deploy it from Demo/backend in touchpoint-ios, run npm run app-config, and save the Android part as demo/acme-bank/live.properties.
  • Public clean-up. No partner branding (the build uses the built-in brand), no internal links, ids or plan tags.
  • CHANGELOG. One line under ## [Unreleased] → ### Added.

The action contract is unchanged: the same five actions and schemas, and no submit action.

Two items from the iOS PR needed no change on Android:

  • Dispute form padding: the "Submitted. Reference …" confirmation is fully visible on Android, so no extra bottom padding was added.
  • Error instead of a blank chat: Android already shows the error and a Try again button when a chat fails to start.

How tested

  • ./gradlew :acme-bank:assemble :acme-bank:test: 69 tests, 0 failures, including ActionContractTest and the no-submit tests. New unit tests cover the forgiving filter (exact match, misheard merchant, date a few days off, no fallback without an amount).
  • Repository checks: build, lint, secret scan, API dump (checkKotlinAbi), build graph, manifests, string resources, release symbols and competing pins all pass. These were run on Windows without make, so each target was run as its underlying command.
  • Live journey on an Android emulator (API 37), signed in against the demo backend: test-plan rows 1-7 pass (open Support and allow Live Sync, open the card, filter to the charge, select it, start the dispute, set the dispute details, tap Submit dispute). The forgiving filter was added after this run and is covered by the unit tests above.
  • Rows 8-9 (voice call and screen share) were not tested: they need a physical phone, and none could be connected over USB.
  • ASH 3.8.0 on the committed demo/acme-bank (cfn-nag excluded; opengrep run as a separate pass): no open findings; 5 secret-scanner hits are test fixtures (AWS's published SigV4 example key and fake test values).
  • Note: on Windows, 6 touchpoint-core JVM tests fail because File.renameTo does not replace an existing file (ConversationStore.kt). This PR does not touch touchpoint-core; the failures are unrelated to it.

@ashsesa-afk
ashsesa-afk requested a review from sderacy as a code owner November 20, 2026 03:26
@ashsesa-afk

Copy link
Copy Markdown
Author

Adds the Acme Bank demo app as demo/acme-bank/, the Android counterpart of the iOS demo in amazon-connect/touchpoint-ios#7. Both demos follow the same customer journey: the AI agent opens an account, filters and selects a transaction and starts a dispute through Live Sync, and the customer submits the dispute with their own tap.

What changed

  • New module demo/acme-bank/. settings.gradle.kts already builds it when the folder exists. It runs in a scripted mode with no backend, and in a live mode (debug builds) against the demo backend.
  • Live Sync keys come from the backend. After a real sign-in, the app calls POST /livesync/credentials on every sign-in, so a rotated key is picked up, and the two key fields are hidden. If the fetch fails, sign-in still succeeds and chat works without Live Sync.
  • No confirmation on start_dispute. With confirmation on, the action is never delivered, so the dispute screen never opens. Opening it is reversible. Submitting stays the customer's tap. A comment marks this as temporary until the SDK fix.
  • Flow name. Live chats send the livesync flow once Live Sync keys are set.
  • Forgiving transaction filter. When no transaction matches amount, merchant and date together, the list shows the transactions that match the amount alone (Kotlin port of iOS TransactionFilter.apply(to:)). The transaction list and the select_transaction fallback both use it.
  • Voice calls keep Live Sync active. Live Sync no longer attaches the SDK's dispatch gate when it binds to a voice contact (the in-app call and the phone call); chat keeps it. The gate suspends Live Sync dispatch when a human agent joins. On an in-app WebRTC call the SDK classifies Connect's own call leg as a human attendee, so dispatch suspended as soon as the call connected and no action arrived. The iOS demo never attaches the gate, so this matches it. Trade-off: a human agent who joins a voice call does not pause the assistant, and the screens can keep moving while the agent is on. Chat still pauses. This should be revisited when the SDK can tell a call's AI leg from a human agent. The change is one gate parameter on LiveSyncCoordinator.bind, passed false at the two voice call sites, with a KDoc and a README section ("Voice calls and Live Sync"). LiveSyncGateTest covers both cases through a real TouchpointSession.
  • Debug-only Live Sync logging. Debug builds also write each line of the in-app Live Sync log (Settings → Live Sync (debug)) to logcat under the tag AcmeLiveSync (adb logcat -v time AcmeLiveSync:I *:S). Release builds do not. The lines hold no keys; a contact id appears only as its first 8 characters. Each bind logs gate → attached or gate → not attached (voice).
  • Config. live.properties stays gitignored. Added live.properties.example with placeholder values only.
  • README. The demo README explains where the backend lives: deploy it from Demo/backend in touchpoint-ios, run npm run app-config, and save the Android part as demo/acme-bank/live.properties.
  • Public clean-up. No partner branding (the build uses the built-in brand), no internal links, ids or plan tags.
  • CHANGELOG. One entry under ## [Unreleased] → ### Added, which also notes the voice-call behaviour.

The action contract is unchanged: the same five actions and schemas, and no submit action.

Two items from the iOS PR needed no change on Android:

  • Dispute form padding: the "Submitted. Reference …" confirmation is fully visible on Android, so no extra bottom padding was added.
  • Error instead of a blank chat: Android already shows the error and a Try again button when a chat fails to start.

How tested

  • ./gradlew :acme-bank:assemble :acme-bank:test: 69 tests, 0 failures, including ActionContractTest and the no-submit tests. New unit tests cover the forgiving filter (exact match, misheard merchant, date a few days off, no fallback without an amount). With the voice change, ./gradlew :acme-bank:test: 71 tests, 0 failures, including ActionContractTest (both no-submit tests) and the 2 LiveSyncGateTest cases.
  • Repository checks: build, lint, secret scan, API dump (checkKotlinAbi), build graph, manifests, string resources, release symbols and competing pins all pass. These were run on Windows without make, so each target was run as its underlying command.
  • Live journey on an Android emulator (API 37), signed in against the demo backend: test-plan rows 1-7 pass (open Support and allow Live Sync, open the card, filter to the charge, select it, start the dispute, set the dispute details, tap Submit dispute). Run on the committed build, including the forgiving filter.
  • Row 8 (in-app voice call, Pixel 9 Pro XL, Android 17) passes: all six actions arrived (open_account, filter_transactions, select_transaction, start_dispute, set_dispute_details twice), the screens moved while the AI agent spoke, and dispatch never suspended. Before the voice change, dispatch suspended as the call connected and no action arrived.
  • Row 9 (screen share) does not work yet: the call reaches a human agent, who starts screen share in the agent workspace, but no Share control appears on the phone. This is under investigation and will be a follow-up commit or issue.
  • ASH 3.8.0 on the committed demo/acme-bank (cfn-nag excluded; opengrep run as a separate pass): no open findings; 5 secret-scanner hits are test fixtures (AWS's published SigV4 example key and fake test values).
  • Note: on Windows, 6 touchpoint-core JVM tests fail because File.renameTo does not replace an existing file (ConversationStore.kt). This PR does not touch touchpoint-core; the failures are unrelated to it.

@ashsesa-afk

Copy link
Copy Markdown
Author

Adds the Acme Bank demo app as demo/acme-bank/, the Android counterpart of the iOS demo in amazon-connect/touchpoint-ios#7. Both demos follow the same customer journey: the AI agent opens an account, filters and selects a transaction and starts a dispute through Live Sync, and the customer submits the dispute with their own tap.

What changed

  • New module demo/acme-bank/. settings.gradle.kts already builds it when the folder exists. It runs in a scripted mode with no backend, and in a live mode (debug builds) against the demo backend.
  • Live Sync keys come from the backend. After a real sign-in, the app calls POST /livesync/credentials on every sign-in, so a rotated key is picked up, and the two key fields are hidden. If the fetch fails, sign-in still succeeds and chat works without Live Sync.
  • No confirmation on start_dispute. With confirmation on, the action is never delivered, so the dispute screen never opens. Opening it is reversible. Submitting stays the customer's tap. A comment marks this as temporary until the SDK fix.
  • Flow name. Live chats send the livesync flow once Live Sync keys are set.
  • Forgiving transaction filter. When no transaction matches amount, merchant and date together, the list shows the transactions that match the amount alone (Kotlin port of iOS TransactionFilter.apply(to:)). The transaction list and the select_transaction fallback both use it.
  • Voice calls keep Live Sync active. Live Sync no longer attaches the SDK's dispatch gate when it binds to a voice contact (the in-app call and the phone call); chat keeps it. The gate suspends Live Sync dispatch when a human agent joins. On an in-app WebRTC call the SDK classifies Connect's own call leg as a human attendee, so dispatch suspended as soon as the call connected and no action arrived. The iOS demo never attaches the gate, so this matches it. Trade-off: a human agent who joins a voice call does not pause the assistant, and the screens can keep moving while the agent is on. Chat still pauses. This should be revisited when the SDK can tell a call's AI leg from a human agent. The change is one gate parameter on LiveSyncCoordinator.bind, passed false at the two voice call sites, with a KDoc and a README section ("Voice calls and Live Sync"). LiveSyncGateTest covers both cases through a real TouchpointSession.
  • Debug-only Live Sync logging. Debug builds also write each line of the in-app Live Sync log (Settings → Live Sync (debug)) to logcat under the tag AcmeLiveSync (adb logcat -v time AcmeLiveSync:I *:S). Release builds do not. The lines hold no keys; a contact id appears only as its first 8 characters. Each bind logs gate → attached or gate → not attached (voice).
  • Config. live.properties stays gitignored. Added live.properties.example with placeholder values only.
  • README. The demo README explains where the backend lives: deploy it from Demo/backend in touchpoint-ios, run npm run app-config, and save the Android part as demo/acme-bank/live.properties.
  • Public clean-up. No partner branding (the build uses the built-in brand), no internal links, ids or plan tags.
  • CHANGELOG. One entry under ## [Unreleased] → ### Added, which also notes the voice-call behaviour.

The action contract is unchanged: the same five actions and schemas, and no submit action.

Two items from the iOS PR needed no change on Android:

  • Dispute form padding: the "Submitted. Reference …" confirmation is fully visible on Android, so no extra bottom padding was added.
  • Error instead of a blank chat: Android already shows the error and a Try again button when a chat fails to start.

How tested

  • ./gradlew :acme-bank:assemble :acme-bank:test: 69 tests, 0 failures, including ActionContractTest and the no-submit tests. New unit tests cover the forgiving filter (exact match, misheard merchant, date a few days off, no fallback without an amount). With the voice change, ./gradlew :acme-bank:test: 71 tests, 0 failures, including ActionContractTest (both no-submit tests) and the 2 LiveSyncGateTest cases.
  • Repository checks: build, lint, secret scan, API dump (checkKotlinAbi), build graph, manifests, string resources, release symbols and competing pins all pass. These were run on Windows without make, so each target was run as its underlying command.
  • Live journey on an Android emulator (API 37), signed in against the demo backend: test-plan rows 1-7 pass (open Support and allow Live Sync, open the card, filter to the charge, select it, start the dispute, set the dispute details, tap Submit dispute). Run on the committed build, including the forgiving filter.
  • Row 8 (in-app voice call, Pixel 9 Pro XL, Android 17) passes: all six actions arrived (open_account, filter_transactions, select_transaction, start_dispute, set_dispute_details twice), the screens moved while the AI agent spoke, and dispatch never suspended. Before the voice change, dispatch suspended as the call connected and no action arrived.
  • Row 9 (screen share, same phone) passes: a human agent accepts the call and starts screen sharing; with the support panel closed, the customer taps Share screen on the call bar, then Share, and the agent sees the app.
  • ASH 3.8.0 on the committed demo/acme-bank (cfn-nag excluded; opengrep run as a separate pass): no open findings; 5 secret-scanner hits are test fixtures (AWS's published SigV4 example key and fake test values).
  • Note: on Windows, 6 touchpoint-core JVM tests fail because File.renameTo does not replace an existing file (ConversationStore.kt). This PR does not touch touchpoint-core; the failures are unrelated to it.

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