Repository navigation
prototype(manifest_requirements): resolve accepted_methods and validate binding endpoints - #586
Conversation
…te binding endpoints Resolve manifest required_bindings.accepted_methods against local policy without duplicating bindings for the same (source, target, relationship), and reject unconfigured endpoints, self/unsupported bindings, and untrusted methods with ProfileError. Closes agentrust-io#580 Signed-off-by: Raghuvar Durga <177662415+drk-ram@users.noreply.github.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
imran-siddique
left a comment
There was a problem hiding this comment.
Checked at 3979726, and two things need changing.
Agent Manifest pins accepted_methods to list[Literal["same-instance-v1"]] with max_length=1, and topology() already refuses self, undeclared and duplicate relationships. The multi-method and endpoint branches only run against the test fakes.
The reachable change is the problem. Local policy with both methods on one pair and no manifest bindings now comes out as same-evidence-v1 only; main keeps both. Combine can tighten but must never drop a local requirement. Same when local same-evidence-v1 meets a declared same-instance-v1: keep the local binding, do not refuse.
…nger bindings Keep local bindings keyed by (source, target, relationship, method) so dual-method local policy is preserved and local same-evidence-v1 bindings are retained when a manifest declares same-instance-v1. Signed-off-by: Raghuvar Durga <177662415+drk-ram@users.noreply.github.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Addressed in 3107a59: local.bindings stays keyed by (source, target, relationship, method) so a local policy with both methods on one pair keeps both, and when local same-evidence-v1 meets a declared same-instance-v1, the local binding is kept without refusing or adding a duplicate same-instance-v1 requirement. |
dinakarjs
left a comment
There was a problem hiding this comment.
Checked 3107a59 against the local-policy preservation finding. Bindings remain keyed by all four fields, so an untouched local dual-method requirement is preserved, and an existing same-evidence-v1 requirement survives a declared same-instance-v1 without refusal or duplication. All 10 binding tests pass locally on Python 3.12.14; current-head hosted Python matrices and CodeQL pass.
Scope distinction: released Agent Manifest still restricts accepted_methods and validates topology, so the added multi-method/malformed-endpoint fake cases are defensive protocol tests, not evidence those inputs reach this bridge through the released verifier. My broader local bridge selection could not collect because that environment lacked cmcp_runtime; I do not count that as either a product failure or a passing integration run. The reported preservation finding is addressed; original maintainer re-review remains.
dinakarjs
left a comment
There was a problem hiding this comment.
Completing the broader bridge review at unchanged 3107a59. The environment limitation in my preceding comment is now resolved: with released Agent Manifest 0.15.0, ca2a-runtime 0.4.0 and the cMCP checkout installed, dependency consistency passes and all 112 tests across manifest-requirements bindings, bridge and verifier-token profile pass on Linux/Python 3.11.17. Exact TRACE source is selected by PYTHONPATH.
The preservation cases retain local dual-method bindings and an existing stronger local requirement; the combined result tightens rather than weakens local trust. The fake malformed/multi-method manifest cases remain defensive protocol tests, not proof of reachable inputs from the released Agent Manifest schema. Current technical hosted checks pass. No additional blocker found in this prototype correction; original maintainer review disposition and approval gate remain separate.
What this changes
Contributor: Raghuvar Durga (@drk-ram)
Closes #580
Fixes two defects in
prototype/manifest_requirements.py(combine_requirements):Resolve
required_bindings[].accepted_methodsagainst local policy without duplicating or dropping local bindings:local.bindingskeyed by(source, target, relationship, method)so local policy with both"same-instance-v1"and"same-evidence-v1"on one pair is preserved unchanged."same-evidence-v1"for(source, target, relationship)and the manifest declares"same-instance-v1", retains the local"same-evidence-v1"binding without refusing or adding a redundant"same-instance-v1"binding."same-instance-v1"and the manifest requires"same-evidence-v1", tightens the binding to"same-evidence-v1".Reject unconfigured binding endpoints, invalid endpoints, and unsupported methods with
ProfileError:declared.sourceanddeclared.targetagainstlocal_by_idand raisesProfileError("manifest_component_unconfigured")instead of leaking a raw PydanticValidationError.declared.source != declared.targetanddeclared.relationship == "same-workload", raisingProfileError("binding_endpoint").declared.accepted_methodsis non-empty and contains only supported methods, raisingProfileError("manifest_requirement_untrusted").Requirements.model_validatecall so anyValidationErrorraisesProfileError("input_invalid").Type of change
Spec section
N/A (
prototype/manifest_requirements.pyandtests/test_manifest_requirements_bindings.py)Tests for a fix
Added
tests/test_manifest_requirements_bindings.pycovering multi-method resolution, tightening, preserving local dual-method andsame-evidence-v1bindings, unconfigured endpoints, self/unsupported relationship endpoints, and unknown/empty binding methods:pytest tests/test_manifest_requirements_bindings.py tests/test_manifest_requirements_bridge.py tests/test_verifier_token_profile.py: passed (101 passed, 1 skipped)python tools/review_bar.py --base origin/main --head HEAD: passed (10 fail on behaviour, 0 fail on a missing name or file, 0 pass or skipagainstorigin/main)python tools/check_dashes.py: passed (no dashes outside examples/, spec/trace-v0.1.md)ruff check prototype/manifest_requirements.py tests/test_manifest_requirements_bindings.py: passed (All checks passed!)mypy --strict --follow-imports=silent prototype/manifest_requirements.py tests/test_manifest_requirements_bindings.py: passed (Success: no issues found in 2 source files)Checklist
git commit -s)CHANGELOG.mdupdated (for any normative change)<!-- CHANGED: #NNN: description -->in spec text