Skip to content

Add adaptive weighted fitness scoring#48

Merged
Pan14ek merged 2 commits into
mainfrom
experiment/adaptive-weighted-fitness
Jun 5, 2026
Merged

Add adaptive weighted fitness scoring#48
Pan14ek merged 2 commits into
mainfrom
experiment/adaptive-weighted-fitness

Conversation

@Pan14ek
Copy link
Copy Markdown
Owner

@Pan14ek Pan14ek commented Jun 5, 2026

Purpose

Implement experiment/adaptive-weighted-fitness by adding a versioned adaptive scalar fitness score that combines structural and runtime evidence without changing existing fitnessScore or runtimeFitnessScore semantics.

Type

  • 🧪 Experiment (fitness function research)
  • ✨ Feature (new business logic)
  • 🐛 Bug fix
  • ♻️ Refactor / neutral change
  • 📝 Documentation only

Changes

  • Adds adaptiveFitnessScore, adaptiveFitnessScoreVersion, and adaptiveFitness as additive collector output fields.
  • Adds ADAPTIVE_FITNESS_CONTEXT=auto|balanced|workload|slo|resource-pressure.
  • Implements context-sensitive weighting over structural quality and runtime signals.
  • Uses SLO/resource pressure classifications to penalize measured pressure even when baseline-relative deltas would hide it.
  • Documents the adaptive scoring contract and marks experiment/adaptive-weighted-fitness as implemented.

Files changed

File Change
fitness-metrics-collector/scripts/adaptiveScoring.ts Adds adaptive weighted scoring, context selection, active weight metadata, and pressure-floor handling.
fitness-metrics-collector/scripts/collectMetrics.ts Emits adaptive fitness fields alongside existing structural/runtime scores.
fitness-metrics-collector/scripts/collectMetrics.test.ts Covers context profiles, auto selection, missing-signal renormalization, pressure penalties, and output writing.
backend/lined/docs/adaptive-weighted-fitness.md Documents inputs, output contract, context selection, signals, and compatibility rules.
backend/lined/docs/README.md Adds adaptive weighted fitness to the backend docs index.
backend/lined/docs/experiment-tasks.md Marks experiment/adaptive-weighted-fitness as implemented.

Expected result

Metric Baseline (main) Branch Direction
checkstyle_violations unknown unknown neutral
spotbugs_total unknown unknown neutral
line_coverage unknown unknown neutral
critical_violations unknown unknown neutral
code_smells unknown unknown neutral
duplicated_lines_density unknown unknown neutral
F score unknown unknown neutral
SonarQube QG unknown unknown neutral

Expected experiment impact: structural CI fitness remains unchanged in meaning. Runtime-aware scoring remains available as the fixed runtime scalar baseline, while adaptive scoring adds a context-sensitive scalar baseline for workload, SLO, and resource-pressure comparisons.

Checklist

  • ./gradlew check passes locally
  • ./gradlew jacocoTestReport passes locally
  • No unintended changes to main business logic
  • Branch name matches experiment/feature naming convention

Additional verification:

  • npm test passes in fitness-metrics-collector (31/31)
  • npm run build passes in fitness-metrics-collector
  • git diff --check passes
  • Critic review completed with no blocking findings

@Pan14ek Pan14ek merged commit 785512b into main Jun 5, 2026
1 check failed
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jun 5, 2026

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.

1 participant