Skip to content

spec(data): retire the import mapping lookup transform's steering params (#10329, ADR-0049) - #11280

Merged
os-sam merged 1 commit into
mainfrom
claude/issue-10329-mapping-lookup-params
Aug 23, 2026
Merged

spec(data): retire the import mapping lookup transform's steering params (#10329, ADR-0049)#11280
os-sam merged 1 commit into
mainfrom
claude/issue-10329-mapping-lookup-params

Conversation

@os-sam

Copy link
Copy Markdown
Collaborator

Fixes#10329

Implements the triage ruling (comment 5383458820): option 1 — retire the four inert lookup params (object, fromField, toField, autoCreate) from ImportFieldMappingSchema.params under ADR-0049 enforce-or-remove, with every alias spelling converted to guidance so each of the fifteen spellings lands on a prescription. Option 2 (a second reference-resolution dialect in applyMappingToRows) is not implemented, per the ruling.

Premise re-verification (on origin/main at 064d484bd, pre-fix)

  • The four keys and the alias set were still declared in packages/spec/src/data/mapping.zod.ts (shape lines 165–168; aliases folding lookupObject/targetObject, match/matchOn/matchField/keyField, returnField/valueField, create/createIfMissing/upsert onto them).
  • applyMappingToRows still handles lookup in the same branch as none (packages/rest/src/import-mapping.ts:122-127 — the cell is copied through; the comment defers resolution to the pipeline's metaMap).
  • The liveness mapping.json sub-walk boundary note still recorded the four keys as read by nothing.
  • Repo-wide grep for fromField / autoCreate / the alias spellings outside mapping.zod.ts + its tests returned only unrelated identifiers (sql-driver.tsuniqueIndexesFromFields, tenant.zod.tsautoCreateSchema/autoCreateDatabase, field.zod.ts's own lookupObject → reference alias). Positive control: the same grep instrument finds the real reader of the neighbouring params.valueMap at packages/rest/src/import-mapping.ts:134-136.

premise_still_valid: true.

What changed

  • Schema (packages/spec/src/data/mapping.zod.ts): the four keys are strict-deleted from the params shape (params is a strictObject, so this is the guidance-map route, not retiredKey() — the 17.0.0 #4488 审计发现的四个"授权门断连":email_template / job / validation 的元数据条目到不了执行点,action 导航项点不动 #4509 treatment of extractQuery/errorPolicy/batchSize on this same schema, one level down). PARAMS_RETIRED_KEY_GUIDANCE carries fifteen entries — 4 canonical + 11 ex-alias spellings — each landing on a full prescription (fully-qualified key, why it was inert, the imperative fix, the os migrate meta --from 17 sentence). Per the ruling, the autoCreate guidance says what actually happens: nothing was ever created — an unresolved reference fails the row with import_reference_not_found, with or without the key.
  • ADR-0087 D2 conversionmapping-lookup-params-removed (protocol 18, retiredFromLoadPath: true) strips the four keys from stored mappings[].fieldMapping[].params (pure lossless deletes; drilled two levels down, the metric-filters-removed shape one level deeper; fixture expectedNotices: 4). Wired into the step-18 chain (conversionIds + rationale extended).
  • No RETIRED_KEYS_BY_MAJOR entries — deliberately. These keys sit one sub-walk level below the authorable-surface drill: authorable-surface/data.json records data/ImportFieldMapping:params only (that row stays live), so there is no defKey:name row for the four to register, delete, or age out — gates (a)/(b)/(b2)/(c) never see them. This mirrors how extractQuery/errorPolicy/batchSize left this same schema at 17.0.0 (conversion + guidance, no retired-key table entries). The dispatch's "retired-key entries" default yields to the playbook's route table and this file's own precedent, as instructed.
  • Liveness ledger (packages/spec/liveness/mapping.json): the fieldMapping sub-walk boundary note now records the retirement (strict deletion — nothing dead remains below the drill) instead of parking the finding. Entry stays live; no row deletion (the four never had rows — sub-walk).
  • Docs: the import-mappings.mdx params warning (the callout pointing at spec(data): mapping lookup transform params (object / fromField / toField / autoCreate) are authorable and read by nothing #10329) is deleted — that page's SDK warning is untouched (a batch sibling owns it). content/docs/references/data/mapping.mdx regenerated: the params row now lists only value/valueMap/separator.
  • Tests (mapping.test.ts): refusal pins per key asserting the prescription text (the autoCreate pin asserts "nothing was ever created" + import_reference_not_found), alias-routing pins, and a surviving-surface pin. The old accept-lookup-params tests are replaced.
  • Changeset.changeset/mapping-lookup-params-removed.md: minor per the lockstep launch-window convention (post-17.0.0-cut, prescription registered at protocol 18 — the element-form-retired precedent; check-changeset-no-major green confirms the convention), FROM → TO per key, one-line fix, plus the adr-0087 registered mapping-lookup-params-removed marker.
  • Untouched by design: packages/rest/src/import-mapping.ts (the pass-through stays; its comments never named the four keys, so no comment edit either), content/docs/releases/, skills/** (no diff — the two skill readings are therefore not applicable).

Note: spec-changes.json / the upgrade guide deliberately do not change — PROTOCOL_MAJOR is 17 and the generator folds up to the current major only; the protocol-18 conversions (this one and its step-18 siblings, e.g. metric-filters-removed) enter those artifacts when 18 is cut. check:spec-changes / check:upgrade-guide green.

Reverse verification (from the committed state)

Predicted direction stated before the run: restoring the pre-fix mapping.zod.ts from base 064d484bd must turn the five new refusal/alias pins RED (the keys parse cleanly again, so the expected throws never happen) and leave the surviving-surface pins green. Mutation proven on disk before reading results (grep -c 'autoCreate: z.boolean().optional()' = 1, grep -c PARAMS_RETIRED_KEY_GUIDANCE = 0). Observed: exactly 5 failed / 33 passed. No rebuild leg needed — mapping.test.ts imports ./mapping.zod relatively (src, never through the package exports/dist), so the mutated source is the resolved module by construction. Restore leg: git checkout HEAD -- …, restoration proven on disk (greps invert: 3 / 0), re-run 38/38 green, git status clean.

Verification (all at commit ea258bef9, the head this PR ships; exit codes captured before any pipe, verdicts quoted from the runners' own lines)

  • pnpm --filter @objectstack/spec buildos-verify-lock: VERDICT command-exit 0
  • pnpm --filter @objectstack/spec check:generated — after --fix regenerated the one proved-stale artifact (gen:docs): all runnable gates green (check:authorable-surface ✓ — zero surface change, correct for a sub-walk deletion; check:migration-registry ✓; check:spec-changes ✓; check:upgrade-guide ✓)
  • pnpm --filter @objectstack/spec testTest Files 418 passed (418) · Tests 11118 passed (11118), VERDICT command-exit 0
  • pnpm --filter @objectstack/rest test (after building the rest dependency closure) — Test Files 138 passed (138) · Tests 2201 passed (2201), VERDICT command-exit 0
  • pnpm --filter @objectstack/spec typecheck / pnpm --filter @objectstack/rest typecheck — VERDICT command-exit 0 both
  • node scripts/pm/dispatch-gates.mjs (no paths — the script derived the changeset itself; its stderr attributes the answer to objectstack-ai/objectstack at ea258bef9): 31 path-matched + 6 convention-triggered families derived. All 36 runnable local families run individually with captured exit codes: check-dev-prereqs failed locally only on the fresh-worktree precondition "the workspace is not built" (43 packages without dist — an environment fact, not a diff finding; CI builds fresh); after turbo run build --filter=./packages/* --filter=./packages/*/* it passes (exit 0), making it 36/36 PASS
  • Convention gates from the test-file edit: check:query-options-erasure, check:type-check-coverage, check:engine-double-contract, check:where-matcher, check:cross-package-test-inputs — PASS; check:type-check-debt (self-test + --re-measure) run after the full packages-closure build — exit 0, PASS
  • pnpm check:nul-bytes — PASS

CI convergence is reviewed by the PM after this report, per the standing dispatch contract.


Generated by Claude Code

…ams (#10329, ADR-0049)
Strict-delete ImportFieldMappingSchema.params' object/fromField/toField/
autoCreate — declared to steer the lookup transform, read by nothing: lookup
copies the cell through and reference resolution runs off the target field's
own metadata. All fifteen spellings (four canonical + eleven ex-aliases) land
on guidance prescriptions; D2 conversion mapping-lookup-params-removed
(protocol 18) strips the keys from stored sources; liveness sub-walk note
records the retirement; docs warning deleted; changeset with FROM->TO.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RadETjNRLALFLhFA3xehZP
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/spec, touching 27 documentable anchor(s).

17 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: node scripts/docs-audit/affected-docs.mjs --json 050d8d8685312ee6a0a77bd9036becf30750fd31.

3 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails.

What this run could not see
  • 1 changed file(s) yielded no anchor (packages/spec/liveness/mapping.json) — pages documenting those are invisible to this run
  • 9 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 45 of 221 client-bound route-ledger rows — the other 176 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run: node scripts/docs-audit/affected-docs.mjs --bridge-coverage

Coarse fallback — 126 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 050d8d8685312ee6a0a77bd9036becf30750fd31packageMentionDocs.

Which tree this was computed on

This run read content/docs from 56dffce3d7c625c473d07b8aaa4968c8dc84dd8a — the merge of head ea258bef9fdea9fa52d0f650b0edbfa0052cda44 into base 050d8d8685312ee6a0a77bd9036becf30750fd31, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 56dffce3d7c625c473d07b8aaa4968c8dc84dd8a && git checkout 56dffce3d7c625c473d07b8aaa4968c8dc84dd8a
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 050d8d8685312ee6a0a77bd9036becf30750fd31 ea258bef9fdea9fa52d0f650b0edbfa0052cda44 && git checkout -B drift-repro 050d8d8685312ee6a0a77bd9036becf30750fd31 && git merge --no-ff ea258bef9fdea9fa52d0f650b0edbfa0052cda44
node scripts/docs-audit/affected-docs.mjs --json 050d8d8685312ee6a0a77bd9036becf30750fd31

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 050d8d8685312ee6a0a77bd9036becf30750fd31 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@github-actions

Copy link
Copy Markdown
Contributor

⛔ merge queue 构建失败 — 先分诊,再决定要不要重排

队列构建 32629757073 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集),
所以失败的测试可能在本 PR 没碰过的包里 —— 那不是重排能修的。每次盲目重排都会让排在后面的所有 PR 重建一轮。

失败的 job(日志抽取,best effort):

  • Dogfood Verify CLI — 失败步骤: Verify pnpm version

    AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:
    
  • Test Core (4/6) — 失败步骤: Verify pnpm version

    AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:
    

↳ 失败原因 是判读的关键:超时Test timed out in … / Hook timed out in …)多半是负载/时序,不是本 PR 的回归;
断言AssertionError: …)才指向真实的行为改变。两者的 FAIL 行长得一模一样,只有这一行能区分。

跨 PR 相同签名(24h,按失败测试文件聚合):

  • ⚠️本次没有可用的聚合签名(日志里没有能解析出测试文件名的 FAIL 行)—— 这不是「没有同签名的其他 PR」,是这一轮没测到。跨 PR 聚合本次不可用,请手工比对其他 PR 的同类评论。
  • ⚠️ 24h 评论账本没读完(超过 5 页仍未读到窗口尽头),所以上面的「不同 PR 数」是下界,不是全量。

历史信号:

  • 本 PR 过去 24h 无队列失败记录(首次)。
  • 过去 24h 队列共有 70 个失败构建(不含本次)。

分诊清单:

  1. 失败测试在本 PR 改动的包里 → 真回归,修 PR。
  2. 失败测试与本 PR 无关 → 看上面的「跨 PR 相同签名」;已有汇总 issue ⇒ flaky/环境问题实锤,去那张 issue 上谈,修好前重排只会再烧一轮全队列。
  3. 两者都不是 → 可能与同组 PR 语义冲突;等前面的 PR 落地或失败出队后再重排一次即可,不要连续重排。

Generated by Claude Code · merge-queue-triage workflow (#4859)

@os-samClaude

Copy link
Copy Markdown
CollaboratorAuthor

Queue-kick triage (spec seat, session_01RadETjNRLALFLhFA3xehZP), per the merge-queue-triage checklist above:

Verdict: infra, not this PR — re-queue once, deliberately delayed. The two failed queue jobs both died at the Verify pnpm version setup step (corepack's pnpm download crashing with Node undici AssertionError [ERR_ASSERTION]: assert(!this.paused)) — before any test body ran, so the triage comment's own assertion-vs-timeout discriminator does not apply (the assertion is in the toolchain fetch, not in a test). The same signature killed Dogfood Regression Gate (3/3) and Test Core (6/6) on PR #11290's PR-side run in the same 08:59–09:00Z window — four jobs, two unrelated diffs, one npm-registry blip. Neither diff touches pnpm, corepack, or CI setup.

Disposition: this is the died-before-any-test-body re-run case. To avoid burning another full-queue build into the same blip, the re-queue happens on the seat's next patrol (~09:20Z) rather than immediately — one re-queue, and a second failure of any shape is treated as real. No changes will be pushed for this signature.


Generated by Claude Code

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

spec(data): mapping lookup transform params (object / fromField / toField / autoCreate) are authorable and read by nothing

2 participants

@os-sam@claude