simplify(agent-hosts): dedup hermes profile-binding admission check - #3064
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
validate_hermes_profile_bindings(host, bindings)helper inhost_bundle::controland call it from both enforcement sites.hermes_profile_binding_admission_is_identical_at_both_entry_pointspinning the rule (Hermes: exactly 1 binding; every other host: exactly 0) through both the single-component dry-run and the component-set preview.Motivation
The same 4-arm
matchreturningHostBundleError::InvalidHermesProfileBindinglived verbatim inplanner::plan_lifecycle_mutationandcontrol::validate_component_set_request, differing only in field-access path. One helper makes the security-relevant admission invariant live in a single place so future edits cannot silently diverge.Changes
control.rs: newpub(super) fn validate_hermes_profile_bindings;validate_component_set_requestcalls it in place of the inlinematch.planner.rs:plan_lifecycle_mutationcalls the same helper with(manifest.host, request.hermes_profile_bindings)at the same gate position.tests.rs: new test covering Hermes × {0,1,2} and a non-Hermes host × {0,1} at both entry points.Behavior-preserving: identical conditions evaluated, identical error returned at the same point in each validation sequence.
Test plan
cargo test -p tracedecay-agent-hosts host_bundle::tests— 28 passedcargo clippy -p tracedecay-agent-hosts --all-targets -- -D warningscleancargo fmt --all -- --checkcleanpython3 scripts/linux-test-partitions.py checkcleancargo test -p tracedecay-agent-hosts --lib agents::host_bundle::tests::hermes_profile_binding_admission_is_identical_at_both_entry_points -- --exactpassesChecklist
CHANGELOG.mdupdated (under[Unreleased]if no version bump).envfiles includedLink to Devin session: https://app.devin.ai/sessions/0d1d5a4296fe4f9ba125199ff3287911
Open in Devin Desktop: https://app.devin.ai/desktop/session/0d1d5a4296fe4f9ba125199ff3287911?variant=devin
Requested by: @ScriptedAlchemy