Skip to content

add taskflow to filter severity#47

Merged
m-y-mo merged 2 commits intomainfrom
filter_severity
Feb 10, 2026
Merged

add taskflow to filter severity#47
m-y-mo merged 2 commits intomainfrom
filter_severity

Conversation

@m-y-mo
Copy link
Copy Markdown
Contributor

@m-y-mo m-y-mo commented Feb 10, 2026

No description provided.

Copilot AI review requested due to automatic review settings February 10, 2026 15:36
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new audit taskflow to identify “low severity” vulnerabilities and introduces persistence + MCP tooling to record reasons for classifying an audit result as low severity.

Changes:

  • Add filter_severity.yaml taskflow to review vulnerable audit results against “low severity” criteria and store a reason when applicable.
  • Introduce LowSeverityAuditResult SQLAlchemy model/table to persist low-severity classification reasons.
  • Extend repo-context MCP server to include result_id in returned audit results and add a store_low_severity_reason MCP tool.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
src/seclab_taskflows/taskflows/audit/filter_severity.yaml New taskflow to triage vulnerable issues and (optionally) store low-severity reasons.
src/seclab_taskflows/mcp_servers/repo_context_models.py Adds LowSeverityAuditResult ORM model/table.
src/seclab_taskflows/mcp_servers/repo_context.py Creates the new table, exposes a new MCP tool to store reasons, and adds result_id to audit result payloads.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

with Session(self.engine) as session:
existing = session.query(LowSeverityAuditResult).filter_by(repo=repo, result_id=result_id).first()
if existing:
existing.reason_for_rejection += reason
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

store_low_severity_reason updates existing.reason_for_rejection, but LowSeverityAuditResult defines the column as reason. This will raise an AttributeError at runtime and prevent saving updates. Use the correct attribute (and consider adding a separator like a newline if appending multiple reasons).

Suggested change
existing.reason_for_rejection += reason
if existing.reason:
existing.reason = f"{existing.reason}\n{reason}"
else:
existing.reason = reason

Copilot uses AI. Check for mistakes.
Comment on lines 101 to 111
Base.metadata.create_all(
self.engine,
tables=[
Application.__table__,
EntryPoint.__table__,
UserAction.__table__,
WebEntryPoint.__table__,
ApplicationIssue.__table__,
AuditResult.__table__,
LowSeverityAuditResult.__table__,
],
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clear_repo() currently deletes rows from AuditResult but not from the new low_severity_audit_result table. Because this is SQLite and bulk deletes are used, relying on ON DELETE CASCADE may not actually remove low-severity rows, so repo cleanup can leave orphan/old data behind. Consider explicitly deleting LowSeverityAuditResult rows for the repo (or enabling/enforcing FK cascades consistently).

Copilot uses AI. Check for mistakes.
"repo": app.repo,
"issue_type": issue.issue_type,
"issue_id": issue.issue_id,
"result_id" : issue.id,
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There’s a formatting inconsistency in the returned dict key ("result_id" : issue.id has an extra space before the colon). This is minor, but keeping key formatting consistent improves readability and reduces noisy diffs later.

Suggested change
"result_id" : issue.id,
"result_id": issue.id,

Copilot uses AI. Check for mistakes.
store a low severity reason for the result with the id {{ result.result_id }}. Otherwise,
you can finish the task.

DO NOT change or store anything for the current audit result.
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The task prompt instructs the agent to store a low-severity reason (and even names the result id), but later says "DO NOT change or store anything for the current audit result." This is contradictory and may prevent the intended store_low_severity_reason call. Clarify that the agent should not modify the AuditResult itself, but should store a low-severity reason record when applicable.

Suggested change
DO NOT change or store anything for the current audit result.
Do not modify the existing AuditResult record itself (for example, do not change its severity, status, or notes); only store a separate low-severity reason record for the current audit result when applicable.

Copilot uses AI. Check for mistakes.
@m-y-mo m-y-mo merged commit 91d8971 into main Feb 10, 2026
9 checks passed
@m-y-mo m-y-mo deleted the filter_severity branch February 10, 2026 17:57
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.

3 participants