Repository navigation
feat(store): a failure keeps its code, so history reads in either language - #58
Merged
Merged
Conversation
…guage A failed request's reason reached the app twice: live, as a `RequestFailed` event, and again from `/history` after a reload. The event carried a code from the start of this work; the row did not — the `error` column held only the sentence, so every failure in the traffic table turned back into English the moment the window was reopened. The row carries the code now. Two nullable columns beside the existing one (`error_code`, `error_args`), and `RequestRow.error` and `HistoryRow.error` are a `Msg` assembled from the three. A row written before this has no code, so it comes back with an empty one — which the app does not recognize, so it shows the text, the same fallback it uses for a code newer than itself. Nothing is migrated and nothing is lost. `Msg::plain` builds one of those codeless messages. It is the fallback, not the usual way: new messages come from `msg!`. Separately, `tw-scan`'s rule set is English. The `why` of every built-in rule is the sentence the Findings page prints under each finding, and six rules had Chinese ids — `忽略指令` is now `ignore-previous-zh`, `凭据外泄` is `exfil-credentials`, and so on. An override file that disables a built-in rule by its old Chinese id will report that the id is unknown. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Merged
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
A failed request's reason reached the app twice: live, as a
RequestFailedevent, and again from
/historyafter a reload. The event carried a code fromthe start of this work; the row did not — the
errorcolumn held only thesentence, so every failure in the traffic table turned back into English the
moment the window was reopened.
The row carries the code now. Two nullable columns beside the existing one
(
error_code,error_args), andRequestRow.error/HistoryRow.errorare aMsgassembled from the three.A row written before this has no code, so it comes back with an empty one —
which the app does not recognize, so it shows the text, the same fallback it
uses for a code newer than itself. Nothing is migrated and nothing is lost; the
migration test drops the two columns and checks the old rows survive.
Msg::plainbuilds one of those codeless messages. It is the fallback, not theusual way: new messages come from
msg!.Also here: the scan rule set
The
whyof every built-in rule is the sentence the Findings page prints undereach finding, and it was Chinese. Six rules also had Chinese ids:
忽略指令ignore-previous-zh新指令new-instructions-zh你现在是you-are-now-zh凭据外泄exfil-credentials凭据外泄2exfil-credentials-reversed写启动项write-startup-itemVerified
cargo fmt --all -- --check,cargo clippy --workspace --all-targets -- -D warnings,cargo test --workspace(78 suites, 0 failures) and./scripts/smoke.sh(51 passed, 0 failed). The smoke script reads a cutrequest back out of
/history, so it covers the new columns end to end.🤖 Generated with Claude Code