Skip to content

prototype(manifest_requirements): resolve accepted_methods and validate binding endpoints - #586

Merged
imran-siddique merged 2 commits into
agentrust-io:mainfrom
drk-ram:drk-ram-fix-manifest-requirements-bindings
Oct 22, 2026
Merged

imran-siddique merged 2 commits into
agentrust-io:mainfrom
drk-ram:drk-ram-fix-manifest-requirements-bindings

Conversation

@drk-ram

@drk-ram drk-ram commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

What this changes

Contributor: Raghuvar Durga (@drk-ram)
Closes #580

Fixes two defects in prototype/manifest_requirements.py (combine_requirements):

  1. Resolve required_bindings[].accepted_methods against local policy without duplicating or dropping local bindings:

    • Keeps local.bindings keyed by (source, target, relationship, method) so local policy with both "same-instance-v1" and "same-evidence-v1" on one pair is preserved unchanged.
    • When local policy already requires "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.
    • When local policy has only "same-instance-v1" and the manifest requires "same-evidence-v1", tightens the binding to "same-evidence-v1".
  2. Reject unconfigured binding endpoints, invalid endpoints, and unsupported methods with ProfileError:

    • Validates declared.source and declared.target against local_by_id and raises ProfileError("manifest_component_unconfigured") instead of leaking a raw Pydantic ValidationError.
    • Validates declared.source != declared.target and declared.relationship == "same-workload", raising ProfileError("binding_endpoint").
    • Validates that declared.accepted_methods is non-empty and contains only supported methods, raising ProfileError("manifest_requirement_untrusted").
    • Wraps the final Requirements.model_validate call so any ValidationError raises ProfileError("input_invalid").

Type of change

  • Editorial (typo, link fix, clarification: no normative effect)
  • Non-breaking spec change (new optional field, new platform profile, informative addition)
  • Breaking spec change (requires 14-day comment period and Project Lead sign-off)
  • Schema change
  • Example addition

Spec section

N/A (prototype/manifest_requirements.py and tests/test_manifest_requirements_bindings.py)

Tests for a fix

Added tests/test_manifest_requirements_bindings.py covering multi-method resolution, tightening, preserving local dual-method and same-evidence-v1 bindings, 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 skip against origin/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

  • DCO sign-off on all commits (git commit -s)
  • CHANGELOG.md updated (for any normative change)
  • Breaking changes marked with <!-- CHANGED: #NNN: description --> in spec text
  • Backward compatibility statement included (for breaking changes)

…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>
@drk-ram
drk-ram requested review from a team, lywinged and rajnisht7 as code owners October 19, 2026 19:21

@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.

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>
@drk-ram

drk-ram commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

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 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.

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 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.

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.

@imran-siddique
imran-siddique merged commit 4c83b1d into agentrust-io:main Oct 22, 2026
13 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

prototype(manifest_requirements): resolve accepted_methods without duplicating bindings and reject unconfigured binding endpoints with ProfileError

3 participants