Commit Graph
6 Commits
Author SHA1 Message Date
yetone 7cb437ee16 masking: its alert sits with its other settings, and its Built-in row says when nothing is masked
The Masking alert was the one masking setting on the Masking page, under
the request list, away from every other one in Settings › Privacy (and
in Settings › Usage before that, where nb5p looked for it). It is now
the first row of Privacy's "when a value is found" list, out in gateway
mode as before. The Masking page is the list of masked requests alone.

Masking turned on with no kind, no personal data and no word of the
user's masks nothing, and its Plugins › Built-in row said only where
its settings are. It now says "Nothing is masked yet" before the link
(the scattered settings audit after netube99 on X).

Run in the tree with this change and the rest of the audit's fixes
(mote, base cd0ba05c2): mask-alert, builtin-places, settings-search:
162 pass, 0 fail, Chromium and WebKit, every language, 1100 and 420
wide; i18n-keys pass. The builtin-places file committed here is the
one run minus the routing-groups case, which comes with its change.
2026-11-09 21:51:53 +08:00
yetone 847f0c4703 gui: Masking alert lives on the Masking page
nb5p on Discord (#feedback): "这个脱敏提醒被放到额度设置里了,害得我找半天没找到".
The Masking alert row sat in Settings › Usage. It now closes Insights ›
Masking, after the list of requests, in the page's own `.list.prefs` rows
(same Off/On segs, same ids #maskAlertRow/#maskAlertSegs, same i18n keys
and the same maskAlert setting). Nothing is left in Usage. The page draws
it from page.js after loadSettings, hides it while one request is open,
and gateway mode leaves it out as Settings did. Placed after the list so
the requests still start in the first screen (masking-records at 640px)
and the demo keeps its place between the card and the list.

Run at base 07a3312c5 with this change:
- mask-alert.test.cjs, Chromium (WSL magpie-desktop and mote) and WebKit
  (WSL), en/zh/zh-TW/ja/de at 900 and 380px: all pass.
- WebKit (WSL): mask-alert, masking-records, masking-demo,
  masking-demo-unblurred: 87 pass, 0 fail (tree differed from the pushed
  one by a client.js comment reflow only). Earlier WebKit run: turn-done,
  quota-reads, routing-masking, gateway-mode, builtins, sidebar pass.
- Chromium (WSL) at the final tree: i18n-keys, mask-alert, masking-records,
  masking-demo, masking-demo-unblurred, turn-done, quota-reads,
  routing-masking, gateway-mode, builtins, sidebar: 131 pass, 1 fail. The
  fail is i18n-keys "a plugin's words are its own" on "Unmarked"
  (plugins/routing/i18n.js), red on main, #4524.
- mote: go test -timeout 45m ./internal/gui/...: TestCoreScriptBudget and
  the budgets pass (app.js only shrinks). Red: TestSettingsSaveKeepsWhat-
  ItDoesNotSend (SearchAll, red on origin/main 93b31f5b7 too, #4514),
  TestColdTurnsTaken (passes alone 3 of 3, #4510), and the AppKit window
  tests killed at their 30s bar on mote over ssh (no window session).

Broken by hand: with internal/gui/assets back as on 07a3312c5 (row in
Settings › Usage, none on the page), mask-alert.test.cjs went 11 of 12
red in Chromium; the feature-off test is the one that still passes.

Not tried: the real app (desktop window) and WebKit on mote, whose
Playwright WebKit launch hangs there.
2026-10-31 14:05:02 +08:00
yetone 76218200af gui: a demo's made-up account is never blurred by Hide accounts (data-no-pii)
outloudvi on Discord (#feedback, 1564923315095732276): with Hide accounts
on, the masking demo's letter on Insights › Masking had its account
(yetone@example.com) blurred and its password (hunter2-prod) not. The
blur is hideAccounts, which masks every address in the window's body.
It isn't the demo's own masking. The demo's values are made up, and
showing them is the point of it.

An element marked data-no-pii, and everything inside it, is now skipped
by the text walker and the tooltip pass. The demo's section carries the
marker. The class: any illustration with made-up accounts takes the same
attribute. A search of the GUI assets found no other drawn one. The only
other fake address is ops@company.com, in input placeholders, which the
blur never touches. Text added later in a marked element stays unmasked
too: the observer's mask(e) passes through the same checks.

New test masking-demo-unblurred: Hide accounts on, an address elsewhere
on the page still masked, the demo played (reduced motion on and off),
its account and password slots both readable, and no .pii in #maskDemo.
A generic [data-no-pii] element with a title and text changed after
masking stays unmasked. It runs en and zh, in both engines.

Run on mote:
- masking-demo-unblurred and masking-demo at this tree: green.
- go test -tags nogui -run Budget ./internal/gui: ok (no budget raised).
- The 124-file GUI run in the commit before, at this tree: none of its
  reds in masking files (masking-records zh-TW was green when rerun).
Broken by hand:
- Marker removed from client.js: red, account slot "ilottn@aamital.cmd"
  in webkit (the reporter's blur).
- Walker and title checks removed from app.js: red.
Not tried: Linux and Windows.
2026-10-28 17:58:50 +08:00
yetone cad7bbbdb7 redact: Insights › Masking shows how masking works, with Little Magpie, folded until opened
A card under "What the vendor didn't see" and above the request list
plays a 27s demo: Little Magpie takes one request (a GitHub sign-in with
a password and an email), tears the real values out into her notebook,
pastes placeholders in, sends it, and swaps them back on your computer
when the tool call comes home.

- Folded by default. The video (xq_light/xq_dark.webm, 1.7MB/1.5MB) and
  the stage are built only on the first open, so a folded card fetches
  nothing but its 0:27 thumbnail.
- It plays only while open, on screen, in a visible window and not
  covered by a single record's sheet; it plays once and rests on the
  last step. Under reduced motion it shows the last step, still.
- The stage (request, notebook, browser, provider) is drawn in the page
  and translated in every language (41 keys, zh, zh-TW, ja, de); only
  Little Magpie herself is video. Light and dark takes match the card's
  colour exactly, and the take follows the theme as it changes, still
  playing (a new source starts paused, so it is woken where T is).
- The request and provider boxes keep room for taller fonts: WebKitGTK's
  Noto ran the provider's note 16px past its box. The stage is 1000x420.
- T, the frame clock, is the authority; a video that drifts (a seek
  it couldn't make) is sent back to T, never the other way.

Run at this head (origin/main 4842f69be + this change), on mote (macOS 27):
- node --test masking-demo, masking-records, i18n-keys: 111 pass, 1
  fail. The red is i18n-keys "a plugin's words are its own" on
  plugins/library "Runs as", red on main since 7f827b3b0 (#3897).
- masking-demo: Chromium and WebKit x en/zh/zh-TW/ja/de x 1100/640:
  folded fetches no webm, opening fetches one, the stage fits, no
  English left, nothing wider than the window, every box's text inside
  it (4px to spare in request and provider); plays, stops when folded
  or covered, rests at the end, restarts; dark take on the card colour;
  a theme changed mid-play goes on playing in the new take.
- go test ./internal/gui/: only TestMainWindowCorners/macOS_26_SDK red,
  the same on main (#3949); TestCoreScriptBudget ok.
- gofmt clean (no Go changed); go vet, GOOS=linux go vet -tags nogui,
  GOOS=windows go vet ./internal/gui/ clean.

Broken by hand:
- T following vid.currentTime (the first take): "plays while open" red
  in Chromium (the step 7 seek never stuck); green after.
- pickVid without wake(): the theme test red in both engines (0/2).
- The provider box at 350px: the no-clip check red ("prov -26px").

Whole GUI suite (*.test.cjs, mote, before the rebase, at dc1cfe015 +
this change): 75 files pass, 33 fail; origin/main 9e6347608 alone: 73
pass, 35 fail. Every file red with this change is red on main too:
account-mask (#3951), gateway-caller-keys (#3797), gateway-key-models
(#2648), header-centre (#3479), icon-tile (#3858), library-row-remove
(#3099), menu-input-scroll (#3402), mobile-web (#3952), old-webkit
(#3403), phone-web (#3876), quota-count-wrap (#3404),
quota-refresh-order (#3679).

Real use, magpie web from this tree:
- Windows 11 (xiaomi-gpu), Edge 156 headless = WebView2's engine:
  folded fetches no webm, VP9 "probably"; rAF 60fps, video 30fps, T
  never steps back; the step 7 seek holds; the theme switch keeps
  playing; rests at 27.5s; no page errors; every box fits in all five
  languages (8px or more to spare).
- Linux (WSL2 magpie-desktop, WebKitGTK 2.52.6 under Xvfb, compositing
  off as under Wayland): plays with T on the video's time, seeks, rests
  at the end, no errors. It found the two fixes above: the theme switch
  left the new take paused, and the provider's note ran 16px past its
  box in English and Japanese (and the request box 6px in ja and de). After: 10px or more to
  spare in all five languages.

Not tried: the packaged Linux and Windows apps themselves (magpie web
in their engines stood in); a real request through masking (the demo
is drawn, not live).
2026-10-28 06:43:31 +08:00
yetone e52a5e50ba redact: a request opens by its key again; the key goes to the GUI as a string
The owner opened the newest masked request and got "This request's
record is gone: records are kept for 30 days", and a request opened from
the list said its whole text was no longer in memory. A record's key is
its time in nanoseconds (~1.79e18), past 2^53, so JSON.parse rounded it
to 256ns: /api/masking/record?key= and /api/masking/sent?key= looked up
a key no record has. A list row worked only because it carried its
record. Every way in by key failed: the Gateway page's and tray panel's
masked badge, ?key= in the address, and each request's sent text; the
list's before= paging was off by the rounding too.

gateway.Masked's key and /api/masking/record(s)' key now go as JSON
strings (",string"); records on disk keep their number. The page keeps
the key a string (no unary +), and a refresh compares keys as BigInt.

Tests: TestMaskedRequestIsRecorded and TestMaskingRecordsAPI check the
key is a string, and masking-records' fake API uses 19-digit string keys
in place of 1001-1005, which no rounding touched.
Broken by hand: with the Go change out, both Go tests fail ("key not a
string"); with the page.js/client.js change out, "chromium: a masked call
on the Gateway page, and a key in the address, open its request" fails.

Run: go test ./internal/gui (twice ok; a first run under load ~180 went
red with its log cut by tail, so the test is unnamed; two reruns with
the whole log were ok), ./internal/gateway ok, ./internal/maskrec ok;
GOOS=linux/windows go vet ./internal/gateway ok; GUI masking-records,
routing-bodies, i18n-keys: 96 of 96 ok, both engines.
Not tried: the real app with a real masked request.
2026-10-26 22:50:37 +08:00
yetone e698a688fd gui: Insights › Masking shows each request as sent, what was masked and how
What masking did moves out of Settings › Privacy into a page of its own
under Insights (plugins/redact: client.js, page.js, redact.css, i18n.js).
Privacy keeps how it is found and what to mask, with a "What was masked"
row that opens the page.

- The top card is Privacy's card, made shorter: the flow animation
  (agents → this computer → providers) with magpie's bird on the centre
  line and "magpie masks it on this computer" under it, so a screenshot
  says who masked it; the count and a 7-day bar. Nothing the list repeats.
- The list: one row per masked request, narrowed by kind, by who found it
  (rules or the local model), by agent or provider, or to held-back
  requests; or by value, each with how often it was put back.
- A request: the message as it went to the vendor beside the original,
  each mask marked, unchanged parts folded; picking a value lights every
  place it was masked; a held-back request offers "Mask it instead".
- Gateway's masked badge and ?view=masking&key=N (trace.go's mainView)
  open one request.
- Classes are msk-: library.css owns mk- (a first cut stacked the flow).
- Budgets lowered to the core's size after the move.
- Not shown: rule names and the local model's confidence; the records
  don't keep them.

Run on f5b1d36ff (rebased since onto 344d11484, which only raised the
budgets and changed a dialog's centring and two unrelated files):
- masking-records.test.cjs: 32/32, Chromium and WebKit, 5 languages,
  1100px and 640px (card, list, filters, detail, put back, held back,
  Gateway badge, deep link, Settings row, no scroll on click), with
  key-import and i18n-keys: 48/48.
- go test ./internal/maskrec ./internal/redact ./plugins/redact
  ./internal/gui ./internal/provider: ok. TestCoreScriptBudget and
  TestMainView ok; gofmt -l clean.
- Before the rebase, on 628e18987: go test ./... -timeout 45m, every
  package ok; GOOS=linux go vet -tags nogui ./... and GOOS=windows go
  vet ./... clean.
- Budgets lowered to the sizes at the pushed head (app.js 1,317,486,
  core 1,524,789), ~26KB under what f35c721c4 raised them to after
  ce5b23cdb's add-key spinner put the core over.

Broken by hand: the bird's href (#bird → #nobird) turns masking-records
red.

Not run at this head when pushed: internal/gateway, which main's newer
commits touched (run right after; the result goes on the release).
Not tried: the whole GUI suite (hours long, and another session's runs
held the machine), the real Linux (WebKitGTK) and Windows apps.
2026-10-24 19:45:03 +08:00