Skip to content

Metadata API saves a translation of an unknown key as valid #38623

Todo

Description

@objectstack-fleet

repo:objectstack#1 · zhuangjianguo · session_01QsR2jTsdScTh3o2fSjbxSz

Found while testing PR #38619 (#37087 PR 2; os-dev report 7257975783, out-of-scope finding 1). Class c: the two doors that judge a translation item disagree.

The defect

On examples/app-showcase, as an administrator: PUT /api/v1/meta/translation/NAME?mode=draft&package=PKG, then publish. A translation item naming a key that does not exist (for example apps.studio.navigation.nav_public_forms.label, removed by #38619) saves and publishes with _diagnostics.valid: true, exactly like one naming a live key, and translates nothing. The project lint refuses the same item with translation-target-unknown, before and after #38619. So the environment's metadata door judges no translation targets, while the files' door does: an author working in Studio or over MCP gets no word that the item does nothing.

Done when

  • The environment's save (and publish) of a translation item reports an unknown target the way the lint does, as a diagnostic on the save answer, with a case for a removed key and one for a live key.
  • If refusing outright is chosen over a diagnostic, say why in the PR; a published item that names a key removed by an upgrade must still load.

Dedupe words: translation-target-unknown, runtime translation save, metadata API translation diagnostics.

Activity

  1. added
    pm:queue
    domain:server
    on Nov 29, 2026
  2. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · zhuangjianguo · session_01QsR2jRH2X4frz9bBiZHNk4

    Triage: lands in the environment's translation save/publish judgment (metadata-protocol), reporting translation-target-unknown as the lint does · area:build (area added) · domain:server · Bug · p2 (was p3) · pm:queue · size S. Rationale: wrong metadata saved over the metadata door (Studio, MCP) is accepted as valid and silently does nothing, while the files' door refuses it; that misses the Building core feature "wrong metadata is loudly refused with a prescription", and it is the class (c) trap for an AI author. Reproduced on examples/app-showcase.

  3. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-steve · session_01ADHkmSwS4mQyXWrddL4r6B

    Claim: PM loop round 1
    Session: session_01ADHkmSwS4mQyXWrddL4r6B
    Account: os-steve
    Branch: claude/issue-38623-translation-target-door
    Worktree: objectstack-issue-38623
    Domain: domain:server
    Seat: repo:objectstack#3
    Area: o3-B
    File surface: packages/lint/src/reference-integrity-suite.ts (the validateTranslationReferences member's runtimeTypes and its comment, ~710), packages/lint/src/runtime-gate.ts (the per-write snapshot a translation write carries, and how the door reports this rule's finding), packages/lint/src/validate-translation-references.ts (only if the rule needs a door-mode reading), packages/metadata-protocol/src/** (only the snapshot assembly for a translation write, if the context must carry more), NEW test files named for this card in packages/lint/src/ and packages/metadata-protocol/src/, root .changeset/38623-*.md (stop on breach; explain in the report)
    Container & model: S, mode:subagent, model: default tier (dispatch-gates --tier: "no path-derived mandate"), effort: high (reason: S per triage, but the door's per-write snapshot and its refuse-or-advise split need measuring, treated as M per 定档)
    Clause-②: no
    Metadata-protocol: none
    Responsibility: objectstack's runtime publish door never dispatches validateTranslationReferences for a translation write (reference-integrity-suite.ts:710 declares no runtimeTypes, so it keeps the ['flow'] default) | the files' door (os validate) already reports translation-target-unknown | every author who saves a translation over the metadata API (Studio, MCP); reproduced by triage on examples/app-showcase
    Thread-read: 7258193756
    Premise: holds (read-only check on origin/main c801993: the member at reference-integrity-suite.ts:710 has no runtimeTypes; RuntimeStackContext (runtime-gate.ts:389) carries objects / permissions / books / datasets; the door refuses error findings and reports warning / info ones as advisories (runtime-gate.ts:799-801, :1569-1570))
    Pre-claim lane: domain:server (file ownership only): packages/metadata-protocol/**; packages/lint/** is domain:spec by the anchoring rule
    Pre-claim deps: none named
    Prior rulings read: check-prior-rulings --card 38623 over the three lint paths and metadata-diagnostics.ts → 0 ruling comments on the thread; surface grep names #9612 (closure objects) and #19542 (runtimeTypes widening needs its own false-positive measurement, the #4716 budget), both read as constraints; ADR hits (ADR-0054 §3, ADR-0068 D4, ADR-0156 D3 …) carry no translation-door ruling
    Fold-or-serial: serial. rule-explanations.ts is not on this surface. #38630 (this zone, in flight) touches packages/lint in other files.
    Serial constraints cleared: #38630 (claim 7259951942) shares no file. check-handover --inflight OVERLAP with seat 1's #37766 (claim 7255693079 names reference-integrity-suite.ts; no open PR found) and #35143 (claim 7256659340, packages/lint/**; its PR #38594, open draft, edits packages/lint/src/runtime-gate.ts). The dev bases on the newest origin/main, runs overlap-check.mjs before each push, and queues behind PR #38594 on exit 1.

  4. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 29, 2026
  5. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-steve · session_01ADHkmSwS4mQyXWrddL4r6B
    os-dev-report

    {
      "issue": 38623,
      "status": "blocked",
      "branch": "claude/issue-38623-translation-target-door",
      "pr": null,
      "session": "session_01ADHkmSwS4mQyXWrddL4r6B",
      "premise_still_valid": true,
      "summary": "Blocked on a FILE-SURFACE BREACH, found before any edit: no commit, no PR, branch pushed empty at c8019932f5. A translation write cannot reach validateTranslationReferences without editing packages/lint/src/authoring-rules.ts, which is not on the claim's surface: the gate picks entries by the ENTRY's runtimeTypes (runtimeAuthoringRulesFor, runtime-gate.ts:813-817), and the validateReferenceIntegrity entry at authoring-rules.ts:1449 lists flow, view, object, dataset, report, page, action. Without translation there, no member-level runtimeTypes (reference-integrity-suite.ts:710) is ever consulted. Five existing pins (not new files) also hold translation ungated, as the ADR-0049 group B control. The premise holds and was reproduced at the door (tests field). Measured as the ruling asked: the member unchanged at the door's snapshot gives 85 false findings on the showcase bundle against 0 whole-stack. Restricted to the families the door can see, both counts are 0. Design ready for re-dispatch: open_questions.",
      "tests": "No repo test was written or run: stopped before the first edit. Readings from a scratch script (tsx, not committed) on origin/main c8019932f5, run against the door's real pure function evaluateRuntimeAuthoringGate (the function saveMetaItem calls for an active save or publish) and the real rule: (1) runtimeAuthoringRulesFor('translation') = []. (2) Door, state active, translation item zh-CN with objects.showcase_project.fields.zzz_removed_field = {error:null, advisories:[]}. The same with apps.studio.navigation.nav_zzz_removed = {error:null, advisories:[]}. (3) Whole-stack validateTranslationReferences over the showcase stack with the same keys as a bundle: error translation-target-unknown at translations[0][zh-CN].objects.showcase_project.fields.zzz_removed_field; and for the apps key, error at translations[0][zh-CN].apps.studio (the APP, not the nav id; see out_of_scope_findings). (4) False positives on the showcase's real ShowcaseTranslationBundle (en + zh-CN), whole-stack vs per-write. Whole-stack: 0 findings. Per-write, member unchanged, snapshot = objects/permissions/books/datasets (what RuntimeStackContext carries): 85 translation-target-unknown, all false. By family: objects._views 28, objects._sections 19, positions 10, flows 10, dashboards 6, objects._tabs 4, reports 4, globalActions 2, apps 1, mappings 1. Per-write restricted to the door-visible families (objects.NAME, objects.NAME.fields.FIELD with its options, ._validations, ._milestones, permissions.NAME): 0 false over 287 judged keys; whole-stack in the same families: 0; translation-option-key-unknown per-write: 0. Ablation: not reached (nothing built).",
      "gates": "None run: no diff. dispatch-gates --commands not derived (no changeset, no change set). overlap-check not run: nothing pushed beyond the empty-branch probe (dev-worktree.sh --probe, PROBE=pushed). Builds for the reading, under os-verify-lock: the metadata-protocol and lint dependency closures (VERDICT command-exit 0, 106s), and the showcase dependency closure with OS_SKIP_DTS=1 (VERDICT command-exit 0, 61s). CI: no PR, so no check-runs.",
      "dogfood_battery": "n/a — no PR, no `!` in a title, no (narrowing) arm",
      "mcp_calls": "0",
      "api_writes": "1 — POST repos/objectstack-ai/objectstack/issues/38623/comments (this os-dev-report, through post-stamped.mjs). Also git push of the empty probe branch (not a REST write).",
      "line_budget": "n/a — no diff",
      "files_changed": [],
      "deviations": [
        "Stopped on a file-surface breach before writing code (dispatch: stop on any breach). Exact lines the surface needs, besides the claim's own: (1) packages/lint/src/authoring-rules.ts:1449, the validateReferenceIntegrity entry: `runtimeTypes: ['flow', 'view', 'object', 'dataset', 'report', 'page', 'action'],` must gain 'translation', plus its paragraph in the comment block at 1308-1448. (2) packages/lint/src/authoring-rule-wiring.test.ts:459 `expect(runtimeAuthoringRulesFor('translation')).toEqual([]);` (the 'a type nobody gated' control): the control type has to move, e.g. to 'tool'. (3) packages/lint/src/runtime-gate.test.ts:185 `runRuntimeAuthoringRules({ type: 'translation', item: { name: 'x' } })` expects rulesRun []: same move. (4) packages/lint/src/runtime-gate.test.ts:227 `buildRuntimeWriteSnapshots({ type: 'translation', ... })).toBeNull()`: goes non-null once TYPE_TO_STACK_KEY maps translation, so it needs an unmapped type. (5) packages/lint/src/runtime-gate.inert-type-writes.test.ts:1040 and (6) packages/lint/src/runtime-gate.datasource-writes.test.ts:365: both `expect(runtimeAuthoringRulesFor('translation')).toEqual([]);`, with comments naming translation the standing ungated control that ADR-0049 group B 'reads first'. These six are the ones a source read finds; a test run after the widening may find more, notably in the metadata-protocol translation-bundle tests.",
        "Two lock-held builds were taken for this reading only (they are not verification of a diff); one used OS_SKIP_DTS=1, so the shared turbo cache may now hold DTS-less dist entries for the showcase closure."
      ],
      "open_questions": [
        {
          "question": "Amend the claim's file surface so the translation crossing can land as ruled (advisory, door-visible families only)?",
          "options": [
            "A — amend the surface with the six lines in deviations and re-dispatch on this branch. Design, measured above, none of it built yet: (i) TYPE_TO_STACK_KEY gains translation: 'translations' (runtime-gate.ts). (ii) The member at reference-integrity-suite.ts:710 gains runtimeTypes ['flow', 'translation'] and passes a door-mode option read off ctx.runtimeWriteType. That is the existing door-reading mechanism (wholeCollection / atSaveDoor / liveUniverse in the same suite, authoring-rules.ts:1782), with the context-chosen severity of one rule id that validateChartBindings already uses (validate-chart-bindings.ts:452). (iii) In door mode the rule reads a translations entry that carries a string locale as one item (no locale segment in its path; name-keyed on the wire). It judges only objects.NAME (and only when no package closure narrowed objects, because the i18n layer is process-wide and not package-scoped), fields and their options, _validations, _milestones and permissions.NAME. It emits warning, so the finding lands in advisories (runtime-gate.ts:1569-1570) and never 422s. It skips every other family: _views, _sections, _tabs, _actions, _relatedLists, apps, globalActions, dashboards, forms, pages, picklists, positions, reports, mappings, books (implicit per-package book), flows, hooks. Cost: no new sys_metadata read, about M effort with pins and ablation.",
            "B — A plus carry served apps for translation writes: the registry's app read applies nav contributions (objectql registry-apps.ts:70), platform apps included. That would let the door judge the card's own family (apps.NAME.navigation.ID) more truly than the lint, which reports the platform studio app itself as unknown. Cost: a RuntimeStackContext key and a host gather in metadata-protocol, one indexed read on every translation publish, and more off-surface pins (derived-context-keys and others), with its own false-positive measurement.",
            "C — Hold. Leave translation ungated until the ADR-0049 group B reading card the existing pins name has run, and treat this report's measurement as that reading."
          ],
          "recommendation": "A. Business need: a real orphan class (removed or renamed fields and rules, dropped permission sets) is told at the save that Studio, MCP and AI authors use, measured at 0 false positives on the shipped bundle. Long-term soundness: one registry and one existing door-reading pattern; no second rule list, no consumer fallback. AI-error prevention: an advisory for exactly what the door can see, and never a guessed unknown. Startup focus: no snapshot widening and no new read. The apps family (B) is deferred, and the PR would name the judged families. The seat should still confirm that this card is the ADR-0049 group B 'read first' carrier the pins cite (#19542: 'translation / tool are read first under two more'), because widening ends that standing control."
        }
      ],
      "security_findings": "none",
      "out_of_scope_findings": [
        "class: a · reach: rule-level reading only, via validateTranslationReferences, which os validate runs; NOT run through the os validate CLI. Over the composed showcase stack a bundle key apps.studio... is refused translation-target-unknown at the APP level (path translations[0][zh-CN].apps.studio), for any nav id, live or not. studio is a platform-provided app (packages/platform-objects/src/apps/studio.app.ts), so the lint's apps rung has no platform-app ladder (the objects rung has isPlatformProvidedObjectName). The card's 'lint refuses the same item before and after #38619' reads this app-level verdict, not a judgement of nav_public_forms, which is LIVE on origin/main c8019932f5 (studio.app.ts:322) while #38619 is open. Needs a CLI repro before filing · dedupe words: translation-target-unknown platform app, apps.studio translation orphan, platform-provided app ladder"
      ]
    }
  6. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-steve · session_01ADHkmSwS4mQyXWrddL4r6B

    Waiting · 2026-11-29T18:38Z · zone o3-B · The dev stopped before any edit (report 7260622326). Crossing translation onto the door means editing the validateReferenceIntegrity entry's runtimeTypes (packages/lint/src/authoring-rules.ts:1449) and five pins that hold translation as the standing ungated control. The pins cite #19542: "translation / tool are read first under two more. Each has its own carrier." Whether this card is that carrier, and so which route it takes (A: door-visible families as an advisory; B: A plus served apps; C: hold), is with the seat repo:objectstack#3 from this stroke. The claim stays until the seat answers; no PR is open.

  7. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-steve · session_01ADHkmSAjFEZHRpRq3WCj6z

    Seat reading of the claim-gate stop (dev report 7260622326), 2026-11-29T18:39Z: no prior-ruling conflict, route A.

  8. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-steve · session_01ADHkmSwS4mQyXWrddL4r6B

    Claim amendment · 2026-11-29T18:40Z · zone o3-B · File surface only; every other claim line stands. Route A per the seat's reading 7260663888.
    File surface (added): packages/lint/src/authoring-rules.ts (the validateReferenceIntegrity entry's runtimeTypes at ~1449 gains translation, plus its paragraph in the comment block ~1308-1448); packages/lint/src/authoring-rule-wiring.test.ts (~459), packages/lint/src/runtime-gate.test.ts (~185, ~227), packages/lint/src/runtime-gate.inert-type-writes.test.ts (~1040) and packages/lint/src/runtime-gate.datasource-writes.test.ts (~365): each control that pins translation as ungated moves to a type that stays ungated (not tool's own control, which stays), and the PR names each move. Any further pin that a run after the widening turns red is reported line by line before it is edited.
    Reason: the door selects rules by the entry's runtimeTypes (runtime-gate.ts:813-817), so the member-level declaration alone never runs. The seat reads this card as the translation carrier that ruling 5754204885 on #19275 names, with the dev's measurement as its reading.

  9. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-steve · session_01ADHkmSwS4mQyXWrddL4r6B

    Claim amendment 2 · 2026-11-29T19:00Z · zone o3-B · File surface narrowed; amendment 7260681542 stands.
    File surface (narrowed): packages/metadata-protocol/src/** is withdrawn. Route A needs no metadata-protocol source change, since the snapshot is not widened. What remains there is ONE new test file named for this card (packages/metadata-protocol/src/*38623*.test.ts), and only if the save-and-publish pins live in that package. The lint lines of the claim and of amendment 7260681542 are unchanged.
    Reason: the earlier directory-wide line met zone o3-P's #38595 claim and its PR #38642 (package-namespace-rename*.ts). The dev runs overlap-check.mjs against #38642 and #38594 before each push, and queues behind either on a real overlap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:builddomain:serverpm:dispatchedpriority:p2

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions