Skip to content

Gate account e-mail addresses behind privacy.showAccountEmail - #25

Merged
fdussert merged 7 commits into
mainfrom
feature/account-email-setting
Oct 15, 2026
Merged

fdussert merged 7 commits into
mainfrom
feature/account-email-setting

Conversation

@fdussert

@fdussert fdussert commented Oct 15, 2026 •

Copy link
Copy Markdown
Owner

What

A new privacy setting, privacy.showAccountEmail, off by default, with a checkbox in /admin → Screen → Privacy next to the Claude usage opt-in. Until it is ticked, no account provider may put the account's e-mail address in what it publishes.

  • Config: showAccountEmail in PrivacySchema (server/src/config/schema.ts), defaulting to false. No release ever published an address, so an older config is read as off by the schema default — no inference like claudeAccountUsage needs. Tests cover v1/v2/v3 files without the field, a file that carries it, a v3 file left untouched on disk, and a file with an unreadable value left untouched while the store runs degraded.
  • Provider contract (server/src/privacy.ts):
    • withAccountEmail(email, show) builds the field: absent when off, not empty or masked.
    • gateAccountEmail(snapshot, show) drops it from an existing snapshot — the error path's { ...last, error } and any cached answer — so an address fetched while the box was ticked is not republished after it is unticked. It looks at the top level only, so it is applied to the object that carries email — account.data in a snapshot shaped like Add opt-in Codex account and session provider #14's.
    • publishesAccountEmail: true on a provider makes a change of the setting drop the hub's cached value of its channel at once (watched or not) and poll it again immediately. An answer from a poll that was already in flight — which may have read the old setting — is thrown away rather than published, whether a widget is still watching or not. Unticking therefore takes the address off the screen immediately rather than at the next poll, five minutes for an account endpoint, and no stale value is replayed to a widget subscribing in between.
    • The registry refuses publishesAccountEmail on a provider without poll(): a poll is the only way anything reaches a channel, so such a provider could never take an address back.
  • Admin: checkbox, label and hint in French and English. The hint says that once on, the address is sent to every widget reading an account channel, marketplace ones included, and appears on screen.
  • Docs: the rule for provider authors in docs/connections.md and AGENTS.md, a pointer in docs/claude-code.md, the user side in the README, and a CHANGELOG line.

No provider on main publishes an e-mail today, so nothing is wired to the helpers yet: they, their tests and the documented contract are what the first account provider is held to.

Why

Decided while reviewing #14 (Codex) and #19 (Claude account): whatever a provider publishes on a channel reaches every widget subscribed to it, including a third-party marketplace widget with network access, whose consent dialog says "reads channel X", not "reads your e-mail" — and the Edge sits on a desk. So the check is server-side: off, the field is never in the snapshot. The plan (Pro, Max, …) and the sign-in method are not covered by the setting and are published either way. #14 and #19 can gate their address on this once it lands.

How to see it

Run a bench server from this branch (FREMKIT_PORT=4301 FREMKIT_DATA_DIR=<tmp dir> from server/, seeded with data/fremkit.example.json), open /admin → Screen → Privacy, tick Show the account e-mail address, and check GET /api/config reports privacy.showAccountEmail: true.

Checks

  • pnpm typecheck — green
  • pnpm test — server 1416 tests / 72 files, ui 385 / 30, all green
  • pnpm --filter ui build — green
  • Checked in a browser against the bench server: the box renders with its hint and the toggle persists.

🤖 Generated with Claude Code

fdussert and others added 5 commits October 15, 2026 18:26
An account provider's snapshot reaches every widget subscribed to its
channel, a third-party marketplace widget with network access included,
and the Edge sits on a desk. The account e-mail therefore needs its own
opt-in, decided server-side, before any provider may publish it.

No release ever published an address, so an older config is read as off
by the schema default and needs no inference, unlike claudeAccountUsage.
The tests pin that, and that the store neither rewrites a v3 file that
lacks the field nor one whose value it cannot read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
withAccountEmail() is spread into a snapshot and adds the address only
when privacy.showAccountEmail is on; off, the key is absent rather than
empty or masked. No provider on main publishes an address today, so
nothing is wired to it yet: the helper, its test and the documented
contract are what the first account provider (Claude, Codex) is held to.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The box sits next to the Claude usage opt-in, and its hint says plainly
what turning it on means: the address is sent to every widget reading an
account channel, marketplace ones included, and shows on the screen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two gaps found reviewing #19. A provider that answers a failure with its
last good snapshot ({ ...last, error }) would keep publishing an address
fetched while the box was ticked; gateAccountEmail() drops it from any
existing snapshot, and the contract now says every returned snapshot goes
through it.

And unticking only took effect at the provider's next poll, five minutes
for an account endpoint, while the hub kept replaying the old value to
new subscribers. A provider now declares publishesAccountEmail, and a
change of the setting has the registry poll those providers at once (or
straight after a poll in flight, which may have read the old value) and
drop the cached value of a channel nobody watches.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review of #25. A poll in flight when the last widget left was not marked
when the setting changed, so its answer, read under the old setting, was
published and cached for the next subscriber; a watched channel kept its
cached value until the repoll returned. The cache is now dropped first in
every case, and an answer from a poll that was in flight is thrown away
rather than published, watched or not.

A provider without poll() can publish nothing on its channel and could
never take an address back, so the registry refuses the flag there. The
documented example now returns from poll() as the provider model does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fdussert
fdussert force-pushed the feature/account-email-setting branch from 99ca586 to 60bce8c Compare October 15, 2026 16:27
fdussert and others added 2 commits October 15, 2026 18:30
The Codex provider in #14 publishes the account under account.data, and
gateAccountEmail only looks at the top level of what it is given, so
gating the whole snapshot would leave a nested address in place. The
helper stays a single-level one, which keeps it obvious; the contract
now says to apply it to the object that carries email, on the fresh,
error and stale paths alike, with a nested example and a test that also
shows gating the outer object changes nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
They compared the whole privacy section with toEqual, so the first
branch to add a key there (#14, #22) would break them with no git
conflict to say why. toMatchObject checks the two keys this setting is
about and nothing else.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fdussert
fdussert merged commit 7858776 into main Oct 15, 2026
1 check passed
@fdussert
fdussert deleted the feature/account-email-setting branch October 15, 2026 16:43
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