diff --git a/docs/cells.md b/docs/cells.md index 48641fd69..3f8fde75e 100644 --- a/docs/cells.md +++ b/docs/cells.md @@ -219,7 +219,8 @@ key must match `registry-public-key.hex`. The package publisher cannot approve itself: registration requires the separate node operator key. Existing account collections, capabilities, token policies and other publisher keys are retained; suspended, revoked and node-restricted registrations are not replaced. Repeating -the preparation keeps unchanged manifest versions and advances changed ones. +the preparation retains the registry protocol version and existing scopes while +updating the app's client version. The wrapper release workflow requires public pins covering all six app IDs, so each included cell has a configured publisher for its updates. diff --git a/scripts/package-manifests.py b/scripts/package-manifests.py index bdb8f9fb6..1d881fa2a 100644 --- a/scripts/package-manifests.py +++ b/scripts/package-manifests.py @@ -85,14 +85,12 @@ def manifest_for(component, existing, key_id, public): if key in item and (item[key] or key in REQUIRED[field])} for item in values[field]] previous_version = existing.get("manifest_version", 0) - if not isinstance(previous_version, int) or previous_version < 0: - raise ValueError("invalid previous manifest version") - values["manifest_version"] = max(1, previous_version) - manifest = {key: values[key] for key in FIELDS if key in values} - previous = {key: existing[key] for key in FIELDS if existing.get(key)} - if previous_version and canonical_bytes(previous) != canonical_bytes(manifest): - manifest["manifest_version"] = previous_version + 1 - return manifest + if type(previous_version) is not int or previous_version not in (0, 1): + raise ValueError("unsupported previous manifest version") + # This is the registry protocol version, not an app release counter. + # Client versions and signed package sequences advance independently. + values["manifest_version"] = 1 + return {key: values[key] for key in FIELDS if key in values} def signed_registration(manifest, publisher, authority): diff --git a/tests/package_manifests_test.py b/tests/package_manifests_test.py index 5818bb453..2dab846e5 100644 --- a/tests/package_manifests_test.py +++ b/tests/package_manifests_test.py @@ -60,11 +60,18 @@ class RegistrationTest(unittest.TestCase): with self.subTest(field=field), self.assertRaises(ValueError): self.manifest(dict(self.existing, **{field: value})) - def test_idempotent_manifests_and_increasing_version(self): + def test_app_updates_retain_the_registry_protocol_version(self): existing = self.manifest() self.assertEqual(self.manifest(existing), existing) self.component["version"] = "2.1.3" - self.assertEqual(self.manifest(existing)["manifest_version"], 2) + updated = self.manifest(existing) + self.assertEqual(updated["manifest_version"], 1) + self.assertEqual(updated["current_client_version"], "2.1.3") + self.assertEqual(updated["collections"], existing["collections"]) + self.assertEqual(updated["keys"], existing["keys"]) + for version in (2, -1, True): + with self.subTest(version=version), self.assertRaises(ValueError): + self.manifest(dict(existing, manifest_version=version)) def test_optional_apps_do_not_claim_root_account_collections(self): self.component = dict(name="lists", id="inbe.lists", version="1.0.1")