sf-plugin-data 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,633 @@
1
+ # Internal DMO field contract
2
+
3
+ The approved Git artifact is the authored-only document below. Runtime source
4
+ expectations and joined projections remain internal, never part of that file.
5
+ The validator/serializer, mappers and raw field projection are offline helpers;
6
+ request mapping alone does not establish deployment acceptance. Explicit CLI
7
+ retrieval now delegates to the existing service and writer; filesystem discovery,
8
+ published JSON Schema and general deployment remain unimplemented. The future layout remains
9
+ `data360/<logical-data-space>/<family>/<api-name>.json`. The internal bounded
10
+ DMO writer below implements only `default/dmo`; explicit CLI retrieval is wired
11
+ to the service and this writer without adding command-level profile restrictions.
12
+
13
+ ## Retrieval selection and aggregate outcomes
14
+
15
+ `selectDmos(connection, selectors, apiVersion, dataSpace)` validates API 65.0/default
16
+ and selector syntax. Exact-only names need no inventory; `dmo` or omitted selectors
17
+ expand the complete transport inventory for default space, coalescing and sorting
18
+ with exact selections. No-selector means all currently implemented families (DMO
19
+ only), not a promise about unimplemented families. There is no `--all` flag.
20
+ The command validates before resolving core org authentication. Each selected name
21
+ still passes `retrieveDmo` and `writeDmoDocument`; no category is silently filtered.
22
+ Envelope `result.selection` records expanded exact selectors. Successful items
23
+ retain their writer receipts even when other objects fail. Object errors carry
24
+ `identity: { dataSpace, apiName }` and a payload-free precise code. Any error yields
25
+ blocked/failed and exit 1; transport/output failures yield failed. Empty inventory
26
+ is success with no items. File shape, canonical bytes and overwrite rules are unchanged.
27
+
28
+ ## Internal read-only deploy input resolver
29
+
30
+ `readDeployInputs({cwd, sourceDir?, metadata?})` returns sorted
31
+ `Array<{path: string, document: DmoDocument}>`. Exactly one nonempty mode is required:
32
+ explicit files/directories, or exact `dmo:ApiName` selectors resolving
33
+ `<cwd>/data360/default/dmo/<ApiName>.json`. Repeated identical selections and
34
+ overlapping paths coalesce; distinct files with case-conflicting identities reject.
35
+ Metadata filenames must exactly match their document identity. No implicit all or
36
+ bare-type selection exists. `deploy --preview` now calls this resolver using
37
+ repeatable non-greedy source-dir or metadata flags, before target inspection.
38
+
39
+ All directory descendants are selected, so non-JSON members reject rather than
40
+ silently narrowing a directory. Limits: 256 files, 1024 visited entries, 16 nested
41
+ levels and 1 MiB per file. Absolute or cwd-relative explicit paths are supported;
42
+ wildcards, parent traversal, drive-relative paths, filesystem roots as directory
43
+ selections, links/junctions/aliased ancestors and hardlinked files reject. Existing
44
+ paths only: no mkdir, artifact, report or scratch writes. File handles are bounded
45
+ and checked against observed identity/size/timestamps; ancestor checks narrow but
46
+ do not eliminate hostile concurrent filesystem replacement races.
47
+
48
+ UTF-8 must decode strictly, without a BOM. JSON must parse with unique object keys
49
+ (including escaped equivalents), and pass both authored validation and independent
50
+ default-space mapping. Raw projections, observations and unknown keys reject.
51
+ Payload-free `DeployInputError` codes: INVALID_SELECTION, UNSAFE_SOURCE,
52
+ INVALID_SOURCE, DUPLICATE_IDENTITY. No connection or mutation transport is used.
53
+
54
+ ## Internal read-only deploy preflight
55
+
56
+ `preflightDmoDeploy(document: unknown, connection: ReadConnection,
57
+ apiVersion: unknown, dataSpace: unknown, allowLabelUpdates = false): Promise<DmoDeployPreview>` accepts one
58
+ standalone authored document and explicit API 65.0/default target binding. It maps
59
+ the source independently before reads and detaches the mapped request in memory.
60
+ Shared execution admission rejects non-Other categories and non-Text/dynamic primary
61
+ keys with `SOURCE_EXECUTION_UNSUPPORTED` before target reads; the offline mapper
62
+ remains broader, without authored-count or unrelated field-type restrictions.
63
+ Metadata qualification uses `readDmoMetadata(connection, objectApiName)` with an
64
+ operation-local Metadata receiver and redirect-refusing transport. Core retains
65
+ SOAP credentials/envelope/parsing; caller connection and global defaults are unchanged.
66
+ Redirects fail with payload-free `METADATA_REDIRECT_REFUSED` before any follow-up.
67
+ No file discovery, saved plan or mutation route is introduced by this service.
68
+
69
+ The result is `{outcome, target, absenceProof, diagnostics}`. Outcomes are `create`,
70
+ `update` (when opted in), `unchanged`, `blocked-changes` or `blocked`; target is `absent`, `present` or
71
+ `unknown`. Only a successful complete offset inventory filtered by exact default
72
+ space/API-name identity yields `absenceProof: 'complete-inventory'`; otherwise it
73
+ is `none`. No 404 or other error establishes absence. Existing inventory entries
74
+ require common `retrieveDmo` qualification including Metadata and relationships.
75
+ A race after inventory acquisition fails closed on retrieval; inventory is not a
76
+ transactional snapshot or permission to execute a later create.
77
+
78
+ Comparison uses fixed authored properties and exact identity-keyed fields, ignoring
79
+ field array order but preserving absent versus empty strings, case, primary/type,
80
+ category, dynamic flags and date designations. Static reasons distinguish object,
81
+ category, field-set, field and immutable changes in default create-only mode. With
82
+ `allowLabelUpdates`, the bounded executable delta gate admits only labels and rejects
83
+ unsupported or mixed changes with `UPDATE_UNSUPPORTED`. Unqualified target semantics produce `blocked`, never no-op.
84
+ Diagnostics contain code/message only, without authored values or remote payloads.
85
+ The public command enforces CMS-style explicit deploy selection, never bare types
86
+ or implicit deploy-all. `--preview` is strictly read-only; omission enables bounded execution.
87
+ Core JSON wraps `sf-data360-deploy` version 1.0.0 with metadata operation deploy /
88
+ preview boolean, diagnostics, targetOrgId provenance and result scope/selection/items.
89
+ Each item includes authored identity, local path, operation preview and the unchanged
90
+ service outcome/target/absenceProof/diagnostics. Aggregate success means preview
91
+ only; any blocked item yields blocked/exit 1, unexpected failure yields failed/exit 1.
92
+ All input resolution precedes command-owned org inspection. No writes or mutation
93
+ transport; parser/auth flag errors use core diagnostics.
94
+
95
+ ## Pure offline update-delta contract candidate
96
+
97
+ `buildDmoUpdateDelta(desired: unknown, current: unknown, targetDataSpace: unknown):
98
+ DmoUpdateDelta` independently validates both authored documents. The caller must
99
+ already have acquired/qualified current state; this helper cannot establish org
100
+ provenance, generated/status or relationship qualification from authored JSON.
101
+ Both identities and explicit target scope must be case-sensitive default; object
102
+ API names must match exactly. Invalid document shapes throw `DmoDocumentError`;
103
+ scope/identity/unsupported changes return `{status: 'blocked', blockers: string[]}`
104
+ without a patch or expected state. Unknown keys (including status, relationships,
105
+ runtime projections and tombstones) reject rather than disappear.
106
+
107
+ The candidate allowlist is object label, explicitly supplied changed nonblank
108
+ object description, existing field label identified by exact name plus unchanged
109
+ `dataType`, and new nonprimary/nondynamic authored fields. New fields map only
110
+ name/label/dataType and explicitly supplied category/nonblank description; false
111
+ primary/dynamic flags remain in the overlay, not the minimal PATCH. No create body
112
+ reuse, object name/dataSpaceName/category/date/status/generated values enter it.
113
+ Existing field description differences (including clearing), category presence or
114
+ value differences, primary/dynamic/type changes, object category and either date
115
+ designation changes block the entire candidate, even alongside admitted changes.
116
+ A changed empty/whitespace object description or new-field description blocks;
117
+ identical existing empty descriptions are no-ops, not clearing operations.
118
+
119
+ Omitted object/field descriptions preserve current values. Desired missing target
120
+ fields preserve them, never delete them: there is no tombstone and no heuristic
121
+ rename inference. A different new name is an addition while the old field remains;
122
+ a case-only collision blocks. Existing field order alone is unchanged. Candidate
123
+ field entries and additions are sorted by exact name; the expected overlay retains
124
+ target order and appends sorted additions. The overlay is detached from both inputs
125
+ and the PATCH. Any blocker returns no partial payload. Unchanged returns
126
+ `{status: 'unchanged', blockers: [], expected: DmoDocument}`; admitted differences
127
+ return `{status: 'candidate', blockers: [], patch: DmoUpdatePatch, expected: DmoDocument}`.
128
+ Neither status is a public update-enabled result or mutation authorization.
129
+
130
+ Authoritative supplied checkpoint (2026-10-26): the official
131
+ [Connect Data Model Object Input reference](https://developer.salesforce.com/docs/data/connectapi/references/spec?meta=type%3AData+Model+Object+Input)
132
+ documents API 65 `PATCH /ssot/data-model-objects/{qualifiedName__dlm}`. Name/type
133
+ changes are forbidden; its additions example does not prove omission preservation
134
+ or existing-field label behavior. HTTP 200 may return the old state; future
135
+ execution must separately GET and qualify actual post-state. Existing-label entry
136
+ encoding above remains an internal candidate, not public update support. Retained
137
+ synthetic PATCH2 readback now qualifies offline against the entire expected authored
138
+ overlay with unchanged raw runtime observations: the changed Connect label matches
139
+ Metadata labelOverride, while Metadata base/master labels retain their old values.
140
+ This bounded checkpoint does not establish arbitrary omission or new-field behavior.
141
+ Public preview/execution now admit only the bounded label subset below; the broader
142
+ candidate is not execution permission. New-field preservation still needs a separately
143
+ authorized experiment.
144
+ No live calls or PATCH transport were added in the label-reconciliation slice.
145
+
146
+ ## Bounded public label-update execution
147
+
148
+ `executeDmoDeploy(document, connection, apiVersion, dataSpace)` and
149
+ `executeDmoDeploySelection(documents, connection, apiVersion, dataSpace)` expose
150
+ internal create/unchanged/update orchestration. `preflightDmoDeploy` accepts an
151
+ optional fifth `allowLabelUpdates` boolean (default false); public preview/selection
152
+ admission and internal execution opt in. Public CLI invokes `executeDmoDeploy` per
153
+ item after whole-selection admission and never reports an update as a creation.
154
+
155
+ Admission retains Other/default/API 65 and nondynamic Text primary-key restrictions.
156
+ Only object labels and existing non-primary field labels execute. Primary-key labels
157
+ would conflict with the current generated qualifier recipe; they remain blocked.
158
+ New fields, object/field descriptions and every other unproven delta block atomically,
159
+ even when mixed with labels. Omitted fields/descriptions preserve target values;
160
+ field reordering is a no-op. The offline delta helper remains deliberately broader.
161
+
162
+ Selection snapshots all valid inputs before reads and rejects duplicate identities.
163
+ It preflights every item before the first write, then requalifies each executing target
164
+ and derives its delta anew immediately before dispatch. One mutation per item, no
165
+ retry/rollback. PATCH bodies (including stale HTTP 200 state) are never confirmation.
166
+ Independent Connect detail, Metadata read and complete relationship inventory must
167
+ qualify the expected authored overlay AND exact raw runtime preservation. Only the
168
+ changed Connect/object Metadata label slots and existing-field Metadata labelOverride
169
+ may differ; base/master field labels, generated qualifiers and all other raw values
170
+ must remain. Only Connect/Metadata field collections normalize identity ordering.
171
+
172
+ Results include `outcome: updated` with `mutation: confirmed-updated` only after all
173
+ checks pass. Pre-write refusal is `not-attempted`; dispatch/readback ambiguity is
174
+ `failed`/`unknown` and stops the selection with an unattempted tail. The recorded
175
+ Other preservation checkpoint informs this narrow policy, not proof for other
176
+ categories, new fields or general update semantics. No live calls were made here.
177
+
178
+ ## Internal guarded create executor
179
+
180
+ `executeDmoCreate(document: unknown, connection: TargetConnection, apiVersion: unknown,
181
+ dataSpace: unknown): Promise<DmoCreateExecution>` accepts independently validated
182
+ authored input and actual core connection subset (instanceUrl/request/metadata/
183
+ getApiVersion), with explicit API65/default. It reconstructs a detached artifact
184
+ before awaiting, then repeats preflight at execution time. No saved preview is
185
+ accepted. Qualified unchanged targets do nothing; any existing differences block.
186
+ Only complete-inventory absence authorizes the single fixed-route POST.
187
+
188
+ Result `{outcome, mutation, preflight?, diagnostics}` uses outcome unchanged/blocked/
189
+ created/failed and mutation not-attempted/confirmed-created/unknown. POST errors
190
+ are unknown even when a status exists: creation may have occurred. POST bodies,
191
+ including empty or malformed success bodies, are not completion evidence or trusted
192
+ identities. Independent exact-name Connect detail + core Metadata read + complete
193
+ relationships must pass common projector generated/qualifier integrity and
194
+ identity-keyed authored comparison before confirmed-created. Missing/unqualified
195
+ readback is READBACK_UNQUALIFIED; qualified semantic differences READBACK_MISMATCH.
196
+ Unknown outcomes require target inspection; no automatic retry or rollback exists.
197
+ The transport disables network retries and masks only the per-call JSforce refresh
198
+ delegate to prevent its automatic 401 POST replay, without changing the original
199
+ connection. Redirects, arbitrary write paths, PATCH and DELETE are unavailable.
200
+ Inventory is not a transaction: concurrent creation cannot be ruled out. Tests are
201
+ synthetic only; the mapper's wider input admission does not establish broader
202
+ projector qualification or live deployment acceptance. Public CLI execution delegates
203
+ creation here through `executeDmoDeploy`, after resolving/validating all inputs and preflighting the whole
204
+ selection. A known blocked item or any preflight error prevents all execution.
205
+ Each execution item carries operation execute, authored identity/path, outcome
206
+ created/updated/unchanged/blocked/failed/not-attempted, mutation evidence (including
207
+ confirmed-updated for qualified label readback), optional preflight
208
+ and diagnostics in the same version 1.0.0 envelope. Sequential execution stops on the
209
+ first blocked/failure/unknown mutation; prior receipts survive and remaining items
210
+ are explicitly not-attempted. An unexpected executor throw conservatively retains
211
+ unknown mutation. Aggregate success requires every execution to be created, updated or
212
+ unchanged; otherwise blocked/failed exits 1, even when earlier mutations succeeded.
213
+ No transaction, concurrency guarantee, retry, rollback or saved plan.
214
+
215
+ ## Internal common authored DMO file writer
216
+
217
+ `writeDmoDocument(value: unknown, projectRoot: string, overwrite: boolean)`
218
+ returns `{ path: string, outcome: 'retrieved' | 'unchanged' }`. First independently
219
+ validate through `buildDmoCreateRequestFromDocument(value, 'default')`, then
220
+ use `serializeDmoDocument`. Persist only the approved authored document, never
221
+ expectations, source IDs or runtime observations. Output is exactly
222
+ `<project-root>/data360/default/dmo/<api-name>.json`; the CLI must supply cwd when
223
+ `-d` is absent. No stale-file deletion or directory discovery exists.
224
+
225
+ Identical bytes preserve the existing file even without overwrite; differing
226
+ bytes require explicit overwrite. All existing ancestors are checked with lstat
227
+ and canonical path checks; symlinks/junctions, directory destinations and file
228
+ ancestors reject. Parents may be created but failed publication is never success.
229
+ Complete flushed staging is created under verified OS temp, then atomically
230
+ renamed for replacement or exclusively hard-linked for a new destination. The
231
+ staging file entry is removed after hard-link publication, leaving no writable
232
+ staging alias. Roots/ownership markers are retained; no recursive cleanup occurs.
233
+ Cross-volume publication fails closed (no copy fallback). The caller must report
234
+ OUTPUT_FAILED as failure and inspect the destination before retrying: publication
235
+ may have completed before a subsequent filesystem failure. Rechecking ancestors
236
+ and prior bytes narrows but cannot eliminate concurrent path-replacement races;
237
+ this is not a filesystem sandbox against a hostile concurrent local process.
238
+ Payload-free DmoWriteError codes: UNSAFE_PATH, OVERWRITE_REQUIRED, OUTPUT_FAILED.
239
+
240
+ ## Authored document
241
+
242
+ `validateDmoDocument(value: unknown): DmoDocument` checks without mutation;
243
+ `serializeDmoDocument(value: unknown): string` sorts object keys, preserves array
244
+ order and string contents, indents two spaces and appends LF. Only ordinary JSON
245
+ records with enumerated keys are accepted. Unknown keys block, even null/false.
246
+
247
+ - `schemaVersion: 1`, `kind: 'dmo'`.
248
+ - `identity: { dataSpace, apiName }`: explicit logical data space and canonical
249
+ non-namespaced custom name ending `__dlm`.
250
+ - `spec`: nonblank `label`, optional string `description`, `category`
251
+ (`Profile | Other | Engagement`), ordered nonempty `fields`. Optional
252
+ `eventDateTimeFieldName` and `recordModifiedFieldName` resolve exactly to a
253
+ DateTime field. Engagement requires its event reference.
254
+ - Fields: canonical custom `name` ending `__c`, nonblank `label`, `dataType`,
255
+ boolean `isPrimaryKey`, boolean `isDynamicLookup`; optional string `description`
256
+ and `category`. Types: `Number`, `Text`, `Date`, `DateTime`, `Url`, `Phone`,
257
+ `Email`, `Percent`, `Boolean`, `Currency`, `ArrayOfFloats`, `ArrayOfTexts`.
258
+ - Exactly one primary key and case-insensitively unique field names are local
259
+ subset constraints. Name stems begin with a letter, do not begin with SSOT,
260
+ and have no trailing or consecutive underscores. Data-space identifiers use
261
+ ASCII letters/digits/underscores and begin with a letter.
262
+
263
+ These are authored-shape constraints, not selected-version deployment acceptance.
264
+ Namespaced/standard objects, extra object categories, SQL/flex DMOs and object
265
+ execution/status inputs remain outside this subset.
266
+
267
+ ## Lossless diagnostic projection, explicitly incomplete
268
+
269
+ `projectDmoRawFields(value: unknown): DmoFieldProjection` accepts custom raw detail
270
+ only and returns `{ status: 'incomplete', blockers, candidate, configuration }`.
271
+ It never returns a complete portable export. `candidate` is the writable-field
272
+ subset for inspection only. `configuration` independently retains every admitted
273
+ raw configuration property, including field order, original category spelling,
274
+ flag presence, custom qualifiers and all system fields. It is not deploy input.
275
+ Do not serialize this incomplete candidate as a portable retrieval result.
276
+ Only a separately qualified strict retrieval may emit the approved authored document.
277
+
278
+ - Read `type` maps to candidate `dataType`; missing boolean flags become false
279
+ only in the candidate. Explicit invalid flags block. Uppercase PROFILE/OTHER/
280
+ ENGAGEMENT map to title-case only in the candidate. Original values survive.
281
+ - `creationType: System` fields remain in configuration, never silently disappear.
282
+ They add `GENERATED_FIELD_REPLAY_UNVERIFIED`. No hardcoded name pattern proves
283
+ generation; recreation and collisions still need target evidence.
284
+ - Custom `keyQualifierName`, `isDistinct` and `usageTag` are retained and add
285
+ `FIELD_SEMANTICS_REPLAY_UNVERIFIED`, even when false or apparently default.
286
+ The nested input contract does not make these directly writable.
287
+ - Every result includes `RELATIONSHIPS_NOT_ACQUIRED`. DMO detail does not establish
288
+ incoming/outgoing relationship completeness. An empty detail field list of
289
+ relationships is not evidence of absence. The separate raw acquisition helper
290
+ below is not yet bound to this projection.
291
+ - Unknown keys, nested semantic values, accessors, duplicate names, unsupported
292
+ creation variants and invalid candidates throw payload-free `DmoDocumentError`.
293
+
294
+ Raw object observations excluded from configuration are exactly `id`,
295
+ `hasExternalDataLakeObjectMappings`, `isEditable`, `isEnabled`, `isSegmentable`.
296
+ All other admitted object keys are configuration. Field configuration includes
297
+ `name`, `label`, `description`, `category`, `type`, `isPrimaryKey`,
298
+ `isDynamicLookup`, `creationType`, `keyQualifierName`, `isDistinct`, `usageTag`.
299
+ No field-ID exemption or generic unknown-metadata stripping exists.
300
+
301
+ ## Common object projection (retrieval-integrated)
302
+
303
+ `projectCommonDmoConnectMetadata(connect: unknown, metadata: unknown,
304
+ relationships: unknown): DmoCommonProjection` returns status `projected` or
305
+ `incomplete`, blockers, optional validated candidate, verified local createIdentity,
306
+ exact qualifierBindings and independent expectations containing all three inputs.
307
+ Candidate is absent for missing Engagement event designation; it is diagnostic
308
+ only whenever blockers remain. Inputs must be complete separately acquired
309
+ collections; the projector cannot establish acquisition completeness itself.
310
+
311
+ One common path composes the shared field join for all authored types/counts.
312
+ Exact object name/label/description/default space and creation type must agree.
313
+ Unknown meaningful properties reject, not disappear. The observed Other taxonomy
314
+ and disabled/unmapped defaults qualify; unfamiliar taxonomy/category, execution,
315
+ metrics and mapping semantics have specific blockers. Explicit Connect event and
316
+ modified references must resolve exactly to authored DateTime fields. No Metadata
317
+ designation key is invented. Missing Engagement event returns
318
+ `ENGAGEMENT_EVENT_DESIGNATION_UNAVAILABLE`, even with one DateTime field.
319
+
320
+ The retained cross-org Other experiment establishes the generated recipe: three
321
+ standard system Text defaults and the explicit primary-key qualifier, joined by
322
+ metadata reference, with their observed labels/usage/default storage semantics.
323
+ The common recognizer checks those identities and defaults, not merely a System
324
+ tag or suffix. Recognition resolves generated/qualifier and observed length-60
325
+ storage blockers, without requiring two authored or six total fields. Other Text
326
+ lengths, required/distinct semantics and unfamiliar generated variants stay blocked.
327
+ Synthetic varied-count/type success is offline qualification, not new live proof.
328
+ No-generated shapes also retain an unverified recipe blocker. Complete nonempty
329
+ relationships remain retained with `RELATIONSHIP_REPLAY_UNSUPPORTED`; malformed,
330
+ foreign or unknown relationship shapes reject. Empty auxiliary Metadata
331
+ collections are checked, not silently dropped. The read service now runs this common
332
+ projection and requires projected status, empty blockers and a common-mapper-validated
333
+ candidate before returning success. The command repeats the completeness gate; the
334
+ writer independently validates authored JSON, never a runtime projection.
335
+
336
+ ## Common offline field join (composed by common projection)
337
+
338
+ `joinDmoConnectMetadataFields(connectFields: unknown, metadataFields: unknown):
339
+ DmoJoinedFields` returns `{ fields, qualifierBindings, blockers, expectations }`.
340
+ It is the shared field-level slice, **not** a complete DMO projection, portable
341
+ export or deployment gate. Existing narrow compatibility helpers are unchanged.
342
+
343
+ Complete collections join one-to-one by exact qualified Connect `name` / Metadata
344
+ `fullName`, regardless of order. Any nonempty count and all 12 authored types are
345
+ admitted. Types/creation semantics must agree. Connect field labels must equal the
346
+ Metadata `mktDataModelFieldAttributes.labelOverride` when present, otherwise the
347
+ Metadata field `label`. A present override must be nonblank text of at most 255
348
+ characters; malformed/empty values do not trigger fallback. The Metadata base
349
+ `label` remains independently validated, and an optional `masterLabel` must still
350
+ equal that base as this projector's bounded qualification (not a universal
351
+ Salesforce equality claim). Independent raw expectations retain all three label
352
+ representations unchanged. This API 65 effective-label contract is documented in
353
+ the official [CustomField reference, MktDataModelFieldAttributes section](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/customfield.htm).
354
+ Optional descriptions and categories preserve presence and value. Exactly one authored primary is designated
355
+ by Metadata `primaryIndexOrder: '1'`; a supplied Connect flag must agree. Dynamic
356
+ lookup uses a supplied Metadata string boolean or a supplied Connect boolean;
357
+ conflicts or absence in both sources reject, never silently default false.
358
+
359
+ System fields never enter authored `fields`. Explicit qualifier references bind
360
+ Connect `keyQualifierName` to unique Metadata `refAttrDeveloperName`, then exact
361
+ System field identity, with complete reference consumption. Multiple qualifiers
362
+ and no qualifiers are supported without suffix inference or fixed field counts.
363
+ Unknown keys, unsupported usage/creation values, nonempty summary semantics,
364
+ ambiguous/dangling references and incomplete collections throw payload-free
365
+ `DmoDocumentError`. Other admitted non-authored semantics remain diagnostics:
366
+ required true, arbitrary positive Text storage length, distinct true, generated
367
+ fields, generated qualifiers and generated descriptions/categories add specific
368
+ `*_REPLAY_UNVERIFIED` blockers. Even an empty blocker array proves only this field
369
+ join; it does not qualify object taxonomy, relationships or generated recreation.
370
+ Independent full admitted collections remain in `expectations`.
371
+
372
+ The common object projector composes this join with object/category/taxonomy
373
+ validation, explicit event/modified references and complete relationship inputs.
374
+ The common retrieval service acquires those inputs; missing Engagement designation
375
+ is a specific blocker rather than field-count/type inference. Live acceptance is
376
+ not expanded beyond retained evidence.
377
+
378
+ ## Strict Connect/Metadata Other diagnostic slice
379
+
380
+ `projectDmoConnectMetadata(connect: unknown, metadata: unknown, relationships: unknown):
381
+ DmoConnectMetadataProjection` joins the exact DMO identity and every field's
382
+ Connect `name` to Metadata `fullName`, independently of field-array order. Only
383
+ one proven API 65 Other variant is admitted: two authored fields (Text primary,
384
+ DateTime nonprimary), four System Text fields including one explicit qualifier,
385
+ no relationships, disabled/unsegmentable/unmapped custom schema. Profile and
386
+ Engagement are not accepted by this helper.
387
+
388
+ Metadata `primaryIndexOrder: '1'` and `isDynamicLookup: 'false'` are authoritative;
389
+ Connect flags, if present, must agree. Qualifiers bind only through exact
390
+ `keyQualifierName` to `refAttrDeveloperName`, then the joined generated field
391
+ identity. No suffix conversion or field-name inference occurs. Required false,
392
+ Text length 60, DateTime length absence, usage tags, distinctness, labels and
393
+ creation types are checked. Unknown properties, nonempty Metadata collections,
394
+ extra/missing/duplicate fields and incompatible semantics throw payload-free
395
+ `DmoDocumentError` rather than being discarded. These constraints describe the
396
+ observed narrow variant, not all valid Salesforce schemas.
397
+
398
+ The result has `status: 'projected'`, `blockers: []`, a two-field `candidate`,
399
+ `createIdentity: { status: 'verified', name, sourceApiName }`, `qualifierBindings`,
400
+ and independently copied full `expectations: { connect, metadata }`. Only after
401
+ all existing profile checks pass, `name` removes exactly one terminal case-sensitive
402
+ `__dlm` from the validated qualified `sourceApiName`. The base starts with an ASCII
403
+ letter, contains only ASCII letters/digits and internal single underscores, and
404
+ cannot start with SSOT (case-insensitive). Missing/wrong/repeated suffixes,
405
+ namespace-like doubles, invalid characters and trailing underscores reject;
406
+ there is no sanitization, case folding or internal replacement. Candidate and
407
+ both expectations retain the original qualified name. Metadata `fullName` equals
408
+ Connect `name`; no separate developerName is inferred.
409
+
410
+ Expectations retain generated fields, primary/dynamic attributes, length/required
411
+ presence and all admitted readback metadata; they are not writable Metadata API
412
+ input. The source Connect ID remains an observation. `projected` establishes only
413
+ this offline profile projection and identity, not general deployment support.
414
+ The projection itself is not a Git artifact. After strict retrieval qualification,
415
+ only the authored candidate belongs in the approved Git file; its runtime source
416
+ expectations remain internal. A detached document is not proof of runtime source
417
+ state or deployment acceptance. No request execution exists. The bounded offline
418
+ mappers below distinguish source revalidation from authored-file mapping.
419
+
420
+ Offline evidence inspected 2026-10-25: a separately authorized Other experiment
421
+ reported full Connect/Metadata equality across orgs, excluding only Connect ID
422
+ and field-array ordering, with no source drift. This gate is satisfied only for
423
+ that fixture and does not establish repeat no-op/update behavior,
424
+ Profile/Engagement support or generic generated schemas.
425
+ No live calls occur in this helper or its independently authored synthetic tests.
426
+
427
+ ## Bounded offline Other create request
428
+
429
+ `buildOtherDmoCreateRequest(value: unknown, targetDataSpace: unknown):
430
+ OtherDmoCreateRequest` accepts the complete joined projection, not a detached
431
+ portable candidate. It re-runs the existing strict profile against the independent
432
+ Connect/Metadata expectations and checks candidate, create identity, qualifier
433
+ binding and empty blocker agreement. Relationships must already have been acquired
434
+ and checked by the projection caller; this pure mapper performs no acquisition.
435
+ It does not authenticate the origin of supplied JSON or prove an org snapshot.
436
+
437
+ Both source and explicit target must equal case-sensitive `default`. Other spaces,
438
+ missing bindings and implicit fallback reject; cross-space remapping is not proven.
439
+ The fresh body contains only `name` (verified unsuffixed object base), `label`,
440
+ optional `description`, `dataSpaceName`, `category: 'Other'`, and exactly the two
441
+ authored `fields` with `name`, `label`, `dataType`, `isPrimaryKey`,
442
+ `isDynamicLookup`. Exact authored custom `__c` names survive unchanged. Generated
443
+ fields/qualifier references, org IDs, usage/distinctness, taxonomy, length/required
444
+ and other readback metadata never enter the request. No POST, update/no-op,
445
+ Profile/Engagement, CLI wiring or general deployment acceptance is implemented.
446
+
447
+ Nested-name reconciliation checked 2026-10-25: local text mirrors have no nested
448
+ input contract. The official reference linked below labels `fields` as Data Object
449
+ Field Input and its paired example submits unsuffixed field names. That example
450
+ shows one accepted spelling, not an explicit prohibition of qualified names.
451
+ Direct nested-page retrieval timed out; indexed full reference text was inspected,
452
+ not unrelated mapping/stream search synthesis. The existing separately authorized
453
+ API 65 experiment submitted `ContractKey__c` and `ObservedAt__c` unchanged and
454
+ read back identical authored identities, plus all four generated identities, in
455
+ both orgs. Its comparison passed with no source drift. That observed evidence
456
+ resolves this exact Other/default profile: field-name inversion is unnecessary.
457
+ It does not establish every naming form, arbitrary spaces or every API version.
458
+ No live org call or write was made while implementing this mapper.
459
+
460
+ ## Common authored-document request mapper
461
+
462
+ `buildDmoCreateRequestFromDocument(value: unknown, targetDataSpace: unknown):
463
+ DmoCreateRequest` independently validates authored schemaVersion/kind/identity/spec.
464
+ It maps all three authored categories, all 12 documented nested types, any nonempty
465
+ field count, one primary key, and true/false dynamic lookup. Field category and
466
+ field/object description retain absence versus empty strings. Explicit event and
467
+ record-modified names retain exact spelling and must resolve to DateTime fields;
468
+ Engagement requires an event reference. Source and explicit target remain default.
469
+ Unsupported scope errors name only the affected property, never its supplied value.
470
+ Unknown/runtime properties still reject through the existing strict validator.
471
+
472
+ The fresh allowlisted object maps identity.apiName to the terminal-suffix-stripped
473
+ name, explicit target to dataSpaceName, and spec label/description/category/date
474
+ references individually. Each fresh field maps only name/label/dataType/description/
475
+ category/isPrimaryKey/isDynamicLookup. No spec spread, generated fields, response
476
+ flags, source expectations or relationships are accepted. Existing narrow Other
477
+ mappers and their compatibility tests remain unchanged but no longer drive retrieval.
478
+ Service/writer/command now use the common path. No new runtime acceptance is implied
479
+ by construction.
480
+
481
+ Evidence rechecked 2026-10-25 after local mirror gaps: official nested page fetches
482
+ timed out. Indexed full official [Connect endpoint reference](https://developer.salesforce.com/docs/data/connectapi/references/spec?meta=type%3AData+Model+Object+Input)
483
+ explicitly lists the three title-case categories, eventDateTimeFieldName and
484
+ recordModifiedFieldName as input (object base properties from 59.0; fields/category/
485
+ references from 60.0; custom DMO POST from 61.0). Its uppercase example is not used
486
+ as the enum. Official Data360 MCP payload_examples for d360_dmo_create independently
487
+ confirms the seven nested properties, optional string category/description,
488
+ boolean dynamic/primary flags and all 12 enum types. That schema omits the object
489
+ date references, so the endpoint contract supplies those mappings. It provides
490
+ no nested per-property minimum versions; true dynamic lookup and additional types
491
+ are schema-level mappings, not newly observed API 65 behavior. Exact authored
492
+ qualified field names retain the earlier naming evidence without claiming a live
493
+ round trip for every category/type/flag combination. SQL/flex/extra categories
494
+ remain outside the authored contract, not silently dropped.
495
+
496
+ ## Standalone authored-document Other mapper
497
+
498
+ `buildOtherDmoCreateRequestFromDocument(value: unknown, targetDataSpace: unknown):
499
+ OtherDmoCreateRequest` first calls `validateDmoDocument`. It accepts the standalone
500
+ approved `{ schemaVersion, kind, identity, spec }` JSON after serialize/parse,
501
+ without a projection, source expectations, qualifier binding or fabricated metadata.
502
+ The existing `buildOtherDmoCreateRequest` remains the separate strict runtime
503
+ projection revalidator; its forged-projection checks are unchanged.
504
+
505
+ Source and explicit target must both equal case-sensitive `default`. The supported
506
+ spec is exactly Other with two authored fields: one Text primary key and one
507
+ DateTime nonprimary, both `isDynamicLookup: false`. Field description/category and
508
+ object event/record-modified references are rejected even if empty. Unknown keys,
509
+ relationships and runtime projection keys reject rather than disappear.
510
+
511
+ The fresh request derives the object base using the already validated terminal
512
+ `__dlm` rule, preserves exact authored `__c` field names, labels and array order,
513
+ and preserves optional object description presence, including empty text. It does
514
+ not mutate or share field objects with its input. No expectations are fabricated.
515
+ This is offline request construction only: deployment must independently validate
516
+ the authored file and later compare actual target readback, with internal runtime
517
+ expectations acquired as needed. It does not provide CLI/file handling, transport,
518
+ target preflight, create/update/no-op orchestration or general DMO acceptance.
519
+
520
+ ## Internal common read-only DMO retrieval
521
+
522
+ `retrieveDmo(connection: ReadConnection, objectApiName: unknown,
523
+ apiVersion: unknown, dataSpace: unknown): Promise<DmoCommonProjection & { candidate: DmoDocument }>`
524
+ is internal; ReadConnection is a Pick of core Connection's instanceUrl, request,
525
+ metadata and getApiVersion. Caller supplies existing authenticated core connection.
526
+ Both explicit API and the connection version must be 65.0; data space must be
527
+ case-sensitive default; object identity must be the supported local custom __dlm
528
+ form. Unsupported inputs fail before acquisition, without version mutation.
529
+
530
+ The service uses ConnectClient GET for exact detail, core
531
+ `connection.metadata.read('CustomObject', [objectApiName])`, then the existing
532
+ complete incoming/outgoing relationship helper with explicit default scope.
533
+ Installed core/JSforce source confirms array input returns the decoded records
534
+ array, not a SOAP result/records wrapper, using the connection's SOAP API version.
535
+ Exactly one record with exact fullName is mandatory; empty, missing, wrapped,
536
+ foreign and ambiguous responses block. Every admitted Metadata property reaches
537
+ the strict projector unchanged; there is no property-stripping envelope adapter.
538
+ The retained successful API 65 Other experiment used the same core metadata.read
539
+ seam with scalar input. No new live execution was needed here.
540
+
541
+ Common joined projection and buildDmoCreateRequestFromDocument both run before success.
542
+ Return value retains complete independent expectations, create identity and
543
+ qualifier binding; no detached candidate or create request is returned instead.
544
+ Acquisition errors have payload-free diagnostics; failures never return a partial
545
+ projection. Existing ConnectError/DmoDocumentError remain intact; other failures
546
+ become DmoRetrieveError with ACQUISITION_FAILED. INVALID_SCOPE and
547
+ INVALID_METADATA identify rejected scope or decoded record cardinality/identity.
548
+ Incomplete variants expose a specific projector blocker (missing Engagement event
549
+ is preferred when present), not a candidate. No snapshot consistency, authenticity
550
+ of arbitrary JSON, general category acceptance, request execution or mutation is
551
+ claimed. Existing module paths remain unchanged; common export names replace the
552
+ unpublished narrow service/writer names without compatibility aliases.
553
+
554
+ ## Authoritative contract evidence (2026-10-25)
555
+
556
+ The coordinator's resolved official naming research uses the
557
+ [Connect Data Model Object Input contract](https://developer.salesforce.com/docs/data/connectapi/references/spec?meta=type%3AData+Model+Object+Input):
558
+ its paired create/read example maps `CustomDMO` to `CustomDMO__dlm`. Documented
559
+ name diagnostics require a leading letter, alphanumeric/underscore characters,
560
+ no consecutive or trailing underscores, and no custom SSOT prefix. The official
561
+ object reference identifies the `__dlm` DMO suffix. Together these support the
562
+ narrow inverse above for the already admitted non-namespaced custom profile,
563
+ without retaining an old create request or introducing a provenance subsystem.
564
+ This slice uses that supplied research offline; it performs no online/org calls.
565
+
566
+ Local official mirrors had no nested field contract. The
567
+ [official Connect REST reference](https://developer.salesforce.com/docs/data/connectapi/references/spec)
568
+ provides the custom DMO endpoint from 61.0 and Date/DateTime examples, not a type
569
+ restriction. Its HTML links a YAML asset that returned HTTP 404; direct nested
570
+ rendering timed out. Search summaries mixed unrelated contracts and were not
571
+ used to infer the enum.
572
+
573
+ The official Salesforce Data360 MCP `payload_examples('d360_dmo_create')`
574
+ returned the nested `DataModelObjectInputRepresentation` schema. Its field item
575
+ has exactly `category`, `dataType` (the 12-value enum above), `description`,
576
+ `isDynamicLookup`, `isPrimaryKey`, `label`, `name`; no nested required list.
577
+ The tool schema is current metadata without per-property minimum API versions.
578
+ Its description/example disagree about suffixes; the separate official naming
579
+ contract resolves object create identity; the bounded API 65 Other replay above
580
+ independently resolves preservation of the exact authored nested field names.
581
+ Neither establishes general version-specific runtime acceptance. The wider object schema also
582
+ exposes additional categories and SQL/flex settings; these are explicitly blocked
583
+ rather than added to this bounded custom-schema slice.
584
+
585
+ `payload_examples('d360_dmo_relationship_list')` independently describes a
586
+ separate source-or-target relationship list, required `dataModelObjectName`,
587
+ optional `dataspace`, `status`, `creationType`. No org call was executed.
588
+
589
+ ## Read-only relationship acquisition
590
+
591
+ The full official endpoint section (checked 2026-10-25) establishes API 64.0
592
+ `GET /ssot/data-model-objects/{dataModelObjectName}/relationships`, covering the
593
+ selected DMO as either source or target. Query parameters: `creationType`,
594
+ `dataspace` (server default is default), `limit` (default 20), `offset`, `orderBy`,
595
+ `sortBy`, `status`. Acquisition deliberately omits status/creation filters.
596
+ The documented response has `relationships`, `count`, `totalSize`, `sortBy` and
597
+ current/next/previous page token/URL pairs. Its sample links use an older v63
598
+ route absent from the operation table; no equivalence is inferred from those URLs.
599
+
600
+ `ConnectClient.listDataModelObjectRelationships(dataModelObjectName: string,
601
+ dataSpace: string): Promise<Array<Record<string, unknown>>>` uses explicit scope,
602
+ API >=64.0 and the documented route only. It requests 20 rows, offsets 0..2000,
603
+ ASC/DeveloperName; 2000 is a local budget, not an endpoint limit claim. It ignores
604
+ response links/tokens for navigation and never forwards them. A terminal page
605
+ requires accumulated rows equal totalSize and absent/null/empty next URL/token.
606
+ Missing total, inconsistent optional count, changing totals, overlap, out-of-scope records, unknown
607
+ envelope keys, premature short pages or budget exhaustion block without returning
608
+ partial data. The helper accepts only identifier-form data spaces and DMO names
609
+ ending __dlm (including namespaces); other names block before network access.
610
+
611
+ Raw entry fields, including unknown nested metadata, qualifiers, cardinality,
612
+ status, owner, generated names and optional/absent targetField, survive untouched.
613
+ This is transport preservation, not approval of unknown semantics for portable
614
+ export. Entries require unique nonblank names and sourceObject/targetObject names;
615
+ at least one endpoint must match the requested DMO. Data-space scope relies on
616
+ the server query, not an invented per-record data-space field. Offset pagination
617
+ has no snapshot guarantee and equal-total concurrent changes can evade detection.
618
+ Read-only API 65.0 acceptance on 2026-10-25 corrected the reference sample's
619
+ assumptions: count/sortBy are absent, endpoints are sourceObject/targetObject,
620
+ and the empty synthetic DMO returns HTTP 204. The helper uses JSforce's private
621
+ noContentResponse sentinel to distinguish 204 from a missing/malformed JSON body;
622
+ 204 is accepted only on the initial page, never after an advertised nonzero total.
623
+ A standard DMO returned 142 records across eight pages of limit 20, ending with
624
+ two records and no next URL. Qualifier properties were null in that inspected set;
625
+ this is not evidence that populated qualifier structures may be discarded.
626
+
627
+ The prior synthetic custom Engagement DMO has two custom and four system fields,
628
+ a qualifier reference lacking the __c suffix of its generated field, and no
629
+ eventDateTimeFieldName in detail. Its projection therefore fails closed: a single
630
+ DateTime field does not prove event-time designation. No suffix-based binding or
631
+ portable output is claimed. The next prerequisite is an authoritative metadata
632
+ source for the designated event field (and record-modified designation), followed
633
+ by generated-qualifier replay evidence. No rows or org changes were used.