Skip to content

test: add integrity CLI round-trip and tamper detection tests#1756

Merged
imran-siddique merged 2 commits intomainfrom
test/integrity-cli-roundtrip
May 6, 2026
Merged

test: add integrity CLI round-trip and tamper detection tests#1756
imran-siddique merged 2 commits intomainfrom
test/integrity-cli-roundtrip

Conversation

@imran-siddique
Copy link
Copy Markdown
Member

Adds 9 tests for the agent-governance integrity CLI subcommand covering generate/verify round-trip and tamper detection.

Tests:

  • Generate creates valid JSON manifest with files and functions
  • Generate-then-verify round-trip passes cleanly
  • Tampered hash fails verification (exit code 1)
  • Removed module detected via regeneration comparison
  • JSON output (--json) structure validated on success and failure
  • No-args live verification passes

Guards against regressions in the CLI used by Agency Playground plugin signing.

imran-siddique and others added 2 commits May 4, 2026 21:21
…ctions.md

Add high-level architecture overview (package map, SDK paths) and
build/test/lint commands for all languages (Python, TypeScript, Rust,
.NET, MCP server, docs) including single-test invocations.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
9 tests covering:
- Generate creates valid JSON manifest
- Generate then verify round-trip passes
- Generate output format (file/function counts)
- Generate overwrites existing manifests
- Tampered hash fails verification
- Removed module detected in regeneration
- JSON output structure on success and failure
- No-args live verification

Guards against regressions in the agent-governance integrity CLI
used by Agency Playground plugin signing pipeline.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@imran-siddique imran-siddique merged commit 791b4c7 into main May 6, 2026
31 checks passed
@imran-siddique imran-siddique deleted the test/integrity-cli-roundtrip branch May 6, 2026 00:42
@github-actions github-actions Bot added documentation Improvements or additions to documentation tests scripts/ci/cd labels May 6, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

🤖 AI Agent: security-scanner — View details

No security issues found.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

🤖 AI Agent: code-reviewer — View details

TL;DR: 0 blockers, 1 warning. Tests are well-structured and comprehensive, but a minor improvement is suggested for future consideration.

# Sev Issue Where
1 Warn No test for edge cases in --json output test_integrity_cli_roundtrip.py

Action items: None.

Warnings (fine as follow-up PRs):

# Issue Where
1 Add tests for edge cases in --json output, such as malformed JSON or unexpected keys. test_integrity_cli_roundtrip.py

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

🤖 AI Agent: test-generator — `agent-governance-python/agent-compliance/tests/test_integrity_cli_roundtrip.py`

agent-governance-python/agent-compliance/tests/test_integrity_cli_roundtrip.py

  • test_generate_output_mentions_file_count -- Missing test for edge case where no files or functions are hashed.
  • test_generate_overwrites_existing_manifest -- No test for handling read-only files during overwrite.
  • test_tampered_file_hash_fails_verification -- Lacks test for tampering with non-existent files.
  • test_verify_json_output_on_tampered_manifest -- Missing test for malformed JSON output when manifest is corrupted.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

🤖 AI Agent: docs-sync-checker — Docs Sync

Docs Sync

  • Documentation is in sync.

@github-actions github-actions Bot added the size/L Large PR (< 500 lines) label May 6, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

🤖 AI Agent: breaking-change-detector — API Compatibility

API Compatibility

No breaking changes detected.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

PR Review Summary

Check Status Details
🔍 Code Review ⚠️ Warning See details
🛡️ Security Scan ✅ Passed No issues found
🔄 Breaking Changes ✅ Passed No issues found
📝 Docs Sync ✅ Passed No issues found
🧪 Test Coverage ✅ Completed Analysis complete

Verdict: ⚠️ Ready for human review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation scripts/ci/cd size/L Large PR (< 500 lines) tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant