5.4 KiB
phase, reviewed, depth, files_reviewed, files_reviewed_list, findings, status
| phase | reviewed | depth | files_reviewed | files_reviewed_list | findings | status | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 14.2.1-translate-plugin | 2026-10-06T14:35:40Z | standard | 18 |
|
|
clean |
Phase 14.2.1: Code Review Report
Reviewed: 2026-10-06T14:35:40Z Depth: standard Files Reviewed: 18 Status: clean
Summary
Standard-depth re-review of the Plan 05/06 gap closure (CR-01 hydration + WR-02 relation-child lift). Source was read directly; plan SUMMARYs were not treated as evidence. classes.TranslatedExact in the plugin (callee of AdminWriter.TranslatedExact) was traced for D-11 only.
All reviewed files meet quality standards. No issues found. The eight look-fors from this pass are closed in code:
| Look-for | Result |
|---|---|
D-11 fallback leaking into TranslatedExact / hydrateMLRecord |
Closed. hydrateMLRecord calls TranslationWriter.TranslatedExact only for non-default codes and writes "" when ok is false. AdminWriter.TranslatedExact delegates to classes.TranslatedExact, which returns the stored key or ok=false and never the host column. classes.Translated (D-11) is not on this path. TestMLHydration english-only row yields pl: "". |
Nested maps dropped on fillChild |
Closed. CreateChild / UpdateChild call liftMLValues on in.Body before fillChild, so the default locale is a host scalar by the time projectOperation → ProjectWritableFields runs. applyMLTranslations runs after the child PK. TestRelationChildMLNestedSave asserts host Hello, Polish attrs, and de 422 with no insert. fillChild itself is only used from those two callers. |
| List-row hydration leaking translations | Closed. hydrateMLRecord is called from CRUDService.ShowRecord / save and RelationService Create/Update/Show child only. ExecuteList → projectRow is unchanged. listSchema Localize sets FormMeta{Locale: locale} with no EnabledLocales. Relation linked/candidate queries select host columns. |
| Cabana importing the plugin | Closed. Cabana has no sm-translate import. crud() and relations() both Lookup[TranslationWriter](). Plugin AdminWriter implements the framework interface. |
| New routes | Closed. Plan 05/06 reuse existing form/relation-schema, record, and child record routes. No translate-read or translate-write endpoint. |
| Locale validation bypass | Closed. liftMLValues still rejects unknown codes, non-strings, and a missing default locale as 422 before Fill. Child saves use the same helper inside the child transaction. |
SPA selector not using FORM_ENABLED_LOCALES |
Closed. MLTextField / MLMarkdownField inject FORM_ENABLED_LOCALES and list those codes. They no longer derive options from Object.keys(value) or hardcode ['en'] as the option list. FormView provides the inject from schema.meta.enabledLocales; RelationChildModal re-provides the parent inject. |
adopt wiping sibling locales |
Closed. FormView.adopt and RelationChildModal.adopt call mergeMLValue. A map overlays the seeded {code: ""} object. A leftover host string becomes the first enabled code and keeps sibling keys. Create seeds via initialValues(fields, enabledLocales). |
WR-01, WR-03, and IN-01..IN-04 were out of scope for this closure and were not re-opened. Host CRUD still calls liftMLValues on s.DB before s.transaction (same as the prior WR-01 note); the child path now reads locales on tx, which is not a regression.
Prior findings resolved
CR-01 (resolved): Admin ML fields never surface enabled locales on create, load, or save
Fixed in Plan 05, confirmed in source:
FormMeta.EnabledLocales(schema_types.go) is copied onto protect()'d form schemaview.Metaand the envelope, and onto relation-schema envelope meta (http.goformSchema/relationSchema/enabledContentLocales).CRUDService.ShowRecordandsaverunhydrateMLRecordafterprojectFullRecord(crud.go).- SPA create seeds
{[code]: ""}; selectors readFORM_ENABLED_LOCALES;adoptmerges throughmergeMLValue(formState.ts,FormView.vue, both ML field components,RelationChildModal.vue).
WR-02 (resolved): Relation-child saves drop nested ML maps
Fixed in Plan 06, confirmed in source:
RelationService.writeris the same unexportedTranslationWriterLookup asCRUDService(relation.go,http.gorelations()).CreateChild/UpdateChild:liftMLValues→fillChild→ row write →applyMLTranslations→hydrateMLRecord.ShowChildhydrates with op"update".TestRelationChildMLNestedSavecovers create, update, show, and undeclaredde.
Narrative Findings (AI reviewer)
None.
Reviewed: 2026-10-06T14:35:40Z Reviewer: the agent (gsd-code-reviewer) Depth: standard