Job aid: the package contract card
Section titled “Job aid: the package contract card”The format, the graph, the import session and its failures on one page, from M6-S2 and M6-S3. Replace the names in angle brackets.
The archive
Section titled “The archive”| Entry | Rule |
|---|---|
manifest.json | Required. schemaVersion: 1.1 plain, 1.2 with mapped-field hints, 1.3/1.4 published versions. A 1.10 importer accepts 1.0–1.4; an older one only 1.0–1.1 |
index.json | Required. orderedResources (in dependency order) and nameMap (id → file name): the only reliable way to a file |
dependencies.json | Required in practice. The edges |
resources/<Type>/<name>.json | One snapshot per resource; no database ids or audit stamps; the source id kept; view execution plans dropped |
| Anything else at the top level | Refused (UNKNOWN_ENTRY). An unsafe name under resources/ is skipped silently |
Never a resource: records, dashboards (records of a system entity), users, groups, organization units, working hours (they travel as references to match or create).
An edge
Section titled “An edge”{from, to, kind, hard, path, resolvedVia}. MEMBERSHIP belongs to; REFERENCE points at.
Hard: must exist; only hard edges extend an export; a skipped or failed target cascade skips its
hard dependents. Soft: nulled at path when the target is missing. Path: where the id sits; the
importer rewrites only an exact match. Order is re-derived from the edges on every import.
Producing a package
Section titled “Producing a package”1 Export, transform, re-import (keep edges true) · 2 Overrides on an import session (content only) · 3 Hand-authoring (unsupported). Prefer 1, parameterise with 2.
The import session
Section titled “The import session”Every route: a system-level Admin grant, the target space from the host (x-space-id past the
gateway), the current updateIdentifier on every write. $BASE is the target’s address and $REL
the Larkspur Release token (M6-S3); the workbench token
is refused here by design.
FILE=$(curl -s -X POST "$BASE/api/storage/v2/files?temp=true" -H "x-app-token: $REL" -F "file=@<pkg>.zip" | jq -r '.result[0].id')curl -s -X POST "$BASE/api/packaging/v1/import/validate" -H "x-app-token: $REL" -H 'Content-Type: application/json' \ -d "{\"fileId\":\"$FILE\",\"fileName\":\"<pkg>.zip\",\"importStrategy\":\"MANUAL\"}"# → sessionId, validationReport, updateIdentifierPATCH …/import/<sid>/strategy {strategy, updateIdentifier} MERGE_NEW_ONLY | OVERWRITE_ALL | MANUALPATCH …/import/<sid>/config {mappings, valueReferences, unmappedDependencies, mappedFieldDecisions, updateIdentifier}GET|PATCH|DELETE …/import/<sid>/resource/<type>/<sourceId>/payload override: content, never structurePOST …/import/<sid>/execute → {jobId}; then poll GET …/import/<sid>/statusPOST …/import/<sid>/retry | /cancelStates: validating → validated → importing → completed | failed. Completed is not success:
read created, overwritten, skipped, cascadeSkipped, errors, importWarnings. Cancel is final
and keeps what was written. Stuck in importing for 15 minutes → failed. Idle sessions expire after
7 days.
Typed failures
Section titled “Typed failures”| Answer | Meaning | Do |
|---|---|---|
400 on validate | No fileId | Upload to storage first |
400 missing space | The call did not come through a host that resolves to a space | Call the space’s address |
403 | Caller below system Admin, or a session of another space | Use the release credential; check the host |
409 STALE_UPDATE_IDENTIFIER | Someone wrote since your token | Reload, reconcile, write again |
409 (other) | Wrong state for this call | Re-read the status, follow the state machine |
409 IMPORT_SESSION_CANCELLED | Execute or retry after a cancel | Open a new session |
400 on an override | A structural field changed | Map the resource instead |
413 on an override | Payload over 2 MB | Override less |
400 on execute | A needed dependency has no target, or a record reference has no action | Map it |
409 MAPPED_FIELD_SOURCE_UNDECIDED | A mapped field needs a decision | Decide it in the config |
The release credential
Section titled “The release credential”A dedicated application user with system Admin: an owner and an expiry, used only by the release pipeline from its own runner, the token in the pipeline’s secret store, regenerated each release train, its use reviewed in the audit trail. Never used for day-to-day reads.
What a package cannot carry (capability checklist)
Section titled “What a package cannot carry (capability checklist)”- Runtimes (a Function needs the target’s function builder)
- Records (starting data loaded by script or entered)
- Application users and tokens
- Programs outside the platform (feeds, clients)
- Per-environment values and secrets (set by override)
- Access that names people or groups (check after install)