Repository navigation
fix(capture-core): reject duplicate JSON keys and non-finite numbers in load_state/sha_mapping and check seal.alg in check_seal (#366) - #370
Conversation
…in load_state/sha_mapping and check seal.alg in check_seal (agentrust-io#366) - Reject duplicate JSON object keys and NaN/Infinity constants in load_state (returning None) and pass allow_nan=False in sha_mapping. - Verify seal.get("alg") == "SHA-256" when "alg" is present in check_seal. Closes agentrust-io#366 Signed-off-by: Raghuvar Durga <177662415+drk-ram@users.noreply.github.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
🟡 Contributor Check: MEDIUM
Automated check by AgenTrust Contributor Check. |
carloshvp
left a comment
There was a problem hiding this comment.
Reviewed exact head e8ff9802582d6738ac8e713c58ff0f5581ca928d in an isolated checkout.
The capture-core changes reject non-finite values before hashing, refuse duplicate/non-finite persisted JSON, and check a present seal algorithm while retaining the established legacy behavior when that field is absent. Existing valid seal/state controls and the new malformed-input cases pass. No blocking finding in the changed package.
Validation: all 56 package tests passed, scoped Ruff and diff whitespace checks passed, and all PR commits carry sign-offs. This approval does not establish completion of hosted CI or the maintainer policy gate.
Reviewed with OpenAI Codex.
|
Hosted CI follow-up at head The current actions/python-versions manifest publishes Python 3.9.25 x64 builds for Ubuntu 22.04 and 24.04, so pinning this compatibility job to ubuntu-24.04 is a concrete way to retain the declared 3.9 coverage: https://github.com/actions/python-versions/blob/9834b4e4911ca2950ff6c3b7547f09eacc006848/versions-manifest.json. This runner setup failure is separate from the package source review and its 56 locally passing tests. |
Summary
NaN/Infinityconstants inagentrust_capture_core.state.load_state(returningNone) and passallow_nan=Falseinagentrust_capture_core.hashing.sha_mapping.seal.get("alg") == "SHA-256"when"alg"is present inagentrust_capture_core.seal.check_seal(returningINTEGRITY_BROKENon algorithm mismatch).Closes #366
Validation
python -m pytest packages/agentrust-capture-core/tests/test_core.py -q