Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ba1d7d4bae
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if v == 0.0 and str(v).startswith("-"): | ||
| return "0" | ||
| return format(v, "g") if isinstance(v, float) else str(v) | ||
| return str(v) |
There was a problem hiding this comment.
Format floats using JS-compatible canonical encoding
Using str(v) for numeric canonicalization diverges from the TypeScript/runtime behavior (String(v)), e.g. a float like 1.0 canonicalizes to "1.0" here but "1" in TS. That changes the canonical payload and hash, so Python can reject otherwise valid signed receipts whenever unsigned receipt fields include integral float values (or other JS/Python stringification mismatches), causing false verification failures.
Useful? React with 👍 / 👎.
Motivation
Description
commandlayer/types.pyand a consistentCommandLayerErrorincommandlayer/errors.py.CommandLayerClientincommandlayer/client.pywith constructor options (runtime,actor,timeout_ms,headers,retries,verify_receipts,verify), convenient verb helpers, genericcall, retry-aware transport, and receipt verification hooks using the verification module.commandlayer/verify.pyto include deterministiccanonicalize_stable_json_v1,recompute_receipt_hash_sha256,parse_ed25519_pubkey,verify_ed25519_signature_over_utf8_hash_string, and deterministic ENS two-hop signer-key resolution viacl.receipt.signer -> cl.sig.pub + cl.sig.kidwith clear, actionable errors and aSignerKeyResolutionreturn type.commandlayer/__init__.py, addedpyproject.tomlfor packaging and dev tooling, and added docs (README.md,docs/*) that mirror the TS SDK guidance and examples.tests/test_client.py,tests/test_verify.py,tests/test_public_api.py) to cover client request flow, error propagation, explicit and ENS-based verification, two-hop ENS resolution, and canonicalization/signature validation.Testing
ruff check .which reported no issues after formatting, andruff format .was applied when needed (passed).mypy commandlayercompleted with no errors.pytest -qran the test suite and all tests passed (no failures, test run showed 100% success).python -m buildfailed in this environment because thebuildhelper module is not installed andpip install buildwas blocked by network/proxy restrictions, so the sdist/wheel build could not be executed here.Codex Task