Skip to content

fix(data_flow,propagation): validate size_bytes/token_count in Python data_flow and reject control chars and conflicting headers in propagation (#104) - #108

Open
drk-ram wants to merge 2 commits into
agentrust-io:mainfrom
drk-ram:drk-ram-fix-data-flow-propagation-103
Open

drk-ram wants to merge 2 commits into
agentrust-io:mainfrom
drk-ram:drk-ram-fix-data-flow-propagation-103

Conversation

@drk-ram

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

Copy link
Copy Markdown

Summary

  • Validate isinstance(source, DataEndpoint), isinstance(destination, DataEndpoint), and non-negative safe-integer size_bytes and token_count (rejecting bool) in src/agentrust_telemetry/data_flow.py to match TypeScript classifiedDataFlow.
  • Reject ASCII control characters (\x00..\x1f, \x7f) and conflicting case-insensitive duplicate correlation headers in src/agentrust_telemetry/propagation.py.

Closes #104

Validation

  • python -m pytest tests/test_data_flow.py tests/test_propagation.py -q
  • python -m ruff check src/agentrust_telemetry/data_flow.py src/agentrust_telemetry/propagation.py tests/test_data_flow.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
… data_flow and reject control chars and conflicting headers in propagation (agentrust-io#103)

- Validate DataEndpoint types and non-negative safe-integer size_bytes and token_count in Python classified_data_flow, matching TypeScript classifiedDataFlow.
- Reject ASCII control characters and conflicting case-insensitive duplicate headers in Python propagation.

Closes agentrust-io#103

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-data-flow-propagation-103 branch from 50a97ec to 4504aef Compare October 23, 2026 22:59

@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 4504aef. 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 new combined test stops on its first failing size assertion, so it does not independently demonstrate the control-character and conflicting-header guards. Please split the regression into independent tests and add valid twins, including identical case-insensitive duplicate headers and boundary size values. Also correct the description's closing reference: data-flow/propagation is #104, not #103.

Source review and local validation are complete within this scope; regression coverage remains for author follow-up before approval.

Prepared with OpenAI Codex.

… twins

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 changed the title fix(data_flow,propagation): validate size_bytes/token_count in Python data_flow and reject control chars and conflicting headers in propagation (#103) fix(data_flow,propagation): validate size_bytes/token_count in Python data_flow and reject control chars and conflicting headers in propagation (#104) Oct 24, 2026
@drk-ram

drk-ram commented Oct 24, 2026

Copy link
Copy Markdown
Author

Thanks @dinakarjs! Split the regression into three independent test methods in tests/test_data_flow.py (test_data_flow_validates_endpoints_and_safe_integer_size_and_token_bounds, test_propagation_rejects_control_characters, and test_propagation_rejects_conflicting_duplicate_headers_and_accepts_identical_duplicates) with valid boundary twins (0 and 2**53 - 1, plus identical case-insensitive duplicate headers), and updated the PR title/description to Closes #104.

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(data_flow,propagation): validate size_bytes/token_count in Python data_flow and reject control chars and conflicting headers in propagation

2 participants