Skip to content

Commit 68fe133

Browse files
committed
docs(localization): define in-place authoring refresh
1 parent a6bb5d7 commit 68fe133

4 files changed

Lines changed: 91 additions & 73 deletions

File tree

‎rfcs/0024-localization-runtime-and-coverage.md‎

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ flowchart TB
124124
direction LR
125125
SURFACE_CHECK["localization:surfaces:check"]
126126
CATALOG_CHECK["CI job: localization-catalogs<br/>catalogs:check / catalogs:detect"]
127-
REFRESH["Localization Catalog Refresh<br/>generated PR"]
127+
REFRESH["Localization Catalog Refresh<br/>same PR when possible • generated PR fallback"]
128128
OWNER_FLOW["owner pipeline<br/>check + refresh"]
129129
RESULT["Owner renderer + coverage evidence<br/>machine semantics unchanged"]
130130
end
@@ -160,34 +160,38 @@ path with an actual message:
160160

161161
```mermaid
162162
flowchart TB
163-
EN["1. Author opens an English-only source PR<br/><code>src/wizard/i18n/catalogs/en.json</code><br/><code>wizard.completion.enable</code>"]
164-
DETECT["2. Credential-free PR checks detect drift<br/><code>localization:surfaces:check</code> confirms ownership<br/><code>localization:catalogs:detect</code> reports zh-CN + zh-TW stale"]
165-
MERGE["3. Maintainer merges the reviewed English PR<br/>protected <code>main</code> now contains the exact source revision"]
166-
REFRESH["4. That trusted <code>main</code> push starts<br/><code>Localization Catalog Refresh</code><br/>provider credentials are available only here"]
167-
GENERATED["5. Automation opens a generated translation PR<br/><code>generated/zh-CN.json</code> + <code>generated/zh-TW.json</code><br/>source revision + provider/model evidence"]
168-
CHECK["6. Generated PR runs strict checks and review<br/><code>localization:catalogs:check</code><br/>keys • ICU • placeholders • protected literals"]
169-
SHIP["7. Generated PR merges and owner artifact ships<br/>the catalog becomes available to that surface"]
163+
EN["1. Author opens a ready English source PR<br/><code>src/wizard/i18n/catalogs/en.json</code><br/><code>wizard.completion.enable</code>"]
164+
DETECT["2. Credential-free PR gate fails on drift<br/><code>localization:surfaces:check</code> confirms ownership<br/><code>localization:catalogs:detect --fail-on-drift</code> names zh-CN + zh-TW"]
165+
ACTION["3. Maintainer runs <code>Localization Catalog Refresh</code><br/>against that PR's exact head<br/>trusted <code>main</code> tooling owns provider credentials"]
166+
UPDATE["4. Automation commits translations to the same PR<br/><code>generated/zh-CN.json</code> + <code>generated/zh-TW.json</code><br/>an exact-head lease rejects a moved branch"]
167+
CHECK["5. The same PR reruns strict checks and review<br/><code>localization:catalogs:check</code><br/>keys • ICU • placeholders • protected literals"]
168+
MERGE["6. A maintainer merges the complete review unit<br/>same-repo: English + translations together<br/>fallback: generated follow-up after English"]
169+
SHIP["7. The owner artifact ships<br/>the catalog becomes available to that surface"]
170170
RENDER["8. The owner renders at its presentation edge<br/><code>LocalizationContext(locale = zh-CN)</code><br/>为 openclaw 启用 zsh shell completion?"]
171+
FORK["Fork or cross-repository source PR<br/>merge reviewed English first<br/>trusted <code>main</code> refresh opens one generated follow-up PR"]
171172
FAIL["Failure or rejection<br/>publish nothing • English fallback stays live<br/>target cells remain partial and visible"]
172173
173-
EN --> DETECT --> MERGE --> REFRESH --> GENERATED --> CHECK --> SHIP --> RENDER
174-
REFRESH -. generation or validation fails .-> FAIL
174+
EN --> DETECT --> ACTION --> UPDATE --> CHECK --> MERGE --> SHIP --> RENDER
175+
EN -. cannot update source branch .-> FORK --> CHECK
176+
ACTION -. generation or validation fails .-> FAIL
175177
CHECK -. checks or review reject .-> FAIL
176178
```
177179

178180
| Point in the path | Actual value |
179181
| --- | --- |
180182
| English source PR | `"wizard.completion.enable": "Enable {shell} shell completion for {cli}?"` |
181-
| PR detection | `zh-CN/wizard-core` and `zh-TW/wizard-core` are stale |
182-
| Trusted trigger | Merge of the registered English source path to protected `main` |
183-
| Generated translation PR | `"wizard.completion.enable": "为 {cli} 启用 {shell} shell completion?"` plus source-pinned evidence |
184-
| Shipped runtime output | After the generated PR merges and the owner artifact ships, `t("wizard.completion.enable", { shell: "zsh", cli: "openclaw" })` → `为 openclaw 启用 zsh shell completion?` |
183+
| PR gate | Fails with `zh-CN/wizard-core` and `zh-TW/wizard-core` stale |
184+
| Trusted action | Maintainer dispatch against the ready same-repository PR's resolved exact head |
185+
| In-place update | `"wizard.completion.enable": "为 {cli} 启用 {shell} shell completion?"` plus source-pinned evidence is committed to the source PR |
186+
| Shipped runtime output | After that PR merges and the owner artifact ships, `t("wizard.completion.enable", { shell: "zsh", cli: "openclaw" })` → `为 openclaw 启用 zsh shell completion?` |
185187

186188
The checked-in `zh-CN` exemplar is marked `bootstrap-reviewed` with a human
187-
provider. The first credentialed post-merge refresh is therefore still a
189+
provider. The first credentialed in-place refresh is therefore still a
188190
supervised rollout gate. Once that gate succeeds, no contributor manually
189-
creates the translation PR: the English merge triggers the trusted refresh and
190-
generated-PR publisher. The same control loop applies to every one of the 15
191+
creates translation commits: the failing check tells them to request the
192+
trusted action, automation updates the same branch, and the check turns green.
193+
Fork and cross-repository sources use the post-merge generated-PR fallback.
194+
The same control loop applies to every one of the 15
191195
product surfaces, but not necessarily through the same files or workflow name:
192196
Control UI, native, and docs keep their conforming owner workflows.
193197

@@ -272,16 +276,19 @@ translation system for every slice:
272276
1. Land the locale/context/runtime foundation and one real consumer.
273277
2. Enroll one owner surface by updating its source, inventory, catalog or
274278
conforming-pipeline disposition, and owner guidance in the same slice.
275-
3. Run credential-free detection on ordinary pull requests.
276-
4. Let the trusted owner workflow generate candidate catalogs and open a
277-
generated pull request.
279+
3. Run credential-free detection on pull requests; fail a ready
280+
same-repository PR when its adopted source makes targets stale.
281+
4. Let the maintainer-authorized owner workflow update that same PR from
282+
trusted tooling, or open one post-merge generated PR when it cannot update
283+
the source branch.
278284
5. Validate keys, placeholders, protected literals, provenance, formatting,
279285
fallback, and required human review.
280286
6. Land the source and generated artifacts, then update the coverage report.
281287

282-
A source PR may be separate from its generated-catalog PR, but the adoption
283-
slice is not complete until both land with required review. Translation
284-
credentials never run against untrusted pull-request code, and AI-generated
288+
The source and generated catalogs normally share one PR. Fork and
289+
cross-repository paths may use a separate generated-catalog PR, but the
290+
adoption slice is not complete until all required artifacts and review land.
291+
Translation credentials never run against pull-request code, and AI-generated
285292
copy never approves itself.
286293

287294
The current source audit contains 47 projected slices grouped into 16

‎rfcs/0024/implementation-plan.md‎

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,11 @@ reporting begin later in `E43`; review evidence and release promotion follow in
5353
The five runtime PRs do not prove the reusable CI and translation-authoring
5454
loop. OpenClaw PR
5555
[#112784](https://github.com/openclaw/openclaw/pull/112784) implements `G45`
56-
and `G46` together: change one routine English source message, observe
57-
credential-free CI detect the stale targets, merge the reviewed English source,
58-
then observe that trusted `main` push run asynchronous generation and validation
59-
and open a generated pull request. Later owners adopt that lane only for their
56+
and `G46` together: change one routine English source message, observe the
57+
credential-free ready-PR gate fail on stale targets, run the maintainer-authorized
58+
refresh against the exact PR head, and observe automation update that same PR so
59+
strict validation can turn green. Fork and cross-repository sources retain the
60+
trusted post-merge generated-PR fallback. Later owners adopt that lane only for their
6061
declared families, namespaces, or directories, with both the scoped gate and
6162
owner-owned refresh configured in the same adoption slice.
6263
Its review branch contains `F01`, the exact five-file `F03` ownership delta,
@@ -164,17 +165,18 @@ translation service for every message family.
164165

165166
| Change in an adopted or newly introduced scope | Required enforcement | Boundary |
166167
| --- | --- | --- |
167-
| Add or change a reviewed English catalog key | `G45` credential-free authoring/drift gate | Reject stale targets, invalid ICU, placeholder or protected-literal drift, and hand-edited generated output. |
168+
| Add or change a reviewed English catalog key | `G45` credential-free authoring/drift gate | Fail a ready same-repository PR on stale targets; reject invalid ICU, placeholder or protected-literal drift, and hand-edited generated output. Keep drafts and non-updatable branches advisory. |
168169
| Add a product-facing source registration, file family, or declared source root | `G47` disposition gate | Require adoption, a conforming existing owner pipeline, or a named English-only, platform-constrained, or deferred disposition. |
169170
| Add a raw product-owned literal inside a family, namespace, or narrow directory already declared migrated | Owner-scoped hardcoded-string inventory such as blocking `L10N001` | Block only for the declared migrated scope. `G47` does not heuristically scan every repository literal. |
170-
| Generate or publish a translation candidate | `G46` trusted exact-source workflow | Run only with trusted credentials, validate before publication, and open or update a generated pull request. |
171+
| Generate or publish a translation candidate | `G46` trusted exact-source workflow | Run only protected-base tooling with trusted credentials, validate before publication, then update the exact same-repository PR head or open/update one generated fallback PR. |
171172
| Reuse Control UI, native, or docs automation | Owner-pipeline conformance record | Map its detection, generation, validation, evidence, publication, and review behavior to `G45`/`G46`; do not replace a conforming pipeline. |
172173
| Promote a locale/surface maturity or product claim | `E43`/`E44` aggregation and review evidence | Consume only landed declarations, generated artifacts, and current required review evidence. |
173174

174-
One logical slice may therefore span a source/adoption pull request and a
175-
generated-catalog pull request. Landing only the source half can enroll the
176-
scope, but it does not complete an entry whose exit bar requires generated
177-
artifacts or named language/security review.
175+
One logical slice normally keeps source/adoption and generated catalogs in one
176+
pull request. A fork or cross-repository path may span a source PR and a
177+
generated fallback PR. Landing only the source half can enroll the scope, but
178+
it does not complete an entry whose exit bar requires generated artifacts or
179+
named language/security review.
178180

179181
Stop the slice when no owner can approve stable meaning, no legitimate locale
180182
exists, safety review is missing, stable machine output would change, or the
@@ -191,7 +193,7 @@ Completion names are tracking cohorts, not single PRs or a linear stack:
191193
| Runtime safety | Bounded user-facing runtime and Gateway errors | `F05` and `R16`-`R24` use owner-approved descriptors, edge rendering, and compatible English fallback. |
192194
| Channels and capabilities | Server-rendered channels, command menus, command metadata, and skill/plugin metadata | `M25`-`M36` land each public contract and locale authority independently. |
193195
| Native and docs | Android, Apple, and documentation | `P39`-`P42` extend existing owner pipelines and record the Persian/Thai disposition. |
194-
| Authoring automation | Shared tooling plus each adopting owner | `G45`-`G46` prove scoped deterministic enforcement and trusted generated-PR refresh; `G47` requires a disposition for newly introduced product-string surfaces. |
196+
| Authoring automation | Shared tooling plus each adopting owner | `G45`-`G46` prove scoped deterministic enforcement, trusted in-place refresh, and generated-PR fallback; `G47` requires a disposition for newly introduced product-string surfaces. |
195197
| Release promotion | Product-wide | `E43`-`E44` aggregate only landed scoped evidence and produce an honest release claim. |
196198

197199
### September 1 delivery target
@@ -239,19 +241,19 @@ Provider secrets are never exposed to untrusted pull-request code.
239241
`G45` and `G46` establish the reusable reference path before broad owner
240242
adoption. One routine, non-safety message family must prove:
241243

242-
1. an English source edit is detected on an untrusted pull request without
244+
1. an English source edit is detected on a pull request without
243245
provider credentials;
244-
2. the pull-request check reports the exact stale target catalogs while
246+
2. a ready same-repository pull-request check fails with the exact stale target catalogs while
245247
blocking malformed registration, source, ICU, placeholder, or
246248
protected-literal changes;
247-
3. merging the reviewed English source to protected `main` automatically starts
248-
a trusted exact-source workflow with provider and publisher credentials;
249-
4. that workflow generates locale candidates and opens or updates a separate
250-
generated pull request rather than pushing directly;
249+
3. a maintainer dispatch starts protected-`main` workflow and generator code
250+
against the source PR's resolved exact head, without executing PR-owned code;
251+
4. that workflow generates locale candidates and commits them to the unchanged
252+
source branch under an exact-head lease;
251253
5. strict generated-catalog validation succeeds before publication and records
252254
source-pinned generation evidence;
253-
6. failed or stale generation publishes nothing and leaves the affected cell
254-
partial.
255+
6. failed or stale generation publishes nothing, while fork or cross-repository
256+
sources use one trusted post-merge generated follow-up PR.
255257

256258
The exemplar proves plumbing, not linguistic completion. Its generated output
257259
does not approve itself, and safety families require their stricter owner and
@@ -277,8 +279,8 @@ passes after a valid disposition is added.
277279
After the exemplar lands, every subsequent slice that adds or migrates
278280
deterministic product strings must leave its area enrolled end to end. The PR
279281
defines the adopted family, namespace, or directory; enables its blocking
280-
credential-free gate; and configures the area's trusted asynchronous refresh,
281-
validation, evidence, and generated-PR path. The same slice updates its
282+
credential-free gate; and configures the area's trusted in-place refresh plus
283+
post-merge generated-PR fallback, validation, and evidence. The same slice updates its
282284
checked-in inventory disposition, public contributor workflow index, nearest
283285
owner-internal guidance, and any additional public contract documentation so
284286
the new maintenance contract is usable at merge time. Existing Control UI,

‎rfcs/0024/localization-coverage-v1-spec.md‎

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -384,21 +384,26 @@ The maintenance workflow follows a dependency-guard-style state machine:
384384

385385
| Phase | Trigger | Behavior |
386386
| --- | --- | --- |
387-
| `detect` | English source pull request | Runs without provider credentials. Reports the exact missing targets, stale revisions, fallback, and review drift. It does not publish translations from untrusted code. |
388-
| `refresh` | Trusted `main` push after the source PR merges, schedule, or manual dispatch | Generates candidate translations per locale, validates isolated artifacts, and opens or updates a generated pull request. Failed generation or validation aborts publication. |
387+
| `detect` | English source pull request | Runs without provider credentials. For a ready same-repository PR, fails with the exact missing or stale targets until refresh output is present. Drafts and branches the repository cannot update remain advisory. It never publishes translations from pull-request code. |
388+
| `refresh` | Maintainer dispatch for a ready same-repository PR, or trusted `main` push after a fork/cross-repository source merge | Runs protected-base tooling against an exact source revision, generates and validates all affected locale candidates as one batch, then either commits them to the unchanged source branch under an exact-head lease or opens/updates one generated fallback PR. Failed generation or validation aborts publication. |
389389
| `enforce` | Pull request and release | Blocks invalid catalogs and any `complete` claim whose source, artifacts, or required review are stale. |
390390

391-
The refresh workflow must check out a trusted exact source revision reachable
392-
from a protected base-repository ref, keep provider credentials unavailable to
393-
untrusted pull-request code, and publish through a scoped generated-PR
394-
application identity. Generated changes retain source, glossary, workflow,
395-
provider/model, and catalog-revision provenance.
396-
397-
The normal contributor path needs no manual translation-PR setup: the source
398-
PR records the reviewed English change and drift, then its merge to protected
399-
`main` triggers the trusted refresh and generated-PR publisher. Repositories
400-
may also schedule or manually reconcile drift, but those are recovery paths,
401-
not the ordinary authoring loop.
391+
The refresh workflow must execute workflow and generator code from a protected
392+
base-repository revision. A source PR's registry and English catalogs are read
393+
only as validated data; its scripts, actions, dependencies, and hooks are never
394+
executed with provider or publisher credentials. Before an in-place push the
395+
workflow rechecks that the PR is open, ready, same-repository, and still at the
396+
resolved source SHA, then uses a scoped application identity and an exact-head
397+
lease. Generated changes retain source, glossary, workflow, provider/model,
398+
and catalog-revision provenance.
399+
400+
The normal same-repository path keeps one review unit: a ready source PR fails
401+
the scoped gate, tells the author to request the maintainer-authorized refresh,
402+
receives one bot commit containing every affected target, and reruns to green.
403+
The original author and reviewers remain responsible for the now-complete PR;
404+
automation never approves or merges it. Fork and cross-repository paths merge
405+
reviewed English first, then use one generated follow-up PR. A trusted `main`
406+
refresh also reconciles residual drift as a recovery path.
402407

403408
Detection and enforcement fail closed on malformed manifests, tool failure, or
404409
unreadable required evidence. A failed refresh leaves the prior catalogs and
@@ -407,7 +412,8 @@ maturity state unchanged while reporting the unresolved drift.
407412
The projected delivery registry proves this contract with three explicit slices.
408413
`G45` adds deterministic, credential-free detect/enforce checks for one
409414
owner-declared routine message family. `G46` adds the trusted exact-source
410-
refresh, validation, evidence, and generated-PR path for the same fixture. They
415+
refresh, validation, evidence, in-place update, and generated-PR fallback for
416+
the same fixture. They
411417
may land together in one bounded core/tooling exemplar PR, after which each
412418
surface adopts the checks only for its own declared families, namespaces, or
413419
directories. `G47` adds a build-time disposition gate for newly enumerated
@@ -419,12 +425,12 @@ informative; the state-machine contract above remains normative.
419425

420426
After the exemplar exists, a migrated string-bearing area does not satisfy the
421427
maintenance contract until both phases are wired for its declared scope:
422-
credential-free detect/enforce on pull requests and trusted refresh through a
423-
generated pull request. Existing owner workflows may provide this evidence;
428+
credential-free detect/enforce on pull requests and trusted in-place refresh
429+
with a generated-PR fallback. Existing owner workflows may provide this evidence;
424430
the RFC does not require replacing a conforming pipeline.
425431

426-
The gate may automatically repair missing low-risk catalog entries in a
427-
generated pull request. It must not:
432+
The trusted refresh may repair missing low-risk catalog entries in the source
433+
PR or a generated fallback PR. It must not:
428434

429435
- push generated translations directly to a protected branch;
430436
- promote its own output to `complete`;

0 commit comments

Comments
 (0)