feat(adversary): support dict-style atomic_ordering steps with per-step metadata#3315
Open
deacon-mp wants to merge 17 commits into
Open
feat(adversary): support dict-style atomic_ordering steps with per-step metadata#3315deacon-mp wants to merge 17 commits into
deacon-mp wants to merge 17 commits into
Conversation
* updating submodule * updating abilities
…ed per-step metadata Allow adversary profiles to specify atomic_ordering entries as dicts containing an ability_id plus a metadata block (e.g. executor_facts keyed by platform). Planning resolves facts from the embedded metadata and injects them before building links; the atomic planner selects the next link by step_idx first, then falls back to ability_id matching for legacy string-only profiles. Clean up debug artefacts: remove large commented-out post_load block, drop debug print() from atomic planner, remove emoji comments from base_api_manager, delete sample AdversarySCHEMA.yml from repo root, and restore conf/ files to master defaults. Add unit tests covering dict-step init, schema round-trip, verify(), check_repeatable_abilities(), store(), and atomic planner step_idx / fallback selection.
4 tasks
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
atomic_orderingto accept dict entries of the form{ability_id, metadata: {executor_facts: {<platform>: [...]}}}alongside legacy plain-string ability IDs.PlanningServiceextracts per-stepexecutor_factskeyed by platform and injects them into link commands before execution, replacing#{trait}placeholders.LogicalPlanner(atomic) selects the next link bystep_idxfirst, then falls back toability_idmatching for backward compatibility with string-only profiles.AdversarySchemanow acceptsma.fields.Raw()entries inatomic_orderingso both strings and dicts pass validation.update_adversary(PATCH) reads the raw JSON body directly before apispec processing to preventatomic_orderingdicts from being stripped.print(), emoji-style comments (✅,🧠), large commented-outpost_loadblock, and sampleAdversarySCHEMA.ymlfrom repo root.conf/default.yml,conf/agents.yml,conf/payloads.yml) restored to master defaults.Test plan
tests/objects/test_adversary.py— 8 newTestAdversaryDictStepscases: init,verify(),check_repeatable_abilities(), schema load/roundtrip,store()— all passtests/planners/test_atomic.py— 6 newTestAtomicDictStepscases:step_idxselection, ordering fallback, fullatomic()run — all passTestAdversary(5) andTestAtomic(3) tests continue to pass (22 total, 0 failures)