[GH-ISSUE #5013] [Issue]: Storage manifest desync hides addEntry and later multi-row writes #2773

Closed
opened 2026-10-21 05:55:12 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @SpicyMarinara on GitHub (Aug 14, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5013

Originally assigned to: @SpicyMarinara on GitHub.

Summary

Successful lorebook writes are persisted in the table file but are not added to storage/manifest.json, so the app continues serving an older state. Single-entry addEntry writes consistently become invisible, and later multi-row creates can also stop being visible.

Expected behavior

Successful lorebook writes should update the storage manifest and remain visible through lorebook.entries and lorebook.list after verification and server restarts.

Actual behavior

lorebook.addEntry returns saved: true and writes rows to lorebook_entries.json, but the corresponding manifest head is missing and the app serves the pre-write state. Repeated attempts create duplicate orphan rows. A later 11-entry lorebook.create also reported success but was not visible through lorebook.list.

Steps to reproduce

  1. Create a lorebook with several entries using lorebook.create and confirm that the entries are visible.
  2. Add a single entry using lorebook.addEntry.
  3. Confirm that the operation reports success and inspect lorebook.entries; the added entry may appear once in a verification read but is subsequently absent.
  4. Inspect packages/server/data/storage/tables/lorebook_entries.json and confirm that the new row exists.
  5. Inspect packages/server/data/storage/manifest.json and confirm that the lorebook_entries head list does not include the new row's head and that manifest.updatedAt predates the write.
  6. Restart the server and verify that the new entry remains unavailable.
  7. Repeat the write or create a larger lorebook with lorebook.create to observe duplicate orphan rows and, later in the session, a successful create that is not visible through lorebook.list.

Environment

  • Marinara Engine version: 2.4.1 and 2.4.2 stable
  • Install type: local install
  • OS + version: macOS Tahoe 26.6.1
  • Browser or app shell: Not provided

Logs, screenshots, or video

No screenshots or video provided. Evidence is in packages/server/data/storage/manifest.json, packages/server/data/storage/tables/lorebook_entries.json, and packages/server/data/storage/journal/. Journal entries exist for the ghosted writes.

Additional context

Observed during a long Home-screen assistant session on Aug 12–13, 2026. The server data directory was packages/server/data. lorebook.create with small or medium entry sets, lorebook.update for renames, and lorebook.updateEntry worked and synced the manifest; lorebook.addEntry ghosted on 5+ attempts. Restarting the server did not reconcile the manifest head. Users can silently lose visibility of saved work and create duplicate orphan rows.

Discord thread: Bug: storage manifest desync: addEntry and later multi-row create writes become invisible to the app
Discord thread link: https://discord.com/channels/1417099416812392641/1537689546303479909
Requested by: Marinara (marinara_spaghetti, Discord ID 169561011928432653)

Discord thread transcript (2 messages)
[2026-08-14T05:09:16.729Z] meow meow beep boop: (Thank you Prof Mari for helping me write this.)

Environment:
Marinara Engine (local install on macOS Tahoe 26.6.1), server data dir: `packages/server/data`
Observed over a long Home-screen assistant session, Aug 12–13 2026 (in both 2.4.1 and 2.4.2 stable)

Summary:
Lorebook entry writes report success (API returns `saved: true`, rows exist in the table file) but never become visible in the app. Reads keep returning an older state. Restarting the server does not fix it. Hand-checking the storage files shows the table file contains the new rows, but `storage/manifest.json ` never advances to include them.

Reproduction:
Create a lorebook with several entries via the assistant's `lorebook.create` (this worked — all entries visible).
Later, add a single entry via `lorebook.addEntry`.
The add returns success and a verification read may even show it once, but afterwards the entry is gone from the app: `lorebook.entries` returns the pre-add set only.
Inspect `packages/server/data/storage/tables/lorebook_entries.json` — the new row IS present (in my case the same entry exists 3 times from 3 attempts).
Inspect `packages/server/data/storage/manifest.json` — the head list for `lorebook_entries` does NOT include the new row's head. Manifest updatedAt predates the write.
Rebuilding the whole lorebook via `lorebook.create` (10 entries, atomic) worked and synced; a subsequent single `addEntry` ghosted again the same way; a second `lorebook.create` (11 entries) reported success but the new lorebook row itself never became visible to `lorebook.list` after that.

What works vs. what ghosts:
`lorebook.create` (small/medium) — works, syncs manifest.
`lorebook.update` (rename) — works.
`lorebook.updateEntry` — works.
`lorebook.addEntry `— ALWAYS ghosts (5+ attempts, 0 visible).
`lorebook.create` (11 entries, later in session) — reported success, never became visible.
[Discord message: https://discord.com/channels/1417099416812392641/1537689546303479909/1537689546303479909]

[2026-08-14T05:09:19.394Z] meow meow beep boop: Evidence:
`packages/server/data/storage/manifest.json` — entry-table heads stop at the create-time set; later writes absent.
`packages/server/data/storage/tables/lorebook_entries.json` — contains orphaned rows the app never serves.
`packages/server/data/storage/journal/` — has journal entries for the ghosted writes.
Server restart does not reconcile the head.

Impact:
Data written through `addEntry` is permanently invisible while remaining on disk; users silently lose work and retry, creating duplicate orphan rows. Long sessions degrade further until even creates stop being visible.
[Discord message: https://discord.com/channels/1417099416812392641/1537689546303479909/1537689557481422929]

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @SpicyMarinara on GitHub (Aug 14, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5013 Originally assigned to: @SpicyMarinara on GitHub. ## Summary Successful lorebook writes are persisted in the table file but are not added to storage/manifest.json, so the app continues serving an older state. Single-entry addEntry writes consistently become invisible, and later multi-row creates can also stop being visible. ## Expected behavior Successful lorebook writes should update the storage manifest and remain visible through lorebook.entries and lorebook.list after verification and server restarts. ## Actual behavior lorebook.addEntry returns saved: true and writes rows to lorebook_entries.json, but the corresponding manifest head is missing and the app serves the pre-write state. Repeated attempts create duplicate orphan rows. A later 11-entry lorebook.create also reported success but was not visible through lorebook.list. ## Steps to reproduce 1. Create a lorebook with several entries using lorebook.create and confirm that the entries are visible. 2. Add a single entry using lorebook.addEntry. 3. Confirm that the operation reports success and inspect lorebook.entries; the added entry may appear once in a verification read but is subsequently absent. 4. Inspect packages/server/data/storage/tables/lorebook_entries.json and confirm that the new row exists. 5. Inspect packages/server/data/storage/manifest.json and confirm that the lorebook_entries head list does not include the new row's head and that manifest.updatedAt predates the write. 6. Restart the server and verify that the new entry remains unavailable. 7. Repeat the write or create a larger lorebook with lorebook.create to observe duplicate orphan rows and, later in the session, a successful create that is not visible through lorebook.list. ## Environment - Marinara Engine version: 2.4.1 and 2.4.2 stable - Install type: local install - OS + version: macOS Tahoe 26.6.1 - Browser or app shell: Not provided ## Logs, screenshots, or video No screenshots or video provided. Evidence is in packages/server/data/storage/manifest.json, packages/server/data/storage/tables/lorebook_entries.json, and packages/server/data/storage/journal/. Journal entries exist for the ghosted writes. ## Additional context Observed during a long Home-screen assistant session on Aug 12–13, 2026. The server data directory was packages/server/data. lorebook.create with small or medium entry sets, lorebook.update for renames, and lorebook.updateEntry worked and synced the manifest; lorebook.addEntry ghosted on 5+ attempts. Restarting the server did not reconcile the manifest head. Users can silently lose visibility of saved work and create duplicate orphan rows. Discord thread: Bug: storage manifest desync: addEntry and later multi-row create writes become invisible to the app Discord thread link: https://discord.com/channels/1417099416812392641/1537689546303479909 Requested by: Marinara (marinara_spaghetti, Discord ID 169561011928432653) <details> <summary>Discord thread transcript (2 messages)</summary> ```text [2026-08-14T05:09:16.729Z] meow meow beep boop: (Thank you Prof Mari for helping me write this.) Environment: Marinara Engine (local install on macOS Tahoe 26.6.1), server data dir: `packages/server/data` Observed over a long Home-screen assistant session, Aug 12–13 2026 (in both 2.4.1 and 2.4.2 stable) Summary: Lorebook entry writes report success (API returns `saved: true`, rows exist in the table file) but never become visible in the app. Reads keep returning an older state. Restarting the server does not fix it. Hand-checking the storage files shows the table file contains the new rows, but `storage/manifest.json ` never advances to include them. Reproduction: Create a lorebook with several entries via the assistant's `lorebook.create` (this worked — all entries visible). Later, add a single entry via `lorebook.addEntry`. The add returns success and a verification read may even show it once, but afterwards the entry is gone from the app: `lorebook.entries` returns the pre-add set only. Inspect `packages/server/data/storage/tables/lorebook_entries.json` — the new row IS present (in my case the same entry exists 3 times from 3 attempts). Inspect `packages/server/data/storage/manifest.json` — the head list for `lorebook_entries` does NOT include the new row's head. Manifest updatedAt predates the write. Rebuilding the whole lorebook via `lorebook.create` (10 entries, atomic) worked and synced; a subsequent single `addEntry` ghosted again the same way; a second `lorebook.create` (11 entries) reported success but the new lorebook row itself never became visible to `lorebook.list` after that. What works vs. what ghosts: `lorebook.create` (small/medium) — works, syncs manifest. `lorebook.update` (rename) — works. `lorebook.updateEntry` — works. `lorebook.addEntry `— ALWAYS ghosts (5+ attempts, 0 visible). `lorebook.create` (11 entries, later in session) — reported success, never became visible. [Discord message: https://discord.com/channels/1417099416812392641/1537689546303479909/1537689546303479909] [2026-08-14T05:09:19.394Z] meow meow beep boop: Evidence: `packages/server/data/storage/manifest.json` — entry-table heads stop at the create-time set; later writes absent. `packages/server/data/storage/tables/lorebook_entries.json` — contains orphaned rows the app never serves. `packages/server/data/storage/journal/` — has journal entries for the ghosted writes. Server restart does not reconcile the head. Impact: Data written through `addEntry` is permanently invisible while remaining on disk; users silently lose work and retry, creating duplicate orphan rows. Long sessions degrade further until even creates stop being visible. [Discord message: https://discord.com/channels/1417099416812392641/1537689546303479909/1537689557481422929] ``` </details> ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 05:55:12 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@SpicyMarinara commented on GitHub (Aug 14, 2026):

Ownership: @SpicyMarinara / Codex reproduced the reported forensic shape with two live writers sharing one data directory. Work is proceeding on hotfix/5013-storage-single-writer; a draft PR targeting staging is being opened before implementation. The fix will preserve storage capacity and existing lorebook behavior while preventing stale writers from overwriting newer snapshots.

<!-- gh-comment-id:5290966090 --> @SpicyMarinara commented on GitHub (Aug 14, 2026): Ownership: @SpicyMarinara / Codex reproduced the reported forensic shape with two live writers sharing one data directory. Work is proceeding on `hotfix/5013-storage-single-writer`; a draft PR targeting `staging` is being opened before implementation. The fix will preserve storage capacity and existing lorebook behavior while preventing stale writers from overwriting newer snapshots.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#2773
No description provided.