Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

fix(platform_measurement): reject non-string or empty runtime.measurement across Python and TypeScript

Đang mở
#628 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Một pull request liên quan đã được merge.

  • #633 của @drk-ram — đã merge

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
30/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python, typescript
Lĩnh vực
backend-api-design

Hướng nghiên cứu

Read src/agentrust_trace/platform_measurement.py and trust-record-verify/src/platform.ts, then find the tests for check_platform_measurement and checkPlatformMeasurement. Check how each function handles absent, empty, and non-string runtime.measurement values, and verify the returned outcome and cause against the proposed behavior. Pull request #633 is already open for this issue.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

needs-review:MEDIUM
Summary

Direct calls to check_platform_measurement (src/agentrust_trace/platform_measurement.py) and checkPlatformMeasurement (trust-record-verify/src/platform.ts) do not require runtime.measurement to be a non-empty string:

  1. Non-string or empty runtime.measurement accepted in check_platform_measurement / checkPlatformMeasurement:
    • Both implementations check only runtime.get("measurement") is None (or measurement === undefined || measurement === null in TypeScript).
    • If record={"runtime": {"measurement": 123}}, record={"runtime": {"measurement": ""}}, or record={"runtime": {"measurement": True}} is passed directly and the caller's appraiser echoes {"measurement": runtime["measurement"], "layers": {"pcr:0": "established"}}, both functions return outcome="appraised" with a non-string or empty evidence["measurement"], violating the documented contract that measurement is a non-empty string ("measurement, the string it appraised") and evidence is JSON-serializable.
Proposed Fix
  • In check_platform_measurement (Python) and checkPlatformMeasurement (TypeScript), require isinstance(measurement, str) and bool(measurement) (in TS: typeof measurement === "string" && measurement !== ""), returning not_attempted with cause="field_absent" when runtime.measurement is absent, empty, or not a string.
Ngôn ngữ chính
Python
Star
37
Fork
33
Merge trung bình
1 ngày 18 giờ
Pull request đã merge (30 ngày)
118

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của agentrust-io/trace-spec

Tất cả issue của agentrust-io/trace-spec

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.