Relationships
#1358 uat: add namespace isolation and shard resilience test coverage
Opened by stack72 · 7/23/2026
Context
The namespace isolation fixes (core #1923, extension #130, #131, #133) and doctor datastores --repair shipped without corresponding UAT coverage. The existing UAT tests use the old namespace set + namespace migrate flow and pass namespace inside --config JSON rather than the new --namespace CLI flag. Five gaps need filling.
Gap 1: setup extension --namespace flag not tested
setupDatastoreWithNamespace in src/cli/helpers/datastore_backend.ts passes namespace inside the --config JSON object, not as --namespace on the CLI. The --namespace flag (shipped in core #1923) is the recommended path and has a different resolution priority (--namespace > config JSON > marker). It needs its own test.
Add a helper variant or update setupDatastoreWithNamespace to use:
["datastore", "setup", "extension", extensionName, "--namespace", namespace, "--config", JSON.stringify(config)]And add a test that verifies: namespace appears in .swamp.yaml, initial pull is scoped, no namespace migrate needed.
Gap 2: Contamination prevention scenario not tested
The exact bug path from #1320/#1325 — Repo A pushes solo-layout data, Repo B connects with namespace to the same prefix, verify B does NOT absorb A's data. This was the most impactful bug (34,700 duplicated objects in production) and has no UAT coverage.
Test outline:
- Repo A:
setupDatastore(no namespace), generate data, push - Repo B:
setupDatastoreWithNamespaceon same prefix - Assert: Repo B's local cache has zero foreign files
- Assert: S3/GCS objects under
{namespace}/contain only Repo B's data - Assert: Repo A's root data is untouched
Run for both S3 and GCS backends.
Gap 3: doctor datastores --repair not tested
The new --repair command (core + extension repairNamespaceContamination method) has no UAT coverage. Test outline:
- Set up a contaminated state: Repo A pushes solo, Repo B connects with namespace, manually seed foreign objects under
{ns}/{foreignNs}/on S3/GCS doctor datastores --json— verify contamination is detecteddoctor datastores --repair --json— verify preview shows correct countsdoctor datastores --repair --confirm --json— verify cleanup completesdata query— verify data is now visible- Verify foreign objects deleted, own data intact
Gap 4: Shard v2 resilience not tested
The Cluster A fix (#1277/#1329) — readShard retry and assembleIndexFromShards error propagation — has no UAT coverage. Test outline:
- Push data, migrate to v2 shards (
datastore migrate-index) - Delete one shard object from S3/GCS (simulates transient unavailability)
- Attempt push — verify it fails with a clear error (not silent v1 downgrade)
- Verify
_meta.jsonremains version 2 - Restore the shard, push again — verify success
Gap 5: Solo-layout push skip not tested
The #1343 fix — namespaced push skips stale solo-layout files — has no UAT coverage. Test outline:
- Set up namespaced repo, generate data
- Seed stale solo-layout files at cache root (outside namespace dir)
sync --push— verify only namespaced files are pushed- Verify no solo-layout files appear on S3/GCS under the namespace
Affected files
src/cli/helpers/datastore_backend.ts—setupDatastoreWithNamespaceshould support--namespaceflagtests/cli/adversarial/namespace_isolation_test.ts— add gaps 2, 4, 5tests/cli/datastore/namespace/— add gap 3 (repair tests)tests/cli/datastore/namespace/regressions_test.ts— add gap 1
Open
No activity in this phase yet.
Sign in to post a ripple.