fix(settings): a setting saved from its record screen is stored, and is held to its rules as it will be stored #120

Merged
james.maes merged 2 commits from fix/budget-edit-over-http into develop 2026-11-21 03:44:04 +00:00
2 Commits
Author SHA1 Message Date
james.maesandClaude Fable 5.2 d7f382af39 test(settings): no customizer pairs a record with its stored row itself; StoredRecords for integer, long and text keys
maven / build (push) Successful in 11m8s
build / maven (push) Successful in 11m8s
ArchitectureTest refuses a call of oldRecordListToMap anywhere in the
assistant: the map is keyed by the stored key, and the key of a record saved
from a screen is text. StoredRecordsTest pairs a record with its stored row
for an integer, a long and a text key, with the key as text and as a number,
and covers the merged record, refusals and comparisons.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-20 19:29:37 -06:00
james.maesandClaude Fable 5.2 70ada072f4 fix(settings): a setting saved from its record screen is stored, and is held to its rules as it will be stored
maven / build (push) Successful in 10m14s
build / maven (push) Successful in 10m14s
A record screen saves through the UI API's table update route: only the
fields that were changed, with the version that was read. The record's key
comes from the request's path, so it reaches a table customizer as text.

AssistantBudgetCustomizer paired the record with its stored row by comparing
that text with the stored integer key, did not find the row, and judged the
one changed field as if it were a whole new budget: 400, nothing stored. The
same pairing was in every settings customizer: budget overrides, data access
rows, providers, knowledge sources and scheduled tasks were refused the same
way; a profile and a skill were stored with the defaults of a new row written
over what the save had not sent.

StoredRecords now does the pairing for all of them: the key of the record
and of each stored row are read as the type of the table's key field before
they are compared, the values being saved are laid over the stored row each
as the type of its field, and a change is found by comparing values of the
same type. A value that cannot be read as the type of its field is refused.

The rules (the host's ceiling on a cost limit, required fields, allowed
periods and scopes, an override's rules) are judged on the record as it will
be stored, for a save of one field exactly as for a save of all of them.

Tests go through the real route against the fixture application; fourteen of
the sixteen fail without the fix.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-20 19:01:19 -06:00