Repository navigation
DS-3987 add new experimental tasks - #23620
Conversation
|
✅ No conflicts with other open PRs targeting |
…-statistical-calcs
….com:smartcontractkit/chainlink into feature/new-pipeline-tasks-statistical-calcs
There was a problem hiding this comment.
🟡 Changes recommended
Numeric precision, input validation, negative-weight handling, and nondeterministic tests can currently produce incorrect results or flaky CI.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Risk Rating: HIGH
Adds experimental sampling, unit normalization, staleness decay, and weighted-mean pipeline tasks.
Changes:
- Introduces
Sampleand normalization workflows. - Adds configurable staleness decay and weighted aggregation.
- Registers task types and improves bridge database mappings.
Scrupulous human review: Numeric validation, precision preservation, decay boundaries, and weighted aggregation require close review.
File summaries
| File | Description |
|---|---|
core/services/pipeline/task.sample.go |
Implements sample extraction and parsing. |
core/services/pipeline/task.sample_test.go |
Tests sample creation. |
core/services/pipeline/task.normalize.go |
Implements unit normalization. |
core/services/pipeline/task.normalize_test.go |
Tests normalization behavior. |
core/services/pipeline/task.staleness.go |
Implements staleness decay. |
core/services/pipeline/task.staleness_test.go |
Tests decay methods and boundaries. |
core/services/pipeline/task.weighted_mean.go |
Implements weighted and winsorized means. |
core/services/pipeline/task.weighted_mean_test.go |
Tests weighted aggregation. |
core/services/pipeline/task_params.go |
Adds sample support to slice parameters. |
core/services/pipeline/common.go |
Registers the new task types. |
core/bridges/bridge_type.go |
Adds explicit database column mappings. |
Review details
Suppressed comments (2)
core/services/pipeline/task.sample.go:318
- Any
tsUnitother thansis silently interpreted as milliseconds, so a typo such assecondsproduces a timestamp off by 1000 without an error. Validate the supported enum explicitly.
if strings.EqualFold(string(tsUnit), "s") {
tsMs *= 1000
}
core/services/pipeline/task.weighted_mean.go:136
- An explicit reference also accepts negative weights. With
winsorRef=weighted_median, cumulative mass is then non-monotonic and the selected reference value is invalid. Apply the same non-negative-weight validation used for aggregation samples.
for _, s := range refSamples {
if !s.Weight.IsZero() {
ref = append(ref, s)
}
}
- Files reviewed: 12/12 changed files
- Comments generated: 9
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|




Adding in new statistical tasks - tagged as experimental as: