Replace stub READMEs with real, runnable examples - #2
Merged
Conversation
- settlement/PendingSettlementExample.kt: registers a settlement expectation, posts the matching on-chain transaction, forces the match via reconcileBatch, confirms SETTLED, and demonstrates the CANCELLED path. - mcp/McpAgentWorkflowExample.kt: a real MCP client (official io.modelcontextprotocol.sdk:mcp) over SSE, mints an agent-scoped API key + policy rule, and drives postTransaction -> reconcileBatch -> rollbackWorkflow -> getAgentAuditLog against the live server. - ExampleAccounts.kt / ReconciliationExample.kt now call the real IdemClient.createAccount / reconcileBatch SDK methods (idem-finance/idem#234) instead of raw httpClient workarounds. - Bumped idem-sdk.version to 0.0.12-test; added the MCP client dependency. All 5 examples verified live against docker-compose (real transaction IDs, real SETTLED/CANCELLED settlement transitions, real HMAC-signed audit trail). Closes #1.
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
No lint/coverage gates yet — this repo has no test source set today, just compileable examples. Runs ./mvnw verify on push/PR to main so it's ready to catch regressions as soon as tests get added.
mvnw was tracked as mode 100644 — fine on Windows (where Git's fileMode tracking is typically off and the file still runs via its .cmd counterpart or an IDE's own Maven wrapper handling), but GitHub Actions' ubuntu-latest runners need the executable bit set to invoke ./mvnw directly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
settlement/PendingSettlementExample.ktreplaces the doc-only stub: registers a settlement expectation, posts the matching on-chain transaction, forces the match viareconcileBatch, confirmsSETTLED, and also demonstrates a second registration ->cancelSettlement->CANCELLED.mcp/McpAgentWorkflowExample.ktreplaces the doc-only stub: a real MCP client (officialio.modelcontextprotocol.sdk:mcp, pinned to the same version the main repo's server pulls in viaspring-ai-bom) connecting over SSE, minting an agent-scoped API key + a permissive policy rule, then drivingpostTransaction->reconcileBatch->rollbackWorkflow->getAgentAuditLog.ExampleAccounts.ktandReconciliationExample.ktnow call the realIdemClient.createAccount/reconcileBatchSDK methods added inidem-finance/idem#234instead of rawhttpClientworkarounds.support/ExampleAdmin.ktfor the one-time ADMIN-scope setup (minting the agent key, creating the policy rule) — kept as raw HTTP by design, since these aren't ledger data-plane operations the SDK should expose.idem-sdk.versionto0.0.12-test, added the MCP client dependency, updatedREADME.md's example table and run instructions.Closes #1.
Test plan
./mvnw compile— BUILD SUCCESSdocker compose up -d+dev,seedone-off for a real API keyexec:java, confirmed real (non-mocked) results:PENDING->SETTLEDandPENDING->CANCELLEDtransitionsUNMATCHEDoutcome via the newreconcileBatchSDK methodCOMMITTEDtransaction,ROLLED_BACKrollback, 4 real HMAC-signed audit eventsgit status/git diffreviewed before commit — no.env/real API key staged