mirror of
https://github.com/esengine/DeepSeek-Reasonix.git
synced 2026-11-07 10:45:59 -10:00
Problem: Studio persona settings cannot select an independent tool and module combination for each conversation, or preserve that combination across reloads. Root cause: discovery and runtime construction follow mutable shared configuration without a versioned session composition or a shared admission boundary. Fix: introduce versioned scoped definitions, retained resources and authoritative session bindings. Assemble isolated runtime selections, enforce tool ceilings, pin MCP contracts, and share the lifecycle gate with first-prompt admission. Expose independent HTTP, CLI, ACP and Studio management and selection controls, with migration, native import/export, diagnostics and read-only history recovery. Verification: composition mechanism tests, provider-wire cache tests, lifecycle rollback tests, sensitive-boundary regressions, frontend typecheck and all 5,219 frontend tests; gofmt, vet, lint and repository checks. Browser light/dark wide and 390px screenshots and real Electron backend interactions are included. Refs: #13588
35 lines
1.5 KiB
Go
35 lines
1.5 KiB
Go
package pluginspec
|
|
|
|
import (
|
|
"path/filepath"
|
|
"reasonix/internal/contract/config"
|
|
"testing"
|
|
)
|
|
|
|
func TestCompositionPackagePathsRebaseWithoutMutatingSiblingSpecs(t *testing.T) {
|
|
root, private := t.TempDir(), t.TempDir()
|
|
spec := FromEntry(config.PluginEntry{Name: "docs", Command: filepath.Join(root, "server"), Args: []string{"--config=" + filepath.Join(root, "config.json")}, Env: map[string]string{"ASSET": filepath.Join(root, "asset")}}, root, Options{})
|
|
before := spec
|
|
ApplySessionPackageRoot(&spec, map[string]SessionPackageRoot{"docs": {Retained: root, Private: private}})
|
|
if spec.Command != filepath.Join(private, "server") || spec.Args[0] != "--config="+filepath.Join(private, "config.json") || spec.Env["ASSET"] != filepath.Join(private, "asset") {
|
|
t.Fatalf("private paths not applied: %+v", spec)
|
|
}
|
|
if before.Args[0] != "--config="+filepath.Join(root, "config.json") || before.Env["ASSET"] != filepath.Join(root, "asset") {
|
|
t.Fatal("sibling spec changed")
|
|
}
|
|
}
|
|
|
|
func TestCompositionSeparatesProcessStateAndSharesCredentialReference(t *testing.T) {
|
|
home := t.TempDir()
|
|
root := t.TempDir()
|
|
entry := config.PluginEntry{Name: "docs", Command: "docs-server"}
|
|
a := FromEntry(entry, root, Options{StateHome: home, ProcessScope: "session-a"})
|
|
b := FromEntry(entry, root, Options{StateHome: home, ProcessScope: "session-b"})
|
|
if a.StateDir != b.StateDir {
|
|
t.Fatal("credential reference stopped sharing its existing owner")
|
|
}
|
|
if a.ProcessStateDir == "" || a.ProcessStateDir == b.ProcessStateDir {
|
|
t.Fatal("session process state was shared")
|
|
}
|
|
}
|