feat(sec-core): add session report command#703
Open
jfeng18 wants to merge 8 commits into
Open
Conversation
RemindD
reviewed
Jun 4, 2026
RemindD
left a comment
Collaborator
There was a problem hiding this comment.
- 目前agent-sec-cli observability更多还是为安全能力的展示。将tokenless数据集成容易有歧义。退一步说,与tokenless的集成也应该使用API接口,避免直接访问后端sqldb
- format 问题需要使用make python-code-pretty
Contributor
Author
|
Agree on both points. Updated:
Thanks for the review. |
9c95888 to
3f0fdea
Compare
Contributor
Author
|
Updated per review feedback:
Changes pushed in |
f4559d8 to
8850e4c
Compare
Contributor
Author
|
Review feedback addressed. Ready for re-review. |
371c388 to
1d37d28
Compare
Contributor
Author
|
Hi @RemindD, gentle ping — I've addressed your earlier feedback. Ready for re-review when convenient. |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds 6 tests covering the `observability report` CLI command: - --session-id and --last flag validation - invalid --format rejection - session not found error - text and JSON output formats - --last with no recorded sessions These cover the cli.py:report() function (lines 137-199) that was missing from incremental coverage, causing CI gate failure. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1d37d28 to
cd69153
Compare
7 tests covering: JSON/text output, session-id lookup, unknown session, missing args, invalid format, and empty database. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
Author
|
Added E2E tests (
All 7 tests pass on ECS (Python 3.11, agent-sec-cli 0.5.0). Follows existing |
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
agent-sec-cli observability reportcommand: per-session debrief aggregating observability and security event data from existing DBs into one view.--last(most recent session),--session-id, and--format json.Example output
Changes
observability/session_report.py— SessionReport dataclass + build_session_report() aggregator + format_text() rendererobservability/cli.py— addedreportsubcommand with --last/--session-id/--formattests/unit-test/observability/test_session_report.py— 9 tests covering empty session, basic aggregation, security verdicts, format rendering, JSON roundtrip, and hint coveragetests/unit-test/observability/test_cli.py— 8 integration tests for the report CLI subcommand (arg validation, text/JSON output, --last flag, security reader wiring)Data sources (read-only, no writes)
Test plan
🤖 Generated with Claude Code