Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

fix(files): upload-raw names the storage backend it used, and refuses a managed-worktree pointer before uploading (#7346)

garrytan8230f3b16870
diff --git a/docs/architecture/key-files/core-utilities-2.md b/docs/architecture/key-files/core-utilities-2.md
index 2cd46c69f3..f921d1f553 100644
--- a/docs/architecture/key-files/core-utilities-2.md
+++ b/docs/architecture/key-files/core-utilities-2.md
@@ -35,7 +35,7 @@ Current behavior and load-bearing invariants; history belongs in Git and CHANGEL
- `src/core/sort-newest-first.ts` — single source of truth for the descending-lex sort that `gbrain import` and `gbrain sync` both apply. Mutates in place (Array.prototype.sort semantics), returns the same array reference for fluent chaining. Empty/single-element inputs short-circuit. Future ordering changes flip one line here instead of touching two CLI commands. Pinned by `test/sort-newest-first.test.ts` (descending order, mixed prefixes, empty, single-element, in-place-mutation contract).
- `src/core/sql-query.ts` — engine-aware tagged-template SQL adapter for OAuth/admin/auth infrastructure. `sqlQueryForEngine(engine)` returns a `SqlQuery` (`(strings, ...values) => Promise<rows[]>`) that walks the template, builds `$N` positional SQL, asserts every value is a `SqlValue` (string | number | bigint | boolean | Date | null), and routes through `engine.executeRaw(sql, params)` (Postgres via postgres.js `unsafe(sql, params)`, PGLite via `db.query(sql, params)`). Deliberately narrower than postgres.js's `sql` tag: no nested fragments, `sql.json()`, `sql.unsafe()`, `sql.begin()`, or array binding — the narrow scalar-only surface is the feature (keeps it from drifting into a partial postgres.js clone). JSONB writes go through `executeRawJsonb(engine, sql, scalarParams, jsonbParams)` which composes positional `$N::jsonb` casts and passes JS **objects** through; an object reaches the wire with the correct type oid, so executeRawJsonb is safe (verified by `test/sql-query.test.ts` on PGLite, `test/e2e/auth-permissions.test.ts:67` on Postgres). Positional binding is NOT universally immune, though: binding a `JSON.stringify(x)` **string** to a bare `$N::jsonb` via `unsafe()` double-encodes it into a jsonb string scalar on real Postgres (PGLite hides it). Fixes: pass a raw object (executeRawJsonb / `sql.json`), or cast through `$N::text::jsonb`. `scripts/check-jsonb-pattern.sh` (template grep) doesn't fire on `executeRawJsonb(...)` because it passes objects; the positional `$N::jsonb` + `JSON.stringify` form is caught by `scripts/check-jsonb-params.mjs`. Also exports `FILES_METADATA_MERGE_SQL`, the one `ON CONFLICT (storage_path)` merge fragment every files upsert (`src/commands/files.ts` x4, `src/core/ops/files.ts` `file_upload`) interpolates: it resets a non-object `files.metadata` to `{}` before the jsonb `||` merge, because `||` array-wraps a non-object left operand and would turn a legacy string-scalar row into `["{}", {...}]` that `gbrain repair-jsonb` can no longer see (pinned by `test/file-upload-fail-closed.test.ts`). Consumed by `src/commands/auth.ts`, `src/commands/serve-http.ts`, `src/core/oauth-provider.ts`, `src/commands/files.ts`, `src/mcp/http-transport.ts` so all five work uniformly against PGLite and Postgres.
-- `src/core/raw-file-upload.ts` — #5963 Part A: `managedRawUploadRefusal` is checked by `gbrain files upload-raw` (`src/commands/files.ts`) before any `mkdir`, so a git-storage upload into a managed canonical worktree refuses `writer_coordinator_required` (raw files are not coordinated in this release; fix: `gbrain files upload` with a storage backend) and creates nothing; `rawUploadRefusedFor` keeps `file_upload` (`src/core/ops/files.ts`) from suggesting upload-raw for such a page when no backend is configured.
+- `src/core/raw-file-upload.ts` — `gbrain files upload-raw` (`src/commands/files.ts`) refuses `writer_coordinator_required` before writing into a managed worktree (raw files are not published): `managedRawUploadRefusal` (#5963) before a git-storage `mkdir` (fix: `gbrain files upload`), `managedPointerRefusal` (#7346) before an object-storage upload whose `.redirect.yaml` would land there (fix: `--no-pointer`). `rawUploadRefusedFor` keeps `file_upload` (`src/core/ops/files.ts`) from suggesting upload-raw for such a page.
- `src/core/storage-config.ts` — Storage tiering: `loadStorageConfig` reads `gbrain.yml` (warning once per process for each unknown key under `storage:`; an optional `keep_db` prefix list, present only when declared, is normalized like the tiers and matched by `isKeepDbSlug`, consumed by `repair/keep-db-policy.ts`), normalizes deprecated keys (`git_tracked`/`supabase_only`) to canonical (`db_tracked`/`db_only`) with once-per-process deprecation warning, and runs `normalizeAndValidateStorageConfig` (auto-fixes missing trailing `/`, throws `StorageConfigError` on tier overlap). Path-segment matcher: `media/x/` does NOT match `media/xerox/foo`. `isDeclaredDbOnlySlug` matches a lowercase page slug against the declared db_only dirs case-insensitively; managed persistence uses it to publish those pages database-only. `hasUnresolvedDbOnlyDeclaration` detects a db_only key line that resolved no directory (a multi-line flow list, a key outside `storage:`; one-line lists parse, `db_only: []` declares none, #8007); the sync baseline-commit guard refuses on it, and managed persistence turns a missing-file refusal into `storage_error`. Uses a dedicated parser for the `gbrain.yml` shape rather than gray-matter (broken on delimiter-less YAML). Also carries `DERIVE_PHASE_DB_ONLY_DEFAULTS` (`life/events/`, `atoms/`, `extracts/`, `dream-cycle-summaries/`) + `effectiveDbOnlyDirs` — the engine's derive-phase output prefixes treated as implicitly-declared db_only by the `undeclared_db_only_pages` doctor check but deliberately NOT merged into `loadStorageConfig` (a global merge would auto-gitignore those dirs and silently kill ingestion for brains that file-back them) — and `findDbOnlyCollisions` (pure collector-output vs db_only overlap detector shared by the `db_only_collector_collision` doctor check and sync's `manageGitignore` warning). Pinned by `test/storage-config.test.ts` + `test/doctor-silent-death-checks.test.ts`.
diff --git a/docs/guides/write-refusals.md b/docs/guides/write-refusals.md
index e43d770ea2..114e7ae9e9 100644
--- a/docs/guides/write-refusals.md
+++ b/docs/guides/write-refusals.md
@@ -96,7 +96,7 @@ of making a duplicate.
| <a id="facts_absorb_write_refused"></a>`facts_absorb_write_refused (<code>)`; `ingest_log` `write_refused: <code> …` | `facts_absorb_write_refused` | A durable `facts-absorb` job extracted facts but the write path refused to store them, for example `writer_coordinator_required` because the entity's Markdown file sits in a claimed canonical worktree before `sources writer activate`, or `permission_denied`, `invalid_params` or `writer_registration_required`. These refusals do not change on retry, so the job goes straight to `dead` on its first attempt instead of re-running inference; on a brain that is not yet activated, a job whose source root is a claimed worktree is refused before extraction starts, so it makes no model call; the `facts:absorb` row in `ingest_log` (and doctor `facts_extraction_health`) records `write_refused` with the real code, not a provider failure. Two outcomes are not refusals and are logged under their own reasons, which doctor never counts toward its threshold: `write_pending_accepted`, a facts write that was accepted and whose receipt is still queued, running or recovering when the job stopped waiting (the job waits up to 30 s, bounded by its deadline; the write commits later), and `write_deferred_unadmitted`, a canonical writer that was busy before anything was admitted (`writer_lock_unavailable`, no receipt; the job retries). Doctor warns about deferrals only when they persist (see the check's `gbrain sources writer status` fix). Doctor's incident count is a historical metric: it counts the `facts:absorb` rows of a rolling 24 h window, says when they age out, and keeps counting them after the cause is fixed and the job retried, so a warning there does not by itself mean anything is still broken; the threshold (`facts.absorb_warn_threshold`) is unchanged. The current state is the check's `jobs still dead` count: facts-absorb jobs that went dead or failed in the last 24 h and that no later job for the same page completed after, each named with `gbrain jobs retry <id>`. The source page itself was already saved. | Fix the named cause first: `gbrain sources writer status <source>`, then finish the [claim and activate runbook](../architecture/topologies.md#claim-and-activate-runbook) for a claimed worktree, or fix the grant. Then `gbrain jobs retry <job id>` (the error names the id). |
| <a id="no_context_ceiling"></a>`no_context_ceiling` | `no_context_ceiling` | A queued job under a cost cap you set stopped before a provider call: the model has a registered price, but gbrain knows no context-token ceiling for it, so it cannot reserve the most one call could cost. OpenRouter models hit this, because that provider declares no context window per model. The message names the model, and the JSON `fix` asks you before it reruns the command without your cap. Re-registering the price does not help. | Choose one. Rerun the command without your cap (the `fix` command, which replaces `--max-usd` with `--yes`): the default cap applies and this model runs unmetered with a warning. Or keep your cap: look up the model's context window on the provider's model page (OpenRouter lists it as `context_length`) and give it to the brain-host operator. `gbrain jobs list --group <id> --json` shows the stopped job. |
| <a id="no_pricing"></a>`no_pricing` | `no_pricing` | A cost cap you set (`--max-cost`, `--max-usd`, `--max-cost-usd`, or an explicit cap in config such as `cycle.extract_atoms.budget_usd`) cannot be enforced, because gbrain has no price for the model the run was about to call. The run stops before that call. Under a default cap an unpriced model warns and runs instead. The message names the model, provider and kind, and JSON output carries the same guidance as fields: `code`, `model`, `provider`, `kind`, `units`, `lookup`, `register_command`, `register_scope` and `docs`. | Look up the provider's current price for the model, for example by searching the web for its pricing page. A chat model needs USD per 1M input tokens and USD per 1M output tokens; an embedding or reranker model needs USD per 1M tokens. On the brain host, run `gbrain pricing set <model> --input <usd> --output <usd> --source <pricing-page-url>` (or `--rate <usd>`), then retry. An agent connected over MCP cannot register prices: give the command to the brain's operator. See [registering a model price](../operations/spend-controls.md#registering-a-model-price). |
-| <a id="managed_raw_upload"></a>raw upload on a managed brain | `writer_coordinator_required` | `gbrain files upload-raw` of a small (git-storage) file whose `.raw/` destination is inside a managed canonical worktree. The persistence coordinator does not publish raw files yet, so the worktree refuses writes from outside it; starting a `gbrain serve` owner does not change that. The refusal comes before anything is created: no `.raw/` directory and no `files` row. With no storage backend, `file_upload` for such a page no longer suggests `upload-raw`. | Configure `storage` (supabase, s3 or local) in the gbrain config, then run the printed `gbrain files upload <file> --page <slug>`; check it with `gbrain files list <slug>`. |
+| <a id="managed_raw_upload"></a>raw upload on a managed brain | `writer_coordinator_required` | `gbrain files upload-raw` of a small (git-storage) file whose `.raw/` destination is inside a managed canonical worktree. The persistence coordinator does not publish raw files yet, so the worktree refuses writes from outside it; starting a `gbrain serve` owner does not change that. The refusal comes before anything is created: no `.raw/` directory and no `files` row. With no storage backend, `file_upload` for such a page no longer suggests `upload-raw`. An object-storage upload (a media file, or 100 MB and over) of a file inside a managed worktree is refused the same way, because its `.redirect.yaml` pointer would be written beside the file: the refusal comes before the upload, so nothing reaches the backend. | Configure `storage` (supabase, s3 or local) in the gbrain config, then run the printed `gbrain files upload <file> --page <slug>`; for the pointer refusal, run the printed `upload-raw … --no-pointer`, which uploads the file and records it for the page without a pointer. Check either with `gbrain files list <slug>`. |
| <a id="timeline_rows_would_be_removed"></a>`timeline_rows_would_be_removed` | `timeline_rows_would_be_removed` | A remote `put_page` (or a `put_pages` entry) has no Timeline section at all — no `<!-- timeline -->` sentinel and no `## Timeline` or `## History` heading — and would delete dated entries the page has, including rows `add_timeline_entry` added. `put_page` content replaces the whole page, so the omission must be explicit. Nothing was written. A section that is present but empty is a deliberate delete and is not refused; a local `gbrain put` without `--expected-revision` keeps the rows instead. | Re-read with `get_page include_content:true`, keep the Timeline section and resubmit with a new `request_id`; to remove every dated entry on purpose, resubmit the same content with `drop_timeline: true` (on put_pages, per entry). A successful write that deletes rows reports `timeline_rows_removed {count, earliest, latest, warning, fix}` (dates only); `get_versions` then `revert_version` restores them as new rows. |
| <a id="purge_lookup_timeout"></a>`purge_lookup_timeout` | `purge_lookup_timeout` | A page purge (`gbrain delete <slug> --purge`) ran one of the journal lookups that still execute inside its publication transaction (the lookup of stored intents for the slug, the re-check of requests admitted after its preparation scan or pending at that scan, the locking read of the requests to redact) and that statement hit the transaction's 5-second statement budget on a large `persistence_requests` table. The request failed terminally instead of being released as `database_contention` and claimed again: nothing of the page was removed or tombstoned, nothing in the journal was redacted, and later writes to the source move again. Do not assume the requested content was erased. The substring search for the page's claims no longer runs here: it runs at preparation in bounded keyset chunks under the preparation budget, and a sweep that outruns that budget twice ends [`preparation_stalled`](#preparation_stalled) instead. A committed purge's receipt reports `journal_sweep` (`scanned`, `ceiling`, `tail`, `pending_rechecked`, `complete`); `complete: false` means a cap was hit (the 10,000-match cap or the tail bound) and some requests were not tested. | If the receipt says the slug index `persistence_requests_slug_intent` is missing or INVALID, run `gbrain repair request-indexes --apply` (the `persistence_request_slug_intent_index` migration builds it online; the index serves the slug lookup, not the substring sweep), then submit the purge again with a new `request_id`. Otherwise submit it again with a new `request_id` (a retry with the same id returns this failure); if it times out again, report the request id with the `persistence_request_indexes` and `persistence_request_growth` entries of `gbrain doctor --json`. |
| <a id="purge_mirror_unwritable"></a>`purge_mirror_unwritable` | `purge_mirror_unwritable` | A fact or page purge appends a text-free `intent` line to the purge mirror (`<brain home>/.gbrain/purge-events.jsonl`) and fsyncs it before it commits, so a later restore of an older backup can replay the purge. The mirror could not be written (a directory in its place, a read-only home, a full disk), so the purge was refused: nothing was removed, tombstoned or redacted. Do not assume the requested content was erased. | Make the mirror a writable regular file owned by the brain's user (mode 0600), then run the purge again with a new `request_id`. |
diff --git a/src/commands/files.ts b/src/commands/files.ts
index 74d799984c..6f5c035c76 100644
--- a/src/commands/files.ts
+++ b/src/commands/files.ts
@@ -233,6 +233,7 @@ async function uploadFile(engine: BrainEngine, args: string[]) {
* >= 100 MB OR media → upload to cloud storage, create .redirect.yaml pointer
*
* The .redirect.yaml pointer stays in the brain repo so git tracks what was stored.
+ * On a managed canonical worktree the pointer write is refused before the upload (#7346).
*/
async function uploadRaw(engine: BrainEngine, args: string[]) {
const filePath = args.find(a => !a.startsWith('--'));
@@ -339,11 +340,18 @@ async function uploadRaw(engine: BrainEngine, args: string[]) {
process.exit(1);
}
+ if (!noPointer && pageSlug) {
+ const refusal = (await import('../core/raw-file-upload.ts')).managedPointerRefusal(filePath, pageSlug, fileType);
+ if (refusal) throw refusal;
+ }
+
const { createStorage } = await import('../core/storage.ts');
const storage = await createStorage(config.storage as any);
const hash = fileHash(filePath);
const storagePath = pageSlug ? `${pageSlug}/${filename}` : `unsorted/${hash.slice(0, 8)}-${filename}`;
const bucket = (config.storage as any).bucket || 'brain-files';
+ const backend = (config.storage as StorageConfig).backend;
+ const reference = `${backend}://${bucket}/${storagePath}`;
const method = stat.size >= SIZE_THRESHOLD ? 'TUS resumable' : 'standard';
console.error(`Uploading ${humanSize(stat.size)} via ${method}...`);
@@ -354,7 +362,7 @@ async function uploadRaw(engine: BrainEngine, args: string[]) {
if (!noPointer && pageSlug) {
const { stringify } = await import('../core/yaml-lite.ts');
const pointer = stringify({
- target: `supabase://${bucket}/${storagePath}`,
+ target: reference,
bucket,
storage_path: storagePath,
size: stat.size,
@@ -384,16 +392,16 @@ async function uploadRaw(engine: BrainEngine, args: string[]) {
mime_type = EXCLUDED.mime_type,
${FILES_METADATA_MERGE_SQL}`,
[pageSlug, filename, storagePath, mimeType, stat.size, 'sha256:' + hash],
- [{ storage: (config.storage as StorageConfig).backend, ...(fileType ? { type: fileType } : {}), upload_method: method }],
+ [{ storage: backend, ...(fileType ? { type: fileType } : {}), upload_method: method }],
);
// Output JSON for scripting
console.log(JSON.stringify({
success: true,
- storage: 'supabase',
+ storage: backend,
storagePath,
bucket,
- reference: `supabase://${bucket}/${storagePath}`,
+ reference,
pointerPath,
size: stat.size,
size_human: humanSize(stat.size),
diff --git a/src/core/raw-file-upload.ts b/src/core/raw-file-upload.ts
index d92482c615..aea2f14562 100644
--- a/src/core/raw-file-upload.ts
+++ b/src/core/raw-file-upload.ts
@@ -23,6 +23,23 @@ export function managedRawUploadRefusal(dest: string, filePath: string, pageSlug
return error;
}
+/** #7346: an object-storage upload-raw whose `.redirect.yaml` pointer would land in a managed worktree, refused before any byte is uploaded. */
+export function managedPointerRefusal(filePath: string, pageSlug: string, fileType: string | null): OperationError | null {
+ const pointerPath = filePath + '.redirect.yaml';
+ const managed = managedFilesystemRootFor(pointerPath);
+ if (!managed) return null;
+ const error = opError('writer_coordinator_required',
+ `gbrain files upload-raw cannot write the pointer ${pointerPath}: that path is in the managed canonical worktree ${managed.root}${managed.sourceId ? ` (source ${managed.sourceId})` : ''}. Nothing was uploaded.`,
+ 'Upload without the pointer file: the command in fix stores the file in the configured backend and links it to the page in the database.',
+ { why: 'The persistence coordinator does not publish raw files or pointer files yet, so the managed worktree refuses writes from outside it.',
+ docs: 'docs/guides/write-refusals.md#managed_raw_upload',
+ fix: { argv: ['gbrain', 'files', 'upload-raw', filePath, '--page', pageSlug, ...(fileType ? ['--type', fileType] : []), '--no-pointer'], consent: [], actor: 'agent', requires_exclusive: false,
+ why: 'Uploads the file to the configured storage backend and records it for the page, without writing a pointer into the managed worktree.',
+ verify: { argv: ['gbrain', 'files', 'list', pageSlug] } } });
+ error.detail = `root=${managed.root} source=${managed.sourceId ?? 'unknown'} evidence=${managed.evidence}`;
+ return error;
+}
+
/** True when a git-storage upload for this page would land in a managed worktree (so upload-raw is refused). */
export async function rawUploadRefusedFor(engine: BrainEngine, pageSlug: string, sourceId: string): Promise<boolean> {
const { resolvePageWriteTarget } = await import('./write-through.ts');
diff --git a/test/files-upload-raw-managed.test.ts b/test/files-upload-raw-managed.test.ts
index 540592dca1..33e399624f 100644
--- a/test/files-upload-raw-managed.test.ts
+++ b/test/files-upload-raw-managed.test.ts
@@ -4,9 +4,9 @@
* and names `gbrain files upload` with a storage backend; `file_upload` with no
* backend stops pointing at upload-raw for a managed page.
*/
-import { afterAll, beforeAll, expect, test } from 'bun:test';
+import { afterAll, beforeAll, expect, spyOn, test } from 'bun:test';
import { randomUUID } from 'node:crypto';
-import { existsSync, mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs';
+import { existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
import { tmpdir } from 'node:os';
import { join } from 'node:path';
import { PGLiteEngine } from '../src/core/pglite-engine.ts';
@@ -55,3 +55,56 @@ test('upload-raw on a managed root refuses before any mkdir and leaves no files
expect(JSON.stringify((upload as OperationError).fix ?? null)).not.toContain('upload-raw');
});
}, 60_000);
+
+// #7346: an object-storage upload-raw names the backend it used, and on a managed root its pointer write is refused
+// before any byte leaves the machine.
+// Value: protects=an upload-raw that cannot write its pointer uploads nothing, and scripts read the real backend;
+// fails_when=the bytes reach the backend before the managed refusal, or the JSON says supabase for another backend;
+// why_new=the #5963 pin covers only the git-storage branch; seam=runFiles upload-raw with a local storage backend;
+// no_claim=publishing pointers through the persistence coordinator.
+test('#7346: object-storage upload-raw labels the backend it used', async () => {
+ const home = join(dir, 'home-7346-label');
+ const store = join(dir, 'store-7346-label');
+ mkdirSync(join(home, '.gbrain'), { recursive: true });
+ writeFileSync(join(home, '.gbrain', 'config.json'), JSON.stringify({ engine: 'pglite', storage: { backend: 'local', bucket: 'brain-files', localPath: store } }));
+ const img = join(fixtures, 'photo-7346.png');
+ writeFileSync(img, 'png-bytes');
+ const logs: string[] = [];
+ const logSpy = spyOn(console, 'log').mockImplementation((...a: unknown[]) => { logs.push(a.join(' ')); });
+ const errSpy = spyOn(console, 'error').mockImplementation(() => {});
+ try {
+ await withEnv({ GBRAIN_HOME: home }, () => runFiles(engine, ['upload-raw', img, '--page', 'people/alice-example']));
+ } finally { logSpy.mockRestore(); errSpy.mockRestore(); }
+ const out = JSON.parse(logs[logs.length - 1]!);
+ expect(out.storage).toBe('local');
+ expect(out.reference).toBe('local://brain-files/people/alice-example/photo-7346.png');
+ expect(readFileSync(img + '.redirect.yaml', 'utf-8')).toContain('target: local://brain-files/people/alice-example/photo-7346.png');
+ expect(existsSync(join(store, 'people', 'alice-example', 'photo-7346.png'))).toBe(true);
+}, 60_000);
+
+test('#7346: object-storage upload-raw of a file in a managed root refuses before uploading', async () => {
+ const home = join(dir, 'home-7346-managed');
+ const store = join(dir, 'store-7346-managed');
+ mkdirSync(join(home, '.gbrain'), { recursive: true });
+ writeFileSync(join(home, '.gbrain', 'config.json'), JSON.stringify({ engine: 'pglite', storage: { backend: 'local', bucket: 'brain-files', localPath: store } }));
+ await withEnv({ GBRAIN_HOME: home }, async () => {
+ const sourceId = `raw-${randomUUID().slice(0, 8)}`;
+ const root = join(dir, sourceId); mkdirSync(join(root, 'people'), { recursive: true });
+ const img = join(root, 'people', 'photo-7346-managed.png');
+ writeFileSync(img, 'png-bytes');
+ await engine.executeRaw('UPDATE persistence_brain SET enabled=false WHERE singleton=1');
+ await engine.executeRaw('INSERT INTO sources(id,name,local_path) VALUES($1,$1,$2)', [sourceId, root]);
+ await claimWorktree(engine, sourceId, root);
+ await engine.executeRaw('UPDATE persistence_brain SET enabled=true WHERE singleton=1');
+ await refreshManagedFilesystemRoots(engine);
+ const errSpy = spyOn(console, 'error').mockImplementation(() => {});
+ let error: unknown;
+ try { await runFiles(engine, ['upload-raw', img, '--page', 'people/alice-example']); } catch (e) { error = e; } finally { errSpy.mockRestore(); }
+ expect(error).toBeInstanceOf(OperationError);
+ expect((error as OperationError).code).toBe('writer_coordinator_required');
+ expect((error as OperationError).fix?.argv).toEqual(['gbrain', 'files', 'upload-raw', img, '--page', 'people/alice-example', '--no-pointer']);
+ expect(existsSync(join(store, 'people', 'alice-example', 'photo-7346-managed.png'))).toBe(false);
+ expect(existsSync(img + '.redirect.yaml')).toBe(false);
+ expect(await engine.executeRaw("SELECT 1 FROM files WHERE storage_path='people/alice-example/photo-7346-managed.png'")).toEqual([]);
+ });
+}, 60_000);