[GH-ISSUE #1522] [Issue]: Long-Term Memory: after a rollback, a settings file written by the newer version can stop the package from starting #1505

Closed
opened 2026-10-22 04:02:46 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Promansis on GitHub (Oct 21, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1522

Originally assigned to: @Promansis on GitHub.

Summary

After rolling back to an older Long-Term Memory version, any settings file written by the newer version can stop the package from starting. Since 1.4.39 (#1415) the loader tolerates unknown top-level keys. It still rejects:

  • a new key inside a nested object, such as a prompt template's new field or a new mode under activePromptTemplateIdsByMode;
  • a new enum value, such as a new reasoningEffort level or a new mode in sourcesAvailabilityModes;
  • a value outside this version's range, such as a memory budget above today's maximum or a longer recall preamble.

One such value fails activation, Settings, extraction, export and saving. The fix belongs in the one shared loader. It drops what this version doesn't know or can't accept, so that setting uses its default. It logs the field names and keeps the newer values on disk.

Affected package

long-term-memory 1.4.55 (upstream/staging 8b72729f1). Measured on 1.4.54 (b1873710f); #1473 (1.4.55) changed none of the lines below. Still present on 1.4.66 (77acb942b); the only shift is in SH/schema.ts, where lines after :1324 sit two lines lower.

S = packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory
SH = packages/long-term-memory/src/engine/packages/shared/src/features/agents/long-term-memory

Expected behavior

  • A settings file written by a newer version loads. Known values are kept. A newer nested key is ignored. A newer enum value, or a value outside this version's range, falls back to its default; a list keeps its other entries.
  • The server logs which fields it ignored, by path only, never their values.
  • The newer values stay in the file for the newer version. Activation and saving the Settings page don't remove them: the page sends its whole form, so a field it sends back as shown counts as unchanged (stop words compared lowercased and without repeats, as the page saves them). A value the user changes replaces the newer one. Delete all keeps the settings files as stored.
  • When the user deletes a template, a newer mode's active choice of it is dropped too, so the newer version can still load the file.
  • Retention cleanup pauses while the retention settings hold a value this version can't use, until the newer version returns, the user resets the settings, or the user restores a backup made during the rollback (that backup holds this version's fallbacks, and restoring it makes them real). Otherwise the fallback limit (for example 180 days instead of the newer 100,000) would delete receipts, logs and drafts the user chose to keep.
  • Some things stay strict and still fail:
    • request bodies;
    • known fields with the wrong type, including a fraction where a whole number is expected, or a wrong shape;
    • a file with a different version;
    • restoring a backup made by a newer version;
    • a range fallback that would leave the file invalid. One example is a prompt template whose text is longer than the old limit: the text is required. Another is more templates than the old limit while one is active: the active choice must name a template. These fail with the range error itself, not a confusing follow-on error.

Actual behavior

  • splitUnknownLtmSettings (S/settings.ts:24-44) handles only unrecognized_keys at the root of the file (issue.path.length === 0). Every other issue goes on to schema.parse in readLtmSettingsFile (:46-53), which throws.

  • The four files the loader serves have nested strict objects and enums in SH/schema.ts:

    • config/settings.json: sourcesAvailabilityModes is a list of modes.
    • Every number, text and list field in all four files has a minimum and maximum, such as longTermMemoryBudgetTokens 128–16,384 (:79) and the retention days 1–3,650 (:1359-1366).
    • config/extraction.json: reasoningEffort, verbosity, promptTemplates[] and activePromptTemplateIdsByMode.
    • config/agent-settings.json: importSource.
    • config/retention.json.
  • Every reader fails on such a file:

    • selfCheck at activation (S/runtime.ts:15-25);
    • first-activation rewrite (S/persistence/storage.ts:244-250);
    • getLtmGlobalSettings (S/settings.ts:54-57);
    • getLtmExtractionConfig (S/extraction/extraction-config.ts:41);
    • retention (S/persistence/retention.ts:125);
    • backup export (S/persistence/backup-restore.ts:38-41).
  • The writers re-add only top-level unknown keys:

    • S/settings.ts:79;
    • S/extraction/extraction-config.ts:97-98;
    • S/persistence/storage.ts:249.

    If only the loader is fixed, the first activation (storage.ts:244-250 rewrites settings.json and retention.json) and the next save of an unrelated field would remove the newer nested values from disk.

Measurement

A private probe (27 checks) writes newer-version fixtures into temporary roots. The first fixture holds:

  • sourcesAvailabilityModes with a fourth mode "adventure";
  • reasoningEffort: "xhigh";
  • a template with a new description field;
  • activePromptTemplateIdsByMode.adventure;
  • importSource: "worldbooks";
  • unknown top-level keys.

A second fixture (checks 14a-15b) holds values outside this version's range:

  • longTermMemoryBudgetTokens: 99999;
  • longTermMemoryMaxChunks: 0;
  • a 600-character recall preamble;
  • a 100-character stop word beside a valid one;
  • maxOutputTokens: 100000;
  • receiptRetentionDays: 100000.

Two more cases are expected to keep failing: a 20,001-character template prompt, and 51 templates with one active.

For each fixture the probe activates the root, reads, saves, exports and restores.

Tree Checks passed
staging b1873710f 10 of 27
Prototype fix 27 of 27

On staging, the 17 failures include:

  • activation (too_big at sourcesAvailabilityModes, invalid_enum_value at sourcesAvailabilityModes.3);
  • every extraction read and save (invalid_enum_value at reasoningEffort, unrecognized_keys at promptTemplates.0 and at activePromptTemplateIdsByMode);
  • the agent settings read (invalid_enum_value at importSource);
  • activation with the range fixture (too_big at receiptRetentionDays), and the global settings read (too_big at longTermMemoryBudgetTokens, too_small at longTermMemoryMaxChunks, too_big at longTermMemoryStopWords.1);
  • backup export.

Seven of the 10 checks that pass on staging are guards that must keep passing:

  • request bodies stay strict, for newer and for out-of-range values;
  • wrong types, wrong shapes and a different version fail;
  • the legacy retrieval block restores;
  • newer backups are refused;
  • the two range fallbacks that would leave the file invalid still fail.

The other three (3, 9 and 14c) pass only because activation failed before it could rewrite anything, or because the request replaced the bad value.

With the prototype, these regressions pass on both trees:

  • tests/long-term-memory-storage.regression.ts (including the #1415 block);
  • -runtime;
  • -routes;
  • -routes-backup.

Strict tsc (with a local strict config) shows the same 44 errors before and after.

Steps to reproduce

  1. Stop the Engine. In the LTM data folder, edit config/extraction.json to {"version":1,"reasoningEffort":"xhigh"}, as a newer version might write it.
  2. Start the Engine. Long-Term Memory fails its activation self-check, with a Zod invalid_enum_value at reasoningEffort.
  3. Alternatively, add "description": "x" to an entry in promptTemplates. The same failure appears with unrecognized_keys at promptTemplates.0.
  4. Or set "longTermMemoryBudgetTokens": 20000 in config/settings.json, as a version with a higher limit might. Activation fails with too_big at longTermMemoryBudgetTokens.

Minimal fix

One PR, patch bump. The finished patch, developed from the prototype measured above, touches 5 source files: settings.ts grows from 82 to about 180 lines, and extraction-config.ts, storage.ts, retention.ts and backup-restore.ts change a few lines each.

  • S/settings.ts:16-53: extend splitUnknownLtmSettings to work at any depth. It runs safeParse on a copy, up to 4 passes, and acts on three kinds of issue:

    • unrecognized_keys: delete the keys. Root keys go to unknown, as today. A nested key's path is recorded in a new newer list.
    • invalid_enum_value: an object field is deleted, so its default applies. A list entry is removed. A list left with no known entries is deleted, so the field loads its default.
    • too_big and too_small, for numbers, text and list lengths: removed the same way as an enum value. They are handled only in a pass with nothing else to remove, so a list first loses its newer entries and only then has its length checked. A 4-mode list with one new mode keeps its 3 known modes; it doesn't fall back as a whole.

    If the cleaned file still fails after a range fallback, readLtmSettingsFile throws the error for the file as stored. It names the range issue (too_big at promptTemplates.0.prompt), not what the fallback caused (Required, or the active-template rule).

    Any other issue still reaches schema.parse and throws. That covers the wrong-type, wrong-shape and version cases. The warning names the root keys and the dotted paths of the newer entries once per file and set of names, never the values.

    Wrong types stay rejected, by choice. A newer version can raise a limit or add an option, and the field still means the same thing. A different type, though, would be a format change that needs a new version, and a different version is rejected anyway. So a wrong type means a damaged or hand-edited file, and quietly using the default would hide that. Zod 3 reports a fraction where a whole number is expected as invalid_type, so it stays rejected too (check 11).

    readLtmSettingsFile returns { settings, unknown, newer, raw }.

  • S/settings.ts, new withNewerLtmSettings(saved, read, request = {}, shown = {}): builds what a writer saves. It starts from {...unknown, ...saved}. Each newer value is then put back unless the request changed it. A request field equal to what readers were shown (shown, the resolved settings the GET returned) is unchanged:

    • a value inside a list comes back with its whole top-level field (raw[field]);
    • elsewhere it comes back at its own key, when that key is missing.
  • Three writers use it:

    • updateLtmGlobalSettings (S/settings.ts:65-82, write at :79), which compares stop words lowercased and without repeats, as the page saves them;
    • updateLtmExtractionConfig (S/extraction/extraction-config.ts:71-104, read at :73, write at :97-98), with the parsed patch, not the raw request, so a legacy systemPrompt request is normalized first; it then drops any active-template choice whose template is not in the saved list, so a restored newer-mode choice never names a deleted template;
    • the first-activation rewrite (S/persistence/storage.ts:248-249).
  • S/persistence/retention.ts:125: when the retention file needed repair, the run returns { ran: false, skippedNewerSettings: true } with one warning, throttled to once a day.

  • Request bodies keep their strict schemas. Backup restore (S/persistence/backup-restore.ts:128-186) stays strict, so a newer backup is still refused. Export writes only the values this version knows.

  • Delete all (S/persistence/backup-restore.ts:188-204) restores an empty export, which holds this version's fallbacks. It now reads the four settings files first and writes them back as stored into the staged vault, through a new optional stored argument of replaceLongTermMemoryData, so the newer values and the retention pause survive. The restore route passes none.

  • CHANGELOG under ## Unreleased: one bullet. It also says retention pauses and what ends the pause.

Not included

  • Range fallbacks that would leave the file invalid. The examples are a template prompt over 20,000 characters, and more than 50 templates while one is active. These still fail, with the range error. Loading them would mean dropping whole templates and the active choices that name them, which is more than a default can stand in for.
  • Restoring a backup made by a newer version. It is refused by design (#1415).
  • Restoring a backup made during the rollback. It holds the values this version ran with, so restoring it replaces the newer values with the fallbacks and ends the retention pause; documented in the CHANGELOG rather than handled.
  • An unknown longTermMemoryRecallStyle: the global schema's preprocessor (SH/schema.ts:113-122) removes it before the loader sees it, so it loads the default and is not kept (as before).
  • S/maintenance/legacy-adoption.ts:51-55. It parses the Engine's agent config, not a file a newer LTM wrote.

Regression proof

One block in tests/long-term-memory-storage.regression.ts, right after the #1415 block (:358); it fails on staging at activation (too_big at receiptRetentionDays). It ports the probe's checks:

  • activation with the newer-version fixture succeeds, and a receipt dispatched a year ago survives it (retention paused);
  • known values load, a newer enum loads its default, and a list keeps its known entries;
  • after activation, saving the whole Settings form through the real PUT /settings and PUT /extraction-settings routes, with one unrelated change or another mode's template, keeps every newer value;
  • a legacy { systemPrompt } request on a file with a newer template field saves a file that loads;
  • deleting a template through the form drops a newer mode's choice of it;
  • a stop-word list stored with capitals keeps its newer entry when the page saves it lowercased;
  • a value or list the user sets replaces the newer one;
  • the warning names the paths and contains no value;
  • a list with only newer entries loads the default and keeps the file;
  • out-of-range numbers, text and list entries load their defaults (a list keeps its valid entries), stay in the file after activation and an unrelated save, appear in the warning by path without values, and are replaced when the user sets them;
  • wrong type (including 2.5 for a whole number), wrong shape and version: 2 still fail; request bodies with a newer or out-of-range value still fail;
  • a too-long template prompt, and 51 templates with one active, still fail with too_big at that path;
  • export succeeds (also with out-of-range values, which it leaves out), its result restores, the legacy retrieval block (maxVectorCandidates) restores, and a newer backup is still refused;
  • Delete all keeps the four settings files as stored, and retention stays paused afterwards.

Environment

  • Marinara Engine version: 2.5.0 line (local staging checkout, unchanged)
  • Package version: long-term-memory 1.4.55 (upstream/staging 8b72729f1); measured on 1.4.54 (b1873710f)
  • Install type: source (probe on temporary roots)
  • OS + version: Linux, Node 24.15.0
  • Browser or app shell: n/a (server)

Logs, screenshots, or video

None. Both probe runs are summarized under Measurement; the raw results are kept privately.

Additional context

Tracker item RT-3 (runtime audit, finding 5, what remains after #1415). It extends the top-level design of #1415. The tracker counts 161 .strict() calls in the shared schemas. This fix doesn't remove any of them: they keep request bodies strict, and the loader tolerates newer values only for files.

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 @Promansis on GitHub (Oct 21, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1522 Originally assigned to: @Promansis on GitHub. ## Summary After rolling back to an older Long-Term Memory version, any settings file written by the newer version can stop the package from starting. Since 1.4.39 (#1415) the loader tolerates unknown top-level keys. It still rejects: - a new key inside a nested object, such as a prompt template's new field or a new mode under `activePromptTemplateIdsByMode`; - a new enum value, such as a new `reasoningEffort` level or a new mode in `sourcesAvailabilityModes`; - a value outside this version's range, such as a memory budget above today's maximum or a longer recall preamble. One such value fails activation, Settings, extraction, export and saving. The fix belongs in the one shared loader. It drops what this version doesn't know or can't accept, so that setting uses its default. It logs the field names and keeps the newer values on disk. ## Affected package `long-term-memory` 1.4.55 (`upstream/staging` 8b72729f1). Measured on 1.4.54 (b1873710f); #1473 (1.4.55) changed none of the lines below. Still present on 1.4.66 (77acb942b); the only shift is in `SH/schema.ts`, where lines after `:1324` sit two lines lower. `S` = `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory` `SH` = `packages/long-term-memory/src/engine/packages/shared/src/features/agents/long-term-memory` ## Expected behavior - A settings file written by a newer version loads. Known values are kept. A newer nested key is ignored. A newer enum value, or a value outside this version's range, falls back to its default; a list keeps its other entries. - The server logs which fields it ignored, by path only, never their values. - The newer values stay in the file for the newer version. Activation and saving the Settings page don't remove them: the page sends its whole form, so a field it sends back as shown counts as unchanged (stop words compared lowercased and without repeats, as the page saves them). A value the user changes replaces the newer one. Delete all keeps the settings files as stored. - When the user deletes a template, a newer mode's active choice of it is dropped too, so the newer version can still load the file. - Retention cleanup pauses while the retention settings hold a value this version can't use, until the newer version returns, the user resets the settings, or the user restores a backup made during the rollback (that backup holds this version's fallbacks, and restoring it makes them real). Otherwise the fallback limit (for example 180 days instead of the newer 100,000) would delete receipts, logs and drafts the user chose to keep. - Some things stay strict and still fail: - request bodies; - known fields with the wrong type, including a fraction where a whole number is expected, or a wrong shape; - a file with a different `version`; - restoring a backup made by a newer version; - a range fallback that would leave the file invalid. One example is a prompt template whose text is longer than the old limit: the text is required. Another is more templates than the old limit while one is active: the active choice must name a template. These fail with the range error itself, not a confusing follow-on error. ## Actual behavior - `splitUnknownLtmSettings` (`S/settings.ts:24-44`) handles only `unrecognized_keys` at the root of the file (`issue.path.length === 0`). Every other issue goes on to `schema.parse` in `readLtmSettingsFile` (`:46-53`), which throws. - The four files the loader serves have nested strict objects and enums in `SH/schema.ts`: - `config/settings.json`: `sourcesAvailabilityModes` is a list of modes. - Every number, text and list field in all four files has a minimum and maximum, such as `longTermMemoryBudgetTokens` 128–16,384 (`:79`) and the retention days 1–3,650 (`:1359-1366`). - `config/extraction.json`: `reasoningEffort`, `verbosity`, `promptTemplates[]` and `activePromptTemplateIdsByMode`. - `config/agent-settings.json`: `importSource`. - `config/retention.json`. - Every reader fails on such a file: - `selfCheck` at activation (`S/runtime.ts:15-25`); - first-activation rewrite (`S/persistence/storage.ts:244-250`); - `getLtmGlobalSettings` (`S/settings.ts:54-57`); - `getLtmExtractionConfig` (`S/extraction/extraction-config.ts:41`); - retention (`S/persistence/retention.ts:125`); - backup export (`S/persistence/backup-restore.ts:38-41`). - The writers re-add only top-level unknown keys: - `S/settings.ts:79`; - `S/extraction/extraction-config.ts:97-98`; - `S/persistence/storage.ts:249`. If only the loader is fixed, the first activation (`storage.ts:244-250` rewrites `settings.json` and `retention.json`) and the next save of an unrelated field would remove the newer nested values from disk. ### Measurement A private probe (27 checks) writes newer-version fixtures into temporary roots. The first fixture holds: - `sourcesAvailabilityModes` with a fourth mode `"adventure"`; - `reasoningEffort: "xhigh"`; - a template with a new `description` field; - `activePromptTemplateIdsByMode.adventure`; - `importSource: "worldbooks"`; - unknown top-level keys. A second fixture (checks 14a-15b) holds values outside this version's range: - `longTermMemoryBudgetTokens: 99999`; - `longTermMemoryMaxChunks: 0`; - a 600-character recall preamble; - a 100-character stop word beside a valid one; - `maxOutputTokens: 100000`; - `receiptRetentionDays: 100000`. Two more cases are expected to keep failing: a 20,001-character template prompt, and 51 templates with one active. For each fixture the probe activates the root, reads, saves, exports and restores. | Tree | Checks passed | |---|---| | `staging` b1873710f | 10 of 27 | | Prototype fix | 27 of 27 | On `staging`, the 17 failures include: - activation (`too_big at sourcesAvailabilityModes`, `invalid_enum_value at sourcesAvailabilityModes.3`); - every extraction read and save (`invalid_enum_value at reasoningEffort`, `unrecognized_keys at promptTemplates.0` and `at activePromptTemplateIdsByMode`); - the agent settings read (`invalid_enum_value at importSource`); - activation with the range fixture (`too_big at receiptRetentionDays`), and the global settings read (`too_big at longTermMemoryBudgetTokens`, `too_small at longTermMemoryMaxChunks`, `too_big at longTermMemoryStopWords.1`); - backup export. Seven of the 10 checks that pass on `staging` are guards that must keep passing: - request bodies stay strict, for newer and for out-of-range values; - wrong types, wrong shapes and a different `version` fail; - the legacy `retrieval` block restores; - newer backups are refused; - the two range fallbacks that would leave the file invalid still fail. The other three (3, 9 and 14c) pass only because activation failed before it could rewrite anything, or because the request replaced the bad value. With the prototype, these regressions pass on both trees: - `tests/long-term-memory-storage.regression.ts` (including the #1415 block); - `-runtime`; - `-routes`; - `-routes-backup`. Strict `tsc` (with a local strict config) shows the same 44 errors before and after. ## Steps to reproduce 1. Stop the Engine. In the LTM data folder, edit `config/extraction.json` to `{"version":1,"reasoningEffort":"xhigh"}`, as a newer version might write it. 2. Start the Engine. Long-Term Memory fails its activation self-check, with a Zod `invalid_enum_value` at `reasoningEffort`. 3. Alternatively, add `"description": "x"` to an entry in `promptTemplates`. The same failure appears with `unrecognized_keys at promptTemplates.0`. 4. Or set `"longTermMemoryBudgetTokens": 20000` in `config/settings.json`, as a version with a higher limit might. Activation fails with `too_big at longTermMemoryBudgetTokens`. ## Minimal fix One PR, patch bump. The finished patch, developed from the prototype measured above, touches 5 source files: `settings.ts` grows from 82 to about 180 lines, and `extraction-config.ts`, `storage.ts`, `retention.ts` and `backup-restore.ts` change a few lines each. - **`S/settings.ts:16-53`**: extend `splitUnknownLtmSettings` to work at any depth. It runs `safeParse` on a copy, up to 4 passes, and acts on three kinds of issue: - `unrecognized_keys`: delete the keys. Root keys go to `unknown`, as today. A nested key's path is recorded in a new `newer` list. - `invalid_enum_value`: an object field is deleted, so its default applies. A list entry is removed. A list left with no known entries is deleted, so the field loads its default. - `too_big` and `too_small`, for numbers, text and list lengths: removed the same way as an enum value. They are handled only in a pass with nothing else to remove, so a list first loses its newer entries and only then has its length checked. A 4-mode list with one new mode keeps its 3 known modes; it doesn't fall back as a whole. If the cleaned file still fails after a range fallback, `readLtmSettingsFile` throws the error for the file as stored. It names the range issue (`too_big at promptTemplates.0.prompt`), not what the fallback caused (`Required`, or the active-template rule). Any other issue still reaches `schema.parse` and throws. That covers the wrong-type, wrong-shape and `version` cases. The warning names the root keys and the dotted paths of the `newer` entries once per file and set of names, never the values. **Wrong types stay rejected, by choice.** A newer version can raise a limit or add an option, and the field still means the same thing. A different type, though, would be a format change that needs a new `version`, and a different `version` is rejected anyway. So a wrong type means a damaged or hand-edited file, and quietly using the default would hide that. Zod 3 reports a fraction where a whole number is expected as `invalid_type`, so it stays rejected too (check 11). `readLtmSettingsFile` returns `{ settings, unknown, newer, raw }`. - **`S/settings.ts`, new `withNewerLtmSettings(saved, read, request = {}, shown = {})`**: builds what a writer saves. It starts from `{...unknown, ...saved}`. Each newer value is then put back unless the request changed it. A request field equal to what readers were shown (`shown`, the resolved settings the GET returned) is unchanged: - a value inside a list comes back with its whole top-level field (`raw[field]`); - elsewhere it comes back at its own key, when that key is missing. - **Three writers use it:** - `updateLtmGlobalSettings` (`S/settings.ts:65-82`, write at `:79`), which compares stop words lowercased and without repeats, as the page saves them; - `updateLtmExtractionConfig` (`S/extraction/extraction-config.ts:71-104`, read at `:73`, write at `:97-98`), with the parsed `patch`, not the raw request, so a legacy `systemPrompt` request is normalized first; it then drops any active-template choice whose template is not in the saved list, so a restored newer-mode choice never names a deleted template; - the first-activation rewrite (`S/persistence/storage.ts:248-249`). - **`S/persistence/retention.ts:125`**: when the retention file needed repair, the run returns `{ ran: false, skippedNewerSettings: true }` with one warning, throttled to once a day. - Request bodies keep their strict schemas. Backup restore (`S/persistence/backup-restore.ts:128-186`) stays strict, so a newer backup is still refused. Export writes only the values this version knows. - **Delete all (`S/persistence/backup-restore.ts:188-204`)** restores an empty export, which holds this version's fallbacks. It now reads the four settings files first and writes them back as stored into the staged vault, through a new optional `stored` argument of `replaceLongTermMemoryData`, so the newer values and the retention pause survive. The restore route passes none. - **CHANGELOG under `## Unreleased`**: one bullet. It also says retention pauses and what ends the pause. **Not included** - Range fallbacks that would leave the file invalid. The examples are a template prompt over 20,000 characters, and more than 50 templates while one is active. These still fail, with the range error. Loading them would mean dropping whole templates and the active choices that name them, which is more than a default can stand in for. - Restoring a backup made by a newer version. It is refused by design (#1415). - Restoring a backup made during the rollback. It holds the values this version ran with, so restoring it replaces the newer values with the fallbacks and ends the retention pause; documented in the CHANGELOG rather than handled. - An unknown `longTermMemoryRecallStyle`: the global schema's preprocessor (`SH/schema.ts:113-122`) removes it before the loader sees it, so it loads the default and is not kept (as before). - `S/maintenance/legacy-adoption.ts:51-55`. It parses the Engine's agent config, not a file a newer LTM wrote. ## Regression proof One block in `tests/long-term-memory-storage.regression.ts`, right after the #1415 block (`:358`); it fails on `staging` at activation (`too_big at receiptRetentionDays`). It ports the probe's checks: - activation with the newer-version fixture succeeds, and a receipt dispatched a year ago survives it (retention paused); - known values load, a newer enum loads its default, and a list keeps its known entries; - after activation, saving the whole Settings form through the real `PUT /settings` and `PUT /extraction-settings` routes, with one unrelated change or another mode's template, keeps every newer value; - a legacy `{ systemPrompt }` request on a file with a newer template field saves a file that loads; - deleting a template through the form drops a newer mode's choice of it; - a stop-word list stored with capitals keeps its newer entry when the page saves it lowercased; - a value or list the user sets replaces the newer one; - the warning names the paths and contains no value; - a list with only newer entries loads the default and keeps the file; - out-of-range numbers, text and list entries load their defaults (a list keeps its valid entries), stay in the file after activation and an unrelated save, appear in the warning by path without values, and are replaced when the user sets them; - wrong type (including `2.5` for a whole number), wrong shape and `version: 2` still fail; request bodies with a newer or out-of-range value still fail; - a too-long template prompt, and 51 templates with one active, still fail with `too_big` at that path; - export succeeds (also with out-of-range values, which it leaves out), its result restores, the legacy `retrieval` block (`maxVectorCandidates`) restores, and a newer backup is still refused; - Delete all keeps the four settings files as stored, and retention stays paused afterwards. ## Environment - Marinara Engine version: 2.5.0 line (local `staging` checkout, unchanged) - Package version: long-term-memory 1.4.55 (`upstream/staging` 8b72729f1); measured on 1.4.54 (b1873710f) - Install type: source (probe on temporary roots) - OS + version: Linux, Node 24.15.0 - Browser or app shell: n/a (server) ## Logs, screenshots, or video None. Both probe runs are summarized under Measurement; the raw results are kept privately. ## Additional context Tracker item RT-3 (runtime audit, finding 5, what remains after #1415). It extends the top-level design of #1415. The tracker counts 161 `.strict()` calls in the shared schemas. This fix doesn't remove any of them: they keep request bodies strict, and the loader tolerates newer values only for files. ## 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-22 04:02:46 +07:00
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-Agents#1505
No description provided.