RepoPulse: update backend/app and dependencies (+3 areas)
Public changes compared with the previous published export: 26 files changed. Affected areas: - backend/app: 11 files - dependencies: 5 files - deployment and CI: 3 files - documentation: 2 files - tests: 5 files Changed files: - Updated: "Dockerfile.unraid" - Updated: "README.md" - Updated: "backend/Dockerfile" - Updated: "backend/app/acquisition.py" - Updated: "backend/app/architecture.py" - Updated: "backend/app/git_analysis.py" - Updated: "backend/app/gitea.py" - Updated: "backend/app/jobs.py" - Updated: "backend/app/main.py" - Added: "backend/app/processes.py" - Updated: "backend/app/rules.py" - Updated: "backend/app/scanner.py" - Updated: "backend/app/signals.py" - Updated: "backend/app/store.py" - Updated: "backend/pyproject.toml" - Added: "backend/tests/test_api_responsiveness.py" - Added: "backend/tests/test_processes.py" - Updated: "backend/tests/test_scanner.py" - Updated: "backend/tests/test_signals_v11.py" - Updated: "backend/tests/test_store.py" - Updated: "docker-compose.yml" - Updated: "docs/ARCHITECTURE.md" - Updated: "frontend/package-lock.json" - Updated: "frontend/package.json" - Updated: "package-lock.json" - Updated: "package.json" Export provenance/manifests refreshed; excluded from the change summary. Publish curated RepoPulse source from a251f826238908b156485299061da76482780ed2
This commit is contained in:
1 parent
23a4a721f1
commit
61ae49f9d0
28 files changed
+1083
-408
No files matched your search
+18
-6
@@ -1,3 +1,5 @@
|
||||
from functools import lru_cache
|
||||
|
||||
from .models import Finding, FindingGuidance, Severity
|
||||
|
||||
_RULES: dict[str, tuple[str, str, str, str]] = {
|
||||
@@ -63,12 +65,16 @@ def _default_rule(finding: Finding) -> tuple[str, str, str, str]:
|
||||
)
|
||||
|
||||
|
||||
def enrich_finding(finding: Finding) -> Finding:
|
||||
remediation_class, why, action, confidence = _RULES.get(finding.code, _default_rule(finding))
|
||||
severity_weight = {Severity.BLOCKER: 700, Severity.WARNING: 400, Severity.INFO: 100}[finding.severity]
|
||||
priority = min(1000, severity_weight + finding.deduction * 5)
|
||||
rationale = f"{finding.severity.value.title()} signal; {finding.deduction} health-point impact."
|
||||
guidance = FindingGuidance(
|
||||
@lru_cache(maxsize=4096)
|
||||
def _guidance(code: str, severity: Severity, deduction: int) -> FindingGuidance:
|
||||
"""Guidance depends only on code, severity and deduction; share one immutable instance."""
|
||||
|
||||
probe = Finding(code=code, category="", severity=severity, message="", deduction=deduction)
|
||||
remediation_class, why, action, confidence = _RULES.get(code, _default_rule(probe))
|
||||
severity_weight = {Severity.BLOCKER: 700, Severity.WARNING: 400, Severity.INFO: 100}[severity]
|
||||
priority = min(1000, severity_weight + deduction * 5)
|
||||
rationale = f"{severity.value.title()} signal; {deduction} health-point impact."
|
||||
return FindingGuidance(
|
||||
remediation_class=remediation_class,
|
||||
confidence=confidence,
|
||||
why=why,
|
||||
@@ -76,6 +82,12 @@ def enrich_finding(finding: Finding) -> Finding:
|
||||
priority=priority,
|
||||
priority_rationale=rationale,
|
||||
)
|
||||
|
||||
|
||||
def enrich_finding(finding: Finding) -> Finding:
|
||||
guidance = _guidance(finding.code, finding.severity, finding.deduction)
|
||||
if finding.guidance is guidance:
|
||||
return finding
|
||||
return finding.model_copy(update={"guidance": guidance})
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user