feat(compliance): add get_compliance_reports_by_batch tool and surface batchId - #410
Merged
AutomateIP merged 1 commit intoAug 18, 2026
Conversation
…e batchId run_compliance_plan silently discarded the platform's batchId field; it is now surfaced as an optional batchId: str | None (graceful degradation over strict validation). Adds a new read-only tool get_compliance_reports_by_batch with matching service method and models validated field-by-field against the platform OpenAPI spec.
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
Adds a new read-only tool
get_compliance_reports_by_batch(ctx, batch_id)andfixes a bug where
run_compliance_plansilently discarded the platform'sbatchId. The two changes are coupled: the new tool needs a batch ID, whichwas previously being dropped before the caller could ever see it.
Changes
run_compliance_plannow surfacesbatchId: str | None(optional; gracefuldegradation over strict validation, per explicit design decision).
get_compliance_reports_by_batch(ctx, batch_id: str), annotatedread_only=True, idempotent=True, open_world=False.OpenAPI spec, using the established wrapper-model pattern (per fix: route get_templates through GetTemplatesResponse RootModel to remove startup output_schema warning #405/feat: add trigger_automation tool and get_automations unified view #356/fix: handle union return types in tool output schema generation #361).
test that fails without the batchId pass-through.
Testing
make cipasses clean (2858 tests).compliance plan ("NERC-CIP Cisco IOS Compliance Plan"), confirmed the
response now includes a populated
batchId, then calledget_compliance_reports_by_batchwith that real batch ID and received 4 realper-device compliance report records with correct schema. No regression on
describe_compliance_reportorget_compliance_plans.Known limitations
matching devices and when the batch ID is unknown/nonexistent. Callers cannot
currently distinguish these two cases from the response alone.
Related Issues
Roadmap: 0.15.0 Tier C #10.