Merge pull request '[agent/codex:gpt-5.4-mini] Read ~/spec/code/core/go/store/RFC.md fully. Find features d...' (#65) from agent/read---spec-code-core-go-store-rfc-md-fu into dev
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run

This commit is contained in:
Virgil 2026-04-03 07:17:55 +00:00
commit fb2ef6fde0

View file

@ -32,7 +32,7 @@ FROM workspace_entries`
var defaultWorkspaceStateDirectory = ".core/state"
// Workspace is a named SQLite buffer for mutable work-in-progress.
// Workspace buffers mutable work-in-progress in a temporary SQLite file.
//
// Usage example: `workspace, err := storeInstance.NewWorkspace("scroll-session-2026-03-30"); if err != nil { return }; defer workspace.Discard()`
type Workspace struct {
@ -109,8 +109,8 @@ func (storeInstance *Store) NewWorkspace(name string) (*Workspace, error) {
}, nil
}
// RecoverOrphans opens leftover workspace files in a state directory so
// callers can inspect them before calling Discard().
// RecoverOrphans(".core/state") returns orphaned workspaces such as
// `scroll-session.duckdb` so callers can inspect Aggregate() and then Discard().
// Usage example: `orphans := storeInstance.RecoverOrphans(".core/state")`
func (storeInstance *Store) RecoverOrphans(stateDirectory string) []*Workspace {
if storeInstance == nil {
@ -212,8 +212,8 @@ func (workspace *Workspace) Aggregate() map[string]any {
return fields
}
// Commit writes the aggregated workspace state to the journal and updates the
// store summary entry for the workspace.
// Commit writes one journal point for the workspace and upserts the summary
// row in `workspace:NAME`.
// Usage example: `result := workspace.Commit()`
func (workspace *Workspace) Commit() core.Result {
if err := workspace.ensureReady("store.Workspace.Commit"); err != nil {