Skip to content

Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.

refactor(webv2): keep the project archive at manifest version 2

Josh Corbettac2f480f229c
diff --git a/docs/src/content/docs/development/Front End/project-files.mdx b/docs/src/content/docs/development/Front End/project-files.mdx
index c3b6cd3bfd..f3b71e3978 100644
--- a/docs/src/content/docs/development/Front End/project-files.mdx
+++ b/docs/src/content/docs/development/Front End/project-files.mdx
@@ -6,7 +6,7 @@ Workbench projects export to a portable `.invk` archive. The feature lives in `i
Import also accepts the `.invokeproject.json` envelope shipped by earlier webv2 builds. New exports use `.invk`; the JSON path remains read-only compatibility.
-`.invk` is shared with the previous frontend's [canvas projects](/development/front-end/canvas-projects/), which write version 1 of the same container. Workbench projects write version 3. The two are deliberately not interchangeable — see [Versions](#versions).
+`.invk` is shared with the previous frontend's [canvas projects](/development/front-end/canvas-projects/), which write version 1 of the same container. Workbench projects write version 2. The two are deliberately not interchangeable — see [Versions](#versions).
## Every project owns one board
@@ -19,17 +19,19 @@ The backend gives each project exactly one private board (`projects.board_id` is
## File format
-`.invk` files are ZIP archives. The current manifest version is `3`.
+`.invk` files are ZIP archives. The current manifest version is `2`.
| Target | Required | Description |
| --------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| `manifest.json` | yes | Archive version, app version, creation timestamp, project name, and optionally the source project id and the cover entry's path. |
| `project.json` | yes | The whole project document — the same payload the backend stores as the project record's opaque `data`. |
-| `board.json` | v3 | The project board's visible contents as the exporting server enumerated them: `{version: 1, items: [{kind, category, name, starred}]}`. |
+| `board.json` | yes\* | The project board's visible contents as the exporting server enumerated them: `{version: 1, items: [{kind, category, name, starred}]}`. |
| `cover.<ext>` | no | Thumbnail of the project's newest result. The extension varies by what the server served, so the entry path is recorded in the manifest. |
| `images/<image_name>` | no | Image bytes, keyed by the exact `image_name` the exporting server used. |
| `videos/<video_name>` | no | Video bytes, keyed the same way. |
+\* Every archive this app writes carries `board.json`. A reader still treats it as optional, because dev builds from before project boards wrote archives without it; its absence means "this file names no board", which is different from a board that was empty.
+
Assets are filed by kind rather than pooled. Images and videos are separate backend namespaces with separate fetch and upload routes, so import has to know which an entry is before it can restore it — the folder states that, where a shared one would leave it to be guessed from a file extension. Adding `videos/` needed no version bump: `readInvkArchive` ignores entries it does not recognize, so a reader predating it reads such an archive and simply leaves those references dangling, exactly as it would for an absent image.
The manifest is written indented and the document compact: the manifest is the one entry someone might open by hand, and the document is the largest thing in the archive before compression. Text entries are deflated; image entries are stored, since PNG and WEBP are already compressed.
@@ -130,13 +132,15 @@ On import the cover prefers an image the restore already put on this server —
## Versions
-Version 3 requires `board.json` and refuses an archive without it as `damaged`. Version 2 is still read and is deliberately *not* asked to carry board membership: an archive written before boards existed has no board to describe, and inventing an empty one for it would claim knowledge the file does not contain — so a v2 import restores its document references and lets the server create the new project an empty board. The archive's `board.json` carries its own `version: 1`, which is the *file's* version and not the API's: the snapshot endpoint returns `{items}` and nothing else, so neither format is pinned to the other.
+Adding `board.json` did **not** bump the manifest version. A version tells a reader what it may assume about a file *somebody else wrote*, and webv2 has not shipped — no archive exists anywhere that predates the entry except the ones dev builds produced, and those are read exactly as what they are: an archive that names no board, whose import restores document references and lets the server create the new project an empty board. Inventing an empty board for such a file would claim knowledge it does not contain, which is why "absent" and "empty" stay distinguishable in the reader.
+
+A malformed `board.json` is a different matter and is refused as `damaged`: half an enumeration is not a board. The entry carries its own `version: 1`, which is the *file's* version and not the API's — the snapshot endpoint returns `{items}` and nothing else, so neither format is pinned to the other.
Manifests parse through a zod discriminated union on `version`, so a version 1 archive is recognized and refused _as what it is_ — `InvkFormatError` carries a `reason` (`legacy-canvas-project`, `unsupported-version`, `not-a-project`, `damaged`, `too-large`) that `describeProjectFileError()` maps to a translated string. There is no translation layer from legacy canvas state to `CanvasStateContractV2`.
The legacy reader is the mirror image: it pins `version: 1` and refuses everything this app writes.
-Future format changes should add a new member to the union rather than widening version 3, so that every version this app has ever written can be named precisely when refused.
+Future format changes should add a new member to the union rather than widening version 2, so that every version this app has ever written can be named precisely when refused.
## Guards
diff --git a/invokeai/frontend/webv2/scripts/mock-backend-fixtures.mjs b/invokeai/frontend/webv2/scripts/mock-backend-fixtures.mjs
index 8e596daa92..49757ba998 100644
--- a/invokeai/frontend/webv2/scripts/mock-backend-fixtures.mjs
+++ b/invokeai/frontend/webv2/scripts/mock-backend-fixtures.mjs
@@ -69,7 +69,7 @@ export const assertMockBackendProfileName = (value) => {
export const PROJECT_FILE_BOARD = Object.freeze({
/** Generated, on the board, and drawn by the canvas: the overlap case. */
referencedImage: 'fixture-image-0002.png',
- /** Generated, on the board, referenced by nothing. Travels only because v3 enumerates the board. */
+ /** Generated, on the board, referenced by nothing. Travels only because the archive enumerates the board. */
unreferencedImage: 'fixture-image-0005.png',
/** An upload, filed under the `user` asset category. */
userAsset: 'fixture-image-0006.png',
diff --git a/invokeai/frontend/webv2/scripts/run-project-file-journey.mjs b/invokeai/frontend/webv2/scripts/run-project-file-journey.mjs
index fd7db77038..2b0495bca3 100644
--- a/invokeai/frontend/webv2/scripts/run-project-file-journey.mjs
+++ b/invokeai/frontend/webv2/scripts/run-project-file-journey.mjs
@@ -284,7 +284,7 @@ const runRoundTrip = async ({ backend, browser, contexts, errors, tempDirectory
const bundledImages = Object.keys(entries).filter((name) => name.startsWith('images/'));
const bundledVideos = Object.keys(entries).filter((name) => name.startsWith('videos/'));
- assert.equal(manifest.version, 3);
+ assert.equal(manifest.version, 2);
assert.equal(manifest.contents, 'workbench-project');
assert.equal(archivedBoard.version, 1);
assert.deepEqual(boardShape(archivedBoard.items), EXPECTED_BOARD_SHAPE);
diff --git a/invokeai/frontend/webv2/src/workbench/projects/invk/exportProject.test.ts b/invokeai/frontend/webv2/src/workbench/projects/invk/exportProject.test.ts
index 007b639b42..038056a1f7 100644
--- a/invokeai/frontend/webv2/src/workbench/projects/invk/exportProject.test.ts
+++ b/invokeai/frontend/webv2/src/workbench/projects/invk/exportProject.test.ts
@@ -136,7 +136,7 @@ describe('executeInvkExport', () => {
cover: 'cover.webp',
name: 'My project',
sourceProjectId: 'project-1',
- version: 3,
+ version: 2,
});
expect(JSON.parse(readEntryText(entries.get(INVK_DOCUMENT_ENTRY)!))).toEqual(projectDocument());
});
diff --git a/invokeai/frontend/webv2/src/workbench/projects/invk/format.ts b/invokeai/frontend/webv2/src/workbench/projects/invk/format.ts
index 0b8bc0af72..2748792f19 100644
--- a/invokeai/frontend/webv2/src/workbench/projects/invk/format.ts
+++ b/invokeai/frontend/webv2/src/workbench/projects/invk/format.ts
@@ -12,7 +12,18 @@
export const INVK_EXTENSION = '.invk';
export const INVK_MIME_TYPE = 'application/zip';
-export const INVK_VERSION = 3;
+
+/**
+ * Workbench projects are version 2 of this container; version 1 is the previous frontend's canvas
+ * project, which is refused by name.
+ *
+ * Board membership did not bump this. A version exists to tell a reader what it is allowed to
+ * assume about a file *someone else wrote*, and webv2 has not shipped — no v2 archive exists
+ * anywhere that predates `board.json`, so a version that distinguished them would describe a
+ * population of files with no members. An archive without the entry is still read (dev builds wrote
+ * some), and it means what its absence says: this file names no board.
+ */
+export const INVK_VERSION = 2;
/** Fixed entry paths. `cover` varies by image format and is named in the manifest. */
export const INVK_MANIFEST_ENTRY = 'manifest.json';
@@ -23,8 +34,8 @@ export const INVK_DOCUMENT_ENTRY = 'project.json';
*
* A project document only references the media it draws with. Everything else the project produced
* — results generated but never placed on canvas — is on its board and named nowhere in the
- * document, so a reader has no way to infer it. Version 3 states it, which is what makes an `.invk`
- * the project's workspace rather than only its canvas.
+ * document, so a reader has no way to infer it. This entry states it, which is what makes an
+ * `.invk` the project's workspace rather than only its canvas.
*/
export const INVK_BOARD_ENTRY = 'board.json';
diff --git a/invokeai/frontend/webv2/src/workbench/projects/invk/importProject.test.ts b/invokeai/frontend/webv2/src/workbench/projects/invk/importProject.test.ts
index bacca30884..c481896105 100644
--- a/invokeai/frontend/webv2/src/workbench/projects/invk/importProject.test.ts
+++ b/invokeai/frontend/webv2/src/workbench/projects/invk/importProject.test.ts
@@ -56,11 +56,12 @@ const validArchive = (overrides: Record<string, string | Uint8Array> = {}) =>
...overrides,
});
-const v3Archive = (overrides: Record<string, string | Uint8Array> = {}) =>
+/** The archive this app writes: a document, its bytes, and the project board it came from. */
+const boardArchive = (overrides: Record<string, string | Uint8Array> = {}) =>
archiveFile({
'board.json': boardEntry(),
'images/a.png': new Uint8Array([1, 2, 3]),
- 'manifest.json': JSON.stringify(manifest({ version: 3 })),
+ 'manifest.json': JSON.stringify(manifest()),
'project.json': JSON.stringify(document()),
...overrides,
});
@@ -84,53 +85,40 @@ describe('readInvkArchive', () => {
});
/**
- * An archive that predates boards genuinely has none, and an archive whose board was empty says
- * so. Discriminating on the version keeps those apart: only the first may have a board invented
- * for it.
+ * "This file names no board" and "this project's board was empty" are different answers, and the
+ * restore treats them differently — only the first may have an empty board invented for it. An
+ * archive with no `board.json` is one a build from before project boards wrote, not a broken one.
*/
- it('reads a v2 archive as having no board at all', async () => {
+ it('reads an archive with no board enumeration as naming no board', async () => {
const contents = await readInvkArchive(await validArchive());
- expect(contents.version).toBe(2);
expect(contents.boardSnapshot).toBeNull();
});
- it('reads and canonicalizes a v3 board enumeration', async () => {
+ it('reads and canonicalizes a board enumeration', async () => {
const contents = await readInvkArchive(
- await v3Archive({
+ await boardArchive({
'board.json': boardEntry([boardItem({ name: 'z.png' }), boardItem({ kind: 'video', name: 'a.mp4' })]),
})
);
- expect(contents.version).toBe(3);
// Sorted by kind then name, whatever order the writer used.
expect(contents.boardSnapshot?.items.map((item) => item.name)).toEqual(['z.png', 'a.mp4']);
});
- it('reads an empty v3 board without inventing anything', async () => {
- const contents = await readInvkArchive(await v3Archive({ 'board.json': boardEntry([]) }));
+ it('reads an empty board without inventing anything', async () => {
+ const contents = await readInvkArchive(await boardArchive({ 'board.json': boardEntry([]) }));
expect(contents.boardSnapshot).toEqual({ items: [], version: 1 });
});
- it('reports a v3 archive with no board enumeration as damaged', async () => {
- const blob = await writeArchive(
- new Map([
- ['manifest.json', textEntry(JSON.stringify(manifest({ version: 3 })))],
- ['project.json', textEntry(JSON.stringify(document()))],
- ])
- );
-
- await expect(readInvkArchive(new File([blob], 'project.invk'))).rejects.toMatchObject({ reason: 'damaged' });
- });
-
it.each([
['unparseable', 'not json'],
['a duplicate descriptor', JSON.stringify({ items: [boardItem(), boardItem()], version: 1 })],
['an unsafe name', JSON.stringify({ items: [boardItem({ name: '../escape.png' })], version: 1 })],
['an unknown version', JSON.stringify({ items: [], version: 2 })],
])('reports a board enumeration that is %s as damaged', async (_case, contents) => {
- await expect(readInvkArchive(await v3Archive({ 'board.json': contents }))).rejects.toMatchObject({
+ await expect(readInvkArchive(await boardArchive({ 'board.json': contents }))).rejects.toMatchObject({
reason: 'damaged',
});
});
@@ -303,7 +291,7 @@ describe('restoreArchiveMedia', () => {
* board media, and the layer follows it to the copy.
*/
it('restores an overlapping item once and points the document at the copy', async () => {
- const archive = await readInvkArchive(await v3Archive());
+ const archive = await readInvkArchive(await boardArchive());
const ledger = createRestoredMediaLedger('staging');
const uploadImage = vi.fn(() => Promise.resolve({ height: 1, imageName: 'never', width: 1 }));
@@ -318,10 +306,10 @@ describe('restoreArchiveMedia', () => {
expect(ledger).toMatchObject({ boardImageNames: ['board-a.png'], imageNames: [] });
});
- /** Unreferenced board media is exactly what v3 exists to carry. */
+ /** Unreferenced board media is exactly what `board.json` exists to carry. */
it('restores board media the document never mentions', async () => {
const archive = await readInvkArchive(
- await v3Archive({
+ await boardArchive({
'board.json': boardEntry([boardItem({ name: 'unreferenced.png', starred: true })]),
'images/unreferenced.png': new Uint8Array([5]),
})
@@ -342,7 +330,7 @@ describe('restoreArchiveMedia', () => {
expect(ledger.imageNames).toEqual(['loose-a.png']);
});
- it('restores a v2 archive as document references only, with no board media', async () => {
+ it('restores an archive with no board as document references only', async () => {
const archive = await readInvkArchive(await validArchive());
const ledger = createRestoredMediaLedger(null);
@@ -356,7 +344,7 @@ describe('restoreArchiveMedia', () => {
expect(ledger).toMatchObject({ boardImageNames: [], boardVideoNames: [], imageNames: ['loose-a.png'] });
});
- it('deduplicates a v2 reference the destination already has', async () => {
+ it('deduplicates a document reference the destination already has', async () => {
const archive = await readInvkArchive(await validArchive());
const ledger = createRestoredMediaLedger(null);
const uploadImage = vi.fn(() => Promise.resolve({ height: 1, imageName: 'never', width: 1 }));
@@ -373,7 +361,7 @@ describe('restoreArchiveMedia', () => {
it('announces a bundled video as a video, whatever its extension', async () => {
const archive = await readInvkArchive(
- await v3Archive({
+ await boardArchive({
'board.json': boardEntry([boardItem({ kind: 'video', name: 'clip.unknown' })]),
'videos/clip.unknown': new Uint8Array([7]),
})
diff --git a/invokeai/frontend/webv2/src/workbench/projects/invk/importProject.ts b/invokeai/frontend/webv2/src/workbench/projects/invk/importProject.ts
index 6cc26cefcd..a323f98f00 100644
--- a/invokeai/frontend/webv2/src/workbench/projects/invk/importProject.ts
+++ b/invokeai/frontend/webv2/src/workbench/projects/invk/importProject.ts
@@ -29,10 +29,10 @@ import { toMediaRefs } from './transfer';
* Reading an `.invk` back, in two steps a caller can put a decision between.
*
* {@link readInvkArchive} is pure inspection: unpack, validate the manifest, parse the document and
- * — for a v3 archive — the board enumeration, then index the bundled bytes. It touches no network
- * and mutates nothing, so a caller can read a file, discover it is a legacy canvas project, and say
- * so without having created anything. Everything structural fails here, before a board or a single
- * uploaded image exists.
+ * the board enumeration, then index the bundled bytes. It touches no network and mutates nothing, so
+ * a caller can read a file, discover it is a legacy canvas project, and say so without having
+ * created anything. Everything structural fails here, before a board or a single uploaded image
+ * exists.
*
* {@link restoreArchiveMedia} is the part with consequences. It is a thin wiring of
* `restoreProjectMedia`, which is shared with duplication: this module supplies the one thing that
@@ -45,7 +45,15 @@ import { toMediaRefs } from './transfer';
/** Simultaneous uploads. Matches the previous frontend's limit. */
const BOARD_UPLOAD_CONCURRENCY = 5;
-interface InvkArchiveBase {
+export interface InvkArchiveContents {
+ /**
+ * What the project's board held, or `null` for an archive that names no board.
+ *
+ * `null` and `{items: []}` are deliberately different answers. "This file does not describe a
+ * board" calls for the server to create an empty one; "this project's board was empty" is a fact
+ * the restore already knows. Only the first may have a board invented for it.
+ */
+ boardSnapshot: InvkBoardSnapshot | null;
/** Bundled preview bytes and the entry they came from, when the archive has one. */
cover: { bytes: Uint8Array; entryName: string } | null;
/** Bundled image bytes, keyed by the image name the exporting server used. */
@@ -56,25 +64,6 @@ interface InvkArchiveBase {
videos: Map<string, Uint8Array>;
}
-/** An archive written before board membership travelled: the document and its bytes, nothing else. */
-export interface InvkArchiveV2 extends InvkArchiveBase {
- boardSnapshot: null;
- version: 2;
-}
-
-/** An archive that also states what was on the project's board. */
-export interface InvkArchiveV3 extends InvkArchiveBase {
- boardSnapshot: InvkBoardSnapshot;
- version: 3;
-}
-
-/**
- * Discriminated on the version rather than carrying an optional snapshot, so "this archive predates
- * boards" and "this archive's board was empty" cannot be confused — they call for different
- * restores, and only one of them is allowed to invent an empty board.
- */
-export type InvkArchiveContents = InvkArchiveV2 | InvkArchiveV3;
-
const parseDocumentEntry = (bytes: Uint8Array): Record<string, unknown> => {
let parsed: unknown;
@@ -91,11 +80,18 @@ const parseDocumentEntry = (bytes: Uint8Array): Record<string, unknown> => {
return parsed as Record<string, unknown>;
};
-const parseBoardEntry = (entries: ReadonlyMap<string, Uint8Array>): InvkBoardSnapshot => {
+/**
+ * The board enumeration, or `null` when the archive carries none.
+ *
+ * Absent is a valid archive — a build from before project boards wrote one — but *malformed* is
+ * not: an enumeration that cannot be trusted has to fail before anything is created, because half
+ * of it is not a board.
+ */
+const parseBoardEntry = (entries: ReadonlyMap<string, Uint8Array>): InvkBoardSnapshot | null => {
const entry = entries.get(INVK_BOARD_ENTRY);
if (!entry) {
- throw new InvkFormatError('damaged', `Archive has no ${INVK_BOARD_ENTRY}.`);
+ return null;
}
try {
@@ -151,9 +147,9 @@ export const readInvkArchive = async (file: File): Promise<InvkArchiveContents>
throw new InvkFormatError('damaged', `Archive has no ${INVK_DOCUMENT_ENTRY}.`);
}
- // Before the bytes are indexed: a v3 archive whose enumeration is malformed must create nothing,
+ // Before the bytes are indexed: an archive whose enumeration is malformed must create nothing,
// and the enumeration is what decides which of those bytes are board media at all.
- const boardSnapshot = manifest.version === 3 ? parseBoardEntry(entries) : null;
+ const boardSnapshot = parseBoardEntry(entries);
const images = new Map<string, Uint8Array>();
const videos = new Map<string, Uint8Array>();
@@ -175,17 +171,15 @@ export const readInvkArchive = async (file: File): Promise<InvkArchiveContents>
}
const coverBytes = manifest.cover === undefined ? undefined : entries.get(manifest.cover);
- const contents = {
+
+ return {
+ boardSnapshot,
cover: coverBytes === undefined ? null : { bytes: coverBytes, entryName: manifest.cover! },
images,
manifest,
projectDocument: parseDocumentEntry(documentEntry),
videos,
};
-
- return boardSnapshot === null
- ? { ...contents, boardSnapshot: null, version: 2 }
- : { ...contents, boardSnapshot, version: 3 };
};
export interface ArchiveBoardUploadDeps {
@@ -203,7 +197,7 @@ export interface ArchiveBoardUploadDeps {
* so its absence is a loss worth naming.
*/
export const createArchiveMediaMaterializer = (
- archive: Pick<InvkArchiveBase, 'images' | 'videos'>,
+ archive: Pick<InvkArchiveContents, 'images' | 'videos'>,
deps: ArchiveBoardUploadDeps = {}
): MediaMaterializer => {
const uploadImage = deps.uploadBoardImage ?? uploadBoardImage;
@@ -264,8 +258,8 @@ export type RestoreArchiveMediaDeps = ArchiveBoardUploadDeps &
* Make an archive's media exist on this server: board items onto the staging board under fresh
* identities, document-only references deduplicated against what is already here.
*
- * A v2 archive has no board, so this is exactly the v2 restore it always was — the shared engine
- * simply sees an empty descriptor list.
+ * An archive that names no board restores its document references and nothing else — the shared
+ * engine simply sees an empty descriptor list.
*/
export const restoreArchiveMedia = (
archive: InvkArchiveContents,
diff --git a/invokeai/frontend/webv2/src/workbench/projects/invk/manifest.ts b/invokeai/frontend/webv2/src/workbench/projects/invk/manifest.ts
index b6cb04b032..333fe41ecd 100644
--- a/invokeai/frontend/webv2/src/workbench/projects/invk/manifest.ts
+++ b/invokeai/frontend/webv2/src/workbench/projects/invk/manifest.ts
@@ -10,29 +10,30 @@ import { INVK_EXTENSION, INVK_VERSION, InvkFormatError } from './format';
* createdAt, name}` — alongside an `images/` folder keyed by backend image name.
* That container is kept verbatim. Version 2 changes only the payload: where a
* v1 archive carried four canvas-shaped state files, a v2 archive carries one
- * `project.json` holding the whole workbench project document, plus an optional
- * cover. Version 3 adds `board.json`, the project board's contents — the part of
- * a project that the document does not reference and a reader cannot infer.
+ * `project.json` holding the whole workbench project document, `board.json`
+ * describing the project's board, and an optional cover.
*
* ```
* <name>.invk
* ├── manifest.json this file's shape
- * ├── project.json the project document (v2 and v3)
- * ├── board.json the project board's visible contents (v3 only)
+ * ├── project.json the project document
+ * ├── board.json the project board's visible contents
* ├── cover.<ext> optional preview; the entry name is recorded here
* ├── images/<image_name> bytes, named exactly as the server names them
* └── videos/<video_name> the same, for the other namespace
* ```
*
- * Parsing is a discriminated union rather than a strict `z.literal(3)` so that
+ * Parsing is a discriminated union rather than a strict `z.literal(2)` so that
* every version this app has written can be named precisely when refused. "This
* is a canvas project from an earlier version" is a sentence someone can act on;
* a zod issue list is not. The legacy reader is the mirror image — it pins
* `version: 1` and will refuse the others, which is correct and needs no change.
*
- * Version 2 is still read, and is deliberately not asked to carry board
- * membership: an archive written before boards existed has no board to describe,
- * and inventing one for it would claim knowledge the file does not contain.
+ * Adding `board.json` did not bump the version, because a version tells a reader
+ * what it may assume about a file *someone else wrote* and no such file predates
+ * the entry — webv2 has not shipped. A reader treats the entry as optional and
+ * its absence as "this archive names no board", which is exactly what a dev build
+ * from before boards produced.
*
* The names and the error class live in `./format`, which carries no zod, so
* that the file picker and the error toast do not drag the schema into the
@@ -59,15 +60,13 @@ const zManifestV2 = z.object({
version: z.literal(2),
});
-const zManifestV3 = zManifestV2.extend({ version: z.literal(3) });
+const zManifest = z.discriminatedUnion('version', [zManifestV1, zManifestV2]);
-const zManifest = z.discriminatedUnion('version', [zManifestV1, zManifestV2, zManifestV3]);
-
-/** A manifest this app can read: v2 or v3, which differ only in what else the archive holds. */
-export type InvkManifest = z.infer<typeof zManifestV2> | z.infer<typeof zManifestV3>;
+/** A manifest this app can read: the workbench project container. */
+export type InvkManifest = z.infer<typeof zManifestV2>;
/**
- * Accepts a v2 or v3 manifest; throws {@link InvkFormatError} for anything else.
+ * Accepts a v2 manifest; throws {@link InvkFormatError} for anything else.
* Never returns a v1 manifest — recognizing v1 exists only to name the refusal.
*/
export const parseInvkManifest = (data: unknown): InvkManifest => {
diff --git a/invokeai/frontend/webv2/src/workbench/projects/projectFile.test.ts b/invokeai/frontend/webv2/src/workbench/projects/projectFile.test.ts
index a439d86cd9..323942f43c 100644
--- a/invokeai/frontend/webv2/src/workbench/projects/projectFile.test.ts
+++ b/invokeai/frontend/webv2/src/workbench/projects/projectFile.test.ts
@@ -18,7 +18,7 @@ const api = vi.hoisted(() => ({
deleteClientStateValue: vi.fn(() => Promise.resolve()),
getClientStateValue: vi.fn(() => Promise.resolve(null)),
getProject: vi.fn(),
- // Every export enumerates the project's board; an empty one is the v2-shaped default.
+ // Every export enumerates the project's board; most of these cases do not care what is on it.
getProjectBoardSnapshot: vi.fn((): Promise<{ items: ProjectBoardItemDTO[] }> => Promise.resolve({ items: [] })),
isProjectNotFoundError: (error: unknown) =>
typeof error === 'object' && error !== null && 'status' in error && error.status === 404,
@@ -309,7 +309,7 @@ describe('what a transfer reports', () => {
});
/**
- * The v3 half: an archive carries the project's board, and importing it gives that board's media
+ * The board half: an archive carries the project's board, and importing it gives that board's media
* new identities on a staging board the create then claims. Nothing here may reuse a name the
* destination already holds — `board_images` keys on the image name, so a reused name would move a
* stranger's picture onto this project's board instead of copying it.
@@ -454,7 +454,7 @@ describe('importing a project board', () => {
contents: 'workbench-project',
createdAt: '',
name: 'No layout',
- version: 3,
+ version: 2,
})
),
],