From 11b23b99c0d35d183ade05e596637f619eedc843 Mon Sep 17 00:00:00 2001 From: Virgil Date: Sat, 4 Apr 2026 12:05:00 +0000 Subject: [PATCH] docs(store): refine AX-oriented comments Co-Authored-By: Virgil --- compact.go | 4 ++-- doc.go | 10 +++++----- workspace.go | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/compact.go b/compact.go index b654be3..2456029 100644 --- a/compact.go +++ b/compact.go @@ -11,8 +11,8 @@ import ( var defaultArchiveOutputDirectory = ".core/archive/" -// CompactOptions selects which completed journal rows move into cold archive -// output and where the compressed file is written. +// CompactOptions archives completed journal rows before a cutoff time to a +// compressed JSONL file. // // Usage example: `options := store.CompactOptions{Before: time.Now().Add(-90 * 24 * time.Hour), Output: "/tmp/archive", Format: "gzip"}` type CompactOptions struct { diff --git a/doc.go b/doc.go index b327c14..a68b1a2 100644 --- a/doc.go +++ b/doc.go @@ -1,9 +1,9 @@ -// Package store provides SQLite-backed key-value storage for grouped entries, TTL expiry, -// namespace isolation, quota enforcement, reactive change notifications, -// workspace journalling, and explicit orphan recovery. +// Package store provides SQLite-backed key-value storage for grouped entries, +// TTL expiry, namespace isolation, quota enforcement, reactive change +// notifications, workspace journalling, and orphan recovery. // -// Workspace files are created under `.core/state/` and can be recovered with -// `RecoverOrphans(".core/state")`. +// Workspace files live under `.core/state/` and can be recovered with +// `RecoverOrphans(".core/state/")`. // // Use `store.NewConfigured(store.StoreConfig{...})` when the database path, // journal, and purge interval are already known. Prefer the struct literal diff --git a/workspace.go b/workspace.go index a29ab1b..ff8eeee 100644 --- a/workspace.go +++ b/workspace.go @@ -65,8 +65,8 @@ func (workspace *Workspace) DatabasePath() string { return workspace.databasePath } -// Close leaves the SQLite workspace file on disk so a later store instance can -// recover it as an orphan and decide whether to Commit or Discard it. +// Close keeps the workspace file on disk so `RecoverOrphans(".core/state/")` +// can reopen it later. // // Usage example: `if err := workspace.Close(); err != nil { return }; orphans := storeInstance.RecoverOrphans(".core/state"); _ = orphans` func (workspace *Workspace) Close() error { @@ -287,8 +287,8 @@ func (workspace *Workspace) Aggregate() map[string]any { return fields } -// Commit writes one journal row for the workspace through the shared journal -// writer and upserts the summary row in `workspace:NAME`. +// Commit writes one completed workspace row to the journal and upserts the +// summary entry in `workspace:NAME`. // // Usage example: `result := workspace.Commit(); if !result.OK { return }; fmt.Println(result.Value)` func (workspace *Workspace) Commit() core.Result { -- 2.45.3