Skip to content

[AAASM-194] ✨ (cli): Implement aasm adapter validate command#22

Merged
Chisanan232 merged 41 commits into
masterfrom
v0.0.0/AAASM-194/adapter_validate_cli
May 1, 2026
Merged

[AAASM-194] ✨ (cli): Implement aasm adapter validate command#22
Chisanan232 merged 41 commits into
masterfrom
v0.0.0/AAASM-194/adapter_validate_cli

Conversation

@Chisanan232
Copy link
Copy Markdown
Contributor

Description

Implements the aasm adapter validate <path-or-module> CLI command for community adapter validation. This allows open-source contributors to verify their custom adapter meets the FrameworkAdapter contract before submitting a PR.

Type of Change

  • ✨ New feature
  • 🔧 Bug fix
  • ♻️ Refactoring
  • 🍀 Performance improvement
  • 📚 Documentation update
  • 🚀 Release

Breaking Changes

Does this PR introduce any breaking changes?

  • No
  • Yes (please describe below)

Related Issues

  • Related JIRA ticket: AAASM-194
  • Parent Epic: AAASM-5
  • Depends on: AAASM-46 (FrameworkAdapter ABC - stable on master)

What Changed

New files

  • agent_assembly/cli/__init__.py — CLI package
  • agent_assembly/cli/adapter_validator.py — Validator logic: 7 contract checks + adapter class loader
  • agent_assembly/cli/output.py — PASS/FAIL output formatter
  • agent_assembly/cli/main.py — argparse CLI with aasm adapter validate subcommand

Modified files

  • pyproject.toml — Added [project.scripts] entry: aasm = "agent_assembly.cli.main:main"

Validation checks performed

  1. Class inherits from FrameworkAdapter
  2. All 4 abstract methods are concretely implemented
  3. get_framework_name() returns non-empty string
  4. get_supported_versions() returns non-empty list of strings
  5. register_hooks() accepts a GovernanceInterceptor argument
  6. unregister_hooks() is idempotent (two calls without error)
  7. Entry point metadata in pyproject.toml (if present)

CLI usage

# Validate by module name
aasm adapter validate my_package.adapters.my_adapter

# Validate by file path
aasm adapter validate ./path/to/my_adapter.py

Exit code 0 on success, non-zero on failure (CI-friendly).

Testing

Describe the testing performed for this PR:

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing performed
  • No tests required (explain why)

38 new unit tests covering:

  • AdapterValidationResult dataclass
  • All 7 _check_* functions with pass/fail cases
  • validate_adapter orchestrator (including short-circuit on inheritance failure)
  • load_adapter_class from module name and file path
  • format_results output formatting
  • CLI main() exit codes (0 and 1)

Full test suite: 155 passed, 7 skipped (pre-existing optional skips).

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Comments added for complex logic
  • Documentation updated if needed
  • All tests passing

Chisanan232 and others added 30 commits May 1, 2026 18:03
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Fix string annotation comparison when from __future__ import annotations
is active.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Chisanan232 and others added 11 commits May 1, 2026 18:15
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 1, 2026

@codecov
Copy link
Copy Markdown

codecov Bot commented May 1, 2026

Codecov Report

❌ Patch coverage is 94.04762% with 10 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
agent_assembly/cli/adapter_validator.py 92.06% 10 Missing ⚠️

📢 Thoughts on this report? Let us know!

@Chisanan232 Chisanan232 merged commit 2428aee into master May 1, 2026
22 checks passed
@Chisanan232 Chisanan232 deleted the v0.0.0/AAASM-194/adapter_validate_cli branch May 1, 2026 10:40
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