[GH-ISSUE #2262] [Issue]: 08-PRESET-COMPAT-default-alias-write-paths prompt default alias write paths #1102

Closed
opened 2026-10-21 05:26:41 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Promansis on GitHub (Jun 5, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2262

Originally assigned to: @Xelvanis on GitHub.

Summary

Surface 08-PRESET-COMPAT-default-alias-write-paths: prompt preset write paths only partially normalize the legacy-compatible default flag to canonical isDefault. Refactor update paths normalize the alias, but create/profile/import paths can persist or ignore default without copying it into isDefault.

Expected behavior

Prompt preset create, profile import, and native/ST import paths should normalize default to isDefault when isDefault is absent, reject contradictory default/isDefault values, or otherwise store one consistent default flag for prompt presets.

Actual behavior

The refactor update schema accepts default and transforms it to isDefault, but Rust storage defaults for prompts only add isDefault. A payload with default: true and no isDefault can be stored with isDefault: false plus default: true, and read paths that use isDefault ?? default can then treat the row as non-default even though the alias was true.

Steps to reproduce

  1. Import or create a prompt preset payload on the refactor path with default: true and no isDefault.
  2. Inspect the stored prompts row after Rust with_entity_defaults("prompts", ...) normalization.
  3. Observe that isDefault is defaulted independently instead of inheriting the default alias.

Impact area

  • App shell, navigation, startup, or providers
  • Catalog resources
  • Chat mode
  • Roleplay mode
  • Game mode
  • Shared mode UI
  • Runtime systems: generation, world-state, visuals, tracker, or haptics
  • Professor Mari or shell tools
  • React-free engine behavior, contracts, agents, or capability ports
  • Shared API wrapper or remote runtime routing
  • Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime
  • Docs, contributor workflow, or templates

Environment

  • Branch or commit: refactor static trace, local checkout tracking upstream/refactor
  • Run mode: not run; static parity trace only
  • OS + version: not relevant
  • Node + pnpm versions: not run
  • Rust version, if relevant: not run
  • Remote Runtime URL configured? not relevant
  • Provider, model, or integration, if relevant: not relevant

Logs, screenshots, or video

Parity proof from Target 8 batch, linked from #2259:

  • Legacy behavior: legacy prompt preset storage writes canonical isDefault on create and setDefault; no prompt default alias was found in the legacy prompt preset schema.
  • Refactor behavior: updatePromptPresetSchema accepts default and maps it to isDefault, but createPromptPresetSchema has only isDefault; Rust prompt defaults add only isDefault; profile import normalizes typed JSON fields but does not copy prompt default into isDefault.
  • Files inspected:
    • src/engine/contracts/schemas/prompt.schema.ts
    • src/features/catalog/presets/components/CreatePresetModal.tsx
    • src/features/catalog/presets/hooks/use-presets.ts
    • src/engine/generation/prompt-assembly.ts
    • src-tauri/src/commands/storage/contracts.rs
    • src-tauri/src/commands/storage/shared.rs
    • src-tauri/src/commands/storage/profile.rs
    • src-tauri/src/commands/storage/imports/marinara.rs
    • src-tauri/src/commands/storage/imports/st_preset.rs
    • legacy main:packages/shared/src/schemas/prompt.schema.ts
    • legacy main:packages/server/src/services/storage/prompts.storage.ts
    • legacy main:packages/server/src/routes/prompts.routes.ts
    • legacy main:packages/server/src/services/import/marinara.importer.ts

Regression notes

This is a confirmed parity gap from upstream parity tracker issue #2259 for 08-PRESET-COMPAT-default-alias-write-paths. Target 1 covered update/default lookup only; this issue tracks the missing create/profile/import write-path normalization.

Additional context

Acceptance criteria:

  • Prompt preset create path treats default as an alias for isDefault when isDefault is absent.
  • Prompt preset profile import path normalizes default/isDefault consistently before replacing prompts.
  • Prompt preset native/ST import paths cannot persist contradictory default and isDefault values.
  • Default-preset lookup remains compatible with legacy rows that already contain only default.
  • Focused proof covers positive alias normalization and a negative contradictory-flags case.

Linked tracker: #2259.

Template check

Please uncheck 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 (Jun 5, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2262 Originally assigned to: @Xelvanis on GitHub. ## Summary Surface `08-PRESET-COMPAT-default-alias-write-paths`: prompt preset write paths only partially normalize the legacy-compatible `default` flag to canonical `isDefault`. Refactor update paths normalize the alias, but create/profile/import paths can persist or ignore `default` without copying it into `isDefault`. ## Expected behavior Prompt preset create, profile import, and native/ST import paths should normalize `default` to `isDefault` when `isDefault` is absent, reject contradictory `default`/`isDefault` values, or otherwise store one consistent default flag for prompt presets. ## Actual behavior The refactor update schema accepts `default` and transforms it to `isDefault`, but Rust storage defaults for `prompts` only add `isDefault`. A payload with `default: true` and no `isDefault` can be stored with `isDefault: false` plus `default: true`, and read paths that use `isDefault ?? default` can then treat the row as non-default even though the alias was true. ## Steps to reproduce 1. Import or create a prompt preset payload on the refactor path with `default: true` and no `isDefault`. 2. Inspect the stored `prompts` row after Rust `with_entity_defaults("prompts", ...)` normalization. 3. Observe that `isDefault` is defaulted independently instead of inheriting the `default` alias. ## Impact area <!-- Check the areas you think are relevant. Leave uncertain items unchecked. --> - [ ] App shell, navigation, startup, or providers - [x] Catalog resources - [ ] Chat mode - [ ] Roleplay mode - [ ] Game mode - [ ] Shared mode UI - [ ] Runtime systems: generation, world-state, visuals, tracker, or haptics - [x] Professor Mari or shell tools - [x] React-free engine behavior, contracts, agents, or capability ports - [ ] Shared API wrapper or remote runtime routing - [x] Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime - [ ] Docs, contributor workflow, or templates ## Environment - Branch or commit: `refactor` static trace, local checkout tracking `upstream/refactor` - Run mode: not run; static parity trace only - OS + version: not relevant - Node + pnpm versions: not run - Rust version, if relevant: not run - Remote Runtime URL configured? not relevant - Provider, model, or integration, if relevant: not relevant ## Logs, screenshots, or video Parity proof from Target 8 batch, linked from #2259: - Legacy behavior: legacy prompt preset storage writes canonical `isDefault` on create and `setDefault`; no prompt `default` alias was found in the legacy prompt preset schema. - Refactor behavior: `updatePromptPresetSchema` accepts `default` and maps it to `isDefault`, but `createPromptPresetSchema` has only `isDefault`; Rust prompt defaults add only `isDefault`; profile import normalizes typed JSON fields but does not copy prompt `default` into `isDefault`. - Files inspected: - `src/engine/contracts/schemas/prompt.schema.ts` - `src/features/catalog/presets/components/CreatePresetModal.tsx` - `src/features/catalog/presets/hooks/use-presets.ts` - `src/engine/generation/prompt-assembly.ts` - `src-tauri/src/commands/storage/contracts.rs` - `src-tauri/src/commands/storage/shared.rs` - `src-tauri/src/commands/storage/profile.rs` - `src-tauri/src/commands/storage/imports/marinara.rs` - `src-tauri/src/commands/storage/imports/st_preset.rs` - legacy `main:packages/shared/src/schemas/prompt.schema.ts` - legacy `main:packages/server/src/services/storage/prompts.storage.ts` - legacy `main:packages/server/src/routes/prompts.routes.ts` - legacy `main:packages/server/src/services/import/marinara.importer.ts` ## Regression notes This is a confirmed parity gap from upstream parity tracker issue #2259 for `08-PRESET-COMPAT-default-alias-write-paths`. Target 1 covered update/default lookup only; this issue tracks the missing create/profile/import write-path normalization. ## Additional context Acceptance criteria: - Prompt preset create path treats `default` as an alias for `isDefault` when `isDefault` is absent. - Prompt preset profile import path normalizes `default`/`isDefault` consistently before replacing `prompts`. - Prompt preset native/ST import paths cannot persist contradictory `default` and `isDefault` values. - Default-preset lookup remains compatible with legacy rows that already contain only `default`. - Focused proof covers positive alias normalization and a negative contradictory-flags case. Linked tracker: #2259. ## Template check Please uncheck 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:26:41 +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-Engine#1102
No description provided.