3 of 6 InspectionResult values are declared but unreachable
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 3/5
- Estimated time
- Half a day
- Newbie friendliness
- 35/100
Research direction
Start with the InspectionResult Literal at src/cmcp_runtime/audit/chain.py (around lines 44-46), then run the two rg searches in the issue to confirm which values response_inspection_result is actually assigned. The fix depends on a maintainer choice among the three options, so confirm the direction in the thread before editing. Done means the type matches the emitted values, or the unreachable values are documented as reserved, with any affected tests passing.
Written by the indexing model from the issue text.
Description
Summary
InspectionResult in cmcp_runtime.audit.chain declares six Literal values, but only three are ever assigned to response_inspection_result anywhere in the codebase:
| Value | Emitted? | Where |
|---|---|---|
size_exceeded |
✅ | proxy.py — size-check terminal path |
injection_detected |
✅ | proxy.py — injection-scan terminal path |
n/a |
✅ | chain.py — _append_session_start default |
schema_violation |
❌ | Stage 2 schema violations flow to policy_decision, never to response_inspection_result |
surplus_stripped |
❌ | Schema redaction emits policy_decision="redact", not a response_inspection_result |
pass |
❌ | Inspection pipeline returns "allow"/"deny" as decisions; "pass" is never written |
The type definition at chain.py:44–46:
InspectionResult = Literal[
"pass", "injection_detected", "schema_violation",
"surplus_stripped", "size_exceeded", "n/a"
]
Repro
# from repo root, at main HEAD
rg '"schema_violation"|"surplus_stripped"' src/cmcp_runtime/ --type py
# returns zero matches for response_inspection_result assignment
rg '"pass"' src/cmcp_runtime/audit/ --type py
# only match is the "pass" literal inside the Literal[] type itself
Impact
- Downstream consumers that branch on
"schema_violation"or"surplus_stripped"from a TRACE claim or audit record will never see those values. - The type overstates the vocabulary the gateway actually emits, which is a spec-vs-implementation drift.
Options
- Implement the missing paths — wire Stage 2 schema violations to emit
response_inspection_result="schema_violation", surplus-field stripping to"surplus_stripped", and clean inspection passes to"pass". - Trim the type — remove the three unreachable values from
InspectionResultand document that schema violations are recorded only inpolicy_decision. - Intentional forward-reservation — if these are placeholders for planned inspection stages, document that in the type or a
# TODOso the gap is explicit.
- Dominant language
- Python
- Stars
- 33
- Forks
- 24
- Avg merge
- 19h 50m
- Merged PRs (30d)
- 75
Getting set up
- Ships a 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/cmcp
-
Follow-ups from #779: seal after bundle verification, owner-auth wording, config-digest changelogPossibly taken @rajnisht7 claimed this 1 day ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 57/100
agentrust-io/cmcp#782 · 2 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
agentrust-io/cmcp#736 · 6 comments ·
Maintainers usually reply within 1 day
-
Session identity is minted fresh on every open, so a restarted or peer instance cannot resume a sessionPossibly taken @dinakarjs claimed this 1 day ago. Openhelp wanted
Difficulty 4/5 3-5 days Newbie friendliness 55/100
agentrust-io/cmcp#675 · 3 comments ·
Maintainers usually reply within 1 day
-
Define explicit authorization for releasing confidential data and derived outputsPossibly taken @rajnisht7 claimed this 1 day ago. Open
Difficulty 5/5 Over a week Newbie friendliness 25/100
agentrust-io/cmcp#660 · 7 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
Bind MCP Tasks and authenticated callbacks into cMCP evidencePossibly taken @rajnisht7 claimed this 1 day ago. Open
Difficulty 5/5 Over a week Newbie friendliness 35/100
agentrust-io/cmcp#567 · 19 comments · 1 assignee ·
Maintainers usually reply within 1 day
All issues in agentrust-io/cmcp
Similar issues
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
yunaremaia/proto-drift#22 ·
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
yunaremaia/memwatch#96 ·
-
bug good first issue
Difficulty 1/5 Under an hour Newbie friendliness 91/100
yunaremaia/ci-gate-watch#34 ·
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
yunaremaia/agent-capability-attestation#64 ·
Maintainers usually reply within 1 day
-
bug good first issue
Difficulty 1/5 Under an hour Newbie friendliness 86/100
yunaremaia/agent-call-graph#43 ·
Maintainers usually reply within 1 day