Skip to content

fix(factory,agt-approval,agt-audit): preserve explicit empty event_id/instance_id for validation and reject pre-epoch timestamps in TS (#115) - #120

Merged
rajnisht7 merged 2 commits into
agentrust-io:mainfrom
drk-ram:drk-ram-fix-factory-agt-ts-115
Nov 25, 2026
Merged

rajnisht7 merged 2 commits into
agentrust-io:mainfrom
drk-ram:drk-ram-fix-factory-agt-ts-115

Conversation

@drk-ram

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

Copy link
Copy Markdown
Contributor

Closes #115

Summary

  • Use event_id is None instead of event_id or ... in Python EventFactory.build (src/agentrust_telemetry/adapters/base.py) so an explicit event_id="" fails validation instead of silently generating a random UUID.
  • Preserve explicit non-None/undefined producer_instance_id / producer.instanceId in Python (base.py) and TypeScript (packages/typescript/src/factory.ts) so "" fails schema validation.
  • Reject pre-epoch (< 1970-01-01T00:00:00Z) timestamps in packages/typescript/src/agt-approval.ts and packages/typescript/src/agt-audit.ts.
  • Add Python and TypeScript unit tests in tests/test_adapters.py, packages/typescript/test/agt-approval.test.ts, and packages/typescript/test/agt-audit.test.ts.

Validation

  • pytest tests/test_adapters.py -q — passed (23 passed)

@drk-ram
drk-ram requested review from a team and imran-siddique as code owners October 25, 2026 06:48
@github-actions

github-actions Bot commented Oct 25, 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 25, 2026
@drk-ram
drk-ram force-pushed the drk-ram-fix-factory-agt-ts-115 branch from 0f29f80 to 3d8953a Compare October 29, 2026 17:14
…/instance_id for validation and reject pre-epoch timestamps in TS (agentrust-io#115)

Signed-off-by: Raghuvar Karthik Durga <177662415+drk-ram@users.noreply.github.com>
@drk-ram
drk-ram force-pushed the drk-ram-fix-factory-agt-ts-115 branch from 3d8953a to 3c256d5 Compare November 13, 2026 01:13

@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 the identifier defaults and both TypeScript timestamp parsers. Omitted IDs still use their defaults, while explicit empty IDs reach validation. The timestamp change preserves the Unix epoch boundary and fractional nanoseconds. The full Python suite passed with 167 tests and 174 subtests. The TypeScript build and all 51 TypeScript tests passed using Node's test runner with the tsx import. Hosted workflows await maintainer authorization.

Prepared with OpenAI Codex.

@imran-siddique imran-siddique left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approving at 3c256d5: ran conformance, the Python suite and the TS check on this head; each new test fails against main's source; all 11 PRs in this series merge onto main together without conflicts and pass combined.

@rajnisht7
rajnisht7 merged commit 289ba20 into agentrust-io:main Nov 25, 2026
9 checks passed
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

4 participants