Skip to content

test(airt): guard generated workflows against dead Assessment methods (ENG-6777)#59

Merged
rdheekonda merged 1 commit into
mainfrom
test/eng-6777-workflow-assessment-methods
Jun 16, 2026
Merged

test(airt): guard generated workflows against dead Assessment methods (ENG-6777)#59
rdheekonda merged 1 commit into
mainfrom
test/eng-6777-workflow-assessment-methods

Conversation

@rdheekonda

Copy link
Copy Markdown
Contributor

Addresses ENG-6777.

Status: already fixed — this PR adds a regression guard

ENG-6777 reported that the TUI agent's generate_attack tool produced workflows calling Assessment methods that no longer exist (record_attack, analyze, push_analytics, generate_report, push_report), crashing the fresh-install happy path with AttributeError.

Verified the current capability (1.4.0) no longer has this bug:

  • Assessment exposes only register/trace/run/done/complete/fail.
  • attack_runner.py has zero references to the five methods (git log -S record_attack shows they never appear in tracked history — the rewrite to the assessment.run(study) API predates it).
  • Generated a real tap workflow: it calls register/trace/run/fail only and executed to completion.

Since the code is already correct, this PR adds tests so the regression cannot silently return.

Tests

  • test_runner_source_has_no_dead_methods — no generator template (any of the 5 modes) references the removed methods.
  • test_single_attack_calls_exist_on_assessment — extracts every assessment.<m>() call from a generated script and asserts each is a real attribute on the installed SDK Assessment class. This also catches the inverse: an SDK rename/removal of a method the template still uses.

Uses generate_only: True so generation runs without executing attacks (fast, offline).

Test plan

  • python -m pytest tests/test_attack_runner.py::TestGeneratedWorkflowAssessmentMethods — 2 passed
  • Confirmed the dynamic check captures register/trace/run/fail and that all 5 dead methods report hasattr=False

No capability version bump — test-only, no behavioral change.

… (ENG-6777)

ENG-6777 reported that generated workflows called Assessment methods that no
longer exist (record_attack, analyze, push_analytics, generate_report,
push_report), crashing the TUI's primary path with AttributeError. The
current generator already uses the assessment.run(study) API and is correct;
these tests lock that in so the regression can't return.

- test_runner_source_has_no_dead_methods: no generator template (any mode)
  references the five removed methods.
- test_single_attack_calls_exist_on_assessment: every assessment.<m>() in a
  generated script is a real attribute on the installed SDK Assessment class
  (also catches SDK-side renames/removals).

Validation: python -m pytest tests/test_attack_runner.py::TestGeneratedWorkflowAssessmentMethods (2 passed).
@rdheekonda rdheekonda force-pushed the test/eng-6777-workflow-assessment-methods branch from 86e72a8 to a58ad65 Compare June 16, 2026 16:19
@rdheekonda rdheekonda merged commit 1922837 into main Jun 16, 2026
5 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.

1 participant