Skip to content

fix(evidence): reject boolean/non-integer max_events and enforce 64-char lowercase hex previousDigest in Python and TypeScript (#105) - #107

Open
drk-ram wants to merge 2 commits into
agentrust-io:mainfrom
drk-ram:drk-ram-fix-evidence-105
Open

drk-ram wants to merge 2 commits into
agentrust-io:mainfrom
drk-ram:drk-ram-fix-evidence-105

Conversation

@drk-ram

@drk-ram drk-ram commented Oct 23, 2026

Copy link
Copy Markdown

Summary

  • Reject boolean or non-integer max_events in Python EvidenceAccumulator.__init__ and require typeof runId === "string" and Number.isSafeInteger(maxEvents) in TypeScript EvidenceAccumulator.
  • Require previous_digest / previousDigest (when present) to match ^[0-9a-f]{64}$ in both Python _entry_digest and TypeScript entryDigest.

Closes #105

Validation

  • python -m pytest tests/test_evidence.py -q
  • python -m ruff check src/agentrust_telemetry/evidence.py tests/test_evidence.py

@drk-ram
drk-ram requested review from a team and imran-siddique as code owners October 23, 2026 22:59
@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

🟡 Contributor Check: MEDIUM

Check Result
Profile MEDIUM
Credential LOW
Overall MEDIUM

Automated check by AgenTrust Contributor Check.

@github-actions github-actions Bot added the needs-review:MEDIUM Contributor check flagged MEDIUM risk label Oct 23, 2026
…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>
@drk-ram
drk-ram force-pushed the drk-ram-fix-evidence-105 branch from c3c27ef to 36747f8 Compare October 23, 2026 23:00
…#107

Signed-off-by: Srinivasa Dinakar Jainti <dinakarjs@gmail.com>

@dinakarjs dinakarjs left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@drk-ram

drk-ram commented Oct 24, 2026

Copy link
Copy Markdown
Author

Thanks @dinakarjs! Fast-forward merged your signed TypeScript boundary test commit (a4c3677, packages/typescript/test/evidence-boundaries.test.ts) with full authorship and sign-off preserved.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-review:MEDIUM Contributor check flagged MEDIUM risk

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(evidence): reject boolean/non-integer max_events and enforce 64-char lowercase hex previousDigest in Python and TypeScript

2 participants