-
Notifications
You must be signed in to change notification settings - Fork 11
refactor(audits): use W prefix for warning-level audit error codes #1733
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
kaligrafy
merged 1 commit into
chairemobilite:main
from
kaligrafy:useNewErrorCodePrefixesForWarningAndInfo
Jul 31, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -106,22 +106,29 @@ All contexts are defined in [`./AuditCheckContexts.ts`](./AuditCheckContexts.ts) | |
|
|
||
| ### 3.2 What kind of problem is it? | ||
|
|
||
| > **TODO:** The prefixes below mix audit *type* (missing, invalid, logical) with *severity* (info, warning). This is historical (`M`/`I`/`L` from 2023; `W` and `F` were added later). A cleaner split is tracked in [#1771](https://github.com/chairemobilite/evolution/issues/1771). | ||
|
|
||
| Follow the existing prefix convention (see the checks folder README): | ||
|
|
||
| - `_M_` — **Missing** required data (`HH_M_Size`). | ||
| - `_I_` — **Invalid** data (`HH_I_Size` — out of range, malformed, wrong type). | ||
| - `_L_` — **Logical** inconsistency between fields or objects (`HH_L_SizeMembersCountMismatch`). | ||
| - `_F_` — **Info** — informational flag, not an error or warning (`HH_F_AtLeastOneTransitSegmentInHousehold`). | ||
| - `_W_` — **Warning** — suspicious data that may be fine but needs reviewer attention (`HH_W_CarNumberPerPotentialDrivingLicenseTooHigh`, `HM_W_preGeographyAndHomeGeographyTooFarApart`). | ||
|
|
||
| Pick `_M_` only if the field should always be present. If "required" depends on survey configuration, use `fieldIsRequired(...)` (see §5.1) and still prefix with `_M_`. | ||
|
|
||
| The type prefix should match the audit `level`: use `_W_` with `level: 'warning'`, `_F_` with `level: 'info'`, and `_M_` / `_I_` / `_L_` with `level: 'error'`. | ||
|
|
||
| ### 3.3 Which severity? | ||
|
|
||
| > **TODO:** Same conflation as §3.2 — this table maps severity to prefixes, but `error` still spans three type letters (`M`, `I`, `L`) instead of one. See [#1771](https://github.com/chairemobilite/evolution/issues/1771). | ||
|
|
||
| | Level | Meaning | Reviewer behavior expected | | ||
| | --------- | -------------------------------------------------------------------------- | -------------------------------------- | | ||
| | `error` | The data is wrong or unusable and must be corrected or explicitly ignored. | Must look at it. | | ||
| | `warning` | Something suspicious that often turns out fine. | Should look at it when they have time. | | ||
| | `info` | Informational only, typically for stats or routing. | Can ignore. | | ||
| | Level | Prefix | Meaning | Reviewer behavior expected | | ||
| | --------- | ------ | -------------------------------------------------------------------------- | -------------------------------------- | | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe also put a similar comment here mentionning the same.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added |
||
| | `error` | `M`, `I`, or `L` | The data is wrong or unusable and must be corrected or explicitly ignored. | Must look at it. | | ||
| | `warning` | `W` | Something suspicious that often turns out fine. | Should look at it when they have time. | | ||
| | `info` | `F` | Informational only, typically for stats or routing. | Can ignore. | | ||
|
|
||
|
|
||
| When in doubt, start at `warning`. Escalating later is cheap; downgrading creates review backlog. | ||
|
|
@@ -293,7 +300,7 @@ Grep before adding to avoid duplicates. Checks live in `<Object>AuditChecks.ts` | |
| and `<Object>ExtendedAuditChecks.ts` under [`./checks/`](./checks/), one file per survey object type (see the table in §3.1). To list all current checks: | ||
|
|
||
| ```bash | ||
| grep -rEn "^[[:space:]]+[IHMPJVTS]{1,2}_[MIL]_[A-Za-z]+:" \ | ||
| grep -rEn "^[[:space:]]+[IHMPJVTS]{1,2}_[MILFW]_[A-Za-z]+:" \ | ||
| packages/evolution-backend/src/services/audits/auditChecks/checks | ||
| ``` | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we have a type specific for NEED_REVIEW? This feel different than a warning, where a warning is just a notice that can be investigate at some point but will not affect results??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, I will propose something more stable and better. Back in few minutes (hours?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #1771