Repository navigation
fix(evidence): reject boolean/non-integer max_events and enforce 64-char lowercase hex previousDigest in Python and TypeScript (#105) - #107
Conversation
|
🟡 Contributor Check: MEDIUM
Automated check by AgenTrust Contributor Check. |
…har lowercase hex previousDigest in Python and TypeScript (agentrust-io#105) - Reject boolean or non-integer max_events in Python EvidenceAccumulator.__init__ and require string runId and safe-integer maxEvents in TypeScript EvidenceAccumulator. - Require previous_digest / previousDigest (when present) to match ^[0-9a-f]{64}$ in Python _entry_digest and TypeScript entryDigest. Closes agentrust-io#105 Signed-off-by: Raghuvar Durga <177662415+drk-ram@users.noreply.github.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
c3c27ef to
36747f8
Compare
…#107 Signed-off-by: Srinivasa Dinakar Jainti <dinakarjs@gmail.com>
dinakarjs
left a comment
There was a problem hiding this comment.
Reviewed source at 36747f8. Python unittest discovery passed with inherited OTEL_* variables removed; the initial three OTel failures were environment configuration. TypeScript build and all 44 existing tests passed using node --import tsx --test test/*.test.ts; the npm check launcher itself encountered an IPC-listen EPERM here, so I do not claim that wrapper passed. Local results only, not hosted CI. Python: 159 tests pass.
The TypeScript change needs a committed behavioral regression. I prepared a test-only adoption companion at dinakarjs#1, based exactly on this head. Its two tests pass on this branch; restoring the previous TypeScript implementation makes the refusal assertion fail. Please adopt the signed commit and retain attribution, then obtain independent review of the combined change. This is a COMMENT because I am contributing those tests.
Prepared with OpenAI Codex.
|
Thanks @dinakarjs! Fast-forward merged your signed TypeScript boundary test commit ( |
Summary
max_eventsin PythonEvidenceAccumulator.__init__and requiretypeof runId === "string"andNumber.isSafeInteger(maxEvents)in TypeScriptEvidenceAccumulator.previous_digest/previousDigest(when present) to match^[0-9a-f]{64}$in both Python_entry_digestand TypeScriptentryDigest.Closes #105
Validation
python -m pytest tests/test_evidence.py -qpython -m ruff check src/agentrust_telemetry/evidence.py tests/test_evidence.py