Repository navigation
Integrate verified testnet payment compatibility and Python operator fixes - #2
Merged
Merged
Conversation
…2, 1:1 with TS - AIRuling EIP-712 types + signer (agirails/types/dispute.py); reproduces the on-chain golden digest 0x9b4778...e365 (golden-vector test). - Canonical evidence-bundle serializer + bundleHash (agirails/dispute/), byte- identical to the TS SDK; tiktoken for the >100k token cap. - Dispute clients mirroring TS: BondEscalationClient, CompositeMediator + events (zero-remaining consumer rule), EvaluatorClient, UMAHelper, DisputeSplitIndexer (OQ-11 admin-CANCELLED counted equally), DisputeClient facade. - 3 contract ABIs + network config; cross-SDK parity tests (surface == TS, descriptor/property-checked). - pytest: 3495 passed / 43 skipped / 0 failed. Branched off feat/ts-4.8.0-parity. Refs: DISPUTE SYSTEM/PRD (M1.5, M2). Note: pyproject version still 4.8.0 vs TS 4.9.0 — version-parity is a separate follow-up. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
settleUMAAssertion + retryMediatorResolution (+ their events) were added to BondEscalation.sol during the AIP-14b dispute-audit fix pass; re-vendor the Python SDK copy so the ABI matches the deployed contract. Byte-identical to the sdk-js copy (md5 227204e8...). ABI-only — no client code change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
BondEscalation gained on-chain prompt-CID governance (proposePromptCID / executePromptCID / cancelPromptCID + activePromptCID/pendingPromptCID/ promptCIDUnlockTime getters + PromptCIDProposed/Updated/ProposalCancelled events). Re-vendor the SDK copy to match the contract. Byte-identical to the sibling SDK copy (md5 c2184425...); pure additions, no reformat. Parity green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… lockstep) Brings python-sdk-v2 to parity with TS @agirails/sdk@4.9.0 (c3dab3e): - version 4.8.0 -> 4.9.0 - kernel ABI re-vendored from artifact (99 entries, +recoverStalledInProgress/recoveryGrace/StalledInProgressRecovered); byte-identical to TS src/abi/ACTPKernel.json. bond_escalation/composite_mediator ABIs (prompt-CID, window 1) untouched. - F-6 kernel-client helpers: recovery_grace(), get_recovery_deadline(tx), recover_stalled_in_progress(tx) - networks Base Sepolia repointed to F-6 redeploy: kernel 0xD8f7..349B, vault 0xAf35..69eb, registry 0xDCcF..17Bc, archive 0x63B0..75AD; deploy block 43_262_304 - SDK-2: RequestResult.transaction.escrow_id added + populated from tx.escrowId - SDK-1/D-2/F-5: no Python surface (RequestStatus model, no AA custom-kernel force-undefined path, no BuyerOrchestrator) = no gap. compile clean, 262 kernel/request/level0/wallet tests pass. NOT published (publish gated post-merge -> post-audit). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…rity follow-up) Addresses Damir's deep-dive audit of bba4d41: - version metadata: pyproject.toml 4.8.0 -> 4.9.0; version.py __version_info__ (4,8,0) -> (4,9,0) (both lagged the __version__ bump). - F-5 (REAL gap, my earlier 'no Python surface' claim was WRONG): Python DOES have BuyerOrchestrator and it lacked the pre-escrow price-band guard. Added _check_provider_price_band (optional injected agent_registry, fail-open: no registry/read-error/no-descriptor/unparseable -> allow), called before create_transaction. Mirrors TS BuyerOrchestrator._checkProviderPriceBand. +7 tests. - Re-verified directly (not from prior conclusions): D-2 genuinely no Python gap (config.actp_kernel_deployment_block flows to the scan floor in blockchain_runtime; no custom-kernel force-undefined like TS had). SDK-1 genuinely no swallow bug (_try_cancel is best-effort, TimeoutError raised after in the caller). Follow-up: default CLI/client wiring of agent_registry (guard is present + injectable + fail-open today; cli/commands/negotiate.py constructs the orchestrator without a registry). 281 py tests pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Closes the last item from Damir's bba4d41 audit: direct unit tests for the F-6 recovery helpers (recovery_grace/get_recovery_deadline/recover_stalled_in_progress) and SDK-2 RequestResult.escrow_id passthrough. SCRATCHPAD Next Steps updated (metadata/tests/F-5 marked done; CLI agent_registry wiring left as follow-up). 5 new tests, all green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…otiate CLI Parity with the TS negotiate CLI wiring. Adds AgentRegistry.connect(network) read-only factory (no signer, account=None — view calls only) and the negotiate CLI now builds it for testnet/mainnet and injects it into BuyerOrchestrator so the F-5 price-band guard is active by default. Fail-open: mock mode / no registry / RPC error -> None, guard skipped. compile clean, 185 negotiation tests pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…t_at_amount (TS parity) Damir's deep-dive caught the remaining gap: I had mirrored only TS's FIRST F-5 check (pre-create, buyer_orchestrator.py:588) but not the SECOND (TS BuyerOrchestrator.ts:1015-1030 in _commitAtAmount), so a multi-round counter could land on an out-of-band FINAL amount and Python would still accept_quote + link_escrow (lock escrow). Now _commit_at_amount re-checks the final amount against the provider band before accept+link; on out-of-band it rolls back to CANCELLED, records a rejected round, and returns (done, success=False). Fail-open when no registry (existing tests unaffected). +1 test. Both SDKs now guard at BOTH sites (pre-create + pre-commit) = full F-5 parity. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Mirror the TS F-5 fix: quote_initial_bond now caps at MAX_ESCALATION_BOND like the contract's _calculateInitialBond (was clamped to MIN only). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…iator) Expose the 2026-07-02 Sepolia deployment (BondEscalation 0x62d5417B, CompositeMediator 0xf8095f8d) on base-sepolia, matching the TS SDK. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…-arg submit_ai_ruling TS-parity port of the AIP-14c v2 SDK track (byte-identical golden digest 0xc14778...): - 9-field AIRuling with evidence/reasoning ref hashes - 64-byte (window, resultHash) delivery proof in all delivery paths (StandardAdapter, BasicAdapter, level1 agent, client.py); synthetic fallback result hash REMOVED — unified to the TS formula, fail-closed when no real result [BLOCKER-1] - bond_escalation: 5-arg submit_ai_ruling + 2-CID escalate_to_uma - agreement builder (D3 agreementHash preimage), serializer byte-identical to TS Tests: 3525 passed / 0 failed. KNOWN GAP: Schema-2.0.0 EvidenceArtifactV2 serializer exists only in sdk-js — port before the joint TS/Py release (golden vectors in sdk-js tests/evidence-artifact-v2.test.ts). NOTE: NOT yet published to PyPI (registry still at 4.8.0); ships with Faza-3. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
TS-parity re-point of BASE_SEPOLIA to the v2 redeploy (same addresses as sdk-js). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…tical TS parity Closes the release-blocker parity gap: ports the AIP-14c D5/D6 immutable evidence artifact serializer to Python (strict validation, same frozen canonicalizer as the 1.0.0 bundle). Cross-SDK hash is BYTE-IDENTICAL to sdk-js for the golden artifact (both: 0xa3678dfb781b297001e69c7830a27bd1ad53a6cd9b6951d96c77f318d33de926). - validate_evidence_artifact_v2 / serialize_artifact_v2[_to_string] / compute_artifact_v2_hash / count_artifact_v2_tokens (mirrors sdk-js dispute/EvidenceArtifactV2.ts) - rejects forbidden D6/D5 keys (reasoning/timeline) + any unknown key at any level; strict exact '2.0.0'; only carries delivery.encrypted when present (TS zod-passthrough parity) - 6 golden-vector parity tests (same vectors as sdk-js tests/evidence-artifact-v2.test.ts) Python dispute suite: 78/78. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Python3.11 suite:3607 passed,44 skipped,12 deselected; Python3.9 targeted66 passed. Source content is identical to the independently inspected local testnet candidate. Review snapshot SHA256: 2aca0aefed8f8df4f781a71c6a4b9fd4db20a225af6c57b8f48f6d5e7b9b514c No deployment, package publication or mainnet activation is included. External/runtime acceptance prerequisites remain separate.
| def do_GET(self): | ||
| if self.path.startswith("/redirect"): | ||
| self.send_response(302) | ||
| self.send_header("Location", self.path.split("?", 1)[1]) |
| assert [fn.fn_name for fn,_ in decoded]==expected | ||
| assert all(call.target==REGISTRY and call.value==0 for call in batch['calls']) | ||
| if scenario=='A': | ||
| assert 'https://agent.invalid' in decoded[0][1].values() |
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.
Aligns canonical/legacy kernel decoding, accepted-quote payments through the real adapter/wallet, and AsyncWeb3 event APIs. Shared cross-SDK vectors are packaged byte-for-byte for standalone CI; Python 3.9–3.12 support is retained.
The operator fixes preserve successful watch exit codes, forward the explicit transition proof, and await registry transaction construction before signing. The stdlib HTTP fallback accepts HTTP(S) and validates redirects while preserving fractional timeouts. Patched cryptography 50.x retains actual Python 3.9 support. DeliveryProof verification now distinguishes legacy and canonical schemas sharing the same EIP-712 type name and rejects incomplete/ambiguous payloads. Agent.request resolves the provider through the actual service directory and rejects missing addresses before funding.
Validated candidate: 6ccff70
Tree: f915bd95c390f4faabb19c0a17f5f88f9d01a6ce
Exact-head CI: https://github.com/agirails/sdk-python/actions/runs/42378341016
Validation:
Owner-authorized CI debt:
Damir explicitly approved merge with the recorded CI debt. Repository-wide Ruff/format still fails. The supplemental fixes reduced comparable Ruff 0.15.16 diagnostics from 3671 to 3662; main had 3419, so the original integration also adds lint debt. CI installs a floating newer Ruff version. Five Bandit heuristics remain in four files verified byte-identical to main: serve.py, agirailsmd.py, proofs.py and validation.py. These reports are not represented as validated vulnerabilities. The borderline CI coverage diagnostic above is also recorded. Overall CI and Test Summary remain red.
No new lint waivers, coverage omissions, lowered thresholds, disabled checks, or bulk source reformatting were added. A broad cleanup attempt was rejected and removed before this final scoped candidate.
No PyPI publication, release tag, deployment, mainnet transaction, owner/key change or live paymaster activation is included. Live Base Sepolia, mutation, benchmark and integration jobs are skipped for this PR; no live-chain readiness claim is made.
Merge readback: main is 76854ab, with tree f915bd95c390f4faabb19c0a17f5f88f9d01a6ce identical to the validated candidate. The automatic post-merge Python SDK Tests run 42378892576 was deliberately cancelled to prevent its existing main-only benchmark auto-push to gh-pages under the no-deployment instruction. This is not a post-merge CI pass; the validation above is from exact-tree PR CI and isolated host runs. No checks or workflow definitions were disabled.