@micha.bigler/ui-core-micha 2.41.1 → 2.41.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,188 @@
1
+ # DX-2 — Declare `sideEffects` so consumers can tree-shake the kit
2
+
3
+ **Target repo:** `ui-core-micha` (branch `main`)
4
+ **Tier:** 3 — shared-core, and it changes what every consumer's bundler is permitted to discard.
5
+
6
+ ---
7
+
8
+ ## A. Envelope
9
+
10
+ ### Goal
11
+
12
+ `package.json` declares **no `sideEffects` field**. Without it a bundler must assume every module in the
13
+ package can have an import side effect and therefore cannot drop unused exports. **Twelve consumers ship the
14
+ whole kit regardless of what they import.**
15
+
16
+ This is not a theory. `hram/THEME-2` switched hram from three named translation bundles to the full
17
+ `uiCoreTranslations` aggregate and measured the built-size delta at **−11 bytes** — not the increase everyone
18
+ expected, because the three-bundle import was already pulling all seven.
19
+
20
+ ### Why this is worth a Tier-3 change
21
+
22
+ Two decisions currently rest on a number that this defect makes meaningless:
23
+
24
+ - **`I18N-1` measured `+28,943 B` raw / `+7,327 B` gzip** for an auth-only app switching to the aggregate.
25
+ That measured a real difference in *source* reachability which the build never realises. As a decision input
26
+ it is void.
27
+ - **`I18N-2` is `blocked` on exactly this.** It was framed as a bundle-size optimisation via
28
+ self-registration, and its stated input is a size delta that cannot be measured until the package can
29
+ tree-shake at all. **This WO is its unblocker**, and it is a far smaller change than reworking how twelve
30
+ consumers resolve strings.
31
+
32
+ ### Scope
33
+
34
+ 1. **Prove it first, per module.** Walk every module reachable from the package root and establish that
35
+ importing it has **no** side effect: no top-level statement with an observable effect, no polyfill or
36
+ registry mutation, no `import './x.css'` or equivalent, no module-scope singleton creation whose existence
37
+ something depends on. **This is the work**; the field is one line.
38
+ 2. **`package.json`** — add `"sideEffects": false` if step 1 holds for everything. If it does **not** hold for
39
+ some module, add the array form listing exactly those files rather than the blanket `false`.
40
+ 3. **Re-measure the delta `I18N-1` got wrong**: the built size of an auth-only app importing only
41
+ `authTranslations` versus the full aggregate, against a package that can now tree-shake. Report the number.
42
+ 4. Update `I18N-2`'s register note with that number, so it is either authorable or droppable on evidence.
43
+
44
+ ### Non-goals / do not touch
45
+
46
+ - **No `exports` map.** It would allow subpath imports and give a further size win, but it changes which
47
+ import paths resolve at all — a breaking-change risk for twelve consumers in the same commit. Separate
48
+ decision, and this WO's measurement is its input.
49
+ - **No component, theme, chart or i18n change.** Nothing in `src/` is edited for its own sake; the only source
50
+ changes permitted are ones step 1 proves are needed to make a module genuinely side-effect-free, and each
51
+ must be reported rather than folded in silently.
52
+ - **No consumer pin bumps.** Apps pick this up when they next bump.
53
+ - **`I18N-2` itself.** This unblocks it; it does not implement it.
54
+
55
+ ### Risks
56
+
57
+ - **The real failure mode is a false `sideEffects: false`.** If a module *does* have an import side effect and
58
+ the field says otherwise, a bundler silently drops it and the consuming app breaks at runtime in a way no
59
+ test here will catch. That is why step 1 is the scope and the field is an afterthought. **If any module is
60
+ uncertain, use the array form and list it** — a partial declaration that is true beats a blanket one that is
61
+ nearly true.
62
+ - **`side effect` includes the theme.** `createAppTheme`, the token module and the registry are the places to
63
+ look hardest: a module that builds an object at import time is fine, but one that *registers* itself
64
+ somewhere is not.
65
+ - **Every consumer's bundle changes shape**, even though no source behaviour changes. That is the intent, and
66
+ it is why this is Tier 3 rather than a chore.
67
+
68
+ ### Required tests to WRITE
69
+
70
+ - **A test asserting the field matches reality** is not really possible in-repo — a bundler is what enforces
71
+ it. So instead: **one build-level check** that the package builds and its entry points still resolve after
72
+ the declaration, plus the measurement in scope item 3 recorded as a number in the register note.
73
+ - If step 1 finds a module needing a source change to become side-effect-free, that change gets a test.
74
+ - Otherwise **no new unit tests** — and saying so is the correct answer for a `package.json` field.
75
+
76
+ Scoped run: the existing suite, to confirm nothing regressed. Not a full-estate exercise.
77
+
78
+ ### Parity guardrail
79
+
80
+ No API, behaviour or visual change. Every currently-working import must keep working; what changes is only
81
+ what a consumer's bundler may discard.
82
+
83
+ ---
84
+
85
+ ## B. Implementation map
86
+
87
+ *Filled by the Orchestrator on `git pull` — see `AGENTS.md` → "Work Order".*
88
+
89
+ **Repo root:** `ui-core-micha` (this is the package root — `package.json` lives here, `src/index.js` is
90
+ the package entry per `"main"`/`"module"`). Build: `pnpm run build` (tsc, `tsconfig.build.json`,
91
+ `rootDir: src` → `outDir: dist`). Tests: `pnpm test` (vitest run), config likely under `tests/` or
92
+ `vite.config.mjs`.
93
+
94
+ **Entry point to walk:** [`src/index.js`](../src/index.js) — every export re-exported from here is a
95
+ module the audit must cover. Rough module groups, in the order they're exported: `theme/` (7 exports),
96
+ `auth/` (AuthContext, UserMenu, apiClient, authApi, authService), `layout/` (PageLayout, SectionNav),
97
+ `pages/` (7 page components), `components/` (12 components incl. charts subtree), `i18n/` (7 translation
98
+ bundle modules, pure data objects), `notifications/` (7 exports incl. a `realtime` module — check for
99
+ WebSocket/EventSource construction at module scope, not just component-body), `messaging/` (13 exports,
100
+ same realtime-connection caution), `onboarding/` (8 exports).
101
+
102
+ **Known non-trivial finding — do not silently "fix" this, report it:**
103
+ [`src/theme/createAppTheme.js:1-3`](../src/theme/createAppTheme.js) has three top-level
104
+ `import '@fontsource/dm-sans/400.css'` (+ `/500.css`, `/600.css`) — these ARE import-level side effects
105
+ (CSS injected into the document on import, unconditionally, regardless of whether `createAppTheme` is
106
+ even called). This module must be **excluded** from a blanket `sideEffects: false` — either list
107
+ `src/theme/createAppTheme.js` explicitly in the array form, or (better, since it's a source-level fix
108
+ consistent with the WO's "no false negatives" risk framing) move the three font-CSS imports into a
109
+ separate module (e.g. `src/theme/fonts.css.js` or inline at the one leaf that needs them) so the rest of
110
+ `theme/` stays tree-shakeable and only that one file is excluded. Whichever path is taken, it must be
111
+ **reported explicitly** in the WO's audit output, not folded in silently (Envelope: "each must be
112
+ reported rather than folded in silently").
113
+
114
+ **Areas most likely to hide further side effects (audit these hardest, per the Envelope's own risk
115
+ note):** `theme/` (registry singletons — `KIT_COMPONENT_SX_REGISTRY` is exported as a value; confirm it's
116
+ a plain object literal built at import with no external registration call), `notifications/realtime.js`
117
+ and `messaging/` (anything opening a socket/listener at module scope rather than inside a hook/effect),
118
+ `auth/apiClient.js` (axios instance creation is fine — a side-effect-free object build — but check for
119
+ any `axios.interceptors.*.use(...)` called at module scope outside a factory function, which would be a
120
+ real side effect since it mutates a shared axios default instance).
121
+
122
+ **Do-not-touch:** no `exports` map in `package.json` (Envelope non-goal). No component/theme/chart/i18n
123
+ behaviour change — only source edits that make a module genuinely side-effect-free, each reported.
124
+
125
+ **Progress contract:** emit `PLAN: …` first, then `PROGRESS: [n/total] <module-group>` before auditing
126
+ each group above and `… done` after, and a final `RESULT: DONE` or `RESULT: BLOCKED <reason>`. No gap
127
+ > ~2 min. Work from this package — open files only to verify specific claims, not a blind full-repo read.
128
+
129
+ ## Preamble
130
+
131
+ The text above is the COMPLETE spec — the committed WO file's content, not a plan to refine; there is
132
+ no separate plan file. Read the nearest `AGENTS.md`, the relevant `.codex/skills/<role>/SKILL.md`, and
133
+ the app `MEMORY.md` ONLY for conventions. Stay in scope; do not touch auth/permissions/deps/schema/CI
134
+ unless the spec says so; do not update `MEMORY.md`. **Do NOT edit `WORK_ORDERS.md`** — the register row
135
+ and the review verdicts are the orchestrator's alone. Do NOT `git add`/`commit`/`push` — leave every
136
+ change uncommitted in the working tree for the orchestrator's independent review. WRITE the tests the
137
+ "Required tests to WRITE" section calls for AND **RUN the tests you just wrote** to confirm they execute
138
+ and pass — that is the ONLY test run you do (NOT the app's affected/full suite, NOT any review). The
139
+ orchestrator re-runs the authoritative set + does the independent review after you finish — those are
140
+ the gate; your own run does not count as the gate.
141
+
142
+ Narrate continuously: a `PLAN: <step1> | <step2> | …` line up front, then a single-line
143
+ `PROGRESS: [<n>/<total>] <present-tense action>` before every relevant action (and `… done` on
144
+ completion), spaced so no gap exceeds ~2 min, stdout unbuffered, plus exactly one final
145
+ `RESULT: DONE|BLOCKED <reason>`.
146
+
147
+ ---
148
+
149
+ ## C. Orchestrator only
150
+
151
+ > **STOP — if you are the implementer reading this work order as your own specification, this section is NOT
152
+ > addressed to you. Skip it entirely.** It tells the Orchestrator how to invoke you. **You ARE that
153
+ > invocation — do NOT shell out to `codex exec`, do NOT spawn reviewers, do NOT edit `WORK_ORDERS.md`, and do
154
+ > NOT `git add`/`commit`/`push`.**
155
+
156
+ ### Execution directive
157
+
158
+ Check `.claude/codex-status.md` first. **No line for the current date means use Codex.** A dated `unavailable`
159
+ line for today means skip the attempt, implement directly in Claude and name the record — that flips
160
+ authorship. Otherwise one probe, outcome written back either way.
161
+
162
+ ### Review routing
163
+
164
+ Tier 3: **independent `reviewer`** — mandatory, and the substantive one here: ask it to **independently
165
+ re-check the side-effect audit**, module by module, rather than accept the implementer's list. That audit is
166
+ the entire safety argument. **No `ui_reviewer`** — nothing renders. No `sec_reviewer`.
167
+
168
+ ### Verification
169
+
170
+ Nothing renders, so no gate. The verification is the audit plus the re-measured delta, both reported as
171
+ findings rather than assertions.
172
+
173
+ **A push to `main` here IS the npm publish** — `publish.yml` triggers on `push: branches: [main]` with `paths`
174
+ covering `package.json` and `src/**`, and npm publishes cannot be undone. So decide the version deliberately
175
+ before pushing: this is a **patch** by scope (no new capability, no API change), and it will go out the moment
176
+ it lands.
177
+
178
+ ### Register + commit
179
+
180
+ One row, `DX-2`. `done` only with the independent reviewer and verdict named, plus the measured delta.
181
+ Update `I18N-2`'s note in the same commit — that cross-reference is half the point of this WO.
182
+
183
+ ### Mini-handover
184
+
185
+ Repo: `ui-core-micha`, branch `main`. WO: `work-orders/DX-2.md`. The one-line field is trivial; **the
186
+ per-module side-effect audit is the work**, and a wrong `false` breaks consumers silently at runtime. Use the
187
+ array form if anything is uncertain. Re-measure the aggregate delta and write it into `I18N-2`. Tier 3,
188
+ `reviewer` mandatory and asked to redo the audit. **Pushing to main publishes.** Follow `orchestrate-codex`.
@@ -0,0 +1,195 @@
1
+ # DX-3 — `publish.yml` tests before it builds, so `2.41.2` cannot publish
2
+
3
+ **Target repo:** `ui-core-micha` (branch `main`)
4
+ **Tier:** 3 — CI is a Tier-3 surface regardless of diff size.
5
+
6
+ Short-form WO: two steps swapped, then an operator-confirmed dispatch.
7
+
8
+ ---
9
+
10
+ ## A. Envelope
11
+
12
+ ### Goal
13
+
14
+ `DX-2` landed on `main` (`31675d8`, `e75192f`) and **its publish failed**, so `@micha.bigler/ui-core-micha`
15
+ is still at `2.41.1` on the registry while `package.json` says `2.41.2`. Nothing DX-2 produced can be
16
+ consumed until this is fixed.
17
+
18
+ Cause, from run
19
+ [32029216699](https://github.com/bigler-webapps/ui-core-micha/actions/runs/32029216699) —
20
+ `completed/failure`:
21
+
22
+ ```
23
+ FAIL tests/packageTreeShaking.test.js > built package entries resolve and unused translation bundles tree-shake
24
+ Error: ENOENT: no such file or directory, lstat '.../ui-core-micha/dist'
25
+ Test Files 1 failed | 64 passed (65)
26
+ Tests 1 failed | 510 passed (511)
27
+ ```
28
+
29
+ `publish.yml` runs **`Run tests` before `Build`**. `DX-2`'s new test copies the package's own `dist/` to
30
+ assemble a fake installed consumer, and **`dist/` is gitignored** (`.gitignore:2`), so in a clean checkout
31
+ it does not exist yet. The test is not flaky and it is not wrong — it inspects the built artifact, which is
32
+ the whole point of it. **It simply cannot pass in the order the workflow runs.**
33
+
34
+ It passed locally at 511/511 because a `dist/` from an earlier `pnpm run build` was lying around. That is
35
+ the failure mode, not the test.
36
+
37
+ ### Scope
38
+
39
+ 1. **`.github/workflows/publish.yml`** — move the `Build` step **above** `Run tests`.
40
+ **Both steps carry `if: steps.version_check.outputs.should_publish == 'true'`; that condition must stay
41
+ on each.** Nothing else in the file changes.
42
+ 2. **Publish `2.41.2`** — see the dispatch note below, which is the part most likely to be missed.
43
+
44
+ ### The dispatch is required, and it is not automatic
45
+
46
+ `publish.yml` triggers on `push` to `main` filtered to `package.json`, `pnpm-lock.yaml`, `src/**` and
47
+ `tsconfig.build.json`. **`.github/workflows/**` is not in that list**, so landing this fix does **not**
48
+ re-trigger the publish. `2.41.2` would sit unpublished until some unrelated `src/**` change happened to
49
+ push it out.
50
+
51
+ So: after the fix lands, **dispatch `publish.yml` on `main`**. `publish.yml` is **not** on the dispatch
52
+ safe-allowlist (`weekly-routines`, `terraform-plan`), so per `AGENTS.md` name the exact workflow and inputs
53
+ and **wait for an explicit operator go** before running it.
54
+
55
+ `should_publish` compares `package.json` against the registry, so with `2.41.2` local and `2.41.1`
56
+ published it will evaluate true and the dispatch will publish. No version bump is needed for this WO — and
57
+ none should be added, because the artifact being published is DX-2's, not this WO's.
58
+
59
+ ### Non-goals / do not touch
60
+
61
+ - **`tests/packageTreeShaking.test.js`.** It is correct. Do not make it build `dist/` itself, do not skip it
62
+ when `dist/` is absent, and above all do not delete it — a skip would silently retire the only check that
63
+ the `sideEffects` declaration actually tree-shakes, which is DX-2's entire deliverable.
64
+ - **The `sideEffects` array, `src/theme/fonts.js`, or anything else DX-2 landed.** Reviewed and correct.
65
+ - **The trigger `paths` list.** Adding `.github/workflows/**` would make every workflow edit attempt a
66
+ publish. That is a worse default than one dispatch.
67
+ - **The version.** Stays `2.41.2`.
68
+ - Any other workflow, any source file.
69
+
70
+ ### Recorded, deliberately out of scope
71
+
72
+ **`publish.yml` is the only workflow in this repo that runs tests, and it runs them only when
73
+ `should_publish == 'true'`.** So ucm's suite executes in CI *only on a version bump* — a `src/**` change
74
+ that does not bump the version is never tested by CI at all. That is a real gap in a shared-core package
75
+ consumed by twelve apps, and it is a separate decision (a `ci.yml` for this repo, or a `pull_request`
76
+ trigger), not something to fold into a two-line reorder.
77
+
78
+ ### Risks
79
+
80
+ - **Low, and the shape is known**: after the swap a build failure surfaces before test results instead of
81
+ after. That is an improvement, not a regression — you want to know the artifact is buildable before
82
+ spending 64 s on tests against it.
83
+ - **The real risk is stopping at the commit.** A landed reorder with no dispatch leaves `2.41.2`
84
+ unpublished and looks done. The acceptance criterion below is the registry, not the workflow file.
85
+
86
+ ### Required tests to WRITE
87
+
88
+ **None.** Nothing to unit-test in a step reorder, and manufacturing one would be noise. The verification is
89
+ a green run plus the registry.
90
+
91
+ ### Acceptance
92
+
93
+ 1. A `publish.yml` run on `main` completes **green**, with `tests/packageTreeShaking.test.js` **passing**
94
+ rather than skipped — 511/511.
95
+ 2. **`npm view @micha.bigler/ui-core-micha version` returns `2.41.2`.** The registry is the acceptance,
96
+ not the commit and not the green tile.
97
+
98
+ ### Parity guardrail
99
+
100
+ No source, API, behaviour or visual change. What changes is the order two CI steps run in.
101
+
102
+ ---
103
+
104
+ ## B. Implementation map
105
+
106
+ *Filled by the Orchestrator on `git pull` — see `AGENTS.md` → "Work Order".*
107
+
108
+ **Repo root:** `ui-core-micha` (workflow lives at repo root, `.github/workflows/publish.yml`).
109
+
110
+ **Exact change:** in [`.github/workflows/publish.yml`](../.github/workflows/publish.yml), the step
111
+ order today (verified on `git pull`, lines 112-118) is:
112
+
113
+ ```yaml
114
+ - name: Run tests
115
+ if: steps.version_check.outputs.should_publish == 'true'
116
+ run: pnpm run test
117
+
118
+ - name: Build
119
+ if: steps.version_check.outputs.should_publish == 'true'
120
+ run: pnpm run build
121
+ ```
122
+
123
+ Swap so `Build` runs first, `Run tests` second — same two `if:` conditions, unchanged, one on each
124
+ step. Nothing else in the file (`Check out code`, `Set up Node`, `Decide whether to publish`,
125
+ `Set up pnpm`, `Show version from package.json`, `Install dependencies (pnpm)`,
126
+ `Ensure recent npm for trusted publishing`, `Publish to npm`) moves or changes.
127
+
128
+ **Do-not-touch (repeat of the Envelope's non-goals, stated here for the implementer):**
129
+ `tests/packageTreeShaking.test.js`, the `sideEffects` array / `src/theme/fonts.js` (DX-2, already
130
+ landed and reviewed), the `on: push: paths` trigger list, `package.json`'s version (stays `2.41.2`).
131
+ This WO touches exactly one file.
132
+
133
+ **Progress contract:** `PLAN: …` naming the single edit, `PROGRESS: [1/1] swap Build/Run-tests order
134
+ in publish.yml … done`, then `RESULT: DONE`.
135
+
136
+ ## Preamble
137
+
138
+ The text above is the COMPLETE spec — the committed WO file's content, not a plan to refine; there is
139
+ no separate plan file. Read the nearest `AGENTS.md`, the relevant `.codex/skills/<role>/SKILL.md`, and
140
+ the app `MEMORY.md` ONLY for conventions. Stay in scope; do not touch auth/permissions/deps/schema/CI
141
+ beyond the one named swap. Do not update `MEMORY.md`. **Do NOT edit `WORK_ORDERS.md`** — the register
142
+ row and the review verdicts are the orchestrator's alone. Do NOT `git add`/`commit`/`push`, and do NOT
143
+ dispatch any workflow — leave every change uncommitted in the working tree for the orchestrator's
144
+ independent review. This WO's "Required tests to WRITE" is explicitly **none** — do not write or run
145
+ any test; there is nothing to verify locally that the orchestrator's own read of the diff and the
146
+ reviewer's pass don't already cover.
147
+
148
+ Narrate continuously: a `PLAN: <step1> | …` line up front, then a single-line
149
+ `PROGRESS: [<n>/<total>] <present-tense action>` before every relevant action (and `… done` on
150
+ completion), spaced so no gap exceeds ~2 min, stdout unbuffered, plus exactly one final
151
+ `RESULT: DONE|BLOCKED <reason>`.
152
+
153
+ ---
154
+
155
+ ## C. Orchestrator only
156
+
157
+ > **STOP — if you are the implementer reading this work order as your own specification, this section is NOT
158
+ > addressed to you. Skip it entirely.** It tells the Orchestrator how to invoke you. **You ARE that
159
+ > invocation — do NOT shell out to `codex exec`, do NOT spawn reviewers, do NOT edit `WORK_ORDERS.md`, do
160
+ > NOT dispatch any workflow, and do NOT `git add`/`commit`/`push`.**
161
+
162
+ ### Execution directive
163
+
164
+ Check `.claude/codex-status.md` first. **No line for the current date means use Codex.** A dated
165
+ `unavailable` line for today means skip the attempt, implement directly in Claude and name the record —
166
+ that flips authorship, which keeps the independent `reviewer` mandatory. Otherwise one probe, outcome
167
+ written back either way.
168
+
169
+ ### Review routing
170
+
171
+ Tier 3: **independent `reviewer`** — mandatory even for two lines, because CI is the surface. **No
172
+ `ui_reviewer`** (nothing renders), no `sec_reviewer`. Ask the reviewer to confirm the `if:` conditions
173
+ survived the move on **both** steps — dropping one would make a step run unconditionally, which is the only
174
+ way a two-line reorder can go wrong.
175
+
176
+ ### Verification
177
+
178
+ Acceptance criterion 2 is the verification: **read the registry.** A green tile is not a publish, and this
179
+ session has now had the publish status misreported in both directions on the same package — once assumed
180
+ published when it was not, once assumed unpublished when it was. `npm view`, every time.
181
+
182
+ ### Register + commit
183
+
184
+ One row, `DX-3`. `done` only with the reviewer's verdict named **and** the registry showing `2.41.2`. Also
185
+ update `DX-2`'s note: it currently reads as fully delivered, and it was not — its publish failed. Leaving
186
+ that uncorrected is how the next person concludes `2.41.2` is available when it is not.
187
+
188
+ ### Mini-handover
189
+
190
+ Repo: `ui-core-micha`, branch `main`. WO: `work-orders/DX-3.md`. Move `Build` above `Run tests` in
191
+ `.github/workflows/publish.yml`, keeping the `if: should_publish` condition on both. Then **ask the operator
192
+ to confirm a `publish.yml` dispatch on `main`** — the workflow's own path filter excludes
193
+ `.github/workflows/**`, so landing the fix does not re-trigger it, and `2.41.2` stays unpublished until
194
+ someone dispatches. Acceptance is `npm view` returning `2.41.2`, not a green tile. Tier 3, `reviewer`
195
+ mandatory. Follow `orchestrate-codex`.
@@ -0,0 +1,207 @@
1
+ # I18N-3 — Backfill Swahili in `messagingTranslations` and restore the four-locale shape test
2
+
3
+ **Target repo:** `ui-core-micha` (branch `main`)
4
+ **Tier:** 3 — shared-core, and it re-tightens a test the estate deliberately loosened.
5
+
6
+ ---
7
+
8
+ ## A. Envelope
9
+
10
+ ### Goal
11
+
12
+ `src/i18n/messagingTranslations.ts` carries **116 keys with `de`/`fr`/`en` and zero `sw`**. Every one of the
13
+ other six bundles carries all four locales:
14
+
15
+ | bundle | de | fr | en | sw |
16
+ |---|---|---|---|---|
17
+ | `auth` | ✓ | ✓ | ✓ | ✓ |
18
+ | `charts` | 12 | 12 | 12 | 12 |
19
+ | **`messaging`** | **116** | **116** | **116** | **0** |
20
+ | `notifications` | 30 | 30 | 30 | 30 |
21
+ | `onboarding` | 27 | 27 | 27 | 27 |
22
+ | `sectionNav` | 3 | 3 | 3 | 3 |
23
+ | `userMenu` | 3 | 3 | 3 | 3 |
24
+
25
+ `I18N-1` hit this while writing its aggregate test: the required "every value keeps its `{de,fr,en,sw}` shape"
26
+ assertion failed, the gap was confirmed as pre-existing rather than caused by the merge, and the operator
27
+ scoped the test down to `{de,fr,en}` with the backfill recorded as a follow-up. **The follow-up was never
28
+ written, and a scoped-down test tends to stay scoped down.** That is what this WO closes.
29
+
30
+ ### Scope
31
+
32
+ 1. **`src/i18n/messagingTranslations.ts`** — add `sw` to all 116 keys.
33
+ 2. **`tests/i18nAggregate.test.js`** — restore the shape assertion to `{de,fr,en,sw}` and **remove the comment
34
+ recording the scope-down**, since it no longer describes the state.
35
+ 3. Nothing else. No other bundle is touched; they already conform.
36
+
37
+ ### The translation quality question, which is this WO's real risk
38
+
39
+ **Machine-translated UI strings that nobody on the team can check are a worse outcome than an honest gap.**
40
+ Messaging strings are user-facing and include the kinds of phrase that go wrong invisibly — actions,
41
+ confirmations, error states, relative time. So:
42
+
43
+ - **Name the source of the translations in the register note.** If they are machine-produced, say so plainly
44
+ rather than shipping them as if reviewed.
45
+ - **Flag any key the translator was unsure of** rather than guessing. A `sw` value that is wrong is harder to
46
+ find later than one that is missing, because the shape test will then pass.
47
+ - **Do not invent terminology.** Where `notifications` or `onboarding` already has a Swahili term for the same
48
+ concept — send, reply, unread, conversation, attachment — **reuse their wording** rather than coining a
49
+ second one. Those bundles are the existing precedent and consistency across them matters more than any
50
+ individual phrasing.
51
+
52
+ ### Who this is actually for
53
+
54
+ `sw` is configured as a locale in **hram** and in no other app measured. hram does **not** register
55
+ `messagingTranslations` today, so nothing is currently broken for a user — this is prevention, and the honest
56
+ framing is: it closes an inconsistency and re-arms a test, rather than fixing a live defect.
57
+
58
+ That matters for the effort trade-off, and it is why the quality bar above is not negotiable: there is no
59
+ urgency justifying unreviewed strings.
60
+
61
+ ### Non-goals / do not touch
62
+
63
+ - **The other six bundles.** They conform.
64
+ - **The aggregate itself, the directory ratchet, or the key/value fidelity and collision checks.** Only the
65
+ locale-shape assertion changes.
66
+ - **`de`/`fr`/`en` values.** Not a re-translation pass.
67
+ - **Adding an eighth locale**, or any change to how consumers register strings (`I18N-2`'s territory).
68
+
69
+ ### Risks
70
+
71
+ - **116 unreviewable strings.** The mitigation is disclosure, not confidence — see above.
72
+ - **Re-tightening the test is the irreversible half.** Once the assertion demands four locales, any future
73
+ bundle addition must supply `sw` or fail CI. That is the intent, and it is worth stating so the next person
74
+ adding a bundle is not surprised.
75
+ - **A push to `main` publishes.** See Part C.
76
+
77
+ ### Required tests to WRITE
78
+
79
+ None new — **`tests/i18nAggregate.test.js`'s restored four-locale assertion IS the test**, and re-arming it is
80
+ scope item 2. It will fail until the backfill is complete, which is the correct behaviour and the reason it
81
+ belongs in the same change.
82
+
83
+ Scoped run: `i18nAggregate` plus the messaging export specs. Not the full suite — no dependency or theme
84
+ change.
85
+
86
+ ### Parity guardrail
87
+
88
+ No API, behaviour or visual change for `de`/`fr`/`en` consumers. Purely additive.
89
+
90
+ ---
91
+
92
+ ## B. Implementation map
93
+
94
+ *Filled by the Orchestrator on `git pull` — see `AGENTS.md` → "Work Order".*
95
+
96
+ **Files to change (exactly two):**
97
+ - [`src/i18n/messagingTranslations.ts`](../src/i18n/messagingTranslations.ts) — 118 lines, 116 keys
98
+ (`export const messagingTranslations = { 'Key': { de, en, fr }, ... }`), every value currently a
99
+ 3-locale object. Add a fourth `sw: '...'` to every one, matching the existing key ordering
100
+ `de, en, fr` → append `sw` last (matches the property order already used in
101
+ `notificationsTranslations.ts`/`onboardingTranslations.ts`, both `de, fr, en, sw`, so put `sw`
102
+ last regardless of the de/en/fr internal order already in this file — do not reorder de/en/fr).
103
+ - [`tests/i18nAggregate.test.js`](../tests/i18nAggregate.test.js) — line 30:
104
+ `const REQUIRED_LOCALES = ['de', 'en', 'fr'];` → `['de', 'en', 'fr', 'sw'];`, and delete the
105
+ explanatory comment at lines 27-29 (`// Scoped to the three locales ... see the Notiz on the
106
+ I18N-1 register row ...`) since it will no longer describe the state. Nothing else in this file
107
+ changes — the other three `it()` blocks (aggregate completeness, no-collision, per-bundle
108
+ availability) are untouched.
109
+
110
+ **Existing Swahili glossary to reuse — do not coin alternate wording for these concepts** (grep
111
+ `sw:` across `src/i18n/*.ts` yourself to see full context; this is not exhaustive, check for any
112
+ other overlap you find):
113
+ - Notification/notify → **Arifa** (`notificationsTranslations.ts`, `onboardingTranslations.ts`)
114
+ - Save → **Hifadhi** (`onboardingTranslations.ts`: `Onboarding.SAVE`)
115
+ - Close → **Funga** (`notificationsTranslations.ts`: `PopupSurface.CLOSE`)
116
+ - Continue → **Endelea** (`onboardingTranslations.ts`: `Onboarding.CONTINUE`)
117
+ - Skip → **Ruka** (`onboardingTranslations.ts`: `Onboarding.SKIP`)
118
+ - Change/switch (section) → **Badilisha** (`sectionNavTranslations.ts`)
119
+ - User menu / profile / logout → **Menyu ya mtumiaji / Wasifu / Toka** (`userMenuTranslations.ts`)
120
+ - "Could not be saved/loaded" error pattern → e.g. **"...haikuweza kuhifadhiwa"** /
121
+ **"...haikuweza kupakiwa"** (`notificationsTranslations.ts` `SAVE_ERROR`/`LOAD_ERROR`) — messaging
122
+ has the same error-string shape repeated ~15 times (`... konnte nicht ... werden: {{message}}`),
123
+ reuse this grammatical pattern rather than inventing a new one per key.
124
+ - "Please try again" → **"Tafadhali jaribu tena"** (`onboardingTranslations.ts`)
125
+
126
+ **None of messaging's specific domain terms (conversation, reply, attachment, reaction, poll,
127
+ announcement, unread, archive, mute) exist in the other bundles' Swahili** — those need fresh
128
+ translation. That is expected and fine; the instruction above is narrower: reuse wording only where
129
+ the *same* concept (save/cancel/close/error phrasing/etc.) already has a Swahili rendering
130
+ elsewhere, don't invent a second one for it.
131
+
132
+ **Do-not-touch:** `de`/`en`/`fr` values in `messagingTranslations.ts` (verify byte-identical before
133
+ and after — a diff review will check this); the other six bundles; `tests/i18nAggregate.test.js`'s
134
+ other three tests, the aggregate export, the directory ratchet, the ordering (`de, en, fr` internal
135
+ order in messaging stays as-is, `sw` only appended).
136
+
137
+ **Progress contract:** `PLAN: …` naming the two files, `PROGRESS: [1/2] backfill sw into
138
+ messagingTranslations.ts … done`, `PROGRESS: [2/2] restore REQUIRED_LOCALES + drop scope-down
139
+ comment in i18nAggregate.test.js … done`, then run the scoped tests named below and report which
140
+ keys (if any) you were unsure of, then `RESULT: DONE`.
141
+
142
+ ## Preamble
143
+
144
+ The text above is the COMPLETE spec — the committed WO file's content, not a plan to refine; there is
145
+ no separate plan file. Read the nearest `AGENTS.md`, the relevant `.codex/skills/<role>/SKILL.md`, and
146
+ the app `MEMORY.md` ONLY for conventions. Stay in scope; do not touch auth/permissions/deps/schema/CI
147
+ unless the spec says so; do not update `MEMORY.md`. **Do NOT edit `WORK_ORDERS.md`** — the register row
148
+ and the review verdicts are the orchestrator's alone. Do NOT `git add`/`commit`/`push` — leave every
149
+ change uncommitted in the working tree for the orchestrator's independent review. This WO's "Required
150
+ tests to WRITE" is explicitly **none new** — the restored `REQUIRED_LOCALES` assertion IS the test;
151
+ run it (and the messaging export specs) to confirm your backfill makes it pass — that is the ONLY test
152
+ run you do (NOT the app's affected/full suite, NOT any review). **State plainly in your final report:
153
+ the source of the Swahili translations (e.g. "machine-translated via <tool>, not reviewed by a fluent
154
+ speaker" — say so honestly, do not imply review that didn't happen) and list any specific key you were
155
+ uncertain of**, per the Envelope's explicit disclosure requirement. The orchestrator re-runs the
156
+ authoritative set + does the independent review after you finish — those are the gate; your own run
157
+ does not count as the gate.
158
+
159
+ Narrate continuously: a `PLAN: <step1> | <step2> | …` line up front, then a single-line
160
+ `PROGRESS: [<n>/<total>] <present-tense action>` before every relevant action (and `… done` on
161
+ completion), spaced so no gap exceeds ~2 min, stdout unbuffered, plus exactly one final
162
+ `RESULT: DONE|BLOCKED <reason>`.
163
+
164
+ ---
165
+
166
+ ## C. Orchestrator only
167
+
168
+ > **STOP — if you are the implementer reading this work order as your own specification, this section is NOT
169
+ > addressed to you. Skip it entirely.** It tells the Orchestrator how to invoke you. **You ARE that
170
+ > invocation — do NOT shell out to `codex exec`, do NOT spawn reviewers, do NOT edit `WORK_ORDERS.md`, and do
171
+ > NOT `git add`/`commit`/`push`.**
172
+
173
+ ### Execution directive
174
+
175
+ Check `.claude/codex-status.md` first. **No line for the current date means use Codex.** A dated `unavailable`
176
+ line for today means skip the attempt, implement directly in Claude and name the record — that flips
177
+ authorship. Otherwise one probe, outcome written back either way.
178
+
179
+ ### Review routing
180
+
181
+ Tier 3: **independent `reviewer`** — mandatory. Ask it specifically to check **terminology consistency against
182
+ `notifications` and `onboarding`**, and to confirm that no `de`/`fr`/`en` value was altered in passing. **No
183
+ `ui_reviewer`** — nothing renders. No `sec_reviewer`.
184
+
185
+ Neither reviewer can validate Swahili. **Say that in the note** rather than letting a clean verdict imply the
186
+ translations were checked.
187
+
188
+ ### Verification
189
+
190
+ The restored four-locale assertion passing is the verification. Nothing renders, so no gate.
191
+
192
+ **A push to `main` here IS the npm publish** — `publish.yml` triggers on `push: branches: [main]` with `src/**`
193
+ in its paths, and publishes cannot be undone. Additive strings, so a **patch** by scope.
194
+
195
+ ### Register + commit
196
+
197
+ One row, `I18N-3`. `done` only with the reviewer and verdict named, **the translation source stated**, and any
198
+ uncertain keys listed. Also update `I18N-1`'s note: its recorded follow-up is now closed, and leaving it open
199
+ there is how the same gap gets rediscovered.
200
+
201
+ ### Mini-handover
202
+
203
+ Repo: `ui-core-micha`, branch `main`. WO: `work-orders/I18N-3.md`. 116 `sw` values into
204
+ `messagingTranslations.ts`, then restore `i18nAggregate.test.js` to `{de,fr,en,sw}` and drop the scope-down
205
+ comment. **Reuse `notifications`/`onboarding` terminology; disclose the translation source; flag uncertain
206
+ keys instead of guessing.** No app is broken today — this closes an inconsistency and re-arms a test. Tier 3,
207
+ `reviewer` mandatory. **Pushing to main publishes.** Follow `orchestrate-codex`.