CLI roadmap — handoff (read this in the next session)
Single page for execution order, shared work (generate + fill), locales JSON, and CepatEdge-style identity warnings. Normative specs stay in json/README.md; this file is planning only.
1. Order of execution (locked for next work)
| # | Track | Goal | Phase doc |
|---|---|---|---|
| 1 | locales subcommands | Finish list; add CliJsonEnvelope + COMMANDS_WITH_JSON_OUTPUT for all four subcommands where applicable; fix --json = no stdin prompts (same rules as prompts, cli-json parity). | locales.md |
| 2 | generate + fill (shared) | Per-target targetResults + progress summary in JSON and human final summary after each target (single or multi). Same types in core/progress — one implementation path. | generate.md § Planning |
| 3 | Key observations (keySites) | Typed observations, scan parity, core adoption. Continues in parallel where it does not block (1)–(2). | key-sites.md |
| 4 | Patching / loader | Auto-patch, schema validation, user-project i18n files — after ADR 004 surface; ties to locales edit. | patching/README.md, ADR 004 |
Web (apps/web, i18nprune.dev) can stay on its own cadence; see i18nprune.dev.md. It does not block the CLI order above.
2. Why locales is first
- Several
locales *paths do not emit a stableCliJsonEnvelopeor behave correctly under--json(prompts, stdout hygiene). That breaks the same contract asvalidate/generate/fill. locales listis still a stub — ship read-only listing first (no ADR 004).
Details and acceptance: locales.md (including § Planning — parity with generate/fill/validate).
3. generate + fill — same state, same envelope fields
fillreuses the translation/session pipeline withgenerate; anytargetResults[]/ per-target progress work must land in both commands.- Types: extend
packages/cli/src/types/command/generate/json.tsandfill/json.ts(or a sharedtranslator-sessiontype) sotargetResultsrows share the same progress shape where concepts match (preserved, parity skip, forced run, optional timing). - Human mode: after each target finishes (one or many), emit a final summary line block for that target (aligned with
core/progress), not only one summary at the very end — exact UX is in generate.md § Planning.
4. CepatEdge reference — “translation equals source” guard
Path (author’s machine): ~/Projects/CepatEdge/apps/web/scripts/locales/generate/
Behavior to port (conceptually into i18nprune generate / fill, not a line-by-line copy):
| Concept | Location (CepatEdge) | Intent |
|---|---|---|
| Identity streak | utils/jsonTree.ts — IDENTITY_STREAK_THRESHOLD, maybePauseOnIdentityStreak, onIdentityStreakPause | After N consecutive leaf translations where normalized output === normalized source, pause and warn the user. |
| User choice | promptIdentityStreakPause (prompts) | Continue translating or abort (CepatEdge: IdentityAbortError — no file write). |
| Non-interactive | Map to --yes (auto-continue / skip prompt) or --json (no stdin: either fail with issues[] or documented auto-continue — pick one and match prompts). | |
| Fill | fill.ts uses findEnglishIdenticalPaths + parity | Same family of check: English-identical paths before re-translate; i18nprune already has quality / parity concepts — unify with the new streak warning so generate and fill share one policy. |
Implementation notes:
- Reuse or align with
packages/cli/src/core/languages/rtlHint.ts-style warnings (human-only vs JSON) where applicable. - Add stable issue codes if the envelope reports “aborted after identity streak” or “suspected bad translation run”.
- Do not duplicate docs prose here — when shipped, update commands/generate, commands/fill, issue codes.
5. Checklist for the next implementer
-
locales: implementlist; add--json+ envelope fordynamic,delete,list,edit(or document subset); stdin/prompt rules — locales.md. -
generate+fill: sharedtargetResults/ per-target progress + human per-target summary — generate.md. - Identity streak / same-as-source warning: design flags (
--yes, JSON behavior), then implement in shared translate path used by both commands. -
key-sites: continue foundation work — key-sites.md. - Patching: after loader/ADR plan — patching/README.md.
See also
- active-phase.md — what is “active” today
- README.md — phases hub