Repository navigation
fix(projection): validate canonical decimal timestamps in TypeScript hrTime and skip non-finite floats in spanAttributes (#114) - #119
Conversation
…hrTime and skip non-finite floats in spanAttributes (agentrust-io#114) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: Raghuvar Durga <177662415+drk-ram@users.noreply.github.com>
|
🟡 Contributor Check: MEDIUM
Automated check by AgenTrust Contributor Check. |
dinakarjs
left a comment
There was a problem hiding this comment.
Bounded review of exact head 49da7a9. I fetched packages/typescript/src/projection.ts at this SHA and executed that module directly using Node 24.22.1 with type stripping. Canonical controls 0, 1 and 1000000001 return the expected tuples; trailing LF, CR, CRLF and Unicode line/paragraph separators are rejected. The spanAttributes control retains run_id while omitting NaN/Infinity values. No new blocker found in those checked paths.
The added 20-digit ceiling already bounds seconds to at most 99,999,999,999, so the subsequent MAX_SAFE_INTEGER-seconds check cannot be reached by a value that passed that regex. Treat it as defensive/redundant, not an independently exercised boundary. A useful nonblocking addition is a committed positive control at 99999999999999999999 ns with the exact [99999999999, 999999999] tuple, alongside the 21-digit refusal.
This is direct TypeScript-module validation and source review; I have not run the repository's complete Python/TypeScript suites or schema consumers in this environment. Reviewed with OpenAI Codex.
dinakarjs
left a comment
There was a problem hiding this comment.
Completing review at unchanged exact head 49da7a9 after the earlier direct-module controls. Fresh hash-locked requirements/test.txt environment and editable local installation: complete Python unittest discovery passes 159 tests with OTEL_TRACES_SAMPLER=always_on. The TypeScript build passes; all 45 TypeScript tests pass via node --import tsx --test test/*.test.ts. npm test's tsx launcher cannot create its local IPC pipe in this environment; invoking the same test files through Node's loader avoids that launcher limitation without changing tests or source. No source changes. Approving the bounded projection/canonical-decimal fix; the suggested 20-digit positive boundary remains nonblocking. Hosted gates and maintainer disposition remain separate. Reviewed with OpenAI Codex.
|
The shared boundary-test follow-up is now a signed test-only adoption companion: dinakarjs#5 at 4d5dcb2, based on your exact 49da7a9 head. Six positive timestamp tuples, thirteen refusals and five projection cases run from the same fixture in both SDKs. Python full suite 162 passes; TS full suite 69 passes and build passes. Removing each decimal/nonfinite projection guard independently fails the new cases. No runtime/schema change or reapproval of our own tests; author adoption and independent review remain separate. |
Closes #114
Summary
/^(0|[1-9][0-9]{0,19})$/) and safe-integer seconds in TypeScripthrTime(packages/typescript/src/projection.ts) before callingBigInt(value).float/numbervalues (NaN,Infinity) inspan_attributes(src/agentrust_telemetry/projection.py) andspanAttributes(packages/typescript/src/projection.ts).tests/test_otel_projectors.pyandpackages/typescript/test/metrics.test.ts.Validation
pytest tests/test_otel_projectors.py -k "not real and not action_metrics" -q— passed (4 passed)