oliver-zehentleitner / maity
clean-up: round 2 hub/web: the experiment notice's text kept twice, its third place unbuilt, PATCH /me's field lists
tsk-dc04hmpz837j Done An agent
From the clean-up audit tsk-hgnbapyw7hnh (round 2, hub/web changes since 80647565), read at 19ed029a.
The experiment notice (tsk-x3vf091b9jyv, PR #1730) and the code it touches.
1. Duplication: one notice text, two catalogs, nothing keeps them equal
- Kind: duplication / drift risk.
- Files:
hub/src/maity_hub/words/<lang>.json:130(register_page.experiment) andweb/i18n/<lang>.json(experiment.notice: en.json:1240, de.json:1234, es/fr/it/nl/pt.json:1159, ja/ko/zh-Hans.json:1130), with the generatedweb/js/i18n/<lang>.js. Ten languages, two copies each. - What is wrong: docs/api.md:4272-4274 says the hub and the dashboard show "the same text in every interface language", and hub/context/preferences.md (decision e5b364ab) relies on the terms carrying the same paragraph. No test compares the two catalogs, so a wording change in one (the owner was to check the final wording) leaves the other behind. The meat-proxy note avoids this by having the dashboard quote the hub's text (docs/api.md:4267, "keeps no copy of its own").
- Proposal: a hub test beside
hub/tests/test_catalog.pythat assertsregister_page.experimentequalsexperiment.noticeinweb/i18n/<lang>.jsonfor every language (the hub repo already holds web/). Serving the text from/melike the meat-proxy note is the alternative, but the registration page is signed out, so the test is the smaller step. - Effort: S. Risk: none.
2. Docs drift and a speculative API: the third place the notice is said to appear
- Kind: docs drift / dead option.
- Files:
docs/api.md:4274-4276("and where an agent of theirs first meets a stranger (§9.6)");web/js/experiment-notice.js:5-8,:22-26(box()withoutunderstood, and itsclassNameoption); its only caller withoutunderstoodisweb/tools/smoke.js:819. - What is wrong: tsk-x3vf091b9jyv point 3 left the stranger case to the firewall card tsk-5c6hw63ncq3m, which is done, and nothing in web/js or the hub shows the notice there. The contract names a place that does not exist, and the bare
box()is kept for it with no caller. Alsoexperiment-notice.js:58falls back to the browser's clock when the PATCH answer has noexperiment_notice_understood_at, which the hub always sends (routes/me.py:115). - Proposal: decide (see Open question). If the stranger case is still wanted, file it as a feature card and leave the code. If not, drop the clause from docs/api.md §5.1, drop the bare
box()path,classNameand the smoke case at :819-821, and drop the fallback at :58. - Effort: S. Risk: low.
3. Design: PATCH /me lists the human fields three times
- Kind: duplication / a rule kept by hand.
- Files:
hub/src/maity_hub/routes/me_session.py:206-221(HUMAN_FIELDS),:891-899(the "nothing to change" guard, its own list),:883-890(public,links);LINKS(:205) exists but:890and:969write the same set out again, solinksandlinks_givenare the same value computed twice. - What is wrong: each new human field has to be added in three places; this change did that at :201, :220 and :898. A field missed in the guard is refused as "nothing to change" when sent alone.
- Proposal: build the guard from one constant: fields whose
nullmeans "nothing" (meat_proxy, the two parts,handle) checked by value, every other field ofHUMAN_FIELDSby presence. UseLINKSat :890 and droplinks_given. Optionally fold the notice's own UPDATE (:961-968) intovalues(:995-996) withcoalesce(experiment_notice_understood_at, now), so one request writes the row once. - Effort: S. Risk: low (test_me.py, test_experiment_notice.py, the meat-proxy tests cover the guard).
Open question
- Item 2: should the notice still appear where an agent first meets a stranger (§9.6)? This is the owner's or the lead's call. tsk-x3vf091b9jyv said "its web part shows the notice there".
Covered elsewhere
routes/me.py:115-119, the inline "RFC 3339 or null": an instance of tsk-jzkpfe8yfkgr item 1, added there as a note.- Searched: experiment, notice, me_session, patch_me, HUMAN_FIELDS, register_page, rfc3339, catalogs.
Effort sum: S+S+S = 3 points.
Notes
An agent · Nov 14, 2026, 07:29 UTC
#1785 gemergt (Punkte 1 und 3). Die Karte bleibt offen für Punkt 2 (wartet auf req-1by88x9ydr9j).
P3 aus A246 (vhqe, 130574) für den Punkt-2-PR: Der Hub-Teil von CI startet nicht beiweb/i18n/*. Deshalb läufttest_catalog.py(Gleichheit des Hinweistexts) bei einem reinen Übersetzungs-PR nicht, und eine Abweichung fällt erst auf main auf. Fix:hub:web/i18n/*in.github/workflows/ci.yml(case-Zeile ~88) ergänzen, oder den Vergleich nachweb/tools/check.pyverschieben.