[agent/codex:gpt-5.4-mini] Read ~/spec/code/core/go/store/RFC.md fully. Find features d... #62

Merged
Virgil merged 1 commit from agent/read---spec-code-core-go-store-rfc-md-fu into dev 2026-04-03 07:04:48 +00:00
3 changed files with 7 additions and 16 deletions

View file

@ -146,7 +146,6 @@ func NewConfigured(config StoreConfig) (*Store, error) {
}
storeInstance.startBackgroundPurge()
storeInstance.discardRecoveredOrphans(defaultWorkspaceStateDirectory)
return storeInstance, nil
}
@ -162,7 +161,6 @@ func New(databasePath string, options ...StoreOption) (*Store, error) {
}
}
storeInstance.startBackgroundPurge()
storeInstance.discardRecoveredOrphans(defaultWorkspaceStateDirectory)
return storeInstance, nil
}

View file

@ -169,17 +169,6 @@ func (storeInstance *Store) RecoverOrphans(stateDirectory string) []*Workspace {
return orphanWorkspaces
}
func (storeInstance *Store) discardRecoveredOrphans(stateDirectory string) {
if storeInstance == nil {
return
}
for _, orphanWorkspace := range storeInstance.RecoverOrphans(stateDirectory) {
_ = orphanWorkspace.Aggregate()
orphanWorkspace.Discard()
}
}
// Usage example: `err := workspace.Put("like", map[string]any{"user": "@alice", "post": "video_123"})`
func (workspace *Workspace) Put(kind string, data map[string]any) error {
if err := workspace.ensureReady("store.Workspace.Put"); err != nil {

View file

@ -183,7 +183,7 @@ func TestWorkspace_RecoverOrphans_Good(t *testing.T) {
assert.False(t, testFilesystem().Exists(workspaceFilePath(stateDirectory, "orphan-session")))
}
func TestWorkspace_New_Good_CleansUpOrphanedWorkspaces(t *testing.T) {
func TestWorkspace_New_Good_PreservesOrphanedWorkspacesUntilRecovered(t *testing.T) {
stateDirectory := useWorkspaceStateDirectory(t)
requireCoreOK(t, testFilesystem().EnsureDir(stateDirectory))
@ -197,7 +197,11 @@ func TestWorkspace_New_Good_CleansUpOrphanedWorkspaces(t *testing.T) {
require.NoError(t, err)
defer storeInstance.Close()
assert.True(t, testFilesystem().Exists(orphanDatabasePath))
orphans := storeInstance.RecoverOrphans(stateDirectory)
require.Len(t, orphans, 1)
orphans[0].Discard()
assert.False(t, testFilesystem().Exists(orphanDatabasePath))
assert.False(t, testFilesystem().Exists(orphanDatabasePath+"-wal"))
assert.False(t, testFilesystem().Exists(orphanDatabasePath+"-shm"))
}