Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
d3579fc
Add initial settings sections (wip)
j-or Sep 25, 2025
df9b94a
Merge branch 'main' into add-quality-function
j-or Sep 25, 2025
63b361e
Add function variables (very wip)
j-or Sep 30, 2025
6e1fd7c
Add function variables table and inputs
j-or Oct 17, 2025
717603c
Merge origin/main into add-quality-function
Jul 14, 2026
7d9e459
feat(core): add score-function schema + v21 migration
Jul 22, 2026
c79be36
feat(core): add computeScore/deriveSymbol/usedSymbols score utils
Jul 22, 2026
5d7a451
feat(core): reducer actions to set score function and data-point resp…
Jul 22, 2026
2062835
feat(core): validate required responses when a score function is used
Jul 22, 2026
2bbdba3
fix(core): mark data points with missing responses invalid
Jul 22, 2026
e86e906
feat(ui): add react-simple-code-editor score-function field with symb…
Jul 22, 2026
1fd6860
feat(ui): add score-function playground with live evaluation
Jul 22, 2026
53d411c
feat(ui): rewrite score-function settings dialog wired to experiment …
Jul 23, 2026
bfdadcb
feat(ui): surface per-objective score-function state on table rows
Jul 23, 2026
8229401
feat(ui): f(x) toggle, manual-value person icon, and RESPONSE inputs …
Jul 23, 2026
b8d5414
fix(ui): address final review — drop debug styles/dead prop, default …
Jul 23, 2026
016b2fb
fix(ui): externalize react-simple-code-editor in the library build
Jul 23, 2026
15c3253
fix(ui): unwrap react-simple-code-editor CJS default-export interop
Jul 23, 2026
6b4389b
fix(ui): don't drop score-function variables when inserting into the …
Jul 23, 2026
4e3b9ac
fix(ui): score-function UX — save deadlock, phantom playground fields…
Jul 23, 2026
5e69293
fix(ui): use human-facing score label in the RESPONSE section
Jul 23, 2026
34a5dff
fix(ui): keep field focus when clicking factor/response buttons
Jul 23, 2026
77c51cf
feat(ui): add 'Score function' section title matching the Playground …
Jul 23, 2026
d819594
fix(ui): hide response-less objectives in the data-point RESPONSE sec…
Jul 23, 2026
fb42fda
feat(ui): collapse the score-function playground behind a 'Test your …
Jul 23, 2026
b9bfe3f
feat(ui): drop redundant Playground header and info box
Jul 23, 2026
3c45b63
feat(ui): add score-function help dialog on the help icon
Jul 23, 2026
27055cf
fix(core): compute & persist score for new function-mode data points
Jul 24, 2026
612e9b5
feat(ui): new data points default to using the score function
Jul 24, 2026
642b3ae
feat(ui): score-function settings dialog refinements
Jul 24, 2026
2462d14
feat(ui): data-point response editor improvements
Jul 24, 2026
add1f89
refactor(ui): replace react-simple-code-editor with an in-house highl…
Jul 24, 2026
c1daa25
docs(adr): 0003 score functions — additive data model persisting into…
Jul 24, 2026
b2d166d
chore(ui): address final review — route quality-scale check via score…
Jul 24, 2026
c1618a5
test(core): strengthen manual-mode reducer assertion
Jul 24, 2026
dc8b128
feat(ui): rename data-points Settings to Score functions with a star …
Jul 28, 2026
9e21f45
docs(plan): bulk enable/disable score function for existing data points
Jul 28, 2026
e6967ee
feat(core): add setDataPointsUseFunction bulk action for score functions
Jul 28, 2026
78afe16
feat(core): export countDataPointsMissingResponses for bulk score-fun…
Jul 28, 2026
3c57fa9
feat(ui): bulk enable/disable score function for existing data points…
Jul 28, 2026
f167f1b
feat(ui): full-width 'For existing data points' section with primary-…
Jul 28, 2026
a524972
style(ui): shrink score-function playground empty-state text to 0.875rem
Jul 28, 2026
1d40dcc
style(ui): tune score-functions panel spacing (tab padding-top + row …
Jul 28, 2026
ccfbb6b
docs(plan): score-function factor sync & compute robustness
Jul 28, 2026
3eec3fb
fix(core): computeScore only requires symbols the expression uses
Jul 28, 2026
a4eb7df
fix(core): keep score-function variables in sync on factor rename/delete
Jul 28, 2026
4ba5606
feat(core): flag data points whose score function can't be computed
Jul 29, 2026
05f6749
feat: warn about undefined symbols in a score function expression
Jul 29, 2026
f2365aa
feat: warn when a score function uses a disabled/removed factor
Jul 29, 2026
3755073
docs(plan): score-function UX fixes (disable button, hide section, tr…
Jul 29, 2026
6bafdad
feat(ui): disable score-functions button when empty; hide bulk sectio…
Jul 29, 2026
95b0adb
fix(ui): wrap disabled score-functions button in span for Tooltip
Jul 29, 2026
71d688f
feat(core): copied suggestions default to using the score function
Jul 29, 2026
329a7a4
feat(ui): Pareto "add selected point" defaults to using the score fun…
Jul 29, 2026
4340fab
fix: only default enabled objectives' functions on point transfer
Jul 29, 2026
867aab0
chore: remove branch-lived superpowers artifacts
Jul 29, 2026
0ce6e41
style(ui): 8px gap under score-functions panel + white toggle text
Jul 30, 2026
30e432e
Add changeset
Jul 31, 2026
2b43ae4
feat(ui): always show f(x) toggle on objective inputs
Sep 28, 2026
da198d6
style(ui): full-width score functions panel and layout polish
Sep 30, 2026
6cd0d55
style(ui): align test box with info box (playgroundContainer margin-top)
Sep 30, 2026
9400a21
style(ui): 8px tab-container top padding; align function field when n…
Sep 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/quiet-pandas-cheer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@boostv/process-optimizer-frontend-core': minor
'@boostv/process-optimizer-frontend-ui': minor
---

Add score functions: compute an objective's score from a per-objective formula.
64 changes: 64 additions & 0 deletions docs/adr/0003-score-functions-additive-data-model.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# 0003. Score functions: additive data model that persists into the existing score entry

- **Status:** accepted
- **Date:** 2026-07-24
- **Deciders:** Jack Ord

## Context

Users need to define a per-objective **score function** — a mathjs expression
over named "responses" (measured values entered per data point) and existing
factors — that computes each data point's quality/cost score, instead of typing
the score by hand.

The score value is load-bearing downstream: the optimizer request builder, the
Pareto selection, the plots, and the CSV export all read it from the existing
`{ type: 'score', name, value }` entry in a data point's `data` array. Anything
that changed that contract would ripple into the Python optimizer API and every
consumer of experiment data.

## Decision

Model score functions as **purely additive** to the experiment data model in
`@boostv/process-optimizer-frontend-core`, behind a `v21` data-format migration:

- `scoreVariable.scoreFunction` — the expression plus its variable definitions
(each `{ name, symbol, source: 'response' | 'factor', factorName? }`).
- `dataEntry.responses` — per-data-point response values plus a `useFunction`
toggle (function-computed vs. manually typed).

The computed value (or the typed value, in manual mode) **continues to live in
the existing `{ type: 'score', name, value }` entry**. The reducer computes it
(`computeScore`) and writes it there; a new function-mode point that has no
score entry yet gets one created, inserted in canonical order so multi-objective
score columns stay positionally aligned. Nothing downstream is modified — the
optimizer request, Pareto, plots, and CSV all keep reading the same entry.

Key commits: `7d9e459` (schema + v21 migration), `5d7a451` (reducer actions),
`27055cf` (compute/persist for new points, preserving score order).

## Consequences

- **Easier:** zero changes to the optimizer/backend or any downstream consumer;
pre-`v21` experiments migrate transparently because the new fields are
optional and additive.
- **Harder / accepted costs:** the score is now sometimes _derived_ state — the
reducer must recompute and persist it when the function or a row's responses
change, and a validation flags rows whose responses are missing (excluded from
the optimizer via `meta.valid`). The UI must track function-vs-manual mode per
row. Expression evaluation runs client-side via mathjs.
- New data points default to using a defined function; pre-existing points stay
manual until switched, so existing hand-entered scores are never silently
overwritten.

## Alternatives considered

- **A separate "computed score" field, distinct from the existing score entry.**
Rejected: every downstream consumer (optimizer request, Pareto, plots, CSV)
would have to learn about it, defeating the goal of leaving them untouched.
- **Compute scores in the backend / optimizer API.** Rejected: couples the
statistical engine to a UI-authoring concern, adds round-trips, and pushes
expression parsing into Python.
- **Store responses inside the `{ type: 'score' }` entry.** Rejected: overloads
the shape downstream code reads; a separate additive `responses` field keeps
the score entry's contract intact.
9 changes: 5 additions & 4 deletions docs/adr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ record no ADR — that's expected. One ADR per branch is a smell.

## Index

| ADR | Title | Status |
| ------------------------------------------------ | ---------------------------------------------------------------- | -------- |
| [0001](0001-pareto-uncertainty-visualization.md) | Pareto front uncertainty: band view + opt-in hover ellipse | accepted |
| [0002](0002-adrs-and-ephemeral-agent-docs.md) | Record decisions in ADRs; treat agent plans/specs as branch-only | accepted |
| ADR | Title | Status |
| --------------------------------------------------- | ----------------------------------------------------------------------------- | -------- |
| [0001](0001-pareto-uncertainty-visualization.md) | Pareto front uncertainty: band view + opt-in hover ellipse | accepted |
| [0002](0002-adrs-and-ephemeral-agent-docs.md) | Record decisions in ADRs; treat agent plans/specs as branch-only | accepted |
| [0003](0003-score-functions-additive-data-model.md) | Score functions: additive data model persisting into the existing score entry | accepted |
102 changes: 92 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading