MCPcopy Create free account
hub / github.com/GongShichen/LuminaCode / atomicWriteJSONL

Function atomicWriteJSONL

session/store.go:559–571  ·  view source on GitHub ↗
(path string, records []map[string]any)

Source from the content-addressed store, hash-verified

557func (s *Store) migrateLegacySession(sessionID string) {
558 mappings := []struct {
559 old string
560 new string
561 }{
562 {filepath.Join(s.dir, sessionID+".jsonl"), s.sessionPath(sessionID)},
563 {filepath.Join(s.dir, sessionID+".meta.json"), s.metaPath(sessionID)},
564 {filepath.Join(s.dir, sessionID+".state.json"), s.statePath(sessionID)},
565 {filepath.Join(s.dir, sessionID+".skill-recovery.json"), s.skillRecoveryPath(sessionID)},
566 {filepath.Join(s.dir, sessionID+".skill-recovery.commit.json"), s.skillRecoveryCommitPath(sessionID)},
567 {filepath.Join(s.dir, sessionID+".tasks.json"), s.taskRuntimePath(sessionID)},
568 {filepath.Join(s.dir, sessionID+".sqlite"), s.sqlitePath(sessionID)},
569 {filepath.Join(s.dir, sessionID+".transcript.md"), filepath.Join(s.sessionDir(sessionID), "transcript.md")},
570 }
571 for _, mapping := range mappings {
572 if _, err := os.Stat(mapping.old); err != nil {
573 continue
574 }

Callers 2

SaveMethod · 0.85
SaveWithMetaMethod · 0.85

Calls 3

marshalPythonJSONFunction · 0.85
atomicReplaceFunction · 0.85

Tested by

no test coverage detected