[GH-ISSUE #2388] [Issue]: 10-CONN-STORAGE-folder-owner-behavior folder create appends instead of prepending #1176

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

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

Originally assigned to: @Promansis on GitHub.

Summary

10-CONN-STORAGE-folder-owner-behavior: refactor creates new connection folders at the bottom of the list, while legacy creates them at the top by shifting existing folder sort orders down.

Linked parity tracker: #2384.

Expected behavior

Creating a connection folder should preserve legacy folder-owner behavior: existing folders shift down and the new folder gets sortOrder: 0.

Actual behavior

Refactor assigns the new folder max(sortOrder/order) + 1, so new folders append to the bottom unless the caller supplies an explicit order.

Steps to reproduce

  1. Create at least one connection folder.
  2. Create another connection folder without passing sortOrder.
  3. Observe the new folder sorts after existing folders instead of before them.

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 batch 4 static trace, 2026-06-06
  • Run mode: Static parityscan only
  • OS + version: not relevant
  • Node + pnpm versions: not relevant
  • Rust version, if relevant: not run
  • Remote Runtime URL configured? not relevant
  • Provider, model, or integration, if relevant: not relevant

Logs, screenshots, or video

Proof:

  • Legacy create shifts existing folders and inserts the new folder at sortOrder: 0: upstream/main:packages/server/src/services/storage/connection-folders.storage.ts:23, :31, :38.
  • Refactor create defaults to max(sortOrder/order) + 1: src-tauri/src/commands/storage/commands/entities.rs:1040, :1050, :1063.
  • Refactor UI create path passes only { name }, so it does not override the storage default: src/features/shell/connections/components/ConnectionsPanel.tsx:369, :376; src/features/catalog/connections/hooks/use-connection-folders.ts:24, :27.

Files inspected:

  • upstream/main:packages/server/src/services/storage/connection-folders.storage.ts:20-98
  • upstream/main:packages/server/src/routes/connection-folders.routes.ts:21-87
  • src-tauri/src/commands/storage/commands/entities.rs:1040-1122, :1390-1508
  • src-tauri/src/commands/storage/contracts.rs:195, :374-379
  • src/features/shell/connections/components/ConnectionsPanel.tsx:369-384
  • src/features/catalog/connections/hooks/use-connection-folders.ts:24-30

Regression notes

Legacy source is upstream/main. The confirmed parity gap is limited to default placement for newly created connection folders. Folder move validation, reorder validation, and unfile-on-delete behavior were present in refactor during the same scan.

Additional context

Acceptance criteria:

  • Creating a connection folder without explicit ordering places it at the top with sortOrder: 0.
  • Existing connection folders shift down consistently, preserving stable ordering.
  • Refactor still preserves current validation, reorder, move, and unfile-on-delete behavior.
  • Static or focused storage proof covers the legacy top-insert behavior and the no-overwrite paths for unrelated connection rows.

Surface ID: 10-CONN-STORAGE-folder-owner-behavior.

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 6, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2388 Originally assigned to: @Promansis on GitHub. ## Summary `10-CONN-STORAGE-folder-owner-behavior`: refactor creates new connection folders at the bottom of the list, while legacy creates them at the top by shifting existing folder sort orders down. Linked parity tracker: #2384. ## Expected behavior Creating a connection folder should preserve legacy folder-owner behavior: existing folders shift down and the new folder gets `sortOrder: 0`. ## Actual behavior Refactor assigns the new folder `max(sortOrder/order) + 1`, so new folders append to the bottom unless the caller supplies an explicit order. ## Steps to reproduce 1. Create at least one connection folder. 2. Create another connection folder without passing `sortOrder`. 3. Observe the new folder sorts after existing folders instead of before them. ## Impact area - [ ] 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 - [ ] Professor Mari or shell tools - [ ] 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 batch 4 static trace, 2026-06-06 - Run mode: Static parityscan only - OS + version: not relevant - Node + pnpm versions: not relevant - Rust version, if relevant: not run - Remote Runtime URL configured? not relevant - Provider, model, or integration, if relevant: not relevant ## Logs, screenshots, or video Proof: - Legacy create shifts existing folders and inserts the new folder at `sortOrder: 0`: `upstream/main:packages/server/src/services/storage/connection-folders.storage.ts:23`, `:31`, `:38`. - Refactor create defaults to `max(sortOrder/order) + 1`: `src-tauri/src/commands/storage/commands/entities.rs:1040`, `:1050`, `:1063`. - Refactor UI create path passes only `{ name }`, so it does not override the storage default: `src/features/shell/connections/components/ConnectionsPanel.tsx:369`, `:376`; `src/features/catalog/connections/hooks/use-connection-folders.ts:24`, `:27`. Files inspected: - `upstream/main:packages/server/src/services/storage/connection-folders.storage.ts:20-98` - `upstream/main:packages/server/src/routes/connection-folders.routes.ts:21-87` - `src-tauri/src/commands/storage/commands/entities.rs:1040-1122`, `:1390-1508` - `src-tauri/src/commands/storage/contracts.rs:195`, `:374-379` - `src/features/shell/connections/components/ConnectionsPanel.tsx:369-384` - `src/features/catalog/connections/hooks/use-connection-folders.ts:24-30` ## Regression notes Legacy source is `upstream/main`. The confirmed parity gap is limited to default placement for newly created connection folders. Folder move validation, reorder validation, and unfile-on-delete behavior were present in refactor during the same scan. ## Additional context Acceptance criteria: - Creating a connection folder without explicit ordering places it at the top with `sortOrder: 0`. - Existing connection folders shift down consistently, preserving stable ordering. - Refactor still preserves current validation, reorder, move, and unfile-on-delete behavior. - Static or focused storage proof covers the legacy top-insert behavior and the no-overwrite paths for unrelated connection rows. Surface ID: `10-CONN-STORAGE-folder-owner-behavior`. ## 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:28:22 +07:00
  • closed this issue
  • added the
    bug
    label
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#1176
No description provided.