Add event taxonomy normalizer with canonical schema and adapters #1

Open
svxf wants to merge 3 commits from event-taxonomy/normalize-schema into main
Owner

Summary

  • Canonical NormalizedFinding schema with Severity enum (CRITICAL/HIGH/MEDIUM/LOW/INFO)
  • Per-project adapters for all 9 analysis tools with severity mapping
  • CLI pipe interface (stdin JSON → normalized JSON) and adapter registry

Canonical Schema

Field Type Description
tool str Tool name
category str Finding category
severity Severity CRITICAL/HIGH/MEDIUM/LOW/INFO
message str Human-readable description
file str? Source file path
line int? Line number
recommendation str? Suggested fix
metadata dict Tool-specific extras

Severity Mapping Table

Tool Native Format Mapping
bus-factor-analyzer String CRITICAL/HIGH/MEDIUM/LOW Direct
dep-risk-scanner String + float 0-10 (computed) Label-based
doc-drift-detector error/warning/info error→HIGH, warning→MEDIUM, info→INFO
knowledge-silo-detector RiskLevel Enum Enum value string
perf-regression-spotter Integer 1-10 8+→CRITICAL, 6+→HIGH, 4+→MEDIUM, 2+→LOW
roadmap-entropy critical/high/moderate/low Direct (moderate→MEDIUM)
schema-evolution-advisor safe/cautious/dangerous dangerous→CRITICAL, cautious→MEDIUM, safe→LOW
semantic-diff No severity (categories) Churn-based heuristic
test-flakiness-analyzer Float 0-1 (flakiness_rate) 0.5+→CRITICAL, 0.3+→HIGH, 0.15+→MEDIUM

Usage

echo '[{"file": "core.py", "top_author": "alice", "top_author_pct": 85, "num_contributors": 2, "bus_factor": 1, "risk_label": "CRITICAL"}]' | python -m event_taxonomy --tool bus-factor-analyzer
from event_taxonomy.registry import normalize_output
event = normalize_output("bus-factor-analyzer", raw_findings)
print(event.to_json(indent=2))

Test Plan

  • 21 tests passing (schema, adapters, severity mapping)
  • Integration test with real tool output
## Summary - Canonical `NormalizedFinding` schema with `Severity` enum (CRITICAL/HIGH/MEDIUM/LOW/INFO) - Per-project adapters for all 9 analysis tools with severity mapping - CLI pipe interface (`stdin JSON → normalized JSON`) and adapter registry ## Canonical Schema | Field | Type | Description | |-------|------|-------------| | tool | str | Tool name | | category | str | Finding category | | severity | Severity | CRITICAL/HIGH/MEDIUM/LOW/INFO | | message | str | Human-readable description | | file | str? | Source file path | | line | int? | Line number | | recommendation | str? | Suggested fix | | metadata | dict | Tool-specific extras | ## Severity Mapping Table | Tool | Native Format | Mapping | |------|---------------|--------| | bus-factor-analyzer | String CRITICAL/HIGH/MEDIUM/LOW | Direct | | dep-risk-scanner | String + float 0-10 (computed) | Label-based | | doc-drift-detector | error/warning/info | error→HIGH, warning→MEDIUM, info→INFO | | knowledge-silo-detector | RiskLevel Enum | Enum value string | | perf-regression-spotter | Integer 1-10 | 8+→CRITICAL, 6+→HIGH, 4+→MEDIUM, 2+→LOW | | roadmap-entropy | critical/high/moderate/low | Direct (moderate→MEDIUM) | | schema-evolution-advisor | safe/cautious/dangerous | dangerous→CRITICAL, cautious→MEDIUM, safe→LOW | | semantic-diff | No severity (categories) | Churn-based heuristic | | test-flakiness-analyzer | Float 0-1 (flakiness_rate) | 0.5+→CRITICAL, 0.3+→HIGH, 0.15+→MEDIUM | ## Usage ```bash echo '[{"file": "core.py", "top_author": "alice", "top_author_pct": 85, "num_contributors": 2, "bus_factor": 1, "risk_label": "CRITICAL"}]' | python -m event_taxonomy --tool bus-factor-analyzer ``` ```python from event_taxonomy.registry import normalize_output event = normalize_output("bus-factor-analyzer", raw_findings) print(event.to_json(indent=2)) ``` ## Test Plan - [x] 21 tests passing (schema, adapters, severity mapping) - [ ] Integration test with real tool output
svxf added 3 commits 2026-03-09 21:11:18 +00:00
Canonical NormalizedFinding schema with Severity enum (CRITICAL/HIGH/MEDIUM/LOW/INFO).
Per-project adapters for 9 tools with severity mapping for string labels, int 1-10,
float 0-1, Python Enum, and computed properties. CLI pipe interface and registry.

Nightshift-Task: event-taxonomy
Nightshift-Ref: https://github.com/marcus/nightshift
Nightshift-Task: event-taxonomy
Nightshift-Ref: https://github.com/marcus/nightshift
Nightshift-Task: event-taxonomy
Nightshift-Ref: https://github.com/marcus/nightshift
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin event-taxonomy/normalize-schema:event-taxonomy/normalize-schema
git checkout event-taxonomy/normalize-schema
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: svxf/event-taxonomy#1