fix(transport): bump bundle schemaVersion 1.2 -> 1.3 for the additive instance AreaPath (TRN-8 follow-up, decision A)

Minor bumps mark additive fields (1.1 sites/connections/instances, 1.2 #118
Derivation). TRN-8 added InstanceDto.AreaPath without a bump. Exporter now
stamps 1.3; ManifestValidator still gates only on bundleFormatVersion, so
1.0-1.2 bundles import unchanged and older importers accept a 1.3 bundle
(ignoring AreaPath, leaf-name fallback). Theory pins 1.0-1.4 validating Ok;
version-pinning tests read the constant. Component-Transport.md + CLAUDE.md.
This commit is contained in:
Joseph Doherty
2026-12-03 12:06:01 -05:00
parent 18311eb385
commit 3f98d40fa4
5 changed files with 44 additions and 8 deletions
+4 -3
View File
@@ -59,7 +59,7 @@ zip-bomb guard, and the exporter never emits per-script files.
```json
{
"bundleFormatVersion": 1,
"schemaVersion": "1.2",
"schemaVersion": "1.3",
"createdAtUtc": "2026-05-24T12:34:56Z",
"sourceEnvironment": "dev-cluster-a",
"exportedBy": "alice@corp.example",
@@ -107,6 +107,7 @@ The manifest is plaintext so the import wizard can preview bundle contents and s
- `bundleFormatVersion` newer than what the importer supports produces a hard refusal at upload with a clear upgrade message.
- `schemaVersion` minor increments are **additive-only**. T18 bumped it `1.0 → 1.1` (adding the `sites`/`dataConnections`/`instances` arrays). `bundleFormatVersion` stays `1`; `ManifestValidator` gates solely on `bundleFormatVersion`, so a pre-T18 importer still accepts a 1.1 bundle and simply lists the new site/instance/connection entries as "skipped — unsupported in this version".
- ScadaBridge#118 bumped it `1.1 → 1.2`: a derived (composition-slot) template carries a `Derivation` object (see [Derived templates](#derived-composition-slot-templates-scadabridge118)). It is omitted on base templates (`WhenWritingNull`), so a base template's JSON is unchanged; an older importer ignores the unknown property and imports the slot the old (wrong) way; a 1.0/1.1 bundle has no derivation anywhere and imports exactly as before (pinned by `Fixtures/pre-118-derived-plaintext.scadabundle`). `bundleFormatVersion` stays `1`. The field lives in `content.json`/`content.enc`, whose SHA-256 is the manifest's `contentHash`, so a signed bundle's signature over `manifest.json` covers it (an edited derivation fails the hash check, or — with a recomputed hash — the signature).
- TRN-8 (2026-12-03) bumped it `1.2 → 1.3`: an instance carries the additive `AreaPath` (root→leaf area names; see the instance bullet under Responsibilities). It is null on an area-less instance; an older importer ignores the unknown property and resolves the leaf `AreaName` as it always did; a 1.0–1.2 bundle has no path and imports through the leaf-name fallback (deterministic resolution + an `ImportResult.Warnings` entry when the leaf is ambiguous). `bundleFormatVersion` stays `1`, and `ManifestValidator` still gates solely on it, so every `1.x` minor — older or newer — validates.
## Architecture
@@ -494,7 +495,7 @@ The `manifest.json` file is always present in the ZIP root and is never encrypte
```json
{
"bundleFormatVersion": 1,
"schemaVersion": "1.2",
"schemaVersion": "1.3",
"createdAtUtc": "2026-05-24T12:34:56Z",
"sourceEnvironment": "dev-cluster-a",
"exportedBy": "alice@corp.example",
@@ -561,7 +562,7 @@ The `manifest.json` file is always present in the ZIP root and is never encrypte
| Field | Description |
|---|---|
| `bundleFormatVersion` | Integer. Importer hard-refuses any value other than the code constant `ManifestBuilder.CurrentBundleFormatVersion`. Stays `1` through T18. The schema and format versions are code constants by design — there is no `Transport:SchemaVersionMajor` option (removed 2026-10-22; it was validated but never read). |
| `schemaVersion` | Semver string. Minor increments are additive-only and accepted by older importers. T18 bumped this `1.0 → 1.1` (adding the `sites`/`dataConnections`/`instances` content arrays); a pre-T18 importer lists those new entries as "skipped — unsupported in this version" since `ManifestValidator` gates only on `bundleFormatVersion`. ScadaBridge#118 bumped it `1.1 → 1.2` (the additive `Derivation` on derived composition-slot templates). |
| `schemaVersion` | Semver string. Minor increments are additive-only and accepted by older importers. T18 bumped this `1.0 → 1.1` (adding the `sites`/`dataConnections`/`instances` content arrays); a pre-T18 importer lists those new entries as "skipped — unsupported in this version" since `ManifestValidator` gates only on `bundleFormatVersion`. ScadaBridge#118 bumped it `1.1 → 1.2` (the additive `Derivation` on derived composition-slot templates); TRN-8 bumped it `1.2 → 1.3` (the additive instance `AreaPath`). |
| `createdAtUtc` | ISO-8601 UTC timestamp of when the export was created. |
| `sourceEnvironment` | The `SourceEnvironment` name of the exporting cluster (from `TransportOptions`). Displayed in the import wizard and required to be retyped at the confirm step. |
| `exportedBy` | Authenticated username of the person who performed the export. |