Skip to content

Refactor validation2 xiii - #329

Merged
mschwoer merged 39 commits into
refactor_validation2_XIIfrom
refactor_validation2_XIII
Nov 19, 2026
Merged

mschwoer merged 39 commits into
refactor_validation2_XIIfrom
refactor_validation2_XIII

Conversation

@mschwoer

Copy link
Copy Markdown
Contributor

Next round of review comments

mschwoer and others added 30 commits November 19, 2026 09:13
It only returned `id`, so the same value had two names.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It raised a bare StopIteration, while the webapp pages render.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
UserUpdate required the messenger id so that leaving it out could not clear
it; `users.update` requires the argument itself since it has explicit
parameters. With a default there, NewUser no longer overrides the field.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The domain RawFile has `id` as its first field, so it comes first anyway.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Assignments always hold lists; the mapper builds them with `list(...)`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`scopes` keeps its explicit None check: an empty list must be rejected, not
become all instruments.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The settings are passed between the processor tasks by unique name instead of
database id, so a run started before the deploy fails afterwards.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An archived or deleted project cannot be changed, so its assignments could
never be removed, and settings assigned to it could never be deleted. Those
assignments never apply again, as archiving and deleting are final.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mongoengine does not store a name starting with `_`, and a name like
`validate` replaced the method, so saving failed with a TypeError. Reject
both, checking the model class instead of a fixed list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The package docstring read as if every write function validated its input.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A value MongoDB cannot store, e.g. a numpy scalar or a Decimal, raised bson's
InvalidDocument, which is not a PyMongoError and escaped untranslated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…uide

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An invisible character such as a zero-width space, or a lookalike letter,
passed the email rule, so a second user with the same-looking email could be
added. The Mongo model uses the same rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- drop the alias of gradient_length that mapped the name to itself
- update the stale comment on dropping empty columns, which only raw files use
- convert missing numeric prefills once, instead of a second NaN loop

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Moved unchanged from test_raw_files.py.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
All other rules sit in the domain types and the shared.db facade. The
backend checked the values against the model instead; `RawFileUpdate` states
the same limits, and the limit test compares them with the model.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`*_errors` returns a list, `_check_*` raises: `users.check_active` becomes
`users.owner_errors`, `settings._check_active` becomes `_check_status_change`,
and the settings check of `assign` becomes `_settings_errors`. A record that a
write refers to but is not active gets one message for users, projects and
settings, via `inactive_errors`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nment

`update_to_latest` raised on a missing newer version before checking the
project, so a caller not allowed to change the fallback project was told
there is no newer version. Like `assign`, it now reports all rule errors
together, the project errors first; `assign` lists them first as well.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Since raw file updates are checked, status details over 1024 characters were
rejected and the intended status was not written. Only the failure callback
and the processor truncated; the handler did not. `RawFileUpdate` now
truncates them for every writer, and the two truncations in the pipeline go.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A creating call raised NotFoundError for a reference that does not exist, so
it dropped the other rule errors and meant something else than on reads; every
client had to translate it. It is now one more entry of the InvalidInputError,
and NotFoundError only means that the addressed record does not exist.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Leaving them out meant all instruments, the misspelled-key risk the caller
note in shared/db warned about. Now a caller must state them, `['*']` for all.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The file remover writes all its errors into the details exactly when there
are too many; over 1024 characters the save failed and the ERROR status was
never written. `shared.db.status.update` truncates them now, with the same
helper as the raw file updates.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- `project_owner`: an owner reference to a user that no longer exists
- `settings.create(archive_previous=True)`: archiving fails after the insert
- `translate_errors`: mongoengine's coding-error signals become DatabaseError

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The record, with its possibly large file info, was loaded only to log its old status.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The migration left such keys alone, and since the webapp no longer merges the
duplicate columns, those documents kept an extra column. Keys with another
value are still left alone and reported. Add the first tests of the migration.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mschwoer and others added 9 commits November 19, 2026 13:15
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`_to_raw_file_dict` and `_to_dict` differed only in the excluded keys; the
metrics and the backup path are added in one pass over the raw files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The error list is the same, as the project errors are collected before; the
else branch and the type ignore on the version go away.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The guard against an empty id list was redundant, as `id__in=[]` matches
nothing, and the backend sort was repeated by the facade, whose project query
returns the newest first anyway.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…uest

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Status records truncated too long details in the facade function, raw files in
their input type. `KrakenStatusUpdate` truncates them the same way and checks
the other field limits; the limit tests compare it with the model.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
NaN is not equal to itself, so a duplicate key with a NaN value was kept and
reported as a conflict. Also find the key holding the current name in one
expression.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both were 1024 and fed the same truncation; nothing meant them to diverge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mschwoer
mschwoer merged commit ab71d62 into refactor_validation2_XII Nov 19, 2026
3 of 4 checks passed
@mschwoer
mschwoer deleted the refactor_validation2_XIII branch November 19, 2026 14:38
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