@bitmagic/cli 0.1.42 → 0.1.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -115,6 +115,8 @@ my-game/
115
115
  build/
116
116
  index.html # bitmagic build's output bundle
117
117
  manifest.json # engineVersion, fingerprint, bytes, sha256, builtAt
118
+ publish/
119
+ source.zip # the source archive each publish uploads (see Publishing)
118
120
  verify/
119
121
  result.json # bitmagic verify's verdict — ok, failures, warnings, fingerprint, at, renderer, settle, snapshot
120
122
  screenshot.png # the publish thumbnail when there is no cover art (not written by --fast runs)
@@ -355,13 +357,33 @@ before `--force` has anything to work with.
355
357
  stick — and note that writing them into `game.json` yourself would change the fingerprint and
356
358
  invalidate the verify you just checked.
357
359
 
360
+ ### The source archive
361
+
362
+ Every publish also uploads a **source archive** — `.bitmagic/publish/source.zip` — alongside the
363
+ bundle. It carries your game's source (`src/work/`, `index.html`, the configs, `bitmagic.json`,
364
+ `GAME-DESIGN.md`, `mechanics-plan.md`) plus a manifest of file hashes. The vendored `engine/` tree
365
+ is hashed but not included: it is platform code, identical for everyone on your engine version, and
366
+ shipping ~14MB of it on every publish would serve nobody.
367
+
368
+ **The archive is uploaded to a publicly readable URL.** The address contains a random component, so
369
+ it cannot be guessed from your game's id or its play URL, but anyone given the link can download it.
370
+ Files that look like credentials — `.env*`, `*.pem`, `*.key`, `id_rsa*`, `.npmrc`,
371
+ `.git-credentials`, `*service-account*.json`, `.claude/settings.local.json` — are **never** put in
372
+ the archive, and publish prints a line naming any it left out. That list will never be exhaustive:
373
+ if your project directory holds a secret in some other shape, move it out before publishing.
374
+
375
+ Bitmagic uses the archive to sanity-check publishes: that the source matches the fingerprint the
376
+ verify gate checked, and that the engine you built against has not been modified. Findings are
377
+ advisory and printed as `warning:` lines — they never block a publish. The one thing that *is*
378
+ refused is a bundle that is not a Bitmagic engine build at all (exit 1).
379
+
358
380
  ### Exit codes
359
381
 
360
382
  `bitmagic publish` uses these to let a script or agent branch without parsing the message:
361
383
 
362
384
  | Code | Meaning |
363
385
  |---|---|
364
- | 1 | Build failed |
386
+ | 1 | Build failed, or the uploaded bundle was not a Bitmagic engine build (check `vite.publish.config.js`). Not retryable — republishing the same bytes gets the same refusal. |
365
387
  | 2 | Not logged in |
366
388
  | 3 | Verify missing, stale, or failed |
367
389
  | 5 | Not the game's owner, or the account/game is banned |
@@ -40,12 +40,13 @@ import { coverImagePath } from './cover.js';
40
40
  import { resolveEnvironment, resolveAuth0ClientId } from '../config/environments.js';
41
41
  import { readDefaultEnvironment } from '../config/credentials.js';
42
42
  import { getAccessToken } from '../auth/session.js';
43
- import { computeFingerprint } from '../publish/fingerprint.js';
43
+ import { buildSourceIndex } from '../publish/fingerprint.js';
44
+ import { buildSourceArchive } from '../publish/source-zip.js';
44
45
  import { readVerifyRecord } from '../verify/result.js';
45
46
  import { readFaviconOverride } from '../publish/favicon.js';
46
47
  import { checkVerifyGate, injectMetaBlock } from '../publish/meta-block.js';
47
48
  import { runBuild as runBuildImpl, readBuildManifest as readBuildManifestImpl, buildBundlePaths, } from '../publish/bundle.js';
48
- import { beginPublish, completePublish, putBundle, requestThumbnailUploadUrl, putThumbnail, } from '../publish/client.js';
49
+ import { beginPublish, completePublish, putBundle, putSourceArchive, requestThumbnailUploadUrl, putThumbnail, } from '../publish/client.js';
49
50
  /** Where `bitmagic verify` writes its record and screenshot — see `commands/verify.ts`. */
50
51
  function verifyArtifactDir(root) {
51
52
  return path.join(root, '.bitmagic', 'verify');
@@ -153,7 +154,10 @@ export async function runPublish(args, deps = defaultDeps()) {
153
154
  ...(args.description !== undefined ? { description: args.description } : {}),
154
155
  };
155
156
  const context = loadProjectContext(deps.startDir);
156
- const fingerprint = computeFingerprint(context.root);
157
+ // One walk, two consumers: the staleness gate below and the source archive further down. Walking
158
+ // twice would let an edit land between them and would give the exclusion rules two call sites.
159
+ const sourceIndex = buildSourceIndex(context.root);
160
+ const fingerprint = sourceIndex.fingerprint;
157
161
  const gate = checkVerifyGate(readVerifyRecord(verifyArtifactDir(context.root)), fingerprint, force);
158
162
  if (!gate.ok)
159
163
  throw new CliError(gate.message, 3);
@@ -173,6 +177,28 @@ export async function runPublish(args, deps = defaultDeps()) {
173
177
  // routes through the Output seam that `--json` redirects to stderr.
174
178
  const thumbnail = await uploadThumbnail(context, environment, token, apiDeps, log);
175
179
  const thumbnailUrl = thumbnail.url;
180
+ // The source archive is built BEFORE begin, because its hash is what begin binds into the meta
181
+ // block — see BeginPublishRequest.sourceSha256. Best-effort throughout: this is a notification
182
+ // and audit artifact, and a game that builds and verifies must still ship when zipping fails.
183
+ let archive = null;
184
+ try {
185
+ archive = await buildSourceArchive({
186
+ root: context.root,
187
+ index: sourceIndex,
188
+ gameId: context.metadata.gameId,
189
+ engineVersion: context.metadata.engineVersion,
190
+ genre: context.metadata.genre,
191
+ });
192
+ if (archive.secretsOmitted.length > 0) {
193
+ // Named, not silently dropped. A creator who keeps a credential in the project should learn
194
+ // that the archive skipped it — both so they trust the archive's contents and so they know
195
+ // the file was there to begin with.
196
+ log(`Source archive: left out ${archive.secretsOmitted.length} credential-shaped file(s): ${archive.secretsOmitted.join(', ')}`);
197
+ }
198
+ }
199
+ catch (error) {
200
+ log(`Source archive could not be built (${error instanceof Error ? error.message : String(error)}) — publishing without it.`);
201
+ }
176
202
  // No bundleBytes/sha256 sent here — see BeginPublishRequest's doc comment in publish/client.ts.
177
203
  // The only honest number for those fields is the size/hash of the bundle AFTER the meta block
178
204
  // below is injected, and that block (and the publishVersion inside it) isn't known until THIS
@@ -184,6 +210,7 @@ export async function runPublish(args, deps = defaultDeps()) {
184
210
  engineVersion: context.metadata.engineVersion,
185
211
  thumbnailUrl,
186
212
  faviconSourceUrl: readFaviconOverride(context.root),
213
+ ...(archive ? { sourceSha256: archive.sha256 } : {}),
187
214
  }, apiDeps);
188
215
  const { htmlPath } = buildBundlePaths(context.root);
189
216
  let builtHtml;
@@ -213,6 +240,19 @@ export async function runPublish(args, deps = defaultDeps()) {
213
240
  // signed PUT whose headers don't match what was signed. Omitting it does not produce a stale
214
241
  // cache — it produces a 403 on upload. `cli-uploads.ts` established the same pattern.
215
242
  await putBundle(begun.signedUrl, publishedHtml, begun.cacheControl, apiDeps);
243
+ // The archive rides the same signed-PUT pattern as the bundle. Uploaded AFTER the bundle so a
244
+ // failure here cannot cost a publish that was otherwise complete, and swallowed for the same
245
+ // reason the build was: `complete` reports "no archive to audit" as a warning, not a refusal.
246
+ let sourceUploaded = false;
247
+ if (archive && begun.sourceSignedUrl && begun.sourceCacheControl) {
248
+ try {
249
+ await putSourceArchive(begun.sourceSignedUrl, fs.readFileSync(archive.filePath), begun.sourceCacheControl, apiDeps);
250
+ sourceUploaded = true;
251
+ }
252
+ catch (error) {
253
+ log(`Source archive upload failed (${error instanceof Error ? error.message : String(error)}) — the game still publishes.`);
254
+ }
255
+ }
216
256
  // `visibility`, `name`, `description`, and `thumbnailUrl` are all re-sent, not implied.
217
257
  // `complete` re-authorizes against its OWN body — `begin` writes nothing, so nothing it
218
258
  // validated is bound — and an absent visibility defaults to private. Omitting them here would
@@ -234,6 +274,12 @@ export async function runPublish(args, deps = defaultDeps()) {
234
274
  // are declarative (logged, never verified) and why engineVersion here is not a second gate.
235
275
  engineVersion: context.metadata.engineVersion,
236
276
  fingerprint,
277
+ // Only claimed when the archive actually landed — declaring a key the server would then fail
278
+ // to read turns a best-effort artifact into a warning about our own plumbing.
279
+ ...(sourceUploaded && archive && begun.sourceKey
280
+ ? { sourceKey: begun.sourceKey, sourceSha256: archive.sha256 }
281
+ : {}),
282
+ fingerprintAlgo: sourceIndex.algo,
237
283
  }, apiDeps);
238
284
  // Nudge, never a gate — and printed BEFORE the publish result so it does not read as a
239
285
  // failure of the publish that just succeeded.
@@ -244,6 +290,10 @@ export async function runPublish(args, deps = defaultDeps()) {
244
290
  if (done.visibility === 'private') {
245
291
  log('Not listed. Publish with --visibility public when you are ready.');
246
292
  }
293
+ // Advisory only — the publish already succeeded, and none of these change the exit code. Printed
294
+ // in the same ` warning:` shape the smoke check uses below so one prose convention covers both.
295
+ for (const warning of done.sourceChecks?.warnings ?? [])
296
+ log(` warning: ${warning}`);
247
297
  output.result({
248
298
  ok: true,
249
299
  url: done.url,
@@ -251,6 +301,7 @@ export async function runPublish(args, deps = defaultDeps()) {
251
301
  publishVersion: done.publishVersion,
252
302
  gameId: context.metadata.gameId,
253
303
  thumbnailSource: thumbnail.source,
304
+ ...(done.sourceChecks ? { sourceChecks: done.sourceChecks } : {}),
254
305
  });
255
306
  // Everything below runs AFTER the game is live. `complete` has written the bytes and the row,
256
307
  // so nothing here can un-publish anything — this stage only decides what we tell the creator.
@@ -1 +1 @@
1
- {"version":3,"file":"publish.js","sourceRoot":"","sources":["../../src/commands/publish.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAuB,MAAM,uBAAuB,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAoB,MAAM,2BAA2B,CAAC;AACvG,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,cAAc,EAA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,EAAE,CAAC,CAAC;IACnE,IAAI,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC;QACd,6FAA6F;QAC7F,+FAA+F;QAC/F,MAAM,IAAI,QAAQ,CAChB,6BAA6B,IAAI,CAAC,GAAG,kDAAkD;YACrF,qBAAqB,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI;YACzE,cAAc,QAAQ,IAAI;YAC1B,kFAAkF,EACpF,CAAC,CACF,CAAC;IACJ,CAAC;IACD,GAAG,CAAC,kDAAkD,CAAC,CAAC;AAC1D,CAAC;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAAC;IAC1C,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,gFAAgF;KAC9F;IACD,IAAI,EAAE;QACJ,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,4EAA4E;SAC1F;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,iFAAiF;SAC/F;QACD,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,wFAAwF;SACtG;QACD,KAAK,EAAE;YACL,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,oFAAoF;SAClG;QACD,YAAY,EAAE;YACZ,IAAI,EAAE,SAAS;YACf,WAAW,EACT,qGAAqG;SACxG;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,kEAAkE;SAChF;KACF;IACD,KAAK,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE;QAChB,MAAM,UAAU,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC;CACF,CAAC,CAAC"}
@@ -24,6 +24,21 @@ export interface BeginPublishRequest {
24
24
  * server simply ignores a field it does not read — the game then keeps its default icon.
25
25
  */
26
26
  faviconSourceUrl?: string;
27
+ /**
28
+ * sha256 of the source archive this publish is about to upload.
29
+ *
30
+ * Sent on BEGIN, unlike everything else about the archive, because `begin` bakes it into the
31
+ * meta block it mints — which is the whole mechanism: `complete` already verifies that block
32
+ * byte-for-byte against what actually landed, so binding the archive's hash into it makes the
33
+ * published bundle carry a claim about which source produced it, at no extra read. That is only
34
+ * possible if the archive is built and hashed BEFORE this call, which is why `runPublish`
35
+ * zips before it begins.
36
+ *
37
+ * Optional: a failure to build the archive must not fail the publish, and an older server
38
+ * ignores a field it does not read (it then mints a block without the line, and `complete`
39
+ * re-renders without it too — see `renderMetaBlock`).
40
+ */
41
+ sourceSha256?: string;
27
42
  }
28
43
  export interface BeginPublishResponse {
29
44
  signedUrl: string;
@@ -44,6 +59,18 @@ export interface BeginPublishResponse {
44
59
  * CLI says nothing rather than guessing.
45
60
  */
46
61
  currentEngineVersion: string | null;
62
+ /**
63
+ * Where to PUT the source archive, and the key it lands at.
64
+ *
65
+ * The server mints the key (it carries a random segment, so the archive cannot be enumerated
66
+ * from a game's public id) — the CLI never proposes one. Both absent when no `sourceSha256`
67
+ * was sent, or when talking to a server that predates this; the CLI then simply publishes
68
+ * without an archive, exactly as it did before.
69
+ */
70
+ sourceSignedUrl?: string;
71
+ sourceKey?: string;
72
+ /** Must be echoed on the archive PUT — bound into the signature, same contract as the bundle. */
73
+ sourceCacheControl?: string;
47
74
  }
48
75
  export declare function beginPublish(environment: Environment, accessToken: string, body: BeginPublishRequest, deps: ApiDeps): Promise<BeginPublishResponse>;
49
76
  export interface CompletePublishRequest {
@@ -74,11 +101,36 @@ export interface CompletePublishRequest {
74
101
  */
75
102
  engineVersion: string;
76
103
  fingerprint: string;
104
+ /**
105
+ * The source archive that was uploaded, so `complete` can audit it: the key `begin` minted
106
+ * (echoed, not proposed — the server re-derives the expected shape and refuses anything else)
107
+ * and the hash that was bound into the meta block.
108
+ *
109
+ * All three optional together. They are absent when the archive could not be built, and absent
110
+ * from every already-installed CLI — so `complete` must treat missing as "cannot check", not as
111
+ * a failure. Making them required would break every publish in the field the moment the server
112
+ * deploys.
113
+ */
114
+ sourceKey?: string;
115
+ sourceSha256?: string;
116
+ /**
117
+ * Which fingerprint algorithm produced `fingerprint`. The server keeps every version it has
118
+ * shipped and dispatches on this, because a creator's pinned CLI and the running server are
119
+ * routinely different copies of the shared code — see SOURCE_INDEX_ALGO.
120
+ */
121
+ fingerprintAlgo?: string;
122
+ }
123
+ /** Per-check outcome from the server's source audit. Advisory: none of it changes the exit code. */
124
+ export interface SourceCheckResult {
125
+ status: 'pass' | 'warn' | 'skip';
126
+ warnings?: string[];
77
127
  }
78
128
  export interface CompletePublishResponse {
79
129
  url: string;
80
130
  publishVersion: number;
81
131
  visibility: 'public' | 'private';
132
+ /** Absent from an older server; the CLI then prints nothing. */
133
+ sourceChecks?: SourceCheckResult;
82
134
  }
83
135
  export declare function completePublish(environment: Environment, accessToken: string, body: CompletePublishRequest, deps: ApiDeps): Promise<CompletePublishResponse>;
84
136
  /**
@@ -89,6 +141,14 @@ export declare function completePublish(environment: Environment, accessToken: s
89
141
  export declare const PUBLISH_BUNDLE_CONTENT_TYPE = "text/html";
90
142
  /** PUT the built (and meta-block-injected) bundle to the signed URL `begin` minted. */
91
143
  export declare function putBundle(signedUrl: string, html: string, cacheControl: string, deps: ApiDeps): Promise<void>;
144
+ /**
145
+ * `begin` signs the source archive as `application/zip`. Fixed here for the same reason as
146
+ * PUBLISH_BUNDLE_CONTENT_TYPE: the response echoes no content type because there is nothing to
147
+ * echo — this is the one value the signature can have been minted with.
148
+ */
149
+ export declare const PUBLISH_SOURCE_CONTENT_TYPE = "application/zip";
150
+ /** PUT the source archive to the signed URL `begin` minted. */
151
+ export declare function putSourceArchive(signedUrl: string, body: Uint8Array, cacheControl: string, deps: ApiDeps): Promise<void>;
92
152
  export interface ThumbnailUploadRequest {
93
153
  gameId: string;
94
154
  filename: string;
@@ -37,6 +37,12 @@ export function publishExitCode(status, body) {
37
37
  return 5;
38
38
  if (status === 409 && body.code === 'engine-below-floor')
39
39
  return 4;
40
+ // "What you uploaded is not an engine build" is a BUILD failure, not a transient upload one.
41
+ // Mapping it to 6 alongside network errors would tell an agent to retry, and a retry re-uploads
42
+ // the identical bytes and gets the identical refusal — a loop with no exit. Exit 1 is the code
43
+ // whose documented remedy is "look at the build", which is the only thing that can fix this.
44
+ if (status === 409 && body.code === 'not-an-engine-build')
45
+ return 1;
40
46
  return 6;
41
47
  }
42
48
  /**
@@ -131,6 +137,16 @@ export const PUBLISH_BUNDLE_CONTENT_TYPE = 'text/html';
131
137
  export async function putBundle(signedUrl, html, cacheControl, deps) {
132
138
  await putSignedUrl(signedUrl, html, { 'Content-Type': PUBLISH_BUNDLE_CONTENT_TYPE, 'Cache-Control': cacheControl }, deps);
133
139
  }
140
+ /**
141
+ * `begin` signs the source archive as `application/zip`. Fixed here for the same reason as
142
+ * PUBLISH_BUNDLE_CONTENT_TYPE: the response echoes no content type because there is nothing to
143
+ * echo — this is the one value the signature can have been minted with.
144
+ */
145
+ export const PUBLISH_SOURCE_CONTENT_TYPE = 'application/zip';
146
+ /** PUT the source archive to the signed URL `begin` minted. */
147
+ export async function putSourceArchive(signedUrl, body, cacheControl, deps) {
148
+ await putSignedUrl(signedUrl, body, { 'Content-Type': PUBLISH_SOURCE_CONTENT_TYPE, 'Cache-Control': cacheControl }, deps);
149
+ }
134
150
  export async function requestThumbnailUploadUrl(environment, accessToken, body, deps) {
135
151
  return postJson(`${environment.apiUrl}/api/cli/v1/uploads/signed-url`, accessToken, body, deps);
136
152
  }
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/publish/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAYxC,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,C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KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;AAC7D,CAAC"}
@@ -1,27 +1,33 @@
1
+ import { type SourceIndex } from '@bitmagic/asset-core/publish-source';
2
+ export { SOURCE_INDEX_ALGO } from '@bitmagic/asset-core/publish-source';
3
+ export type { SourceIndex, SourceIndexEntry } from '@bitmagic/asset-core/publish-source';
1
4
  /**
2
5
  * A relative path as the fingerprint hashes it: always forward-slashed.
3
6
  *
4
- * `sep` is a parameter rather than a direct `path.sep` read so this is testable on any
5
- * platform the Windows behaviour that makes normalization necessary cannot otherwise be
6
- * exercised on the POSIX runners CI uses, which is exactly how a vacuous test gets written.
7
+ * Re-exported through this module (rather than having callers reach into the shared package) so
8
+ * the CLI keeps one import site for path normalisation, and defaults to the host's separator —
9
+ * the shared version defaults to '/' because it is given already-normalised zip entry names.
7
10
  */
8
11
  export declare function toPosixPath(relativePath: string, sep?: string): string;
9
12
  /**
10
- * A hash of everything that determines the published bundle.
13
+ * Every fingerprinted file in the project, hashed, plus the fingerprint they roll up to.
11
14
  *
12
- * This is what lets `publish` decide whether a `verify` is too stale to trust, by CONTENT
13
- * rather than by clock: a timestamp policy would accept an edit made one second after
14
- * verifying and reject an untouched project that merely sat overnight.
15
- *
16
- * The path is hashed alongside the content so that moving a file — which changes what the
17
- * bundle imports — changes the fingerprint even though no byte of any file did.
18
- *
19
- * Kept deliberately coarse (every tracked file, not a module graph): a false "stale" costs one
20
- * `bitmagic verify`, while a false "fresh" ships an unverified bundle.
15
+ * One walk per publish. `runPublish` calls this once and feeds the SAME result to both the
16
+ * staleness gate and the source archive previously the tree was walked twice (once to
17
+ * fingerprint, once to build the artifact), which opened a window for an edit to land between
18
+ * them and gave the exclusion rules two call sites that could drift.
21
19
  *
22
20
  * Any filesystem error (unreadable directory, permission denied, etc.) propagates immediately
23
21
  * rather than being silently omitted: the project source is the creator's own files, so an
24
22
  * unreadable subtree is a real problem worth surfacing, not something to hide. An omitted
25
23
  * directory would produce a fingerprint that matches a stale project — the costly failure mode.
26
24
  */
25
+ export declare function buildSourceIndex(root: string): SourceIndex;
26
+ /**
27
+ * The project's fingerprint on its own.
28
+ *
29
+ * Kept as the entry point for the callers that only need the hash (`verify`, `build`), so they
30
+ * do not have to know an index exists. `publish` uses `buildSourceIndex` directly because it
31
+ * needs both halves.
32
+ */
27
33
  export declare function computeFingerprint(root: string): string;
@@ -1,99 +1,103 @@
1
- import { createHash } from 'crypto';
2
- import * as fs from 'fs';
3
- import * as path from 'path';
4
1
  /**
5
- * Directories whose contents never change what the bundle contains: our own artifacts
6
- * (`.bitmagic/`, `dist/`), the dependency tree (`node_modules/` pinned by the lockfile the
7
- * scaffold writes), vite's cache, and git's object store. Including any of them would make the
8
- * fingerprint change on something other than an edit, which would make the staleness gate reject
9
- * a publish of an unchanged project.
10
- *
11
- * `.git` is the one that bit in practice. Hashing it means an EMPTY `git commit` — no source
12
- * change at all — flips the fingerprint, because the commit writes new objects, a new ref value
13
- * and a new reflog entry. That turns the ordinary `bitmagic verify` → `git commit` →
14
- * `bitmagic publish` sequence into exit 3 ("The project has changed since it was last verified"),
15
- * and `bitmagic upgrade` actively pushes creators into git by refusing a dirty tree. The
16
- * scaffolded AGENTS.md's "do not edit any tracked file between verifying and publishing" cannot
17
- * prevent it either: committing is not editing. It also made every publish rebuild, since the
18
- * build manifest's own recorded fingerprint could never still match by the time publish ran.
19
- *
20
- * `.DS_Store` is excluded for the same reason at file granularity: on macOS, Finder writes it
21
- * merely for opening the project folder, and no build tool ever reads it — so it is another way
22
- * to flip the fingerprint without editing anything. The list is deliberately not a general ignore
23
- * mechanism, because a false "fresh" ships an unverified bundle while a false "stale" only costs
24
- * one `bitmagic verify`.
25
- *
26
- * `mechanics-plan.md` earns its place the same way, and for a sharper version of the reason: the
27
- * agent is told to rewrite it after every slice — moving shipped items out of the backlog and
28
- * re-ranking the rest is the whole point of the file. Left in, the ordinary
29
- * `bitmagic verify` → update the backlog → `bitmagic publish` sequence exits 3 over prose, which
30
- * teaches agents to reach for `--force`, the one flag that also waves through a genuinely stale
31
- * verify. Nothing imports it and `vite.publish.config.js` cannot put prose in the bundle.
2
+ * The filesystem half of "what is this project's source": one walk, producing both the
3
+ * per-file index the source archive ships and the fingerprint the verify gate compares.
32
4
  *
33
- * `GAME-DESIGN.md` earns its place on the same "no build tool reads it" test: nothing imports it,
34
- * `vite.publish.config.js` cannot put prose in the bundle, and it exists to be REWRITTEN as the
35
- * game evolves it is the input `bitmagic cover` reads. Left in, the ordinary
36
- * `bitmagic verify` refine the design doc `bitmagic publish` sequence exits 3 over a paragraph
37
- * of prose, which teaches agents to reach for `--force` (the one flag that also waves through a
38
- * genuinely stale verify). Excluded at basename granularity like `.DS_Store`, so a design doc kept
39
- * in a subdirectory counts the same way.
5
+ * The rules themselves which directories and files are excluded, how a path is normalised,
6
+ * how the per-file hashes fold into one fingerprint live in
7
+ * `@bitmagic/asset-core/publish-source`, because api-server has to reproduce them exactly when it
8
+ * re-derives the fingerprint from an uploaded archive. Only the `fs` walk is here; that package
9
+ * deliberately touches no filesystem so it stays usable from both sides.
40
10
  */
41
- const EXCLUDED_DIRS = new Set(['.bitmagic', 'node_modules', 'dist', '.vite-cache', '.git']);
42
- /** See EXCLUDED_DIRS: files that can never change what the bundle contains. */
43
- const EXCLUDED_FILES = new Set(['.DS_Store', 'GAME-DESIGN.md', 'mechanics-plan.md']);
11
+ import { createHash } from 'crypto';
12
+ import * as fs from 'fs';
13
+ import * as path from 'path';
14
+ import { ARCHIVED_UNFINGERPRINTED_FILES, EXCLUDED_DIRS, EXCLUDED_FILES, SOURCE_INDEX_ALGO, VENDORED_ENGINE_PREFIX, engineComparisonHash, fingerprintFromIndex, toPosixPath as toPosixPathShared, } from '@bitmagic/asset-core/publish-source';
15
+ export { SOURCE_INDEX_ALGO } from '@bitmagic/asset-core/publish-source';
44
16
  /**
45
17
  * A relative path as the fingerprint hashes it: always forward-slashed.
46
18
  *
47
- * `sep` is a parameter rather than a direct `path.sep` read so this is testable on any
48
- * platform the Windows behaviour that makes normalization necessary cannot otherwise be
49
- * exercised on the POSIX runners CI uses, which is exactly how a vacuous test gets written.
19
+ * Re-exported through this module (rather than having callers reach into the shared package) so
20
+ * the CLI keeps one import site for path normalisation, and defaults to the host's separator —
21
+ * the shared version defaults to '/' because it is given already-normalised zip entry names.
50
22
  */
51
23
  export function toPosixPath(relativePath, sep = path.sep) {
52
- return relativePath.split(sep).join('/');
24
+ return toPosixPathShared(relativePath, sep);
53
25
  }
54
- function walk(dir, root, out) {
26
+ /**
27
+ * Collect every fingerprinted file under `root`.
28
+ *
29
+ * Symlinks are skipped: `entry.isFile()` is false for a symlink Dirent. That is long-standing
30
+ * behaviour rather than a decision made here, but it is now load-bearing in a second place —
31
+ * api-server walks the uploaded archive and must arrive at the same file set — so it is called
32
+ * out rather than left as an implicit property of the Dirent API.
33
+ */
34
+ function walk(dir, root, out, archivedOnly) {
55
35
  const entries = fs.readdirSync(dir, { withFileTypes: true });
56
36
  for (const entry of entries) {
57
37
  if (entry.isDirectory()) {
58
38
  if (EXCLUDED_DIRS.has(entry.name))
59
39
  continue;
60
- walk(path.join(dir, entry.name), root, out);
40
+ walk(path.join(dir, entry.name), root, out, archivedOnly);
61
41
  }
62
42
  else if (entry.isFile()) {
63
- if (EXCLUDED_FILES.has(entry.name))
43
+ const relPath = toPosixPath(path.relative(root, path.join(dir, entry.name)));
44
+ if (EXCLUDED_FILES.has(entry.name)) {
45
+ // Excluded from the fingerprint, but a design doc or backlog is exactly what makes the
46
+ // source archive readable — collected separately so it can never reach the fold.
47
+ if (ARCHIVED_UNFINGERPRINTED_FILES.has(entry.name))
48
+ archivedOnly.push(relPath);
64
49
  continue;
65
- const relPath = path.relative(root, path.join(dir, entry.name));
66
- out.push(toPosixPath(relPath));
50
+ }
51
+ out.push(relPath);
67
52
  }
68
53
  }
69
54
  }
70
55
  /**
71
- * A hash of everything that determines the published bundle.
72
- *
73
- * This is what lets `publish` decide whether a `verify` is too stale to trust, by CONTENT
74
- * rather than by clock: a timestamp policy would accept an edit made one second after
75
- * verifying and reject an untouched project that merely sat overnight.
76
- *
77
- * The path is hashed alongside the content so that moving a file — which changes what the
78
- * bundle imports — changes the fingerprint even though no byte of any file did.
56
+ * Every fingerprinted file in the project, hashed, plus the fingerprint they roll up to.
79
57
  *
80
- * Kept deliberately coarse (every tracked file, not a module graph): a false "stale" costs one
81
- * `bitmagic verify`, while a false "fresh" ships an unverified bundle.
58
+ * One walk per publish. `runPublish` calls this once and feeds the SAME result to both the
59
+ * staleness gate and the source archive previously the tree was walked twice (once to
60
+ * fingerprint, once to build the artifact), which opened a window for an edit to land between
61
+ * them and gave the exclusion rules two call sites that could drift.
82
62
  *
83
63
  * Any filesystem error (unreadable directory, permission denied, etc.) propagates immediately
84
64
  * rather than being silently omitted: the project source is the creator's own files, so an
85
65
  * unreadable subtree is a real problem worth surfacing, not something to hide. An omitted
86
66
  * directory would produce a fingerprint that matches a stale project — the costly failure mode.
87
67
  */
88
- export function computeFingerprint(root) {
89
- const files = [];
90
- walk(root, root, files);
91
- files.sort();
92
- const hash = createHash('sha256');
93
- for (const rel of files) {
68
+ export function buildSourceIndex(root) {
69
+ const paths = [];
70
+ const archivedOnlyPaths = [];
71
+ walk(root, root, paths, archivedOnlyPaths);
72
+ paths.sort();
73
+ archivedOnlyPaths.sort();
74
+ const hashFile = (rel) => {
94
75
  const content = fs.readFileSync(path.join(root, rel));
95
- hash.update(`${rel}:${createHash('sha256').update(content).digest('hex')}\n`);
96
- }
97
- return hash.digest('hex');
76
+ return {
77
+ path: rel,
78
+ sha256: createHash('sha256').update(content).digest('hex'),
79
+ bytes: content.byteLength,
80
+ // Only for the vendored engine, and only because the server compares those against the
81
+ // official release without ever receiving their bytes — it cannot normalise after the fact.
82
+ ...(rel.startsWith(VENDORED_ENGINE_PREFIX) ? { engineSha256: engineComparisonHash(content) } : {}),
83
+ };
84
+ };
85
+ const files = paths.map(hashFile);
86
+ return {
87
+ algo: SOURCE_INDEX_ALGO,
88
+ files,
89
+ fingerprint: fingerprintFromIndex(files),
90
+ archivedOnly: archivedOnlyPaths.map(hashFile),
91
+ };
92
+ }
93
+ /**
94
+ * The project's fingerprint on its own.
95
+ *
96
+ * Kept as the entry point for the callers that only need the hash (`verify`, `build`), so they
97
+ * do not have to know an index exists. `publish` uses `buildSourceIndex` directly because it
98
+ * needs both halves.
99
+ */
100
+ export function computeFingerprint(root) {
101
+ return buildSourceIndex(root).fingerprint;
98
102
  }
99
103
  //# sourceMappingURL=fingerprint.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fingerprint.js","sourceRoot":"","sources":["../../src/publish/fingerprint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC,CAAC,WAAW,EAAE,cAAc,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,CAAC,CAAC,CAAC;AAE5F,+EAA+E;AAC/E,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,CAAC,WAAW,EAAE,gBAAgB,EAAE,mBAAmB,CAAC,CAAC,CAAC;AAErF;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAAC,YAAoB,EAAE,MAAc,IAAI,CAAC,GAAG;IACtE,OAAO,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC3C,CAAC;AAED,SAAS,IAAI,CAAC,GAAW,EAAE,IAAY,EAAE,GAAa;IACpD,MAAM,OAAO,GAAG,EAAE,CAAC,WAAW,CAAC,GAAG,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7D,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,IAAI,KA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CAAC;IAEF,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAClC,OAAO;QACL,IAAI,EAAE,iBAAiB;QACvB,KAAK;QACL,WAAW,EAAE,oBAAoB,CAAC,KAAK,CAAC;QACxC,YAAY,EAAE,iBAAiB,CAAC,GAAG,CAAC,QAAQ,CAAC;KAC9C,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAY;IAC7C,OAAO,gBAAgB,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;AAC5C,CAAC"}
@@ -0,0 +1,38 @@
1
+ import { type SourceIndex } from '@bitmagic/asset-core/publish-source';
2
+ /** Where the archive is written. Inside `.bitmagic/`, so it can never affect the fingerprint. */
3
+ export declare function sourceArchivePath(root: string): string;
4
+ export interface SourceArchive {
5
+ /** Absolute path to the written archive. */
6
+ filePath: string;
7
+ bytes: number;
8
+ /** sha256 of the archive as written — the value that gets bound into the meta block. */
9
+ sha256: string;
10
+ /** Fingerprinted paths deliberately not carried in the payload (engine + anything secret). */
11
+ omitted: string[];
12
+ /** Secret-shaped paths among `omitted`, so `publish` can tell the creator what it withheld. */
13
+ secretsOmitted: string[];
14
+ }
15
+ export interface BuildSourceArchiveOptions {
16
+ root: string;
17
+ index: SourceIndex;
18
+ gameId: string;
19
+ engineVersion: string;
20
+ genre: string;
21
+ /** Injected so tests get a stable manifest; production passes the real clock. */
22
+ now?: () => Date;
23
+ }
24
+ /**
25
+ * Build the archive and return what `publish` needs to upload and declare.
26
+ *
27
+ * The manifest is written FIRST so a reader (and the server) hits it before streaming past
28
+ * megabytes of payload, and `files` covers the fingerprint's entire set — including the paths the
29
+ * payload omits — because that is what lets the server re-derive the fingerprint from an archive
30
+ * that does not physically contain every file.
31
+ *
32
+ * Note the payload is read from disk again here rather than being buffered during
33
+ * `buildSourceIndex`: holding every file's bytes to avoid a second read would mean holding the
34
+ * whole project in memory, and the index already carries the hashes that make a re-read safe to
35
+ * detect. A file edited between the two reads changes the archive but not the manifest, which the
36
+ * server's per-entry hash check reports — the honest outcome, and the reason that check exists.
37
+ */
38
+ export declare function buildSourceArchive(options: BuildSourceArchiveOptions): Promise<SourceArchive>;
@@ -0,0 +1,131 @@
1
+ /**
2
+ * The source archive a publish leaves behind: what a human opens from the Slack link, and what
3
+ * api-server audits against the fingerprint the publish declared.
4
+ *
5
+ * Three things it is deliberately NOT:
6
+ *
7
+ * - **Not the whole project.** The vendored `engine/` tree is ~14MB of platform code, byte-
8
+ * identical for everyone on a given engine version. Shipping it on every publish would upload
9
+ * several MB to store the same bytes repeatedly, and it is not what someone opening the archive
10
+ * wants to read. It is hashed into the manifest instead, which is all the server needs to check
11
+ * it against the official release.
12
+ * - **Not a secret carrier.** The archive lands in a bucket with a bucket-level
13
+ * `allUsers:objectViewer` grant. Anything matching `SECRET_FILE_PATTERNS` is hashed and listed
14
+ * but never included. See that constant for why this is a deny-list and what that costs.
15
+ * - **Not the fingerprint's file set.** `GAME-DESIGN.md` and `mechanics-plan.md` are excluded
16
+ * from the fingerprint (they are rewritten constantly and no build tool reads them) but ARE
17
+ * included here, because a design document is exactly what makes an archive readable. The
18
+ * manifest records the fingerprint's set, not the payload's, so the two never have to agree.
19
+ *
20
+ * Written to disk rather than held in memory: the payload is small but a creator's `world.json`
21
+ * can be large, the file is genuinely useful to inspect when an audit warns, and `.bitmagic/` is
22
+ * already both gitignored and fingerprint-excluded so it cannot perturb the next publish.
23
+ */
24
+ import { createHash } from 'crypto';
25
+ import * as fs from 'fs';
26
+ import * as path from 'path';
27
+ import { Zip, ZipDeflate } from 'fflate';
28
+ import { SOURCE_MANIFEST_NAME, VENDORED_ENGINE_PREFIX, isSecretPath, } from '@bitmagic/asset-core/publish-source';
29
+ import { CliError } from '../errors.js';
30
+ /** Where the archive is written. Inside `.bitmagic/`, so it can never affect the fingerprint. */
31
+ export function sourceArchivePath(root) {
32
+ return path.join(root, '.bitmagic', 'publish', 'source.zip');
33
+ }
34
+ /** Is this fingerprinted path one the payload carries, or one only the manifest records? */
35
+ function isPayloadPath(relPath) {
36
+ if (relPath.startsWith(VENDORED_ENGINE_PREFIX))
37
+ return false;
38
+ return !isSecretPath(relPath);
39
+ }
40
+ /**
41
+ * Build the archive and return what `publish` needs to upload and declare.
42
+ *
43
+ * The manifest is written FIRST so a reader (and the server) hits it before streaming past
44
+ * megabytes of payload, and `files` covers the fingerprint's entire set — including the paths the
45
+ * payload omits — because that is what lets the server re-derive the fingerprint from an archive
46
+ * that does not physically contain every file.
47
+ *
48
+ * Note the payload is read from disk again here rather than being buffered during
49
+ * `buildSourceIndex`: holding every file's bytes to avoid a second read would mean holding the
50
+ * whole project in memory, and the index already carries the hashes that make a re-read safe to
51
+ * detect. A file edited between the two reads changes the archive but not the manifest, which the
52
+ * server's per-entry hash check reports — the honest outcome, and the reason that check exists.
53
+ */
54
+ export async function buildSourceArchive(options) {
55
+ const { root, index, gameId, engineVersion, genre } = options;
56
+ const now = options.now ?? (() => new Date());
57
+ const omitted = index.files.map((f) => f.path).filter((p) => !isPayloadPath(p));
58
+ const secretsOmitted = omitted.filter((p) => !p.startsWith(VENDORED_ENGINE_PREFIX));
59
+ const manifest = {
60
+ algo: index.algo,
61
+ gameId,
62
+ engineVersion,
63
+ genre,
64
+ exportedAt: now().toISOString(),
65
+ fingerprint: index.fingerprint,
66
+ files: Object.fromEntries(index.files.map((f) => [f.path, f.sha256])),
67
+ omitted,
68
+ engineHashes: Object.fromEntries(index.files.filter((f) => f.engineSha256 !== undefined).map((f) => [f.path, f.engineSha256])),
69
+ };
70
+ const filePath = sourceArchivePath(root);
71
+ fs.mkdirSync(path.dirname(filePath), { recursive: true });
72
+ const hash = createHash('sha256');
73
+ let bytes = 0;
74
+ const out = fs.createWriteStream(filePath);
75
+ await new Promise((resolve, reject) => {
76
+ let failed = false;
77
+ const fail = (error) => {
78
+ if (failed)
79
+ return;
80
+ failed = true;
81
+ reject(error instanceof Error ? error : new Error(String(error)));
82
+ };
83
+ out.on('error', fail);
84
+ // fflate's Zip pushes chunks synchronously as entries are fed in. Tee each one into the hash
85
+ // so the archive is hashed as it is produced — reading the finished file back to hash it would
86
+ // both double the I/O and leave a window where the bytes on disk are not the bytes hashed.
87
+ const zip = new Zip((err, chunk, final) => {
88
+ if (err) {
89
+ fail(err);
90
+ return;
91
+ }
92
+ hash.update(chunk);
93
+ bytes += chunk.length;
94
+ out.write(chunk);
95
+ if (final)
96
+ out.end();
97
+ });
98
+ out.on('finish', () => {
99
+ if (!failed)
100
+ resolve();
101
+ });
102
+ try {
103
+ const addFile = (name, content) => {
104
+ // ZipDeflate, not AsyncZipDeflate: synchronous deflate keeps this a single pass with no
105
+ // worker pool, and the payload is source text, which compresses about four to one — 476KB
106
+ // stored versus ~120KB deflated on a real project. Worth it on every publish, since the
107
+ // creator waits for the upload.
108
+ const entry = new ZipDeflate(name, { level: 6 });
109
+ zip.add(entry);
110
+ entry.push(content, true);
111
+ };
112
+ addFile(SOURCE_MANIFEST_NAME, Buffer.from(`${JSON.stringify(manifest, null, 2)}\n`, 'utf8'));
113
+ // The fingerprinted files, then the ones the fingerprint deliberately ignores but a reader
114
+ // wants (GAME-DESIGN.md, mechanics-plan.md). Both go through the same secret filter — a
115
+ // credential does not become safe to ship by being unfingerprinted.
116
+ for (const file of [...index.files, ...index.archivedOnly]) {
117
+ if (!isPayloadPath(file.path))
118
+ continue;
119
+ addFile(file.path, fs.readFileSync(path.join(root, file.path)));
120
+ }
121
+ zip.end();
122
+ }
123
+ catch (error) {
124
+ fail(error);
125
+ }
126
+ }).catch((error) => {
127
+ throw new CliError(`Could not write the source archive at ${filePath}: ${error.message}`, 1);
128
+ });
129
+ return { filePath, bytes, sha256: hash.digest('hex'), omitted, secretsOmitted };
130
+ }
131
+ //# sourceMappingURL=source-zip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-zip.js","sourceRoot":"","sources":["../../src/publish/source-zip.ts"],"names":[],"mappings":"AAAA;;;;;;;;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IAAI,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;YAE7F,2FAA2F;YAC3F,wFAAwF;YACxF,oEAAoE;YACpE,KAAK,MAAM,IAAI,IAAI,CAAC,GAAG,KAAK,CAAC,KAAK,EAAE,GAAG,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC;gBAC3D,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC;oBAAE,SAAS;gBACxC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClE,CAAC;YAED,GAAG,CAAC,GAAG,EAAE,CAAC;QACZ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,KAAK,CAAC,CAAC;QACd,CAAC;IACH,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAY,EAAE,EAAE;QACxB,MAAM,IAAI,QAAQ,CAAC,yCAAyC,QAAQ,KAAK,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;IAC/F,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC;AAClF,CAAC"}
@@ -646,7 +646,7 @@ If \`bitmagic publish\` exits non-zero, branch on the exit code rather than pars
646
646
 
647
647
  | Code | Meaning | Fix |
648
648
  |---|---|---|
649
- | 1 | Build failed | Run \`bitmagic check\` to see the error, fix it. If the message says \`vite.publish.config.js\` is missing, this project predates it — run \`bitmagic upgrade\` |
649
+ | 1 | Build failed, or what was uploaded was not an engine build | Run \`bitmagic check\` to see the error, fix it. If the message says \`vite.publish.config.js\` is missing, this project predates it — run \`bitmagic upgrade\`. Do NOT retry an unchanged bundle; the refusal is deterministic |
650
650
  | 2 | Not logged in | \`bitmagic login\` |
651
651
  | 3 | Verify missing, stale, or failed | \`bitmagic verify\` (then publish again, or add \`--force\` for a stale/failed record) |
652
652
  | 5 | Not this game's owner, or the account/game is banned | Not self-serve — stop and report it |
@@ -661,6 +661,12 @@ a bundle that cannot find its own world.json, a canvas nothing ever draws into.
661
661
  Pass \`--skip-smoke\` to skip it. The publish still happens; it is simply not confirmed to render,
662
662
  and the output says so.
663
663
 
664
+ Every publish also uploads a **source archive** of this project to a **publicly readable** (though
665
+ unguessable) URL, which Bitmagic checks against the bundle and against an unmodified \`engine/\`;
666
+ findings print as \`warning:\` lines and never block a publish. Credential-shaped files (\`.env*\`,
667
+ \`*.pem\`, \`*.key\`, \`.npmrc\`, service-account JSON) are excluded and named in the output — but
668
+ that list cannot be exhaustive, so never keep a secret in this directory.
669
+
664
670
  Publishing is never refused because the vendored engine is old. When a newer engine exists,
665
671
  \`bitmagic dev\` and \`bitmagic publish\` say so and suggest \`bitmagic upgrade\` — upgrade while you
666
672
  are developing, when rebuilding is cheap, rather than being blocked at the moment you ship.
@@ -1 +1 @@
1
- {"version":3,"file":"project-files.js","sourceRoot":"","sources":["../../src/scaffold/project-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEjF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,2BAA2B,EAAE,SAAS;IACtC,2BAA2B,EAAE,SAAS;IACtC,kBAAkB,EAAE,QAAQ;IAC5B,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;IAClB,kCAAkC,EAAE,QAAQ;IAC5C,KAAK,EAAE,SAAS;IAChB,KAAK,EAAE,UAAU;IACjB,4FAA4F;IAC5F,6FAA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+ "version": "0.1.43",
4
4
  "description": "Build Bitmagic games from your own agent tool",
5
5
  "type": "module",
6
6
  "bin": {
@@ -17,9 +17,10 @@
17
17
  },
18
18
  "dependencies": {
19
19
  "citty": "^0.2.2",
20
+ "fflate": "^0.8.2",
20
21
  "playwright-core": "^1.59.1",
21
22
  "tar": "^7.4.3",
22
- "@bitmagic/asset-core": "0.1.2",
23
+ "@bitmagic/asset-core": "0.1.3",
23
24
  "@bitmagic/world-forger": "0.1.5"
24
25
  },
25
26
  "devDependencies": {