conformance: harden URI, explicit-null, and string-digest checks in TR-RTE, TR-ANC, TR-TXN, TR-SCA, and TR-POL
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 75/100
Research direction
Start with conformance/src/trace_tests/modules/tr_rte.py, tr_anc.py, tr_txn.py, tr_sca.py, and tr_pol.py, using schema/trace-claim.json as the validation reference. Locate the named conformance checks and existing tests or fixtures for URI, explicit-null, and digest handling. Done means malformed or schema-invalid values produce Status.FAIL, missing optional fields alone produce Status.SKIP, and valid records retain their existing results.
Written by the indexing model from the issue text.
Description
What is wrong
Contributor: Raghuvar Durga (@drk-ram)
On main (e1560f3), four conformance modules in conformance/src/trace_tests/modules/ have URI, explicit-null, and non-string digest coercion gaps that allow schema-invalid records to pass or skip conformance checks:
-
TR-RTE-003(conformance/src/trace_tests/modules/tr_rte.py, lines 90-104):- Checks only
if rim_uri is None: Status.SKIPandelif isinstance(rim_uri, str) and rim_uri.startswith("https://"): Status.PASS. - As a result:
- Explicit
{"rim_uri": None}(nullin JSON, which failsschema/trace-claim.jsonbecauseruntime.rim_uriis"type": "string") returnsStatus.SKIPinstead ofStatus.FAIL(unlikeTR-APR-003andTR-APR-004, which fail on explicitnull). rim_uri = "https://"(empty authority/host),rim_uri = "https://ex ample.com/rim"(contains whitespace),rim_uri = "https://example.com/\x01"(contains control characters), andrim_uri = "https://["(unparseable IPv6 host) all returnStatus.PASS!
- Explicit
- Checks only
-
TR-ANC-001(conformance/src/trace_tests/modules/tr_anc.py, lines 21-42):- Uses
urlparse(transparency)and checks onlyparsed.scheme != "https" or not parsed.netloc. - Because
urllib.parse.urlparsedoes not reject whitespace or control characters,transparency = "https://rekor.sigstore.dev/api/v1/log/entries/bad uri"or"https://rekor.sigstore.dev/api/v1/log/entries/x\n"returnsStatus.PASSonTR-ANC-001(whereasTR-POL-003andTR-APR-002/003explicitly reject whitespace and control characters).
- Uses
-
TR-TXN-002(conformance/src/trace_tests/modules/tr_txn.py, lines 31-34):- Checks
call_count = txn.get("call_count"); if call_count is None: Status.SKIP. - When
"call_count": nullis explicitly present intool_transcript("call_count" in txn and txn["call_count"] is None),schema/trace-claim.jsonrejects it ("type": "integer"), butTR-TXN-002returnsStatus.SKIPinstead ofStatus.FAIL.
- Checks
-
Non-string digest coercion via
str(...)inTR-RTE-002,TR-SCA-002,TR-TXN-001, andTR-POL-001:tr_rte.py(_DIGEST_RE.fullmatch(str(measurement))),tr_sca.py(_DIGEST_RE.fullmatch(str(digest))),tr_txn.py(_DIGEST_RE.fullmatch(str(h))), andtr_pol.py(_DIGEST_RE.fullmatch(str(bundle_hash))) coerce non-strings viastr(...)before matching_DIGEST_RE, instead of requiringisinstance(..., str).
Spec section or file
conformance/src/trace_tests/modules/tr_rte.py(TR-RTE-002,TR-RTE-003)conformance/src/trace_tests/modules/tr_anc.py(TR-ANC-001)conformance/src/trace_tests/modules/tr_txn.py(TR-TXN-001,TR-TXN-002)conformance/src/trace_tests/modules/tr_sca.py(TR-SCA-002)conformance/src/trace_tests/modules/tr_pol.py(TR-POL-001)
Expected behavior
TR-RTE-003should skip only when"rim_uri" not in runtime, fail whenrim_uriisNoneor not astr, and require a validhttpsURI with non-empty host (netloc) and no whitespace or control characters.TR-ANC-001should rejecttransparencyURIs containing whitespace or control characters withStatus.FAIL.TR-TXN-002should skip only when"call_count" not in txn, and fail withStatus.FAILwhen"call_count"is explicitlyNone.TR-RTE-002,TR-SCA-002,TR-TXN-001, andTR-POL-001should requireisinstance(value, str)before matching_DIGEST_RE.
Impact
Prevents trace-tests from passing malformed runtime.rim_uri ("https://" or URIs with spaces/control characters) and transparency URIs with spaces/control characters, or skipping explicit null values on runtime.rim_uri and tool_transcript.call_count.
- Dominant language
- Python
- Stars
- 37
- Forks
- 33
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 122
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from agentrust-io/trace-spec
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
agentrust-io/trace-spec#593 · 1 comment ·
Maintainers usually reply within 1 day
-
bug needs-review:HIGH
Difficulty 5/5 Over a week Newbie friendliness 20/100
agentrust-io/trace-spec#591 · 4 comments ·
Maintainers usually reply within 1 day
-
prototype(manifest_requirements): resolve accepted_methods without duplicating bindings and reject unconfigured binding endpoints with ProfileErrorPossibly taken @drk-ram claimed this 1 day ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 78/100
agentrust-io/trace-spec#580 ·
Maintainers usually reply within 1 day
-
feat(delegation): add parent_record_hash, verify_delegation_link, and verify_delegation_chain to agentrust_tracePossibly taken @drk-ram claimed this 1 day ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 58/100
agentrust-io/trace-spec#581 ·
Maintainers usually reply within 1 day
-
revocation,trust-record-verify: implement es256 and es384 bundle verification and add EC revocation vectors (#448 items 1, 10)Possibly taken @drk-ram claimed this 1 day ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 52/100
agentrust-io/trace-spec#584 ·
Maintainers usually reply within 1 day
All issues in agentrust-io/trace-spec
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
changelog investigate
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
ramnes/notion-sdk-py#423 ·
-
type-bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day